stylus 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +2 -3
- data/CHANGELOG.md +5 -2
- data/README.md +16 -16
- data/lib/stylus/railtie.rb +1 -1
- data/lib/stylus/version.rb +1 -1
- data/stylus.gemspec +1 -1
- metadata +18 -18
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 0.4.2 (2012-03-24)
|
|
4
|
+
[Compare view](https://github.com/lucasmazza/ruby-stylus/compare/v0.4.1...v.0.4.2)
|
|
5
|
+
|
|
6
|
+
* Tells Rails to always run the Railtie initializer.
|
|
7
|
+
|
|
3
8
|
### 0.4.1 (2012-01-06)
|
|
4
9
|
[Compare view](https://github.com/lucasmazza/ruby-stylus/compare/v0.4.0...v.0.4.1)
|
|
5
10
|
|
|
6
11
|
* Skips Sprockets configuration if `config.assets.enabled` isn't true.
|
|
7
12
|
|
|
8
|
-
|
|
9
|
-
|
|
10
13
|
### 0.4.0 (2011-11-23)
|
|
11
14
|
[Compare view](https://github.com/lucasmazza/ruby-stylus/compare/v0.3.0...v.0.4.0)
|
|
12
15
|
|
data/README.md
CHANGED
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
10
|
-
Since version 0.3.0, the [stylus-source](https://github.com/railsjedi/ruby-stylus-source) packages the Stylus source into a
|
|
10
|
+
Since version 0.3.0, the [stylus-source](https://github.com/railsjedi/ruby-stylus-source) packages the Stylus source into a Rubygem, so it will be available after installing this gem. The `ruby-source` version will follow the Stylus releases and their versions.
|
|
11
11
|
|
|
12
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.
|
|
13
13
|
|
|
14
|
-
**But remember**,
|
|
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 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.
|
|
15
15
|
|
|
16
16
|
## Usage
|
|
17
17
|
|
|
18
|
-
The interaction is done by the `Stylus` module. You can compile
|
|
18
|
+
The interaction is done by the `Stylus` module. You can compile Stylus syntax to CSS, convert it back, enable plugins and tweak some other options:
|
|
19
19
|
|
|
20
20
|
```ruby
|
|
21
21
|
require 'stylus'
|
|
@@ -23,20 +23,20 @@ require 'stylus'
|
|
|
23
23
|
# Accepts a raw string or an IO object (File, StringIO or anything that responds to 'read').
|
|
24
24
|
Stylus.compile(File.new('application.styl')) # returns the compiled stylesheet.
|
|
25
25
|
|
|
26
|
-
#
|
|
26
|
+
# Use the :compress option, removing most newlines from the code.
|
|
27
27
|
Stylus.compile(File.read('application.styl'), :compress => true)
|
|
28
28
|
|
|
29
29
|
# Or use the global compress flag
|
|
30
30
|
Stylus.compress = true
|
|
31
31
|
Stylus.compile(File.read('application.styl'))
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# Convert old and boring CSS to awesome Stylus.
|
|
34
34
|
Stylus.convert(File.new('file.css'))
|
|
35
35
|
|
|
36
|
-
#
|
|
36
|
+
# Import plugins directly from Node.js, like nib.
|
|
37
37
|
Stylus.use :nib
|
|
38
38
|
|
|
39
|
-
#
|
|
39
|
+
# Enable debug info, which sends the 'linenos' and 'firebug' options to Stylus.
|
|
40
40
|
# If you provide a raw content String to the `Stylus.compile` method, remember to send
|
|
41
41
|
# a `:filename` option so Stylus can locate your stylesheet for proper inspection.
|
|
42
42
|
Stylus.debug = true
|
|
@@ -47,40 +47,40 @@ First of all, remember to add `gem 'stylus'` to your Gemfile inside the `:assets
|
|
|
47
47
|
|
|
48
48
|
Adding `stylus` to your Gemfile should let you work with `.styl` files with the Rails 3.1 Pipeline. Any asset generated with `rails generate` will be created with a `.css.styl` extension.
|
|
49
49
|
|
|
50
|
-
Any `@import` directive will add the stylesheet as a sprockets dependency, so you can update external libraries and it will reflect on your assets fingerprints. Also, the Sprockets
|
|
50
|
+
Any `@import` directive will add the stylesheet as a sprockets dependency, so you can update external libraries and it will reflect on your assets fingerprints. Also, the Sprockets load path (usually `app/assets`, `lib/assets`, `vendor/assets` and the `assets` folder inside any other gem) will be available to your stylesheets.
|
|
51
51
|
|
|
52
|
-
If the `config.assets.debug` is turned on, Stylus will emit
|
|
52
|
+
If the `config.assets.debug` is turned on, Stylus will emit extra comments on your stylesheets to help debugging and inspection using the `linenos` and `firebug` options. Check the [FireStylus extension for Firebug](https://github.com/LearnBoost/stylus/blob/master/docs/firebug.md) for more info.
|
|
53
53
|
|
|
54
54
|
### `@import` and file extensions.
|
|
55
55
|
|
|
56
|
-
Stylus and Sprockets file
|
|
56
|
+
Stylus and Sprockets file lookups differ on the subject of handling file extensions, and that may hurt a bit.
|
|
57
57
|
|
|
58
58
|
If you use Stylus `@import` to expose variables, mixins or just to concatenate code, you should use only the `.styl` extension on your imported files. If you use the `.css.styl` form (a convention from Sprockets), Stylus will treat it as a plain CSS file since it has `.css` on its name.
|
|
59
59
|
|
|
60
60
|
```sass
|
|
61
|
-
// imports
|
|
61
|
+
// imports mixins.styl
|
|
62
62
|
@import 'mixins'
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
## Plugins
|
|
66
66
|
|
|
67
|
-
[Stylus](https://github.com/LearnBoost/stylus) exposes a nice API to create plugins written on [node.js](http://nodejs.org), like [nib](https://github.com/visionmedia/nib). The installation process should be same as described above for [Stylus](https://github.com/LearnBoost/stylus) (since they're all npm packages after all). You can hook them
|
|
67
|
+
[Stylus](https://github.com/LearnBoost/stylus) exposes a nice API to create plugins written on [node.js](http://nodejs.org), like [nib](https://github.com/visionmedia/nib). The installation process should be the same as described above for [Stylus](https://github.com/LearnBoost/stylus) (since they're all npm packages after all). You can hook them up on your Ruby code with `Stylus.use`:
|
|
68
68
|
|
|
69
69
|
```ruby
|
|
70
70
|
Stylus.use :fingerprint, :literal => 'caa8c262e23268d2a7062c6217202343b84f472b'
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
Will run something like this
|
|
73
|
+
Will run something like this in JavaScript:
|
|
74
74
|
|
|
75
75
|
```javascript
|
|
76
76
|
stylus(file).use(fingerprint({literal:'caa8c262e23268d2a7062c6217202343b84f472b'}));
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
##
|
|
79
|
+
## Questions, Bugs or Support
|
|
80
80
|
|
|
81
|
-
You can [submit an issue](https://github.com/lucasmazza/ruby-stylus/issues) or ping me
|
|
81
|
+
You can [submit an issue](https://github.com/lucasmazza/ruby-stylus/issues) or ping me on [GitHub](http://github.com/lucasmazza) or [Twitter](http://twitter.com/lucasmazza).
|
|
82
82
|
|
|
83
|
-
For more info about the [Stylus](https://github.com/LearnBoost/stylus) syntax and
|
|
83
|
+
For more info about the [Stylus](https://github.com/LearnBoost/stylus) syntax and its features you can check the [project repository](https://github.com/learnboost/stylus) and the docs on the [GitHub page](http://learnboost.github.com/stylus).
|
|
84
84
|
|
|
85
85
|
## Changelog
|
|
86
86
|
[It's available here.](https://github.com/lucasmazza/ruby-stylus/blob/master/CHANGELOG.md)
|
data/lib/stylus/railtie.rb
CHANGED
|
@@ -9,7 +9,7 @@ module Stylus
|
|
|
9
9
|
|
|
10
10
|
config.app_generators.stylesheet_engine :stylus
|
|
11
11
|
|
|
12
|
-
initializer :setup_stylus, :after => 'sprockets.environment' do |app|
|
|
12
|
+
initializer :setup_stylus, :after => 'sprockets.environment', :group => :all do |app|
|
|
13
13
|
if app.config.assets.enabled
|
|
14
14
|
app.assets.register_engine '.styl', Tilt::StylusTemplate
|
|
15
15
|
app.assets.register_preprocessor 'text/css', Stylus::ImportProcessor
|
data/lib/stylus/version.rb
CHANGED
data/stylus.gemspec
CHANGED
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
|
15
15
|
s.add_dependency 'execjs'
|
|
16
16
|
s.add_dependency 'stylus-source'
|
|
17
17
|
s.add_development_dependency 'rspec', '~> 2.0'
|
|
18
|
-
s.add_development_dependency 'railties', '~> 3.
|
|
18
|
+
s.add_development_dependency 'railties', '~> 3.0'
|
|
19
19
|
s.add_development_dependency 'tzinfo'
|
|
20
20
|
s.add_development_dependency 'yajl-ruby'
|
|
21
21
|
s.add_development_dependency 'rocco'
|
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.2
|
|
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-
|
|
12
|
+
date: 2012-03-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: execjs
|
|
16
|
-
requirement: &
|
|
16
|
+
requirement: &70186296838480 !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: *70186296838480
|
|
25
25
|
- !ruby/object:Gem::Dependency
|
|
26
26
|
name: stylus-source
|
|
27
|
-
requirement: &
|
|
27
|
+
requirement: &70186296851920 !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: *70186296851920
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: rspec
|
|
38
|
-
requirement: &
|
|
38
|
+
requirement: &70186296850680 !ruby/object:Gem::Requirement
|
|
39
39
|
none: false
|
|
40
40
|
requirements:
|
|
41
41
|
- - ~>
|
|
@@ -43,21 +43,21 @@ dependencies:
|
|
|
43
43
|
version: '2.0'
|
|
44
44
|
type: :development
|
|
45
45
|
prerelease: false
|
|
46
|
-
version_requirements: *
|
|
46
|
+
version_requirements: *70186296850680
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
|
48
48
|
name: railties
|
|
49
|
-
requirement: &
|
|
49
|
+
requirement: &70186296849620 !ruby/object:Gem::Requirement
|
|
50
50
|
none: false
|
|
51
51
|
requirements:
|
|
52
52
|
- - ~>
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 3.
|
|
54
|
+
version: '3.0'
|
|
55
55
|
type: :development
|
|
56
56
|
prerelease: false
|
|
57
|
-
version_requirements: *
|
|
57
|
+
version_requirements: *70186296849620
|
|
58
58
|
- !ruby/object:Gem::Dependency
|
|
59
59
|
name: tzinfo
|
|
60
|
-
requirement: &
|
|
60
|
+
requirement: &70186296848740 !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: *70186296848740
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: yajl-ruby
|
|
71
|
-
requirement: &
|
|
71
|
+
requirement: &70186296847340 !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: *70186296847340
|
|
80
80
|
- !ruby/object:Gem::Dependency
|
|
81
81
|
name: rocco
|
|
82
|
-
requirement: &
|
|
82
|
+
requirement: &70186296845660 !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: *70186296845660
|
|
91
91
|
description: Bridge library to compile .styl stylesheets from ruby code.
|
|
92
92
|
email:
|
|
93
93
|
- luc4smazza@gmail.com
|
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
160
160
|
version: '0'
|
|
161
161
|
requirements: []
|
|
162
162
|
rubyforge_project:
|
|
163
|
-
rubygems_version: 1.8.
|
|
163
|
+
rubygems_version: 1.8.17
|
|
164
164
|
signing_key:
|
|
165
165
|
specification_version: 3
|
|
166
166
|
summary: Ruby Stylus Compiler
|