Class: Amp::Repositories::Stores::EncodedStore

Inherits:
BasicStore show all
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

BasicStore::BASIC_DATA_FILES

Instance Attribute Summary

Attributes inherited from BasicStore

#create_mode, #opener, #path, #path_joiner

Instance Method Summary collapse

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_listObject

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

#datafilesObject

over-ride the datafiles block so that it decodes filenames before it returns them.

See Also:



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

#joinObject

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