middleman-geo_pattern 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2bdf192996be8b11abbfe2ffb250bc3960ca0c6
4
- data.tar.gz: 1bb02bf2806545331cde9af1fc54e51d5d2e4144
3
+ metadata.gz: 1ad13540886ab229f2f9c7d4645889d229697296
4
+ data.tar.gz: e58bc876e46b88ca769a445a735d208ae858df74
5
5
  SHA512:
6
- metadata.gz: a117ed19217a66558c8b94b07d45c6ee5271e548d240343bc0f3f1df358272055e9947ae0a9093be4714ceb8e68fab997bc2ae61e947a3084f85b3894e6239b0
7
- data.tar.gz: 84ad9dcbc9f7c5aa9f97617a3d51977f6ff5bdbb80ef54d58026e004f2742e30accaad294e501bac8f2006b0e9de864f1565c42354ee4b678b0b8182efcbc93c
6
+ metadata.gz: 146c3296cdc46ae0dddd18d621d1d099d0097e20e294b5c53cad5bf0169ae8e83dff6aaad2372ca129faa6ec50445c1c671760f3ebdef57eb590fda519db3e62
7
+ data.tar.gz: 34a1ad53d3c2649168556d3b8ff1a2ea9de9c705b52a198d17921882f06c917da41b6a05dbb2c198cf759ad7162f70707032e190859a0f822a2f57c9d0c9001d
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- middleman-geo_pattern (0.0.2)
4
+ middleman-geo_pattern (0.0.3)
5
5
  geo_pattern (~> 1.4.0)
6
6
  middleman-core (>= 3.3.10)
7
7
 
@@ -78,6 +78,40 @@ Feature: Generate GeoPattern
78
78
  When I go to "/index.html"
79
79
  Then I should see a geo pattern based on "Mastering Markdown" with patterns "hexagons" with color "#541428"
80
80
 
81
+ Scenario: Set default css class
82
+ Given a middleman config file with:
83
+ """
84
+ activate :geo_pattern do |g|
85
+ g.css_class = 'gp-content'
86
+ end
87
+ """
88
+ And a source file named "index.erb" with:
89
+ """
90
+ <%= geo_pattern 'Mastering Markdown' %>
91
+ """
92
+ And the Server is running
93
+ When I go to "/index.html"
94
+ Then I should see:
95
+ """
96
+ class="gp-content"
97
+ """
98
+
99
+ Scenario: Use css_class
100
+ Given a middleman config file with:
101
+ """
102
+ activate :geo_pattern
103
+ """
104
+ And a source file named "index.erb" with:
105
+ """
106
+ <%= geo_pattern 'Mastering Markdown', css_class: 'gp-content' %>
107
+ """
108
+ And the Server is running
109
+ When I go to "/index.html"
110
+ Then I should see:
111
+ """
112
+ class="gp-content"
113
+ """
114
+
81
115
  Scenario: Set tag as string
82
116
  Given a middleman config file with:
83
117
  """
@@ -139,13 +173,13 @@ Feature: Generate GeoPattern
139
173
  """
140
174
  And a source file named "index.erb" with:
141
175
  """
142
- <%= geo_pattern 'Mastering Markdown', class: 'gp-content' %>
176
+ <%= geo_pattern 'Mastering Markdown', role: :main %>
143
177
  """
144
178
  And the Server is running
145
179
  When I go to "/index.html"
146
180
  Then I should see:
147
181
  """
148
- class="gp-content"
182
+ role="main"
149
183
  """
150
184
 
151
185
  Scenario: Generate content tag
@@ -7,6 +7,7 @@ module Middleman
7
7
  option :base_color, nil, 'The base color to use'
8
8
  option :is_content_tag, true, 'Is content tag?'
9
9
  option :html_tag, :div, 'Tag to generate'
10
+ option :css_class, nil, 'CSS class for tag'
10
11
 
11
12
  def initialize(app, options_hash = {}, &block)
12
13
  # Call super to build options from the options_hash
@@ -55,6 +56,7 @@ module Middleman
55
56
  base_color: extensions[:geo_pattern].options.base_color,
56
57
  is_content_tag: extensions[:geo_pattern].options.is_content_tag,
57
58
  html_tag: extensions[:geo_pattern].options.html_tag,
59
+ css_class: extensions[:geo_pattern].options.css_class,
58
60
  **options,
59
61
  &block
60
62
  )
@@ -69,10 +71,10 @@ module Middleman
69
71
  style += options.delete(:style) if options[:style]
70
72
 
71
73
  # rubocop:disable Metrics/LineLength
72
- return public_send(:content_tag, html_tag, nil, **options, style: style, &block) if is_content_tag == true
74
+ return public_send(:content_tag, html_tag, nil, **options, class: css_class, style: style, &block) if is_content_tag == true
73
75
  # rubocop:enable Metrics/LineLength
74
76
 
75
- public_send(:tag, html_tag, **options, style: style)
77
+ public_send(:tag, html_tag, **options, class: css_class, style: style)
76
78
  end
77
79
  # rubocop:enable Metrics/MethodLength
78
80
  # rubocop:enable Metrics/ParameterLists
@@ -3,6 +3,6 @@
3
3
  module Middleman
4
4
  # GeoPattern
5
5
  module GeoPattern
6
- VERSION = '0.0.3'
6
+ VERSION = '0.0.4'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-geo_pattern
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Meyer