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 CHANGED
@@ -1,6 +1,7 @@
1
1
  *.gem
2
2
  node_modules
3
3
  .bundle
4
+ gemfiles/*.lock
4
5
  Gemfile.lock
5
6
  pkg/*
6
7
  docs
data/.travis.yml CHANGED
@@ -1,5 +1,9 @@
1
1
  before_script: "npm install nib"
2
2
  before_install: gem update --system
3
+ language: ruby
4
+ gemfile:
5
+ - gemfiles/Gemfile-rails.3.1.x
6
+ - Gemfile
3
7
  rvm:
4
8
  - ree
5
9
  - 1.9.3
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) 2011 Lucas Mazza <luc4smazza@gmail.com>
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 the Rails 3.1 Asset Pipeline.
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) 2011 Lucas Mazza &lt;luc4smazza@gmail.com&gt;
92
+ Copyright (c) 2012 Lucas Mazza &lt;luc4smazza@gmail.com&gt;
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 do |task|
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
@@ -0,0 +1,7 @@
1
+ source :rubygems
2
+
3
+ gem 'railties', '~> 3.1.0'
4
+ gem 'tzinfo'
5
+ gem 'rspec', '~> 2.0'
6
+ gem 'execjs'
7
+ gem 'stylus-source'
@@ -9,22 +9,24 @@ module Stylus
9
9
 
10
10
  config.app_generators.stylesheet_engine :stylus
11
11
 
12
- initializer :setup_stylus, :after => 'sprockets.environment', :group => :all do |app|
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
- # After initialization block to inspect the `Sprockets` configuration
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.after_initialize do |app|
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
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
@@ -1,3 +1,3 @@
1
1
  module Stylus
2
- VERSION = "0.4.2"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -2,9 +2,10 @@ require 'spec_helper'
2
2
 
3
3
  describe 'Sprockets and Rails integration' do
4
4
 
5
- it 'copies the asset paths into the Stylus load path' do
5
+ it "copies the folders ending with 'stylesheets' from the Sprockets load path" do
6
6
  app = create_app
7
- Stylus.paths.should =~ app.assets.paths
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
@@ -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('../../fixtures', __FILE__)
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.0'
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.2
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-24 00:00:00.000000000 Z
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: &70186296838480 !ruby/object:Gem::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: *70186296838480
24
+ version_requirements: *70111340797160
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: stylus-source
27
- requirement: &70186296851920 !ruby/object:Gem::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: *70186296851920
35
+ version_requirements: *70111340796740
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70186296850680 !ruby/object:Gem::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: *70186296850680
46
+ version_requirements: *70111340796200
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: railties
49
- requirement: &70186296849620 !ruby/object:Gem::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.0'
54
+ version: '3.2'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70186296849620
57
+ version_requirements: *70111340795660
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: tzinfo
60
- requirement: &70186296848740 !ruby/object:Gem::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: *70186296848740
68
+ version_requirements: *70111340795280
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: yajl-ruby
71
- requirement: &70186296847340 !ruby/object:Gem::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: *70186296847340
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