sassc-inline-svg 0.0.2 → 0.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/.travis.yml +15 -0
 - data/README.md +3 -0
 - data/Rakefile +6 -0
 - data/lib/sassc-inline-svg.rb +9 -7
 - data/lib/sassc-inline-svg/version.rb +1 -1
 - data/sassc-inline-svg.gemspec +2 -2
 - metadata +8 -6
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 756970df6515df5bf1fc6cdc181e9d389d5c076ac95a43a2c8d530bbc85aa0db
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 82c8c1d81c7b985f7a135ce163fea119cbe86b503d649a5bf2708a322b50392f
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 416746835847cb369e4f136073c3bbd5f17392ff68576820e8fb6f45092eb0b89f455a13e2a4c7ef989266f2bdb748f2e6b58a21ae657a5028b1be4fc0e01fcf
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 11b644be465484ec6e5eb6c154f75cad34bf179294a1e7103c55eb1295491513694bf12d2c8f8436909950834b4ee6fcefb5b20d6366ba42e1c997cd03cfa730
         
     | 
    
        data/.travis.yml
    ADDED
    
    | 
         @@ -0,0 +1,15 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            env:
         
     | 
| 
      
 2 
     | 
    
         
            +
              global:
         
     | 
| 
      
 3 
     | 
    
         
            +
                - CC_TEST_REPORTER_ID=91cbbc09da385c121252eaa16660d01c14c02f5c09f179e03415f4b75eda0361
         
     | 
| 
      
 4 
     | 
    
         
            +
            language: ruby
         
     | 
| 
      
 5 
     | 
    
         
            +
            rvm:
         
     | 
| 
      
 6 
     | 
    
         
            +
              - 2.6.5
         
     | 
| 
      
 7 
     | 
    
         
            +
            before_install: gem install bundler
         
     | 
| 
      
 8 
     | 
    
         
            +
            before_script:
         
     | 
| 
      
 9 
     | 
    
         
            +
              - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
         
     | 
| 
      
 10 
     | 
    
         
            +
              - chmod +x ./cc-test-reporter
         
     | 
| 
      
 11 
     | 
    
         
            +
              - ./cc-test-reporter before-build
         
     | 
| 
      
 12 
     | 
    
         
            +
            script:
         
     | 
| 
      
 13 
     | 
    
         
            +
              - bundle exec rake
         
     | 
| 
      
 14 
     | 
    
         
            +
            after_script:
         
     | 
