nanoc 3.6.1 → 3.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile.lock +4 -4
  3. data/LICENSE +1 -1
  4. data/NEWS.md +17 -0
  5. data/lib/nanoc.rb +1 -1
  6. data/lib/nanoc/base/result_data/item_rep.rb +20 -12
  7. data/lib/nanoc/base/source_data/item_array.rb +1 -1
  8. data/lib/nanoc/cli/commands/check.rb +1 -1
  9. data/lib/nanoc/cli/commands/deploy.rb +32 -23
  10. data/lib/nanoc/cli/commands/prune.rb +2 -2
  11. data/lib/nanoc/cli/commands/validate-css.rb +1 -0
  12. data/lib/nanoc/cli/commands/validate-html.rb +1 -0
  13. data/lib/nanoc/cli/commands/validate-links.rb +2 -0
  14. data/lib/nanoc/cli/commands/watch.rb +1 -1
  15. data/lib/nanoc/extra/checking/checks/external_links.rb +5 -2
  16. data/lib/nanoc/extra/checking/runner.rb +9 -4
  17. data/lib/nanoc/filters/rdoc.rb +9 -2
  18. data/lib/nanoc/helpers/breadcrumbs.rb +10 -15
  19. data/nanoc.gemspec +3 -2
  20. data/test/base/test_checksum_store.rb +1 -3
  21. data/test/base/test_code_snippet.rb +1 -3
  22. data/test/base/test_compiler.rb +24 -3
  23. data/test/base/test_compiler_dsl.rb +1 -3
  24. data/test/base/test_context.rb +1 -3
  25. data/test/base/test_data_source.rb +1 -3
  26. data/test/base/test_dependency_tracker.rb +1 -3
  27. data/test/base/test_directed_graph.rb +1 -3
  28. data/test/base/test_filter.rb +1 -3
  29. data/test/base/test_item.rb +1 -3
  30. data/test/base/test_item_array.rb +1 -3
  31. data/test/base/test_item_rep.rb +1 -3
  32. data/test/base/test_layout.rb +1 -3
  33. data/test/base/test_memoization.rb +1 -3
  34. data/test/base/test_notification_center.rb +1 -3
  35. data/test/base/test_outdatedness_checker.rb +1 -3
  36. data/test/base/test_plugin.rb +1 -3
  37. data/test/base/test_rule.rb +1 -3
  38. data/test/base/test_rule_context.rb +1 -3
  39. data/test/base/test_site.rb +1 -3
  40. data/test/cli/commands/test_check.rb +1 -3
  41. data/test/cli/commands/test_compile.rb +1 -3
  42. data/test/cli/commands/test_create_item.rb +1 -3
  43. data/test/cli/commands/test_create_layout.rb +1 -3
  44. data/test/cli/commands/test_create_site.rb +1 -3
  45. data/test/cli/commands/test_deploy.rb +45 -4
  46. data/test/cli/commands/test_help.rb +1 -3
  47. data/test/cli/commands/test_info.rb +1 -3
  48. data/test/cli/commands/test_prune.rb +1 -3
  49. data/test/cli/commands/test_sync.rb +1 -3
  50. data/test/cli/commands/test_update.rb +1 -3
  51. data/test/cli/commands/test_watch.rb +1 -3
  52. data/test/cli/test_cleaning_stream.rb +1 -3
  53. data/test/cli/test_cli.rb +1 -3
  54. data/test/cli/test_error_handler.rb +1 -3
  55. data/test/cli/test_logger.rb +1 -3
  56. data/test/data_sources/test_filesystem.rb +1 -3
  57. data/test/data_sources/test_filesystem_unified.rb +1 -3
  58. data/test/data_sources/test_filesystem_verbose.rb +1 -3
  59. data/test/data_sources/test_static.rb +1 -3
  60. data/test/extra/checking/checks/test_css.rb +1 -3
  61. data/test/extra/checking/checks/test_external_links.rb +20 -43
  62. data/test/extra/checking/checks/test_html.rb +1 -3
  63. data/test/extra/checking/checks/test_internal_links.rb +1 -3
  64. data/test/extra/checking/checks/test_stale.rb +1 -3
  65. data/test/extra/checking/test_check.rb +1 -3
  66. data/test/extra/checking/test_dsl.rb +1 -3
  67. data/test/extra/checking/test_runner.rb +1 -3
  68. data/test/extra/core_ext/test_enumerable.rb +1 -3
  69. data/test/extra/core_ext/test_pathname.rb +1 -3
  70. data/test/extra/core_ext/test_time.rb +1 -3
  71. data/test/extra/deployers/test_fog.rb +1 -3
  72. data/test/extra/deployers/test_rsync.rb +1 -3
  73. data/test/extra/test_auto_compiler.rb +1 -3
  74. data/test/extra/test_file_proxy.rb +1 -3
  75. data/test/extra/test_link_collector.rb +1 -3
  76. data/test/extra/test_vcs.rb +1 -3
  77. data/test/extra/validators/test_links.rb +1 -3
  78. data/test/extra/validators/test_w3c.rb +1 -3
  79. data/test/filters/test_asciidoc.rb +1 -3
  80. data/test/filters/test_bluecloth.rb +1 -3
  81. data/test/filters/test_coderay.rb +1 -3
  82. data/test/filters/test_coffeescript.rb +1 -3
  83. data/test/filters/test_colorize_syntax.rb +3 -16
  84. data/test/filters/test_erb.rb +1 -3
  85. data/test/filters/test_erubis.rb +1 -3
  86. data/test/filters/test_haml.rb +1 -3
  87. data/test/filters/test_handlebars.rb +1 -3
  88. data/test/filters/test_kramdown.rb +1 -3
  89. data/test/filters/test_less.rb +1 -3
  90. data/test/filters/test_markaby.rb +1 -3
  91. data/test/filters/test_maruku.rb +1 -3
  92. data/test/filters/test_mustache.rb +1 -3
  93. data/test/filters/test_pandoc.rb +1 -3
  94. data/test/filters/test_rainpress.rb +1 -3
  95. data/test/filters/test_rdiscount.rb +1 -3
  96. data/test/filters/test_rdoc.rb +6 -10
  97. data/test/filters/test_redcarpet.rb +1 -3
  98. data/test/filters/test_redcloth.rb +1 -3
  99. data/test/filters/test_relativize_paths.rb +2 -9
  100. data/test/filters/test_rubypants.rb +1 -3
  101. data/test/filters/test_sass.rb +1 -3
  102. data/test/filters/test_slim.rb +1 -3
  103. data/test/filters/test_typogruby.rb +1 -3
  104. data/test/filters/test_uglify_js.rb +1 -3
  105. data/test/filters/test_xsl.rb +1 -3
  106. data/test/filters/test_yui_compressor.rb +1 -3
  107. data/test/helper.rb +6 -0
  108. data/test/helpers/test_blogging.rb +1 -3
  109. data/test/helpers/test_breadcrumbs.rb +21 -59
  110. data/test/helpers/test_capturing.rb +1 -3
  111. data/test/helpers/test_filtering.rb +1 -3
  112. data/test/helpers/test_html_escape.rb +1 -3
  113. data/test/helpers/test_link_to.rb +1 -3
  114. data/test/helpers/test_rendering.rb +1 -3
  115. data/test/helpers/test_tagging.rb +1 -3
  116. data/test/helpers/test_text.rb +1 -3
  117. data/test/helpers/test_xml_sitemap.rb +1 -3
  118. data/test/tasks/test_clean.rb +1 -3
  119. data/test/test_gem.rb +1 -3
  120. metadata +7 -20
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzAwNTU0YThiMWVmNzIyNDQyY2VkMDVmNTAxY2U3NGI3NDFlODE4Yg==
5
+ data.tar.gz: !binary |-
6
+ ODNmZjI4ZjM2YzBhMGVhMTMyYWViMDM3OGI4NGQ5ZTI2ZjUwNzNmMw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YmRkMzY0ZGE4YzY5ZmU2ODdhMTZmYTFiNjQ2MTQ2MWI3MzQ4MGNiOTZkZDhh
10
+ OTIzYTRiYWIwMjYzNTE3NmI0MzFiYzdlNmRlZTljOWMyNWE2NjQ4ZDA2YzNh
11
+ NWExYzkzNDcwNTk1OTM2YmU0ZTQ2NDY0OWU5YmE0NmUwNGM2NGU=
12
+ data.tar.gz: !binary |-
13
+ ZTRiYTAzYTA2OWZjZjNkYTlmMTY4ZGQxZmM2NzNlMGVmYWU3N2M3MGUxZDE5
14
+ YmNkYmUyMDE4MmY4NWU1MmJhYWU3MTUyOWM2MzJhMmNjMjNlYTlmOGNiNGU3
15
+ YjBmOGUxZDg5YjkyYzNmYjQxNTA1YmIwYmNmMWIwMmJiNGFkZjA=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nanoc (3.6.1)
4
+ nanoc (3.6.2)
5
5
  cri (~> 2.3)
