nanoc 3.7.3 → 3.7.4

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.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +71 -46
  3. data/NEWS.md +14 -0
  4. data/lib/nanoc.rb +1 -1
  5. data/lib/nanoc/base/checksummer.rb +1 -1
  6. data/lib/nanoc/base/compilation/checksum_store.rb +1 -1
  7. data/lib/nanoc/base/compilation/compiled_content_cache.rb +1 -1
  8. data/lib/nanoc/base/compilation/compiler.rb +11 -10
  9. data/lib/nanoc/base/compilation/compiler_dsl.rb +4 -4
  10. data/lib/nanoc/base/compilation/dependency_tracker.rb +7 -7
  11. data/lib/nanoc/base/compilation/filter.rb +1 -1
  12. data/lib/nanoc/base/compilation/item_rep_proxy.rb +6 -5
  13. data/lib/nanoc/base/compilation/item_rep_recorder_proxy.rb +8 -7
  14. data/lib/nanoc/base/compilation/outdatedness_checker.rb +6 -6
  15. data/lib/nanoc/base/compilation/rule.rb +1 -1
  16. data/lib/nanoc/base/compilation/rule_memory_store.rb +1 -1
  17. data/lib/nanoc/base/compilation/rules_collection.rb +5 -5
  18. data/lib/nanoc/base/context.rb +1 -1
  19. data/lib/nanoc/base/core_ext/array.rb +1 -1
  20. data/lib/nanoc/base/core_ext/date.rb +1 -1
  21. data/lib/nanoc/base/core_ext/hash.rb +1 -1
  22. data/lib/nanoc/base/directed_graph.rb +3 -3
  23. data/lib/nanoc/base/memoization.rb +1 -1
  24. data/lib/nanoc/base/notification_center.rb +1 -1
  25. data/lib/nanoc/base/ordered_hash.rb +1 -1
  26. data/lib/nanoc/base/plugin_registry.rb +3 -3
  27. data/lib/nanoc/base/result_data/item_rep.rb +13 -11
  28. data/lib/nanoc/base/source_data/code_snippet.rb +2 -2
  29. data/lib/nanoc/base/source_data/data_source.rb +3 -3
  30. data/lib/nanoc/base/source_data/item.rb +8 -8
  31. data/lib/nanoc/base/source_data/item_array.rb +1 -1
  32. data/lib/nanoc/base/source_data/layout.rb +1 -1
  33. data/lib/nanoc/base/source_data/site.rb +27 -18
  34. data/lib/nanoc/base/store.rb +3 -3
  35. data/lib/nanoc/base/temp_filename_factory.rb +2 -2
  36. data/lib/nanoc/cli.rb +6 -6
  37. data/lib/nanoc/cli/cleaning_stream.rb +1 -1
  38. data/lib/nanoc/cli/command_runner.rb +4 -3
  39. data/lib/nanoc/cli/commands/autocompile.rb +3 -3
  40. data/lib/nanoc/cli/commands/check.rb +3 -3
  41. data/lib/nanoc/cli/commands/compile.rb +23 -23
  42. data/lib/nanoc/cli/commands/create-item.rb +5 -5
  43. data/lib/nanoc/cli/commands/create-layout.rb +14 -14
  44. data/lib/nanoc/cli/commands/create-site.rb +6 -6
  45. data/lib/nanoc/cli/commands/deploy.rb +8 -8
  46. data/lib/nanoc/cli/commands/nanoc.rb +3 -3
  47. data/lib/nanoc/cli/commands/prune.rb +3 -3
  48. data/lib/nanoc/cli/commands/shell.rb +4 -4
  49. data/lib/nanoc/cli/commands/show-data.rb +5 -5
  50. data/lib/nanoc/cli/commands/show-plugins.rb +5 -5
  51. data/lib/nanoc/cli/commands/show-rules.rb +4 -4
  52. data/lib/nanoc/cli/commands/sync.rb +1 -1
  53. data/lib/nanoc/cli/commands/update.rb +13 -13
  54. data/lib/nanoc/cli/commands/validate-css.rb +3 -3
  55. data/lib/nanoc/cli/commands/validate-html.rb +3 -3
  56. data/lib/nanoc/cli/commands/validate-links.rb +6 -6
  57. data/lib/nanoc/cli/commands/view.rb +4 -4
  58. data/lib/nanoc/cli/commands/watch.rb +11 -11
  59. data/lib/nanoc/cli/error_handler.rb +10 -10
  60. data/lib/nanoc/cli/logger.rb +1 -1
  61. data/lib/nanoc/cli/stream_cleaners/abstract.rb +1 -1
  62. data/lib/nanoc/data_sources/deprecated/last_fm.rb +5 -5
  63. data/lib/nanoc/data_sources/deprecated/twitter.rb +1 -1
  64. data/lib/nanoc/data_sources/filesystem.rb +16 -16
  65. data/lib/nanoc/data_sources/filesystem_unified.rb +1 -1
  66. data/lib/nanoc/data_sources/filesystem_verbose.rb +1 -1
  67. data/lib/nanoc/data_sources/static.rb +1 -1
  68. data/lib/nanoc/extra/auto_compiler.rb +2 -2
  69. data/lib/nanoc/extra/checking/check.rb +11 -1
  70. data/lib/nanoc/extra/checking/checks/external_links.rb +15 -7
  71. data/lib/nanoc/extra/checking/checks/internal_links.rb +3 -3
  72. data/lib/nanoc/extra/checking/checks/stale.rb +6 -6
  73. data/lib/nanoc/extra/checking/runner.rb +10 -9
  74. data/lib/nanoc/extra/chick.rb +2 -2
  75. data/lib/nanoc/extra/core_ext/enumerable.rb +1 -1
  76. data/lib/nanoc/extra/deployers/fog.rb +2 -2
  77. data/lib/nanoc/extra/deployers/rsync.rb +3 -3
  78. data/lib/nanoc/extra/file_proxy.rb +3 -3
  79. data/lib/nanoc/extra/jruby_nokogiri_warner.rb +1 -1
  80. data/lib/nanoc/extra/link_collector.rb +3 -3
  81. data/lib/nanoc/extra/piper.rb +2 -2
  82. data/lib/nanoc/extra/pruner.rb +4 -3
  83. data/lib/nanoc/extra/validators/links.rb +2 -2
  84. data/lib/nanoc/extra/validators/w3c.rb +1 -1
  85. data/lib/nanoc/extra/vcs.rb +5 -5
  86. data/lib/nanoc/extra/vcses/dummy.rb +1 -1
  87. data/lib/nanoc/filters/asciidoc.rb +1 -1
  88. data/lib/nanoc/filters/bluecloth.rb +1 -1
  89. data/lib/nanoc/filters/coffeescript.rb +1 -1
  90. data/lib/nanoc/filters/colorize_syntax.rb +19 -21
  91. data/lib/nanoc/filters/erubis.rb +1 -1
  92. data/lib/nanoc/filters/handlebars.rb +1 -1
  93. data/lib/nanoc/filters/less.rb +2 -2
  94. data/lib/nanoc/filters/markaby.rb +1 -1
  95. data/lib/nanoc/filters/mustache.rb +1 -1
  96. data/lib/nanoc/filters/rdoc.rb +1 -1
  97. data/lib/nanoc/filters/relativize_paths.rb +5 -5
  98. data/lib/nanoc/filters/rubypants.rb +1 -1
  99. data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +1 -1
  100. data/lib/nanoc/filters/typogruby.rb +1 -1
  101. data/lib/nanoc/filters/xsl.rb +1 -1
  102. data/lib/nanoc/helpers/blogging.rb +12 -12
  103. data/lib/nanoc/helpers/capturing.rb +3 -3
  104. data/lib/nanoc/helpers/html_escape.rb +6 -6
  105. data/lib/nanoc/helpers/tagging.rb +1 -1
  106. data/lib/nanoc/helpers/xml_sitemap.rb +4 -4
  107. data/lib/nanoc/tasks/clean.rake +1 -1
  108. data/lib/nanoc/tasks/clean.rb +1 -1
  109. data/lib/nanoc/tasks/deploy/rsync.rake +2 -2
  110. data/lib/nanoc/version.rb +1 -1
  111. data/tasks/rubocop.rake +1 -0
  112. data/test/base/core_ext/array_spec.rb +7 -7
  113. data/test/base/core_ext/hash_spec.rb +1 -1
  114. data/test/base/test_checksum_store.rb +1 -1
  115. data/test/base/test_compiler.rb +14 -14
  116. data/test/base/test_compiler_dsl.rb +13 -13
  117. data/test/base/test_context.rb +2 -2
  118. data/test/base/test_dependency_tracker.rb +42 -42
  119. data/test/base/test_directed_graph.rb +102 -102
  120. data/test/base/test_item.rb +21 -21
  121. data/test/base/test_item_array.rb +19 -19
  122. data/test/base/test_item_rep.rb +50 -50
  123. data/test/base/test_layout.rb +6 -6
  124. data/test/base/test_outdatedness_checker.rb +2 -2
  125. data/test/base/test_rule_context.rb +2 -2
  126. data/test/base/test_site.rb +5 -5
  127. data/test/cli/commands/test_compile.rb +7 -7
  128. data/test/cli/commands/test_create_site.rb +2 -2
  129. data/test/cli/commands/test_deploy.rb +10 -10
  130. data/test/cli/commands/test_prune.rb +2 -2
  131. data/test/cli/commands/test_sync.rb +1 -1
  132. data/test/cli/commands/test_watch.rb +7 -7
  133. data/test/cli/test_cleaning_stream.rb +4 -4
  134. data/test/cli/test_cli.rb +3 -3
  135. data/test/cli/test_error_handler.rb +3 -3
  136. data/test/data_sources/test_filesystem.rb +19 -19
  137. data/test/data_sources/test_filesystem_unified.rb +30 -30
  138. data/test/data_sources/test_filesystem_verbose.rb +3 -3
  139. data/test/data_sources/test_static.rb +9 -9
  140. data/test/extra/checking/checks/test_stale.rb +8 -8
  141. data/test/extra/checking/test_check.rb +11 -1
  142. data/test/extra/checking/test_dsl.rb +1 -1
  143. data/test/extra/core_ext/test_enumerable.rb +2 -2
  144. data/test/extra/deployers/test_fog.rb +10 -10
  145. data/test/extra/deployers/test_rsync.rb +2 -2
  146. data/test/extra/test_auto_compiler.rb +28 -28
  147. data/test/extra/test_filesystem_tools.rb +3 -3
  148. data/test/extra/test_link_collector.rb +39 -20
  149. data/test/extra/validators/test_w3c.rb +5 -5
  150. data/test/filters/test_asciidoc.rb +2 -2
  151. data/test/filters/test_bluecloth.rb +1 -1
  152. data/test/filters/test_coffeescript.rb +1 -1
  153. data/test/filters/test_colorize_syntax.rb +20 -13
  154. data/test/filters/test_erb.rb +1 -1
  155. data/test/filters/test_kramdown.rb +1 -1
  156. data/test/filters/test_less.rb +10 -10
  157. data/test/filters/test_markaby.rb +2 -2
  158. data/test/filters/test_maruku.rb +2 -2
  159. data/test/filters/test_pandoc.rb +3 -3
  160. data/test/filters/test_rainpress.rb +4 -4
  161. data/test/filters/test_rdiscount.rb +2 -2
  162. data/test/filters/test_rdoc.rb +1 -1
  163. data/test/filters/test_redcarpet.rb +5 -5
  164. data/test/filters/test_redcloth.rb +5 -5
  165. data/test/filters/test_relativize_paths.rb +33 -31
  166. data/test/filters/test_rubypants.rb +2 -2
  167. data/test/filters/test_sass.rb +8 -8
  168. data/test/filters/test_slim.rb +3 -3
  169. data/test/filters/test_uglify_js.rb +1 -1
  170. data/test/filters/test_yui_compressor.rb +3 -3
  171. data/test/gem_loader.rb +1 -1
  172. data/test/helper.rb +14 -16
  173. data/test/helpers/test_blogging.rb +28 -28
  174. data/test/helpers/test_breadcrumbs.rb +12 -12
  175. data/test/helpers/test_capturing.rb +7 -7
  176. data/test/helpers/test_filtering.rb +16 -16
  177. data/test/helpers/test_link_to.rb +3 -3
  178. data/test/helpers/test_rendering.rb +1 -1
  179. data/test/helpers/test_tagging.rb +11 -11
  180. data/test/helpers/test_xml_sitemap.rb +18 -18
  181. data/test/tasks/test_clean.rb +8 -8
  182. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1846757f101a6af4c5ca4162918499723f8aef23
4
- data.tar.gz: a98022b27dcd1006ea2302bc55fcf9dcd023930b
3
+ metadata.gz: 15684f17b89e23c06fbe52df15a80529390df3a1
4
+ data.tar.gz: fcac628a29b82a5783020594f69a5b738d0fdc9b
5
5
  SHA512:
6
- metadata.gz: a6c17a90232a432a8f759c76922a9fee0917cfd79396707df54d6594fb5e665126ba04164d6e58aa42365a080450fdd87c025169b50dced1d0bda5c60501ee84
7
- data.tar.gz: 30ca231cbcdb8057aec80cf81462c533d60b151b9618aa08f2596b2c553b8111de2c262bf68b2dd7831b0b726275c494f9cff2a6de12916bb76371ef144a4756
6
+ metadata.gz: 37fde883c3804bd00defeb90266326921e79a4077454402c511acd0988a948361642db481019fa3f29a8708a07abaa5accd8000f08e773363156fcd409b75fff
7
+ data.tar.gz: fbb6f99a16f66438e70918a0f058b0f3089c41908595270d7d9e68ed5bb29be8feb9c1adff7207c096162a42e33fb15cfb47e7a53b3b08c58b3965eeab599dc7
@@ -11,12 +11,15 @@ GEM
11
11
  addressable (2.3.6)
12
12
  adsf (1.2.0)
13
13
  rack (>= 1.0.0)
14
+ allison (2.0.3)
14
15
  ast (2.0.0)
16
+ astrolabe (1.3.0)
17
+ parser (>= 2.2.0.pre.3, < 3.0)
15
18
  bluecloth (2.2.0)
16
19
  builder (3.2.2)
17
- celluloid (0.15.2)
18
- timers (~> 1.1.0)
19
- chunky_png (1.3.1)
20
+ celluloid (0.16.0)
21
+ timers (~> 4.0.0)
22
+ chunky_png (1.3.3)
20
23
  coderay (1.1.0)
21
24
  coffee-script (2.3.0)
22
25
  coffee-script-source
@@ -28,29 +31,36 @@ GEM
28
31
  chunky_png (~> 1.2)
29
32
  fssm (>= 0.2.7)
30
33
  sass (~> 3.2.19)
31
- coveralls (0.7.1)
34
+ coveralls (0.7.2)
32
35
  multi_json (~> 1.3)
33
- rest-client
36
+ rest-client (= 1.6.7)
34
37
  simplecov (>= 0.7)
35
- term-ansicolor
36
- thor
38
+ term-ansicolor (= 1.2.2)
39
+ thor (= 0.18.1)
37
40
  crack (0.4.2)
