svg-inline-file-extractor 0.1.0 → 0.1.1
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 +1 -0
- data/Gemfile +2 -0
- data/README.md +7 -3
- data/lib/svg_inline_file_extractor.rb +2 -5
- data/lib/svg_inline_file_extractor/svg_file.rb +2 -7
- data/lib/svg_inline_file_extractor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86bd56dfb132d0e44d1f43e90b90d3820d80bd94
|
4
|
+
data.tar.gz: 4b3ccf10067ce9769e6b9e77ad84865a2e284bdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a393389a63bd08ce0909649d68b8ae3ef59e952df8ae86da881f09a2f005a2bb325869d77e2543490e429b9081c82747f19757d2891f03692548cd4eda02964
|
7
|
+
data.tar.gz: a026ad5434c85b87ea2f9a7be413acd49686bd597bf3446660e8d658509534101220fe450fb39879f9d27ed42314d3c6421661ddda19bb0f046bb6af1d991ff4
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# Svg Inline File Extractor
|
2
|
+
[](https://travis-ci.org/boie0025/svg_inline_file_extractor)
|
3
|
+
[](https://codeclimate.com/github/boie0025/svg_inline_file_extractor/coverage)
|
4
|
+
[](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 '
|
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
|
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(
|
6
|
-
|
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
|
9
|
-
string
|
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)
|
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.
|
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.
|
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.
|