undraw 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/README.md +17 -9
- data/lib/undraw/helper.rb +9 -2
- data/lib/undraw/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 461d8f0b985f1b1fde5e56eb1c20e47df84eb7480f5e91628fd2b5d018af2353
|
4
|
+
data.tar.gz: 5b2cfec3950b43c938f46b83d7c9cf7026dd0f5f370b7cea4f744d473cd7706a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31aa52e5a0a0ce8aac73cc703b16503f1ee19b8a90b1db4c55ba81d4a04247bc50924dd5248b2229192532e5db3af99e67f5856634ef25f34f1a132682a7d90c
|
7
|
+
data.tar.gz: 9809411cf274edf9dfdc1150047dfaab697a159ac009be8587fcccb1fae060ab74279e344897a6c29f81b4a6597fe3f210a156f5dfd2bfd75ca763d90810ef88
|
data/Gemfile.lock
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
undraw (0.
|
4
|
+
undraw (0.3.3)
|
5
5
|
inline_svg (~> 1.3.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (5.2.
|
10
|
+
activesupport (5.2.3)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
12
|
i18n (>= 0.7, < 2)
|
13
13
|
minitest (~> 5.1)
|
14
14
|
tzinfo (~> 1.1)
|
15
|
-
concurrent-ruby (1.1.
|
16
|
-
i18n (1.
|
15
|
+
concurrent-ruby (1.1.5)
|
16
|
+
i18n (1.6.0)
|
17
17
|
concurrent-ruby (~> 1.0)
|
18
18
|
inline_svg (1.3.1)
|
19
19
|
activesupport (>= 3.0)
|
20
20
|
nokogiri (>= 1.6)
|
21
21
|
mini_portile2 (2.4.0)
|
22
22
|
minitest (5.11.3)
|
23
|
-
nokogiri (1.
|
23
|
+
nokogiri (1.10.3)
|
24
24
|
mini_portile2 (~> 2.4.0)
|
25
25
|
rake (10.5.0)
|
26
26
|
thread_safe (0.3.6)
|
@@ -36,4 +36,4 @@ DEPENDENCIES
|
|
36
36
|
undraw!
|
37
37
|
|
38
38
|
BUNDLED WITH
|
39
|
-
1.17.
|
39
|
+
1.17.2
|
data/README.md
CHANGED
@@ -45,18 +45,26 @@ Browse to find the [images](https://undraw.co/illustrations) that fit your needs
|
|
45
45
|
<%= undraw("designer_life", color: "#ff6347", class: "undraw-designer-life") %>
|
46
46
|
```
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
This gem will often update assets perhaps weekly. You need to manually update your installed gem to support new svg released.
|
52
|
-
|
53
|
-
$ bundle update undraw
|
54
|
-
|
48
|
+
## Update
|
49
|
+
Run bundle update to latest gem released
|
55
50
|
|
56
|
-
|
57
|
-
|
51
|
+
```$ bundle update undraw```
|
52
|
+
|
53
|
+
Due the license issue, any new illustrations released are no longer added to this gems and existing assets might be removed in a future release.
|
54
|
+
You need to manually download preferred svg file and put on:
|
55
|
+
|
56
|
+
```\vendor\images\undraw\<asset_name>.svg```
|
57
|
+
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
# default color
|
61
|
+
<%= undraw("<asset_name>") %>
|
62
|
+
```
|
58
63
|
|
59
64
|
|
65
|
+
## Development
|
66
|
+
DEMO: http://materialize.labs.my/undraw
|
67
|
+
|
60
68
|
|
61
69
|
## Contributing
|
62
70
|
|
data/lib/undraw/helper.rb
CHANGED
@@ -3,8 +3,15 @@ module Undraw
|
|
3
3
|
|
4
4
|
def undraw(filename, transform_params={})
|
5
5
|
asset_path = "#{Undraw.root}/vendor/assets/images/undraw/#{filename}.svg"
|
6
|
+
vendor_path = "#{Rails.root}/vendor/assets/images/undraw/#{filename}.svg"
|
6
7
|
begin
|
7
|
-
|
8
|
+
|
9
|
+
if File.exist?(vendor_path)
|
10
|
+
svg_file = File.read(vendor_path)
|
11
|
+
else
|
12
|
+
svg_file = File.read(asset_path)
|
13
|
+
end
|
14
|
+
|
8
15
|
color = transform_params.delete(:color)
|
9
16
|
|
10
17
|
if color.is_a?(Hash)
|
@@ -19,7 +26,7 @@ module Undraw
|
|
19
26
|
#inline_svg svg_file, class: 'some-class'
|
20
27
|
InlineSvg::TransformPipeline.generate_html_from(svg_file, transform_params).html_safe
|
21
28
|
rescue Errno::ENOENT
|
22
|
-
raise Undraw::FileNotFound.new("Asset not found: #{
|
29
|
+
raise Undraw::FileNotFound.new("Asset not found: #{filename}, you can manually download and place svg in #{vendor_path}")
|
23
30
|
end
|
24
31
|
end
|
25
32
|
|
data/lib/undraw/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: undraw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mkhairi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inline_svg
|