38
41
  safe_yaml (~> 1.0.0)
39
42
  cri (2.6.1)
40
43
  colored (~> 1.2)
41
44
  docile (1.1.5)
45
+ echoe (4.6.6)
46
+ allison (>= 2.0.3)
47
+ rake (>= 0.9.2)
48
+ rdoc (>= 2.5.11)
49
+ rubyforge (>= 2.0.4)
42
50
  erubis (2.7.0)
43
- excon (0.39.5)
44
- execjs (2.2.1)
45
- ffi (1.9.3)
46
- fog (1.23.0)
51
+ excon (0.41.0)
52
+ execjs (2.2.2)
53
+ ffi (1.9.6)
54
+ fog (1.24.0)
47
55
  fog-brightbox
48
56
  fog-core (~> 1.23)
49
57
  fog-json
58
+ fog-radosgw (>= 0.0.2)
59
+ fog-sakuracloud (>= 0.0.4)
50
60
  fog-softlayer
51
61
  ipaddress (~> 0.5)
52
62
  nokogiri (~> 1.5, >= 1.5.11)
53
- fog-brightbox (0.4.1)
63
+ fog-brightbox (0.6.1)
54
64
  fog-core (~> 1.22)
55
65
  fog-json
56
66
  inflecto
@@ -63,9 +73,19 @@ GEM
63
73
  net-ssh (>= 2.1.3)