| 
      
 15 
     | 
    
         
            +
              - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,6 +1,9 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # sassс-inline-svg
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            [](https://badge.fury.io/rb/sassc-inline-svg)
         
     | 
| 
      
 4 
     | 
    
         
            +
            [](https://travis-ci.org/OrdinaryMagic/sassc-inline-svg)
         
     | 
| 
      
 5 
     | 
    
         
            +
            [](https://codeclimate.com/github/OrdinaryMagic/sassc-inline-svg/maintainability)
         
     | 
| 
      
 6 
     | 
    
         
            +
            [](https://codeclimate.com/github/OrdinaryMagic/sassc-inline-svg/test_coverage)
         
     | 
| 
       4 
7 
     | 
    
         | 
| 
       5 
8 
     | 
    
         
             
            Inline url-encoded SVG with Sassc. Optional variable string replacement included!
         
     | 
| 
       6 
9 
     | 
    
         | 
    
        data/Rakefile
    ADDED
    
    
    
        data/lib/sassc-inline-svg.rb
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # encoding: UTF-8
         
     | 
| 
       2 
2 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
     | 
    
         
            -
            require 'sassc 
     | 
| 
      
 4 
     | 
    
         
            +
            require 'sassc'
         
     | 
| 
       5 
5 
     | 
    
         
             
            require 'cgi'
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
            module SassC::InlineSVG
         
     | 
| 
         @@ -15,18 +15,20 @@ module SassC::InlineSVG 
     | 
|
| 
       15 
15 
     | 
    
         
             
                private
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
                def read_file(path)
         
     | 
| 
       18 
     | 
    
         
            -
                  if defined?(Rails) && Rails.application
         
     | 
| 
       19 
     | 
    
         
            -
                    source = Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)
         
     | 
| 
       20 
     | 
    
         
            -
                    asset = source.find_asset(path)
         
     | 
| 
       21 
     | 
    
         
            -
                    raise "File not found or cannot be read (Sprockets): #{path}" if asset.nil?
         
     | 
| 
      
 18 
     | 
    
         
            +
                  return find_rails_asset(path) if defined?(Rails) && Rails.application
         
     | 
| 
       22 
19 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
                    return asset.to_s
         
     | 
| 
       24 
     | 
    
         
            -
                  end
         
     | 
| 
       25 
20 
     | 
    
         
             
                  raise SassC::SyntaxError, "File not found or cannot be read (native): #{path}" unless File.readable?(path)
         
     | 
| 
       26 
21 
     | 
    
         | 
| 
       27 
22 
     | 
    
         
             
                  File.open(path, 'rb') { |f| f.read }.strip
         
     | 
| 
       28 
23 
     | 
    
         
             
                end
         
     | 
| 
       29 
24 
     | 
    
         | 
| 
      
 25 
     | 
    
         
            +
                def find_rails_asset(path)
         
     | 
| 
      
 26 
     | 
    
         
            +
                  source = Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)
         
     | 
| 
      
 27 
     | 
    
         
            +
                  asset = source.find_asset(path)
         
     | 
| 
      
 28 
     | 
    
         
            +
                  raise "File not found or cannot be read (Sprockets): #{path}" if asset.nil?
         
     | 
| 
      
 29 
     | 
    
         
            +
                  asset.to_s
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
       30 
32 
     | 
    
         
             
                def replace_options(svg, options)
         
     | 
| 
       31 
33 
     | 
    
         
             
                  return svg if options.nil?
         
     | 
| 
       32 
34 
     | 
    
         | 
    
        data/sassc-inline-svg.gemspec
    CHANGED
    
    | 
         @@ -17,8 +17,8 @@ Gem::Specification.new do |s| 
     | 
|
| 
       17 
17 
     | 
    
         
             
              s.test_files      = `git ls-files -z -- {test,spec,features}/*`.split("\x0")
         
     | 
| 
       18 
18 
     | 
    
         
             
              s.require_paths   = ['lib']
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
              s.add_dependency 'sassc 
     | 
| 
      
 20 
     | 
    
         
            +
              s.add_dependency 'sassc', '~> 2.0'
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
              s.add_development_dependency 'rspec', "~> 3.0"
         
     | 
| 
       23 
     | 
    
         
            -
              s.add_development_dependency 'simplecov', ' 
     | 
| 
      
 23 
     | 
    
         
            +
              s.add_development_dependency 'simplecov', '0.17.1'
         
     | 
| 
       24 
24 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: sassc-inline-svg
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Dmitry Leonov
         
     | 
| 
         @@ -11,7 +11,7 @@ cert_chain: [] 
     | 
|
| 
       11 
11 
     | 
    
         
             
            date: 2020-10-26 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
     | 
    
         
            -
              name: sassc 
     | 
| 
      
 14 
     | 
    
         
            +
              name: sassc
         
     | 
| 
       15 
15 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       16 
16 
     | 
    
         
             
                requirements:
         
     | 
| 
       17 
17 
     | 
    
         
             
                - - "~>"
         
     | 
| 
         @@ -42,16 +42,16 @@ dependencies: 
     | 
|
| 
       42 
42 
     | 
    
         
             
              name: simplecov
         
     | 
| 
       43 
43 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       44 
44 
     | 
    
         
             
                requirements:
         
     | 
| 
       45 
     | 
    
         
            -
                - -  
     | 
| 
      
 45 
     | 
    
         
            +
                - - '='
         
     | 
| 
       46 
46 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       47 
     | 
    
         
            -
                    version:  
     | 
| 
      
 47 
     | 
    
         
            +
                    version: 0.17.1
         
     | 
| 
       48 
48 
     | 
    
         
             
              type: :development
         
     | 
| 
       49 
49 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       50 
50 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       51 
51 
     | 
    
         
             
                requirements:
         
     | 
| 
       52 
     | 
    
         
            -
                - -  
     | 
| 
      
 52 
     | 
    
         
            +
                - - '='
         
     | 
| 
       53 
53 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       54 
     | 
    
         
            -
                    version:  
     | 
| 
      
 54 
     | 
    
         
            +
                    version: 0.17.1
         
     | 
| 
       55 
55 
     | 
    
         
             
            description: Adds inline_svg as a Sass function.
         
     | 
| 
       56 
56 
     | 
    
         
             
            email: ordm67@gmail.com
         
     | 
| 
       57 
57 
     | 
    
         
             
            executables: []
         
     | 
| 
         @@ -60,8 +60,10 @@ extra_rdoc_files: [] 
     | 
|
| 
       60 
60 
     | 
    
         
             
            files:
         
     | 
| 
       61 
61 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
       62 
62 
     | 
    
         
             
            - ".rspec"
         
     | 
| 
      
 63 
     | 
    
         
            +
            - ".travis.yml"
         
     | 
| 
       63 
64 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       64 
65 
     | 
    
         
             
            - README.md
         
     | 
| 
      
 66 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
       65 
67 
     | 
    
         
             
            - lib/sassc-inline-svg.rb
         
     | 
| 
       66 
68 
     | 
    
         
             
            - lib/sassc-inline-svg/version.rb
         
     | 
| 
       67 
69 
     | 
    
         
             
            - sassc-inline-svg.gemspec
         
     |