rack-less 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -3
- data/lib/rack/less/config.rb +13 -8
- data/lib/rack/less/version.rb +1 -1
- data/test/config_test.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rack-less (2.0.
|
4
|
+
rack-less (2.0.2)
|
5
5
|
less (~> 1.2)
|
6
6
|
rack (~> 1.0)
|
7
7
|
|
@@ -43,8 +43,6 @@ PLATFORMS
|
|
43
43
|
|
44
44
|
DEPENDENCIES
|
45
45
|
bundler (~> 1.0)
|
46
|
-
less (~> 1.2)
|
47
|
-
rack (~> 1.0)
|
48
46
|
rack-less!
|
49
47
|
rack-test (>= 0.5.3)
|
50
48
|
sinatra (>= 0.9.4)
|
data/lib/rack/less/config.rb
CHANGED
@@ -37,7 +37,7 @@ module Rack::Less
|
|
37
37
|
|
38
38
|
def initialize(settings={})
|
39
39
|
ATTRIBUTES.each do |a|
|
40
|
-
instance_variable_set("@#{a}", settings[a]
|
40
|
+
instance_variable_set("@#{a}", settings[a].nil? ? DEFAULTS[a] : settings[a])
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -77,22 +77,27 @@ module Rack::Less
|
|
77
77
|
filename = key.strip
|
78
78
|
filename += ".css" unless filename.include?('.css')
|
79
79
|
if !filename.include?('?') && self.cache_bust != false
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
else
|
84
|
-
self.cache_bust ||= default_cache_bust
|
85
|
-
end.to_s
|
80
|
+
if !(cb = cache_bust_value).empty?
|
81
|
+
filename += "?#{cb}"
|
82
|
+
end
|
86
83
|
end
|
87
84
|
filename
|
88
85
|
end
|
89
86
|
|
87
|
+
def cache_bust_value
|
88
|
+
if self.cache_bust == true
|
89
|
+
Time.now.to_i
|
90
|
+
else
|
91
|
+
self.cache_bust ||= default_cache_bust
|
92
|
+
end.to_s
|
93
|
+
end
|
94
|
+
|
90
95
|
def default_cache_bust
|
91
96
|
if defined?(::Sinatra) && defined?(::Sinatra::Application)
|
92
97
|
app_root_cache_bust(::Sinatra::Application)
|
93
98
|
elsif defined?(::Rails)
|
94
99
|
app_root_cache_bust(::Rails)
|
95
|
-
end ||
|
100
|
+
end || ""
|
96
101
|
end
|
97
102
|
|
98
103
|
def app_root_cache_bust(app)
|
data/lib/rack/less/version.rb
CHANGED
data/test/config_test.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-less
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 2
|
10
|
+
version: 2.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|