Module: Candle

Defined in:
lib/candle.rb,
lib/candle/view.rb,
lib/candle/tasks.rb,
lib/candle/command.rb,
lib/candle/utility.rb,
lib/candle/version.rb,
lib/candle/generators/cli.rb,
lib/candle/generators/jam.rb,
lib/candle/generators/map.rb,
lib/candle/generators/xib.rb,
lib/candle/generators/help.rb,
lib/candle/generators/blank.rb,
lib/candle/generators/table.rb,
lib/candle/generators/actions.rb

Defined Under Namespace

Modules: Generators, Tasks, Utility, Version, View

Class Method Summary collapse

Class Method Details

.bin(*args) ⇒ Object

This method return the correct location of candle bin or exec it using Kernel#system with the given args



8
9
10
11
# File 'lib/candle/command.rb', line 8

def self.bin(*args)
  @_candle_bin ||= [self.ruby_command, File.expand_path("../../../bin/candle", __FILE__)]
  args.empty? ? @_candle_bin : system(args.unshift(@_candle_bin).join(" "))
end

.bin_gen(*args) ⇒ Object

This method return the correct location of mvc-gen bin or exec it using Kernel#system with the given args



16
17
18
19
# File 'lib/candle.rb', line 16

def self.bin_gen(*args)
  @_mvc_gen_bin ||= [IphoneMvc.ruby_command, File.expand_path("../bin/candle", __FILE__)]
  args.empty? ? @_mvc_gen_bin : system(args.unshift(@_mvc_gen_bin).join(" "))
end

.ruby_commandObject

Return the path to the ruby interpreter taking into account multiple installations and windows extensions.



17
18
19
20
21
22
23
24
25
26
# File 'lib/candle/command.rb', line 17

def self.ruby_command
  @ruby_command ||= begin
    ruby = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
    ruby << Config::CONFIG['EXEEXT']

    # escape string in case path to ruby executable contain spaces.
    ruby.sub!(/.*\s.*/m, '"\&"')
    ruby
  end
end