auto_html 1.6.4 → 2.0.0
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 +7 -0
 - data/README.md +47 -98
 - data/Rakefile +6 -7
 - data/lib/auto_html.rb +9 -15
 - data/lib/auto_html/emoji.rb +57 -0
 - data/lib/auto_html/html_escape.rb +10 -0
 - data/lib/auto_html/image.rb +23 -0
 - data/lib/auto_html/link.rb +31 -0
 - data/lib/auto_html/markdown.rb +15 -0
 - data/lib/auto_html/pipeline.rb +15 -0
 - data/lib/auto_html/simple_format.rb +22 -0
 - data/spec/emoji_spec.rb +9 -0
 - data/spec/html_escape_spec.rb +8 -0
 - data/spec/image_spec.rb +39 -0
 - data/spec/link_spec.rb +39 -0
 - data/spec/markdown_spec.rb +7 -0
 - data/spec/pipeline_spec.rb +24 -0
 - data/spec/simple_format_spec.rb +16 -0
 - data/spec/spec_helper.rb +11 -0
 - metadata +121 -88
 - data/lib/auto_html/auto_html_for.rb +0 -64
 - data/lib/auto_html/base.rb +0 -18
 - data/lib/auto_html/builder.rb +0 -21
 - data/lib/auto_html/capistrano.rb +0 -17
 - data/lib/auto_html/filter.rb +0 -22
 - data/lib/auto_html/filters/dailymotion.rb +0 -6
 - data/lib/auto_html/filters/flickr.rb +0 -20
 - data/lib/auto_html/filters/gist.rb +0 -8
 - data/lib/auto_html/filters/google_map.rb +0 -19
 - data/lib/auto_html/filters/google_video.rb +0 -6
 - data/lib/auto_html/filters/hashtag.rb +0 -7
 - data/lib/auto_html/filters/html_escape.rb +0 -9
 - data/lib/auto_html/filters/image.rb +0 -16
 - data/lib/auto_html/filters/instagram.rb +0 -10
 - data/lib/auto_html/filters/link.rb +0 -16
 - data/lib/auto_html/filters/liveleak.rb +0 -19
 - data/lib/auto_html/filters/metacafe.rb +0 -13
 - data/lib/auto_html/filters/redcarpet.rb +0 -4
 - data/lib/auto_html/filters/sanitize.rb +0 -5
 - data/lib/auto_html/filters/simple_format.rb +0 -12
 - data/lib/auto_html/filters/soundcloud.rb +0 -21
 - data/lib/auto_html/filters/ted.rb +0 -13
 - data/lib/auto_html/filters/twitter.rb +0 -19
 - data/lib/auto_html/filters/vimeo.rb +0 -15
 - data/lib/auto_html/filters/worldstar.rb +0 -8
 - data/lib/auto_html/filters/youtube.rb +0 -19
 - data/lib/auto_html/filters/youtube_image.rb +0 -17
 - data/lib/auto_html/filters/youtube_js_api.rb +0 -6
 - data/lib/auto_html/railtie.rb +0 -10
 - data/lib/auto_html/rake_tasks.rb +0 -27
 - data/lib/auto_html/task.rb +0 -9
 - data/test/fixture_setup.rb +0 -13
 - data/test/fixtures/database.yml +0 -5
 - data/test/fixtures/schema.rb +0 -20
 - data/test/functional/auto_html_for_options_test.rb +0 -26
 - data/test/functional/auto_html_for_test.rb +0 -56
 - data/test/functional/filter_test.rb +0 -27
 - data/test/test_helper.rb +0 -9
 - data/test/unit/auto_html_test.rb +0 -37
 - data/test/unit/filters/dailymotion_test.rb +0 -20
 - data/test/unit/filters/gist_test.rb +0 -15
 - data/test/unit/filters/google_map_test.rb +0 -24
 - data/test/unit/filters/hashtag_test.rb +0 -25
 - data/test/unit/filters/html_escape_test.rb +0 -15
 - data/test/unit/filters/image_test.rb +0 -65
 - data/test/unit/filters/instagram_test.rb +0 -8
 - data/test/unit/filters/link_test.rb +0 -55
 - data/test/unit/filters/liveleak_test.rb +0 -15
 - data/test/unit/filters/metacafe_test.rb +0 -29
 - data/test/unit/filters/redcarpet_test.rb +0 -38
 - data/test/unit/filters/sanitize_test.rb +0 -36
 - data/test/unit/filters/simple_format_test.rb +0 -15
 - data/test/unit/filters/soundcloud_test.rb +0 -29
 - data/test/unit/filters/ted_test.rb +0 -18
 - data/test/unit/filters/twitter_test.rb +0 -45
 - data/test/unit/filters/vimeo_test.rb +0 -50
 - data/test/unit/filters/worldstar_test.rb +0 -14
 - data/test/unit/filters/youtube_image_test.rb +0 -59
 - data/test/unit/filters/youtube_js_api_test.rb +0 -30
 - data/test/unit/filters/youtube_test.rb +0 -59
 - data/test/unit/unit_test_helper.rb +0 -3
 
    
        data/spec/link_spec.rb
    ADDED
    
    | 
         @@ -0,0 +1,39 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            RSpec.describe AutoHtml::Link do
         
     | 