64
74
  fog-json (1.0.0)
65
75
  multi_json (~> 1.0)
66
- fog-softlayer (0.3.16)
76
+ fog-radosgw (0.0.3)
77
+ fog-core (>= 1.21.0)
78
+ fog-json
79
+ fog-xml (>= 0.0.1)
80
+ fog-sakuracloud (0.1.1)
81
+ fog-core
82
+ fog-json
83
+ fog-softlayer (0.3.24)
67
84
  fog-core
68
85
  fog-json
86
+ fog-xml (0.1.1)
87
+ fog-core
88
+ nokogiri (~> 1.5, >= 1.5.11)
69
89
  formatador (0.2.5)
70
90
  fssm (0.2.10)
71
91
  haml (4.0.5)
@@ -74,14 +94,16 @@ GEM
74
94
  handlebars-source (~> 1.3.0)
75
95
  therubyracer (~> 0.12.0)
76
96
  handlebars-source (1.3.0)
97
+ hitimes (1.2.2)
77
98
  inflecto (0.0.2)
78
99
  ipaddress (0.8.0)
79
100
  json (1.8.1)
80
- kramdown (1.4.1)
101
+ json_pure (1.8.1)
102
+ kramdown (1.5.0)
81
103
  less (2.6.0)
82
104
  commonjs (~> 0.2.7)
83
- libv8 (3.16.14.3)
84
- listen (2.7.9)
105
+ libv8 (3.16.14.7)
106
+ listen (2.8.0)
85
107
  celluloid (>= 0.15.2)
86
108
  rb-fsevent (>= 0.9.3)
87
109
  rb-inotify (>= 0.9)
@@ -90,21 +112,20 @@ GEM
90
112
  maruku (0.7.2)
91
113
  metaclass (0.0.4)
92
114
  method_source (0.8.2)
93
- mime-types (2.3)
94
- mini_portile (0.6.0)
115
+ mime-types (2.4.3)
116
+ mini_portile (0.6.1)
95
117
  minitest (4.7.5)
96
118
  mocha (1.1.0)
97
119
  metaclass (~> 0.0.1)
98
120
  multi_json (1.10.1)
99
- mustache (0.99.6)
121
+ mustache (0.99.7)
100
122
  net-scp (1.2.1)
101
123
  net-ssh (>= 2.6.5)
102
124
  net-ssh (2.9.1)
103
- netrc (0.7.7)
104
- nokogiri (1.6.3.1)
105
- mini_portile (= 0.6.0)
125
+ nokogiri (1.6.4.1)
126
+ mini_portile (~> 0.6.0)
106
127
  pandoc-ruby (0.7.5)
107
- parser (2.2.0.pre.4)
128
+ parser (2.2.0.pre.7)
108
129
  ast (>= 1.1, < 3.0)
109
130
  slop (~> 3.4, >= 3.4.5)
110
131
  posix-spawn (0.3.9)
@@ -119,61 +140,65 @@ GEM
119
140
  rack (1.5.2)
120
141
  rainbow (2.0.0)
121
142
  rainpress (1.0)
143
+ echoe
122
144
  rake (10.3.2)
123
145
  rb-fsevent (0.9.4)
124
146
  rb-inotify (0.9.5)
125
147
  ffi (>= 0.5.0)
126
148
  rdiscount (2.1.7.1)
127
- rdoc (4.1.1)
149
+ rdoc (4.1.2)
128
150
  json (~> 1.4)
129
- redcarpet (3.1.2)
151
+ redcarpet (3.2.0)
130
152
  ref (1.0.5)
