stylus 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +6 -0
- data/LICENSE +1 -1
- data/README.md +2 -2
- data/Rakefile +2 -19
- data/gemfiles/Gemfile-rails.3.1.x +7 -0
- data/lib/stylus/railtie.rb +9 -7
- data/lib/stylus/version.rb +1 -1
- data/spec/sprockets_spec.rb +3 -2
- data/spec/{fixtures → stylesheets}/compressed.styl +0 -0
- data/spec/{fixtures → stylesheets}/debug.styl +0 -0
- data/spec/{fixtures → stylesheets}/implicit.styl +0 -0
- data/spec/{fixtures → stylesheets}/import.styl +0 -0
- data/spec/{fixtures → stylesheets}/mixins/vendor.styl +0 -0
- data/spec/{fixtures → stylesheets}/nib.styl +0 -0
- data/spec/{fixtures → stylesheets}/plugin.styl +0 -0
- data/spec/{fixtures → stylesheets}/simple.styl +0 -0
- data/spec/{fixtures → stylesheets}/stylesheet.styl +0 -0
- data/spec/support/helpers.rb +2 -1
- data/stylus.gemspec +1 -2
- metadata +34 -44
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## Changelog
|
2
2
|
|
3
|
+
### 0.5.0 (Master)
|
4
|
+
[Compare view](https://github.com/lucasmazza/ruby-stylus/compare/v0.4.2...v.0.5.0)
|
5
|
+
|
6
|
+
* Rewrite of the Railtie initializers to match 3.2 loading order;
|
7
|
+
* Only folders ending with `stylesheets` will be copied over to `Stylus.paths`.
|
8
|
+
|
3
9
|
### 0.4.2 (2012-03-24)
|
4
10
|
[Compare view](https://github.com/lucasmazza/ruby-stylus/compare/v0.4.1...v.0.4.2)
|
5
11
|
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
(The MIT License)
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2012 Lucas Mazza <luc4smazza@gmail.com>
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
6
6
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -41,7 +41,7 @@ Stylus.use :nib
|
|
41
41
|
# a `:filename` option so Stylus can locate your stylesheet for proper inspection.
|
42
42
|
Stylus.debug = true
|
43
43
|
```
|
44
|
-
### With
|
44
|
+
### With Rails 3 and the Asset Pipeline.
|
45
45
|
|
46
46
|
First of all, remember to add `gem 'stylus'` to your Gemfile inside the `:assets` group, So Rails will require the gem according to your current environment - on production you should serve precompiled versions of your assets instead of compiling on the fly.
|
47
47
|
|
@@ -89,7 +89,7 @@ For more info about the [Stylus](https://github.com/LearnBoost/stylus) syntax an
|
|
89
89
|
|
90
90
|
(The MIT License)
|
91
91
|
|
92
|
-
Copyright (c)
|
92
|
+
Copyright (c) 2012 Lucas Mazza <luc4smazza@gmail.com>
|
93
93
|
|
94
94
|
Permission is hereby granted, free of charge, to any person obtaining
|
95
95
|
a copy of this software and associated documentation files (the
|
data/Rakefile
CHANGED
@@ -1,25 +1,8 @@
|
|
1
|
-
require 'fileutils'
|
2
1
|
require 'bundler'
|
3
2
|
require 'rspec/core/rake_task'
|
4
|
-
require 'rocco/tasks'
|
5
3
|
Bundler::GemHelper.install_tasks
|
6
4
|
|
7
5
|
desc "Run specs"
|
8
|
-
RSpec::Core::RakeTask.new
|
9
|
-
task.rspec_opts = ["-c -b"]
|
10
|
-
end
|
6
|
+
RSpec::Core::RakeTask.new
|
11
7
|
|
12
|
-
task :default => :spec
|
13
|
-
|
14
|
-
Rocco::make 'docs/'
|
15
|
-
|
16
|
-
desc 'Builds Rocco docs'
|
17
|
-
task :docs => :rocco do
|
18
|
-
Dir['docs/lib/**/*.html'].each do |file|
|
19
|
-
path = file.gsub(/lib/,'')
|
20
|
-
FileUtils.mkdir_p(File.dirname(path))
|
21
|
-
FileUtils.mv(file, path)
|
22
|
-
end
|
23
|
-
cp 'docs/stylus.html', 'docs/index.html', :preserve => true
|
24
|
-
end
|
25
|
-
directory 'docs/'
|
8
|
+
task :default => :spec
|
data/lib/stylus/railtie.rb
CHANGED
@@ -9,22 +9,24 @@ module Stylus
|
|
9
9
|
|
10
10
|
config.app_generators.stylesheet_engine :stylus
|
11
11
|
|
12
|
-
initializer
|
12
|
+
initializer 'stylus.register', :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
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
#
|
19
|
+
# Initializer block to inspect the `Sprockets` configuration
|
20
20
|
# And reflect it on the `Stylus` module;
|
21
21
|
# It also includes the `Rails` asset load path into `Stylus` so any
|
22
22
|
# `.styl` file inside it can be imported by the `Stylus` API.
|
23
|
-
config
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
Stylus.
|
23
|
+
initializer 'stylus.config', :after => :append_assets_path, :group => :all do |app|
|
24
|
+
sprockets = app.config.assets
|
25
|
+
paths = sprockets.paths.select { |dir| dir.to_s.ends_with?('stylesheets') }
|
26
|
+
if sprockets.enabled
|
27
|
+
Stylus.compress = sprockets.compress
|
28
|
+
Stylus.debug = sprockets.debug
|
29
|
+
Stylus.paths.concat paths
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
data/lib/stylus/version.rb
CHANGED
data/spec/sprockets_spec.rb
CHANGED
@@ -2,9 +2,10 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'Sprockets and Rails integration' do
|
4
4
|
|
5
|
-
it
|
5
|
+
it "copies the folders ending with 'stylesheets' from the Sprockets load path" do
|
6
6
|
app = create_app
|
7
|
-
Stylus.paths.should
|
7
|
+
Stylus.paths.should == [fixture_root]
|
8
|
+
Stylus.paths.should_not == app.assets.paths
|
8
9
|
end
|
9
10
|
|
10
11
|
it 'process .styl files with the asset pipeline' do
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/support/helpers.rb
CHANGED
@@ -16,13 +16,14 @@ module Helpers
|
|
16
16
|
assets.compress = true if options[:compress]
|
17
17
|
assets.debug = true if options[:debug]
|
18
18
|
assets.paths << fixture_root
|
19
|
+
assets.paths << File.expand_path('javascripts')
|
19
20
|
app.config.active_support.deprecation = :log
|
20
21
|
app.initialize!
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
24
25
|
def fixture_root
|
25
|
-
File.expand_path('../../
|
26
|
+
File.expand_path('../../stylesheets', __FILE__)
|
26
27
|
end
|
27
28
|
|
28
29
|
def output_root
|
data/stylus.gemspec
CHANGED
@@ -15,10 +15,9 @@ 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.2'
|
19
19
|
s.add_development_dependency 'tzinfo'
|
20
20
|
s.add_development_dependency 'yajl-ruby'
|
21
|
-
s.add_development_dependency 'rocco'
|
22
21
|
|
23
22
|
s.files = `git ls-files`.split("\n")
|
24
23
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
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
|
+
version: 0.5.0
|
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-
|
12
|
+
date: 2012-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: execjs
|
16
|
-
requirement: &
|
16
|
+
requirement: &70111340797160 !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: *70111340797160
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: stylus-source
|
27
|
-
requirement: &
|
27
|
+
requirement: &70111340796740 !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: *70111340796740
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70111340796200 !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: *70111340796200
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: railties
|
49
|
-
requirement: &
|
49
|
+
requirement: &70111340795660 !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.2'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70111340795660
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: tzinfo
|
60
|
-
requirement: &
|
60
|
+
requirement: &70111340795280 !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: *70111340795280
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: yajl-ruby
|
71
|
-
requirement: &
|
71
|
+
requirement: &70111340794820 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,18 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
80
|
-
- !ruby/object:Gem::Dependency
|
81
|
-
name: rocco
|
82
|
-
requirement: &70186296845660 !ruby/object:Gem::Requirement
|
83
|
-
none: false
|
84
|
-
requirements:
|
85
|
-
- - ! '>='
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: '0'
|
88
|
-
type: :development
|
89
|
-
prerelease: false
|
90
|
-
version_requirements: *70186296845660
|
79
|
+
version_requirements: *70111340794820
|
91
80
|
description: Bridge library to compile .styl stylesheets from ruby code.
|
92
81
|
email:
|
93
82
|
- luc4smazza@gmail.com
|
@@ -102,6 +91,7 @@ files:
|
|
102
91
|
- LICENSE
|
103
92
|
- README.md
|
104
93
|
- Rakefile
|
94
|
+
- gemfiles/Gemfile-rails.3.1.x
|
105
95
|
- lib/rails/generators/stylus/assets/assets_generator.rb
|
106
96
|
- lib/rails/generators/stylus/assets/templates/stylesheet.css.styl
|
107
97
|
- lib/rails/generators/stylus/scaffold/scaffold_generator.rb
|
@@ -119,21 +109,21 @@ files:
|
|
119
109
|
- spec/cases/plugin.css
|
120
110
|
- spec/cases/simple.css
|
121
111
|
- spec/cases/stylesheet.css
|
122
|
-
- spec/fixtures/compressed.styl
|
123
|
-
- spec/fixtures/debug.styl
|
124
|
-
- spec/fixtures/implicit.styl
|
125
|
-
- spec/fixtures/import.styl
|
126
|
-
- spec/fixtures/mixins/vendor.styl
|
127
|
-
- spec/fixtures/nib.styl
|
128
|
-
- spec/fixtures/plugin.styl
|
129
|
-
- spec/fixtures/simple.styl
|
130
|
-
- spec/fixtures/stylesheet.styl
|
131
112
|
- spec/generators/assets_generator_spec.rb
|
132
113
|
- spec/generators/controller_generator_spec.rb
|
133
114
|
- spec/generators/scaffold_generator_spec.rb
|
134
115
|
- spec/import_processor_spec.rb
|
135
116
|
- spec/spec_helper.rb
|
136
117
|
- spec/sprockets_spec.rb
|
118
|
+
- spec/stylesheets/compressed.styl
|
119
|
+
- spec/stylesheets/debug.styl
|
120
|
+
- spec/stylesheets/implicit.styl
|
121
|
+
- spec/stylesheets/import.styl
|
122
|
+
- spec/stylesheets/mixins/vendor.styl
|
123
|
+
- spec/stylesheets/nib.styl
|
124
|
+
- spec/stylesheets/plugin.styl
|
125
|
+
- spec/stylesheets/simple.styl
|
126
|
+
- spec/stylesheets/stylesheet.styl
|
137
127
|
- spec/stylus_spec.rb
|
138
128
|
- spec/support/generators/test_case.rb
|
139
129
|
- spec/support/helpers.rb
|
@@ -172,21 +162,21 @@ test_files:
|
|
172
162
|
- spec/cases/plugin.css
|
173
163
|
- spec/cases/simple.css
|
174
164
|
- spec/cases/stylesheet.css
|
175
|
-
- spec/fixtures/compressed.styl
|
176
|
-
- spec/fixtures/debug.styl
|
177
|
-
- spec/fixtures/implicit.styl
|
178
|
-
- spec/fixtures/import.styl
|
179
|
-
- spec/fixtures/mixins/vendor.styl
|
180
|
-
- spec/fixtures/nib.styl
|
181
|
-
- spec/fixtures/plugin.styl
|
182
|
-
- spec/fixtures/simple.styl
|
183
|
-
- spec/fixtures/stylesheet.styl
|
184
165
|
- spec/generators/assets_generator_spec.rb
|
185
166
|
- spec/generators/controller_generator_spec.rb
|
186
167
|
- spec/generators/scaffold_generator_spec.rb
|
187
168
|
- spec/import_processor_spec.rb
|
188
169
|
- spec/spec_helper.rb
|
189
170
|
- spec/sprockets_spec.rb
|
171
|
+
- spec/stylesheets/compressed.styl
|
172
|
+
- spec/stylesheets/debug.styl
|
173
|
+
- spec/stylesheets/implicit.styl
|
174
|
+
- spec/stylesheets/import.styl
|
175
|
+
- spec/stylesheets/mixins/vendor.styl
|
176
|
+
- spec/stylesheets/nib.styl
|
177
|
+
- spec/stylesheets/plugin.styl
|
178
|
+
- spec/stylesheets/simple.styl
|
179
|
+
- spec/stylesheets/stylesheet.styl
|
190
180
|
- spec/stylus_spec.rb
|
191
181
|
- spec/support/generators/test_case.rb
|
192
182
|
- spec/support/helpers.rb
|