| 
      
 4 
     | 
    
         
            +
              it 'transforms URL to a link' do
         
     | 
| 
      
 5 
     | 
    
         
            +
                result = subject.call('<a href="https://www.ruby-lang.org/en/" >https://www.ruby-lang.org/en/</a>')
         
     | 
| 
      
 6 
     | 
    
         
            +
                expect(result).to eq '<a href="https://www.ruby-lang.org/en/" >https://www.ruby-lang.org/en/</a>'
         
     | 
| 
      
 7 
     | 
    
         
            +
              end
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
              it 'transforms URL with param to a link' do
         
     | 
| 
      
 10 
     | 
    
         
            +
                result = subject.call('http://example.com/abc?query=ruby')
         
     | 
| 
      
 11 
     | 
    
         
            +
                expect(result).to eq '<a href="http://example.com/abc?query=ruby">http://example.com/abc?query=ruby</a>'
         
     | 
| 
      
 12 
     | 
    
         
            +
              end
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
              it 'transforms URL with param and a trailing dot' do
         
     | 
| 
      
 15 
     | 
    
         
            +
                result = subject.call('http://example.com/abc?query=ruby.')
         
     | 
| 
      
 16 
     | 
    
         
            +
                expect(result).to eq '<a href="http://example.com/abc?query=ruby">http://example.com/abc?query=ruby</a>.'
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
              it 'transforms URL with anchor and a trailing dot' do
         
     | 
| 
      
 20 
     | 
    
         
            +
                result = subject.call('http://example.com/example#id=123.12.')
         
     | 
| 
      
 21 
     | 
    
         
            +
                expect(result).to eq '<a href="http://example.com/example#id=123.12">http://example.com/example#id=123.12</a>.'
         
     | 
| 
      
 22 
     | 
    
         
            +
              end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              it 'transforms URL with commas' do
         
     | 
| 
      
 25 
     | 
    
         
            +
                result = subject.call('http://www.dw-world.de/dw/article/0,,4708386,00.html?maca=ser-rss-ser-all-1494-rdf')
         
     | 
| 
      
 26 
     | 
    
         
            +
                expect(result).to eq '<a href="http://www.dw-world.de/dw/article/0,,4708386,00.html?maca=ser-rss-ser-all-1494-rdf">http://www.dw-world.de/dw/article/0,,4708386,00.html?maca=ser-rss-ser-all-1494-rdf</a>'
         
     | 
| 
      
 27 
     | 
    
         
            +
              end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
              it 'transforms complex URL' do
         
     | 
| 
      
 30 
     | 
    
         
            +
                result = subject.call('http://www.google.com/#q=nikola+tesla&ct=tesla09&oi=ddle&fp=Xmf0jJ9P_V0')
         
     | 
