octopress-asset-pipeline 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/octopress-asset-pipeline/assets/asset.rb +7 -4
- data/lib/octopress-asset-pipeline/assets/coffeescript.rb +3 -3
- data/lib/octopress-asset-pipeline/assets/css.rb +6 -2
- data/lib/octopress-asset-pipeline/assets/sass.rb +16 -5
- data/lib/octopress-asset-pipeline/version.rb +1 -1
- data/lib/octopress-asset-pipeline.rb +3 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7a7c1650a57c445019bbc0fb892ad4b0db48c68
|
4
|
+
data.tar.gz: edc057d9c1fe8d36c9aecf83aeedb234f45ce900
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5d5beb7b2f478cc9b927034e80043ffb84dfcde75880e9da9c5601fc2aeb0a41d73f1dd9b93e480e5b3331a896f86440eee62604cb883880f359e83e67f7720
|
7
|
+
data.tar.gz: 60d5ed234189d96cfccb9fa715bc9fb381dc4f0b27772533af4f399dd5eccabb81e84706c2358d5c286631530d19e010a265c47fe11e2c2e90c1d87f4b3983df
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
module Octopress
|
2
2
|
module AssetPipeline
|
3
3
|
class Asset < Ink::Assets::Asset
|
4
|
-
|
4
|
+
attr_reader :file_object
|
5
|
+
|
6
|
+
def initialize(plugin, object)
|
5
7
|
@plugin = plugin
|
6
|
-
@
|
8
|
+
@file_object = object
|
9
|
+
@file = object.path
|
7
10
|
end
|
8
11
|
|
9
12
|
def info
|
@@ -17,7 +20,7 @@ module Octopress
|
|
17
20
|
end
|
18
21
|
|
19
22
|
def base
|
20
|
-
|
23
|
+
file_object.relative_path.sub(filename,'').sub(/^\/(.+)\/$/,'\1')
|
21
24
|
end
|
22
25
|
|
23
26
|
def destination
|
@@ -25,7 +28,7 @@ module Octopress
|
|
25
28
|
end
|
26
29
|
|
27
30
|
def path
|
28
|
-
|
31
|
+
file
|
29
32
|
end
|
30
33
|
|
31
34
|
# Copy is unncessary with local assets
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Octopress
|
2
2
|
module AssetPipeline
|
3
3
|
class Coffeescript < Javascript
|
4
|
-
def
|
5
|
-
::CoffeeScript.compile(
|
4
|
+
def content
|
5
|
+
::CoffeeScript.compile(super)
|
6
6
|
end
|
7
7
|
|
8
8
|
def path
|
9
|
-
|
9
|
+
File.join(Octopress.site.source, file)
|
10
10
|
end
|
11
11
|
|
12
12
|
def destination
|
@@ -6,12 +6,16 @@ module Octopress
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def destination
|
9
|
-
File.join(base,
|
9
|
+
File.join(base, output_file_name)
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def tag
|
13
13
|
"<link href='#{Filters.expand_url(destination)}' media='#{media}' rel='stylesheet' type='text/css'>"
|
14
14
|
end
|
15
|
+
|
16
|
+
def output_file_name
|
17
|
+
filename.sub(/@/,'-')
|
18
|
+
end
|
15
19
|
end
|
16
20
|
end
|
17
21
|
end
|
@@ -1,12 +1,14 @@
|
|
1
1
|
module Octopress
|
2
2
|
module AssetPipeline
|
3
3
|
class Sass < Css
|
4
|
+
attr_reader :render
|
5
|
+
|
4
6
|
def ext
|
5
|
-
|
7
|
+
file_object.ext
|
6
8
|
end
|
7
9
|
|
8
10
|
def path
|
9
|
-
|
11
|
+
File.join(Octopress.site.source, file)
|
10
12
|
end
|
11
13
|
|
12
14
|
def destination
|
@@ -14,14 +16,23 @@ module Octopress
|
|
14
16
|
end
|
15
17
|
|
16
18
|
def add
|
17
|
-
Ink::Plugins.static_files << Ink::StaticFileContent.new(
|
19
|
+
Ink::Plugins.static_files << Ink::StaticFileContent.new(content, destination)
|
18
20
|
end
|
19
21
|
|
20
22
|
def data
|
21
|
-
|
23
|
+
file_object.data
|
22
24
|
end
|
23
25
|
|
24
|
-
def
|
26
|
+
def content
|
27
|
+
@render ||= begin
|
28
|
+
contents = super
|
29
|
+
if asset_payload = payload
|
30
|
+
Liquid::Template.parse(contents).render!(payload)
|
31
|
+
else
|
32
|
+
contents
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
25
36
|
Ink::PluginAssetPipeline.compile_sass(self)
|
26
37
|
end
|
27
38
|
end
|
@@ -117,15 +117,10 @@ module Octopress
|
|
117
117
|
#
|
118
118
|
def add_static_files
|
119
119
|
find_static_assets(asset_dirs, '.js', '.css').each do |f|
|
120
|
-
if f.path
|
121
|
-
|
122
|
-
@no_compress_js << Javascript.new(self, f)
|
123
|
-
else f.path =~ /\.js$/
|
124
|
-
@js << Javascript.new(self, f)
|
125
|
-
end
|
120
|
+
if File.extname(f.path) == '.js'
|
121
|
+
@js << Javascript.new(self, f)
|
126
122
|
Octopress.site.static_files.delete(f) if combine_js
|
127
|
-
|
128
|
-
elsif f.path =~ /\.css$/
|
123
|
+
elsif File.extname(f.path) == '.css'
|
129
124
|
@css << Css.new(self, f)
|
130
125
|
Octopress.site.static_files.delete(f) if combine_css
|
131
126
|
end
|
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: 2.0.
|
4
|
+
version: 2.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: 2015-01-
|
11
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octopress-ink
|