Class: Alternator::Actions::Wrap
- Inherits:
-
Object
- Object
- Alternator::Actions::Wrap
- Includes:
- Alternator::Action
- Defined in:
- lib/alternator/actions/wrap.rb
Instance Attribute Summary
Attributes included from Alternator::Action
Instance Method Summary collapse
Methods included from Alternator::Action
Instance Method Details
#execute ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/alternator/actions/wrap.rb', line 18 def execute File.open file_path, 'w', 0700 do |f| f.write <<-eoh #!/usr/bin/env sh exec #{target_binary} $@ eoh end end |
#file_path ⇒ Object
10 11 12 |
# File 'lib/alternator/actions/wrap.rb', line 10 def file_path "#{ENV['HOME']}/bin/#{filename}" end |
#filename ⇒ Object
6 7 8 |
# File 'lib/alternator/actions/wrap.rb', line 6 def filename @arguments.first end |
#target_binary ⇒ Object
14 15 16 |
# File 'lib/alternator/actions/wrap.rb', line 14 def target_binary @arguments[1] end |