sinatra-support 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md
CHANGED
@@ -72,7 +72,7 @@ module Sinatra::CssSupport
|
|
72
72
|
prefix = options[:from]
|
73
73
|
|
74
74
|
get path do |name|
|
75
|
-
fname = Dir[File.join(prefix, "#{name}.{css,scss,less}")].first or pass
|
75
|
+
fname = Dir[File.join(prefix, "#{name}.{css,sass,scss,less}")].first or pass
|
76
76
|
|
77
77
|
content_type :css, :charset => 'utf-8'
|
78
78
|
last_modified css_mtime_for(prefix, fname)
|
@@ -80,7 +80,7 @@ module Sinatra::CssSupport
|
|
80
80
|
|
81
81
|
if fname =~ /\.scss$/
|
82
82
|
scss File.read(fname)
|
83
|
-
elsif fname =~ /\.
|
83
|
+
elsif fname =~ /\.sass$/
|
84
84
|
sass File.read(fname)
|
85
85
|
elsif fname =~ /\.less$/
|
86
86
|
less File.read(fname)
|
data/test/test_css.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.expand_path('../helper', __FILE__)
|
2
|
+
|
3
|
+
class CssAppTest < Test::Unit::TestCase
|
4
|
+
include Rack::Test::Methods
|
5
|
+
|
6
|
+
class App < Sinatra::Base
|
7
|
+
register Sinatra::CssSupport
|
8
|
+
serve_css '/css', :from => File.expand_path('../fixtures/css', __FILE__)
|
9
|
+
end
|
10
|
+
|
11
|
+
def app
|
12
|
+
App.new
|
13
|
+
end
|
14
|
+
|
15
|
+
test "sass" do
|
16
|
+
get '/css/style-sass.css'
|
17
|
+
|
18
|
+
assert_equal "body, #sass {\n color: #333333; }\n", last_response.body
|
19
|
+
end
|
20
|
+
|
21
|
+
test "scss" do
|
22
|
+
get '/css/style-scss.css'
|
23
|
+
|
24
|
+
assert_equal "body, #scss {\n color: #333333; }\n", last_response.body
|
25
|
+
end
|
26
|
+
|
27
|
+
test "less" do
|
28
|
+
get '/css/style-less.css'
|
29
|
+
|
30
|
+
assert_equal "body, #less { color: #333333; }\n", last_response.body
|
31
|
+
end
|
32
|
+
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: sinatra-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.1.
|
5
|
+
version: 1.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Cyril David
|
@@ -118,6 +118,9 @@ files:
|
|
118
118
|
- lib/sinatra/support/ohmerrorhelpers.rb
|
119
119
|
- lib/sinatra/support/version.rb
|
120
120
|
- lib/sinatra/support.rb
|
121
|
+
- test/fixtures/css/style-less.less
|
122
|
+
- test/fixtures/css/style-sass.sass
|
123
|
+
- test/fixtures/css/style-scss.scss
|
121
124
|
- test/fixtures/i18n/en.yml
|
122
125
|
- test/fixtures/i18n/tl.yml
|
123
126
|
- test/fixtures/multirender/views_1/dupe.erb
|
@@ -128,6 +131,7 @@ files:
|
|
128
131
|
- test/helper.rb
|
129
132
|
- test/test_compass_app.rb
|
130
133
|
- test/test_country.rb
|
134
|
+
- test/test_css.rb
|
131
135
|
- test/test_date.rb
|
132
136
|
- test/test_date_app.rb
|
133
137
|
- test/test_date_form.rb
|