nanoc3 3.1.0rc1 → 3.1.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/NEWS.md CHANGED
@@ -1,6 +1,8 @@
1
- # nanoc News
1
+ # nanoc news
2
2
 
3
- ## 3.1
3
+ ## 3.1 (2010-04-03)
4
+
5
+ New:
4
6
 
5
7
  * An `Item#rep_named(name)` function for quickly getting a certain rep
6
8
  * An `Item#compiled_content` function for quickly getting compiled content
@@ -10,7 +12,8 @@
10
12
  * A `debug` command that shows information about the items, reps and layouts
11
13
  * A `kramdown` filter ([kramdown site](http://kramdown.rubyforge.org/))
12
14
  * A diff between the previously compiled content and the last compiled content
13
- is now written to `output.diff`
15
+ is now written to `output.diff` if the `enable_output_diff` site
16
+ configuration attribute is true
14
17
  * Assigns, such as `@items`, `@layouts`, `@item`, … are accessible without `@`
15
18
  * Support for binary items
16
19
 
@@ -32,6 +35,7 @@ Changed:
32
35
  * The `--server` autocompile option is now known as `--handler`
33
36
  * Assigns in filters are now available as instance variables and methods
34
37
  * The `#breadcrumbs_trail` function now allows missing parents
38
+ * The `sass` filter now properly handles `@import` dependencies
35
39
 
36
40
  Deprecated:
37
41
 
@@ -40,30 +44,30 @@ Deprecated:
40
44
  * The `last_fm`, `delicious` and `twitter` data sources; fetch online content
41
45
  into a cache by a rake task and load data from this cache instead
42
46
 
43
- ## 3.0.9
47
+ ## 3.0.9 (2010-02-24)
44
48
 
45
49
  * Fixed 1.8.x parsing bug due to lack of parens which could cause “undefined
46
50
  method `to_iso8601_time` for #<String:0x…>” errors
47
51
 
48
- ## 3.0.8
52
+ ## 3.0.8 (2010-02-24)
49
53
 
50
54
  * `#atom_tag_for` now works with base_urls that contain a path [Eric Sunshine]
51
55
  * Generated root URLs in `#atom_feed` now end with a slash [Eric Sunshine]
52
56
  * Autocompiler now recognises requests to index files
53
57
  * `Blogging` helper now allows created_at to be a Time instance
54
58
 
55
- ## 3.0.7
59
+ ## 3.0.7 (2010-01-29)
56
60
 
57
- * Fixed a bug which could cause layout rules not be matched in order
61
+ * Fixed bug which could cause layout rules not be matched in order
58
62
 
59
- ## 3.0.6
63
+ ## 3.0.6 (2010-01-17)
60
64
 
61
65
  * Error checking in `filesystem_combined` has been improved [Brian Candler]
62
66
  * Generated HTML files now have a default encoding of UTF-8
63
67
  * Periods in identifiers for layouts now behave correctly
64
68
  * The `relativize_paths` filter now correctly handles “/” [Eric Sunshine]
65
69
 
66
- ## 3.0.5
70
+ ## 3.0.5 (2010-01-12)
67
71
 
68
72
  * Restored pre-3.0.3 behaviour of periods in identifiers. By default, a file
69
73
  can have multiple extensions (e.g. `content/foo.html.erb` will have the
@@ -72,13 +76,13 @@ Deprecated:
72
76
  `content/blog/stuff.entry.html` will have the identifier
73
77
  `/blog/stuff.entry/`).
74
78
 
75
- ## 3.0.4
79
+ ## 3.0.4 (2010-01-07)
76
80
 
77
81
  * Fixed a bug which would cause the `filesystem_compact` data source to
78
82
  incorrectly determine the content filename, leading to weird “Expected 1
79
83
  content file but found 3” errors [Eric Sunshine]
80
84
 
81
- ## 3.0.3
85
+ ## 3.0.3 (2010-01-06)
82
86
 
83
87
  * The `Blogging` helper now properly handles item reps without paths
84
88
  * The `relativize_paths` filter now only operates inside tags
@@ -90,14 +94,14 @@ Deprecated:
90
94
  * Required enumerator to make sure `#enum_with_index` always works
91
95
  * `Array#stringify_keys` now properly recurses
92
96
 
93
- ## 3.0.2
97
+ ## 3.0.2 (2009-11-07)
94
98
 
95
99
  * Children-only identifier patterns no longer erroneously also match parent
96
100
  (e.g.` /foo/*/` no longer matches `/foo/`)
97
101
  * The `create_site` command no longer uses those ugly HTML entities
98
102
  * Install message now mentions the IRC channel
99
103
 
100
- ## 3.0.1
104
+ ## 3.0.1 (2009-10-05)
101
105
 
102
106
  * The proper exception is now raised when no matching compilation rules can
103
107
  be found
@@ -107,7 +111,7 @@ Deprecated:
107
111
  * Several outdated URLs are now up-to-date
108
112
  * Error handling has been improved in general
109
113
 
110
- ## 3.0
114
+ ## 3.0 (2009-08-14)
111
115
 
112
116
  New:
113
117
 
@@ -132,7 +136,7 @@ Removed:
132
136
  * `save_*`, `move_*` and `delete_*` methods in data sources
133
137
  * Processing instructions in metadata
134
138
 
135
- ## 2.2.2
139
+ ## 2.2.2 (2009-05-18)
136
140
 
137
141
  * Removed `relativize_paths` filter; use `relativize_paths_in_html` or
138
142
  `relativize_paths_in_css` instead
@@ -141,14 +145,14 @@ Removed:
141
145
  * Fixed bug which would cause nanoc to complain about the open file limit
142
146
  being reached when using a large amount of assets
143
147
 
144
- ## 2.2.1
148
+ ## 2.2.1 (2009-04-08)
145
149
 
146
150
  * Fixed bug which prevented `relative_path_to` from working
147
151
  * Split `relativize_paths` filter into two filter: `relativize_paths_in_html`
148
152
  and `relativize_paths_in_css`
149
153
  * Removed bundled mime-types library
150
154
 
151
- ## 2.2
155
+ ## 2.2 (2009-04-06)
152
156
 
153
157
  New:
154
158
 
@@ -174,7 +178,7 @@ Removed:
174
178
 
175
179
  * deprecated extension-based code
176
180
 
177
- ## 2.1.6
181
+ ## 2.1.6 (2009-02-28)
178
182
 
179
183
  * The `filesystem_combined` data source now supports empty metadata sections
180
184
  * The `rdoc` filter now works for both RDoc 1.x and 2.x
@@ -184,34 +188,34 @@ Removed:
184
188
  end with a slash
185
189
  * The autocompiler now always serves asset content correctly
186
190
 
187
- ## 2.1.5
191
+ ## 2.1.5 (2009-02-01)
188
192
 
189
193
  * Added Ruby 1.9 compatibility
190
194
  * The `filesystem` and `filesystem_combined` data sources now preserve custom
191
195
  extensions
192
196
 
193
- ## 2.1.4
197
+ ## 2.1.4 (2008-11-15)
194
198
 
195
199
  * Fixed an issue where the autocompiler in Windows would serve broken assets
196
200
 
197
- ## 2.1.3
201
+ ## 2.1.3 (2008-09-27)
198
202
 
199
203
  * The `haml` and `sass` filters now correctly take their options from assets
200
204
  * The autocompiler now serves index files instead of 404s
201
205
  * Layouts named “index” are now handled correctly
202
206
  * The `filesystem_combined` data source now properly handles assets
203
207
 
204
- ## 2.1.2
208
+ ## 2.1.2 (2008-09-08)
205
209
 
206
210
  * The utocompiler now compiles assets as well
207
211
  * The `sass` filter now takes options (just like the `haml` filter)
208
212
  * Haml/Sass options are now taken from the page *rep* instead of the page
209
213
 
210
- ## 2.1.1
214
+ ## 2.1.1 (2008-08-18)
211
215
 
212
216
  * Fixed issue which would cause files not to be required in the right order
213
217
 
214
- ## 2.1
218
+ ## 2.1 (2008-08-17)
215
219
 
216
220
  This is only a short summary of all changes in 2.1. For details, see the
217
221
  [nanoc web site](http://nanoc.stoneship.org/). Especially the blog and the
@@ -242,27 +246,27 @@ Removed:
242
246
  * `markdown`: use `bluecloth`, `rdiscount` or `maruku` instead
243
247
  * `textile`: use `redcloth` instead
244
248
 
245
- ## 2.0.4
249
+ ## 2.0.4 (2008-05-04)
246
250
 
247
251
  * Fixed `default.rb`’s `#html_escape`
248
252
  * Updated Haml filter and layout processor so that @page, @pages and @config
249
253
  are now available as instance variables instead of local variables
250
254
 
251
- ## 2.0.3
255
+ ## 2.0.3 (2008-03-25)
252
256
 
253
257
  * The autocompiler now honors custom paths
254
258
  * The autocompiler now attempts to serve pages with the most appropriate MIME
255
259
  type, instead of always serving everything as `text/html`
256
260
 
257
- ## 2.0.2
261
+ ## 2.0.2 (2008-01-26)
258
262
 
259
263
  * nanoc now requires Ruby 1.8.5 instead of 1.8.6
260
264
 
261
- ## 2.0.1
265
+ ## 2.0.1 (2008-01-21)
262
266
 
263
267
  * Fixed a “too many open files” error that could appear during (auto)compiling
264
268
 
265
- ## 2.0
269
+ ## 2.0 (2007-12-25)
266
270
 
267
271
  New:
268
272
 
@@ -283,15 +287,15 @@ Removed:
283
287
  * The `filters` property; use `filters_pre` instead
284
288
  * Support for Liquid
285
289
 
286
- ## 1.6.2
290
+ ## 1.6.2 (2007-10-23)
287
291
 
288
292
  * Fixed an issue which prevented the content capturing plugin from working
289
293
 
290
- ## 1.6.1
294
+ ## 1.6.1 (2007-10-14)
291
295
 
292
296
  * Removed a stray debug message
293
297
 
294
- ## 1.6
298
+ ## 1.6 (2007-10-13)
295
299
 
296
300
  * Added support for post-layout filters
297
301
  * Added support for getting a File object for the page, so you can now e.g.
@@ -299,14 +303,14 @@ Removed:
299
303
  * Cleaned up the source code a lot
300
304
  * Removed deprecated asset-copying functionality
301
305
 
302
- ## 1.5
306
+ ## 1.5 (2007-09-10)
303
307
 
304
308
  * Added support for custom filters
305
309
  * Improved Liquid support -- Liquid is now a first-class nanoc citizen
306
310
  * Deprecated assets -- use something like rsync instead
307
311
  * Added `eruby_engine` option, which can be `erb` or `erubis`
308
312
 
309
- ## 1.4
313
+ ## 1.4 (2007-07-06)
310
314
 
311
315
  * nanoc now supports ERB (as well as Erubis); Erubis no longer is a dependency
312
316
  * `meta.yaml` can now have `haml_options` property, which is passed to Haml
@@ -315,12 +319,12 @@ Removed:
315
319
  * Pages now know in what order they should be compiled, eliminating the need
316
320
  for custom page ordering [Dennis Sutch]
317
321
 
318
- ## 1.3.1
322
+ ## 1.3.1 (2007-06-30)
319
323
 
320
324
  * The contents of the `assets` directory are now copied into the output
321
325
  directory specified in `config.yaml`
322
326
 
323
- ## 1.3
327
+ ## 1.3 (2007-06-24)
324
328
 
325
329
  * The `@pages` array now also contains uncompiled pages
326
330
  * Pages with `skip_output` set to true will not be outputted
@@ -330,11 +334,11 @@ Removed:
330
334
  * nanoc now warns before overwriting in `create_site`, `create_page` and
331
335
  `create_template` (but not in compile)
332
336
 
333
- ## 1.2
337
+ ## 1.2 (2007-06-05)
334
338
 
335
339
  * Sites now have an `assets` directory, whose contents are copied to the
336
340
  `output` directory when compiling [Soryu]
337
- * Added support for non-eRuby layouts (Markaby, Haml, Liquid, ...)
341
+ * Added support for non-eRuby layouts (Markaby, Haml, Liquid, )
338
342
  * Added more filters (Markaby, Haml, Liquid, RDoc [Dmitry Bilunov])
339
343
  * Improved error reporting
340
344
  * Accessing page attributes using instance variables, and not through `@page`,
@@ -342,16 +346,16 @@ Removed:
342
346
  * Page attributes can now be accessed using dot notation, i.e. `@page.title`
343
347
  as well as `@page[:title]`
344
348
 
345
- ## 1.1.3
349
+ ## 1.1.3 (2007-05-18)
346
350
 
347
351
  * Fixed bug which would cause layoutless pages to be outputted incorrectly
348
352
 
349
- ## 1.1.2
353
+ ## 1.1.2 (2007-05-17)
350
354
 
351
355
  * Backup files (files ending with a “~”) are now ignored
352
356
  * Fixed bug which would cause subpages not to be generated correctly
353
357
 
354
- ## 1.1
358
+ ## 1.1 (2007-05-08)
355
359
 
356
360
  * Added support for nested layouts
357
361
  * Added coloured logging
@@ -360,12 +364,12 @@ Removed:
360
364
  directory they are in [Colin Barrett]
361
365
  * It is now possible to access `@page` in the page’s content file
362
366
 
363
- ## 1.0.1
367
+ ## 1.0.1 (2007-05-05)
364
368
 
365
369
  * Fixed a bug which would cause a “no such template” error to be displayed
366
370
  when the template existed but compiling it would raise an exception
367
371
  * Fixed bug which would cause pages not to be sorted by order before compiling
368
372
 
369
- ## 1.0
373
+ ## 1.0 (2007-05-03)
370
374
 
371
375
  * Initial release
@@ -3,7 +3,7 @@
3
3
  module Nanoc3
4
4
 
5
5
  # The current nanoc version.
6
- VERSION = '3.1.0rc1'
6
+ VERSION = '3.1.0'
7
7
 
8
8
  end
9
9
 
@@ -59,7 +59,6 @@ module Nanoc3
59
59
 
60
60
  # Load dependencies
61
61
  dependency_tracker.load_graph
62
- dependency_tracker.print_graph if $DEBUG
63
62
 
64
63
  # Get items and reps to compile
65
64
  if item
@@ -176,10 +175,15 @@ module Nanoc3
176
175
  end
177
176
 
178
177
  # Retry
179
- puts "*** No active reps left; activating all (#{inactive_reps.size}) inactive reps" if $DEBUG
180
- puts if $DEBUG
181
- active_reps = inactive_reps
182
- inactive_reps = []
178
+ if inactive_reps.empty?
179
+ puts "*** Nothing left to compile!" if $DEBUG
180
+ break
181
+ else
182
+ puts "*** No active reps left; activating all (#{inactive_reps.size}) inactive reps" if $DEBUG
183
+ puts if $DEBUG
184
+ active_reps = inactive_reps
185
+ inactive_reps = []
186
+ end
183
187
  end
184
188
 
185
189
  # Notify skipped reps
@@ -57,11 +57,9 @@ module Nanoc3
57
57
 
58
58
  # Register start of visits
59
59
  Nanoc3::NotificationCenter.on(:visit_started, self) do |item|
60
- $stderr.puts "*** IN stack.size=#{@stack.size} item=#{item.inspect}" if $DEBUG
61
-
62
60
  # Record possible dependency
63
61
  unless @stack.empty?
64
- $stderr.puts "*** Recording dependency #{@stack[-1].inspect} -> #{item.inspect}" if $DEBUG
62
+ $stderr.puts "*** Recording dependency on #{item.inspect}" if $DEBUG
65
63
  self.record_dependency(@stack[-1], item)
66
64
  end
67
65
 
@@ -70,8 +68,6 @@ module Nanoc3
70
68
 
71
69
  # Register end of visits
72
70
  Nanoc3::NotificationCenter.on(:visit_ended, self) do |item|
73
- $stderr.puts "*** OUT stack.size=#{@stack.size} item=#{item.inspect}" if $DEBUG
74
-
75
71
  @stack.pop
76
72
  end
77
73
  end
@@ -133,7 +133,7 @@ module Nanoc3
133
133
  # compiled
134
134
  def initialize(rep)
135
135
  @rep = rep
136
- super("The “#{rep.item.identifier}” item (rep “#{rep.name}”) cannot currently be compiled yet due to an unmet dependency.".make_compatible_with_env)
136
+ super("The current item cannot be compiled yet because of an unmet dependency on the “#{rep.item.identifier}” item (rep “#{rep.name}”).".make_compatible_with_env)
137
137
  end
138
138
 
139
139
  end
@@ -66,13 +66,13 @@ module Nanoc3
66
66
  end
67
67
 
68
68
  # @return [Boolean] True if this filter can be applied to binary item
69
- # representations, false otherwise
69
+ # representations, false otherwise
70
70
  def from_binary?
71
71
  (@from || :text) == :binary
72
72
  end
73
73
 
74
74
  # @return [Boolean] True if this filter results in a binary item
75
- # representation, false otherwise
75
+ # representation, false otherwise
76
76
  def to_binary?
77
77
  (@to || :text) == :binary
78
78
  end
@@ -82,7 +82,7 @@ module Nanoc3
82
82
  # Creates a new filter that has access to the given assigns.
83
83
  #
84
84
  # @param [Hash] hash A hash containing variables that should be made
85
- # available during filtering.
85
+ # available during filtering.
86
86
  def initialize(hash={})
87
87
  @assigns = hash
88
88
  super
@@ -93,22 +93,22 @@ module Nanoc3
93
93
  # @abstract
94
94
  #
95
95
  # @param [String] content_or_filename The unprocessed content that should
96
- # be filtered (if the item is a textual item) or the path to the file that
97
- # should be fitlered (if the item is a binary item)
96
+ # be filtered (if the item is a textual item) or the path to the file
97
+ # that should be filtered (if the item is a binary item)
98
98
  #
99
99
  # @param [Hash] params A hash containing parameters. Filter subclasses can
100
- # use these parameters to allow modifying the filter's behaviour.
100
+ # use these parameters to allow modifying the filter's behaviour.
101
101
  #
102
- # @return [String] The filtered content (if the item is a textual item) or
103
- # a path to a newly generated file containing the filtered content (if the
104
- # item is a binary item)
102
+ # @return [String, void] If the filter output binary content, the return
103
+ # value is undefined; if the filter outputs textual content, the return
104
+ # value will be the filtered content.
105
105
  def run(content_or_filename, params={})
106
106
  raise NotImplementedError.new("Nanoc3::Filter subclasses must implement #run")
107
107
  end
108
108
 
109
109
  # Returns a filename that is used to write data to. This method is only
110
- # used on binary items. When running a binary filter on a file, the
111
- # resulting file must end up in the location returned by this method.
110
+ # used on binary items. When running a binary filter on a file, the
111
+ # resulting file must end up in the location returned by this method.
112
112
  #
113
113
  # @return [String] The output filename
114
114
  def output_filename
@@ -125,7 +125,7 @@ module Nanoc3
125
125
  end
126
126
 
127
127
  # Returns the filename associated with the item that is being filtered.
128
- # It is in the format `item <identifier> (rep <name>)`.
128
+ # It is in the format `item <identifier> (rep <name>)`.
129
129
  #
130
130
  # @return [String] The filename
131
131
  def filename
@@ -396,8 +396,6 @@ module Nanoc3
396
396
  # content in `diff(1)` format, or nil if there is no previous compiled
397
397
  # content
398
398
  def diff
399
- return nil if !@item.site.config[:enable_output_diff]
400
-
401
399
  if self.binary?
402
400
  nil
403
401
  else
@@ -439,7 +437,7 @@ module Nanoc3
439
437
  end
440
438
 
441
439
  def generate_diff
442
- if @old_content.nil? or self.raw_path.nil?
440
+ if @old_content.nil? || self.raw_path.nil? || !@item.site.config[:enable_output_diff]
443
441
  @diff = nil
444
442
  else
445
443
  @diff_thread = Thread.new do
@@ -128,6 +128,13 @@ module Nanoc3::CLI::Commands
128
128
  end
129
129
 
130
130
  def write_diff_for(reps)
131
+ # Delete diff
132
+ FileUtils.rm('output.diff') if File.file?('output.diff')
133
+
134
+ # Don’t generate diffs when diffs are disabled
135
+ return if !@base.site.config[:enable_output_diff]
136
+
137
+ # Generate diff
131
138
  full_diff = ''
132
139
  reps.each do |rep|
133
140
  diff = rep.diff
@@ -82,7 +82,7 @@ module Nanoc3::DataSources
82
82
 
83
83
  # Read content and metadata
84
84
  is_binary = !!(content_filename && !@site.config[:text_extensions].include?(File.extname(content_filename)[1..-1]))
85
- if is_binary
85
+ if is_binary && klass == Nanoc3::Item
86
86
  meta = (meta_filename && YAML.load_file(meta_filename)) || {}
87
87
  content_or_filename = content_filename
88
88
  else
@@ -54,10 +54,15 @@ module Nanoc3::Filters
54
54
  imported_items = imported_filenames.map do |filename|
55
55
  normalized_filename = Pathname.new(filename).realpath
56
56
  @items.find { |i| Pathname.new(i[:filename]).realpath == normalized_filename }
57
- end
57
+ end.compact
58
58
 
59
59
  # Require compilation of each item
60
60
  imported_items.each do |item|
61
+ # Notify
62
+ Nanoc3::NotificationCenter.post(:visit_started, item)
63
+ Nanoc3::NotificationCenter.post(:visit_ended, item)
64
+
65
+ # Raise unmet dependency error if item is not yet compiled
61
66
  any_uncompiled_rep = item.reps.find { |r| !r.compiled? }
62
67
  raise Nanoc3::Errors::UnmetDependency.new(any_uncompiled_rep) if any_uncompiled_rep
63
68
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc3
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: true
4
+ prerelease: false
5
5
  segments:
6
6
  - 3
7
7
  - 1
8
- - 0rc1
9
- version: 3.1.0rc1
8
+ - 0
9
+ version: 3.1.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Denis Defreyne
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-27 00:00:00 +01:00
17
+ date: 2010-04-03 00:00:00 +02:00
18
18
  default_executable: nanoc3
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -179,13 +179,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
179
  version: "0"
180
180
  required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  requirements:
182
- - - ">"
182
+ - - ">="
183
183
  - !ruby/object:Gem::Version
184
184
  segments:
185
- - 1
186
- - 3
187
- - 1
188
- version: 1.3.1
185
+ - 0
186
+ version: "0"
189
187
  requirements: []
190
188
 
191
189
  rubyforge_project: