stylus 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +7 -0
- data/README.md +2 -1
- data/lib/stylus/railtie.rb +9 -5
- data/lib/stylus/version.rb +1 -1
- data/spec/sprockets_spec.rb +6 -0
- data/spec/support/generators/test_case.rb +11 -14
- data/spec/support/helpers.rb +1 -1
- metadata +16 -16
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## Changelog
|
2
2
|
|
3
|
+
### 0.4.1 (2012-01-06)
|
4
|
+
[Compare view](https://github.com/lucasmazza/ruby-stylus/compare/v0.4.0...v.0.4.1)
|
5
|
+
|
6
|
+
* Skips Sprockets configuration if `config.assets.enabled` isn't true.
|
7
|
+
|
8
|
+
|
9
|
+
|
3
10
|
### 0.4.0 (2011-11-23)
|
4
11
|
[Compare view](https://github.com/lucasmazza/ruby-stylus/compare/v0.3.0...v.0.4.0)
|
5
12
|
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Ruby Stylus
|
2
2
|
|
3
3
|
[![Build Status](https://secure.travis-ci.org/lucasmazza/ruby-stylus.png)](http://travis-ci.org/lucasmazza/ruby-stylus)
|
4
|
+
[![Dependencies](https://gemnasium.com/lucasmazza/ruby-stylus.png?travis)](https://gemnasium.com/lucasmazza/ruby-stylus)
|
4
5
|
|
5
6
|
`stylus` is a bridge between your Ruby code and the [Stylus](https://github.com/LearnBoost/stylus) library that runs on [node.js](http://nodejs.org). It has support for the Rails 3.1 asset pipeline (thanks to a [Tilt](https://github.com/rtomayko/tilt) Template) and it's backed by the [ExecJS](https://github.com/sstephenson/execjs) gem.
|
6
7
|
|
@@ -10,7 +11,7 @@ Since version 0.3.0, the [stylus-source](https://github.com/railsjedi/ruby-stylu
|
|
10
11
|
|
11
12
|
You can replace the Stylus code by placing another version of Stylus on `./node_modules/stylus`, and it will be used instead of the version bundled inside the gem.
|
12
13
|
|
13
|
-
**But remember**, You still need the `node` command available on your runtime for this gem to work. `stylus` is also compatible with the Heroku Cedar stack, enabling the asset compilation during the deployment of your apps.
|
14
|
+
**But remember**, You still need the `node` command available on your runtime for this gem to work. `stylus` is also compatible with the Heroku Cedar stack, enabling the asset compilation during the deployment of your apps. You can check the [Node.js wiki](https://github.com/joyent/node/wiki/Quick-and-easy-installation) for more info.
|
14
15
|
|
15
16
|
## Usage
|
16
17
|
|
data/lib/stylus/railtie.rb
CHANGED
@@ -10,8 +10,10 @@ module Stylus
|
|
10
10
|
config.app_generators.stylesheet_engine :stylus
|
11
11
|
|
12
12
|
initializer :setup_stylus, :after => 'sprockets.environment' do |app|
|
13
|
-
app.assets.
|
14
|
-
|
13
|
+
if app.config.assets.enabled
|
14
|
+
app.assets.register_engine '.styl', Tilt::StylusTemplate
|
15
|
+
app.assets.register_preprocessor 'text/css', Stylus::ImportProcessor
|
16
|
+
end
|
15
17
|
end
|
16
18
|
|
17
19
|
# After initialization block to inspect the `Sprockets` configuration
|
@@ -19,9 +21,11 @@ module Stylus
|
|
19
21
|
# It also includes the `Rails` asset load path into `Stylus` so any
|
20
22
|
# `.styl` file inside it can be imported by the `Stylus` API.
|
21
23
|
config.after_initialize do |app|
|
22
|
-
|
23
|
-
|
24
|
-
|
24
|
+
if app.config.assets.enabled
|
25
|
+
Stylus.compress = app.config.assets.compress
|
26
|
+
Stylus.debug = app.config.assets.debug
|
27
|
+
Stylus.paths.concat app.assets.paths
|
28
|
+
end
|
25
29
|
end
|
26
30
|
end
|
27
31
|
end
|
data/lib/stylus/version.rb
CHANGED
data/spec/sprockets_spec.rb
CHANGED
@@ -39,4 +39,10 @@ describe 'Sprockets and Rails integration' do
|
|
39
39
|
app = create_app(:compress => true)
|
40
40
|
app.assets['compressed'].to_s.should == result
|
41
41
|
end
|
42
|
+
|
43
|
+
it 'loads the app normally even when the asset pipeline is disabled' do
|
44
|
+
expect {
|
45
|
+
create_app(:enabled => false)
|
46
|
+
}.to_not raise_error
|
47
|
+
end
|
42
48
|
end
|
@@ -40,22 +40,19 @@ module Generators
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
File.expand_path(relative, destination_root)
|
47
|
-
end
|
43
|
+
def file(relative)
|
44
|
+
File.expand_path(relative, destination_root)
|
45
|
+
end
|
48
46
|
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
def method_missing(method_sym, *arguments, &block)
|
48
|
+
self.test_case_instance.send(method_sym, *arguments, &block)
|
49
|
+
end
|
52
50
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
end
|
51
|
+
def respond_to?(method_sym, include_private = false)
|
52
|
+
if self.test_case_instance.respond_to?(method_sym)
|
53
|
+
true
|
54
|
+
else
|
55
|
+
super
|
59
56
|
end
|
60
57
|
end
|
61
58
|
end
|
data/spec/support/helpers.rb
CHANGED
@@ -12,7 +12,7 @@ module Helpers
|
|
12
12
|
Class.new(Rails::Application).tap do |app|
|
13
13
|
assets = app.config.assets
|
14
14
|
assets.cache_store = :memory_store
|
15
|
-
assets.enabled = true
|
15
|
+
assets.enabled = options.fetch(:enabled, true)
|
16
16
|
assets.compress = true if options[:compress]
|
17
17
|
assets.debug = true if options[:debug]
|
18
18
|
assets.paths << fixture_root
|
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.4.
|
4
|
+
version: 0.4.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:
|
12
|
+
date: 2012-01-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: execjs
|
16
|
-
requirement: &
|
16
|
+
requirement: &70320174413340 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70320174413340
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: stylus-source
|
27
|
-
requirement: &
|
27
|
+
requirement: &70320174412720 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70320174412720
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70320174410980 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '2.0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70320174410980
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: railties
|
49
|
-
requirement: &
|
49
|
+
requirement: &70320174410100 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 3.1.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70320174410100
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: tzinfo
|
60
|
-
requirement: &
|
60
|
+
requirement: &70320174409620 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70320174409620
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: yajl-ruby
|
71
|
-
requirement: &
|
71
|
+
requirement: &70320178628460 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70320178628460
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rocco
|
82
|
-
requirement: &
|
82
|
+
requirement: &70320178627720 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70320178627720
|
91
91
|
description: Bridge library to compile .styl stylesheets from ruby code.
|
92
92
|
email:
|
93
93
|
- luc4smazza@gmail.com
|