inline-style 0.4 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/inline-style.rb +4 -2
- data/lib/inline-style/rack/middleware.rb +2 -2
- metadata +1 -1
data/lib/inline-style.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
require 'nokogiri'
|
2
2
|
require 'open-uri'
|
3
|
-
|
3
|
+
|
4
|
+
gem 'maca-fork-csspool'
|
5
|
+
require 'csspool'
|
4
6
|
|
5
7
|
require "#{ File.dirname( __FILE__ ) }/inline-style/rack/middleware"
|
6
8
|
|
7
9
|
module InlineStyle
|
8
|
-
VERSION = '0.4'
|
10
|
+
VERSION = '0.4.2'
|
9
11
|
|
10
12
|
# Options:
|
11
13
|
# +:stylesheets_path+
|
@@ -21,7 +21,7 @@ module InlineStyle
|
|
21
21
|
#
|
22
22
|
def initialize app, opts = {}
|
23
23
|
@app = app
|
24
|
-
@opts =
|
24
|
+
@opts = opts
|
25
25
|
@paths = /^(?:#{ [*opts[:paths]].join('|') })/
|
26
26
|
end
|
27
27
|
|
@@ -33,7 +33,7 @@ module InlineStyle
|
|
33
33
|
response = ::Rack::Response.new '', status, headers
|
34
34
|
body = content.respond_to?(:body) ? content.body : content
|
35
35
|
|
36
|
-
response.write InlineStyle.process(body, @opts)
|
36
|
+
response.write InlineStyle.process(body, {:document_root => env['DOCUMENT_ROOT']}.merge(@opts))
|
37
37
|
response.finish
|
38
38
|
end
|
39
39
|
end
|