Class: Amp::Repositories::Stores::EncodedStore
- Inherits:
-
BasicStore
- Object
- BasicStore
- Amp::Repositories::Stores::EncodedStore
- Defined in:
- lib/amp/repository/store.rb
Overview
EncodedStore
This version of the store uses encoded file paths to preserve consistency across platforms.
Constant Summary
Constants inherited from BasicStore
Instance Attribute Summary
Attributes inherited from BasicStore
#create_mode, #opener, #path, #path_joiner
Instance Method Summary collapse
-
#copy_list ⇒ Object
We’ve got a new required file so let’s include it.
-
#datafiles ⇒ Object
over-ride the datafiles block so that it decodes filenames before it returns them.
-
#join ⇒ Object
Encode the filename before joining.
Methods inherited from BasicStore
#calculate_mode, #do_walk, #initialize, #walk
Constructor Details
This class inherits a constructor from Amp::Repositories::Stores::BasicStore
Instance Method Details
#copy_list ⇒ Object
We’ve got a new required file so let’s include it
170 171 172 173 174 |
# File 'lib/amp/repository/store.rb', line 170 def copy_list BASIC_DATA_FILES.inject ['requires', '00changelog.i'] do |a, f| a + @path_joiner.call('store', f) end end |
#datafiles ⇒ Object
over-ride the datafiles block so that it decodes filenames before it returns them.
155 156 157 158 159 160 |
# File 'lib/amp/repository/store.rb', line 155 def datafiles do_walk('data', true) do |a, b, size| a = decode_filename(a) || nil yield [a, b, size] if block_given? end end |
#join ⇒ Object
Encode the filename before joining
164 165 166 |
# File 'lib/amp/repository/store.rb', line 164 def join @path_joiner.call @path, encode_filename(f) end |