middleman-svg 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +13 -0
  3. data/bin/console +1 -1
  4. data/lib/middleman-svg.rb +6 -3
  5. data/lib/middleman-svg/asset_file.rb +16 -0
  6. data/lib/{middleman/svg → middleman-svg}/extension.rb +19 -9
  7. data/lib/{middleman/svg → middleman-svg}/id_generator.rb +0 -0
  8. data/lib/{middleman/svg → middleman-svg}/io_resource.rb +0 -7
  9. data/lib/{middleman → middleman-svg}/svg.rb +3 -0
  10. data/lib/{middleman/svg → middleman-svg}/transform_pipeline.rb +2 -2
  11. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations.rb +15 -15
  12. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/aria_attributes.rb +0 -0
  13. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/aria_hidden.rb +0 -0
  14. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/aria_hidden_attribute.rb +0 -0
  15. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/class_attribute.rb +0 -0
  16. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/data_attributes.rb +0 -0
  17. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/description.rb +0 -0
  18. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/height.rb +0 -0
  19. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/id_attribute.rb +0 -0
  20. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/no_comment.rb +0 -0
  21. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/no_defs.rb +0 -0
  22. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/preserve_aspect_ratio.rb +0 -0
  23. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/size.rb +0 -0
  24. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/style_attribute.rb +0 -0
  25. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/title.rb +0 -0
  26. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/transformation.rb +0 -0
  27. data/lib/{middleman/svg → middleman-svg}/transform_pipeline/transformations/width.rb +0 -0
  28. data/lib/middleman-svg/uri_resource.rb +16 -0
  29. data/lib/{middleman/svg → middleman-svg}/version.rb +1 -1
  30. data/middleman-svg.gemspec +19 -22
  31. metadata +46 -69
  32. data/lib/middleman/svg/asset_file.rb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f75c7508eeb8091388a6d0a5750f3fbc99f4bcb9
4
- data.tar.gz: 99e5f0b678180819ce60c8e61b3f48b9960bf7cb
2
+ SHA256:
3
+ metadata.gz: a8ec43630fd7af6af547cdd98d1ada9c78b91ddc89c93f1c2df0f37e51c47b2c
4
+ data.tar.gz: ab10e224897bba5158752b59fb85912dd24cb8ea687d1a66701cdfae596c35e4
5
5
  SHA512:
6
- metadata.gz: fb03d634937ca902f894c58e0c4137730ddfd741aaf701a8213907efc6b8b902197d53e210fc258bbe41214e4dd0355df1d2be36f2efed15ba23b66e1db43d25
7
- data.tar.gz: 9b44f0013e1b41c2702ab6094916a2a8db60b483b58934e053f3e9d98ca1fe89c04541f9e4fcef52506108510a5ba5d5b53a470782987c0fc0d1201e97f3a98d
6
+ metadata.gz: 014d5c9b7812fe51aa043200387687a5e261103c7be511f6cd961b0e33e28747c83250895343dbedc468465670dea88eb4c927427792b51c156d240f7ee2fae9
7
+ data.tar.gz: 724c0c667de15db17dadb835b7a8c11b43fee675e85e40f1af3e116e6dd46511472cc9467a35050d8809c8503d6ea39980bb04d1ccdbe423e8db424d1070f569
data/Gemfile CHANGED
@@ -2,3 +2,16 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in middleman-test.gemspec
4
4
  gemspec
5
+
6
+ gem 'middleman-core'
7
+
8
+ # Build and doc tools
9
+ gem 'rake', '>= 10.3', require: false
10
+ gem 'yard', '>= 0.9', require: false
11
+
12
+ # Test tools
13
+ gem 'byebug'
14
+ gem 'rspec', '>= 3.0', require: false
15
+
16
+ # Code Quality
17
+ gem 'rubocop', '>= 0.57', require: false
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "middleman/svg"
4
+ require "middleman-svg"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
data/lib/middleman-svg.rb CHANGED
@@ -1,4 +1,7 @@
1
- require 'middleman-core'
2
- require 'middleman/svg'
1
+ require "middleman-core"
2
+ require "middleman-svg/version"
3
3
 
