Module: GitTracker::Standalone
Constant Summary collapse
- GIT_TRACKER_ROOT =
File.('../../..', __FILE__)
- PREAMBLE =
<<-preamble # # This file is generated code. DO NOT send patches for it. # # Original source files with comments are at: # https://github.com/stevenharman/git_tracker # preamble
Instance Method Summary collapse
Instance Method Details
#build(io) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/git_tracker/standalone.rb', line 24 def build(io) io.puts "#!#{ruby_executable}" io << PREAMBLE each_source_file do |filename| File.open(filename, 'r') do |source| inline_source(source, io) end end io.puts 'GitTracker::Runner.execute(*ARGV)' io end |
#ruby_executable ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/git_tracker/standalone.rb', line 38 def ruby_executable if File.executable? '/usr/bin/ruby' then '/usr/bin/ruby' else require 'rbconfig' File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']) end end |
#save(filename, path = '.') ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/git_tracker/standalone.rb', line 16 def save(filename, path = '.') dest = File.join(File.(path), filename) File.open(dest, 'w') do |f| build(f) f.chmod(0755) end end |