lib/snapshot/snapshot_file.rb in snapshot-0.4.7 vs lib/snapshot/snapshot_file.rb in snapshot-0.4.8
- old
+ new
@@ -22,11 +22,12 @@
value = arguments.first || (block.call if block_given?) # this is either a block or a value
end
case method_sym
when :devices
- self.verify_devices(value)
+ raise "Devices has to be an array".red unless value.kind_of?Array
+ @config.devices = value
when :languages
@config.languages = value
when :ios_version
raise "ios_version has to be an String".red unless value.kind_of?String
@config.ios_version = value
@@ -41,10 +42,13 @@
raise "screenshots_path has to be an String".red unless value.kind_of?String
@config.screenshots_path = File.expand_path(value)
when :build_command
raise "build_command has to be an String".red unless value.kind_of?String
@config.build_command = value
+ when :custom_args
+ raise "custom_args has to be an String".red unless value.kind_of?String
+ @config.custom_args = value
when :skip_alpha_removal
@config.skip_alpha_removal = true
when :clear_previous_screenshots
@config.clear_previous_screenshots = true
when :project_path
@@ -63,22 +67,8 @@
raise "#{method_sym} needs to have a block provided." unless block_given?
@config.blocks[method_sym] = block
else
Helper.log.error "Unknown method #{method_sym}"
end
- end
-
- def verify_devices(value)
- raise "Devices has to be an array".red unless value.kind_of?Array
- @config.devices = []
- value.each do |current|
- current += " (#{@config.ios_version} Simulator)" unless current.include?"Simulator"
-
- unless Simulators.available_devices.include?current
- raise "Device '#{current}' not found. Available device types: #{Simulators.available_devices}".red
- else
- @config.devices << current
- end
- end
end
end
end
\ No newline at end of file