nutils 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +6 -6
- data/lib/nutils/filters/svg2png.rb +2 -1
- data/lib/nutils/filters/yuicompressor.rb +12 -2
- data/lib/nutils.rb +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -4,12 +4,12 @@ A set of utilities for nanoc 3.
|
|
4
4
|
|
5
5
|
## Filters
|
6
6
|
|
7
|
-
* **beautify** Retabs HTML code. Tested in Mac OS X 10.6, Ruby 1.8.7 and Nanoc 3.1.6.
|
8
|
-
* **crop** Extracts the specified rectangle from the image.. Tested in Mac OS X 10.6, Ruby 1.8.7 and Nanoc 3.1.6.
|
9
|
-
* **sprockets** Runs the content through [Sprockets](http://getsprockets.org)
|
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
|
-
* **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** Deprecated.
|
7
|
+
* **beautify** Retabs HTML code. Tested in Mac OS X 10.6, Ruby 1.8.7 and Nanoc 3.1.6, 3.2.1.
|
8
|
+
* **crop** Extracts the specified rectangle from the image.. Tested in Mac OS X 10.6, Ruby 1.8.7 and Nanoc 3.1.6, 3.2.1.
|
9
|
+
* **sprockets** Runs the content through [Sprockets](http://getsprockets.org). Tested in Mac OS X 10.6, Ruby 1.8.7, Nanoc 3.1.6, 3.2.1 and Sprockets 1.
|
10
|
+
* **svg_to_png** Converts an SVG to PNG. Tested in Mac OS X 10.6, Ruby 1.8.7, Nanoc 3.1.6, 3.2.1 and Batik 1.7.
|
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, 3.2.1 and yui-compressor 0.9.1.
|
12
|
+
* **zass** Deprecated. You **should** 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.
|
@@ -6,7 +6,7 @@ module Nutils
|
|
6
6
|
#
|
7
7
|
# @version 0.3.1
|
8
8
|
#
|
9
|
-
# @note Requires «rjb»
|
9
|
+
# @note Requires «rjb» and «batik»
|
10
10
|
class SvgToPng < Nanoc3::Filter
|
11
11
|
require 'rjb'
|
12
12
|
require 'tempfile'
|
@@ -33,6 +33,7 @@ module Nutils
|
|
33
33
|
end
|
34
34
|
|
35
35
|
# Runs the content through {http://xmlgraphics.apache.org/batik/ Batik}.
|
36
|
+
# Batik must be in the `CLASSPATH`.
|
36
37
|
#
|
37
38
|
# @param [String] content The content to filter.
|
38
39
|
#
|
@@ -3,7 +3,7 @@ module Nutils
|
|
3
3
|
|
4
4
|
# @author Arnau Siches
|
5
5
|
#
|
6
|
-
# @version 1.
|
6
|
+
# @version 1.2.0
|
7
7
|
#
|
8
8
|
# @note Requires «yui-compressor»
|
9
9
|
class YuiCompressor < Nanoc3::Filter
|
@@ -16,10 +16,20 @@ module Nutils
|
|
16
16
|
#
|
17
17
|
# @param [String] content The content to filter.
|
18
18
|
#
|
19
|
+
# @option params [Symbol] :type The type of code to compress. Should be
|
20
|
+
# `:css` or `:js`.
|
21
|
+
#
|
19
22
|
# @return [String] The filtered content.
|
20
23
|
def run(content, params={})
|
21
24
|
require "yui/compressor"
|
22
|
-
|
25
|
+
if (params[:type] == :css)
|
26
|
+
compressor = ::YUI::CssCompressor.new
|
27
|
+
elsif (params[:type] == :js)
|
28
|
+
# It fallbacks to `:type => :js` because backwards compatibility w/
|
29
|
+
# prior versions of the filter.
|
30
|
+
compressor = ::YUI::JavaScriptCompressor.new
|
31
|
+
end
|
32
|
+
|
23
33
|
compressor.compress(content)
|
24
34
|
end
|
25
35
|
|
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: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 10
|
9
|
+
- 0
|
10
|
+
version: 0.10.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-
|
18
|
+
date: 2011-08-17 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|