| 
      
 31 
     | 
    
         
            +
                expect(result).to eq '<a href="http://www.google.com/#q=nikola+tesla&ct=tesla09&oi=ddle&fp=Xmf0jJ9P_V0">http://www.google.com/#q=nikola+tesla&ct=tesla09&oi=ddle&fp=Xmf0jJ9P_V0</a>'
         
     | 
| 
      
 32 
     | 
    
         
            +
              end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
              it 'transforms with options' do
         
     | 
| 
      
 35 
     | 
    
         
            +
                filter = described_class.new(target: '_blank')
         
     | 
| 
      
 36 
     | 
    
         
            +
                result = filter.call('http://rors.org')
         
     | 
| 
      
 37 
     | 
    
         
            +
                expect(result).to eq '<a href="http://rors.org" target="_blank">http://rors.org</a>'
         
     | 
| 
      
 38 
     | 
    
         
            +
              end
         
     | 
| 
      
 39 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,24 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            RSpec.describe AutoHtml::Pipeline do
         
     | 
| 
      
 4 
     | 
    
         
            +
              subject { described_class.new(AutoHtml::SimpleFormat.new, AutoHtml::Image.new, AutoHtml::Link.new) }
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
              it 'does not transforms input when no filters provided' do
         
     | 
| 
      
 7 
     | 
    
         
            +
                input  = 'Hey check out my blog => http://rors.org'
         
     | 
| 
      
 8 
     | 
    
         
            +
                result = described_class.new.call(input)
         
     | 
| 
      
 9 
     | 
    
         
            +
                expect(result).to eq input
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              it 'transforms input using provided filters' do
         
     | 
| 
      
 13 
     | 
    
         
            +
                result = subject.call 'Check the logo: http://rors.org/images/rails.png. Visit: http://rubyonrails.org'
         
     | 
| 
      
 14 
     | 
    
         
            +
                expect(result).to eq '<p>Check the logo: <img src="http://rors.org/images/rails.png" />. Visit: <a href="http://rubyonrails.org">http://rubyonrails.org</a></p>'
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              it 'is blank if input is blank' do
         
     | 
| 
      
 18 
     | 
    
         
            +
                expect(subject.call '').to eq ''
         
     | 
| 
      
 19 
     | 
    
         
            +
              end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              it 'is blank if input is nil' do
         
     | 
| 
      
 22 
     | 
    
         
            +
                expect(subject.call nil).to eq ''
         
     | 
| 
      
 23 
     | 
    
         
            +
              end
         
     | 
| 
      
 24 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            RSpec.describe AutoHtml::SimpleFormat do
         
     | 
| 
      
 4 
     | 
    
         
            +
              it 'formats input using simple rules' do
         
     | 
| 
      
 5 
     | 
    
         
            +
                result = subject.call('Hey check out my blog => http://rors.org')
         
     | 
| 
      
 6 
     | 
    
         
            +
                expect(result).to eq '<p>Hey check out my blog => http://rors.org</p>'
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                expect(subject.call("crazy\r\n cross\r platform linebreaks")).to eq "<p>crazy\n<br /> cross\n<br /> platform linebreaks</p>"
         
     | 
| 
      
 9 
     | 
    
         
            +
                expect(subject.call("A paragraph\n\nand another one!")).to eq "<p>A paragraph</p>\n\n<p>and another one!</p>"
         
     | 
| 
      
 10 
     | 
    
         
            +
                expect(subject.call("A paragraph\n With a newline")).to eq "<p>A paragraph\n<br /> With a newline</p>"
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                expect(subject.call("A\nB\nC\nD")).to eq "<p>A\n<br />B\n<br />C\n<br />D</p>"
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                expect(subject.call("A\r\n  \nB\n\n\r\n\t\nC\nD")).to eq "<p>A\n<br />  \n<br />B</p>\n\n<p>\t\n<br />C\n<br />D</p>"
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
            end
         
     | 
    
        data/spec/spec_helper.rb
    ADDED
    
    | 
         @@ -0,0 +1,11 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'auto_html'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            RSpec.configure do |config|
         
     | 
| 
      
 4 
     | 
    
         
            +
              config.expect_with :rspec do |expectations|
         
     | 
