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
@@ -1,3 +1,9 @@
1
+ v1.1.1 - May 27, 2011
2
+ ---------------------
3
+
4
+ ### Fixed:
5
+ * CssSupport: Fix issue where Sass files are not loaded
6
+
1
7
  v1.1.0 - May 27, 2011
2
8
  ---------------------
3
9
 
@@ -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 =~ /\.scss$/
83
+ elsif fname =~ /\.sass$/
84
84
  sass File.read(fname)
85
85
  elsif fname =~ /\.less$/
86
86
  less File.read(fname)
@@ -1,6 +1,6 @@
1
1
  module Sinatra
2
2
  module Support
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
 
5
5
  def self.version
6
6
  VERSION
@@ -0,0 +1,2 @@
1
+ @grey: #333;
2
+ body, #less { color: @grey; }
@@ -0,0 +1,2 @@
1
+ body, #sass
2
+ color: #333
@@ -0,0 +1,2 @@
1
+ $grey: #333;
2
+ body, #scss { color: $grey; }
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.0
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