octopress-asset-pipeline 1.0.2 → 1.0.3

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: a65951d6238e41daed4a564bedaff22618bacada
4
- data.tar.gz: 3cc274f658887d68b7aca538fe0a9d85f9bdd33b
3
+ metadata.gz: e2a8a4164aec8a28dc9f9cb06499f226e8dbc4ed
4
+ data.tar.gz: 70ac0a34c2a3a50c44cdec3f99ba6b08fbcacea6
5
5
  SHA512:
6
- metadata.gz: af99e603afd3502887161df5cfa999bab897d5133c05a3f018ef38f85e75e53433d958414ca21199f5721968891ab87fd64a2c8e1e42dc73468c68a88511fd07
7
- data.tar.gz: 055b51b6c4c5946c36881ed44c54e7f687193ca45dbefff25ff39e1206e3e2a00a53e5265a462086035675c09cc85161d50efc9308e55a2f9c8c9d14949ebc41
6
+ metadata.gz: 8c53cee000f6a95373d5728c6ef2988029ca2c1f720a18a5780ed2681383def6a0b41bbc4258fc7bd701dd316e032981712f0be90817edd9c2f07ac7d57fed80
7
+ data.tar.gz: d7e746b35a3afc73965fc414747c64972e5dcc1784b1ef0017b8d547ebb056588702ce5ce46198f11145e921b05c63f732f5add2a750ad3cecab9aff03c21205
data/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.0.3 - 2014-08-11
4
+
5
+ - Cleaned up asset methods, added back Sass rendering through liquid.
6
+
3
7
  ### 1.0.2 - 2014-08-11
4
8
 
5
- - Fix: Updated integration with latest Octopress Ink
9
+ - Fix: Updated integration with latest Octopress Ink.
6
10
 
7
11
  ### 1.0.1 - 2014-07-19
8
12
 
@@ -65,10 +65,9 @@ module Octopress
65
65
  add_sass
66
66
 
67
67
  if !combine_css
68
- # Add tags for {% js_asset_tag %}
68
+ # Add tags for {% css_asset_tag %}
69
69
  stylesheets.each { |f| Plugins.add_css_tag(f.tag) }
70
70
  @css.clear
71
- @sass.clear
72
71
  end
73
72
 
74
73
  end
@@ -101,8 +100,8 @@ module Octopress
101
100
  def add_sass
102
101
  Octopress.site.pages.each do |f|
103
102
  if f.ext =~ /\.s[ca]ss/
104
- @sass << Assets::LocalSassAsset.new(self, f)
105
- Octopress.site.pages.delete(f) if combine_css
103
+ @sass << LocalAssets::Sass.new(self, f)
104
+ Octopress.site.pages.delete(f)
106
105
  end
107
106
  end
108
107
  end
@@ -112,7 +111,7 @@ module Octopress
112
111
  def add_css
113
112
  Octopress.site.static_files.each do |f|
114
113
  if f.path =~ /\.css$/
115
- @css << Assets::LocalCssAsset.new(self, f)
114
+ @css << LocalAssets::Css.new(self, f)
116
115
  Octopress.site.static_files.delete(f) if combine_css
117
116
  end
118
117
  end
@@ -123,7 +122,7 @@ module Octopress
123
122
  def add_coffee
124
123
  Octopress.site.pages.each do |f|
125
124
  if f.ext =~ /\.coffee$/
126
- @coffee << Assets::LocalCoffeeScriptAsset.new(self, f)
125
+ @coffee << LocalAssets::Coffeescript.new(self, f)
127
126
  Octopress.site.pages.delete(f) if combine_js
128
127
  end
129
128
  end
@@ -134,7 +133,7 @@ module Octopress
134
133
  def add_js
135
134
  Octopress.site.static_files.each do |f|
136
135
  if f.path =~ /\.js$/
137
- @js << Assets::LocalJavaScriptAsset.new(self, f)
136
+ @js << LocalAssets::Javascript.new(self, f)
138
137
  Octopress.site.static_files.delete(f) if combine_js
139
138
  end
140
139
  end
@@ -1,11 +1,7 @@
1
1
  module Octopress
2
2
  module Ink
3
- module Assets
4
- class LocalCoffeeScriptAsset < LocalJavaScriptAsset
5
- def read
6
- @compiled ||= compile
7
- end
8
-
3
+ module LocalAssets
4
+ class Coffeescript < LocalAssets::Javascript
9
5
  def compile
