svg-inline-file-extractor 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cb1fcd20c40f02c464a4d5e8ff4faab3eb00119
4
- data.tar.gz: a32965212ff272a8e300e2845c29049edf63331c
3
+ metadata.gz: 86bd56dfb132d0e44d1f43e90b90d3820d80bd94
4
+ data.tar.gz: 4b3ccf10067ce9769e6b9e77ad84865a2e284bdf
5
5
  SHA512:
6
- metadata.gz: d33e116ff51ba9db45ef31be73eab7f69e17231cc5c1dec43499c00e8295c5bff8627bb0df0de5922f901cd939c745a574fe12446fa0dca1b8addc4fa927dd75
7
- data.tar.gz: 76af0d55eba87d4eb72f2ced0275badd6a3eb74fe42916a7ae71033146ecf9003cc2dfa74ac0fc767299ff2914eef743375020caa7a09c77ad4dafeaa09914bf
6
+ metadata.gz: 7a393389a63bd08ce0909649d68b8ae3ef59e952df8ae86da881f09a2f005a2bb325869d77e2543490e429b9081c82747f19757d2891f03692548cd4eda02964
7
+ data.tar.gz: a026ad5434c85b87ea2f9a7be413acd49686bd597bf3446660e8d658509534101220fe450fb39879f9d27ed42314d3c6421661ddda19bb0f046bb6af1d991ff4
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.3.0
4
+ - 2.2.0
4
5
  before_install: gem install bundler -v 1.11.2
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem "codeclimate-test-reporter", group: :test, require: nil
4
+
3
5
  # Specify your gem's dependencies in svg_inline_file_extractor.gemspec
4
6
  gemspec
data/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # SvgInlineFileExtractor
1
+ # Svg Inline File Extractor
2
+ [![Build Status](https://travis-ci.org/boie0025/svg_inline_file_extractor.svg?branch=master)](https://travis-ci.org/boie0025/svg_inline_file_extractor)
3
+ [![Test Coverage](https://codeclimate.com/github/boie0025/svg_inline_file_extractor/badges/coverage.svg)](https://codeclimate.com/github/boie0025/svg_inline_file_extractor/coverage)
4
+ [![Code Climate](https://codeclimate.com/github/boie0025/svg_inline_file_extractor/badges/gpa.svg)](https://codeclimate.com/github/boie0025/svg_inline_file_extractor)
5
+
2
6
 
3
7
  The purpose of this gem is to extract inline SVG base64 encoded PNG images. This is based in part from ideas in https://gist.github.com/r10r/2822884
4
8
 
@@ -16,7 +20,7 @@ This is a work in progress.
16
20
  Add this line to your application's Gemfile:
17
21
 
18
22
  ```ruby
19
- gem 'svg_inline_file_extractor'
23
+ gem 'svg-inline-file-extractor'
20
24
  ```
21
25
 
22
26
  And then execute:
@@ -25,7 +29,7 @@ And then execute:
25
29
 
26
30
  Or install it yourself as:
27
31
 
28
- $ gem install svg_inline_file_extractor
32
+ $ gem install svg-inline-file-extractor
29
33
 
30
34
  ## Usage
31
35
 
@@ -2,10 +2,7 @@ require "svg_inline_file_extractor/version"
2
2
  require "svg_inline_file_extractor/svg_file"
3
3
 
4
4
  module SvgInlineFileExtractor
5
- def self.binary_images(path: nil, xml: nil)
6
- raise ArgumentError.new("Specify a path: [full path], or xml: [SVG String]") unless (path || xml)
7
- raise ArgumentError.new("Specify either a path: [full path], or xml: [SVG String]") if (path && xml)
8
- return SvgFile.from_path(path).binary_images if path
9
- return SvgFile.from_string(xml).binary_images if xml
5
+ def self.binary_images(string)
6
+ SvgFile.binary_images(string)
10
7
  end
11
8
  end
@@ -5,13 +5,8 @@ module SvgInlineFileExtractor
5
5
  class SvgFile
6
6
 
7
7
  class << self
8
- def from_path(path)
9
- string = File.read(path)
10
- new(string)
11
- end
12
-
13
- def from_string(string)
14
- new(string)
8
+ def binary_images(string)
9
+ new(string).binary_images
15
10
  end
16
11
 
17
12
  def strip_header_from(string)
@@ -1,3 +1,3 @@
1
1
  module SvgInlineFileExtractor
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svg-inline-file-extractor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Boie
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project:
123
- rubygems_version: 2.5.2
123
+ rubygems_version: 2.5.1
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Extract inline SVG base64 encoded images, and other inline files.