Class: ZipFileExtractor
- Inherits:
-
Object
- Object
- ZipFileExtractor
- Defined in:
- app/services/zip_file_extractor.rb
Constant Summary collapse
- OUTPUT_PATH =
File.join('public', 'vinsol_spree_themes')
- IGNORED_FILES_REGEX =
/\/(\.|__)/
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#theme ⇒ Object
readonly
Returns the value of attribute theme.
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(file_path, theme) ⇒ ZipFileExtractor
constructor
A new instance of ZipFileExtractor.
Constructor Details
#initialize(file_path, theme) ⇒ ZipFileExtractor
Returns a new instance of ZipFileExtractor.
10 11 12 13 |
# File 'app/services/zip_file_extractor.rb', line 10 def initialize(file_path, theme) @file_path = file_path @theme = theme end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
8 9 10 |
# File 'app/services/zip_file_extractor.rb', line 8 def file_path @file_path end |
#theme ⇒ Object (readonly)
Returns the value of attribute theme.
8 9 10 |
# File 'app/services/zip_file_extractor.rb', line 8 def theme @theme end |
Instance Method Details
#extract ⇒ Object
15 16 17 18 |
# File 'app/services/zip_file_extractor.rb', line 15 def extract FileUtils.mkdir_p(OUTPUT_PATH) parse_file end |