6
6
 
7
7
  GEM
@@ -75,7 +75,7 @@ GEM
75
75
  rack (1.5.2)
76
76
  rainpress (1.0)
77
77
  rake (10.0.3)
78
- rdiscount (2.0.7)
78
+ rdiscount (2.0.7.1)
79
79
  rdoc (4.0.0)
80
80
  json (~> 1.4)
81
81
  redcarpet (2.2.2)
@@ -90,7 +90,7 @@ GEM
90
90
  syntax (1.0.0)
91
91
  systemu (2.5.2)
92
92
  temple (0.5.5)
93
- therubyracer (0.11.3)
93
+ therubyracer (0.11.4)
94
94
  libv8 (~> 3.11.8.12)
95
95
  ref
96
96
  tilt (1.3.3)
@@ -103,7 +103,7 @@ GEM
103
103
  json
104
104
  nokogiri
105
105
  yajl-ruby (1.1.0)
106
- yard (0.8.5)
106
+ yard (0.8.5.2)
107
107
  yuicompressor (1.2.0)
108
108
 
109
109
  PLATFORMS
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007-2012 Denis Defreyne and contributors
1
+ Copyright (c) 2007-2013 Denis Defreyne and contributors
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/NEWS.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # nanoc news
2
2
 
3
+ ## 3.6.2 (2013-03-23)
4
+
5
+ Fixes:
6
+
7
+ * Removed the list of available deployers from the `deploy` help text and moved
8
+ them into a new `--list-deployers` option [Damien Pollet]
9
+ * Fixed warning about `__send__ `and `object_id` being redefined on Ruby
10
+ 1.8.x [Justin Hileman]
11
+
12
+ Enhancements:
13
+
14
+ * Added possible alternative names for the `Checks` file for consistency with
15
+ the `Rules` file: `Checks.rb`, `checks`, `checks.rb` [Damien Pollet]
16
+ * Made sure unchanged files never have their mtime updated [Justin Hileman]
17
+ * Made link checker retry 405 Method Not Allowed results with GET instead of
18
+ HEAD [Daniel Hofstetter]
19
+
3
20
  ## 3.6.1 (2013-02-25)
