nutils 0.11.2 → 0.11.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/nutils/filters/sprockets.rb +6 -5
- data/lib/nutils.rb +2 -2
- metadata +5 -12
@@ -6,6 +6,7 @@ module Nutils
|
|
6
6
|
#
|
7
7
|
# @note Requires «sprockets»
|
8
8
|
class SprocketWheel < Nanoc3::Filter
|
9
|
+
require 'pathname'
|
9
10
|
identifier :sprockets
|
10
11
|
type :text
|
11
12
|
# Concatenate the Javascript, CoffeeScript or Sass content through [Sprockets](http://getsprockets.org).
|
@@ -22,7 +23,7 @@ module Nutils
|
|
22
23
|
private
|
23
24
|
|
24
25
|
def default(content, params)
|
25
|
-
filename = Pathname.new(@item[:content_filename])
|
26
|
+
filename = ::Pathname.new(@item[:content_filename])
|
26
27
|
|
27
28
|
# Create a temp file with the content received to give the desired
|
28
29
|
# content to Sprockets on the same context.
|
@@ -44,12 +45,12 @@ module Nutils
|
|
44
45
|
|
45
46
|
# Select just the possible items that can be dependencies
|
46
47
|
possible_items = @items.reject { |i| i[:content_filename].nil? }.select do |i|
|
47
|
-
load_path.find { |p| Pathname.new(p).realpath.to_s == Pathname.new(i[:content_filename]).dirname.realpath.to_s }
|
48
|
+
load_path.find { |p| ::Pathname.new(p).realpath.to_s == ::Pathname.new(i[:content_filename]).dirname.realpath.to_s }
|
48
49
|
end
|
49
50
|
|
50
51
|
# Get Nanoc::Item equivalent for each dependence managed by Sprockets
|
51
52
|
dependencies = main_asset.dependencies.inject([]) do |dep, asset|
|
52
|
-
item = possible_items.find { |i| asset.pathname == Pathname.new(i[:content_filename]).realpath }
|
53
|
+
item = possible_items.find { |i| asset.pathname == ::Pathname.new(i[:content_filename]).realpath }
|
53
54
|
dep << item unless item.nil?
|
54
55
|
dep
|
55
56
|
end
|
@@ -66,7 +67,7 @@ module Nutils
|
|
66
67
|
puts "You are using Sprockets 1.0.0. It's strongly recommended you upgrade to Sprockets >= 2.0.0"
|
67
68
|
puts "Nutils 1.0.0 will *not* support Sprockets 1.0.0"
|
68
69
|
|
69
|
-
filename = Pathname.new(@item[:content_filename])
|
70
|
+
filename = ::Pathname.new(@item[:content_filename])
|
70
71
|
|
71
72
|
# Create a temp file with the content received to give the desired
|
72
73
|
# content to Sprockets on the same context.
|
@@ -88,4 +89,4 @@ module Nutils
|
|
88
89
|
end
|
89
90
|
end
|
90
91
|
end
|
91
|
-
end
|
92
|
+
end
|
data/lib/nutils.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Nutils
|
4
4
|
|
5
5
|
# The current nutils version.
|
6
|
-
VERSION = '0.11.
|
6
|
+
VERSION = '0.11.3'
|
7
7
|
|
8
8
|
end
|
9
9
|
|
@@ -14,4 +14,4 @@ require 'nanoc3'
|
|
14
14
|
require 'nutils/base'
|
15
15
|
require 'nutils/data_sources'
|
16
16
|
require 'nutils/filters'
|
17
|
-
require 'nutils/helpers'
|
17
|
+
require 'nutils/helpers'
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 11
|
9
|
-
-
|
10
|
-
version: 0.11.
|
8
|
+
- 3
|
9
|
+
version: 0.11.3
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Arnau Siches
|
@@ -15,18 +14,16 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date:
|
17
|
+
date: 2012-01-03 00:00:00 +01:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: nanoc3
|
23
22
|
prerelease: false
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
24
|
requirements:
|
27
25
|
- - ">="
|
28
26
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 7
|
30
27
|
segments:
|
31
28
|
- 3
|
32
29
|
- 1
|
@@ -71,29 +68,25 @@ rdoc_options:
|
|
71
68
|
require_paths:
|
72
69
|
- lib
|
73
70
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
71
|
requirements:
|
76
72
|
- - ">="
|
77
73
|
- !ruby/object:Gem::Version
|
78
|
-
hash: 57
|
79
74
|
segments:
|
80
75
|
- 1
|
81
76
|
- 8
|
82
77
|
- 7
|
83
78
|
version: 1.8.7
|
84
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
80
|
requirements:
|
87
81
|
- - ">="
|
88
82
|
- !ruby/object:Gem::Version
|
89
|
-
hash: 3
|
90
83
|
segments:
|
91
84
|
- 0
|
92
85
|
version: "0"
|
93
86
|
requirements: []
|
94
87
|
|
95
88
|
rubyforge_project:
|
96
|
-
rubygems_version: 1.3.
|
89
|
+
rubygems_version: 1.3.6
|
97
90
|
signing_key:
|
98
91
|
specification_version: 3
|
99
92
|
summary: A set of utilities for Nanoc3.
|