rake-pipeline 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/.rspec +1 -0
- data/.yardopts +2 -0
- data/Gemfile +10 -0
- data/LICENSE +20 -0
- data/README.markdown +4 -0
- data/README.yard +149 -0
- data/Rakefile +12 -0
- data/bin/rakep +27 -0
- data/lib/rake-pipeline.rb +365 -0
- data/lib/rake-pipeline/dsl.rb +146 -0
- data/lib/rake-pipeline/error.rb +17 -0
- data/lib/rake-pipeline/file_wrapper.rb +173 -0
- data/lib/rake-pipeline/filter.rb +209 -0
- data/lib/rake-pipeline/filters.rb +1 -0
- data/lib/rake-pipeline/filters/concat.rb +63 -0
- data/lib/rake-pipeline/matcher.rb +106 -0
- data/lib/rake-pipeline/middleware.rb +70 -0
- data/lib/rake-pipeline/rails_plugin.rb +8 -0
- data/lib/rake-pipeline/railtie.rb +17 -0
- data/lib/rake-pipeline/version.rb +6 -0
- data/rails/init.rb +2 -0
- data/rake-pipeline.gemspec +22 -0
- data/spec/concat_filter_spec.rb +60 -0
- data/spec/dsl_spec.rb +86 -0
- data/spec/encoding_spec.rb +106 -0
- data/spec/file_wrapper_spec.rb +105 -0
- data/spec/filter_spec.rb +216 -0
- data/spec/matcher_spec.rb +105 -0
- data/spec/middleware_spec.rb +149 -0
- data/spec/pipeline_spec.rb +160 -0
- data/spec/rake_acceptance_spec.rb +240 -0
- data/spec/spec_helper.rb +74 -0
- metadata +123 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
SimpleCov.start do
|
3
|
+
add_group "lib", "lib"
|
4
|
+
add_group "spec", "spec"
|
5
|
+
end
|
6
|
+
|
7
|
+
|
8
|
+
require "rake-pipeline"
|
9
|
+
require "rake-pipeline/filters"
|
10
|
+
|
11
|
+
class Rake::Pipeline
|
12
|
+
module SpecHelpers
|
13
|
+
|
14
|
+
# TODO: OS agnostic modules
|
15
|
+
module FileUtils
|
16
|
+
def mkdir_p(dir)
|
17
|
+
system "mkdir", "-p", dir
|
18
|
+
end
|
19
|
+
|
20
|
+
def touch(file)
|
21
|
+
system "touch", file
|
22
|
+
end
|
23
|
+
|
24
|
+
def rm_rf(dir)
|
25
|
+
system "rm", "-rf", dir
|
26
|
+
end
|
27
|
+
|
28
|
+
def touch_p(file)
|
29
|
+
dir = File.dirname(file)
|
30
|
+
mkdir_p dir
|
31
|
+
touch file
|
32
|
+
end
|
33
|
+
|
34
|
+
def age_existing_files
|
35
|
+
old_time = Time.now - 10
|
36
|
+
Dir[File.join(tmp, "**/*.js")].each do |file|
|
37
|
+
File.utime(old_time, old_time, file)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
module Filters
|
43
|
+
ConcatFilter = Rake::Pipeline::ConcatFilter
|
44
|
+
|
45
|
+
class StripAssertsFilter < Rake::Pipeline::Filter
|
46
|
+
def generate_output(inputs, output)
|
47
|
+
inputs.each do |input|
|
48
|
+
output.write input.read.gsub(%r{^\s*assert\(.*\)\s*;?\s*$}m, '')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
RSpec.configure do |config|
|
57
|
+
original = Dir.pwd
|
58
|
+
|
59
|
+
config.include Rake::Pipeline::SpecHelpers::FileUtils
|
60
|
+
|
61
|
+
def tmp
|
62
|
+
File.expand_path("../tmp", __FILE__)
|
63
|
+
end
|
64
|
+
|
65
|
+
config.before do
|
66
|
+
rm_rf(tmp)
|
67
|
+
mkdir_p(tmp)
|
68
|
+
Dir.chdir(tmp)
|
69
|
+
end
|
70
|
+
|
71
|
+
config.after do
|
72
|
+
Dir.chdir(original)
|
73
|
+
end
|
74
|
+
end
|
metadata
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rake-pipeline
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Yehuda Katz
|
9
|
+
- Tom Dale
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2011-12-05 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rake
|
17
|
+
requirement: &70238259782180 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.9.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *70238259782180
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rspec
|
28
|
+
requirement: &70238259781760 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *70238259781760
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rack-test
|
39
|
+
requirement: &70238259781300 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *70238259781300
|
48
|
+
description: Simple Asset Management
|
49
|
+
email:
|
50
|
+
- wycats@gmail.com
|
51
|
+
executables:
|
52
|
+
- rakep
|
53
|
+
extensions: []
|
54
|
+
extra_rdoc_files: []
|
55
|
+
files:
|
56
|
+
- .gitignore
|
57
|
+
- .rspec
|
58
|
+
- .yardopts
|
59
|
+
- Gemfile
|
60
|
+
- LICENSE
|
61
|
+
- README.markdown
|
62
|
+
- README.yard
|
63
|
+
- Rakefile
|
64
|
+
- bin/rakep
|
65
|
+
- lib/rake-pipeline.rb
|
66
|
+
- lib/rake-pipeline/dsl.rb
|
67
|
+
- lib/rake-pipeline/error.rb
|
68
|
+
- lib/rake-pipeline/file_wrapper.rb
|
69
|
+
- lib/rake-pipeline/filter.rb
|
70
|
+
- lib/rake-pipeline/filters.rb
|
71
|
+
- lib/rake-pipeline/filters/concat.rb
|
72
|
+
- lib/rake-pipeline/matcher.rb
|
73
|
+
- lib/rake-pipeline/middleware.rb
|
74
|
+
- lib/rake-pipeline/rails_plugin.rb
|
75
|
+
- lib/rake-pipeline/railtie.rb
|
76
|
+
- lib/rake-pipeline/version.rb
|
77
|
+
- rails/init.rb
|
78
|
+
- rake-pipeline.gemspec
|
79
|
+
- spec/concat_filter_spec.rb
|
80
|
+
- spec/dsl_spec.rb
|
81
|
+
- spec/encoding_spec.rb
|
82
|
+
- spec/file_wrapper_spec.rb
|
83
|
+
- spec/filter_spec.rb
|
84
|
+
- spec/matcher_spec.rb
|
85
|
+
- spec/middleware_spec.rb
|
86
|
+
- spec/pipeline_spec.rb
|
87
|
+
- spec/rake_acceptance_spec.rb
|
88
|
+
- spec/spec_helper.rb
|
89
|
+
homepage: ''
|
90
|
+
licenses: []
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ! '>='
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
requirements: []
|
108
|
+
rubyforge_project:
|
109
|
+
rubygems_version: 1.8.10
|
110
|
+
signing_key:
|
111
|
+
specification_version: 3
|
112
|
+
summary: Simple Asset Management
|
113
|
+
test_files:
|
114
|
+
- spec/concat_filter_spec.rb
|
115
|
+
- spec/dsl_spec.rb
|
116
|
+
- spec/encoding_spec.rb
|
117
|
+
- spec/file_wrapper_spec.rb
|
118
|
+
- spec/filter_spec.rb
|
119
|
+
- spec/matcher_spec.rb
|
120
|
+
- spec/middleware_spec.rb
|
121
|
+
- spec/pipeline_spec.rb
|
122
|
+
- spec/rake_acceptance_spec.rb
|
123
|
+
- spec/spec_helper.rb
|