4
21
 
5
22
  Fixes:
@@ -3,7 +3,7 @@
3
3
  module Nanoc
4
4
 
5
5
  # The current nanoc version.
6
- VERSION = '3.6.1'
6
+ VERSION = '3.6.2'
7
7
 
8
8
  # @return [String] A string containing information about this nanoc version
9
9
  # and its environment (Ruby engine and version, Rubygems version if any).
@@ -133,25 +133,33 @@ module Nanoc
133
133
  Nanoc::NotificationCenter.post(:will_write_rep, self, snapshot)
134
134
 
135
135
  if self.binary?
136
- # Check whether content was modified
137
- is_modified = !File.file?(raw_path) || !FileUtils.identical?(raw_path, temporary_filenames[:last])
138
-
139
- # Always copy (time spent checking modification is not useful)
140
- FileUtils.cp(temporary_filenames[:last], raw_path)
136
+ temp_path = temporary_filenames[:last]
141
137
  else
142
- # Check whether content was modified
143
- is_modified = (!File.file?(raw_path) || File.read(raw_path) != @content[:last])
144
-
145
- # Write
146
- if is_modified
147
- File.open(raw_path, 'w') { |io| io.write(@content[:last]) }
148
- end
138
+ temp_path = self.temp_filename
139
+ File.open(temp_path, 'w') { |io| io.write(@content[:last]) }
149
140
  end