4
- Middleman::Extensions.register(:inline_svg, Middleman::Svg::Extension)
4
+ ::Middleman::Extensions.register(:inline_svg) do
5
+ require "middleman-svg/extension"
6
+ ::Middleman::Svg::SvgExtension
7
+ end
@@ -0,0 +1,16 @@
1
+ module Middleman
2
+ module Svg
3
+ class AssetFile
4
+ class FileNotFound < IOError; end
5
+ UNREADABLE_PATH = ''
6
+
7
+ def self.named(filename)
8
+ root = Middleman::Application.root
9
+ source_path = File.join(root, 'source')
10
+ File.read(File.join(source_path, 'images', source) || File.join(source_path, 'fonts/svg', source) || UNREADABLE_PATH)
11
+ rescue Errno::ENOENT
12
+ raise FileNotFound.new("Asset not found: #{asset_path}")
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,11 +1,19 @@
1
- require 'middleman-core'
1
+ require "middleman-svg/asset_file"
2
+ require "middleman-svg/transform_pipeline"
3
+ require "middleman-svg/io_resource"
4
+ require "middleman-svg/uri_resource"
5
+ require 'middleman-svg/id_generator'
6
+
7
+ require 'uri'
8
+ require 'open-uri'
9
+ require 'nokogiri'
2
10
 
3
11
  module Middleman
4
12
  module Svg
5
- class Extension < ::Middleman::Extension
13
+ class SvgExtension < Middleman::Extension
6
14
  expose_to_template :inline_svg
7
15
 
8
- def initialize( app, options_hash={}, &block)
16
+ def initialize(app, options_hash={}, &block)
9
17
  super
10
18
 
11
19
  require 'active_support/core_ext/string'
@@ -13,15 +21,15 @@ module Middleman
13
21
 
14
22
  def inline_svg(filename, transform_params={})
15
23
  begin
16
- svg_file = Middleman::Svg::Extension.read_svg(filename)
24
+ svg_file = Middleman::Svg::SvgExtension.read_svg(filename)
17
25
  rescue Middleman::Svg::AssetFile::FileNotFound
18
- return Middleman::Svg::Extension.placeholder(filename) unless transform_params[:fallback].present?
26
+ return Middleman::Svg::SvgExtension.placeholder(filename) unless transform_params[:fallback].present?
19
27
 
20
28
  if transform_params[:fallback].present?
21
29
  begin
22
- svg_file = Middleman::Svg::Extension.read_svg(transform_params[:fallback])
30
+ svg_file = Middleman::Svg::SvgExtension.read_svg(transform_params[:fallback])
23
31
  rescue Middleman::Svg::AssetFile::FileNotFound
24
- Middleman::Svg::Extension.placeholder(filename)
32
+ Middleman::Svg::SvgExtension.placeholder(filename)
25
33
  end
26
34
  end
27
35
  end
@@ -32,8 +40,10 @@ module Middleman
32
40
  def self.read_svg(filename)
33
41
  if Middleman::Svg::IOResource === filename
34
42
  Middleman::Svg::IOResource.read filename
43
+ elsif Middleman::Svg::URIResource === filename
44
+ Middleman::Svg::URIResource.read filename
35
45
  else
36
- Middleman::Svg::Extension.asset_path(filename)
46
+ Middleman::Svg::SvgExtension.asset_path(filename)
37
47
  end
38
48
  end
39
49
 
@@ -49,7 +59,7 @@ module Middleman
49
59
 
50
60
  def self.placeholder(filename)
51
61
  css_class = Middleman::Svg.configuration.svg_not_found_css_class
52
- not_found_message = "'#{filename}' #{Middleman::Svg::Extension.extension_hint(filename)}"
62
+ not_found_message = "'#{filename}' #{Middleman::Svg::SvgExtension.extension_hint(filename)}"
53
63
 
54
64
  if css_class.nil?
55
65
  return "<svg><!-- SVG file not found: #{not_found_message}--></svg>".html_safe
@@ -5,13 +5,6 @@ module Middleman
5
5
  object.is_a?(IO) || object.is_a?(StringIO)
6
6
  end
7
7
 
8
- def self.default_for(object)
9
- case object
10
- when StringIO then ''
11
- when IO then 1
12
- end
13
- end
14
-
15
8
  def self.read(object)
16
9
  start = object.pos
17
10
  str = object.read
@@ -4,7 +4,10 @@ require 'middleman/svg/extension'
4
4
  require "middleman/svg/asset_file"
5
5
  require "middleman/svg/transform_pipeline"
6
6
  require "middleman/svg/io_resource"
7
+ require "middleman/svg/uri_resource"
7
8
 
