octopress 3.0.0.rc.35 → 3.0.0.rc.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/octopress/commands/helpers.rb +1 -1
- data/lib/octopress/commands/new.rb +3 -3
- data/lib/octopress/draft.rb +3 -1
- data/lib/octopress/page.rb +5 -4
- data/lib/octopress/post.rb +4 -1
- data/lib/octopress/version.rb +1 -1
- data/scaffold/_templates/draft +1 -1
- data/scaffold/_templates/page +1 -1
- data/scaffold/_templates/post +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b08d794360068ba72052efefd497779499f23a45
|
4
|
+
data.tar.gz: e6797ddb7a7a2003665b2fd75c419d46ba5889f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d02e7f4f06301d06870ced806bd42b367abd157abd2c04dbcf7048c43962a064f9377daf47b3c1995d2cbca45e06f483fde98de93541310141ca63e9aeab754f
|
7
|
+
data.tar.gz: 572c1d688ff5d73962ddfb239b437e13c72b476abf5651755f637b887f04eb3422b36b9dfb540738356be2c7e9a4cd61c5a0f098fbbd00a1d8d6b3a642f1d802
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,7 @@ module Octopress
|
|
4
4
|
|
5
5
|
def add_page_options(c)
|
6
6
|
c.option 'date', '-d', '--date DATE', "Use 'now' or a String that is parseable by Time#parse."
|
7
|
-
c.option 'template', '-
|
7
|
+
c.option 'template', '-T','--template PATH', "New #{c.name.to_s} from a template."
|
8
8
|
c.option 'force', '-f', '--force', 'Overwrite file if it already exists'
|
9
9
|
end
|
10
10
|
|
@@ -26,7 +26,7 @@ module Octopress
|
|
26
26
|
|
27
27
|
c.action do |args, options|
|
28
28
|
if args.empty?
|
29
|
-
c.logger.error "Plese
|
29
|
+
c.logger.error "Plese pass a path for your new page."
|
30
30
|
puts c
|
31
31
|
else
|
32
32
|
options['path'] = args.first
|
@@ -45,7 +45,7 @@ module Octopress
|
|
45
45
|
|
46
46
|
c.action do |args, options|
|
47
47
|
if args.empty?
|
48
|
-
c.logger.error "Please
|
48
|
+
c.logger.error "Please pass a title for your new post."
|
49
49
|
puts c
|
50
50
|
else
|
51
51
|
options['title'] = args.join(" ")
|
@@ -63,7 +63,7 @@ module Octopress
|
|
63
63
|
|
64
64
|
c.action do |args, options|
|
65
65
|
if args.empty?
|
66
|
-
c.logger.error "Plese
|
66
|
+
c.logger.error "Plese pass a title for your new draft."
|
67
67
|
puts c
|
68
68
|
else
|
69
69
|
options['title'] = args.join(" ")
|
data/lib/octopress/draft.rb
CHANGED
@@ -3,6 +3,7 @@ module Octopress
|
|
3
3
|
|
4
4
|
def set_default_options
|
5
5
|
@options['type'] ||= 'draft'
|
6
|
+
@options['write_message'] ||= 'New draft:'
|
6
7
|
|
7
8
|
if @options['title'].nil? && @options[:type] == 'post'
|
8
9
|
raise "Draft not created: Please choose a title.\n".red + " For example: " + "octopress new draft 'The merits of napping'".yellow
|
@@ -38,7 +39,8 @@ module Octopress
|
|
38
39
|
'slug' => title_slug,
|
39
40
|
'content' => read_post_content,
|
40
41
|
'dir' => @options['dir'],
|
41
|
-
'type' =>
|
42
|
+
'type' => "post from draft",
|
43
|
+
'write_message' => "Published: #{relative_path(path)} →"
|
42
44
|
}
|
43
45
|
|
44
46
|
# Create a new post file
|
data/lib/octopress/page.rb
CHANGED
@@ -17,7 +17,7 @@ module Octopress
|
|
17
17
|
@options = options
|
18
18
|
set_default_options
|
19
19
|
|
20
|
-
@front_matter = %w{
|
20
|
+
@front_matter = %w{title date}
|
21
21
|
|
22
22
|
# Ensure title
|
23
23
|
#
|
@@ -25,7 +25,7 @@ module Octopress
|
|
25
25
|
|
26
26
|
# Ensure a quoted title to avoid YAML parsing issues.
|
27
27
|
#
|
28
|
-
@options['title'] = "
|
28
|
+
@options['title'] = "#{@options['title']}"
|
29
29
|
|
30
30
|
@content = options['content'] || content
|
31
31
|
end
|
@@ -36,7 +36,7 @@ module Octopress
|
|
36
36
|
|
37
37
|
def write
|
38
38
|
if File.exist?(path) && !@options['force']
|
39
|
-
|
39
|
+
abort "File #{relative_path(path)} already exists. Use --force to overwrite."
|
40
40
|
end
|
41
41
|
|
42
42
|
dir = File.dirname(path)
|
@@ -44,7 +44,7 @@ module Octopress
|
|
44
44
|
FileUtils.mkdir_p(dir)
|
45
45
|
File.open(path, 'w') { |f| f.write(@content) }
|
46
46
|
if STDOUT.tty?
|
47
|
-
puts "
|
47
|
+
puts "#{@options['write_message']} #{relative_path(path)}"
|
48
48
|
|
49
49
|
# If path begins with an underscore the page is probably being added to a collection
|
50
50
|
#
|
@@ -97,6 +97,7 @@ module Octopress
|
|
97
97
|
|
98
98
|
def set_default_options
|
99
99
|
@options['type'] ||= 'page'
|
100
|
+
@options['write_message'] ||= 'New page:'
|
100
101
|
@options['layout'] = @config['page_layout']
|
101
102
|
if @options['date']
|
102
103
|
@options['date'] = convert_date @options['date']
|
data/lib/octopress/post.rb
CHANGED
@@ -3,6 +3,7 @@ module Octopress
|
|
3
3
|
|
4
4
|
def set_default_options
|
5
5
|
@options['type'] ||= 'post'
|
6
|
+
@options['write_message'] ||= 'New post:'
|
6
7
|
|
7
8
|
if @options['title'].nil? && @options[:type] == 'post'
|
8
9
|
raise "Post not created: Please choose a title.\n".red + " For example: " + "octopress new post \"Friendship with a tomato?\"".yellow
|
@@ -36,8 +37,10 @@ module Octopress
|
|
36
37
|
'slug' => title_slug,
|
37
38
|
'content' => read_post_content,
|
38
39
|
'dir' => @options['dir'],
|
39
|
-
'type' =>
|
40
|
+
'type' => "draft from post",
|
41
|
+
'write_message' => "Unpublished: #{relative_path(path)} →"
|
40
42
|
}
|
43
|
+
|
41
44
|
Draft.new(site, post_options).write
|
42
45
|
|
43
46
|
# Remove the old post file
|
data/lib/octopress/version.rb
CHANGED
data/scaffold/_templates/draft
CHANGED
data/scaffold/_templates/page
CHANGED
data/scaffold/_templates/post
CHANGED
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.rc.
|
4
|
+
version: 3.0.0.rc.36
|
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: 2015-
|
12
|
+
date: 2015-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mercenary
|
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
249
|
version: 1.3.1
|
250
250
|
requirements: []
|
251
251
|
rubyforge_project:
|
252
|
-
rubygems_version: 2.
|
252
|
+
rubygems_version: 2.4.6
|
253
253
|
signing_key:
|
254
254
|
specification_version: 4
|
255
255
|
summary: Octopress is an obsessively designed framework for Jekyll blogging. It’s
|