rails2_asset_pipeline 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -5,3 +5,5 @@ gem 'rake'
5
5
  gem 'json'
6
6
  gem 'rspec', '~>2'
7
7
  gem 'bump'
8
+ gem 'sass'
9
+ gem 'sprockets-sass'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails2_asset_pipeline (0.3.0)
4
+ rails2_asset_pipeline (0.3.1)
5
5
  sprockets
6
6
 
7
7
  GEM
@@ -22,11 +22,15 @@ GEM
22
22
  rspec-expectations (2.12.1)
23
23
  diff-lcs (~> 1.1.3)
24
24
  rspec-mocks (2.12.1)
25
+ sass (3.2.5)
25
26
  sprockets (2.8.2)
26
27
  hike (~> 1.2)
27
28
  multi_json (~> 1.0)
28
29
  rack (~> 1.0)
29
30
  tilt (~> 1.1, != 1.3.0)
31
+ sprockets-sass (0.9.1)
32
+ sprockets (~> 2.0)
33
+ tilt (~> 1.1)
30
34
  tilt (1.3.3)
31
35
 
32
36
  PLATFORMS
@@ -38,3 +42,5 @@ DEPENDENCIES
38
42
  rails2_asset_pipeline!
39
43
  rake
40
44
  rspec (~> 2)
45
+ sass
46
+ sprockets-sass
@@ -11,7 +11,12 @@ namespace :assets do
11
11
  if t.respond_to?(:manifest=) # sprockets 2.8+ ?
12
12
  t.manifest = Sprockets::Manifest.new(t.environment.index, "./public/#{Rails2AssetPipeline.prefix}/manifest.json")
13
13
  end
14
- t.assets = t.environment.paths.map{|p| Dir["#{p.sub(Rails.root.to_s,"")}/**/*"] }.flatten
14
+ t.assets = t.environment.each_logical_path.map do |logical_path|
15
+ partial = (logical_path =~ %r{(^|/)_[^/]*.css$})
16
+ if !partial && asset = t.environment.find_asset(logical_path)
17
+ asset.pathname.to_s
18
+ end
19
+ end.compact
15
20
  t.log_level = Logger::ERROR
16
21
  t.keep = 2
17
22
  end
@@ -1,3 +1,3 @@
1
1
  module Rails2AssetPipeline
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
@@ -34,6 +34,23 @@ describe "Rails2AssetPipeline Tasks" do
34
34
  run("ls public/assets").should == "application-09565e705ecd8821e8ca69c50e3e2bae.js\nmanifest.json\n"
35
35
  end
36
36
 
37
+ context "sass partials" do
38
+ before do
39
+ write "app/assets/stylesheets/application.scss", "@import \"_utils.scss\";\nbody{background-color: $blue;}"
40
+ write "app/assets/stylesheets/_utils.scss", "$blue: #000044;"
41
+ end
42
+
43
+ it "does not compile" do
44
+ run "rake assets:precompile"
45
+ run("ls public/assets").should_not include("utils")
46
+ end
47
+
48
+ it "includes them" do
49
+ run "rake assets:precompile"
50
+ run("cat public/assets/application-*.css").should == "body {\n background-color: #000044; }\n"
51
+ end
52
+ end
53
+
37
54
  context "with a custom prefix" do
38
55
  after do
39
56
  run "rm -rf public/static-assets"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails2_asset_pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-16 00:00:00.000000000 Z
12
+ date: 2013-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sprockets
@@ -67,7 +67,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
67
67
  version: '0'
68
68
  segments:
69
69
  - 0
70
- hash: 4425275783523912848
70
+ hash: 343763774772784530
71
71
  required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  segments:
78
78
  - 0
79
- hash: 4425275783523912848
79
+ hash: 343763774772784530
80
80
  requirements: []
81
81
  rubyforge_project:
82
82
  rubygems_version: 1.8.24