9
+ require 'uri'
10
+ require 'open-uri'
8
11
  require 'nokogiri'
9
12
 
10
13
  module Middleman
@@ -8,5 +8,5 @@ module Middleman::Svg::TransformPipeline
8
8
  end
9
9
 
10
10
  require 'nokogiri'
11
- require 'middleman/svg/id_generator'
12
- require 'middleman/svg/transform_pipeline/transformations'
11
+ require 'middleman-svg/id_generator'
12
+ require 'middleman-svg/transform_pipeline/transformations'
@@ -60,18 +60,18 @@ module Middleman::Svg::TransformPipeline::Transformations
60
60
  end
61
61
  end
62
62
 
63
- require 'middleman/svg/transform_pipeline/transformations/transformation'
64
- require 'middleman/svg/transform_pipeline/transformations/no_defs'
65
- require 'middleman/svg/transform_pipeline/transformations/no_comment'
66
- require 'middleman/svg/transform_pipeline/transformations/class_attribute'
67
- require 'middleman/svg/transform_pipeline/transformations/style_attribute'
68
- require 'middleman/svg/transform_pipeline/transformations/title'
69
- require 'middleman/svg/transform_pipeline/transformations/description'
70
- require 'middleman/svg/transform_pipeline/transformations/size'
71
- require 'middleman/svg/transform_pipeline/transformations/height'
72
- require 'middleman/svg/transform_pipeline/transformations/width'
73
- require 'middleman/svg/transform_pipeline/transformations/id_attribute'
74
- require 'middleman/svg/transform_pipeline/transformations/data_attributes'
75
- require 'middleman/svg/transform_pipeline/transformations/preserve_aspect_ratio'
76
- require 'middleman/svg/transform_pipeline/transformations/aria_attributes'
77
- require "middleman/svg/transform_pipeline/transformations/aria_hidden_attribute"
63
+ require 'middleman-svg/transform_pipeline/transformations/transformation'
64
+ require 'middleman-svg/transform_pipeline/transformations/no_defs'
65
+ require 'middleman-svg/transform_pipeline/transformations/no_comment'
66
+ require 'middleman-svg/transform_pipeline/transformations/class_attribute'
67
+ require 'middleman-svg/transform_pipeline/transformations/style_attribute'
68
+ require 'middleman-svg/transform_pipeline/transformations/title'
69
+ require 'middleman-svg/transform_pipeline/transformations/description'
70
+ require 'middleman-svg/transform_pipeline/transformations/size'
71
+ require 'middleman-svg/transform_pipeline/transformations/height'
72
+ require 'middleman-svg/transform_pipeline/transformations/width'
73
+ require 'middleman-svg/transform_pipeline/transformations/id_attribute'
74
+ require 'middleman-svg/transform_pipeline/transformations/data_attributes'
75
+ require 'middleman-svg/transform_pipeline/transformations/preserve_aspect_ratio'
76
+ require 'middleman-svg/transform_pipeline/transformations/aria_attributes'
77
+ require "middleman-svg/transform_pipeline/transformations/aria_hidden_attribute"
@@ -0,0 +1,16 @@
1
+ module Middleman
2
+ module Svg
3
+ module URIResource
4
+ def self.===(object)
5
+ return false if object.is_a?(IO) || object.is_a?(StringIO)
6
+ uri = URI.parse(object)
7
+ uri.kind_of?(URI::HTTP) or uri.kind_of?(URI::HTTPS)
8
+ end
9
+
10
+ def self.read(object)
11
+ str = open(object) { |f| f.read }
12
+ str
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Svg
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -1,32 +1,29 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'middleman/svg/version'
4
+ require 'middleman-svg/version'
5
5
 
6
- Gem::Specification.new do |spec|
7
- spec.platform = Gem::Platform::RUBY
8
- spec.name = "middleman-svg"
9
- spec.version = Middleman::Svg::VERSION
10
- spec.authors = ["Damiano Giacomello"]
11
- spec.email = ["giacomello.damiano@gmail.com"]
6
+ Gem::Specification.new do |s|
7
+ s.platform = Gem::Platform::RUBY
8
+ s.name = "middleman-svg"
9
+ s.version = Middleman::Svg::VERSION
10
+ s.authors = ["Damiano Giacomello"]
11
+ s.email = ["giacomello.damiano@gmail.com"]
12
12
 
