Module: Goggles
- Extended by:
- Goggles
- Included in:
- Goggles
- Defined in:
- lib/goggles.rb,
lib/goggles/version.rb,
lib/goggles/iteration.rb,
lib/goggles/comparison.rb,
lib/goggles/configuration.rb
Defined Under Namespace
Classes: Comparison, Configuration, EmptyDirectoryError, Iteration
Constant Summary collapse
- VERSION =
"0.10.0"
Instance Method Summary collapse
-
#configure {|Goggles::Configuration| ... } ⇒ Goggles::Configuration
Yields the global configuration object to a block.
-
#each(*instance, &block) ⇒ Goggles::Comparison
Creates an Iteration object for each combination of browser and width derived from global configuration and given arguments.
Instance Method Details
#configure {|Goggles::Configuration| ... } ⇒ Goggles::Configuration
Yields the global configuration object to a block.
19 20 21 |
# File 'lib/goggles.rb', line 19 def configure &block configuration.tap { |conf| yield conf } end |
#each(*instance, &block) ⇒ Goggles::Comparison
Creates an Iteration object for each combination of browser and width derived from global
configuration and given arguments.
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/goggles.rb', line 31 def each *instance, &block validate_directory_setting args = instance.flatten.map(&:to_s) sizes = configuration.sizes + args.grep(/\d+/).map(&:to_i) browsers = configuration.browsers + args.grep(/[^\d+]/).map(&:to_sym) browsers.product(sizes).each do |browser, size| Iteration.new browser, size, configuration, &block end Comparison.new(configuration).tap { |comparison| comparison.make! } end |