nanoc-sprockets-filter 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ require 'nanoc'
3
3
  module Nanoc
4
4
  module Filters
5
5
  class Sprockets < Nanoc::Filter
6
- VERSION = '0.0.1'
6
+ VERSION = '0.0.2'
7
7
 
8
8
  type :text
9
9
 
@@ -12,8 +12,8 @@ module Nanoc
12
12
  module ModuleMethods
13
13
 
14
14
  def asset_path(item_or_filename, options = {})
15
- if item_or_filename.is_a?(Nanoc::Item)
16
- filename = item_or_filename
15
+ if item_or_filename.is_a?(::Nanoc::Item)
16
+ filename = item_or_filename[:filename]
17
17
  else
18
18
  filename = item_or_filename
19
19
  end
@@ -35,6 +35,20 @@ module Nanoc
35
35
  base.send :include, ModuleMethods
36
36
  end
37
37
 
38
+ def self.method_missing(method, *args)
39
+ if ::Sprockets::Helpers.respond_to?(method)
40
+ if block_given?
41
+ ::Sprockets::Helpers.send(method, *args) do |*block_args|
42
+ yield *block_args
43
+ end
44
+ else
45
+ ::Sprockets::Helpers.send(method, *args)
46
+ end
47
+ else
48
+ super
49
+ end
50
+ end
51
+
38
52
  def method_missing(method, *args)
39
53
  if ::Sprockets::Helpers.respond_to?(method)
40
54
  if block_given?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-sprockets-filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -106,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  segments:
108
108
  - 0
109
- hash: -3970027099751348058
109
+ hash: -1833548163494978094
110
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  none: false
112
112
  requirements:
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  segments:
117
117
  - 0
118
- hash: -3970027099751348058
118
+ hash: -1833548163494978094
119
119
  requirements: []
120
120
  rubyforge_project:
121
121
  rubygems_version: 1.8.24