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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9262a0c33a0c7c88bbe9306d6e7563c832cb172b
4
- data.tar.gz: 160c46f0cfa00af04a5afcc573ef3aed152b9a58
3
+ metadata.gz: c7a7c1650a57c445019bbc0fb892ad4b0db48c68
4
+ data.tar.gz: edc057d9c1fe8d36c9aecf83aeedb234f45ce900
5
5
  SHA512:
6
- metadata.gz: 6d6f0b53e2eb6fd4cc187cb304e8e47a06a95ac7c9508ff2e680b36ab44e7560ebe6231202746d8c5f26a8218e66a8b2fb909642d13138a95bc8e0d9f9007164
7
- data.tar.gz: 5b7ae968ad75c3ef5e7cfa1671e947c71c86e4e9a7cc8790c210532c90ca1c08649b5c40baa5eb27e15a7f8c03a602852c2cff008289883de53bbe98605b57ca
6
+ metadata.gz: c5d5beb7b2f478cc9b927034e80043ffb84dfcde75880e9da9c5601fc2aeb0a41d73f1dd9b93e480e5b3331a896f86440eee62604cb883880f359e83e67f7720
7
+ data.tar.gz: 60d5ed234189d96cfccb9fa715bc9fb381dc4f0b27772533af4f399dd5eccabb81e84706c2358d5c286631530d19e010a265c47fe11e2c2e90c1d87f4b3983df
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 2.0.1 - 2015-01-28
4
+
5
+ - Fix: javascripts ending in .min.js can be sorted manually.
6
+
3
7
  ### 2.0.0 - 2015-01-15
4
8
 
5
9
  - Change: Reads stylesheets from: `css/` and `stylesheets/`.
@@ -1,9 +1,12 @@
1
1
  module Octopress
2
2
  module AssetPipeline
3
3
  class Asset < Ink::Assets::Asset
4
- def initialize(plugin, file)
4
+ attr_reader :file_object
5
+
6
+ def initialize(plugin, object)
5
7
  @plugin = plugin
6
- @file = file
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
- file.relative_path.sub(filename,'').sub(/^\/(.+)\/$/,'\1')
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
- Pathname.new file.path
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 compile
5
- ::CoffeeScript.compile(file.content)
4
+ def content
5
+ ::CoffeeScript.compile(super)
6
6
  end
7
7
 
8
8
  def path
9
- Pathname.new File.join(Octopress.site.source, file.path)
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, filename.sub(/@(.+?)\./,'.'))
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
- file.ext
7
+ file_object.ext
6
8
  end
7
9
 
8
10
  def path
9
- Pathname.new File.join(Octopress.site.source, file.path)
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(compile, destination)
19
+ Ink::Plugins.static_files << Ink::StaticFileContent.new(content, destination)
18
20
  end
19
21
 
20
22
  def data
21
- file.data
23
+ file_object.data
22
24
  end
23
25
 
24
- def compile
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
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module AssetPipeline
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  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 =~ /\.js$/
121
- if f.path =~ /\.min\.js$/i
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.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-16 00:00:00.000000000 Z
11
+ date: 2015-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octopress-ink