Class: Rstreet::UploadableCollector
- Inherits:
-
Object
- Object
- Rstreet::UploadableCollector
- Defined in:
- lib/uploadable_collector.rb
Instance Attribute Summary collapse
-
#manifest_builder ⇒ Object
readonly
TODO: Shouldn’t need to get this for the pull_manifest in rstreet.rb Instead, consider some class method with the default file path info.
-
#manifest_uploadable ⇒ Object
readonly
TODO: Shouldn’t need to get this for the pull_manifest in rstreet.rb Instead, consider some class method with the default file path info.
Instance Method Summary collapse
- #collect ⇒ Object
-
#find_uploadables(file_names) ⇒ Object
TODO: be more consistent with name, file, path var names.
-
#initialize(src) ⇒ UploadableCollector
constructor
A new instance of UploadableCollector.
Constructor Details
#initialize(src) ⇒ UploadableCollector
Returns a new instance of UploadableCollector.
12 13 14 15 16 17 |
# File 'lib/uploadable_collector.rb', line 12 def initialize(src) @src = File.realpath src # TODO: get rid of cache and consolidate inside of manifest builder @uploadables_cache = {} init_manifest_builder end |
Instance Attribute Details
#manifest_builder ⇒ Object (readonly)
TODO: Shouldn’t need to get this for the pull_manifest in rstreet.rb Instead, consider some class method with the default file path info
10 11 12 |
# File 'lib/uploadable_collector.rb', line 10 def manifest_builder @manifest_builder end |
#manifest_uploadable ⇒ Object (readonly)
TODO: Shouldn’t need to get this for the pull_manifest in rstreet.rb Instead, consider some class method with the default file path info
10 11 12 |
# File 'lib/uploadable_collector.rb', line 10 def manifest_uploadable @manifest_uploadable end |
Instance Method Details
#collect ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/uploadable_collector.rb', line 19 def collect files = FilesReader.read_all(@src) uploadables = convert_files_to_uploadables files uploadables = add_manifest_to_uploadables uploadables save_uploadables_in_manifest uploadables uploadables end |
#find_uploadables(file_names) ⇒ Object
TODO: be more consistent with name, file, path var names
28 29 30 |
# File 'lib/uploadable_collector.rb', line 28 def find_uploadables(file_names) @uploadables_cache.select { |k, v| file_names.include? k }.values end |