From e4e9c65c36a01ef3aecd754e98036707e7869f6d Mon Sep 17 00:00:00 2001 From: Philip Blyth Date: Fri, 13 Sep 2013 15:41:45 -0400 Subject: [PATCH 1/5] compress: Added flag making PNG grid optional --- lib/blueprint/compressor.rb | 7 +++++-- lib/compress.rb | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/blueprint/compressor.rb b/lib/blueprint/compressor.rb index 72734606..5c3b904f 100644 --- a/lib/blueprint/compressor.rb +++ b/lib/blueprint/compressor.rb @@ -8,7 +8,7 @@ class Compressor "parts/grid.html", "parts/sample.html"] - attr_accessor :namespace, :custom_css, :custom_layout, :semantic_classes, :project_name, :plugins, :custom_tests_path + attr_accessor :namespace, :custom_css, :custom_layout, :semantic_classes, :project_name, :plugins, :custom_tests_path, :do_grid_png attr_reader :custom_path, :loaded_from_settings, :destination_path, :script_name # overridden setter method for destination_path @@ -30,6 +30,7 @@ def initialize self.custom_css = {} self.semantic_classes = {} self.plugins = [] + self.do_grid_png = false self.options.parse!(ARGV) initialize_project_from_yaml(self.project_name) @@ -67,6 +68,8 @@ def options #:nodoc:# "Set a new column count for the output grid") {|cc| self.custom_layout.column_count = cc } o.on( "--custom_tests_path=TESTS_OUTPUT_PATH", String, "Define a different path to output generated test files to") {|test_path| self.custom_tests_path = test_path } + o.on( "-g", "--grid", + "Generate grid PNG") { self.do_grid_png = true } #o.on("-v", "--verbose", "Turn on verbose output.") { |$verbose| } o.on("-h", "--help", "Show this help message.") { puts o; exit } end @@ -143,7 +146,7 @@ def generate_css_files # append semantic class names if set append_semantic_classes - generate_grid_png + generate_grid_png if self.do_grid_png end def append_custom_css(css, current_file_name) diff --git a/lib/compress.rb b/lib/compress.rb index 34a6c16e..fc783d4c 100644 --- a/lib/compress.rb +++ b/lib/compress.rb @@ -1,5 +1,5 @@ #!/usr/bin/env ruby -require File.join(File.dirname(__FILE__), "blueprint", "blueprint") +require_relative File.join("blueprint", "blueprint.rb") # **Basic # From 6cf1e4fba08bd4189eb3369ea1349d4f4198bc43 Mon Sep 17 00:00:00 2001 From: Philip Blyth Date: Fri, 13 Sep 2013 15:57:22 -0400 Subject: [PATCH 2/5] compress: FIXED semantic_class_names wrapping Array in quotes... --- lib/blueprint/semantic_class_names.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/blueprint/semantic_class_names.rb b/lib/blueprint/semantic_class_names.rb index d561e33b..062f1057 100644 --- a/lib/blueprint/semantic_class_names.rb +++ b/lib/blueprint/semantic_class_names.rb @@ -50,7 +50,7 @@ def css_from_assignments(assignments = {}) # set the semantic class to the rules gathered in classes, sorted by index # this way, the styles will be applied in the correct order from top of file to bottom - output_css[semantic_class] = "#{classes.sort_by {|i| i[:idx] }.map {|i| i[:rules] }}" + output_css[semantic_class] = classes.sort_by {|i| i[:idx] }.map {|i| i[:rules] }.join end # return the css in proper format From ba46d21488ecadf6d4419a1744bec438ff0fea38 Mon Sep 17 00:00:00 2001 From: Philip Blyth Date: Fri, 13 Sep 2013 13:56:53 -0700 Subject: [PATCH 3/5] Ignore .bundle From 492cf0b0506fa7e61bcd8c1404261d10d1db9789 Mon Sep 17 00:00:00 2001 From: Philip Blyth Date: Thu, 10 Apr 2014 13:46:36 -0400 Subject: [PATCH 4/5] Make `compress.rb` executable --- lib/compress.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 lib/compress.rb diff --git a/lib/compress.rb b/lib/compress.rb old mode 100644 new mode 100755 From fe0f2c8f4a84e7cdc9b631608edb9ad8723f2efa Mon Sep 17 00:00:00 2001 From: Philip Blyth Date: Thu, 10 Apr 2014 13:49:05 -0400 Subject: [PATCH 5/5] Switched to `oily_png` This is a `chunky_png` wrapper w/ more support across platforms. --- Gemfile | 2 +- Gemfile.lock | 55 +++++++++++++++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/Gemfile b/Gemfile index 96161fe1..4612eb4b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "http://rubygems.org" gem "colored" -gem "chunky_png" +gem "oily_png" group :test do gem "cucumber", "0.10.2" diff --git a/Gemfile.lock b/Gemfile.lock index 3909338b..cc3b472b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,7 +5,7 @@ GEM childprocess (>= 0.1.7) cucumber (>= 0.10.0) rspec (>= 2.5.0) - builder (3.0.0) + builder (3.2.2) capybara (0.4.1.2) celerity (>= 0.7.9) culerity (>= 0.2.4) @@ -17,10 +17,10 @@ GEM xpath (~> 0.1.3) capybara-webkit (0.3.0) capybara (~> 0.4.1) - celerity (0.8.9) - childprocess (0.1.9) - ffi (~> 1.0.6) - chunky_png (1.2.0) + celerity (0.9.2) + childprocess (0.5.2) + ffi (~> 1.0, >= 1.0.11) + chunky_png (1.3.0) colored (1.2) cucumber (0.10.2) builder (>= 2.1.2) @@ -29,32 +29,39 @@ GEM json (>= 1.4.6) term-ansicolor (>= 1.0.5) culerity (0.2.15) - diff-lcs (1.1.2) - ffi (1.0.8) - gherkin (2.3.7) - json (>= 1.4.6) - json (1.5.1) - json_pure (1.5.1) - mime-types (1.16) - nokogiri (1.4.4) - rack (1.2.2) - rack-test (0.6.0) + diff-lcs (1.1.3) + ffi (1.9.3) + gherkin (2.12.2) + multi_json (~> 1.3) + json (1.8.1) + mime-types (2.2) + mini_portile (0.5.3) + multi_json (1.9.2) + nokogiri (1.6.1) + mini_portile (~> 0.5.0) + oily_png (1.1.1) + chunky_png (~> 1.3.0) + rack (1.5.2) + rack-test (0.6.2) rack (>= 1.0) rspec (2.6.0) rspec-core (~> 2.6.0) rspec-expectations (~> 2.6.0) rspec-mocks (~> 2.6.0) - rspec-core (2.6.0) + rspec-core (2.6.4) rspec-expectations (2.6.0) diff-lcs (~> 1.1.2) rspec-mocks (2.6.0) - rubyzip (0.9.4) - selenium-webdriver (0.2.0) - childprocess (>= 0.1.7) - ffi (>= 1.0.7) - json_pure - rubyzip - term-ansicolor (1.0.5) + rubyzip (1.1.2) + selenium-webdriver (2.41.0) + childprocess (>= 0.5.0) + multi_json (~> 1.0) + rubyzip (~> 1.0) + websocket (~> 1.0.4) + term-ansicolor (1.3.0) + tins (~> 1.0) + tins (1.0.1) + websocket (1.0.7) xpath (0.1.4) nokogiri (~> 1.3) @@ -65,7 +72,7 @@ DEPENDENCIES aruba (= 0.3.6) capybara (= 0.4.1.2) capybara-webkit (= 0.3.0) - chunky_png colored cucumber (= 0.10.2) + oily_png rspec (= 2.6.0)