13
- spec.summary = "A simple helper to generate inline SVG with Middleman"
14
- spec.description = "A simple helper to generate inline SVG content with Middleman"
15
- spec.homepage = "https://github.com/cantierecreativo/middleman-svg"
16
- spec.license = "MIT"
13
+ s.summary = "A simple helper to generate inline SVG with Middleman"
14
+ s.description = "A simple helper to generate inline SVG content with Middleman"
15
+ s.homepage = "https://github.com/cantierecreativo/middleman-svg"
16
+ s.license = "MIT"
17
17
 
18
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
19
19
  f.match(%r{^(test|spec|features)/})
20
20
  end
21
- spec.bindir = "exe"
22
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
- spec.require_paths = ["lib"]
21
+ s.bindir = "exe"
22
+ s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ s.require_paths = ["lib"]
24
+ s.required_ruby_version = '>= 2.0.0'
24
25
 
25
- spec.add_development_dependency "bundler", "~> 1.13"
26
- spec.add_development_dependency "rake", "~> 10.0"
27
- spec.add_development_dependency "rspec", "~> 3.0"
28
-
29
- spec.add_runtime_dependency "middleman-core", ">= 4.0.0"
30
- spec.add_runtime_dependency "activesupport", ">= 3.0"
31
- spec.add_runtime_dependency "nokogiri", ">= 1.6"
26
+ s.add_runtime_dependency 'middleman-core', '~> 4.0', '>= 4.0.0'
27
+ s.add_runtime_dependency "activesupport", "~> 3.0", ">= 3.0"
28
+ s.add_runtime_dependency "nokogiri", "~> 1.6", ">= 1.6"
32
29
  end
metadata CHANGED
@@ -1,61 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damiano Giacomello
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
11
+ date: 2018-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.13'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.13'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '10.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '10.0'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
14
+ name: middleman-core
43
15
  requirement: !ruby/object:Gem::Requirement
44
16
  requirements:
45
17
  - - "~>"
46
18
  - !ruby/object:Gem::Version
47
- version: '3.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.0'
55
- - !ruby/object:Gem::Dependency
56
- name: middleman-core
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
19
+ version: '4.0'
59
20
  - - ">="
60
21
  - !ruby/object:Gem::Version
61
22
  version: 4.0.0
@@ -63,6 +24,9 @@ dependencies:
63
24
  prerelease: false
64
25
  version_requirements: !ruby/object:Gem::Requirement
65
26
  requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '4.0'
66
30
  - - ">="
67
31
  - !ruby/object:Gem::Version
68
32
  version: 4.0.0
@@ -70,6 +34,9 @@ dependencies:
70
34
  name: activesupport
71
35
  requirement: !ruby/object:Gem::Requirement
72
36
  requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.0'
73
40
  - - ">="
74
41
  - !ruby/object:Gem::Version
75
42
  version: '3.0'
@@ -77,6 +44,9 @@ dependencies:
77
44
  prerelease: false
78
45
  version_requirements: !ruby/object:Gem::Requirement
79
46
  requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '3.0'
80
50
  - - ">="
81
51
  - !ruby/object:Gem::Version
82
52
  version: '3.0'
@@ -84,6 +54,9 @@ dependencies:
84
54
  name: nokogiri
85
55
  requirement: !ruby/object:Gem::Requirement
86
56
  requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '1.6'
87
60
  - - ">="
88
61
  - !ruby/object:Gem::Version
89
62
  version: '1.6'
@@ -91,6 +64,9 @@ dependencies:
91
64
  prerelease: false
92
65
  version_requirements: !ruby/object:Gem::Requirement
93
66
  requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '1.6'
94
70
  - - ">="
95
71
  - !ruby/object:Gem::Version
96
72
  version: '1.6'
@@ -112,30 +88,31 @@ files:
112
88
  - bin/console
113
89
  - bin/setup
114
90
  - lib/middleman-svg.rb
