Module: SimpleTemplater::Helpers
Overview
Instance Method Summary collapse
- #env_shebang(executable = ruby_basename, *args) ⇒ Object
- #plain_shebang(executable = ruby_basename, *args) ⇒ Object
- #ruby_basename ⇒ Object
- #rubypath ⇒ Object
- #shebang(executable = ruby_basename, *args) ⇒ Object
Instance Method Details
#env_shebang(executable = ruby_basename, *args) ⇒ Object
21 22 23 |
# File 'lib/simple-templater/helpers.rb', line 21 def env_shebang(executable = ruby_basename, *args) "#!/usr/bin/env #{executable} #{args.join(" ")}".chomp(" ") end |
#plain_shebang(executable = ruby_basename, *args) ⇒ Object
17 18 19 |
# File 'lib/simple-templater/helpers.rb', line 17 def plain_shebang(executable = ruby_basename, *args) "#!#{executable} #{args.join(" ")}".chomp(" ") end |
#ruby_basename ⇒ Object
29 30 31 |
# File 'lib/simple-templater/helpers.rb', line 29 def ruby_basename RbConfig::CONFIG["RUBY_INSTALL_NAME"] end |
#rubypath ⇒ Object
25 26 27 |
# File 'lib/simple-templater/helpers.rb', line 25 def rubypath File.join(RbConfig::CONFIG["bindir"], self.ruby_basename) end |
#shebang(executable = ruby_basename, *args) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/simple-templater/helpers.rb', line 9 def shebang(executable = ruby_basename, *args) if RUBY_PLATFORM.match(/darwin/) self.env_shebang(executable, args) else self.plain_shebang(executable, args) end end |