150
141
 
142
+ # Check whether content was modified
143
+ is_modified = is_created || !FileUtils.identical?(raw_path, temp_path)
144
+
145
+ # Write
146
+ FileUtils.cp(temp_path, raw_path) if is_modified
147
+
151
148
  # Notify
152
149
  Nanoc::NotificationCenter.post(:rep_written, self, raw_path, is_created, is_modified)
153
150
  end
154
151
 
152
+ TMP_TEXT_ITEMS_DIR = 'tmp/text_items'
153
+
154
+ def temp_filename
155
+ FileUtils.mkdir_p(TMP_TEXT_ITEMS_DIR)
156
+ tempfile = Tempfile.new('', TMP_TEXT_ITEMS_DIR)
157
+ new_filename = tempfile.path
158
+ tempfile.close!
159
+
160
+ File.expand_path(new_filename)
161
+ end
162
+
155
163
  # Resets the compilation progress for this item representation. This is
156
164
  # necessary when an unmet dependency is detected during compilation.
157
165
  #
@@ -18,7 +18,7 @@ module Nanoc
18
18
  :instance_eval, :instance_exec, :__send__, :__id__
19
19
  ]
20
20
 
21
- DELEGATED_METHODS = Array.instance_methods + Enumerable.instance_methods - EXCLUDED_METHODS
21
+ DELEGATED_METHODS = (Array.instance_methods + Enumerable.instance_methods).map { |m| m.to_sym } - EXCLUDED_METHODS
22
22
  def_delegators :@items, *DELEGATED_METHODS
23
23
 
24
24
  def initialize
@@ -3,7 +3,7 @@
3
3
  usage 'check [options] [names]'
4
4
  summary 'run issue checks'
5
5
  description <<-EOS
6
- Run issue checks on the current site. If the `--all` option is passed, all available issue checks will be run. If the `--deploy` option is passed, the issue checks marked for deployment will be fun.
6
+ Run issue checks on the current site. If the `--all` option is passed, all available issue checks will be run. If the `--deploy` option is passed, the issue checks marked for deployment will be run.
7
7
  EOS
8
8
 
9
9
  flag :a, :all, 'run all checks'
@@ -1,50 +1,59 @@
1
1
  # encoding: utf-8
2
2
 
3
- # Find all
4
- registry = Nanoc::PluginRegistry.instance
5
- deployer_class = Nanoc::Extra::Deployer
6
- deployers = registry.find_all(deployer_class)
7
- deployer_names = deployers.keys.sort_by { |k| k.to_s }
8
-
9
3
  usage 'deploy [options]'
10
4
  summary 'deploy the compiled site'
11
5
  description <<-EOS
12
6
  Deploys the compiled site. The compiled site contents in the output directory will be uploaded to the destination, which is specified using the `--target` option.
13
-
14
- Available deployers: #{deployer_names.join(', ')}
15
-
16
7
  EOS
17
8
 
