Module: Appjam

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



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

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



11
12
13
14
# File 'lib/appjam.rb', line 11

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