Sha256: 1c494e27e15e730beb496bffd3d529df215c85a82cbd0e6d037403d99af14787

Contents?: true

Size: 455 Bytes

Versions: 1

Compression:

Stored size: 455 Bytes

Contents

module Alternator
  module Actions
    class Wrap
      include Alternator::Action

      def filename
        @arguments.first
      end

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

      def target_binary
        @arguments[1]
      end

      def execute
        File.open file_path, 'w', 0700 do |f|
          f.write <<-eoh
#!/usr/bin/env sh

exec #{target_binary} $@
          eoh
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alternator-0.0.2 lib/alternator/actions/wrap.rb