18
- option :t, :target, 'specify the location to deploy to (default: `default`)', :argument => :required
19
- flag :C, :'no-check', 'do not run the issue checks marked for deployment'
20
- flag :L, :list, 'list available locations to deploy to'
21
- option :n, :'dry-run', 'show what would be deployed'
9
+ option :t, :target, 'specify the location to deploy to (default: `default`)', :argument => :required
10
+ flag :C, :'no-check', 'do not run the issue checks marked for deployment'
11
+ flag :L, :list, 'list available locations to deploy to'
12
+ flag :D, :'list-deployers', 'list available deployers'
13
+ option :n, :'dry-run', 'show what would be deployed'
22
14
 
23
15
  module Nanoc::CLI::Commands
24
16
 
25
17
  class Deploy < ::Nanoc::CLI::CommandRunner
26
18
 
27
19
  def run
28
- require_site
29
-
30
- # Get config
31
- deploy_configs = site.config.fetch(:deploy) do
32
- raise Nanoc::Errors::GenericTrivial, "The site configuration has no deploy configuration."
20
+ self.load_site
21
+
22
+ # List deployers
23
+ if options[:'list-deployers']
24
+ deployers = Nanoc::PluginRegistry.instance.find_all(Nanoc::Extra::Deployer)
25
+ deployer_names = deployers.keys.sort_by { |k| k.to_s }
26
+ puts "Available deployers:"
27
+ deployer_names.each do |name|
28
+ puts " #{name}"
29
+ end
30
+ return
33
31
  end
34
32
 
35
- # List
33
+ # Get & list configs
34
+ deploy_configs = site.config.fetch(:deploy, {})
35
+
36
36
  if options[:list]
37
- puts "Available deployment configurations:"
38
- deploy_configs.keys.each do |name|
39
- puts " #{name}"
37
+ if deploy_configs.empty?
38
+ puts "No deployment configurations."
39
+ else
40
+ puts "Available deployment configurations:"
41
+ deploy_configs.keys.each do |name|
42
+ puts " #{name}"
43
+ end
40
44
  end
41
45
  return
42
46
  end
43
47
 
48
+ # Can't proceed further without a deploy config
49
+ if deploy_configs.empty?
50
+ raise Nanoc::Errors::GenericTrivial, "The site has no deployment configurations."
51
+ end
52
+
44
53
  # Get target
45
54
  target = options.fetch(:target, :default).to_sym
46
55
  config = deploy_configs.fetch(target) do
47
- raise Nanoc::Errors::GenericTrivial, "The site configuration has no deploy configuration for #{target}."
56
+ raise Nanoc::Errors::GenericTrivial, "The site has no deployment configuration for #{target}."
48
57
  end
49
58
 
50
59
  # Get deployer
@@ -7,8 +7,8 @@ Find all files in the output directory that do not correspond to an item
7
7
  managed by nanoc and remove them. Since this is a hazardous operation, an
8
8
  additional `--yes` flag is needed as confirmation.
9
9
 
