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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Nutils Readme
2
2
 
3
- A set of utilities for Nanoc3.
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** Compiles the content using [Sass](http://sass-lang.com/) 3.1. Tested in Mac OS X 10.6.7, Ruby 1.8.7, Nanoc 3.1.6 and sass 3.1.
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>.
@@ -25,7 +25,15 @@ module Nutils
25
25
  #
26
26
  # @return [Proc]
27
27
  def load_rules(filepath)
28
- rules_dir = @site.config[:rules_dir] || ['.']
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
@@ -3,7 +3,7 @@
3
3
  module Nutils
4
4
 
5
5
  # The current nutils version.
6
- VERSION = '0.8.4'
6
+ VERSION = '0.9.0'
7
7
 
8
8
  end
9
9
 
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: 55
4
+ hash: 59
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 8
9
- - 4
10
- version: 0.8.4
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-17 00:00:00 -04:00
18
+ date: 2011-07-25 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency