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) 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) 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) 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.
Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
All files in this distribution are subject to the terms of the Ruby license.
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.
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
You can use order_by to set internal sort order.
#<< takes a two element [k,v] array and inserts.
Use ::auto which creates Dictionay sub-entries as needed.
And ::alpha which creates a new Dictionary sorted by key.
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.
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.
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.
Array containing the names and versions of all the gems required by Ramaze along with the name of how the gem should be required.
Array containing all the development dependencies.
Constant for storing meta-information persistent
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.
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
# 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
# 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
# File lib/ramaze/plugin.rb, line 5 def self.plugin(name, options = {}) Plugin.load(name, options) end
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
Generated with the Darkfish Rdoc Generator 2.