| 
      
 5 
     | 
    
         
            +
                expectations.include_chain_clauses_in_custom_matcher_descriptions = true
         
     | 
| 
      
 6 
     | 
    
         
            +
              end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
              config.mock_with :rspec do |mocks|
         
     | 
| 
      
 9 
     | 
    
         
            +
                mocks.verify_partial_doubles = true
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,141 +1,174 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: auto_html
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version:  
     | 
| 
       5 
     | 
    
         
            -
              prerelease: 
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.0.0
         
     | 
| 
       6 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       8 
7 
     | 
    
         
             
            - Dejan Simic
         
     | 
| 
       9 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-12-19 00:00:00.000000000 Z
         
     | 
| 
       13 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: tag_helper
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '0.5'
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '0.5'
         
     | 
| 
       14 
27 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
28 
     | 
    
         
             
              name: rinku
         
     | 
| 
       16 
29 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       17 
     | 
    
         
            -
                none: false
         
     | 
| 
       18 
30 
     | 
    
         
             
                requirements:
         
     | 
| 
       19 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 31 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 33 
     | 
    
         
            +
                    version: '1.7'
         
     | 
| 
      
 34 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 35 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 36 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 37 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 38 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 39 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 40 
     | 
    
         
            +
                    version: '1.7'
         
     | 
| 
      
 41 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 42 
     | 
    
         
            +
              name: gemoji
         
     | 
| 
      
 43 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 44 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 45 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       20 
46 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       21 
     | 
    
         
            -
                    version: 1 
     | 
| 
      
 47 
     | 
    
         
            +
                    version: '2.1'
         
     | 
| 
       22 
48 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       23 
49 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       24 
50 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       25 
     | 
    
         
            -
                none: false
         
     | 
| 
       26 
51 
     | 
    
         
             
                requirements:
         
     | 
| 
       27 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 52 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       28 
53 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       29 
     | 
    
         
            -
                    version: 1 
     | 
| 
      
 54 
     | 
    
         
            +
                    version: '2.1'
         
     | 
| 
       30 
55 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       31 
56 
     | 
    
         
             
              name: redcarpet
         
     | 
| 
       32 
57 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       33 
     | 
    
         
            -
                none: false
         
     | 
| 
       34 
58 
     | 
    
         
             
                requirements:
         
     | 
| 
       35 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 59 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       36 
60 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       37 
     | 
    
         
            -
                    version: '3. 
     | 
| 
      
 61 
     | 
    
         
            +
                    version: '3.3'
         
     | 
| 
       38 
62 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       39 
63 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       40 
64 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       41 
     | 
    
         
            -
                none: false
         
     | 
| 
       42 
65 
     | 
    
         
             
                requirements:
         
     | 
| 
       43 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 66 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 67 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 68 
     | 
    
         
            +
                    version: '3.3'
         
     | 
| 
      
 69 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 70 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 71 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 72 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 73 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 74 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 75 
     | 
    
         
            +
                    version: '10.4'
         
     | 
| 
      
 76 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 77 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 78 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 79 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 80 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       44 
81 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       45 
     | 
    
         
            -
                    version: ' 
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
               
     | 
| 
      
 82 
     | 
    
         
            +
                    version: '10.4'
         
     | 
| 
      
 83 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 84 
     | 
    
         
            +
              name: rspec
         
     | 
| 
      
 85 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 86 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 87 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 88 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 89 
     | 
    
         
            +
                    version: '3.3'
         
     | 
| 
      
 90 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 91 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 92 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 93 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 94 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 95 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 96 
     | 
    
         
            +
                    version: '3.3'
         
     | 
| 
      
 97 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 98 
     | 
    
         
            +
              name: rspec_junit_formatter
         
     | 
| 
      
 99 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 100 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 101 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 102 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 103 
     | 
    
         
            +
                    version: '0.2'
         
     | 
| 
      
 104 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 105 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 106 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 107 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 108 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 109 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 110 
     | 
    
         
            +
                    version: '0.2'
         
     | 
| 
      
 111 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 112 
     | 
    
         
            +
              name: rubocop
         
     | 
| 
      
 113 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 114 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 115 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 116 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 117 
     | 
    
         
            +
                    version: '0.33'
         
     | 
| 
      
 118 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 119 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 120 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 121 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 122 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 123 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 124 
     | 
    
         
            +
                    version: '0.33'
         
     | 
| 
      
 125 
     | 
    
         
            +
            description: Collection of filters for transforming text into HTML code
         
     | 
| 
       48 
126 
     | 
    
         
             
            email: desimic@gmail.com
         
     | 
| 
       49 
127 
     | 
    
         
             
            executables: []
         
     | 
| 
       50 
128 
     | 
    
         
             
            extensions: []
         
     | 
| 
       51 
129 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       52 
130 
     | 
    
         
             
            files:
         
     | 
| 
      
 131 
     | 
    
         
            +
            - README.md
         
     | 
| 
       53 
132 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       54 
     | 
    
         
            -
            - lib/auto_html/auto_html_for.rb
         
     | 
| 
       55 
     | 
    
         
            -
            - lib/auto_html/base.rb
         
     | 
| 
       56 
     | 
    
         
            -
            - lib/auto_html/builder.rb
         
     | 
| 
       57 
     | 
    
         
            -
            - lib/auto_html/capistrano.rb
         
     | 
| 
       58 
     | 
    
         
            -
            - lib/auto_html/filter.rb
         
     | 
| 
       59 
     | 
    
         
            -
            - lib/auto_html/filters/dailymotion.rb
         
     | 
| 
       60 
     | 
    
         
            -
            - lib/auto_html/filters/flickr.rb
         
     | 
| 
       61 
     | 
    
         
            -
            - lib/auto_html/filters/gist.rb
         
     | 
| 
       62 
     | 
    
         
            -
            - lib/auto_html/filters/google_map.rb
         
     | 
| 
       63 
     | 
    
         
            -
            - lib/auto_html/filters/google_video.rb
         
     | 
| 
       64 
     | 
    
         
            -
            - lib/auto_html/filters/hashtag.rb
         
     | 
| 
       65 
     | 
    
         
            -
            - lib/auto_html/filters/html_escape.rb
         
     | 
| 
       66 
     | 
    
         
            -
            - lib/auto_html/filters/image.rb
         
     | 
| 
       67 
     | 
    
         
            -
            - lib/auto_html/filters/instagram.rb
         
     | 
| 
       68 
     | 
    
         
            -
            - lib/auto_html/filters/link.rb
         
     | 
| 
       69 
     | 
    
         
            -
            - lib/auto_html/filters/liveleak.rb
         
     | 
| 
       70 
     | 
    
         
            -
            - lib/auto_html/filters/metacafe.rb
         
     | 
| 
       71 
     | 
    
         
            -
            - lib/auto_html/filters/redcarpet.rb
         
     | 
| 
       72 
     | 
    
         
            -
            - lib/auto_html/filters/sanitize.rb
         
     | 
| 
       73 
     | 
    
         
            -
            - lib/auto_html/filters/simple_format.rb
         
     | 
| 
       74 
     | 
    
         
            -
            - lib/auto_html/filters/soundcloud.rb
         
     | 
| 
       75 
     | 
    
         
            -
            - lib/auto_html/filters/ted.rb
         
     | 
| 
       76 
     | 
    
         
            -
            - lib/auto_html/filters/twitter.rb
         
     | 
| 
       77 
     | 
    
         
            -
            - lib/auto_html/filters/vimeo.rb
         
     | 
| 
       78 
     | 
    
         
            -
            - lib/auto_html/filters/worldstar.rb
         
     | 
| 
       79 
     | 
    
         
            -
            - lib/auto_html/filters/youtube.rb
         
     | 
| 
       80 
     | 
    
         
            -
            - lib/auto_html/filters/youtube_image.rb
         
     | 
| 
       81 
     | 
    
         
            -
            - lib/auto_html/filters/youtube_js_api.rb
         
     | 
| 
       82 
     | 
    
         
            -
            - lib/auto_html/railtie.rb
         
     | 
| 
       83 
     | 
    
         
            -
            - lib/auto_html/rake_tasks.rb
         
     | 
| 
       84 
     | 
    
         
            -
            - lib/auto_html/task.rb
         
     | 
| 
       85 
133 
     | 
    
         
             
            - lib/auto_html.rb
         
     | 
| 
       86 
     | 
    
         
            -
            -  
     | 
| 
       87 
     | 
    
         
            -
            -  
     | 
| 
       88 
     | 
    
         
            -
            -  
     | 
| 
       89 
     | 
    
         
            -
            -  
     | 
| 
       90 
     | 
    
         
            -
            -  
     | 
| 
       91 
     | 
    
         
            -
            -  
     | 
| 
       92 
     | 
    
         
            -
            -  
     | 
| 
       93 
     | 
    
         
            -
            -  
     | 
| 
       94 
     | 
    
         
            -
            -  
     | 
| 
       95 
     | 
    
         
            -
            -  
     | 
| 
       96 
     | 
    
         
            -
            -  
     | 
| 
       97 
     | 
    
         
            -
            -  
     | 
| 
       98 
     | 
    
         
            -
            -  
     | 
| 
       99 
     | 
    
         
            -
            -  
     | 
| 
       100 
     | 
    
         
            -
            -  
     | 
| 
       101 
     | 
    
         
            -
             
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
       103 
     | 
    
         
            -
            -  
     | 
| 
       104 
     | 
    
         
            -
             
     | 
| 
       105 
     | 
    
         
            -
            - test/unit/filters/sanitize_test.rb
         
     | 
| 
       106 
     | 
    
         
            -
            - test/unit/filters/simple_format_test.rb
         
     | 
| 
       107 
     | 
    
         
            -
            - test/unit/filters/soundcloud_test.rb
         
     | 
| 
       108 
     | 
    
         
            -
            - test/unit/filters/ted_test.rb
         
     | 
| 
       109 
     | 
    
         
            -
            - test/unit/filters/twitter_test.rb
         
     | 
| 
       110 
     | 
    
         
            -
            - test/unit/filters/vimeo_test.rb
         
     | 
| 
       111 
     | 
    
         
            -
            - test/unit/filters/worldstar_test.rb
         
     | 
| 
       112 
     | 
    
         
            -
            - test/unit/filters/youtube_image_test.rb
         
     | 
| 
       113 
     | 
    
         
            -
            - test/unit/filters/youtube_js_api_test.rb
         
     | 
| 
       114 
     | 
    
         
            -
            - test/unit/filters/youtube_test.rb
         
     | 
| 
       115 
     | 
    
         
            -
            - test/unit/unit_test_helper.rb
         
     | 
| 
       116 
     | 
    
         
            -
            - README.md
         
     | 
| 
       117 
     | 
    
         
            -
            homepage: http://github.com/dejan/auto_html
         
     | 
| 
       118 
     | 
    
         
            -
            licenses: []
         
     | 
| 
      
 134 
     | 
    
         
            +
            - lib/auto_html/emoji.rb
         
     | 
| 
      
 135 
     | 
    
         
            +
            - lib/auto_html/html_escape.rb
         
     | 
| 
      
 136 
     | 
    
         
            +
            - lib/auto_html/image.rb
         
     | 
| 
      
 137 
     | 
    
         
            +
            - lib/auto_html/link.rb
         
     | 
| 
      
 138 
     | 
    
         
            +
            - lib/auto_html/markdown.rb
         
     | 
| 
      
 139 
     | 
    
         
            +
            - lib/auto_html/pipeline.rb
         
     | 
| 
      
 140 
     | 
    
         
            +
            - lib/auto_html/simple_format.rb
         
     | 
| 
      
 141 
     | 
    
         
            +
            - spec/emoji_spec.rb
         
     | 
| 
      
 142 
     | 
    
         
            +
            - spec/html_escape_spec.rb
         
     | 
| 
      
 143 
     | 
    
         
            +
            - spec/image_spec.rb
         
     | 
| 
      
 144 
     | 
    
         
            +
            - spec/link_spec.rb
         
     | 
