nanoc 3.6.7 → 3.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +8 -8
  2. data/CONTRIBUTING.md +9 -13
  3. data/Gemfile +5 -1
  4. data/Gemfile.lock +70 -45
  5. data/NEWS.md +15 -1
  6. data/README.md +12 -119
  7. data/doc/yardoc_handlers/identifier.rb +34 -0
  8. data/lib/nanoc/base/compilation/checksum_store.rb +2 -2
  9. data/lib/nanoc/base/compilation/compiler.rb +3 -3
  10. data/lib/nanoc/base/compilation/compiler_dsl.rb +20 -15
  11. data/lib/nanoc/base/compilation/dependency_tracker.rb +4 -4
  12. data/lib/nanoc/base/compilation/filter.rb +5 -5
  13. data/lib/nanoc/base/compilation/item_rep_proxy.rb +2 -2
  14. data/lib/nanoc/base/compilation/item_rep_recorder_proxy.rb +3 -3
  15. data/lib/nanoc/base/compilation/outdatedness_checker.rb +49 -46
  16. data/lib/nanoc/base/compilation/rule.rb +6 -4
  17. data/lib/nanoc/base/compilation/rule_context.rb +10 -4
  18. data/lib/nanoc/base/compilation/rule_memory_calculator.rb +8 -7
  19. data/lib/nanoc/base/compilation/rule_memory_store.rb +2 -2
  20. data/lib/nanoc/base/compilation/rules_collection.rb +2 -2
  21. data/lib/nanoc/base/core_ext/array.rb +2 -2
  22. data/lib/nanoc/base/core_ext/date.rb +4 -2
  23. data/lib/nanoc/base/core_ext/hash.rb +3 -3
  24. data/lib/nanoc/base/core_ext/pathname.rb +1 -1
  25. data/lib/nanoc/base/directed_graph.rb +6 -6
  26. data/lib/nanoc/base/errors.rb +1 -1
  27. data/lib/nanoc/base/memoization.rb +4 -4
  28. data/lib/nanoc/base/notification_center.rb +1 -1
  29. data/lib/nanoc/base/ordered_hash.rb +207 -179
  30. data/lib/nanoc/base/plugin_registry.rb +7 -7
  31. data/lib/nanoc/base/result_data/item_rep.rb +25 -26
  32. data/lib/nanoc/base/source_data/code_snippet.rb +2 -2
  33. data/lib/nanoc/base/source_data/configuration.rb +1 -1
  34. data/lib/nanoc/base/source_data/data_source.rb +2 -2
  35. data/lib/nanoc/base/source_data/item.rb +16 -15
  36. data/lib/nanoc/base/source_data/item_array.rb +4 -4
  37. data/lib/nanoc/base/source_data/layout.rb +5 -5
  38. data/lib/nanoc/base/source_data/site.rb +6 -6
  39. data/lib/nanoc/base/store.rb +8 -8
  40. data/lib/nanoc/cli/cleaning_stream.rb +11 -12
  41. data/lib/nanoc/cli/command_runner.rb +8 -8
  42. data/lib/nanoc/cli/commands/autocompile.rb +5 -4
  43. data/lib/nanoc/cli/commands/check.rb +12 -11
  44. data/lib/nanoc/cli/commands/compile.rb +50 -52
  45. data/lib/nanoc/cli/commands/create-item.rb +6 -6
  46. data/lib/nanoc/cli/commands/create-layout.rb +6 -6
  47. data/lib/nanoc/cli/commands/create-site.rb +10 -13
  48. data/lib/nanoc/cli/commands/deploy.rb +11 -11
  49. data/lib/nanoc/cli/commands/prune.rb +10 -10
  50. data/lib/nanoc/cli/commands/shell.rb +7 -7
  51. data/lib/nanoc/cli/commands/show-data.rb +22 -23
  52. data/lib/nanoc/cli/commands/show-plugins.rb +3 -3
  53. data/lib/nanoc/cli/commands/show-rules.rb +8 -8
  54. data/lib/nanoc/cli/commands/sync.rb +4 -2
  55. data/lib/nanoc/cli/commands/update.rb +4 -4
  56. data/lib/nanoc/cli/commands/validate-css.rb +3 -3
  57. data/lib/nanoc/cli/commands/validate-html.rb +3 -3
  58. data/lib/nanoc/cli/commands/validate-links.rb +3 -3
  59. data/lib/nanoc/cli/commands/view.rb +5 -3
  60. data/lib/nanoc/cli/commands/watch.rb +12 -12
  61. data/lib/nanoc/cli/error_handler.rb +58 -58
  62. data/lib/nanoc/cli/logger.rb +6 -6
  63. data/lib/nanoc/cli/stream_cleaners/abstract.rb +1 -1
  64. data/lib/nanoc/cli/stream_cleaners.rb +0 -1
  65. data/lib/nanoc/cli.rb +24 -22
  66. data/lib/nanoc/data_sources/deprecated/delicious.rb +1 -1
  67. data/lib/nanoc/data_sources/deprecated/last_fm.rb +16 -14
  68. data/lib/nanoc/data_sources/deprecated/twitter.rb +1 -1
  69. data/lib/nanoc/data_sources/filesystem.rb +22 -20
  70. data/lib/nanoc/data_sources/filesystem_unified.rb +4 -5
  71. data/lib/nanoc/data_sources/filesystem_verbose.rb +2 -3
  72. data/lib/nanoc/data_sources/static.rb +2 -2
  73. data/lib/nanoc/extra/auto_compiler.rb +3 -3
  74. data/lib/nanoc/extra/checking/check.rb +3 -3
  75. data/lib/nanoc/extra/checking/checks/css.rb +2 -2
  76. data/lib/nanoc/extra/checking/checks/external_links.rb +9 -9
  77. data/lib/nanoc/extra/checking/checks/html.rb +2 -3
  78. data/lib/nanoc/extra/checking/checks/internal_links.rb +6 -7
  79. data/lib/nanoc/extra/checking/checks/stale.rb +6 -6
  80. data/lib/nanoc/extra/checking/dsl.rb +1 -1
  81. data/lib/nanoc/extra/checking/runner.rb +19 -19
  82. data/lib/nanoc/extra/chick.rb +11 -9
  83. data/lib/nanoc/extra/core_ext/pathname.rb +1 -2
  84. data/lib/nanoc/extra/core_ext/time.rb +2 -2
  85. data/lib/nanoc/extra/core_ext.rb +0 -1
  86. data/lib/nanoc/extra/deployer.rb +2 -2
  87. data/lib/nanoc/extra/deployers/fog.rb +12 -12
  88. data/lib/nanoc/extra/deployers/rsync.rb +6 -6
  89. data/lib/nanoc/extra/file_proxy.rb +1 -1
  90. data/lib/nanoc/extra/filesystem_tools.rb +5 -5
  91. data/lib/nanoc/extra/link_collector.rb +4 -3
  92. data/lib/nanoc/extra/pruner.rb +5 -5
  93. data/lib/nanoc/extra/validators/links.rb +3 -3
  94. data/lib/nanoc/extra/vcs.rb +1 -1
  95. data/lib/nanoc/filters/asciidoc.rb +3 -3
  96. data/lib/nanoc/filters/bluecloth.rb +1 -1
  97. data/lib/nanoc/filters/coderay.rb +2 -2
  98. data/lib/nanoc/filters/coffeescript.rb +2 -0
  99. data/lib/nanoc/filters/colorize_syntax.rb +16 -16
  100. data/lib/nanoc/filters/erb.rb +5 -5
  101. data/lib/nanoc/filters/erubis.rb +1 -1
  102. data/lib/nanoc/filters/haml.rb +1 -1
  103. data/lib/nanoc/filters/handlebars.rb +2 -2
  104. data/lib/nanoc/filters/kramdown.rb +1 -1
  105. data/lib/nanoc/filters/less.rb +1 -1
  106. data/lib/nanoc/filters/markaby.rb +1 -1
  107. data/lib/nanoc/filters/maruku.rb +1 -1
  108. data/lib/nanoc/filters/mustache.rb +1 -1
  109. data/lib/nanoc/filters/pandoc.rb +1 -1
  110. data/lib/nanoc/filters/rainpress.rb +1 -1
  111. data/lib/nanoc/filters/rdiscount.rb +1 -1
  112. data/lib/nanoc/filters/rdoc.rb +1 -1
  113. data/lib/nanoc/filters/redcarpet.rb +2 -2
  114. data/lib/nanoc/filters/redcloth.rb +9 -9
  115. data/lib/nanoc/filters/relativize_paths.rb +7 -8
  116. data/lib/nanoc/filters/rubypants.rb +1 -1
  117. data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +1 -1
  118. data/lib/nanoc/filters/sass.rb +1 -1
  119. data/lib/nanoc/filters/slim.rb +1 -1
  120. data/lib/nanoc/filters/typogruby.rb +1 -1
  121. data/lib/nanoc/filters/uglify_js.rb +1 -1
  122. data/lib/nanoc/filters/xsl.rb +9 -7
  123. data/lib/nanoc/filters/yui_compressor.rb +2 -0
  124. data/lib/nanoc/helpers/blogging.rb +6 -6
  125. data/lib/nanoc/helpers/breadcrumbs.rb +1 -1
  126. data/lib/nanoc/helpers/capturing.rb +2 -2
  127. data/lib/nanoc/helpers/filtering.rb +1 -1
  128. data/lib/nanoc/helpers/html_escape.rb +3 -3
  129. data/lib/nanoc/helpers/link_to.rb +6 -6
  130. data/lib/nanoc/helpers/rendering.rb +2 -2
  131. data/lib/nanoc/helpers/tagging.rb +2 -2
  132. data/lib/nanoc/helpers/text.rb +1 -1
  133. data/lib/nanoc/helpers/xml_sitemap.rb +2 -2
  134. data/lib/nanoc/version.rb +1 -1
  135. data/lib/nanoc.rb +3 -2
  136. data/nanoc.gemspec +2 -6
  137. data/tasks/rubocop.rake +5 -0
  138. data/test/base/test_compiler_dsl.rb +20 -1
  139. data/test/cli/commands/test_compile.rb +4 -3
  140. data/test/cli/test_error_handler.rb +32 -0
  141. data/test/filters/test_erb.rb +1 -1
  142. data/test/filters/test_less.rb +1 -1
  143. data/test/filters/test_xsl.rb +95 -8
  144. metadata +30 -84
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDYwZDczMTNhNTI0MzcxNDYwZjAzY2ZhMzRiY2E1OTA5ZmJjZDZjZg==
4
+ Y2RmYzljOTcyNWE2NzhmYTEzZWI3MDhlNDAzNTQ2ZGZhMzhhYTliMg==
5
5
  data.tar.gz: !binary |-