115
- - lib/middleman/svg.rb
116
- - lib/middleman/svg/asset_file.rb
117
- - lib/middleman/svg/extension.rb
118
- - lib/middleman/svg/id_generator.rb
119
- - lib/middleman/svg/io_resource.rb
120
- - lib/middleman/svg/transform_pipeline.rb
121
- - lib/middleman/svg/transform_pipeline/transformations.rb
122
- - lib/middleman/svg/transform_pipeline/transformations/aria_attributes.rb
123
- - lib/middleman/svg/transform_pipeline/transformations/aria_hidden.rb
124
- - lib/middleman/svg/transform_pipeline/transformations/aria_hidden_attribute.rb
125
- - lib/middleman/svg/transform_pipeline/transformations/class_attribute.rb
126
- - lib/middleman/svg/transform_pipeline/transformations/data_attributes.rb
127
- - lib/middleman/svg/transform_pipeline/transformations/description.rb
128
- - lib/middleman/svg/transform_pipeline/transformations/height.rb
129
- - lib/middleman/svg/transform_pipeline/transformations/id_attribute.rb
130
- - lib/middleman/svg/transform_pipeline/transformations/no_comment.rb
131
- - lib/middleman/svg/transform_pipeline/transformations/no_defs.rb
132
- - lib/middleman/svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
133
- - lib/middleman/svg/transform_pipeline/transformations/size.rb
134
- - lib/middleman/svg/transform_pipeline/transformations/style_attribute.rb
135
- - lib/middleman/svg/transform_pipeline/transformations/title.rb
136
- - lib/middleman/svg/transform_pipeline/transformations/transformation.rb
137
- - lib/middleman/svg/transform_pipeline/transformations/width.rb
138
- - lib/middleman/svg/version.rb
91
+ - lib/middleman-svg/asset_file.rb
92
+ - lib/middleman-svg/extension.rb
93
+ - lib/middleman-svg/id_generator.rb
94
+ - lib/middleman-svg/io_resource.rb
95
+ - lib/middleman-svg/svg.rb
96
+ - lib/middleman-svg/transform_pipeline.rb
97
+ - lib/middleman-svg/transform_pipeline/transformations.rb
98
+ - lib/middleman-svg/transform_pipeline/transformations/aria_attributes.rb
99
+ - lib/middleman-svg/transform_pipeline/transformations/aria_hidden.rb
100
+ - lib/middleman-svg/transform_pipeline/transformations/aria_hidden_attribute.rb
101
+ - lib/middleman-svg/transform_pipeline/transformations/class_attribute.rb
102
+ - lib/middleman-svg/transform_pipeline/transformations/data_attributes.rb
103
+ - lib/middleman-svg/transform_pipeline/transformations/description.rb
104
+ - lib/middleman-svg/transform_pipeline/transformations/height.rb
105
+ - lib/middleman-svg/transform_pipeline/transformations/id_attribute.rb
106
+ - lib/middleman-svg/transform_pipeline/transformations/no_comment.rb
107
+ - lib/middleman-svg/transform_pipeline/transformations/no_defs.rb
108
+ - lib/middleman-svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
109
+ - lib/middleman-svg/transform_pipeline/transformations/size.rb
110
+ - lib/middleman-svg/transform_pipeline/transformations/style_attribute.rb
111
+ - lib/middleman-svg/transform_pipeline/transformations/title.rb
112
+ - lib/middleman-svg/transform_pipeline/transformations/transformation.rb
113
+ - lib/middleman-svg/transform_pipeline/transformations/width.rb
114
+ - lib/middleman-svg/uri_resource.rb
115
+ - lib/middleman-svg/version.rb
139
116
  - middleman-svg.gemspec
140
117
  - source/images/example.svg
141
118
  - source/images/known-document-two.svg
@@ -155,7 +132,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
132
  requirements:
156
133
  - - ">="
157
134
  - !ruby/object:Gem::Version
158
- version: '0'
135
+ version: 2.0.0
159
136
  required_rubygems_version: !ruby/object:Gem::Requirement
160
137
  requirements:
161
138
  - - ">="
@@ -163,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
140
  version: '0'
164
141
  requirements: []
165
142
  rubyforge_project:
166
- rubygems_version: 2.6.12
143
+ rubygems_version: 2.7.6
167
144
  signing_key:
168
145
  specification_version: 4
169
146
  summary: A simple helper to generate inline SVG with Middleman
@@ -1,14 +0,0 @@
1
- module Middleman::Svg
2
- class AssetFile
3
- class FileNotFound < IOError; end
4
- UNREADABLE_PATH = ''
5
-
6
- def self.named(filename)
7
- root = Middleman::Application.root
8
- source_path = File.join(root, 'source')
9
- File.read(File.join(source_path, 'images', source) || File.join(source_path, 'fonts/svg', source) || UNREADABLE_PATH)
10
- rescue Errno::ENOENT
11
- raise FileNotFound.new("Asset not found: #{asset_path}")
12
- end
13
- end
14
- end