nanoc3 3.2.4 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. metadata +14 -313
  2. data/.gemtest +0 -0
  3. data/ChangeLog +0 -3
  4. data/Gemfile +0 -29
  5. data/LICENSE +0 -19
  6. data/NEWS.md +0 -449
  7. data/README.md +0 -108
  8. data/Rakefile +0 -14
  9. data/bin/nanoc3 +0 -12
  10. data/doc/yardoc_templates/default/layout/html/footer.erb +0 -10
  11. data/lib/nanoc3.rb +0 -28
  12. data/lib/nanoc3/base.rb +0 -49
  13. data/lib/nanoc3/base/compilation/checksum_store.rb +0 -57
  14. data/lib/nanoc3/base/compilation/compiled_content_cache.rb +0 -62
  15. data/lib/nanoc3/base/compilation/compiler.rb +0 -455
  16. data/lib/nanoc3/base/compilation/compiler_dsl.rb +0 -214
  17. data/lib/nanoc3/base/compilation/dependency_tracker.rb +0 -196
  18. data/lib/nanoc3/base/compilation/filter.rb +0 -165
  19. data/lib/nanoc3/base/compilation/item_rep_proxy.rb +0 -102
  20. data/lib/nanoc3/base/compilation/item_rep_recorder_proxy.rb +0 -88
  21. data/lib/nanoc3/base/compilation/outdatedness_checker.rb +0 -223
  22. data/lib/nanoc3/base/compilation/outdatedness_reasons.rb +0 -46
  23. data/lib/nanoc3/base/compilation/rule.rb +0 -73
  24. data/lib/nanoc3/base/compilation/rule_context.rb +0 -84
  25. data/lib/nanoc3/base/compilation/rule_memory_calculator.rb +0 -40
  26. data/lib/nanoc3/base/compilation/rule_memory_store.rb +0 -53
  27. data/lib/nanoc3/base/compilation/rules_collection.rb +0 -231
  28. data/lib/nanoc3/base/context.rb +0 -47
  29. data/lib/nanoc3/base/core_ext.rb +0 -6
  30. data/lib/nanoc3/base/core_ext/array.rb +0 -62
  31. data/lib/nanoc3/base/core_ext/hash.rb +0 -63
  32. data/lib/nanoc3/base/core_ext/pathname.rb +0 -26
  33. data/lib/nanoc3/base/core_ext/string.rb +0 -46
  34. data/lib/nanoc3/base/directed_graph.rb +0 -275
  35. data/lib/nanoc3/base/errors.rb +0 -174
  36. data/lib/nanoc3/base/memoization.rb +0 -67
  37. data/lib/nanoc3/base/notification_center.rb +0 -84
  38. data/lib/nanoc3/base/ordered_hash.rb +0 -200
  39. data/lib/nanoc3/base/plugin_registry.rb +0 -165
  40. data/lib/nanoc3/base/result_data/item_rep.rb +0 -488
  41. data/lib/nanoc3/base/source_data/code_snippet.rb +0 -58
  42. data/lib/nanoc3/base/source_data/configuration.rb +0 -24
  43. data/lib/nanoc3/base/source_data/data_source.rb +0 -234
  44. data/lib/nanoc3/base/source_data/item.rb +0 -301
  45. data/lib/nanoc3/base/source_data/layout.rb +0 -130
  46. data/lib/nanoc3/base/source_data/site.rb +0 -361
  47. data/lib/nanoc3/base/store.rb +0 -135
  48. data/lib/nanoc3/cli.rb +0 -133
  49. data/lib/nanoc3/cli/command.rb +0 -139
  50. data/lib/nanoc3/cli/commands/autocompile.rb +0 -60
  51. data/lib/nanoc3/cli/commands/compile.rb +0 -280
  52. data/lib/nanoc3/cli/commands/create_item.rb +0 -62
  53. data/lib/nanoc3/cli/commands/create_layout.rb +0 -75
  54. data/lib/nanoc3/cli/commands/create_site.rb +0 -410
  55. data/lib/nanoc3/cli/commands/debug.rb +0 -119
  56. data/lib/nanoc3/cli/commands/info.rb +0 -98
  57. data/lib/nanoc3/cli/commands/nanoc.rb +0 -37
  58. data/lib/nanoc3/cli/commands/update.rb +0 -72
  59. data/lib/nanoc3/cli/commands/view.rb +0 -84
  60. data/lib/nanoc3/cli/commands/watch.rb +0 -125
  61. data/lib/nanoc3/cli/error_handler.rb +0 -193
  62. data/lib/nanoc3/cli/logger.rb +0 -91
  63. data/lib/nanoc3/data_sources.rb +0 -29
  64. data/lib/nanoc3/data_sources/deprecated/delicious.rb +0 -42
  65. data/lib/nanoc3/data_sources/deprecated/last_fm.rb +0 -87
  66. data/lib/nanoc3/data_sources/deprecated/twitter.rb +0 -38
  67. data/lib/nanoc3/data_sources/filesystem.rb +0 -299
  68. data/lib/nanoc3/data_sources/filesystem_unified.rb +0 -116
  69. data/lib/nanoc3/data_sources/filesystem_verbose.rb +0 -86
  70. data/lib/nanoc3/extra.rb +0 -22
  71. data/lib/nanoc3/extra/auto_compiler.rb +0 -103
  72. data/lib/nanoc3/extra/chick.rb +0 -125
  73. data/lib/nanoc3/extra/core_ext.rb +0 -4
  74. data/lib/nanoc3/extra/core_ext/enumerable.rb +0 -33
  75. data/lib/nanoc3/extra/core_ext/time.rb +0 -19
  76. data/lib/nanoc3/extra/deployers.rb +0 -11
  77. data/lib/nanoc3/extra/deployers/rsync.rb +0 -114
  78. data/lib/nanoc3/extra/file_proxy.rb +0 -40
  79. data/lib/nanoc3/extra/validators.rb +0 -12
  80. data/lib/nanoc3/extra/validators/links.rb +0 -264
  81. data/lib/nanoc3/extra/validators/w3c.rb +0 -95
  82. data/lib/nanoc3/extra/vcs.rb +0 -66
  83. data/lib/nanoc3/extra/vcses.rb +0 -17
  84. data/lib/nanoc3/extra/vcses/bazaar.rb +0 -25
  85. data/lib/nanoc3/extra/vcses/dummy.rb +0 -24
  86. data/lib/nanoc3/extra/vcses/git.rb +0 -25
  87. data/lib/nanoc3/extra/vcses/mercurial.rb +0 -25
  88. data/lib/nanoc3/extra/vcses/subversion.rb +0 -25
  89. data/lib/nanoc3/filters.rb +0 -53
  90. data/lib/nanoc3/filters/asciidoc.rb +0 -38
  91. data/lib/nanoc3/filters/bluecloth.rb +0 -19
  92. data/lib/nanoc3/filters/coderay.rb +0 -21
  93. data/lib/nanoc3/filters/colorize_syntax.rb +0 -261
  94. data/lib/nanoc3/filters/erb.rb +0 -35
  95. data/lib/nanoc3/filters/erubis.rb +0 -27
  96. data/lib/nanoc3/filters/haml.rb +0 -27
  97. data/lib/nanoc3/filters/kramdown.rb +0 -20
  98. data/lib/nanoc3/filters/less.rb +0 -53
  99. data/lib/nanoc3/filters/markaby.rb +0 -20
  100. data/lib/nanoc3/filters/maruku.rb +0 -20
  101. data/lib/nanoc3/filters/mustache.rb +0 -24
  102. data/lib/nanoc3/filters/rainpress.rb +0 -19
  103. data/lib/nanoc3/filters/rdiscount.rb +0 -22
  104. data/lib/nanoc3/filters/rdoc.rb +0 -33
  105. data/lib/nanoc3/filters/redcarpet.rb +0 -27
  106. data/lib/nanoc3/filters/redcloth.rb +0 -47
  107. data/lib/nanoc3/filters/relativize_paths.rb +0 -45
  108. data/lib/nanoc3/filters/rubypants.rb +0 -20
  109. data/lib/nanoc3/filters/sass.rb +0 -66
  110. data/lib/nanoc3/filters/slim.rb +0 -25
  111. data/lib/nanoc3/filters/typogruby.rb +0 -23
  112. data/lib/nanoc3/filters/uglify_js.rb +0 -42
  113. data/lib/nanoc3/helpers.rb +0 -16
  114. data/lib/nanoc3/helpers/blogging.rb +0 -319
  115. data/lib/nanoc3/helpers/breadcrumbs.rb +0 -40
  116. data/lib/nanoc3/helpers/capturing.rb +0 -138
  117. data/lib/nanoc3/helpers/filtering.rb +0 -50
  118. data/lib/nanoc3/helpers/html_escape.rb +0 -55
  119. data/lib/nanoc3/helpers/link_to.rb +0 -151
  120. data/lib/nanoc3/helpers/rendering.rb +0 -140
  121. data/lib/nanoc3/helpers/tagging.rb +0 -71
  122. data/lib/nanoc3/helpers/text.rb +0 -44
  123. data/lib/nanoc3/helpers/xml_sitemap.rb +0 -76
  124. data/lib/nanoc3/tasks.rb +0 -10
  125. data/lib/nanoc3/tasks/clean.rake +0 -16
  126. data/lib/nanoc3/tasks/clean.rb +0 -29
  127. data/lib/nanoc3/tasks/deploy/rsync.rake +0 -14
  128. data/lib/nanoc3/tasks/validate.rake +0 -92
  129. data/nanoc3.gemspec +0 -49
  130. data/tasks/doc.rake +0 -16
  131. data/tasks/test.rake +0 -44
  132. data/test/base/core_ext/array_spec.rb +0 -73
  133. data/test/base/core_ext/hash_spec.rb +0 -98
  134. data/test/base/core_ext/pathname_spec.rb +0 -27
  135. data/test/base/core_ext/string_spec.rb +0 -37
  136. data/test/base/test_checksum_store.rb +0 -35
  137. data/test/base/test_code_snippet.rb +0 -31
  138. data/test/base/test_compiler.rb +0 -316
  139. data/test/base/test_compiler_dsl.rb +0 -161
  140. data/test/base/test_context.rb +0 -31
  141. data/test/base/test_data_source.rb +0 -46
  142. data/test/base/test_dependency_tracker.rb +0 -262
  143. data/test/base/test_directed_graph.rb +0 -283
  144. data/test/base/test_filter.rb +0 -83
  145. data/test/base/test_item.rb +0 -179
  146. data/test/base/test_item_rep.rb +0 -553
  147. data/test/base/test_layout.rb +0 -59
  148. data/test/base/test_memoization.rb +0 -90
  149. data/test/base/test_notification_center.rb +0 -34
  150. data/test/base/test_outdatedness_checker.rb +0 -394
  151. data/test/base/test_plugin.rb +0 -30
  152. data/test/base/test_rule.rb +0 -19
  153. data/test/base/test_rule_context.rb +0 -65
  154. data/test/base/test_site.rb +0 -190
  155. data/test/cli/commands/test_compile.rb +0 -33
  156. data/test/cli/commands/test_create_item.rb +0 -14
  157. data/test/cli/commands/test_create_layout.rb +0 -28
  158. data/test/cli/commands/test_create_site.rb +0 -24
  159. data/test/cli/commands/test_help.rb +0 -12
  160. data/test/cli/commands/test_info.rb +0 -11
  161. data/test/cli/commands/test_update.rb +0 -10
  162. data/test/cli/test_cli.rb +0 -102
  163. data/test/cli/test_error_handler.rb +0 -29
  164. data/test/cli/test_logger.rb +0 -10
  165. data/test/data_sources/test_filesystem.rb +0 -433
  166. data/test/data_sources/test_filesystem_unified.rb +0 -536
  167. data/test/data_sources/test_filesystem_verbose.rb +0 -357
  168. data/test/extra/core_ext/test_enumerable.rb +0 -30
  169. data/test/extra/core_ext/test_time.rb +0 -15
  170. data/test/extra/deployers/test_rsync.rb +0 -232
  171. data/test/extra/test_auto_compiler.rb +0 -417
  172. data/test/extra/test_file_proxy.rb +0 -19
  173. data/test/extra/test_vcs.rb +0 -22
  174. data/test/extra/validators/test_links.rb +0 -51
  175. data/test/extra/validators/test_w3c.rb +0 -47
  176. data/test/filters/test_asciidoc.rb +0 -22
  177. data/test/filters/test_bluecloth.rb +0 -18
  178. data/test/filters/test_coderay.rb +0 -44
  179. data/test/filters/test_colorize_syntax.rb +0 -283
  180. data/test/filters/test_erb.rb +0 -99
  181. data/test/filters/test_erubis.rb +0 -70
  182. data/test/filters/test_haml.rb +0 -96
  183. data/test/filters/test_kramdown.rb +0 -18
  184. data/test/filters/test_less.rb +0 -113
  185. data/test/filters/test_markaby.rb +0 -24
  186. data/test/filters/test_maruku.rb +0 -18
  187. data/test/filters/test_mustache.rb +0 -25
  188. data/test/filters/test_rainpress.rb +0 -29
  189. data/test/filters/test_rdiscount.rb +0 -31
  190. data/test/filters/test_rdoc.rb +0 -18
  191. data/test/filters/test_redcarpet.rb +0 -63
  192. data/test/filters/test_redcloth.rb +0 -33
  193. data/test/filters/test_relativize_paths.rb +0 -332
  194. data/test/filters/test_rubypants.rb +0 -18
  195. data/test/filters/test_sass.rb +0 -229
  196. data/test/filters/test_slim.rb +0 -35
  197. data/test/filters/test_typogruby.rb +0 -21
  198. data/test/filters/test_uglify_js.rb +0 -30
  199. data/test/gem_loader.rb +0 -11
  200. data/test/helper.rb +0 -179
  201. data/test/helpers/test_blogging.rb +0 -754
  202. data/test/helpers/test_breadcrumbs.rb +0 -81
  203. data/test/helpers/test_capturing.rb +0 -41
  204. data/test/helpers/test_filtering.rb +0 -106
  205. data/test/helpers/test_html_escape.rb +0 -32
  206. data/test/helpers/test_link_to.rb +0 -249
  207. data/test/helpers/test_rendering.rb +0 -89
  208. data/test/helpers/test_tagging.rb +0 -87
  209. data/test/helpers/test_text.rb +0 -24
  210. data/test/helpers/test_xml_sitemap.rb +0 -103
  211. data/test/tasks/test_clean.rb +0 -67
@@ -1,71 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Nanoc3::Helpers
4
-
5
- # Provides support for managing tags added to items.
6
- #
7
- # To add tags to items, set the `tags` attribute to an array of tags that
8
- # should be applied to the item.
9
- #
10
- # @example Adding tags to an item
11
- #
12
- # tags: [ 'foo', 'bar', 'baz' ]
13
- module Tagging
14
-
15
- require 'nanoc3/helpers/html_escape'
16
- include Nanoc3::Helpers::HTMLEscape
17
-
18
- # Returns a formatted list of tags for the given item as a string. The
19
- # tags will be linked using the {#link_for_tag} function; the
20
- # HTML-escaping rules for {#link_for_tag} apply here as well.
21
- #
22
- # @option params [String] base_url ("http://technorati.com/tag/") The URL
23
- # to which the tag will be appended to construct the link URL. This URL
24
- # must have a trailing slash.
25
- #
26
- # @option params [String] none_text ("(none)") The text to display when
27
- # the item has no tags
28
- #
29
- # @option params [String] separator (", ") The separator to put between
30
- # tags
31
- #
32
- # @return [String] A hyperlinked list of tags for the given item
33
- def tags_for(item, params={})
34
- base_url = params[:base_url] || 'http://technorati.com/tag/'
35
- none_text = params[:none_text] || '(none)'
36
- separator = params[:separator] || ', '
37
-
38
- if item[:tags].nil? or item[:tags].empty?
39
- none_text
40
- else
41
- item[:tags].map { |tag| link_for_tag(tag, base_url) }.join(separator)
42
- end
43
- end
44
-
45
- # Find all items with the given tag.
46
- #
47
- # @param [String] tag The tag for which to find all items
48
- #
49
- # @return [Array] All items with the given tag
50
- def items_with_tag(tag)
51
- @items.select { |i| (i[:tags] || []).include?(tag) }
52
- end
53
-
54
- # Returns a link to to the specified tag. The link is marked up using the
55
- # rel-tag microformat. The `href` attribute of the link will be HTML-
56
- # escaped, as will the content of the `a` element.
57
- #
58
- # @param [String] tag The name of the tag, which should consist of letters
59
- # and numbers (no spaces, slashes, or other special characters).
60
- #
61
- # @param [String] base_url The URL to which the tag will be appended to
62
- # construct the link URL. This URL must have a trailing slash.
63
- #
64
- # @return [String] A link for the given tag and the given base URL
65
- def link_for_tag(tag, base_url)
66
- %[<a href="#{h base_url}#{h tag}" rel="tag">#{h tag}</a>]
67
- end
68
-
69
- end
70
-
71
- end
@@ -1,44 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Nanoc3::Helpers
4
-
5
- # Contains several useful text-related helper functions.
6
- module Text
7
-
8
- # Returns an excerpt for the given string. HTML tags are ignored, so if
9
- # you don't want them to turn up, they should be stripped from the string
10
- # before passing it to the excerpt function.
11
- #
12
- # @param [String] string The string for which to build an excerpt
13
- #
14
- # @option params [Number] length (25) The maximum number of characters
15
- # this excerpt can contain, including the omission.
16
- #
17
- # @option params [String] omission ("...") The string to append to the
18
- # excerpt when the excerpt is shorter than the original string
19
- #
20
- # @return [String] The excerpt of the given string
21
- def excerptize(string, params={})
22
- # Initialize params
23
- params[:length] ||= 25
24
- params[:omission] ||= '...'
25
-
26
- # Get excerpt
27
- length = params[:length] - params[:omission].length
28
- length = 0 if length < 0
29
- (string.length > params[:length] ? string[0...length] + params[:omission] : string)
30
- end
31
-
32
- # Strips all HTML tags out of the given string.
33
- #
34
- # @param [String] string The string from which to strip all HTML
35
- #
36
- # @return [String] The given string with all HTML stripped
37
- def strip_html(string)
38
- # FIXME will need something more sophisticated than this, because it sucks
39
- string.gsub(/<[^>]*(>+|\s*\z)/m, '').strip
40
- end
41
-
42
- end
43
-
44
- end
@@ -1,76 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Nanoc3::Helpers
4
-
5
- # Contains functionality for building XML sitemaps that will be crawled by
6
- # search engines. See the [Sitemaps protocol site](http://www.sitemaps.org)
7
- # for details.
8
- module XMLSitemap
9
-
10
- # Builds an XML sitemap and returns it.
11
- #
12
- # The following attributes can optionally be set on items to change the
13
- # behaviour of the sitemap:
14
- #
15
- # * `changefreq` — The estimated change frequency as defined by the
16
- # Sitemaps protocol
17
- #
18
- # * `priority` — The item's priority, ranging from 0.0 to 1.0, as defined
19
- # by the Sitemaps protocol
20
- #
21
- # The sitemap will also include dates on which the items were updated.
22
- # These are generated automatically; the way this happens depends on the
23
- # used data source (the filesystem data source checks the file mtimes, for
24
- # instance).
25
- #
26
- # The site configuration will need to have the following attributes:
27
- #
28
- # * `base_url` — The URL to the site, without trailing slash. For example,
29
- # if the site is at "http://example.com/", the `base_url` would be
30
- # "http://example.com".
31
- #
32
- # @example Excluding binary items from the sitemap
33
- #
34
- # <%= xml_sitemap :items => @items.reject{ |i| i[:is_hidden] || i[:binary] } %>
35
- #
36
- # @option params [Array] :items A list of items to include in the sitemap
37
- #
38
- # @return [String] The XML sitemap
39
- def xml_sitemap(params={})
40
- require 'builder'
41
-
42
- # Extract parameters
43
- items = params[:items] || @items.reject { |i| i[:is_hidden] }
44
-
45
- # Create builder
46
- buffer = ''
47
- xml = Builder::XmlMarkup.new(:target => buffer, :indent => 2)
48
-
49
- # Check for required attributes
50
- if @site.config[:base_url].nil?
51
- raise RuntimeError.new("The Nanoc3::Helpers::XMLSitemap helper requires the site configuration to specify the base URL for the site.")
52
- end
53
-
54
- # Build sitemap
55
- xml.instruct!
56
- xml.urlset(:xmlns => 'http://www.sitemaps.org/schemas/sitemap/0.9') do
57
- # Add item
58
- items.each do |item|
59
- item.reps.reject { |r| r.raw_path.nil? }.each do |rep|
60
- xml.url do
61
- xml.loc @site.config[:base_url] + rep.path
62
- xml.lastmod item.mtime.to_iso8601_date unless item.mtime.nil?
63
- xml.changefreq item[:changefreq] unless item[:changefreq].nil?
64
- xml.priority item[:priority] unless item[:priority].nil?
65
- end
66
- end
67
- end
68
- end
69
-
70
- # Return sitemap
71
- buffer
72
- end
73
-
74
- end
75
-
76
- end
@@ -1,10 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'nanoc3'
4
- require 'rake'
5
-
6
- module Nanoc3::Tasks
7
- end
8
-
9
- Dir[File.dirname(__FILE__) + '/tasks/**/*.rb'].each { |f| load f }
10
- Dir[File.dirname(__FILE__) + '/tasks/**/*.rake'].each { |f| Rake.application.add_import(f) }
@@ -1,16 +0,0 @@
1
- # encoding: utf-8
2
-
3
- desc 'Remove output files generated by nanoc3'
4
- task :clean do
5
- # Load site
6
- site = Nanoc3::Site.new('.')
7
- if site.nil?
8
- $stderr.puts 'The current working directory does not seem to be a ' +
9
- 'valid/complete nanoc site directory; aborting.'
10
- exit 1
11
- end
12
-
13
- # Clean
14
- clean = ::Nanoc3::Tasks::Clean.new(site)
15
- clean.run
16
- end
@@ -1,29 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Nanoc3::Tasks
4
-
5
- class Clean
6
-
7
- def initialize(site)
8
- @site = site
9
- end
10
-
11
- def run
12
- filenames.each do |filename|
13
- FileUtils.rm_f filename unless filename.nil?
14
- end
15
- end
16
-
17
- private
18
-
19
- def filenames
20
- @site.items.map do |item|
21
- item.reps.map do |rep|
22
- rep.raw_path
23
- end
24
- end.flatten
25
- end
26
-
27
- end
28
-
29
- end
@@ -1,14 +0,0 @@
1
- # encoding: utf-8
2
-
3
- namespace :deploy do
4
-
5
- desc 'Upload the compiled site using rsync'
6
- task :rsync do
7
- dry_run = !!ENV['dry_run']
8
- config_name = ENV['config'] || :default
9
-
10
- deployer = Nanoc3::Extra::Deployers::Rsync.new
11
- deployer.run(:config_name => config_name, :dry_run => dry_run)
12
- end
13
-
14
- end
@@ -1,92 +0,0 @@
1
- # encoding: utf-8
2
-
3
- namespace :validate do
4
-
5
- desc 'Validate the site’s HTML files'.make_compatible_with_env
6
- task :html do
7
- # Get output directory
8
- site = Nanoc3::Site.new('.')
9
- if site.nil?
10
- $stderr.puts 'The current working directory does not seem to be a ' +
11
- 'valid/complete nanoc site directory; aborting.'
12
- exit 1
13
- end
14
- dir = site.config[:output_dir]
15
-
16
- # Validate
17
- validator = ::Nanoc3::Extra::Validators::W3C.new(dir, [ :html ])
18
- validator.run
19
- end
20
-
21
- desc 'Validate the site’s CSS files'.make_compatible_with_env
22
- task :css do
23
- # Get output directory
24
- site = Nanoc3::Site.new('.')
25
- if site.nil?
26
- $stderr.puts 'The current working directory does not seem to be a ' +
27
- 'valid/complete nanoc site directory; aborting.'
28
- exit 1
29
- end
30
- dir = site.config[:output_dir]
31
-
32
- # Validate
33
- validator = ::Nanoc3::Extra::Validators::W3C.new(dir, [ :css ])
34
- validator.run
35
- end
36
-
37
- namespace :links do
38
-
39
- desc 'Validate the site’s internal links'.make_compatible_with_env
40
- task :internal do
41
- # Get output directory
42
- site = Nanoc3::Site.new('.')
43
- if site.nil?
44
- $stderr.puts 'The current working directory does not seem to be a ' +
45
- 'valid/complete nanoc site directory; aborting.'
46
- exit 1
47
- end
48
- dir = site.config[:output_dir]
49
- index_filenames = site.config[:index_filenames]
50
-
51
- # Validate
52
- validator = ::Nanoc3::Extra::Validators::Links.new(dir, index_filenames, :internal => true)
53
- validator.run
54
- end
55
-
56
- desc 'Validate the site’s internal links'.make_compatible_with_env
57
- task :external do
58
- # Get output directory
59
- site = Nanoc3::Site.new('.')
60
- if site.nil?
61
- $stderr.puts 'The current working directory does not seem to be a ' +
62
- 'valid/complete nanoc site directory; aborting.'
63
- exit 1
64
- end
65
- dir = site.config[:output_dir]
66
- index_filenames = site.config[:index_filenames]
67
-
68
- # Validate
69
- validator = ::Nanoc3::Extra::Validators::Links.new(dir, index_filenames, :external => true)
70
- validator.run
71
- end
72
-
73
- end
74
-
75
- desc 'Validate the site’s internal and external links'.make_compatible_with_env
76
- task :links do
77
- # Get output directory
78
- site = Nanoc3::Site.new('.')
79
- if site.nil?
80
- $stderr.puts 'The current working directory does not seem to be a ' +
81
- 'valid/complete nanoc site directory; aborting.'
82
- exit 1
83
- end
84
- dir = site.config[:output_dir]
85
- index_filenames = site.config[:index_filenames]
86
-
87
- # Validate
88
- validator = ::Nanoc3::Extra::Validators::Links.new(dir, index_filenames, :internal => true, :external => true)
89
- validator.run
90
- end
91
-
92
- end
@@ -1,49 +0,0 @@
1
- # encoding: utf-8
2
-
3
- $LOAD_PATH.unshift(File.expand_path('../lib/', __FILE__))
4
- require 'nanoc3'
5
-
6
- Gem::Specification.new do |s|
7
- s.name = 'nanoc3'
8
- s.version = Nanoc3::VERSION
9
- s.homepage = 'http://nanoc.stoneship.org/'
10
- s.summary = 'a web publishing system written in Ruby for building small to medium-sized websites.'
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
-
13
- s.author = 'Denis Defreyne'
14
- s.email = 'denis.defreyne@stoneship.org'
15
-
16
- s.files = Dir['[A-Z]*'] +
17
- Dir['doc/yardoc_templates/**/*'] +
18
- Dir['{bin,lib,tasks,test}/**/*'] +
19
- [ 'nanoc3.gemspec', '.gemtest' ]
20
- s.executables = [ 'nanoc3' ]
21
- s.require_paths = [ 'lib' ]
22
-
23
- s.rdoc_options = [ '--main', 'README.md' ]
24
- s.extra_rdoc_files = [ 'ChangeLog', 'LICENSE', 'README.md', 'NEWS.md' ]
25
-
26
- s.add_runtime_dependency('cri', '~> 2.0')
27
-
28
- s.add_development_dependency('minitest')
29
- s.add_development_dependency('mocha')
30
- s.add_development_dependency('rake')
31
- s.add_development_dependency('rdiscount')
32
- s.add_development_dependency('yard')
33
-
34
- s.post_install_message = %q{------------------------------------------------------------------------------
35
- Thanks for installing nanoc 3.2! Here are some resources to help you get
36
- started:
37
-
38
- * The web site at <http://nanoc.stoneship.org/>
39
- * The tutorial at <http://nanoc.stoneship.org/docs/3-getting-started/>
40
- * The manual at <http://nanoc.stoneship.org/docs/4-basic-concepts/>
41
-
42
- If you have questions, issues or simply want to share ideas, join the
43
- discussion at <http://groups.google.com/group/nanoc> or stop by in the IRC
44
- channel on irc.freenode.net, channel #nanoc. See you there!
45
-
46
- Enjoy!
47
- ------------------------------------------------------------------------------
48
- }
49
- end
@@ -1,16 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'yard'
4
-
5
- YARD::Rake::YardocTask.new(:doc) do |yard|
6
- yard.files = Dir['lib/**/*.rb']
7
- yard.options = [
8
- '--markup', 'markdown',
9
- '--markup-provider', 'kramdown',
10
- '--charset', 'utf-8',
11
- '--readme', 'README.md',
12
- '--files', 'NEWS.md,LICENSE',
13
- '--output-dir', 'doc/yardoc',
14
- '--template-path', 'doc/yardoc_templates'
15
- ]
16
- end
@@ -1,44 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'minitest/unit'
4
-
5
- test = namespace :test do
6
-
7
- # test:all
8
- desc 'Run all tests'
9
- task :all do
10
- ENV['QUIET'] ||= 'true'
11
-
12
- $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/..'))
13
-
14
- # require our test helper so we don't have to in each individual test
15
- require 'test/helper'
16
-
17
- MiniTest::Unit.autorun
18
-
19
- test_files = Dir['test/**/*_spec.rb'] + Dir['test/**/test_*.rb']
20
- test_files.each { |f| require f }
21
- end
22
-
23
- # test:...
24
- %w( base cli data_sources extra filters helpers tasks ).each do |dir|
25
- desc "Run all #{dir} tests"
26
- task dir.to_sym do |task|
27
- ENV['QUIET'] ||= 'true'
28
-
29
- $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/..'))
30
-
31
- # require our test helper so we don't have to in each individual test
32
- require 'test/helper'
33
-
34
- MiniTest::Unit.autorun
35
-
36
- test_files = Dir["test/#{dir}/**/*_spec.rb"] + Dir["test/#{dir}/**/test_*.rb"]
37
- test_files.each { |f| require f }
38
- end
39
- end
40
-
41
- end
42
-
43
- desc 'Alias for test:all'
44
- task :test => [ :'test:all' ]