less-rails 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 2.1.1 - 11/24/2011
5
+ ------------------
6
+
7
+ * All app asset stylesheet paths are added to less paths.
8
+
9
+
4
10
  2.1.0 - 11/18/2011
5
11
  ------------------
6
12
  * Remove our basic CssCompressor since it can not handle real world general purpose JS
data/README.md CHANGED
@@ -18,7 +18,7 @@ This gem was made for other gems to properly hook into one place to provide path
18
18
 
19
19
  ```ruby
20
20
  MyProject::Application.configure do
21
- config.less.paths << "#{Rails.root}/lib/less/stylesheets"
21
+ config.less.paths << "#{Rails.root}/lib/less/protractor/stylesheets"
22
22
  config.less.compress = true
23
23
  end
24
24
  ```
@@ -29,6 +29,30 @@ If `config.assets.compress` is set to true, we will set the `config.less.compres
29
29
 
30
30
 
31
31
 
32
+ ## Import Hooks
33
+
34
+ Any `@import` to a `.less` file will automatically declare that file as a sprockets dependency to the file importing it. This means that you can edit imported framework files and see changes reflected in the parent durning development. So this:
35
+
36
+ ```css
37
+ @import "frameworks/bootstrap/mixins";
38
+
39
+ #leftnav { .border-radius(5px); }
40
+ ```
41
+
42
+ Will end up acting as if you had done this below:
43
+
44
+ ```css
45
+ /*
46
+ *= depend_on "frameworks/bootstrap/mixins.less"
47
+ */
48
+
49
+ @import "frameworks/bootstrap/mixins";
50
+
51
+ #leftnav { .border-radius(5px); }
52
+ ```
53
+
54
+
55
+
32
56
  ## Helpers
33
57
 
34
58
  When referencing assets use the following helpers in LESS.
data/less-rails.gemspec CHANGED
@@ -18,5 +18,5 @@ Gem::Specification.new do |s|
18
18
  s.add_runtime_dependency 'actionpack', '~> 3.1.1'
19
19
  s.add_development_dependency 'minitest'
20
20
  s.add_development_dependency 'guard-minitest'
21
- s.add_development_dependency 'rails', '~> 3.1.1'
21
+ s.add_development_dependency 'rails', '~> 3.1.3'
22
22
  end
@@ -18,16 +18,21 @@ module Less
18
18
  Sprockets.register_engine '.less', Less::Rails::LessTemplate
19
19
  end
20
20
 
21
- initializer 'less-rails.before.load_config_initializers', :before => 'load_config_initializers', :group => :all do |app|
21
+ initializer 'less-rails.before.load_config_initializers', :before => :load_config_initializers, :group => :all do |app|
22
22
  raise 'The less-rails plugin requires the asset pipeline to be enabled.' unless app.config.assets.enabled
23
23
  app.assets.register_preprocessor 'text/css', ImportProcessor
24
24
  end
25
25
 
26
- initializer 'less-rails.after.load_config_initializers', :after => 'load_config_initializers', :group => :all do |app|
26
+ initializer 'less-rails.after.load_config_initializers', :after => :load_config_initializers, :group => :all do |app|
27
27
  app.assets.context_class.extend(LessContext)
28
28
  app.assets.context_class.less_config = app.config.less
29
29
  end
30
30
 
31
+ initializer 'less-rails.after.append_assets_path', :after => :append_assets_path, :group => :all do |app|
32
+ assets_stylesheet_paths = app.config.assets.paths.select { |p| p.ends_with?('stylesheets') }
33
+ app.config.less.paths.unshift(*assets_stylesheet_paths)
34
+ end
35
+
31
36
  initializer 'less-rails.setup_compression', :group => :all do |app|
32
37
  config.less.compress = app.config.assets.compress
33
38
  end
@@ -1,5 +1,5 @@
1
1
  module Less
2
2
  module Rails
3
- VERSION = "2.1.0"
3
+ VERSION = "2.1.1"
4
4
  end
5
5
  end
@@ -8,8 +8,8 @@ class RailtieSpec < Less::Rails::Spec
8
8
  dummy_config.less.must_be_instance_of ActiveSupport::OrderedOptions
9
9
  end
10
10
 
11
- it 'must have an empty array for paths' do
12
- dummy_config.less.paths.must_equal Array.new
11
+ it 'must have an array for paths' do
12
+ dummy_config.less.paths.must_be_kind_of Array
13
13
  end
14
14
 
15
15
  it 'must have an options hash passed down to the #to_css method' do
@@ -38,6 +38,10 @@ class RailtieSpec < Less::Rails::Spec
38
38
  dummy_assets.preprocessors['text/css'].must_include Less::Rails::ImportProcessor
39
39
  end
40
40
 
41
+ it 'must include the asset pipelines stylesheet paths to less paths' do
42
+ dummy_app.config.less.paths.must_include "#{dummy_app.root}/app/assets/stylesheets"
43
+ end
44
+
41
45
  end
42
46
 
43
47
 
data/test/spec_helper.rb CHANGED
@@ -50,7 +50,6 @@ module Less
50
50
  end
51
51
 
52
52
  def reset_config_options
53
- dummy_config.less.paths = []
54
53
  dummy_config.less.compress = true
55
54
  end
56
55
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: less-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
- - 0
10
- version: 2.1.0
9
+ - 1
10
+ version: 2.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ken Collins
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-18 00:00:00 Z
18
+ date: 2011-11-25 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: less
@@ -85,12 +85,12 @@ dependencies:
85
85
  requirements:
86
86
  - - ~>
87
87
  - !ruby/object:Gem::Version
88
- hash: 1
88
+ hash: 5
89
89
  segments:
90
90
  - 3
91
91
  - 1
92
- - 1
93
- version: 3.1.1
92
+ - 3
93
+ version: 3.1.3
94
94
  type: :development
95
95
  version_requirements: *id005
96
96
  description: The dynamic stylesheet language for the Rails asset pipeline. Allows other gems to extend Less load path.