octopress 3.0.0.alpha6 → 3.0.0.alpha7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c62527f5ef1b7b0e75d335abc472f1cf5dbb21d
4
- data.tar.gz: 30988331da408ed9f8ae6d39160dcaf9dc5ee01c
3
+ metadata.gz: 1652fdb31e927325dd2d90571f8dab99be6dfe7d
4
+ data.tar.gz: a214422e3a4c98cd014c57cc91bc036b93778a23
5
5
  SHA512:
6
- metadata.gz: 7a046d7353d0acf7f3baf45e4ebe5c29eb546f660a138a0610c81dbc033d6977151f7ab923d83e596db445cd4340ab09a7201ebcdd066c4136597b9a0257121f
7
- data.tar.gz: 85237ccbced52a8ae86ad2d1c24df0527f76c90aa5dda09eaafcd11cf40814929e12c4a8ea6d3c062a54d2ed3d240818d8e8bc2e3d5f2bd2f1a3166fe90c4c9f
6
+ metadata.gz: b699385d7fc6d6473c78ce88e8f0c759994eb32e6f8fe130cdfd25fcaa518b43b3e4543b86e34e4ae6a8522c361a4af89abcd01145b2eceaac2c7ca195af0568
7
+ data.tar.gz: 35219bf6f8ebbddfeaf2ce04906ed20c1978c698bf979f768959cab9a49a987772a31ee9fb4d3db87d3dafb1deb06a47445bc5eeb32d80ae08a4c1ba115e8cf1
@@ -1,3 +1,5 @@
1
+ require 'mercenary'
2
+
1
3
  module Octopress
2
4
  require 'octopress/core_ext'
3
5
  require 'octopress/configuration'
@@ -20,7 +22,7 @@ module Octopress
20
22
  ]
21
23
 
22
24
  def self.logger
23
- @logger ||= Logger.new(STDOUT)
25
+ @logger ||= Mercenary::Command.logger
24
26
  @logger.level = Logger::DEBUG
25
27
  @logger
26
28
  end
@@ -1,7 +1,7 @@
1
1
  module Octopress
2
2
  module CommandHelpers
3
3
  def self.add_build_options(c)
4
- c.option 'config', '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
4
+ c.option 'config', '--config <CONFIG_FILE>[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
5
5
  c.option 'future', '--future', 'Publishes posts with a future date'
6
6
  c.option 'limit_posts', '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
7
7
  c.option 'watch', '--watch', 'Watch for changes and rebuild'
@@ -18,8 +18,8 @@ module Octopress
18
18
  end
19
19
 
20
20
  def self.add_common_options(c)
21
+ c.option 'template', '--template PATH', "New #{c.name.to_s} from a template. PATH is relative to _templates/"
21
22
  c.option 'date', '--date DATE', 'String that is parseable by Time#parse. (default: Time.now.iso8601)'
22
- c.option 'template', '--template PATH', 'Path to a post or page template.'
23
23
  c.option 'force', '--force', 'Force creation even if PATH already exists'
24
24
  end
25
25
  end
@@ -4,31 +4,33 @@ module Octopress
4
4
  class New < Command
5
5
  def self.init_with_program(p)
6
6
  p.command(:new) do |c|
7
- c.syntax 'octopress new PATH'
8
- c.description 'Creates a new Jekyll site scaffold in PATH'
9
- c.option 'force', '--force', 'Force creation even if PATH already exists'
7
+ c.syntax 'new <path>'
8
+ c.description 'Creates a new Jekyll site scaffold in path'
9
+ c.option 'force', '--force', 'Force creation even if path already exists'
10
10
  c.option 'blank', '--blank', 'Creates scaffolding but with empty files'
11
11
 
12
12
  c.action do |args, options|
