nanoc3 3.2.0a4 → 3.2.0b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. data/NEWS.md +20 -2
  2. data/README.md +7 -3
  3. data/bin/nanoc3 +1 -3
  4. data/lib/nanoc3.rb +1 -13
  5. data/lib/nanoc3/base/compilation/filter.rb +21 -0
  6. data/lib/nanoc3/base/compilation/item_rep_recorder_proxy.rb +1 -3
  7. data/lib/nanoc3/base/compilation/outdatedness_checker.rb +1 -1
  8. data/lib/nanoc3/base/compilation/rule_memory_calculator.rb +0 -2
  9. data/lib/nanoc3/base/compilation/rules_collection.rb +37 -13
  10. data/lib/nanoc3/base/directed_graph.rb +3 -3
  11. data/lib/nanoc3/base/memoization.rb +6 -9
  12. data/lib/nanoc3/base/source_data/code_snippet.rb +2 -1
  13. data/lib/nanoc3/base/source_data/configuration.rb +7 -3
  14. data/lib/nanoc3/base/source_data/item.rb +52 -10
  15. data/lib/nanoc3/base/source_data/layout.rb +28 -1
  16. data/lib/nanoc3/base/source_data/site.rb +14 -3
  17. data/lib/nanoc3/cli.rb +98 -6
  18. data/lib/nanoc3/cli/{base.rb → command.rb} +117 -153
  19. data/lib/nanoc3/cli/commands/autocompile.rb +20 -48
  20. data/lib/nanoc3/cli/commands/compile.rb +32 -48
  21. data/lib/nanoc3/cli/commands/create_item.rb +21 -37
  22. data/lib/nanoc3/cli/commands/create_layout.rb +18 -36
  23. data/lib/nanoc3/cli/commands/create_site.rb +15 -34
  24. data/lib/nanoc3/cli/commands/debug.rb +17 -31
  25. data/lib/nanoc3/cli/commands/info.rb +14 -29
  26. data/lib/nanoc3/cli/commands/nanoc.rb +37 -0
  27. data/lib/nanoc3/cli/commands/update.rb +21 -44
  28. data/lib/nanoc3/cli/commands/view.rb +18 -44
  29. data/lib/nanoc3/cli/commands/watch.rb +16 -31
  30. data/lib/nanoc3/data_sources/filesystem.rb +25 -6
  31. data/lib/nanoc3/data_sources/filesystem_unified.rb +5 -5
  32. data/lib/nanoc3/extra/auto_compiler.rb +1 -0
  33. data/lib/nanoc3/extra/file_proxy.rb +0 -1
  34. data/lib/nanoc3/filters.rb +2 -0
  35. data/lib/nanoc3/filters/asciidoc.rb +16 -36
  36. data/lib/nanoc3/filters/bluecloth.rb +2 -2
  37. data/lib/nanoc3/filters/coderay.rb +2 -2
  38. data/lib/nanoc3/filters/colorize_syntax.rb +18 -5
  39. data/lib/nanoc3/filters/erb.rb +2 -2
  40. data/lib/nanoc3/filters/erubis.rb +2 -2
  41. data/lib/nanoc3/filters/haml.rb +2 -2
  42. data/lib/nanoc3/filters/kramdown.rb +2 -2
  43. data/lib/nanoc3/filters/less.rb +32 -1
  44. data/lib/nanoc3/filters/markaby.rb +2 -2
  45. data/lib/nanoc3/filters/maruku.rb +2 -2
  46. data/lib/nanoc3/filters/mustache.rb +2 -2
  47. data/lib/nanoc3/filters/rainpress.rb +2 -2
  48. data/lib/nanoc3/filters/rdiscount.rb +4 -3
  49. data/lib/nanoc3/filters/rdoc.rb +10 -6
  50. data/lib/nanoc3/filters/redcarpet.rb +2 -2
  51. data/lib/nanoc3/filters/redcloth.rb +2 -2
  52. data/lib/nanoc3/filters/rubypants.rb +2 -2
  53. data/lib/nanoc3/filters/sass.rb +44 -52
  54. data/lib/nanoc3/filters/slim.rb +2 -2
  55. data/lib/nanoc3/filters/typogruby.rb +2 -2
  56. data/lib/nanoc3/filters/uglify_js.rb +42 -0
  57. data/nanoc3.gemspec +1 -1
  58. data/tasks/test.rake +6 -0
  59. data/test/base/core_ext/array_spec.rb +0 -2
  60. data/test/base/core_ext/hash_spec.rb +0 -2
  61. data/test/base/core_ext/pathname_spec.rb +0 -2
  62. data/test/base/core_ext/string_spec.rb +0 -2
  63. data/test/base/test_checksum_store.rb +0 -2
  64. data/test/base/test_code_snippet.rb +0 -2
  65. data/test/base/test_compiler.rb +2 -4
  66. data/test/base/test_compiler_dsl.rb +1 -3
  67. data/test/base/test_context.rb +0 -2
  68. data/test/base/test_data_source.rb +0 -2
  69. data/test/base/test_dependency_tracker.rb +0 -2
  70. data/test/base/test_directed_graph.rb +0 -2
  71. data/test/base/test_filter.rb +0 -2
  72. data/test/base/test_item.rb +19 -4
  73. data/test/base/test_item_rep.rb +0 -2
  74. data/test/base/test_layout.rb +19 -4
  75. data/test/base/test_memoization.rb +39 -2
  76. data/test/base/test_notification_center.rb +0 -2
  77. data/test/base/test_outdatedness_checker.rb +31 -2
  78. data/test/base/test_plugin.rb +0 -2
  79. data/test/base/test_rule.rb +0 -2
  80. data/test/base/test_rule_context.rb +0 -2
  81. data/test/base/test_site.rb +30 -3
  82. data/test/cli/commands/test_compile.rb +24 -3
  83. data/test/cli/commands/test_create_item.rb +5 -3
  84. data/test/cli/commands/test_create_layout.rb +4 -4
  85. data/test/cli/commands/test_create_site.rb +5 -5
  86. data/test/cli/commands/test_help.rb +3 -3
  87. data/test/cli/commands/test_info.rb +2 -3
  88. data/test/cli/commands/test_update.rb +0 -2
  89. data/test/cli/test_cli.rb +40 -0
  90. data/test/cli/test_logger.rb +0 -2
  91. data/test/data_sources/test_filesystem.rb +0 -2
  92. data/test/data_sources/test_filesystem_unified.rb +32 -58
  93. data/test/data_sources/test_filesystem_verbose.rb +0 -2
  94. data/test/extra/core_ext/test_enumerable.rb +0 -2
  95. data/test/extra/core_ext/test_time.rb +0 -2
  96. data/test/extra/deployers/test_rsync.rb +0 -2
  97. data/test/extra/test_auto_compiler.rb +5 -7
  98. data/test/extra/test_file_proxy.rb +0 -2
  99. data/test/extra/test_vcs.rb +0 -2
  100. data/test/extra/validators/test_links.rb +0 -2
  101. data/test/extra/validators/test_w3c.rb +0 -2
  102. data/test/filters/test_asciidoc.rb +0 -2
  103. data/test/filters/test_bluecloth.rb +0 -2
  104. data/test/filters/test_coderay.rb +0 -2
  105. data/test/filters/test_colorize_syntax.rb +49 -2
  106. data/test/filters/test_erb.rb +0 -2
  107. data/test/filters/test_erubis.rb +0 -2
  108. data/test/filters/test_haml.rb +0 -2
  109. data/test/filters/test_kramdown.rb +0 -2
  110. data/test/filters/test_less.rb +59 -5
  111. data/test/filters/test_markaby.rb +0 -2
  112. data/test/filters/test_maruku.rb +0 -2
  113. data/test/filters/test_mustache.rb +0 -2
  114. data/test/filters/test_rainpress.rb +0 -2
  115. data/test/filters/test_rdiscount.rb +0 -2
  116. data/test/filters/test_rdoc.rb +0 -2
  117. data/test/filters/test_redcarpet.rb +0 -2
  118. data/test/filters/test_redcloth.rb +0 -2
  119. data/test/filters/test_relativize_paths.rb +77 -24
  120. data/test/filters/test_rubypants.rb +0 -2
  121. data/test/filters/test_sass.rb +136 -10
  122. data/test/filters/test_slim.rb +0 -2
  123. data/test/filters/test_typogruby.rb +0 -2
  124. data/test/filters/test_uglify_js.rb +30 -0
  125. data/test/gem_loader.rb +11 -0
  126. data/test/helper.rb +3 -0
  127. data/test/helpers/test_blogging.rb +0 -2
  128. data/test/helpers/test_breadcrumbs.rb +0 -2
  129. data/test/helpers/test_capturing.rb +0 -2
  130. data/test/helpers/test_filtering.rb +0 -2
  131. data/test/helpers/test_html_escape.rb +0 -2
  132. data/test/helpers/test_link_to.rb +0 -2
  133. data/test/helpers/test_rendering.rb +0 -2
  134. data/test/helpers/test_tagging.rb +0 -2
  135. data/test/helpers/test_text.rb +0 -2
  136. data/test/helpers/test_xml_sitemap.rb +0 -2
  137. data/test/tasks/test_clean.rb +0 -2
  138. metadata +11 -9
  139. data/lib/nanoc3/cli/commands.rb +0 -16
  140. data/lib/nanoc3/cli/commands/help.rb +0 -71
  141. data/tasks/clean.rake +0 -11
