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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1a009ebd4fa6a9f1bd0de8b591ebd844dc5dd68b3471675a01d7700828044c0
4
- data.tar.gz: e709c62511471c9364268ac41c07be3cc03452a98bee975d62e99b502d6555b2
3
+ metadata.gz: 461d8f0b985f1b1fde5e56eb1c20e47df84eb7480f5e91628fd2b5d018af2353
4
+ data.tar.gz: 5b2cfec3950b43c938f46b83d7c9cf7026dd0f5f370b7cea4f744d473cd7706a
5
5
  SHA512:
6
- metadata.gz: ee88f402d3a0d4b4c86558739facbb1e426a612986498481b8599823371003c662408076bd7a61f6465d5e9c6afcef2044589439249e20410a5e5fe404e18d3f
7
- data.tar.gz: 0d08935413caf51f41069fc93fec99901f5e4d059a1aa29d69f8a19e7699cebaad2a0793178371ae6c8cefdde5fc5180420dcd6feef5cf8167533e3f67b7a5a6
6
+ metadata.gz: 31aa52e5a0a0ce8aac73cc703b16503f1ee19b8a90b1db4c55ba81d4a04247bc50924dd5248b2229192532e5db3af99e67f5856634ef25f34f1a132682a7d90c
7
+ data.tar.gz: 9809411cf274edf9dfdc1150047dfaab697a159ac009be8587fcccb1fae060ab74279e344897a6c29f81b4a6597fe3f210a156f5dfd2bfd75ca763d90810ef88
@@ -1,26 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- undraw (0.2.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.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.4)
16
- i18n (1.4.0)
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.9.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.1
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
- **Note:
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
- DEMO: http://materialize.labs.my/undraw
57
- ## Development
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
 
@@ -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
- svg_file = File.read(asset_path)
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: #{asset_path}")
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
 
@@ -1,3 +1,3 @@
1
1
  module Undraw
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
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.2
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-18 00:00:00.000000000 Z
11
+ date: 2019-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inline_svg