octopress-asset-pipeline 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ed731c311f629bb538a58f8c51a10ec3bebff27
4
- data.tar.gz: fe0e5496d05ed3830d80100c762fc47dff44abf1
3
+ metadata.gz: a65951d6238e41daed4a564bedaff22618bacada
4
+ data.tar.gz: 3cc274f658887d68b7aca538fe0a9d85f9bdd33b
5
5
  SHA512:
6
- metadata.gz: 4213093d12803f32df1aa72c6cefd3ddea89d953104528a76fb8119d92a0df22f753fe2b69f04efc3334008f23261a7591bdf3ef2eedaa8e06d2850174af18ad
7
- data.tar.gz: 0575497d3d8fa7019cea05b7f9316640f510f51ea1fd263b68dd0ddb2db5a1a089b581ed8357ccbde10491e039f101df44f34e9cf4cd74032de6114c8a58816e
6
+ metadata.gz: af99e603afd3502887161df5cfa999bab897d5133c05a3f018ef38f85e75e53433d958414ca21199f5721968891ab87fd64a2c8e1e42dc73468c68a88511fd07
7
+ data.tar.gz: 055b51b6c4c5946c36881ed44c54e7f687193ca45dbefff25ff39e1206e3e2a00a53e5265a462086035675c09cc85161d50efc9308e55a2f9c8c9d14949ebc41
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## Current version
3
+ ### 1.0.2 - 2014-08-11
4
+
5
+ - Fix: Updated integration with latest Octopress Ink
6
+
7
+ ### 1.0.1 - 2014-07-19
8
+
9
+ - Updated tests to reflect no longer rendering Sass through liquid.
4
10
 
5
11
  ### 1.0.0 - 2014-05-25
6
12
 
@@ -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 path
10
- File.join(file.site.source, file.path)
9
+ def compile
10
+ ::CoffeeScript.compile(file.content)
11
11
  end
12
12
 
13
- def compile
14
- ::CoffeeScript.compile(render_page)
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(File.join(destination))}' media='#{media}' rel='stylesheet' type='text/css'>"
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
- File.open(path).read
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
- render_page
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(file.site.source, file.path)
18
+ Pathname.new File.join(Octopress.site.source, file.path)
19
19
  end
20
20
 
21
21
  def destination
@@ -1,7 +1,7 @@
1
1
  module Octopress
2
2
  module Ink
3
3
  module LocalAssetPipeline
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
6
6
  end
7
7
  end
@@ -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 Ink.site.pages.empty? && Ink.site.posts.empty?
33
- Ink.site.read_directories
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
- Ink.config
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
- Ink.site.pages.each do |f|
102
+ Octopress.site.pages.each do |f|
103
103
  if f.ext =~ /\.s[ca]ss/
104
104
  @sass << Assets::LocalSassAsset.new(self, f)
105
- Ink.site.pages.delete(f) if combine_css
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
- Ink.site.static_files.each do |f|
113
+ Octopress.site.static_files.each do |f|
114
114
  if f.path =~ /\.css$/
115
115
  @css << Assets::LocalCssAsset.new(self, f)
116
- Ink.site.static_files.delete(f) if combine_css
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
- Ink.site.pages.each do |f|
124
+ Octopress.site.pages.each do |f|
125
125
  if f.ext =~ /\.coffee$/
126
126
  @coffee << Assets::LocalCoffeeScriptAsset.new(self, f)
127
- Ink.site.pages.delete(f) if combine_js
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
- Ink.site.static_files.each do |f|
135
+ Octopress.site.static_files.each do |f|
136
136
  if f.path =~ /\.js$/
137
137
  @js << Assets::LocalJavaScriptAsset.new(self, f)
138
- Ink.site.static_files.delete(f) if combine_js
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.11"
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: combine_false site
13
+ compare: expected/no_combining site
data/test/Gemfile CHANGED
@@ -1,9 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- group :octopress do
4
- gem 'octopress'
5
- gem 'octopress-ink'
6
- gem 'octopress-asset-pipeline', path: '../'
7
- gem 'pry-debugger'
8
- gem 'clash'
9
- end
3
+ gemspec path: '../'
4
+ gem 'octopress-ink', path: '../../ink'
@@ -0,0 +1 @@
1
+ combine_js: false
@@ -0,0 +1,2 @@
1
+ <link href='/stylesheets/all-.css' media='all' rel='stylesheet' type='text/css'>
2
+ <script src='/blah.js'></script><script src='/foo.js'></script>
@@ -0,0 +1 @@
1
+ console.log("Yo I'm a javascript")
@@ -0,0 +1,6 @@
1
+ (function() {
2
+ if (!false) {
3
+ console.log('hi');
4
+ }
5
+
6
+ }).call(this);
@@ -1,2 +1,2 @@
1
- <script src='/foo.js'></script><script src='/blah.js'></script>
2
1
  <link href='/test.css' media='all' rel='stylesheet' type='text/css'><link href='/css-test.scss' media='all' rel='stylesheet' type='text/css'>
2
+ <script src='/foo.js'></script><script src='/blah.js'></script>
@@ -1,2 +1,2 @@
1
- <script src='/javascripts/all-.js'></script>
2
1
  <link href='/stylesheets/all-.css' media='all' rel='stylesheet' type='text/css'>
2
+ <script src='/javascripts/all-.js'></script>
@@ -0,0 +1 @@
1
+ body{color:#444}body{background:black}
data/test/site/index.html CHANGED
@@ -1,2 +1,2 @@
1
- <script src='/foo.js'></script><script src='/blah.js'></script>
2
1
  <link href='/test.css' media='all' rel='stylesheet' type='text/css'><link href='/css-test.scss' media='all' rel='stylesheet' type='text/css'>
2
+ <script src='/foo.js'></script><script src='/blah.js'></script>
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.1
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-07-19 00:00:00.000000000 Z
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.11
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.11
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/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
126
- - test/expected/index.html
127
- - test/expected/javascripts/all-.js
128
- - test/expected/stylesheets/all-.css
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/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
175
- - test/expected/index.html
176
- - test/expected/javascripts/all-.js
177
- - test/expected/stylesheets/all-.css
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