octopress-asset-pipeline 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/octopress-asset-pipeline/assets/coffeescript.rb +5 -5
- data/lib/octopress-asset-pipeline/assets/css.rb +2 -2
- data/lib/octopress-asset-pipeline/assets/local.rb +2 -12
- data/lib/octopress-asset-pipeline/assets/sass.rb +3 -3
- data/lib/octopress-asset-pipeline/version.rb +1 -1
- data/lib/octopress-asset-pipeline.rb +12 -12
- data/octopress-asset-pipeline.gemspec +2 -1
- data/test/.clash.yml +7 -2
- data/test/Gemfile +2 -7
- data/test/_combine_css_only.yml +1 -0
- data/test/{combine_false → expected/css_tag_only}/blah.js +0 -0
- data/test/{combine_false → expected/css_tag_only}/foo.js +0 -0
- data/test/expected/css_tag_only/index.html +2 -0
- data/test/expected/{stylesheets → css_tag_only/stylesheets}/all-.css +0 -0
- data/test/expected/no_combining/blah.js +1 -0
- data/test/expected/no_combining/foo.js +6 -0
- data/test/{combine_false → expected/no_combining}/index.html +1 -1
- data/test/{combine_false → expected/no_combining}/sass-test.css +0 -0
- data/test/{combine_false → expected/no_combining}/test.css +0 -0
- data/test/expected/{index.html → standard/index.html} +1 -1
- data/test/expected/{javascripts → standard/javascripts}/all-.js +0 -0
- data/test/expected/standard/stylesheets/all-.css +1 -0
- data/test/site/index.html +1 -1
- metadata +44 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a65951d6238e41daed4a564bedaff22618bacada
|
4
|
+
data.tar.gz: 3cc274f658887d68b7aca538fe0a9d85f9bdd33b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af99e603afd3502887161df5cfa999bab897d5133c05a3f018ef38f85e75e53433d958414ca21199f5721968891ab87fd64a2c8e1e42dc73468c68a88511fd07
|
7
|
+
data.tar.gz: 055b51b6c4c5946c36881ed44c54e7f687193ca45dbefff25ff39e1206e3e2a00a53e5265a462086035675c09cc85161d50efc9308e55a2f9c8c9d14949ebc41
|
data/CHANGELOG.md
CHANGED
@@ -3,15 +3,15 @@ module Octopress
|
|
3
3
|
module Assets
|
4
4
|
class LocalCoffeeScriptAsset < LocalJavaScriptAsset
|
5
5
|
def read
|
6
|
-
compile
|
6
|
+
@compiled ||= compile
|
7
7
|
end
|
8
8
|
|
9
|
-
def
|
10
|
-
|
9
|
+
def compile
|
10
|
+
::CoffeeScript.compile(file.content)
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
14
|
-
|
13
|
+
def path
|
14
|
+
Pathname.new File.join(Octopress.site.source, file.path)
|
15
15
|
end
|
16
16
|
|
17
17
|
def destination
|
@@ -3,7 +3,7 @@ module Octopress
|
|
3
3
|
module Assets
|
4
4
|
class LocalCssAsset < LocalAsset
|
5
5
|
def media
|
6
|
-
path.scan(/@(.+?)\./).flatten[0] || 'all'
|
6
|
+
path.to_s.scan(/@(.+?)\./).flatten[0] || 'all'
|
7
7
|
end
|
8
8
|
|
9
9
|
def destination
|
@@ -11,7 +11,7 @@ module Octopress
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def tag
|
14
|
-
"<link href='#{Filters.expand_url(
|
14
|
+
"<link href='#{Filters.expand_url(destination)}' media='#{media}' rel='stylesheet' type='text/css'>"
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -26,26 +26,16 @@ module Octopress
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def path
|
29
|
-
file.path
|
29
|
+
Pathname.new file.path
|
30
30
|
end
|
31
31
|
|
32
32
|
def read
|
33
|
-
|
33
|
+
path.read
|
34
34
|
end
|
35
35
|
|
36
36
|
# Copy is unncessary with local assets
|
37
37
|
#
|
38
38
|
def copy(target_dir); end
|
39
|
-
|
40
|
-
private
|
41
|
-
|
42
|
-
def render_page
|
43
|
-
payload = Ink.site.site_payload
|
44
|
-
payload['page'] = file.data
|
45
|
-
|
46
|
-
render_liquid(file.content, payload)
|
47
|
-
end
|
48
|
-
|
49
39
|
end
|
50
40
|
end
|
51
41
|
end
|
@@ -3,11 +3,11 @@ module Octopress
|
|
3
3
|
module Assets
|
4
4
|
class LocalSassAsset < LocalCssAsset
|
5
5
|
def read
|
6
|
-
compile
|
6
|
+
@compiled ||= compile
|
7
7
|
end
|
8
8
|
|
9
9
|
def content
|
10
|
-
|
10
|
+
render
|
11
11
|
end
|
12
12
|
|
13
13
|
def ext
|
@@ -15,7 +15,7 @@ module Octopress
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def path
|
18
|
-
File.join(
|
18
|
+
Pathname.new File.join(Octopress.site.source, file.path)
|
19
19
|
end
|
20
20
|
|
21
21
|
def destination
|
@@ -29,8 +29,8 @@ module Octopress
|
|
29
29
|
# This is necessary when Jekyll isn't being asked to build a site,
|
30
30
|
# like when a user runs the list command to list assets
|
31
31
|
#
|
32
|
-
if
|
33
|
-
|
32
|
+
if Octopress.site.pages.empty? && Octopress.site.posts.empty?
|
33
|
+
Octopress.site.read_directories
|
34
34
|
end
|
35
35
|
|
36
36
|
add_stylesheets
|
@@ -38,7 +38,7 @@ module Octopress
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def config
|
41
|
-
|
41
|
+
Octopress.config
|
42
42
|
end
|
43
43
|
|
44
44
|
# Return stylesheets to be combined in the asset pipeline
|
@@ -89,7 +89,7 @@ module Octopress
|
|
89
89
|
sorted = []
|
90
90
|
config.each do |item|
|
91
91
|
files.each do |file|
|
92
|
-
sorted << files.delete(file) if file.path.include? item
|
92
|
+
sorted << files.delete(file) if file.path.to_s.include? item
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
@@ -99,10 +99,10 @@ module Octopress
|
|
99
99
|
# Finds all Sass files registered by Jekyll
|
100
100
|
#
|
101
101
|
def add_sass
|
102
|
-
|
102
|
+
Octopress.site.pages.each do |f|
|
103
103
|
if f.ext =~ /\.s[ca]ss/
|
104
104
|
@sass << Assets::LocalSassAsset.new(self, f)
|
105
|
-
|
105
|
+
Octopress.site.pages.delete(f) if combine_css
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
@@ -110,10 +110,10 @@ module Octopress
|
|
110
110
|
# Finds all CSS files registered by Jekyll
|
111
111
|
#
|
112
112
|
def add_css
|
113
|
-
|
113
|
+
Octopress.site.static_files.each do |f|
|
114
114
|
if f.path =~ /\.css$/
|
115
115
|
@css << Assets::LocalCssAsset.new(self, f)
|
116
|
-
|
116
|
+
Octopress.site.static_files.delete(f) if combine_css
|
117
117
|
end
|
118
118
|
end
|
119
119
|
end
|
@@ -121,10 +121,10 @@ module Octopress
|
|
121
121
|
# Finds all Coffeescript files registered by Jekyll
|
122
122
|
#
|
123
123
|
def add_coffee
|
124
|
-
|
124
|
+
Octopress.site.pages.each do |f|
|
125
125
|
if f.ext =~ /\.coffee$/
|
126
126
|
@coffee << Assets::LocalCoffeeScriptAsset.new(self, f)
|
127
|
-
|
127
|
+
Octopress.site.pages.delete(f) if combine_js
|
128
128
|
end
|
129
129
|
end
|
130
130
|
end
|
@@ -132,10 +132,10 @@ module Octopress
|
|
132
132
|
# Finds all Javascript files registered by Jekyll
|
133
133
|
#
|
134
134
|
def add_js
|
135
|
-
|
135
|
+
Octopress.site.static_files.each do |f|
|
136
136
|
if f.path =~ /\.js$/
|
137
137
|
@js << Assets::LocalJavaScriptAsset.new(self, f)
|
138
|
-
|
138
|
+
Octopress.site.static_files.delete(f) if combine_js
|
139
139
|
end
|
140
140
|
end
|
141
141
|
end
|
@@ -18,10 +18,11 @@ 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.
|
21
|
+
spec.add_runtime_dependency "octopress-ink", "~> 1.0.0.rc.13"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.6"
|
24
24
|
spec.add_development_dependency "clash", "~> 1.0"
|
25
25
|
spec.add_development_dependency "rake"
|
26
26
|
spec.add_development_dependency "octopress"
|
27
|
+
spec.add_development_dependency "pry-debugger"
|
27
28
|
end
|
data/test/.clash.yml
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
-
|
2
2
|
build: true
|
3
|
-
compare: expected site
|
3
|
+
compare: expected/standard site
|
4
|
+
-
|
5
|
+
build: true
|
6
|
+
config:
|
7
|
+
octopress: _combine_css_only.yml
|
8
|
+
compare: expected/css_tag_only site
|
4
9
|
-
|
5
10
|
build: true
|
6
11
|
config:
|
7
12
|
octopress: _combine_false.yml
|
8
|
-
compare:
|
13
|
+
compare: expected/no_combining site
|
data/test/Gemfile
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
combine_js: false
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
console.log("Yo I'm a javascript")
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
body{color:#444}body{background:black}
|
data/test/site/index.html
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.2
|
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-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octopress-ink
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.0.rc.
|
19
|
+
version: 1.0.0.rc.13
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.0.rc.
|
26
|
+
version: 1.0.0.rc.13
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry-debugger
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description: Combine and compress CSS and Sass, Javascript and Coffeescript to a single
|
84
98
|
fingerprinted file.
|
85
99
|
email:
|
@@ -116,16 +130,21 @@ files:
|
|
116
130
|
- octopress-asset-pipeline.gemspec
|
117
131
|
- test/.clash.yml
|
118
132
|
- test/Gemfile
|
133
|
+
- test/_combine_css_only.yml
|
119
134
|
- test/_combine_false.yml
|
120
135
|
- test/_config.yml
|
121
|
-
- test/
|
122
|
-
- test/
|
123
|
-
- test/
|
124
|
-
- test/
|
125
|
-
- test/
|
126
|
-
- test/expected/
|
127
|
-
- test/expected/
|
128
|
-
- test/expected/
|
136
|
+
- test/expected/css_tag_only/blah.js
|
137
|
+
- test/expected/css_tag_only/foo.js
|
138
|
+
- test/expected/css_tag_only/index.html
|
139
|
+
- test/expected/css_tag_only/stylesheets/all-.css
|
140
|
+
- test/expected/no_combining/blah.js
|
141
|
+
- test/expected/no_combining/foo.js
|
142
|
+
- test/expected/no_combining/index.html
|
143
|
+
- test/expected/no_combining/sass-test.css
|
144
|
+
- test/expected/no_combining/test.css
|
145
|
+
- test/expected/standard/index.html
|
146
|
+
- test/expected/standard/javascripts/all-.js
|
147
|
+
- test/expected/standard/stylesheets/all-.css
|
129
148
|
- test/site/blah.js
|
130
149
|
- test/site/foo.js
|
131
150
|
- test/site/index.html
|
@@ -165,16 +184,21 @@ summary: Combine and compress CSS and Sass, Javascript and Coffeescript to a sin
|
|
165
184
|
test_files:
|
166
185
|
- test/.clash.yml
|
167
186
|
- test/Gemfile
|
187
|
+
- test/_combine_css_only.yml
|
168
188
|
- test/_combine_false.yml
|
169
189
|
- test/_config.yml
|
170
|
-
- test/
|
171
|
-
- test/
|
172
|
-
- test/
|
173
|
-
- test/
|
174
|
-
- test/
|
175
|
-
- test/expected/
|
176
|
-
- test/expected/
|
177
|
-
- test/expected/
|
190
|
+
- test/expected/css_tag_only/blah.js
|
191
|
+
- test/expected/css_tag_only/foo.js
|
192
|
+
- test/expected/css_tag_only/index.html
|
193
|
+
- test/expected/css_tag_only/stylesheets/all-.css
|
194
|
+
- test/expected/no_combining/blah.js
|
195
|
+
- test/expected/no_combining/foo.js
|
196
|
+
- test/expected/no_combining/index.html
|
197
|
+
- test/expected/no_combining/sass-test.css
|
198
|
+
- test/expected/no_combining/test.css
|
199
|
+
- test/expected/standard/index.html
|
200
|
+
- test/expected/standard/javascripts/all-.js
|
201
|
+
- test/expected/standard/stylesheets/all-.css
|
178
202
|
- test/site/blah.js
|
179
203
|
- test/site/foo.js
|
180
204
|
- test/site/index.html
|