Class: Berkshelf::API::CacheBuilder::Worker::FileStore
- Defined in:
- lib/berkshelf/api/cache_builder/worker/file_store.rb
Instance Attribute Summary collapse
- #path ⇒ String readonly
Attributes inherited from Base
Instance Method Summary collapse
-
#cookbooks ⇒ Array<RemoteCookbook>
The list of cookbooks this builder can find.
-
#initialize(options = {}) ⇒ FileStore
constructor
A new instance of FileStore.
- #metadata(remote) ⇒ Ridley::Chef::Cookbook::Metadata
- #to_s ⇒ String
Methods inherited from Base
Methods included from Mixin::Services
Methods included from Logging
Constructor Details
#initialize(options = {}) ⇒ FileStore
Returns a new instance of FileStore.
12 13 14 15 |
# File 'lib/berkshelf/api/cache_builder/worker/file_store.rb', line 12 def initialize( = {}) @path = Pathname([:path]) super() end |
Instance Attribute Details
#path ⇒ String (readonly)
8 9 10 |
# File 'lib/berkshelf/api/cache_builder/worker/file_store.rb', line 8 def path @path end |
Instance Method Details
#cookbooks ⇒ Array<RemoteCookbook>
Returns The list of cookbooks this builder can find.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/berkshelf/api/cache_builder/worker/file_store.rb', line 24 def cookbooks [].tap do |cookbook_versions| @path.each_child do |dir| next unless dir.cookbook? begin cookbook = Ridley::Chef::Cookbook.from_path(dir) cookbook_versions << RemoteCookbook.new(cookbook.cookbook_name, cookbook.version, self.class.worker_type, cookbook.path, priority) rescue => ex log.debug ex. end end end end |
#metadata(remote) ⇒ Ridley::Chef::Cookbook::Metadata
42 43 44 |
# File 'lib/berkshelf/api/cache_builder/worker/file_store.rb', line 42 def (remote) (remote.location_path) end |
#to_s ⇒ String
18 19 20 |
# File 'lib/berkshelf/api/cache_builder/worker/file_store.rb', line 18 def to_s friendly_name(path) end |