Sha256: 1eb5eb4b5894b9f8bc957108352ee1aa8a940e8cca107fb33215d72859dfcffe

Contents?: true

Size: 507 Bytes

Versions: 3

Compression:

Stored size: 507 Bytes

Contents

module Overapp
  class FromCommand
    include FromHash
    attr_accessor :command, :path

    def with_tmp_dir
      dir = "/tmp/#{rand(1000000000000000000)}"
      `mkdir #{dir}`
      Dir.chdir(dir) do
        yield dir
      end
    ensure
      ec "rm -rf #{dir}", :silent => true
    end

    fattr(:files) do
      with_tmp_dir do |dir|
        Overapp.ec command, :silent => true
        Files.load [dir,path].select { |x| x.present? }.join("/"), :file_class => BasicFile
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
overapp-0.3.1 lib/overapp/from_command.rb
overapp-0.3.0 lib/overapp/from_command.rb
overapp-0.2.0 lib/overapp/from_command.rb