Class: EmergeCLI::Commands::Upload::ClientLibraries::Paparazzi
- Inherits:
-
Object
- Object
- EmergeCLI::Commands::Upload::ClientLibraries::Paparazzi
- Defined in:
- lib/commands/upload/snapshots/client_libraries/paparazzi.rb
Instance Method Summary collapse
- #image_files ⇒ Object
-
#initialize(project_root) ⇒ Paparazzi
constructor
A new instance of Paparazzi.
- #parse_file_info(image_path) ⇒ Object
Constructor Details
#initialize(project_root) ⇒ Paparazzi
Returns a new instance of Paparazzi.
6 7 8 |
# File 'lib/commands/upload/snapshots/client_libraries/paparazzi.rb', line 6 def initialize(project_root) @project_root = project_root end |
Instance Method Details
#image_files ⇒ Object
10 11 12 13 |
# File 'lib/commands/upload/snapshots/client_libraries/paparazzi.rb', line 10 def image_files # TODO: support "paparazzi.snapshot.dir" dynamic config Dir.glob(File.join(@project_root, '**/src/test/snapshots/images/**/*.png')) end |
#parse_file_info(image_path) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/commands/upload/snapshots/client_libraries/paparazzi.rb', line 15 def parse_file_info(image_path) file_name = image_path.split('src/test/snapshots/images/').last test_class_name = File.basename(File.dirname(image_path)) { file_name:, group_name: test_class_name, # TODO: add support for nicer group names variant_name: File.basename(file_name, '.*') } end |