10
6
  ::CoffeeScript.compile(file.content)
11
7
  end
@@ -1,7 +1,7 @@
1
1
  module Octopress
2
2
  module Ink
3
- module Assets
4
- class LocalCssAsset < LocalAsset
3
+ module LocalAssets
4
+ class Css < LocalAssets::Asset
5
5
  def media
6
6
  path.to_s.scan(/@(.+?)\./).flatten[0] || 'all'
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Octopress
2
2
  module Ink
3
- module Assets
4
- class LocalJavaScriptAsset < LocalAsset
3
+ module LocalAssets
4
+ class Javascript < LocalAssets::Asset
5
5
  def tag
6
6
  "<script src='#{Filters.expand_url(destination)}'></script>"
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Octopress
2
2
  module Ink
3
- module Assets
4
- class LocalAsset < Asset
3
+ module LocalAssets
4
+ class Asset < Ink::Assets::Asset
5
5
  def initialize(plugin, file)
6
6
  @plugin = plugin
7
7
  @file = file
@@ -29,10 +29,6 @@ module Octopress
29
29
  Pathname.new file.path
30
30
  end
31
31
 
32
- def read
33
- path.read
34
- end
35
-
36
32
  # Copy is unncessary with local assets
37
33
  #
38
34
  def copy(target_dir); end
@@ -1,15 +1,7 @@
1
1
  module Octopress
2
2
  module Ink
3
- module Assets
4
- class LocalSassAsset < LocalCssAsset
5
- def read
6
- @compiled ||= compile
7
- end
8
-
9
- def content
10
- render
11
- end
12
-
3
+ module LocalAssets
4
+ class Sass < LocalAssets::Css
13
5
  def ext
14
6
  file.ext
15
7
  end
@@ -19,7 +11,15 @@ module Octopress
19
11
  end
20
12
 
21
13
  def destination
22
- File.join(base, filename.sub(/@(.+?)\./,'.').sub(/s.ss/, 'css'))
14
+ super.sub(/\.s[ca]ss$/, '.css')
15
+ end
16
+
17
+ def add
18
+ Plugins.static_files << StaticFileContent.new(compile, destination)
19
+ end
20
+
21
+ def data
22
+ file.data
23
23
  end
24
24
 
25
25
  def compile
@@ -1,7 +1,7 @@
1
1
  module Octopress
2
2
  module Ink
3
3
  module LocalAssetPipeline
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -18,7 +18,7 @@ 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.13"
21
+ spec.add_runtime_dependency "octopress-ink", "~> 1.0.0.rc.14"
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.6"
24
24
  spec.add_development_dependency "clash", "~> 1.0"
data/test/Gemfile CHANGED
@@ -1,4 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec path: '../'
4
- gem 'octopress-ink', path: '../../ink'
@@ -1 +1 @@
1
- body{color:#444}body{background:black}
1
+ body{color:#444}body{background:#00ffaa}
@@ -1,2 +1,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'>
1
+ <link href='/test.css' media='all' rel='stylesheet' type='text/css'><link href='/sass-test.css' media='all' rel='stylesheet' type='text/css'>
2
2
  <script src='/foo.js'></script><script src='/blah.js'></script>
@@ -1,2 +1,2 @@
1
1
  body {
2
- background: black; }
2
+ background: #00ffaa; }
@@ -1 +1 @@
1
- body{color:#444}body{background:black}
1
+ body{color:#444}body{background:#00ffaa}
data/test/site/index.html CHANGED
@@ -1,2 +1,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'>
1
+ <link href='/test.css' media='all' rel='stylesheet' type='text/css'><link href='/sass-test.css' media='all' rel='stylesheet' type='text/css'>
2
2
  <script src='/foo.js'></script><script src='/blah.js'></script>
@@ -1,2 +1,2 @@
1
1
  body {
2
- background: black; }
2
+ background: #00ffaa; }
@@ -1 +1 @@
1
- $bg: black
1
+ $bg: #00ffaa
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import: partial
2
3
  ---
3
- @import "partial";
4
+ @import "{{ page.import }}";
4
5
  body { background: $bg; }
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.2
4
+ version: 1.0.3
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-08-11 00:00:00.000000000 Z
11
+ date: 2014-08-12 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.13
19
+ version: 1.0.0.rc.14
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.13
26
+ version: 1.0.0.rc.14
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement