In Files

Class/Module Index [+]

Quicksearch

Ramaze

Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.



Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Dictionary

The Dictionary class is a Hash that preserves order. So it has some array-like extensions also. By defualt a Dictionary object preserves insertion order, but any order can be specified including alphabetical key order.

Usage

Just require this file and use Dictionary instead of Hash.

# You can do simply
hsh = Dictionary.new
hsh['z'] = 1
hsh['a'] = 2
hsh['c'] = 3
p hsh.keys     #=> ['z','a','c']

# or using Dictionary[] method
hsh = Dictionary['z', 1, 'a', 2, 'c', 3]
p hsh.keys     #=> ['z','a','c']

# but this don't preserve order
hsh = Dictionary['z'=>1, 'a'=>2, 'c'=>3]
p hsh.keys     #=> ['a','c','z']

# Dictionary has useful extensions: push, pop and unshift
p hsh.push('to_end', 15)       #=> true, key added
p hsh.push('to_end', 30)       #=> false, already - nothing happen
p hsh.unshift('to_begin', 50)  #=> true, key added
p hsh.unshift('to_begin', 60)  #=> false, already - nothing happen
p hsh.keys                     #=> ["to_begin", "a", "c", "z", "to_end"]
p hsh.pop                      #=> ["to_end", 15], if nothing remains, return nil
p hsh.keys                     #=> ["to_begin", "a", "c", "z"]
p hsh.shift                    #=> ["to_begin", 30], if nothing remains, return nil

Usage Notes


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com

All files in this distribution are subject to the terms of the Ruby license.


Namespace for Ramaze

THINK:

* for now, we don't extend this with Innate to keep things clean. But we
  should eventually do it for a simple API, or people always have to find
  out whether something is in Innate or Ramaze.
  No matter which way we go, we should keep references point to the
  original location to avoid too much confusion for core developers.

Constants

AppMap

An application is a collection of controllers and options that have a common name. Every application has a location it dispatches from, this behaves similar to Rack::URLMap.

Cache
DEPENDENCIES

Array containing the names and versions of all the gems required by Ramaze along with the name of how the gem should be required.

DEPRECATED_CONSTANTS
DEVELOPMENT_DEPENDENCIES

Array containing all the development dependencies.

Helper
Log
OpenIDStore

Constant for storing meta-information persistent

ROOT
UNSUPPORTED_GEMS

Array containing gems that aren't supported for certain reasons. The gems that are in this array by default will be removed if the current setup does support them.

VERSION
View

Attributes

options[RW]

Public Class Methods

acquire(*globs) click to toggle source

Require all .rb and .so files on the given globs, utilizes Dir::[].

Examples:

# Given following directory structure:
# src/foo.rb
# src/bar.so
# src/foo.yaml
# src/foobar/baz.rb
# src/foobar/README

# requires all files in 'src':
Ramaze.acquire 'src/*'

# requires all files in 'src' recursive:
Ramaze.acquire 'src/**/*'

# require 'src/foo.rb' and 'src/bar.so' and 'src/foobar/baz.rb'
Ramaze.acquire 'src/*', 'src/foobar/*'
# File lib/ramaze/snippets/ramaze/acquire.rb, line 25
def self.acquire(*globs)
  globs.flatten.each do |glob|
    Dir[glob].each do |file|
      require file if file =~ /\.(rb|so)$/
    end
  end
end
const_missing(name) click to toggle source
# File lib/ramaze/snippets/ramaze/deprecated.rb, line 15
def self.const_missing(name)
  if to = DEPRECATED_CONSTANTS[name]
    Log.warn "Ramaze::#{name} is deprecated, use #{to} instead"
    constant(to)
  else
    super
  end
end
deprecated(from, to = nil) click to toggle source
# File lib/ramaze/snippets/ramaze/deprecated.rb, line 8
def self.deprecated(from, to = nil)
  message = "%s is deprecated"
  message << ", use %s instead" unless to.nil?
  message << " - from: %p"
  Log.warn(message % [from, to, caller[1]])
end
plugin(name, options = {}) click to toggle source
# File lib/ramaze/plugin.rb, line 5
def self.plugin(name, options = {})
  Plugin.load(name, options)
end
setup(options = {:verbose => true}, &block) click to toggle source

Convenient setup and activation of gems from different sources and specific versions. It's almost like Kernel#gem but also installs automatically if a gem is missing.

@example

Ramaze.setup :verbose => true do
  # gem and specific version
  gem 'makura', '>=2009.01'

  # gem and name for require
  gem 'aws-s3', :lib => 'aws/s3'

  # gem with specific version from rubyforge (default)
  gem 'json', :version => '=1.1.3', :source => rubyforge
end

@author manveru @since 19-05-2009 @see GemSetup#initialize

# File lib/ramaze/setup.rb, line 23
def self.setup(options = {:verbose => true}, &block)
  GemSetup.new(options, &block)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.