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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45fab522fafd72280e5c32a70f46201cf31cb3936c931b73e53609e6b81f68ab
4
- data.tar.gz: ec172364ac155f64c36c922859493e7228790fb3bf12b6db55fc6954cdc497b3
3
+ metadata.gz: 756970df6515df5bf1fc6cdc181e9d389d5c076ac95a43a2c8d530bbc85aa0db
4
+ data.tar.gz: 82c8c1d81c7b985f7a135ce163fea119cbe86b503d649a5bf2708a322b50392f
5
5
  SHA512:
6
- metadata.gz: 48d62ecf4fa8c9e1ae0602b408954a5727971379863b5a3ed56a46a03c25a24d33088214d5020aca707c98b257907dbcd2859c98d2b2c988a92d54d3a81aa01a
7
- data.tar.gz: bd9631d10eac751d06bc82c46d7a529a75d1f58285b580824bf06fb6ce009c12465d58f2e8875d6ac21b29d2676dac1288b70a2076d69d3b71fe56378dd95e1d
6
+ metadata.gz: 416746835847cb369e4f136073c3bbd5f17392ff68576820e8fb6f45092eb0b89f455a13e2a4c7ef989266f2bdb748f2e6b58a21ae657a5028b1be4fc0e01fcf
7
+ data.tar.gz: 11b644be465484ec6e5eb6c154f75cad34bf179294a1e7103c55eb1295491513694bf12d2c8f8436909950834b4ee6fcefb5b20d6366ba42e1c997cd03cfa730
@@ -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
  [![Gem Version](https://badge.fury.io/rb/sassc-inline-svg.svg)](https://badge.fury.io/rb/sassc-inline-svg)
4
+ [![Build Status](https://travis-ci.org/OrdinaryMagic/sassc-inline-svg.svg?branch=master)](https://travis-ci.org/OrdinaryMagic/sassc-inline-svg)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/12d2b44eba163f7ca09e/maintainability)](https://codeclimate.com/github/OrdinaryMagic/sassc-inline-svg/maintainability)
6
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/12d2b44eba163f7ca09e/test_coverage)](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
 
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'sassc-rails'
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
 
@@ -3,6 +3,6 @@
3
3
 
4
4
  module SassC
5
5
  module InlineSVG
6
- VERSION = '0.0.2'
6
+ VERSION = '0.0.3'
7
7
  end
8
8
  end
@@ -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-rails', '~> 2.0'
20
+ s.add_dependency 'sassc', '~> 2.0'
21
21
 
22
22
  s.add_development_dependency 'rspec', "~> 3.0"
23
- s.add_development_dependency 'simplecov', '~> 0.19'
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.2
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-rails
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: '0.19'
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: '0.19'
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