6
- NzhlNjQyMjdiMmQ0ZWEzZGM2NWMwNjRjZWI4NTVmN2YzYTE3MWM5NA==
6
+ YWYzNTkyNDZmYWU0ZjdiMWE0NWIwNDZiMmEzMDhjYmRhMTc5NDZmZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTY3NDMxNjY3ZWFlY2FkN2EwZjA2ZWNiMGI2MDJiYTRlY2Y5N2Y4Y2QxZjQ0
10
- NThlYTg0ZTQ4OWU0YjA2YjM4ZDBlOTQwY2ExNTQxMDdhMTZhYzM1NmUyZDQx
11
- YThkZDI5ZjdmYmZmMGE5NGU0ZDZjMzMyNjk0YWM1NTNlYzM3NmE=
9
+ ZWQ1N2I4MDVhOWJhMTYzNzI3Mjg5MmIwYWVlZmE0MzViMDk4NmI3ZDA3MTUx
10
+ MzJmNjhhMjFjNTdhZTMzZDBjMzIyODhhNzYxYTVlOTVhNDM2MzYwNWMyOTAx
11
+ ZTQyMTk2M2RmMGE1Nzg2NDhiOTVlZmEzNWUyMWZlZjhjZjAzZjA=
12
12
  data.tar.gz: !binary |-
