Class: Alternator::Actions::Wrap

Inherits:
Object
  • Object
show all
Includes:
Alternator::Action
Defined in:
lib/alternator/actions/wrap.rb

Instance Attribute Summary

Attributes included from Alternator::Action

#arguments

Instance Method Summary collapse

Methods included from Alternator::Action

#initialize

Instance Method Details

#executeObject



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_pathObject



10
11
12
# File 'lib/alternator/actions/wrap.rb', line 10

def file_path
  "#{ENV['HOME']}/bin/#{filename}"
end

#filenameObject



6
7
8
# File 'lib/alternator/actions/wrap.rb', line 6

def filename
  @arguments.first
end

#target_binaryObject



14
15
16
# File 'lib/alternator/actions/wrap.rb', line 14

def target_binary
  @arguments[1]
end