Class: Ramaze::SetupEnvironment

Inherits:
Object
  • Object
show all
Defined in:
lib/ramaze/setup.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ SetupEnvironment

FIXME:

  • This is weird, class scope includes Global, yet it’s skipped by Ruby on the lookup only because it’s not in the scope of the block at the point of creation, shouldn’t instance_eval take the binding of the SetupEnvironment instance in acocunt?



14
15
16
# File 'lib/ramaze/setup.rb', line 14

def initialize(&block)
  instance_eval(&block)
end

Instance Method Details

#gem(*args) ⇒ Object

Shortcut for Ramaze::Gems::gem



19
20
21
22
23
# File 'lib/ramaze/setup.rb', line 19

def gem(*args)
  require 'ramaze/contrib/gems'
  Ramaze::Gems::gem(*args)
  Ramaze::Gems::setup
end

#gems(*args) ⇒ Object

Shortcut if you don’t need specific versions but tons of gems



26
27
28
# File 'lib/ramaze/setup.rb', line 26

def gems(*args)
  gems.each{|g| gem(g) }
end

#global(hash = nil) ⇒ Object Also known as: option



30
31
32
33
34
35
36
# File 'lib/ramaze/setup.rb', line 30

def global(hash = nil)
  if hash
    Global.merge!(hash)
  else
    Global
  end
end