13
- NWEwMzcxMTY2ODBjMDBkYWE5NjUyNjI1MTEyMDU4MDNlNGI4NDcwMWI0ZTJj
14
- OTVmNWY2YjU4ZTQ4N2I2YmRjNzdkYWQ3ZjhkY2RiNzdjN2FhN2VkNTQ0Mjc4
15
- MGIyNWI2M2NlNmQ2ZWYyZmZmN2I1YTcwNzIxZTFhY2VmNmM4NGY=
13
+ NjQxYTNjMmZlYmQ0OTRlNWYzYjE4MWNiNDYyYjQ5MjI1N2U1ZjNjZDY4OWY0
14
+ YjU3Mjk2NjlkMTgxZTQ3YmE2OWRiMGY4MThiMzU5Mjc2MjFjMTc1MzI2YWY5
15
+ YWM5MzM3MzczZGMwMzI4ZDdiNjRjMDAyOWRlMWJjNTMyYjE2MmE=
data/CONTRIBUTING.md CHANGED
@@ -4,22 +4,18 @@ Contributing
4
4
  Reporting bugs
5
5
  --------------
6
6
 
7
- If you find a bug in nanoc, you should report it! But before you do, make sure you have the latest version of nanoc (and dependencies) installed, and see if you can still reproduce the bug there. If you can, report it!
7
+ If you find a bug in nanoc, you should report it! Some information that you should include in your bug report is the nanoc version (`nanoc --version`) and, if relevant, the crash log (`crash.log`).
8
8
 
