nutils 0.8.4 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -3
- data/lib/nutils/helpers/rules.rb +9 -1
- data/lib/nutils.rb +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Nutils Readme
|
2
2
|
|
3
|
-
A set of utilities for
|
3
|
+
A set of utilities for nanoc 3.
|
4
4
|
|
5
5
|
## Filters
|
6
6
|
|
@@ -9,13 +9,13 @@ A set of utilities for Nanoc3.
|
|
9
9
|
* **sprockets** Runs the content through [Sprockets](http://getsprockets.org)
|
10
10
|
* **svg_to_png** Converts an SVG to PNG. Tested in Mac OS X 10.6, Ruby 1.8.7, Nanoc 3.1.6 and Batik 1.7.
|
11
11
|
* **yuicompressor** Compress the content with [YUI Compressor](http://developer.yahoo.com/yui/compressor/). Tested in Mac OS X 10.6, Ruby 1.8.7, Nanoc 3.1.6 and yui-compressor 0.9.1.
|
12
|
-
* **zass**
|
12
|
+
* **zass** Deprecated. Use the **sass** filter from nanoc 3.1.9+
|
13
13
|
|
14
14
|
## Data Sources
|
15
15
|
* **filesystem_customizable** Allows an array for source directories and for layout directories.
|
16
16
|
|
17
17
|
## Helpers
|
18
|
-
* **load_rules** Allows to use multiple files with Nanoc rules.
|
18
|
+
* **load_rules** Allows to use multiple files with Nanoc rules. It works with nanoc 3.1 and 3.2.
|
19
19
|
|
20
20
|
## Contact
|
21
21
|
You can reach me at <arnau.siches@gmail.com>.
|
data/lib/nutils/helpers/rules.rb
CHANGED
@@ -25,7 +25,15 @@ module Nutils
|
|
25
25
|
#
|
26
26
|
# @return [Proc]
|
27
27
|
def load_rules(filepath)
|
28
|
-
|
28
|
+
# Monkey-patch to obtain the site configuration since nanoc 3.2
|
29
|
+
if Gem.loaded_specs["nanoc3"].version >= Gem::Version.create('3.1') and Gem.loaded_specs["nanoc3"].version < Gem::Version.create('3.2')
|
30
|
+
rules_dir = @site.config[:rules_dir] || ['.']
|
31
|
+
elsif Gem.loaded_specs["nanoc3"].version >= Gem::Version.create('3.2')
|
32
|
+
rules_dir = @rules_collection.instance_variable_get(:@compiler).instance_variable_get(:@site).config[:rules_dir] || ['.']
|
33
|
+
else
|
34
|
+
raise "The load_rules helper needs nanoc 3.1 or higher."
|
35
|
+
end
|
36
|
+
|
29
37
|
|
30
38
|
path = rules_dir.map do |dir|
|
31
39
|
Dir[File.join(dir, filepath)].each { |filename| filename }
|
data/lib/nutils.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 59
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 9
|
9
|
+
- 0
|
10
|
+
version: 0.9.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Arnau Siches
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-07-
|
18
|
+
date: 2011-07-25 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|