nanoc 3.3.0 → 3.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/NEWS.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # nanoc news
2
2
 
3
+ ## 3.3.1 (2012-02-18)
4
+
5
+ * Fixed issue with long paths on Windows
6
+ * Fixed a few deployer crashes
7
+ * Added nanoc3.rb, nanoc3/tasks.rb, … for compatibility with older versions
8
+ * Made nanoc setup Bundler at startup [John Nishinaga]
9
+
3
10
  ## 3.3 (2012-02-12)
4
11
 
5
12
  Base:
data/README.md CHANGED
@@ -96,6 +96,7 @@ may be interested in the development dependencies:
96
96
  * Nikhil Marathe
97
97
  * Daniel Mendler
98
98
  * Ale Muñoz
99
+ * John Nishinaga
99
100
  * Nicky Peeters
100
101
  * Christian Plessl
101
102
  * Šime Ramov
data/bin/nanoc CHANGED
@@ -1,6 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: utf-8
3
3
 
4
+ # Try loading bundler if it's possible
5
+ begin
6
+ require 'bundler/setup'
7
+ rescue LoadError
8
+ # no problem
9
+ end
10
+
4
11
  # Add lib to load path
5
12
  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
6
13
 
data/lib/nanoc.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Nanoc
4
4
 
5
5
  # The current nanoc version.
6
- VERSION = '3.3.0'
6
+ VERSION = '3.3.1'
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).
@@ -117,7 +117,7 @@ module Nanoc
117
117
  def output_filename
118
118
  @output_filename ||= begin
119
119
  FileUtils.mkdir_p(TMP_BINARY_ITEMS_DIR)
120
- tempfile = Tempfile.new(filename.gsub(/[^a-z]/, '-'), TMP_BINARY_ITEMS_DIR)
120
+ tempfile = Tempfile.new('', TMP_BINARY_ITEMS_DIR)
121
121
  new_filename = tempfile.path
122
122
  tempfile.close!
123
123
 
@@ -50,6 +50,12 @@ module Nanoc
50
50
  registry.register(klass, class_or_name, *identifiers)
51
51
  end
52
52
 
53
+ # @return [Hash<Symbol, Class>] All plugins of this type, with keys
54
+ # being the identifiers and values the plugin classes
55
+ def all
56
+ Nanoc::Plugin.find_all(self)
57
+ end
58
+
53
59
  # Returns the plugin with the given name (identifier)
54
60
  #
55
61
  # @param [String] name The name of the plugin class to find
@@ -53,14 +53,15 @@ module Nanoc::CLI::Commands
53
53
  end
54
54
 
55
55
  # Get deployer
56
+ names = Nanoc::Extra::Deployer.all.keys
56
57
  name = config.fetch(:kind) do
57
58
  $stderr.puts "The specified deploy target does not have a kind."
58
- $stderr.puts "(expected one of #{KIND_MAPPING.keys.join(', ')})"
59
+ $stderr.puts "(expected one of #{names.join(', ')})"
59
60
  exit 1
60
61
  end
61
62
  deployer_class = Nanoc::Extra::Deployer.named(name) do
62
63
  $stderr.puts "The specified deploy target has an unrecognised kind (#{kind})."
63
- $stderr.puts "(expected one of #{KIND_MAPPING.keys.join(', ')})"
64
+ $stderr.puts "(expected one of #{names.join(', ')})"
64
65
  exit 1
65
66
  end
66
67
 
@@ -144,6 +144,7 @@ module Nanoc::CLI
144
144
  'cri' => 'cri',
145
145
  'erubis' => 'erubis',
146
146
  'escape' => 'escape',
147
+ 'fog' => 'fog',
147
148
  'fssm' => 'fssm',
148
149
  'haml' => 'haml',
149
150
  'json' => 'json',
data/lib/nanoc3.rb ADDED
@@ -0,0 +1,3 @@
1
+ # encoding: utf-8
2
+
3
+ require 'nanoc'
data/lib/nanoc3/cli.rb ADDED
@@ -0,0 +1,3 @@
1
+ # encoding: utf-8
2
+
3
+ require 'nanoc/cli'
@@ -0,0 +1,3 @@
1
+ # encoding: utf-8
2
+
3
+ require 'nanoc/tasks'
@@ -71,4 +71,32 @@ class Nanoc::CLI::Commands::DeployTest < MiniTest::Unit::TestCase
71
71
  end
72
72
  end
73
73
 
74
+ def test_deploy_without_kind
75
+ if_have 'systemu' do
76
+ with_site do |site|
77
+ File.open('config.yaml', 'w') do |io|
78
+ io.write "deploy:\n"
79
+ io.write " public:\n"
80
+ io.write " dst: mydestination"
81
+ end
82
+
83
+ FileUtils.mkdir_p('output')
84
+ File.open('output/blah.html', 'w') { |io| io.write 'moo' }
85
+
86
+ ios = capturing_stdio do
87
+ assert_raises SystemExit do
88
+ Nanoc::CLI.run %w( deploy -t public )
89
+ end
90
+ end
91
+
92
+ assert ios[:stdout].empty?
93
+ assert ios[:stderr].include?('The specified deploy target does not have a kind.')
94
+ assert ios[:stderr].include?('(expected one of ')
95
+
96
+ refute File.directory?('mydestination')
97
+ refute File.file?('mydestination/blah.html')
98
+ end
99
+ end
100
+ end
101
+
74
102
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-12 00:00:00.000000000 Z
12
+ date: 2012-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cri
16
- requirement: &70219118237300 !ruby/object:Gem::Requirement
16
+ requirement: &70230609637420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70219118237300
24
+ version_requirements: *70230609637420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: minitest
27
- requirement: &70219118236520 !ruby/object:Gem::Requirement
27
+ requirement: &70230609637020 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70219118236520
35
+ version_requirements: *70230609637020
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: mocha
38
- requirement: &70219118235600 !ruby/object:Gem::Requirement
38
+ requirement: &70230609636560 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70219118235600
46
+ version_requirements: *70230609636560
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &70219118234900 !ruby/object:Gem::Requirement
49
+ requirement: &70230609652500 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70219118234900
57
+ version_requirements: *70230609652500
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rdiscount
60
- requirement: &70219118250340 !ruby/object:Gem::Requirement
60
+ requirement: &70230609652080 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70219118250340
68
+ version_requirements: *70230609652080
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: yard
71
- requirement: &70219118249240 !ruby/object:Gem::Requirement
71
+ requirement: &70230609651660 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70219118249240
79
+ version_requirements: *70230609651660
80
80
  description: nanoc is a simple but very flexible static site generator written in
81
81
  Ruby. It operates on local files, and therefore does not run on the server. nanoc
82
82
  “compiles” the local source files into HTML (usually), by evaluating eRuby, Markdown,
@@ -228,6 +228,9 @@ files:
228
228
  - lib/nanoc/tasks/validate.rake
229
229
  - lib/nanoc/tasks.rb
230
230
  - lib/nanoc.rb
231
+ - lib/nanoc3/cli.rb
232
+ - lib/nanoc3/tasks.rb
233
+ - lib/nanoc3.rb
231
234
  - tasks/doc.rake
232
235
  - tasks/test.rake
233
236
  - test/base/core_ext/array_spec.rb
@@ -366,7 +369,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
366
369
  version: '0'
367
370
  requirements: []
368
371
  rubyforge_project:
369
- rubygems_version: 1.8.10
372
+ rubygems_version: 1.8.16
370
373
  signing_key:
371
374
  specification_version: 3
372
375
  summary: a web publishing system written in Ruby for building small to medium-sized