Sha256: 262756fe9bd2015d9a2a4f7de296ec6422d567690b48b230eaa6bb35e07353e6

Contents?: true

Size: 799 Bytes

Versions: 32

Compression:

Stored size: 799 Bytes

Contents

require 'rbconfig'

module Appjam
  ##
  # This method return the correct location of appjam bin or
  # exec it using Kernel#system with the given args
  #
  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

  ##
  # Return the path to the ruby interpreter taking into account multiple
  # installations and windows extensions.
  #
  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
end # Appjam

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
appjam-0.1.8.11 lib/appjam/command.rb
appjam-0.1.8.10 lib/appjam/command.rb
appjam-0.1.8.9 lib/appjam/command.rb
appjam-0.1.8.8 lib/appjam/command.rb
appjam-0.1.8.7 lib/appjam/command.rb
appjam-0.1.8.6 lib/appjam/command.rb
appjam-0.1.8.5 lib/appjam/command.rb
appjam-0.1.8.4 lib/appjam/command.rb
appjam-0.1.8.3 lib/appjam/command.rb
appjam-0.1.8.2 lib/appjam/command.rb
appjam-0.1.8.1 lib/appjam/command.rb
appjam-0.1.8 lib/appjam/command.rb
appjam-0.1.8.pre13 lib/appjam/command.rb
appjam-0.1.8.pre12 lib/appjam/command.rb
appjam-0.1.8.pre11 lib/appjam/command.rb
appjam-0.1.8.pre10 lib/appjam/command.rb
appjam-0.1.8.pre9 lib/appjam/command.rb
appjam-0.1.8.pre7 lib/appjam/command.rb
appjam-0.1.8.pre6 lib/appjam/command.rb
appjam-0.1.8.pre5 lib/appjam/command.rb