| 
      
 145 
     | 
    
         
            +
            - spec/markdown_spec.rb
         
     | 
| 
      
 146 
     | 
    
         
            +
            - spec/pipeline_spec.rb
         
     | 
| 
      
 147 
     | 
    
         
            +
            - spec/simple_format_spec.rb
         
     | 
| 
      
 148 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     | 
| 
      
 149 
     | 
    
         
            +
            homepage: https://github.com/dejan/auto_html
         
     | 
| 
      
 150 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 151 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 152 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
       119 
153 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
       120 
154 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       121 
155 
     | 
    
         
             
            require_paths:
         
     | 
| 
       122 
156 
     | 
    
         
             
            - lib
         
     | 
| 
       123 
157 
     | 
    
         
             
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
       124 
     | 
    
         
            -
              none: false
         
     | 
| 
       125 
158 
     | 
    
         
             
              requirements:
         
     | 
| 
       126 
     | 
    
         
            -
              - -  
     | 
| 
      
 159 
     | 
    
         
            +
              - - ">="
         
     | 
| 
       127 
160 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       128 
161 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       129 
162 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       130 
     | 
    
         
            -
              none: false
         
     | 
| 
       131 
163 
     | 
    
         
             
              requirements:
         
     | 
| 
       132 
     | 
    
         
            -
              - -  
     | 
| 
      
 164 
     | 
    
         
            +
              - - ">="
         
     | 
| 
       133 
165 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       134 
166 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       135 
167 
     | 
    
         
             
            requirements: []
         
     | 
| 
       136 
168 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       137 
     | 
    
         
            -
            rubygems_version:  
     | 
| 
      
 169 
     | 
    
         
            +
            rubygems_version: 2.4.5
         
     | 
| 
       138 
170 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       139 
     | 
    
         
            -
            specification_version:  
     | 
| 
       140 
     | 
    
         
            -
            summary:  
     | 
| 
      
 171 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 172 
     | 
    
         
            +
            summary: Plain text to HTML conversion
         
     | 
| 
       141 
173 
     | 
    
         
             
            test_files: []
         
     | 
| 
      
 174 
     | 
    
         
            +
            has_rdoc: 
         
     | 
| 
         @@ -1,64 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require 'rails'
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            require 'active_support/core_ext/module/attribute_accessors' if Rails::VERSION::MAJOR >= 4
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            module AutoHtmlFor
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
              # default options that can be overridden on the global level
         
     | 
| 
       8 
     | 
    
         
            -
              @@auto_html_for_options = {
         
     | 
| 
       9 
     | 
    
         
            -
                :htmlized_attribute_suffix => '_html'
         
     | 
| 
       10 
     | 
    
         
            -
              }
         
     | 
| 
       11 
     | 
    
         
            -
              mattr_reader :auto_html_for_options
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
              def self.included(base)
         
     | 
| 
       14 
     | 
    
         
            -
                base.extend(ClassMethods)
         
     | 
| 
       15 
     | 
    
         
            -
              end
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
              module ClassMethods
         
     | 
| 
       18 
     | 
    
         
            -
                def auto_html_for(raw_attrs, &proc)
         
     | 
| 
       19 
     | 
    
         
            -
                  include AutoHtmlFor::InstanceMethods
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
                  if defined?(ActiveRecord) == "constant"
         
     | 
| 
       22 
     | 
    
         
            -
                    return unless ActiveRecord::Base.connection.table_exists? self.table_name
         
     | 
| 
       23 
     | 
    
         
            -
                  end
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
                  suffix =  AutoHtmlFor.auto_html_for_options[:htmlized_attribute_suffix]
         
     | 
| 
       26 
     | 
    
         
            -
                  auto_html_for_columns = [raw_attrs].flatten.map { |a| "#{a}#{suffix}" }
         
     | 
| 
       27 
     | 
    
         
            -
                  
         
     | 
| 
       28 
     | 
    
         
            -
                  # Needed for Mongoid
         
     | 
