html-pipeline-rouge_filter 1.0.2 → 1.0.3
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/CHANGELOG.md +4 -0
 - data/README.md +3 -0
 - data/lib/html/pipeline/rouge_filter/version.rb +1 -1
 - data/lib/html/pipeline/rouge_filter.rb +6 -1
 - data/test/rouge_filter_test.rb +14 -0
 - metadata +3 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 3764c586c76cd0455f21d18e39e7c41c061b3d54
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 305b56c8c4758a7ec4354168fbc39cbaad025044
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 35d277942a7eb834d9ea2afb1121b21db61b18292fe017ef064f8189a07063053c507e9d820b9ea09b21d9610156c49eb6eaceb54afe04e04bdcd267c660d4db
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 0d7f67970f355c47b6fdff2b65bd74dc9fde84d6b8ef86652b08b5a54882e67ae58c326d0d29b0ce8f9c8598a7f16b3ab54d8f080f6bd74eaa6d4ffc9d7453c3
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -2,6 +2,10 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            ## Unreleased
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
      
 5 
     | 
    
         
            +
            ## 1.0.3 - 2016.02.10
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            - Generate line numbers via `line_numbers` option in context hash [#5](https://github.com/JuanitoFatas/html-pipeline-rouge_filter/pull/5) by @lowjoel
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
       5 
9 
     | 
    
         
             
            ## 1.0.2 - 2015.08.06
         
     | 
| 
       6 
10 
     | 
    
         | 
| 
       7 
11 
     | 
    
         
             
            - Allow to use with `HTML::Pipeline` >= 1.11 [#3](https://github.com/JuanitoFatas/html-pipeline-rouge_filter/pull/3) by @townsen
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -58,6 +58,9 @@ Prints (without the linebreaks): 
     | 
|
| 
       58 
58 
     | 
    
         
             
            </pre>
         
     | 
| 
       59 
59 
     | 
    
         
             
            ```
         
     | 
| 
       60 
60 
     | 
    
         | 
| 
      
 61 
     | 
    
         
            +
            You can specify line numbers via `line_numbers` option in
         
     | 
| 
      
 62 
     | 
    
         
            +
            [context](https://github.com/jch/html-pipeline#examples) hash.
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
       61 
64 
     | 
    
         
             
            ## Contributing
         
     | 
| 
       62 
65 
     | 
    
         | 
| 
       63 
66 
     | 
    
         
             
            1. Fork it ( https://github.com/juanitofatas/html-pipeline-rouge_filter/fork )
         
     | 
| 
         @@ -35,8 +35,13 @@ module HTML 
     | 
|
| 
       35 
35 
     | 
    
         
             
                    must_str(context[:css_class]) || "highlight"
         
     | 
| 
       36 
36 
     | 
    
         
             
                  end
         
     | 
| 
       37 
37 
     | 
    
         | 
| 
      
 38 
     | 
    
         
            +
                  def line_numbers
         
     | 
| 
      
 39 
     | 
    
         
            +
                    context[:line_numbers] || false
         
     | 
| 
      
 40 
     | 
    
         
            +
                  end
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
       38 
42 
     | 
    
         
             
                  def formatter(css_class: default_css_class)
         
     | 
| 
       39 
     | 
    
         
            -
                    Rouge::Formatters::HTML.new(css_class: css_class 
     | 
| 
      
 43 
     | 
    
         
            +
                    Rouge::Formatters::HTML.new(css_class: css_class,
         
     | 
| 
      
 44 
     | 
    
         
            +
                                                line_numbers: line_numbers)
         
     | 
| 
       40 
45 
     | 
    
         
             
                  end
         
     | 
| 
       41 
46 
     | 
    
         | 
| 
       42 
47 
     | 
    
         
             
                  def lexer_for(lang)
         
     | 
    
        data/test/rouge_filter_test.rb
    CHANGED
    
    | 
         @@ -54,6 +54,20 @@ class HTML::Pipeline::RougeFilterTest < Minitest::Test 
     | 
|
| 
       54 
54 
     | 
    
         
             
                assert_equal "superlight", filter.default_css_class
         
     | 
| 
       55 
55 
     | 
    
         
             
              end
         
     | 
| 
       56 
56 
     | 
    
         | 
| 
      
 57 
     | 
    
         
            +
              def test_line_numbers
         
     | 
| 
      
 58 
     | 
    
         
            +
                filter = RougeFilter.new \
         
     | 
| 
      
 59 
     | 
    
         
            +
                  "<pre lang='ruby'>hello</pre>"
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                assert_equal false, filter.line_numbers
         
     | 
| 
      
 62 
     | 
    
         
            +
              end
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
              def test_line_numbers_can_be_specified_by_context
         
     | 
| 
      
 65 
     | 
    
         
            +
                filter = RougeFilter.new \
         
     | 
| 
      
 66 
     | 
    
         
            +
                  "<pre lang='ruby'>hello</pre>", line_numbers: true
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                assert_equal true, filter.line_numbers
         
     | 
| 
      
 69 
     | 
    
         
            +
              end
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
       57 
71 
     | 
    
         
             
              def test_default_formatter
         
     | 
| 
       58 
72 
     | 
    
         
             
                filter = RougeFilter.new \
         
     | 
| 
       59 
73 
     | 
    
         
             
                  "<pre lang='ruby'>hello</pre>"
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: html-pipeline-rouge_filter
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Juanito Fatas
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-02-09 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: html-pipeline
         
     | 
| 
         @@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       91 
91 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       92 
92 
     | 
    
         
             
            requirements: []
         
     | 
| 
       93 
93 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       94 
     | 
    
         
            -
            rubygems_version: 2. 
     | 
| 
      
 94 
     | 
    
         
            +
            rubygems_version: 2.5.1
         
     | 
| 
       95 
95 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       96 
96 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       97 
97 
     | 
    
         
             
            summary: Rouge integration with html-pipeline.
         
     |