@@ -1,16 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Nanoc3::CLI::Commands
4
- end
5
-
6
- require 'nanoc3/cli/commands/autocompile'
7
- require 'nanoc3/cli/commands/compile'
8
- require 'nanoc3/cli/commands/create_layout'
9
- require 'nanoc3/cli/commands/create_item'
10
- require 'nanoc3/cli/commands/create_site'
11
- require 'nanoc3/cli/commands/debug'
12
- require 'nanoc3/cli/commands/help'
13
- require 'nanoc3/cli/commands/info'
14
- require 'nanoc3/cli/commands/update'
15
- require 'nanoc3/cli/commands/view'
16
- require 'nanoc3/cli/commands/watch'
@@ -1,71 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Nanoc3::CLI::Commands
4
-
5
- class Help < Cri::Command
6
-
7
- def name
8
- 'help'
9
- end
10
-
11
- def aliases
12
- []
13
- end
14
-
15
- def short_desc
16
- 'show help for a command'
17
- end
18
-
19
- def long_desc
20
- 'Show help for the given command, or show general help. When no ' +
21
- 'command is given, a list of available commands is displayed, as ' +
22
- 'well as a list of global commandline options. When a command is ' +
23
- 'given, a command description as well as command-specific ' +
24
- 'commandline options are shown.'
25
- end
26
-
27
- def usage
28
- "nanoc3 help [options] [command]"
29
- end
30
-
31
- def run(options, arguments)
32
- # Check arguments
33
- if arguments.size > 1
34
- $stderr.puts "usage: #{usage}"
35
- exit 1
36
- end
37
-
38
- if arguments.length == 0
39
- # Build help text
40
- text = ''
41
-
42
- # Add title
43
- text << "nanoc, a static site compiler written in Ruby.\n"
44
-
45
- # Add available commands
46
- text << "\n"
47
- text << "Available commands:\n"
48
- text << "\n"
49
- @base.commands.sort.each do |command|
50
- text << sprintf(" %-20s %s\n", command.name, command.short_desc)
51
- end
52
-
53
- # Add global options
54
- text << "\n"
55
- text << "Global options:\n"
56
- text << "\n"
57
- @base.global_option_definitions.sort { |x,y| x[:long] <=> y[:long] }.each do |opt_def|
58
- text << sprintf(" -%1s --%-15s %s\n", opt_def[:short], opt_def[:long], opt_def[:desc])
59
- end
60
-
61
- # Display text
62
- puts text
63
- elsif arguments.length == 1
64
- command = @base.command_named(arguments[0])
65
- puts command.help
66
- end
67
- end
68
-
69
- end
70
-
71
- end
@@ -1,11 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'rake/clean'
4
-
5
- CLEAN.include([
6
- 'coverage',
7
- 'doc',
8
- 'tmp'
9
- ])
10
-
11
- CLOBBER.include([ 'pkg' ])