Module: Puer

Defined in:
lib/puer.rb,
lib/puer/view.rb,
lib/puer/tasks.rb,
lib/puer/command.rb,
lib/puer/utility.rb,
lib/puer/version.rb,
lib/puer/generators/cli.rb,
lib/puer/generators/jam.rb,
lib/puer/generators/xib.rb,
lib/puer/generators/gist.rb,
lib/puer/generators/help.rb,
lib/puer/generators/model.rb,
lib/puer/generators/search.rb,
lib/puer/generators/actions.rb,
lib/puer/generators/controller.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 puer bin or exec it using Kernel#system with the given args



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

def self.bin(*args)
  @_puer_bin ||= [self.ruby_command, File.expand_path("../../../bin/puer", __FILE__)]
  args.empty? ? @_puer_bin : system(args.unshift(@_puer_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



18
19
20
21
# File 'lib/puer.rb', line 18

def self.bin_gen(*args)
  @_mvc_gen_bin ||= [IphoneMvc.ruby_command, File.expand_path("../bin/puer", __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/puer/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