Class: Clerq::Repositories::FileRepository
- Inherits:
-
Object
- Object
- Clerq::Repositories::FileRepository
- Defined in:
- lib/clerq/repositories/file_repository.rb
Overview
Direct Known Subclasses
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#patt ⇒ Object
readonly
Returns the value of attribute patt.
Instance Method Summary collapse
-
#initialize(path: Dir.pwd, pattern: '*.*') ⇒ FileRepository
constructor
A new instance of FileRepository.
- #inside ⇒ Object
Constructor Details
#initialize(path: Dir.pwd, pattern: '*.*') ⇒ FileRepository
Returns a new instance of FileRepository.
18 19 20 21 22 23 24 25 26 |
# File 'lib/clerq/repositories/file_repository.rb', line 18 def initialize(path: Dir.pwd, pattern: '*.*') # TODO check that path exists and save it in full form unless Dir.exist?(path) msg = "'#{path}' directory does not exist!" raise ArgumentError, msg end @path = path @patt = pattern end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
13 14 15 |
# File 'lib/clerq/repositories/file_repository.rb', line 13 def path @path end |
#patt ⇒ Object (readonly)
Returns the value of attribute patt.
14 15 16 |
# File 'lib/clerq/repositories/file_repository.rb', line 14 def patt @patt end |
Instance Method Details
#inside ⇒ Object
28 29 30 |
# File 'lib/clerq/repositories/file_repository.rb', line 28 def inside Dir.chdir(@path) { yield } end |