131
- rest-client (1.7.2)
132
- mime-types (>= 1.16, < 3.0)
133
- netrc (~> 0.7)
134
- rouge (1.6.2)
135
- rubocop (0.25.0)
136
- parser (>= 2.2.0.pre.4, < 3.0)
153
+ rest-client (1.6.7)
154
+ mime-types (>= 1.16)
155
+ rouge (1.7.3)
156
+ rubocop (0.27.1)
157
+ astrolabe (~> 1.3)
158
+ parser (>= 2.2.0.pre.7, < 3.0)
137
159
  powerpack (~> 0.0.6)
138
160
  rainbow (>= 1.99.1, < 3.0)
139
161
  ruby-progressbar (~> 1.4)
140
- ruby-progressbar (1.5.1)
162
+ ruby-progressbar (1.7.0)
163
+ rubyforge (2.0.4)
164
+ json_pure (>= 1.1.7)
141
165
  rubypants (0.2.0)
142
- safe_yaml (1.0.3)
166
+ safe_yaml (1.0.4)
143
167
  sass (3.2.19)
144
- simplecov (0.9.0)
168
+ simplecov (0.9.1)
145
169
  docile (~> 1.1.0)
146
- multi_json
170
+ multi_json (~> 1.0)
147
171
  simplecov-html (~> 0.8.0)
148
172
  simplecov-html (0.8.0)
149
- slim (2.0.3)
150
- temple (~> 0.6.6)
173
+ slim (2.1.0)
174
+ temple (~> 0.6.9)
151
175
  tilt (>= 1.3.3, < 2.1)
152
176
  slop (3.6.0)
153
- temple (0.6.8)
154
- term-ansicolor (1.3.0)
155
- tins (~> 1.0)
177
+ temple (0.6.10)
178
+ term-ansicolor (1.2.2)
179
+ tins (~> 0.8)
156
180
  therubyracer (0.12.1)
157
181
  libv8 (~> 3.16.14.0)
158
182
  ref
159
- thor (0.19.1)
183
+ thor (0.18.1)
160
184
  tilt (2.0.1)
161
- timers (1.1.0)
162
- tins (1.3.2)
185
+ timers (4.0.1)
186
+ hitimes
187
+ tins (0.13.2)
163
188
  typogruby (1.0.17)
164
189
  rubypants
165
190
  uglifier (2.5.3)
166
191
  execjs (>= 0.3.0)
167
192
  json (>= 1.8.0)
168
- vcr (2.9.2)
193
+ vcr (2.9.3)
169
194
  w3c_validators (1.2)
170
195
  json
171
196
  nokogiri
172
- webmock (1.18.0)
197
+ webmock (1.20.4)
173
198
  addressable (>= 2.3.6)
174
199
  crack (>= 0.3.2)
175
200
  yajl-ruby (1.1.0)
176
- yard (0.8.7.4)
201
+ yard (0.8.7.6)
177
202
  yuicompressor (1.3.3)
178
203
 
179
204
  PLATFORMS
data/NEWS.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # nanoc news
2
2
 