13
- abort "You must specify a path." if args.empty?
14
- ::Jekyll::Commands::New.process(args, options.to_symbol_keys)
13
+ if args.empty?
14
+ c.logger.error "You must specify a path."
15
+ else
16
+ ::Jekyll::Commands::New.process(args, options.to_symbol_keys)
17
+ end
15
18
  end
16
19
 
17
20
  c.command(:page) do |page_command|
18
- page_command.syntax 'octopress new page PATH [options]'
21
+ page_command.syntax 'page <PATH> [options]'
19
22
  page_command.description 'Add a new page to your Jekyll site.'
20
23
  page_command.option 'title', '--title TITLE', 'String to be added as the title in the YAML front-matter.'
21
24
  CommandHelpers.add_common_options page_command
22
25
 
23
26
  page_command.action do |args, options|
24
- abort "You must specify a path." if args.empty?
25
27
  options['path'] = args.first
26
28
  Page.new(options).write
27
29
  end
28
30
  end
29
31
 
30
32
  c.command(:post) do |post_command|
31
- post_command.syntax 'octopress new post TITLE [options]'
33
+ post_command.syntax 'post <TITLE> [options]'
32
34
  post_command.description 'Add a new post to your Jekyll site.'
33
35
  CommandHelpers.add_common_options post_command
34
36
 
@@ -39,7 +41,7 @@ module Octopress
39
41
  end
40
42
 
41
43
  c.command(:draft) do |draft_command|
42
- draft_command.syntax 'octopress new draft TITLE [options]'
44
+ draft_command.syntax 'draft <TITLE> [options]'
43
45
  draft_command.description 'Add a new draft post to your Jekyll site.'
44
46
  CommandHelpers.add_common_options draft_command
45
47
 
@@ -17,7 +17,6 @@ module Octopress
17
17
  if File.exist? file
18
18
  config = YAML.safe_load(File.open(file))
19
19
  end
20
- #config['jekyll'] = jekyll_config(options)
21
20
  @config = DEFAULTS.deep_merge(config)
22
21
  end
23
22
 
@@ -10,7 +10,7 @@ module Octopress
10
10
 
11
11
  def write
12
12
  if File.exist?(path) && !@options['force']
13
- abort "File #{relative_path} already exists"
13
+ raise "File #{relative_path} already exists. Use --force to overwrite."
14
14
  end
15
15
 
16
16
  FileUtils.mkdir_p(File.dirname(path))
@@ -34,6 +34,7 @@ module Octopress
34
34
  def path
35
35
  return @path if @path
36
36
  file = @options['path']
37
+ raise "You must specify a path." unless file
37
38
 
38
39
  # If path ends with a slash, make it an index
39
40
  file += "index" if file =~ /\/$/
@@ -4,10 +4,10 @@ module Octopress
4
4
  def set_default_options
5
5
  @options['type'] ||= 'post'
6
6
  @options['layout'] = @config['new_post_layout']
7
- @options['title'] ||= 'New Post'
8
7
  @options['date'] = convert_date @options['date'] || Time.now
9
8
  @options['extension'] ||= @config['new_post_extension']
10
9
  @options['template'] ||= @config['new_post_template']
10
+ raise "You must specify a title." if @options['title'].nil?
11
11
  end
12
12
 
13
13
  def path
@@ -1,3 +1,3 @@
1
1
  module Octopress
2
- VERSION = "3.0.0.alpha6"
2
+ VERSION = "3.0.0.alpha7"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency "mercenary", "~> 0.3.0"
21
+ spec.add_runtime_dependency "mercenary", "~> 0.3.1"
22
22
  spec.add_runtime_dependency "jekyll", "~> 1.4.2"
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.3"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.alpha6
4
+ version: 3.0.0.alpha7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-21 00:00:00.000000000 Z
12
+ date: 2014-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mercenary
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
- version: 0.3.0
20
+ version: 0.3.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
- version: 0.3.0
27
+ version: 0.3.1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: jekyll
30
30
  requirement: !ruby/object:Gem::Requirement