Class: Licensee::FilesystemRepository
- Inherits:
-
Object
- Object
- Licensee::FilesystemRepository
- Defined in:
- lib/licensee/filesystem_repository.rb
Defined Under Namespace
Classes: Blob
Instance Method Summary collapse
-
#initialize(path) ⇒ FilesystemRepository
constructor
A new instance of FilesystemRepository.
- #last_commit ⇒ Object
- #lookup(filename) ⇒ Object
- #tree ⇒ Object
Constructor Details
#initialize(path) ⇒ FilesystemRepository
Returns a new instance of FilesystemRepository.
3 4 5 |
# File 'lib/licensee/filesystem_repository.rb', line 3 def initialize(path) @path = path end |
Instance Method Details
#last_commit ⇒ Object
7 |
# File 'lib/licensee/filesystem_repository.rb', line 7 def last_commit() self end |
#lookup(filename) ⇒ Object
18 19 20 |
# File 'lib/licensee/filesystem_repository.rb', line 18 def lookup(filename) Blob.new File.read(filename) end |
#tree ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/licensee/filesystem_repository.rb', line 9 def tree return to_enum(__method__) unless block_given? Dir.entries(@path).each do |name| filename = File.join @path, name next if File.directory? filename yield(:name => name, :type => :blob, :oid => filename) end end |