| 
       29 
     | 
    
         
            -
                  column_names = self.respond_to?(:column_names) ? self.column_names : fields.keys
         
     | 
| 
       30 
     | 
    
         
            -
                  
         
     | 
| 
       31 
     | 
    
         
            -
                  missing_cache_columns =  auto_html_for_columns - column_names
         
     | 
| 
       32 
     | 
    
         
            -
                  missing_cache_columns.each do |missing_cache_column|
         
     | 
| 
       33 
     | 
    
         
            -
                    raw_attr = missing_cache_column.gsub(suffix, '')
         
     | 
| 
       34 
     | 
    
         
            -
                    define_method(missing_cache_column) do
         
     | 
| 
       35 
     | 
    
         
            -
                      val = self[raw_attr] || self.send(raw_attr.to_sym)
         
     | 
| 
       36 
     | 
    
         
            -
                      auto_html(val, &proc)
         
     | 
| 
       37 
     | 
    
         
            -
                    end
         
     | 
| 
       38 
     | 
    
         
            -
                  end
         
     | 
| 
       39 
     | 
    
         
            -
                  
         
     | 
| 
       40 
     | 
    
         
            -
                  cache_columns = auto_html_for_columns - missing_cache_columns
         
     | 
| 
       41 
     | 
    
         
            -
                  cache_columns.each do |cache_column|
         
     | 
| 
       42 
     | 
    
         
            -
                    raw_attr = cache_column.gsub(suffix, '')
         
     | 
| 
       43 
     | 
    
         
            -
                    define_method("#{raw_attr}=") do |val|
         
     | 
| 
       44 
     | 
    
         
            -
                      self[raw_attr] = val
         
     | 
| 
       45 
     | 
    
         
            -
                      result = auto_html(val, &proc)
         
     | 
| 
       46 
     | 
    
         
            -
                      self.send("#{cache_column}=", result)
         
     | 
| 
       47 
     | 
    
         
            -
                      val
         
     | 
| 
       48 
     | 
    
         
            -
                    end
         
     | 
| 
       49 
     | 
    
         
            -
                    
         
     | 
| 
       50 
     | 
    
         
            -
                    define_method(cache_column) do
         
     | 
| 
       51 
     | 
    
         
            -
                      result = self[cache_column]
         
     | 
| 
       52 
     | 
    
         
            -
                      result.respond_to?(:html_safe) ? result.html_safe : result
         
     | 
| 
       53 
     | 
    
         
            -
                    end
         
     | 
| 
       54 
     | 
    
         
            -
                  end
         
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
                end
         
     | 
| 
       57 
     | 
    
         
            -
              end
         
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
              module InstanceMethods
         
     | 
| 
       60 
     | 
    
         
            -
                include AutoHtml
         
     | 
| 
       61 
     | 
    
         
            -
              end
         
     | 
| 
       62 
     | 
    
         
            -
            end
         
     | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
       64 
     | 
    
         
            -
             
     | 
    
        data/lib/auto_html/base.rb
    DELETED
    
    | 
         @@ -1,18 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            module AutoHtml
         
     | 
| 
       2 
     | 
    
         
            -
              extend self
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
              def self.add_filter(name, &block)
         
     | 
| 
       5 
     | 
    
         
            -
                AutoHtml::Builder.add_filter(name, &block)
         
     | 
| 
       6 
     | 
    
         
            -
              end
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
              def auto_html(raw, &proc)
         
     | 
| 
       9 
     | 
    
         
            -
                return "" if raw.blank?
         
     | 
| 
       10 
     | 
    
         
            -
                builder = Builder.new(raw)
         
     | 
| 
       11 
     | 
    
         
            -
                result = builder.instance_eval(&proc)
         
     | 
| 
       12 
     | 
    
         
            -
                return raw if result.nil?
         
     | 
| 
       13 
     | 
    
         
            -
                result.respond_to?(:html_safe) ?
         
     | 
| 
       14 
     | 
    
         
            -
                  result.html_safe :
         
     | 
| 
       15 
     | 
    
         
            -
                    result
         
     | 
| 
       16 
     | 
    
         
            -
              end
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
            end
         
     |