octopress-asset-pipeline 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +1 -1
- data/lib/octopress-asset-pipeline/version.rb +1 -1
- data/lib/octopress-asset-pipeline.rb +8 -5
- data/octopress-asset-pipeline.gemspec +3 -2
- data/test/.clash.yml +8 -0
- data/test/Gemfile +2 -1
- data/test/{_concat_false.yml → _combine_false.yml} +0 -0
- data/test/{concat_false → combine_false}/blah.js +0 -0
- data/test/{concat_false → combine_false}/foo.js +0 -0
- data/test/{concat_false → combine_false}/index.html +0 -0
- data/test/{concat_false → combine_false}/sass-test.css +0 -0
- data/test/{concat_false → combine_false}/test.css +0 -0
- data/test/site/blah.js +1 -0
- data/test/site/foo.js +6 -0
- data/test/site/index.html +2 -2
- data/test/site/sass-test.css +2 -0
- data/test/site/test.css +2 -0
- data/test/source/sass-test.scss +1 -2
- metadata +50 -34
- data/test/site/javascripts/all-.js +0 -1
- data/test/site/stylesheets/all-.css +0 -1
- data/test/test.rb +0 -14
- data/test/test_suite.rb +0 -160
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ed731c311f629bb538a58f8c51a10ec3bebff27
|
4
|
+
data.tar.gz: fe0e5496d05ed3830d80100c762fc47dff44abf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4213093d12803f32df1aa72c6cefd3ddea89d953104528a76fb8119d92a0df22f753fe2b69f04efc3334008f23261a7591bdf3ef2eedaa8e06d2850174af18ad
|
7
|
+
data.tar.gz: 0575497d3d8fa7019cea05b7f9316640f510f51ea1fd263b68dd0ddb2db5a1a089b581ed8357ccbde10491e039f101df44f34e9cf4cd74032de6114c8a58816e
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -97,7 +97,7 @@ When your site is compiled, this file will be written separately and its `<link>
|
|
97
97
|
|
98
98
|
## Contributing
|
99
99
|
|
100
|
-
1. Fork it ( https://github.com/
|
100
|
+
1. Fork it ( https://github.com/octopress/asset-pipeline/fork )
|
101
101
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
102
102
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
103
103
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -25,7 +25,6 @@ module Octopress
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def register
|
28
|
-
@config ||= Ink.config
|
29
28
|
# Tell Jekyll to read static files and pages
|
30
29
|
# This is necessary when Jekyll isn't being asked to build a site,
|
31
30
|
# like when a user runs the list command to list assets
|
@@ -38,23 +37,27 @@ module Octopress
|
|
38
37
|
add_javascripts
|
39
38
|
end
|
40
39
|
|
40
|
+
def config
|
41
|
+
Ink.config
|
42
|
+
end
|
43
|
+
|
41
44
|
# Return stylesheets to be combined in the asset pipeline
|
42
45
|
def stylesheets
|
43
|
-
sort(@css.clone.concat(@sass),
|
46
|
+
sort(@css.clone.concat(@sass), config['order_css'] || [])
|
44
47
|
end
|
45
48
|
|
46
49
|
def javascripts
|
47
|
-
sort(@js.clone.concat(@coffee),
|
50
|
+
sort(@js.clone.concat(@coffee), config['order_js'] || [])
|
48
51
|
end
|
49
52
|
|
50
53
|
private
|
51
54
|
|
52
55
|
def combine_js
|
53
|
-
|
56
|
+
config['combine_js']
|
54
57
|
end
|
55
58
|
|
56
59
|
def combine_css
|
57
|
-
|
60
|
+
config['combine_css']
|
58
61
|
end
|
59
62
|
|
60
63
|
def add_stylesheets
|
@@ -18,9 +18,10 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.add_runtime_dependency "octopress-ink", "~> 1.0.0.rc.11"
|
22
|
+
|
21
23
|
spec.add_development_dependency "bundler", "~> 1.6"
|
24
|
+
spec.add_development_dependency "clash", "~> 1.0"
|
22
25
|
spec.add_development_dependency "rake"
|
23
26
|
spec.add_development_dependency "octopress"
|
24
|
-
|
25
|
-
spec.add_runtime_dependency "octopress-ink", "~> 1.0.0.rc.1"
|
26
27
|
end
|
data/test/.clash.yml
ADDED
data/test/Gemfile
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/test/site/blah.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
console.log("Yo I'm a javascript")
|
data/test/site/foo.js
ADDED
data/test/site/index.html
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
<script src='/
|
2
|
-
<link href='/
|
1
|
+
<script src='/foo.js'></script><script src='/blah.js'></script>
|
2
|
+
<link href='/test.css' media='all' rel='stylesheet' type='text/css'><link href='/css-test.scss' media='all' rel='stylesheet' type='text/css'>
|
data/test/site/test.css
ADDED
data/test/source/sass-test.scss
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-asset-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: octopress-ink
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.0.0.rc.11
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.0.0.rc.11
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -25,21 +39,21 @@ dependencies:
|
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: '1.6'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
42
|
+
name: clash
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- - "
|
45
|
+
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
47
|
+
version: '1.0'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- - "
|
52
|
+
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
54
|
+
version: '1.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
56
|
+
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - ">="
|
@@ -53,19 +67,19 @@ dependencies:
|
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: octopress
|
70
|
+
name: octopress
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- - "
|
73
|
+
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
62
|
-
type: :
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- - "
|
80
|
+
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
82
|
+
version: '0'
|
69
83
|
description: Combine and compress CSS and Sass, Javascript and Coffeescript to a single
|
70
84
|
fingerprinted file.
|
71
85
|
email:
|
@@ -100,28 +114,29 @@ files:
|
|
100
114
|
- lib/octopress-asset-pipeline/assets/sass.rb
|
101
115
|
- lib/octopress-asset-pipeline/version.rb
|
102
116
|
- octopress-asset-pipeline.gemspec
|
117
|
+
- test/.clash.yml
|
103
118
|
- test/Gemfile
|
104
|
-
- test/
|
119
|
+
- test/_combine_false.yml
|
105
120
|
- test/_config.yml
|
106
|
-
- test/
|
107
|
-
- test/
|
108
|
-
- test/
|
109
|
-
- test/
|
110
|
-
- test/
|
121
|
+
- test/combine_false/blah.js
|
122
|
+
- test/combine_false/foo.js
|
123
|
+
- test/combine_false/index.html
|
124
|
+
- test/combine_false/sass-test.css
|
125
|
+
- test/combine_false/test.css
|
111
126
|
- test/expected/index.html
|
112
127
|
- test/expected/javascripts/all-.js
|
113
128
|
- test/expected/stylesheets/all-.css
|
129
|
+
- test/site/blah.js
|
130
|
+
- test/site/foo.js
|
114
131
|
- test/site/index.html
|
115
|
-
- test/site/
|
116
|
-
- test/site/
|
132
|
+
- test/site/sass-test.css
|
133
|
+
- test/site/test.css
|
117
134
|
- test/source/_sass/_partial.sass
|
118
135
|
- test/source/blah.js
|
119
136
|
- test/source/foo.coffee
|
120
137
|
- test/source/index.html
|
121
138
|
- test/source/sass-test.scss
|
122
139
|
- test/source/test.css
|
123
|
-
- test/test.rb
|
124
|
-
- test/test_suite.rb
|
125
140
|
homepage: https://github.com/octopress/asset-pipeline
|
126
141
|
licenses:
|
127
142
|
- MIT
|
@@ -148,25 +163,26 @@ specification_version: 4
|
|
148
163
|
summary: Combine and compress CSS and Sass, Javascript and Coffeescript to a single
|
149
164
|
fingerprinted file.
|
150
165
|
test_files:
|
166
|
+
- test/.clash.yml
|
151
167
|
- test/Gemfile
|
152
|
-
- test/
|
168
|
+
- test/_combine_false.yml
|
153
169
|
- test/_config.yml
|
154
|
-
- test/
|
155
|
-
- test/
|
156
|
-
- test/
|
157
|
-
- test/
|
158
|
-
- test/
|
170
|
+
- test/combine_false/blah.js
|
171
|
+
- test/combine_false/foo.js
|
172
|
+
- test/combine_false/index.html
|
173
|
+
- test/combine_false/sass-test.css
|
174
|
+
- test/combine_false/test.css
|
159
175
|
- test/expected/index.html
|
160
176
|
- test/expected/javascripts/all-.js
|
161
177
|
- test/expected/stylesheets/all-.css
|
178
|
+
- test/site/blah.js
|
179
|
+
- test/site/foo.js
|
162
180
|
- test/site/index.html
|
163
|
-
- test/site/
|
164
|
-
- test/site/
|
181
|
+
- test/site/sass-test.css
|
182
|
+
- test/site/test.css
|
165
183
|
- test/source/_sass/_partial.sass
|
166
184
|
- test/source/blah.js
|
167
185
|
- test/source/foo.coffee
|
168
186
|
- test/source/index.html
|
169
187
|
- test/source/sass-test.scss
|
170
188
|
- test/source/test.css
|
171
|
-
- test/test.rb
|
172
|
-
- test/test_suite.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
console.log("Yo I'm a javascript")(function(){console.log("hi")}).call(this);
|
@@ -1 +0,0 @@
|
|
1
|
-
body{color:#444}body{background:black}
|
data/test/test.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require './test_suite'
|
2
|
-
ENV['JEKYLL_ENV'] = 'test'
|
3
|
-
|
4
|
-
@failures = []
|
5
|
-
|
6
|
-
build
|
7
|
-
|
8
|
-
test_dirs('Site build', 'site', 'expected')
|
9
|
-
|
10
|
-
#build({:octopress_config => '_concat_false.yml'})
|
11
|
-
|
12
|
-
#test_dirs('Site build', 'site', 'concat_false')
|
13
|
-
|
14
|
-
print_results
|
data/test/test_suite.rb
DELETED
@@ -1,160 +0,0 @@
|
|
1
|
-
require 'colorator'
|
2
|
-
require 'find'
|
3
|
-
|
4
|
-
# This is a makeshift integration test-suite.
|
5
|
-
# It is unapologetically pragmatic.
|
6
|
-
|
7
|
-
|
8
|
-
# Build Jekyll
|
9
|
-
#
|
10
|
-
def build(options={})
|
11
|
-
if options[:octopress_config]
|
12
|
-
FileUtils.cp options[:octopress_config], '_octopress.yml'
|
13
|
-
end
|
14
|
-
|
15
|
-
config = ['_config.yml'] << options[:config]
|
16
|
-
cmd = "rm -rf site && bundle exec jekyll build --config #{config.join(',')}"
|
17
|
-
|
18
|
-
`#{cmd}`
|
19
|
-
`rm _octopress.yml` if options[:octopress_config]
|
20
|
-
end
|
21
|
-
|
22
|
-
|
23
|
-
# Find all files in a given directory
|
24
|
-
#
|
25
|
-
def dir_files(dir)
|
26
|
-
Find.find(dir).to_a.reject!{|f| File.directory?(f) }
|
27
|
-
end
|
28
|
-
|
29
|
-
# Recursively diff two directories
|
30
|
-
#
|
31
|
-
# This will walk through dir1 and diff matching paths in dir2
|
32
|
-
#
|
33
|
-
def test_dirs(desc, dir1, dir2)
|
34
|
-
|
35
|
-
test_missing_files(desc, dir1, dir2)
|
36
|
-
|
37
|
-
dir_files(dir1).each do |file|
|
38
|
-
file2 = file.sub(dir1, dir2)
|
39
|
-
if File.exist?(file2)
|
40
|
-
if diff = diff_file(file, file2)
|
41
|
-
@failures << {
|
42
|
-
desc: "#{desc}\nDiff of file: #{file.sub(dir1+'/', '')}\n",
|
43
|
-
result: format_diff(diff)
|
44
|
-
}
|
45
|
-
pout 'F'.red
|
46
|
-
else
|
47
|
-
pout '.'.green
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def format_diff(diff)
|
54
|
-
"#{diff.gsub(/\A.+?\n/,'').gsub(/^[^><].+/,'---').gsub(/^>.+/){|m|
|
55
|
-
m.green
|
56
|
-
}.gsub(/^(<.+?)$/){ |m|
|
57
|
-
m.red
|
58
|
-
}}"
|
59
|
-
end
|
60
|
-
|
61
|
-
# List differences between files in two directories
|
62
|
-
#
|
63
|
-
def test_missing_files(desc, dir1, dir2)
|
64
|
-
files1 = dir_files(dir1).map {|f| f.sub(dir1,'') }
|
65
|
-
files2 = dir_files(dir2).map {|f| f.sub(dir2,'') }
|
66
|
-
|
67
|
-
missing = []
|
68
|
-
|
69
|
-
(files2 - files1).each do |file|
|
70
|
-
missing << File.join(dir1, file)
|
71
|
-
end
|
72
|
-
|
73
|
-
(files1 - files2).each do |file|
|
74
|
-
missing << File.join(dir2, file)
|
75
|
-
end
|
76
|
-
|
77
|
-
if !missing.empty?
|
78
|
-
@failures << {
|
79
|
-
desc: "#{desc}\nMissing files:\n",
|
80
|
-
result: " - " + missing.join("\n - ")
|
81
|
-
}
|
82
|
-
|
83
|
-
pout 'F'.red
|
84
|
-
else
|
85
|
-
pout '.'.green
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
# Diff two files
|
90
|
-
#
|
91
|
-
def diff_file(file1, file2)
|
92
|
-
diff = `diff #{file1} #{file2}`
|
93
|
-
if diff.size > 0
|
94
|
-
diff
|
95
|
-
else
|
96
|
-
false
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
# Test command output
|
101
|
-
#
|
102
|
-
# Input: options hash, format:
|
103
|
-
# {
|
104
|
-
# desc: description of task
|
105
|
-
# cmd: system command to be run, (String or Array)
|
106
|
-
# expect: expected output from command
|
107
|
-
# }
|
108
|
-
#
|
109
|
-
def test_cmd(options)
|
110
|
-
if cmd = options[:cmd]
|
111
|
-
cmd = [cmd] unless cmd.is_a? Array
|
112
|
-
|
113
|
-
# In debug mode command output is printed
|
114
|
-
#
|
115
|
-
if options[:debug]
|
116
|
-
system cmd.join('; ')
|
117
|
-
else
|
118
|
-
output = `#{cmd.join('; ')}`.gsub(/#{Dir.pwd}\/*/,'').strip
|
119
|
-
|
120
|
-
# Remove character color codes
|
121
|
-
output = output.gsub("\e",'').gsub(/\[\d+m/,'').gsub("\[0m",'')
|
122
|
-
end
|
123
|
-
if options[:expect] && options[:expect].strip == output
|
124
|
-
pout '.'.green
|
125
|
-
else
|
126
|
-
pout 'F'.red
|
127
|
-
@failures << {
|
128
|
-
desc: options[:desc]+"\n",
|
129
|
-
result: <<-HERE
|
130
|
-
expected: #{(options[:expect] || '').strip.green}
|
131
|
-
result: #{(output || '').strip.red}
|
132
|
-
HERE
|
133
|
-
}
|
134
|
-
end
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
|
139
|
-
# Print a single character without a newline
|
140
|
-
#
|
141
|
-
def pout(str)
|
142
|
-
print str
|
143
|
-
$stdout.flush
|
144
|
-
end
|
145
|
-
|
146
|
-
# Ouptut nicely formatted failure messages
|
147
|
-
#
|
148
|
-
def print_results
|
149
|
-
if !@failures.empty?
|
150
|
-
@failures.each do |test|
|
151
|
-
pout "\nFailed: #{test[:desc]}"
|
152
|
-
puts test[:result]
|
153
|
-
# print a newline for easier reading
|
154
|
-
puts ""
|
155
|
-
end
|
156
|
-
abort
|
157
|
-
else
|
158
|
-
puts "All passed!".green
|
159
|
-
end
|
160
|
-
end
|