stylus 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,11 @@
1
1
  ## Changelog
2
2
 
3
- ### 0.5.0 (Master)
3
+ ### 0.5.1 (2012-05-07)
4
+ [Compare view](https://github.com/lucasmazza/ruby-stylus/compare/v0.5.0...v.0.5.1)
5
+
6
+ * Fixes the `ImportProcessor` so it doesn't evaluates the stylesheets.
7
+
8
+ ### 0.5.0 (2012-03-26)
4
9
  [Compare view](https://github.com/lucasmazza/ruby-stylus/compare/v0.4.2...v.0.5.0)
5
10
 
6
11
  * Rewrite of the Railtie initializers to match 3.2 loading order;
@@ -11,9 +11,10 @@ module Stylus
11
11
  dependencies = data.scan(IMPORT_SCANNER).flatten.compact.uniq
12
12
 
13
13
  dependencies.each do |path|
14
- asset = context.environment[path]
14
+ asset = context.resolve(path, :content_type => 'text/css')
15
+
15
16
  if asset
16
- context.depend_on_asset(asset.pathname)
17
+ context.depend_on(asset)
17
18
  end
18
19
  end
19
20
  data
@@ -1,3 +1,3 @@
1
1
  module Stylus
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -0,0 +1,3 @@
1
+ body {
2
+ color: #8a0000;
3
+ }
@@ -1,19 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Stylus::ImportProcessor do
4
-
5
- let(:app) { create_app }
6
- let(:env) { app.assets }
7
- let(:context) { double(:environment => env) }
8
-
9
4
  it 'adds an imported stylesheet as a dependency' do
10
- source = fixture(:import).first
11
- asset = env['import']
12
- template = Stylus::ImportProcessor.new { source }
5
+ source = fixture(:import).first
6
+ template = Stylus::ImportProcessor.new { source }
13
7
  dependency = Pathname.new(fixture_path('mixins/vendor'))
8
+ sprockets = double(:resolve => dependency)
14
9
 
15
- context.should_receive(:depend_on_asset).with(dependency)
16
- template.render(context)
10
+ sprockets.should_receive(:depend_on).with(dependency)
11
+ template.render(sprockets)
17
12
  end
18
-
19
13
  end
@@ -6,6 +6,7 @@ require 'active_support/railtie'
6
6
  require 'action_controller/railtie'
7
7
  require 'sprockets/railtie'
8
8
  require 'stylus/railtie'
9
+ require 'stylus'
9
10
 
10
11
  require 'active_support/core_ext/class/attribute_accessors'
11
12
 
@@ -41,6 +41,12 @@ describe 'Sprockets and Rails integration' do
41
41
  app.assets['compressed'].to_s.should == result
42
42
  end
43
43
 
44
+ it "share variables between imported stylesheets" do
45
+ result = fixture(:variables).last
46
+
47
+ app = create_app
48
+ app.assets['variables'].to_s.should == result
49
+ end
44
50
  it 'loads the app normally even when the asset pipeline is disabled' do
45
51
  expect {
46
52
  create_app(:enabled => false)
@@ -0,0 +1,2 @@
1
+ @import 'variables_definition'
2
+ @import 'variables_usage'
@@ -0,0 +1 @@
1
+ the_color = #990000
@@ -0,0 +1,2 @@
1
+ body
2
+ color darken(the_color, 10%)
@@ -1,4 +1,3 @@
1
- require 'stylus'
2
1
  require 'spec_helper'
3
2
 
4
3
  describe Stylus do
@@ -70,6 +69,13 @@ describe Stylus do
70
69
  Stylus.compile(input).should == output
71
70
  end
72
71
 
72
+ it "share variables between imported stylesheets" do
73
+ input, output = fixture :variables
74
+ path = fixture_root
75
+
76
+ Stylus.compile(input, :paths => path).should == output
77
+ end
78
+
73
79
  describe "The debug flag" do
74
80
 
75
81
  let(:path) { fixture_path(:debug) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stylus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-26 00:00:00.000000000 Z
12
+ date: 2012-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: execjs
16
- requirement: &70111340797160 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70111340797160
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: stylus-source
27
- requirement: &70111340796740 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70111340796740
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rspec
38
- requirement: &70111340796200 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '2.0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70111340796200
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: railties
49
- requirement: &70111340795660 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ~>
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: '3.2'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *70111340795660
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '3.2'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: tzinfo
60
- requirement: &70111340795280 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: '0'
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *70111340795280
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: yajl-ruby
71
- requirement: &70111340794820 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ! '>='
@@ -76,7 +101,12 @@ dependencies:
76
101
  version: '0'
77
102
  type: :development
78
103
  prerelease: false
79
- version_requirements: *70111340794820
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
80
110
  description: Bridge library to compile .styl stylesheets from ruby code.
81
111
  email:
82
112
  - luc4smazza@gmail.com
@@ -109,6 +139,7 @@ files:
109
139
  - spec/cases/plugin.css
110
140
  - spec/cases/simple.css
111
141
  - spec/cases/stylesheet.css
142
+ - spec/cases/variables.css
112
143
  - spec/generators/assets_generator_spec.rb
113
144
  - spec/generators/controller_generator_spec.rb
114
145
  - spec/generators/scaffold_generator_spec.rb
@@ -124,6 +155,9 @@ files:
124
155
  - spec/stylesheets/plugin.styl
125
156
  - spec/stylesheets/simple.styl
126
157
  - spec/stylesheets/stylesheet.styl
158
+ - spec/stylesheets/variables.styl
159
+ - spec/stylesheets/variables_definition.styl
160
+ - spec/stylesheets/variables_usage.styl
127
161
  - spec/stylus_spec.rb
128
162
  - spec/support/generators/test_case.rb
129
163
  - spec/support/helpers.rb
@@ -150,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
184
  version: '0'
151
185
  requirements: []
152
186
  rubyforge_project:
153
- rubygems_version: 1.8.17
187
+ rubygems_version: 1.8.23
154
188
  signing_key:
155
189
  specification_version: 3
156
190
  summary: Ruby Stylus Compiler
@@ -162,6 +196,7 @@ test_files:
162
196
  - spec/cases/plugin.css
163
197
  - spec/cases/simple.css
164
198
  - spec/cases/stylesheet.css
199
+ - spec/cases/variables.css
165
200
  - spec/generators/assets_generator_spec.rb
166
201
  - spec/generators/controller_generator_spec.rb
167
202
  - spec/generators/scaffold_generator_spec.rb
@@ -177,6 +212,9 @@ test_files:
177
212
  - spec/stylesheets/plugin.styl
178
213
  - spec/stylesheets/simple.styl
179
214
  - spec/stylesheets/stylesheet.styl
215
+ - spec/stylesheets/variables.styl
216
+ - spec/stylesheets/variables_definition.styl
217
+ - spec/stylesheets/variables_usage.styl
180
218
  - spec/stylus_spec.rb
181
219
  - spec/support/generators/test_case.rb
182
220
  - spec/support/helpers.rb