Sha256: f48942f69dbf0c165fe27b698f21f85948e74cd6172e66b1bd7071767eab5f81

Contents?: true

Size: 805 Bytes

Versions: 17

Compression:

Stored size: 805 Bytes

Contents

module Vos
  class Box
    module Vfs
      def open_fs &block
        open &block
      end
      
      def to_entry
        '/'.to_entry_on(self)
      end
      
      def to_file
        to_entry.file
      end
      
      def to_dir
        to_entry.dir
      end
      
      # def [] path
      #   to_entry[path]
      # end
      # alias_method :/, :[]
            
      %w(
        entry dir file 
        entries dirs files
        [] / 
        tmp
      ).each do |m|
        script = <<-RUBY
          def #{m} *a, &b
            to_entry.#{m} *a, &b
          end
        RUBY
        eval script, binding, __FILE__, __LINE__
      end
    end
  end
end

module Vfs
  class Dir
    def bash cmd, *args      
      storage.bash_without_path "cd #{path} && #{cmd}", *args
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
vos-0.3.12 lib/vos/box/vfs.rb
vos-0.3.11 lib/vos/box/vfs.rb
vos-0.3.10 lib/vos/box/vfs.rb
vos-0.3.9 lib/vos/box/vfs.rb
vos-0.3.8 lib/vos/box/vfs.rb
vos-0.3.7 lib/vos/box/vfs.rb
vos-0.3.6 lib/vos/box/vfs.rb
vos-0.3.5 lib/vos/box/vfs.rb
vos-0.3.4 lib/vos/box/vfs.rb
vos-0.3.3 lib/vos/box/vfs.rb
vos-0.3.2 lib/vos/box/vfs.rb
vos-0.3.1 lib/vos/box/vfs.rb
vos-0.3 lib/vos/box/vfs.rb
vos-0.2.1 lib/vos/box/vfs.rb
vos-0.2 lib/vos/box/vfs.rb
vos-0.1.4 lib/vos/box/vfs.rb
vos-0.1.3 lib/vos/box/vfs.rb