9
- When reporting a bug, please make sure you include as many details as you can about the bug. Some information that you should include:
9
+ For details, check the [*bug reporting* section of the development guide](http://nanoc.ws/development/#reporting-bugs).
10
10
 
11
- * The nanoc version (`nanoc --version`)
12
- * The `crash.log` file, if relevant
11
+ Contributing code
12
+ -----------------
13
13
 
14
- Submitting Patches
15
- ------------------
14
+ Pull requests are appreciated! When submitting a PR, be sure to submit it onto the right branch:
16
15
 
17
- If you want to submit a pull request, please review the following few guidelines:
16
+ * For bug fixes, use the release branch, e.g. `release-3.6.x`
17
+ * For features, use the `master` branch
18
18
 
19
- * If your pull request is a **bug fix**, submit it on the latest release branch. At the moment of writing, this is `release-3.4.x`. This ensures that the bug fix comes in the next patch release.
19
+ When submitting a PR, make sure that your changes have covering tests, that the documentation remains up-to-date and that you retain backwards compatibility.
20
20
 
21
- * If your pull request is a new **feature** or extends an existing feature, submit it on the `master` branch.
22
-
23
- In both cases, make sure that your changes have **test cases** that cover the bug fix or the new/changed functionality.
24
-
25
- Also note that **backwards compatibility** must be retained. This means that you cannot simply modify a feature to work in a different way. What you can do, is add an option to make it work in a different way, but do double-check with me (@ddfreyne) first.
21
+ For details, check the [*contributing code* section of the development guide](http://nanoc.ws/development/#contributing-code).
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
@@ -18,6 +18,8 @@ gem 'listen'
18
18
  gem 'markaby'
19
19
  gem 'maruku'
20
20
  gem 'mime-types'
21
+ gem 'minitest', '~> 4.0'
22
+ gem 'mocha'
21
23
  gem 'mustache'
22
24
  gem 'nokogiri', '~> 1.5.5'
23
25
  gem 'pandoc-ruby'
@@ -30,6 +32,7 @@ gem 'rdiscount'
30
32
  gem 'rdoc'
31
33
  gem 'redcarpet'
32
34
  gem 'RedCloth'
35
+ gem 'rubocop'
33
36
  gem 'rubypants'
34
37
  gem 'sass', '~> 3.2.2'
35
38
  gem 'slim'
@@ -38,3 +41,4 @@ gem 'typogruby'
38
41
  gem 'uglifier'
39
42
  gem 'w3c_validators'
40
43
  gem 'yuicompressor'
44
+ gem 'yard'
data/Gemfile.lock CHANGED
@@ -5,79 +5,95 @@ PATH
5
5
  cri (~> 2.3)
6
6
 
7
7
  GEM
8
- remote: http://rubygems.org/
8
+ remote: https://rubygems.org/
9
9
  specs:
10
10
  RedCloth (4.2.9)
11
- adsf (1.1.1)
11
+ adsf (1.2.0)
12
12
  rack (>= 1.0.0)
13
+ ast (1.1.0)
13
14
  bluecloth (2.2.0)
14
15
  builder (3.2.2)
15
16
  celluloid (0.15.2)
16
17
  timers (~> 1.1.0)
17
- chunky_png (1.2.9)
18
+ celluloid-io (0.15.0)
19
+ celluloid (>= 0.15.0)
20
+ nio4r (>= 0.5.0)
21
+ chunky_png (1.3.0)
18
22
  coderay (1.1.0)
19
23
  coffee-script (2.2.0)
20
24
  coffee-script-source
21
25
  execjs
22
- coffee-script-source (1.6.3)
26
+ coffee-script-source (1.7.0)
23
27
  colored (1.2)
24
28
  commonjs (0.2.7)
25
- compass (0.12.2)
29
+ compass (0.12.4)
26
30
  chunky_png (~> 1.2)
27
31
  fssm (>= 0.2.7)
28
- sass (~> 3.1)
29
- cri (2.4.0)
32
+ sass (~> 3.2.17)
33
+ cri (2.5.0)
30
34
  colored (>= 1.2)
31
35
  erubis (2.7.0)
32
- excon (0.28.0)
36
+ excon (0.32.1)
33
37
  execjs (2.0.2)
34
38
  ffi (1.9.3)
35
- fog (1.18.0)
39
+ fog (1.21.0)
40
+ fog-brightbox
41
+ fog-core (~> 1.21, >= 1.21.1)
42
+ fog-json
43
+ nokogiri (~> 1.5, >= 1.5.11)
44
+ fog-brightbox (0.0.1)
45
+ fog-core
46
+ fog-json
47
+ fog-core (1.21.1)
36
48
  builder
37
- excon (~> 0.28.0)
49
+ excon (~> 0.32)
38
50
  formatador (~> 0.2.0)
39
51
  mime-types
40
- multi_json (~> 1.0)
41
52
  net-scp (~> 1.1)
42
53
  net-ssh (>= 2.1.3)
43
- nokogiri (~> 1.5)
44
- ruby-hmac
54
+ fog-json (1.0.0)
55
+ multi_json (~> 1.0)
45
56
  formatador (0.2.4)
46
57
  fssm (0.2.10)
47
- haml (4.0.4)
58
+ haml (4.0.5)
48
59
  tilt
49
- handlebars (0.5.0)
50
- commonjs (~> 0.2.3)
51
- handlebars-source (~> 1.0.12)
60
+ handlebars (0.6.0)
61
+ handlebars-source (~> 1.3.0)
52
62
  therubyracer (~> 0.12.0)
53
- handlebars-source (1.0.12)
63
+ handlebars-source (1.3.0)
54
64
  json (1.8.1)
55
- kramdown (1.2.0)
56
- less (2.4.0)
65
+ kramdown (1.3.3)
66
+ less (2.5.0)
57
67
  commonjs (~> 0.2.7)
58
68
  libv8 (3.16.14.3)
59
- listen (2.2.0)
69
+ listen (2.7.1)
60
70
  celluloid (>= 0.15.2)
71
+ celluloid-io (>= 0.15.0)
61
72
  rb-fsevent (>= 0.9.3)
62
73
  rb-inotify (>= 0.9)
63
- markaby (0.7.2)
64
- builder (>= 2.0.0)
65
- maruku (0.7.0)
66
- metaclass (0.0.1)
74
+ markaby (0.8.0)
75
+ builder
76
+ maruku (0.7.1)
77
+ metaclass (0.0.4)
67
78
  method_source (0.8.2)
68
- mime-types (2.0)
79
+ mime-types (2.2)
69
80
  minitest (4.7.5)
70
- mocha (0.14.0)
81
+ mocha (1.0.0)
71
82
  metaclass (~> 0.0.1)
72
- multi_json (1.8.2)
83
+ multi_json (1.9.2)
73
84
  mustache (0.99.5)
74
85
  net-scp (1.1.2)
75
86
  net-ssh (>= 2.6.5)
76
- net-ssh (2.7.0)
77
- nokogiri (1.5.10)
87
+ net-ssh (2.8.0)
88
+ nio4r (1.0.0)
89
+ nokogiri (1.5.11)
78
90
  pandoc-ruby (0.7.5)
79
- posix-spawn (0.3.6)
80
- pry (0.9.12.4)
91
+ parser (2.1.7)
92
+ ast (~> 1.1)
93
+ slop (~> 3.4, >= 3.4.5)
94
+ posix-spawn (0.3.8)
95
+ powerpack (0.0.9)
96
+ pry (0.9.12.6)
81
97
  coderay (~> 1.0)
82
98
  method_source (~> 0.8)
83
99
  slop (~> 3.4)
@@ -85,33 +101,40 @@ GEM
85
101
  posix-spawn (~> 0.3.6)
86
102
  yajl-ruby (~> 1.1.0)
87
103
  rack (1.5.2)
104
+ rainbow (2.0.0)
88
105
  rainpress (1.0)
89
- rake (10.1.0)
90
- rb-fsevent (0.9.3)
91
- rb-inotify (0.9.2)
106
+ rake (10.1.1)
107
+ rb-fsevent (0.9.4)
108
+ rb-inotify (0.9.3)
92
109
  ffi (>= 0.5.0)
93
110
  rdiscount (2.1.7)
94
- rdoc (4.0.1)
111
+ rdoc (4.1.1)
95
112
  json (~> 1.4)
96
- redcarpet (3.0.0)
113
+ redcarpet (3.1.1)
97
114
  ref (1.0.5)
98
- ruby-hmac (0.4.0)
115
+ rubocop (0.19.1)
116
+ json (>= 1.7.7, < 2)
117
+ parser (~> 2.1.7)
118
+ powerpack (~> 0.0.6)
119
+ rainbow (>= 1.99.1, < 3.0)
120
+ ruby-progressbar (~> 1.4)
121
+ ruby-progressbar (1.4.2)
99
122
  rubypants (0.2.0)
100
- sass (3.2.12)
123
+ sass (3.2.17)
101
124
  slim (2.0.2)
102
125
  temple (~> 0.6.6)
103
126
  tilt (>= 1.3.3, < 2.1)
104
- slop (3.4.7)
105
- systemu (2.5.2)
127
+ slop (3.5.0)
128
+ systemu (2.6.4)
106
129
  temple (0.6.7)
107
- therubyracer (0.12.0)
130
+ therubyracer (0.12.1)
108
131
  libv8 (~> 3.16.14.0)
109
132
  ref
110
- tilt (1.4.1)
133
+ tilt (2.0.1)
111
134
  timers (1.1.0)
112
135
  typogruby (1.0.16)
113
136
  rubypants
114
- uglifier (2.3.1)
137
+ uglifier (2.5.0)
115
138
  execjs (>= 0.3.0)
116
139
  json (>= 1.8.0)
117
140
  w3c_validators (1.2)
@@ -119,7 +142,7 @@ GEM
119
142
  nokogiri
120
143
  yajl-ruby (1.1.0)
121
144
  yard (0.8.7.3)
122
- yuicompressor (1.2.1)
145
+ yuicompressor (1.3.3)
123
146
 
124
147
  PLATFORMS
125
148
  ruby
@@ -129,6 +152,7 @@ DEPENDENCIES
129
152
  adsf
130
153
  bluecloth
131
154
  builder
155
+ bundler (~> 1.5)
132
156
  coderay
133
157
  coffee-script
134
158
  compass
@@ -156,6 +180,7 @@ DEPENDENCIES
156
180
  rdiscount
157
181
  rdoc
158
182
  redcarpet
183
+ rubocop
159
184
  rubypants
160
185
  sass (~> 3.2.2)
161
186
  slim
data/NEWS.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # nanoc news
2
2
 
3
+ ## 3.6.8 (2014-03-22)
4
+
5
+ Fixes:
6
+
7
+ * Fixed issue with missing compilation durations (#374, #379)
8
+ * Made XSL filter transform item rather than layout (#399, #401) [Simon South]
9
+ * Made XSL filter honor omit-xml-declaration (#403, #404) [Simon South]
10
+ * Removed "see full crash log" line from crash log (#397, #402)
11
+
12
+ Enhancements:
13
+
14
+ * Added warning when multiple preprocessors are defined (#389)
15
+ * Improve stylesheet handling in default site (#339, #395)
16
+
3
17
  ## 3.6.7 (2013-12-09)
4
18
 
5
19
  Fixes:
@@ -10,7 +24,7 @@ Fixes:
10
24
  * Fixed crash in watcher (#358)
11
25
  * Fixed huge durations when showing skipped items after compilation (#360, #364)
12
26
  * Fixed output of `--verbose` compilation statistics (#359, #365)
13
- * Fixed issue with Sass files not recompiling (#350, 370)
27
+ * Fixed issue with Sass files not recompiling (#350, #370)
14
28
 
15
29
  Enhancements:
16
30
 
data/README.md CHANGED
@@ -1,129 +1,22 @@
1
1
  [![Build Status](https://travis-ci.org/nanoc/nanoc.png)](https://travis-ci.org/nanoc/nanoc)
2
- [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/nanoc/nanoc)
2
+ [![Code Climate](https://codeclimate.com/github/nanoc/nanoc.png)](https://codeclimate.com/github/nanoc/nanoc)
3
+ [![Coverage Status](https://coveralls.io/repos/nanoc/nanoc/badge.png?branch=master)](https://coveralls.io/r/nanoc/nanoc)
4
+ [![Gem Version](https://badge.fury.io/rb/nanoc.png)](http://badge.fury.io/rb/nanoc)
3
5
 
4
- **Please take a moment and [donate](http://pledgie.com/campaigns/9282) to nanoc. A lot of time has gone into developing nanoc, and I would like to keep the current pace. Your support will ensure that nanoc will continue to improve.**
6
+ ![nanoc logo](https://avatars1.githubusercontent.com/u/3260163?s=140)
5
7
 
6
- # nanoc 3
8
+ # nanoc
7
9
 
8
- nanoc is a simple but very flexible static site generator written in Ruby.
9
- It operates on local files, and therefore does not run on the server. nanoc
10
- “compiles” the local source files into HTML (usually), by evaluating eRuby,
11
- Markdown, etc.
10
+ nanoc is a flexible static site generator written in Ruby. See the [nanoc web site](http://nanoc.ws) for more information.
12
11
 
13
- Note: This documentation looks best with Yardoc, not RDoc.
12
+ **Please take a moment and [donate](http://pledgie.com/campaigns/9282) to nanoc. A lot of time has gone into developing nanoc, and I would like to keep it going. Your support will ensure that nanoc will continue to improve.**
14
13
 
15
- ## Resources
14
+ ## Contributing
16
15
 
17
- The [nanoc web site](http://nanoc.ws) contains a few useful resources to help you get started with nanoc. If you need further assistance, the following places will help you out:
16
+ Contributions are greatly appreciated! Consult the [Development guidelines](http://nanoc.ws/development/) for information on how you can contribute.
18
17
 
19
- * The [discussion group](http://groups.google.com/group/nanoc)
20
- * The [IRC channel](irc://chat.freenode.net/#nanoc)
18
+ ### Contributors
21
19
 
22
- ## Versioning
20
+ Many thanks to everyone who has contributed to nanoc in one way or another:
23
21
 
24
- nanoc uses [Semantic Versioning](http://semver.org/).
25
-
26
- ## Source Code Documentation
27
-
28
- The source code is located in `lib/nanoc` and is structured in a few
29
- directories:
30
-
31
- * `base` contains the bare essentials necessary for nanoc to function
32
- * `source_data` contains raw, uncompiled content that will be compiled
33
- * `result_data` contains the compiled content
34
- * `compilation` contains the compilation functionality
35
- * `cli` contains the commandline interface
36
- * `data_sources` contains the standard data sources ({Nanoc::DataSource}
37
- subclasses), such as the filesystem data source
38
- * `extra` contains stuff that is not needed by nanoc itself, but which may
39
- be used by helpers, data sources, filters or VCSes.
40
- * `filters` contains the standard filters ({Nanoc::Filter} subclasses)
41
- such as ERB, Markdown, Haml, …
42
- * `helpers` contains helpers, which provide functionality some sites
43
- may find useful, such as the blogging and tagging helpers
44
- * `tasks` contains rake tasks that perform a variety of functions such as
45
- validating HTML and CSS, uploading compiled files, …
46
-
47
- The namespaces (modules) are organised like this:
48
-
49
- * {Nanoc} is the namespace for everything nanoc-related (obviously). The
50
- classes in `lib/nanoc/base` are part of this module (not `Nanoc::Base`)
51
- * {Nanoc::CLI} containing everything related to the commandline tool.
52
- * {Nanoc::DataSources} contains the data sources
53
- * {Nanoc::Helpers} contains the helpers
54
- * {Nanoc::Extra} contains useful stuff not needed by nanoc itself
55
- * {Nanoc::Filters} contains the (textual) filters
56
-
57
- The central class in nanoc is {Nanoc::Site}, so you should start there if
58
- you want to explore nanoc from a technical perspective.
59
-
60
- ## Dependencies
61
-
62
- nanoc has few dependencies. It is possible to use nanoc programmatically
63
- without any dependencies at all, but if you want to use nanoc in a proper way,
64
- you’ll likely need some dependencies:
65
-
66
- * The **commandline frontend** depends on `cri`.
67
- * The **autocompiler** depends on `mime-types` and `rack`.
68
- * Filters and helpers likely have dependencies on their own too.
69
-
70
- If you’re developing for nanoc, such as writing custom filters or helpers, you
71
- may be interested in the development dependencies:
72
-
73
- * For **documentation generation** you’ll need `yard`.
74
- * For **packaging** you’ll need `rubygems` (1.3 or newer).
75
- * For **testing** you’ll need `mocha` and `minitest`.
76
-
77
- ## Contributors
78
-
79
- (In alphabetical order)
80
-
81
- * Ben Armston
82
- * Colin Barrett
83
- * Bil Bas
84
- * Dmitry Bilunov
85
- * Fabian Buch
86
- * Devon Luke Buchanan
87
- * Stefan Bühler
88
- * Dan Callahan
89
- * Brian Candler
90
- * Jack Chu
91
- * Michal Cichra
92
- * Zaiste de Grengolada
93
- * Vincent Driessen
94
- * Chris Eppstein
95
- * Jeff Forcier
96
- * Riley Goodside
97
- * Felix Hanley
98
- * Justin Hileman
99
- * Starr Horne
100
- * Daniel Hofstetter
101
- * Tuomas Kareinen
102
- * Greg Karékinian
103
- * Matt Keveney
104
- * Kevin Lynagh
105
- * Go Maeda
106
- * Nikhil Marathe
107
- * Daniel Mendler
108
- * Stuart Montgomery
109
- * Ale Muñoz
110
- * John Nishinaga
111
- * Gregory Pakosz
112
- * Nicky Peeters
113
- * Christian Plessl
114
- * Damien Pollet
115
- * Šime Ramov
116
- * Xavier Shay
117
- * Arnau Siches
118
- * “Soryu”
119
- * Eric Sunshine
120
- * Dennis Sutch
121
- * Takashi Uchibe
122
- * Matthias Vallentin
123
- * Ruben Verborgh
124
- * Scott Vokes
125
- * Toon Willems
126
-
127
- ## Contact
128
-
129
- You can reach me at <denis.defreyne@stoneship.org>.
22
+ Ale Muñoz, Alexander Mankuta, Arnau Siches, Ben Armston, Bil Bas, Brian Candler, Bruno Dufour, Chris Eppstein, Christian Plessl, Colin Barrett, Damien Pollet, Dan Callahan, Daniel Hofstetter, Daniel Mendler, Daniel Wollschlaeger, David Everitt, Dennis Sutch, Devon Luke Buchanan, Dmitry Bilunov, Eric Sunshine, Erik Hollensbe, Fabian Buch, Felix Hanley, Go Maeda, Gregory Pakosz, Grégory Karékinian, Guilherme Garnier, Jack Chu, Jake Benilov, Jasper Van der Jeugt, Jeff Forcier, John Nishinaga, Justin Clift, Justin Hileman, Kevin Lynagh, Louis T., Mathias Bynens, Matt Keveney, Matthew Frazier, Matthias Beyer, Matthias Reitinger, Matthias Vallentin, Michal Cichra, Nelson Chen, Nicky Peeters, Nikhil Marathe, Oliver Byford, Peter Aronoff, Raphael von der Grün, Remko Tronçon, Riley Goodside, Ruben Verborgh, Scott Vokes, Simon South, Spencer Whitt, Stanley Rost, Starr Horne, Stefan Bühler, Stuart Montgomery, Takashi Uchibe, Toon Willems, Tuomas Kareinen, Ursula Kallio, Vincent Driessen, Xavier Shay, Zaiste de Grengolada, Šime Ramov
@@ -0,0 +1,34 @@
1
+ class NanocIdentifierHandler < ::YARD::Handlers::Ruby::AttributeHandler
2
+
3
+ # e.g. identifier :foo, :bar
4
+
5
+ handles method_call(:identifier), method_call(:identifiers)
6
+ namespace_only
7
+
8
+ def process
9
+ identifiers = statement.parameters(false).map { |param| param.jump(:ident)[0] }
10
+ namespace['nanoc_identifiers'] = identifiers
11
+ end
12
+
13
+ end
14
+
15
+ class NanocRegisterFilterHandler < ::YARD::Handlers::Ruby::AttributeHandler
16
+
17
+ # e.g. Nanoc::Filter.register '::Nanoc::Filters::AsciiDoc', :asciidoc
18
+
19
+ handles method_call(:register)
20
+ namespace_only
21
+
22
+ def process
23
+ target = statement.jump(:const_path_ref)
24
+ return if target != s(:const_path_ref, s(:var_ref, s(:const, "Nanoc")), s(:const, "Filter"))
25
+
26
+ class_name = statement.jump(:string_literal).jump(:tstring_content)[0]
27
+ identifier = statement.jump(:symbol_literal).jump(:ident)[0]
28
+
29
+ obj = YARD::Registry.at(class_name.sub(/^::/, ''))
30
+ obj['nanoc_identifiers'] ||= []
31
+ obj['nanoc_identifiers'] << identifier
32
+ end
33
+
34
+ end
@@ -10,10 +10,10 @@ module Nanoc
10
10
 
11
11
  # @option params [Nanoc::Site] site The site where this checksum store
12
12
  # belongs to
13
- def initialize(params={})
13
+ def initialize(params = {})
14
14
  super('tmp/checksums', 1)
15
15
 
16
- @site = params[:site] if params.has_key?(:site)
16
+ @site = params[:site] if params.key?(:site)
17
17
 
18
18
  @checksums = {}
19
19
  end
@@ -169,7 +169,7 @@ module Nanoc
169
169
  end
170
170
 
171
171
  # Calculate checksums
172
- self.objects.each do |obj|
172
+ objects.each do |obj|
173
173
  checksum_store[obj] = obj.checksum
174
174
  end
175
175
 
@@ -239,7 +239,7 @@ module Nanoc
239
239
  basic_path = rule.apply_to(rep, :compiler => self)
240
240
  next if basic_path.nil?
241
241
  if basic_path !~ %r{^/}
242
- raise RuntimeError, "The path returned for the #{rep.inspect} item representation, “#{basic_path}”, does not start with a slash. Please ensure that all routing rules return a path that starts with a slash."
242
+ raise "The path returned for the #{rep.inspect} item representation, “#{basic_path}”, does not start with a slash. Please ensure that all routing rules return a path that starts with a slash."
243
243
  end
244
244
 
245
245
  # Get raw path by prepending output directory
@@ -250,7 +250,7 @@ module Nanoc
250
250
  @site.config[:index_filenames].each do |index_filename|
251
251
  if rep.paths[snapshot][-index_filename.length..-1] == index_filename
252
252
  # Strip and stop
253
- rep.paths[snapshot] = rep.paths[snapshot][0..-index_filename.length-1]
253
+ rep.paths[snapshot] = rep.paths[snapshot][0..-index_filename.length - 1]
254
254
  break
255
255
  end
256
256
  end
@@ -25,6 +25,11 @@ module Nanoc
25
25
  #
26
26
  # @return [void]
27
27
  def preprocess(&block)
28
+ if @rules_collection.preprocessor
29
+ warn 'WARNING: A preprocess block is already defined. Defining ' \
30
+ 'another preprocess block overrides the previously one.'
31
+ end
32
+
28
33
  @rules_collection.preprocessor = block
29
34
  end
30
35
 
@@ -60,9 +65,9 @@ module Nanoc
60
65
  # compile '/bar/', :rep => :raw do
61
66
  # # do nothing
62
67
  # end
63
- def compile(identifier, params={}, &block)
68
+ def compile(identifier, params = {}, &block)
64
69
  # Require block
65
- raise ArgumentError.new("#compile requires a block") unless block_given?
70
+ raise ArgumentError.new('#compile requires a block') unless block_given?
66
71
 
67
72
  # Get rep name
68
73
  rep_name = params[:rep] || :default
@@ -104,9 +109,9 @@ module Nanoc
104
109
  # route '/bar/', :rep => :raw do
105
110
  # '/raw' + item.identifier + 'index.txt'
106
111
  # end
107
- def route(identifier, params={}, &block)
112
+ def route(identifier, params = {}, &block)
108
113
  # Require block
109
- raise ArgumentError.new("#route requires a block") unless block_given?
114
+ raise ArgumentError.new('#route requires a block') unless block_given?
110
115
 
111
116
  # Get rep name
112
117
  rep_name = params[:rep] || :default
@@ -141,7 +146,7 @@ module Nanoc
141
146
  # @example Using custom filter arguments for a layout
142
147
  #
143
148
  # layout '/custom/', :haml, :format => :html5
144
- def layout(identifier, filter_name, params={})
149
+ def layout(identifier, filter_name, params = {})
145
150
  @rules_collection.layout_filter_mapping[identifier_to_regex(identifier)] = [ filter_name, params ]
146
151
  end
147
152
 
@@ -170,15 +175,15 @@ module Nanoc
170
175
  # @example Copying the `:raw` rep of the `/bar/` item as-is
171
176
  #
172
177
  # passthrough '/bar/', :rep => :raw
173
- def passthrough(identifier, params={})
178
+ def passthrough(identifier, params = {})
174
179
  # Require no block
175
- raise ArgumentError.new("#passthrough does not require a block") if block_given?
180
+ raise ArgumentError.new('#passthrough does not require a block') if block_given?
176
181
 
177
182
  # Get rep name
178
183
  rep_name = params[:rep] || :default
179
184
 
180
185
  # Create compilation rule
181
- compilation_block = proc { }
186
+ compilation_block = proc {}
182
187
  compilation_rule = Rule.new(identifier_to_regex(identifier), rep_name, compilation_block)
183
188
  @rules_collection.add_item_compilation_rule(compilation_rule)
184
189
 
@@ -213,15 +218,15 @@ module Nanoc
213
218
  # @example Suppressing compilation and output for all all `/foo/*` items.
214
219
  #
215
220
  # ignore '/foo/*'
216
- def ignore(identifier, params={})
217
- raise ArgumentError.new("#ignore does not require a block") if block_given?
221
+ def ignore(identifier, params = {})
222
+ raise ArgumentError.new('#ignore does not require a block') if block_given?
218
223
 
219
224
  rep_name = params[:rep] || :default
220
225
 
221
- compilation_rule = Rule.new(identifier_to_regex(identifier), rep_name, proc { })
226
+ compilation_rule = Rule.new(identifier_to_regex(identifier), rep_name, proc {})
222
227
  @rules_collection.add_item_compilation_rule(compilation_rule)
223
228
 
224
- routing_rule = Rule.new(identifier_to_regex(identifier), rep_name, proc { }, :snapshot_name => :last)
229
+ routing_rule = Rule.new(identifier_to_regex(identifier), rep_name, proc {}, :snapshot_name => :last)
225
230
  @rules_collection.add_item_routing_rule(routing_rule)
226
231
  end
227
232
 
@@ -241,7 +246,7 @@ module Nanoc
241
246
  filename = [ "#{name}", "#{name}.rb", "./#{name}", "./#{name}.rb" ].find { |f| File.file?(f) }
242
247
  raise Nanoc::Errors::NoRulesFileFound.new if filename.nil?
243
248
 
244
- self.instance_eval(File.read(filename), filename)
249
+ instance_eval(File.read(filename), filename)
245
250
  end
246
251
 
247
252
  private
@@ -254,8 +259,8 @@ module Nanoc
254
259
  if identifier.is_a? String
255
260
  # Add leading/trailing slashes if necessary
256
261
  new_identifier = identifier.dup
257
- new_identifier[/^/] = '/' if identifier[0,1] != '/'
258
- new_identifier[/$/] = '/' unless [ '*', '/' ].include?(identifier[-1,1])
262
+ new_identifier[/^/] = '/' if identifier[0, 1] != '/'
263
+ new_identifier[/$/] = '/' unless [ '*', '/' ].include?(identifier[-1, 1])
259
264
 
260
265
  /^#{new_identifier.gsub('*', '(.*?)').gsub('+', '(.+?)')}$/
261
266
  else
@@ -55,7 +55,7 @@ module Nanoc
55
55
  Nanoc::NotificationCenter.on(:visit_started, self) do |obj|
56
56
  if !@stack.empty?
57
57
  Nanoc::NotificationCenter.post(:dependency_created, @stack.last, obj)
58
- self.record_dependency(@stack.last, obj)
58
+ record_dependency(@stack.last, obj)
59
59
  end
60
60
  @stack.push(obj)
61
61
  end
@@ -72,7 +72,7 @@ module Nanoc
72
72
  def stop
73
73
  # Sanity check
74
74
  if !@stack.empty?
75
- raise "Internal inconsistency: dependency tracker stack not empty at end of compilation"
75
+ raise 'Internal inconsistency: dependency tracker stack not empty at end of compilation'
76
76
  end
77
77
 
78
78
  # Unregister
@@ -159,12 +159,12 @@ module Nanoc
159
159
 
160
160
  # @deprecated Use {#store} instead
161
161
  def store_graph
162
- self.store
162
+ store
163
163
  end
164
164
 
165
165
  # @deprecated Use {#load} instead
166
166
  def load_graph
167
- self.load
167
+ load
168
168
  end
169
169
 
170
170
  # @see Nanoc::Store#unload