3
+ ## 3.7.4 (2014-11-23)
4
+
5
+ Enhancements:
6
+
7
+ * Made `check` command fail when output directory is missing (#472) [Mike Pennisi]
8
+ * Made external links check timeouts start small and grow (#483) [Michal Papis]
9
+ * Made code and API adhere much more closely to the Ruby style guide (#476)
10
+
11
+ Fixes:
12
+
13
+ * Fixed potential “parent directory is world writable” error (#465, #474)
14
+ * Fixed retrying requests in the external link checker (#483) [Michal Papis]
15
+ * Fixed issue with data sources not being unloaded (#491) [Michal Papis]
16
+
3
17
  ## 3.7.3 (2014-08-31)
4
18
 
5
19
  Fixes:
@@ -15,7 +15,7 @@ module Nanoc
15
15
 
16
16
  # @return [Boolean] True if the current platform is Windows,
17
17
  def self.on_windows?
18
- !!(RUBY_PLATFORM =~ /windows|bccwin|cygwin|djgpp|mingw|mswin|wince/i)
18
+ RUBY_PLATFORM =~ /windows|bccwin|cygwin|djgpp|mingw|mswin|wince/i
19
19
  end
20
20
 
21
21
  end
@@ -19,7 +19,7 @@ module Nanoc
19
19
  digest.base64digest
20
20
  end
21
21
 
22
- private
22
+ private
23
23
 
24
24
  def update(obj, digest)
25
25
  digest.update(obj.class.to_s)
@@ -42,7 +42,7 @@ module Nanoc
42
42
  @checksums = {}
43
43
  end
44
44
 
45
- protected
45
+ protected
46
46
 
47
47
  def data
48
48
  @checksums
@@ -47,7 +47,7 @@ module Nanoc
47
47
  @cache = {}
48
48
  end
49
49
 
50
- protected
50
+ protected
51
51
 
52
52
  def data
53
53
  @cache
@@ -74,7 +74,7 @@ module Nanoc
74
74
  #
75
75
  # @overload run
76
76
  # @return [void]
77
- def run(*args)
77
+ def run(*_args)
78
78
  # Create output directory if necessary
79
79
  FileUtils.mkdir_p(@site.config[:output_dir])
80
80
 
@@ -206,7 +206,7 @@ module Nanoc
206
206
  # @api private
207
207
  def objects
208
208
  site.items + site.layouts + site.code_snippets +
209
- [ site.config, rules_collection ]
209
+ [site.config, rules_collection]
210
210
  end
211
211
 
212
212
  # Creates the representations of all items as defined by the compilation
@@ -250,11 +250,12 @@ module Nanoc
250
250
  # Get normal path by stripping index filename
251
251
  rep.paths[snapshot] = basic_path
252
252
  @site.config[:index_filenames].each do |index_filename|
253
- if rep.paths[snapshot][-index_filename.length..-1] == index_filename
254
- # Strip and stop
255
- rep.paths[snapshot] = rep.paths[snapshot][0..-index_filename.length - 1]
256
- break
257
- end
253
+ rep_path_ending = rep.paths[snapshot][-index_filename.length..-1]
254
+ next unless rep_path_ending == index_filename
255
+
256
+ # Strip and stop
257
+ rep.paths[snapshot] = rep.paths[snapshot][0..-index_filename.length - 1]
258
+ break
258
259
  end
259
260
  end
260
261
  end
@@ -294,7 +295,7 @@ module Nanoc
294
295
  end
295
296
  memoize :outdatedness_checker
296
297
 
297
- private
298
+ private
298
299
 
299
300
  # @return [Array<Nanoc::Item>] The site’s items
300
301
  def items
@@ -324,7 +325,7 @@ module Nanoc
324
325
 
325
326
  # Listen to processing start/stop
326
327
  Nanoc::NotificationCenter.on(:processing_started, self) { |obj| @stack.push(obj) }
327
- Nanoc::NotificationCenter.on(:processing_ended, self) { |obj| @stack.pop }
328
+ Nanoc::NotificationCenter.on(:processing_ended, self) { |_obj| @stack.pop }
328
329
 
329
330
  # Assign snapshots
330
331
  reps.each do |rep|
@@ -350,7 +351,7 @@ module Nanoc
350
351
  end
351
352
 
352
353
  # Check whether everything was compiled
353
- if !content_dependency_graph.vertices.empty?
354
+ unless content_dependency_graph.vertices.empty?
354
355
  raise Nanoc::Errors::RecursiveCompilation.new(content_dependency_graph.vertices)
355
356
  end
356
357
  ensure
@@ -151,7 +151,7 @@ module Nanoc
151
151
  #
152
152
  # layout '/custom/', :haml, :format => :html5
153
153
  def layout(identifier, filter_name, params = {})
154
- @rules_collection.layout_filter_mapping[identifier_to_regex(identifier)] = [ filter_name, params ]
154
+ @rules_collection.layout_filter_mapping[identifier_to_regex(identifier)] = [filter_name, params]
155
155
  end
156
156
 
157
157
  # Creates a pair of compilation and routing rules that indicate that the
@@ -247,13 +247,13 @@ module Nanoc
247
247
  # include_rules 'rules/assets'
248
248
  # include_rules 'rules/content'
249
249
  def include_rules(name)
250
- filename = [ "#{name}", "#{name}.rb", "./#{name}", "./#{name}.rb" ].find { |f| File.file?(f) }
250
+ filename = ["#{name}", "#{name}.rb", "./#{name}", "./#{name}.rb"].find { |f| File.file?(f) }
251
251
  raise Nanoc::Errors::NoRulesFileFound.new if filename.nil?
252
252
 
253
253
  @rules_collection.parse(filename)
254
254
  end
255
255
 
256
- private
256
+ private
257
257
 
258
258
  # Converts the given identifier, which can contain the '*' or '+'
259
259
  # wildcard characters, matching zero or more resp. one or more
@@ -264,7 +264,7 @@ module Nanoc
264
264
  # Add leading/trailing slashes if necessary
265
265
  new_identifier = identifier.dup
266
266
  new_identifier[/^/] = '/' if identifier[0, 1] != '/'
267
- new_identifier[/$/] = '/' unless [ '*', '/' ].include?(identifier[-1, 1])
267
+ new_identifier[/$/] = '/' unless ['*', '/'].include?(identifier[-1, 1])
268
268
 
269
269
  /^#{new_identifier.gsub('*', '(.*?)').gsub('+', '(.+?)')}$/
270
270
  else
@@ -37,7 +37,7 @@ module Nanoc
37
37
  super('tmp/dependencies', 4)
38
38
 
39
39
  @objects = objects
40
- @graph = Nanoc::DirectedGraph.new([ nil ] + @objects)
40
+ @graph = Nanoc::DirectedGraph.new([nil] + @objects)
41
41
  @stack = []
42
42
  end
43
43
 
@@ -53,7 +53,7 @@ module Nanoc
53
53
 
54
54
  # Register start of visits
55
55
  Nanoc::NotificationCenter.on(:visit_started, self) do |obj|
56
- if !@stack.empty?
56
+ unless @stack.empty?
57
57
  Nanoc::NotificationCenter.post(:dependency_created, @stack.last, obj)
58
58
  record_dependency(@stack.last, obj)
59
59
  end
@@ -61,7 +61,7 @@ module Nanoc
61
61
  end
62
62
 
63
63
  # Register end of visits
64
- Nanoc::NotificationCenter.on(:visit_ended, self) do |obj|
64
+ Nanoc::NotificationCenter.on(:visit_ended, self) do |_obj|
65
65
  @stack.pop
66
66
  end
67
67
  end
@@ -71,7 +71,7 @@ module Nanoc
71
71
  # @return [void]
72
72
  def stop
73
73
  # Sanity check
74
- if !@stack.empty?
74
+ unless @stack.empty?
75
75
  raise 'Internal inconsistency: dependency tracker stack not empty at end of compilation'
76
76
  end
77
77
 
@@ -169,10 +169,10 @@ module Nanoc
169
169
 
170
170
  # @see Nanoc::Store#unload
171
171
  def unload
172
- @graph = Nanoc::DirectedGraph.new([ nil ] + @objects)
172
+ @graph = Nanoc::DirectedGraph.new([nil] + @objects)
173
173
  end
174
174
 
175
- protected
175
+ protected
176
176
 
177
177
  def data
178
178
  {
@@ -183,7 +183,7 @@ module Nanoc
183
183
 
184
184
  def data=(new_data)
185
185
  # Create new graph
186
- @graph = Nanoc::DirectedGraph.new([ nil ] + @objects)
186
+ @graph = Nanoc::DirectedGraph.new([nil] + @objects)
187
187
 
188
188
  # Load vertices
189
189
  previous_objects = new_data[:vertices].map do |reference|
@@ -135,7 +135,7 @@ module Nanoc
135
135
  # @return [String, void] If the filter output binary content, the return
136
136
  # value is undefined; if the filter outputs textual content, the return
137
137
  # value will be the filtered content.
138
- def run(content_or_filename, params = {})
138
+ def run(_content_or_filename, _params = {})
139
139
  raise NotImplementedError.new('Nanoc::Filter subclasses must implement #run')
140
140
  end
141
141