pipefitter 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pipefitter.rb +15 -2
- data/lib/pipefitter/version.rb +1 -1
- data/spec/pipefitter_spec.rb +9 -1
- metadata +2 -2
data/lib/pipefitter.rb
CHANGED
@@ -110,13 +110,26 @@ class Pipefitter
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def source_paths
|
113
|
-
|
113
|
+
standard_paths | optional_paths
|
114
|
+
end
|
115
|
+
|
116
|
+
def standard_paths
|
117
|
+
%w{
|
114
118
|
Gemfile
|
115
119
|
Gemfile.lock
|
116
120
|
app/assets
|
121
|
+
}.map { |path| File.join(base_path, path) }
|
122
|
+
end
|
123
|
+
|
124
|
+
def optional_paths
|
125
|
+
%w{
|
117
126
|
lib/assets
|
118
127
|
vendor/assets
|
119
|
-
}.map
|
128
|
+
}.map do |path|
|
129
|
+
File.join(base_path, path)
|
130
|
+
end.select do |path|
|
131
|
+
File.exists?(path)
|
132
|
+
end
|
120
133
|
end
|
121
134
|
|
122
135
|
def artifact_paths
|
data/lib/pipefitter/version.rb
CHANGED
data/spec/pipefitter_spec.rb
CHANGED
@@ -75,8 +75,16 @@ describe Pipefitter do
|
|
75
75
|
|
76
76
|
it 'uses a custom compile command', :focus => true do
|
77
77
|
compiler_stub = stub
|
78
|
-
Pipefitter::Compiler.should_receive(:new).with(
|
78
|
+
Pipefitter::Compiler.should_receive(:new).with(rails_root, :logger => kind_of(Logger), :command => 'script/precompile_assets').and_return(compiler_stub)
|
79
79
|
compiler_stub.should_receive(:compile).and_return(true)
|
80
80
|
Pipefitter.compile(rails_root, :command => 'script/precompile_assets', :logger => null_logger)
|
81
81
|
end
|
82
|
+
|
83
|
+
it 'skips optional directories if they do not exist' do
|
84
|
+
FileUtils.rm_r(File.join(rails_root, 'lib/assets'))
|
85
|
+
FileUtils.rm_r(File.join(rails_root, 'vendor/assets'))
|
86
|
+
Pipefitter.compile(rails_root, :logger => null_logger)
|
87
|
+
manifest_file = "#{rails_root}/public/assets/manifest.yml"
|
88
|
+
File.exists?(manifest_file).should be_true
|
89
|
+
end
|
82
90
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: pipefitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.2.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Lee Jones
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2013-03-
|
13
|
+
date: 2013-03-25 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: A command-line tool that avoids unnecessary compiles when using the Rails Asset Pipeline.
|