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 +4 -4
- data/Gemfile.lock +1 -1
- data/features/generate_geo_pattern.feature +36 -2
- data/lib/middleman-geo_pattern/extension.rb +4 -2
- data/lib/middleman-geo_pattern/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1ad13540886ab229f2f9c7d4645889d229697296
         | 
| 4 | 
            +
              data.tar.gz: e58bc876e46b88ca769a445a735d208ae858df74
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 146c3296cdc46ae0dddd18d621d1d099d0097e20e294b5c53cad5bf0169ae8e83dff6aaad2372ca129faa6ec50445c1c671760f3ebdef57eb590fda519db3e62
         | 
| 7 | 
            +
              data.tar.gz: 34a1ad53d3c2649168556d3b8ff1a2ea9de9c705b52a198d17921882f06c917da41b6a05dbb2c198cf759ad7162f70707032e190859a0f822a2f57c9d0c9001d
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
| @@ -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',  | 
| 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 | 
            -
                 | 
| 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
         |