10
- Also see the `auto_prune` site configuration option in `config.yamlz, which
11
- will automatically prune after compilation.
10
+ Also see the `auto_prune` configuration option in `nanoc.yaml` (`config.yaml`
11
+ for older nanoc sites), which will automatically prune after compilation.
12
12
  EOS
13
13
 
14
14
  flag :y, :yes, 'confirm deletion'
@@ -13,6 +13,7 @@ module Nanoc::CLI::Commands
13
13
  class ValidateCSS < ::Nanoc::CLI::CommandRunner
14
14
 
15
15
  def run
16
+ warn "The `validate-css` command is deprecated. Please use the new `check` command instead."
16
17
  Nanoc::CLI.run %w( check css )
17
18
  end
18
19
 
@@ -13,6 +13,7 @@ module Nanoc::CLI::Commands
13
13
  class ValidateHTML < ::Nanoc::CLI::CommandRunner
14
14
 
15
15
  def run
16
+ warn "The `validate-html` command is deprecated. Please use the new `check` command instead."
16
17
  Nanoc::CLI.run %w( check html )
17
18
  end
18
19
 
@@ -16,6 +16,8 @@ module Nanoc::CLI::Commands
16
16
  class ValidateLinks < ::Nanoc::CLI::CommandRunner
17
17
 
18
18
  def run
19
+ warn "The `validate-links` command is deprecated. Please use the new `check` command instead."
20
+
19
21
  checks = []
20
22
  checks << 'ilinks' if options[:internal]
21
23
  checks << 'elinks' if options[:external]
@@ -67,7 +67,7 @@ module Nanoc::CLI::Commands
67
67
 
68
68
  # Get directories to watch
69
69
  dirs_to_watch = watcher_config[:dirs_to_watch] || ['content', 'layouts', 'lib']
70
- files_to_watch = watcher_config[:files_to_watch] || ['config.yaml', 'Rules', 'rules', 'Rules.rb', 'rules.rb']
70
+ files_to_watch = watcher_config[:files_to_watch] || ['nanoc.yaml', 'config.yaml', 'Rules', 'rules', 'Rules.rb', 'rules.rb']
71
71
  files_to_watch = Regexp.new(files_to_watch.map { |name| "#{Regexp.quote(name)}$"}.join("|"))
72
72
  ignore_dir = Regexp.new(Dir.glob("*").map{|dir| dir if File::ftype(dir) == "directory" }.compact.join("|"))
73
73
 
@@ -103,6 +103,9 @@ module ::Nanoc::Extra::Checking::Checks
103
103
  begin
104
104
  Timeout::timeout(10) do
105
105
  res = request_url_once(url)
106
+ if res.code == '405'
107
+ res = request_url_once(url, Net::HTTP::Get)
108
+ end
106
109
  end
107
110
  rescue => e
108
111
  return Result.new(href, e.message)
@@ -133,9 +136,9 @@ module ::Nanoc::Extra::Checking::Checks
133
136
  raise 'should not have gotten here'
134
137
  end
135
138
 
136
- def request_url_once(url)
139
+ def request_url_once(url, req_method = Net::HTTP::Head)
137
140
  path = (url.path.nil? || url.path.empty? ? '/' : url.path)
138
- req = Net::HTTP::Head.new(path)
141
+ req = req_method.new(path)
139
142
  http = Net::HTTP.new(url.host, url.port)
140
143
  if url.instance_of? URI::HTTPS
141
144
  http.use_ssl = true
@@ -7,16 +7,21 @@ module Nanoc::Extra::Checking
7
7
  # @api private
8
8
  class Runner
9
9
 
10
- CHECKS_FILENAME = 'Checks'
10
+ CHECKS_FILENAMES = ['Checks', 'Checks.rb', 'checks', 'checks.rb']
11
11
 
12
12
  # @param [Nanoc::Site] site The nanoc site this runner is for
13
13
  def initialize(site)
14
14
  @site = site
15
15
  end
16
16
 
17
+ # @param [String] The name of the Checks file
18
+ def checks_filename
19
+ @_checks_filename ||= CHECKS_FILENAMES.find { |f| File.file?(f) }
20
+ end
21
+
17
22
  # @return [Boolean] true if a Checks file exists, false otherwise
18
23
  def has_dsl?
19
- File.exist?(CHECKS_FILENAME)
24
+ self.checks_filename && File.file?(self.checks_filename)
20
25
  end
21
26
 
22
27
  # Lists all available checks on stdout.
@@ -66,7 +71,7 @@ module Nanoc::Extra::Checking
66
71
  @dsl_loaded ||= false
67
72
  if !@dsl_loaded
68
73
  if self.has_dsl?
69
- @dsl = Nanoc::Extra::Checking::DSL.from_file(CHECKS_FILENAME)
74
+ @dsl = Nanoc::Extra::Checking::DSL.from_file(self.checks_filename)
70
75
  else
71
76
  @dsl = nil
72
77
  end
@@ -77,7 +82,7 @@ module Nanoc::Extra::Checking
77
82
  def require_dsl
78
83
  self.load_dsl_if_available
79
84
  if self.dsl.nil?
80
- raise Nanoc::Errors::GenericTrivial, "No checks defined (no #{CHECKS_FILENAME} file present)"
85
+ raise Nanoc::Errors::GenericTrivial, "No checks defined (no #{CHECKS_FILENAMES.first} file present)"
81
86
  end
82
87
  end
83
88
 
@@ -3,7 +3,12 @@
3
3
  module Nanoc::Filters
4
4
  class RDoc < Nanoc::Filter
5
5
 
6
- requires 'rdoc/markup', 'rdoc/markup/to_html'
6
+ requires 'rdoc'
7
+
8
+ def self.setup
9
+ gem 'rdoc', '~> 4.0'
10
+ super
11
+ end
7
12
 
8
13
  # Runs the content through [RDoc::Markup](http://rdoc.rubyforge.org/RDoc/Markup.html).
9
14
  # This method takes no options.
@@ -12,7 +17,9 @@ module Nanoc::Filters
12
17
  #
13
18
  # @return [String] The filtered content
14
19
  def run(content, params={})
15
- ::RDoc::Markup.new.convert(content, ::RDoc::Markup::ToHtml.new)
20
+ options = ::RDoc::Options.new
21
+ to_html = ::RDoc::Markup::ToHtml.new(options)
22
+ ::RDoc::Markup.new.convert(content, to_html)
16
23
  end
17
24
 
18
25
  end
@@ -15,24 +15,19 @@ module Nanoc::Helpers
15
15
  # @return [Array] The breadcrumbs, starting with the root item and ending
16
16
  # with the item itself
17
17
  def breadcrumbs_trail
18
- breadcrumbs_for_identifier(@item.identifier)
19
- end
18
+ trail = []
19
+ idx_start = 0
20
20
 
21
- def item_with_identifier(identifier)
22
- @identifier_cache ||= {}
23
- @identifier_cache[identifier] ||= begin
24
- @items.find { |i| i.identifier == identifier }
25
- end
26
- end
21
+ loop do
22
+ idx = @item.identifier.index('/', idx_start)
23
+ break if idx.nil?
27
24
 
28
- def breadcrumbs_for_identifier(identifier)
29
- @breadcrumbs_cache ||= {}
30
- @breadcrumbs_cache[identifier] ||= begin
31
- head = (identifier == '/' ? [] : breadcrumbs_for_identifier(identifier.sub(/[^\/]+\/$/, '')) )
32
- tail = [ item_with_identifier(identifier) ]
33
-
34
- head + tail
25
+ idx_start = idx+1
26
+ identifier = @item.identifier[0..idx]
27
+ trail << @items[identifier]
35
28
  end
29
+
30
+ trail
36
31
  end
37
32
 
38
33
  end
@@ -10,8 +10,9 @@ Gem::Specification.new do |s|
10
10
  s.summary = 'a web publishing system written in Ruby for building small to medium-sized websites.'
11
11
  s.description = 'nanoc is a simple but very flexible static site generator written in Ruby. It operates on local files, and therefore does not run on the server. nanoc “compiles” the local source files into HTML (usually), by evaluating eRuby, Markdown, etc.'
12
12
 
13
- s.author = 'Denis Defreyne'
14
- s.email = 'denis.defreyne@stoneship.org'
13
+ s.author = 'Denis Defreyne'
14
+ s.email = 'denis.defreyne@stoneship.org'
15
+ s.license = 'MIT'
15
16
 
16
17
  s.files = Dir['[A-Z]*'] +
17
18
  Dir['doc/yardoc_templates/**/*'] +
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::ChecksumStoreTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::ChecksumStoreTest < Nanoc::TestCase
6
4
 
7
5
  def test_get_with_existing_object
8
6
  require 'pstore'
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::CodeSnippetTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::CodeSnippetTest < Nanoc::TestCase
6
4
 
7
5
  def test_load
8
6
  # Initialize