octopress 3.0.0.rc.7 → 3.0.0.rc.8

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: 59c785e8fc0a2c991a658c34c50f52da7b4b4ca0
4
- data.tar.gz: ce63bf02022b52d310125846721207f010005a38
3
+ metadata.gz: 7181311c72df30bf2bd51536204ffb32729cdbbc
4
+ data.tar.gz: 870db272c2517159439914f81b78c289b092190f
5
5
  SHA512:
6
- metadata.gz: 50806cb6a15a804aa1ebd0051455671b69f6030e6b89d106431cd4c93e4e0786cb197576b54e4f3ea950efe049541cc4e699d80d598b083e9a63a3c0183ec42a
7
- data.tar.gz: 2efc75fbf39e73fa9ccec8493c87d5d81e38d5715050d5a682a5334dd523060bf8459a4d21b1782df0bef9924dcd5e461ea5c249547416809110904bb13ab069
6
+ metadata.gz: 8faa5b4e17b749720394be730ea8880a243b4ae09fba9166f5f75fff4e3212b25fae705d91bf726359aee948054a93c358c389c17c48822f3305902b79dab7f7
7
+ data.tar.gz: 84a04d179116e46154689aa89bcd06eb09b108151110c415f55deae5acb682290ade34191859d0aa7ce5448bc539b87499b9969b38fa1bf4c53a0b2e98e21db3
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Current released version
4
4
 
5
+ ### 3.0.0 RC8 - 2014-05-02
6
+
7
+ - Improved draft date management [#35](https://github.com/octopress/octopress/issues/35)
8
+
5
9
  ### 3.0.0 RC7 - 2014-03-24
6
10
 
7
11
  - Fixed Time.parse with `--date` option on new posts and pages.
@@ -5,6 +5,10 @@ permalink: /changelog/
5
5
 
6
6
  ## Current released version
7
7
 
8
+ ### 3.0.0 RC8 - 2014-05-02
9
+
10
+ - Improved draft date management [#35](https://github.com/octopress/octopress/issues/35)
11
+
8
12
  ### 3.0.0 RC7 - 2014-03-24
9
13
 
10
14
  - Fixed Time.parse with `--date` option on new posts and pages.
@@ -20,7 +20,7 @@ module Octopress
20
20
 
21
21
  def self.add_page_options(c)
22
22
  c.option 'template', '--template PATH', "New #{c.name.to_s} from a template."
23
- c.option 'date', '--date DATE', "Use 'now' or a String that is parseable by Time#parse. (default: Time.now.iso8601)"
23
+ c.option 'date', '--date DATE', "Use 'now' or a String that is parseable by Time#parse."
24
24
  c.option 'force', '--force', 'Overwrite file if it already exists'
25
25
  end
26
26
 
@@ -8,8 +8,8 @@ module Octopress
8
8
  @options['extension'] ||= @config['post_ext']
9
9
  @options['template'] ||= @config['post_template']
10
10
 
11
- if @options['type'] == 'draft'
12
- @options['date'] = convert_date @options['date']
11
+ if @options['date']
12
+ @options['date'] = convert_date @options['date']
13
13
  end
14
14
  end
15
15
 
@@ -28,13 +28,12 @@ module Octopress
28
28
  # and options passed to the publish command
29
29
  #
30
30
  def publish
31
- @options['date'] ||= read_draft_date
32
- @options['date'] = convert_date @options['date']
31
+ @options['date'] ||= read_draft_date || Time.now.iso8601
33
32
 
34
33
  post_options = {
35
34
  'title' => read_draft_title,
36
- 'slug' => publish_slug,
37
35
  'date' => @options['date'],
36
+ 'slug' => publish_slug,
38
37
  'content' => read_draft_content,
39
38
  'dir' => @options['dir'],
40
39
  'type' => 'post from draft'
@@ -71,24 +70,40 @@ module Octopress
71
70
  # Get title from draft post file
72
71
  #
73
72
  def read_draft_title
74
- read.match(/title:\s+(.+)?$/)[1]
73
+ match = read.match(/title:\s+(.+)?$/)
74
+ match[1] if match
75
75
  end
76
76
 
77
77
  # read_draft_date
78
78
  #
79
79
  def read_draft_date
80
- read.match(/date:\s+(.+)?$/)[1]
80
+ match = read.match(/date:\s+(.+)?$/)
81
+ match[1] if match
81
82
  end
82
83
 
83
84
  # Get content from draft post file
85
+ # also update the draft's date configuration
84
86
  #
85
87
  def read_draft_content
86
88
  if @options['date']
87
- read.sub(/date:\s+.+?$/, "date: #{@options['date']}")
89
+ # remove date if it exists
90
+ content = read.sub(/date:\s+.+?\n/, "")
91
+
92
+ # Insert date after title
93
+ content.sub(/(title:.+$)/i, '\1'+"\ndate: #{@options['date']}")
88
94
  else
89
95
  read
90
96
  end
91
97
  end
92
98
 
99
+ # Draft template defaults
100
+ #
101
+ def default_content
102
+ if @options['date']
103
+ front_matter %w{layout title date}
104
+ else
105
+ front_matter %w{layout title}
106
+ end
107
+ end
93
108
  end
94
109
  end
@@ -1,3 +1,3 @@
1
1
  module Octopress
2
- VERSION = "3.0.0.rc.7"
2
+ VERSION = "3.0.0.rc.8"
3
3
  end
@@ -0,0 +1 @@
1
+ timezone: GMT
data/test/test.rb CHANGED
@@ -13,7 +13,8 @@ FileUtils.cd('test-site') do |dir|
13
13
  cmd: [
14
14
  'octopress new . --blank',
15
15
  'echo "<div class=\'post\'>{{ page.title }}{{ content }}</div>" > _layouts/post.html',
16
- 'echo "<div class=\'page\'>{{ page.title }}{{ content }}</div>" > _layouts/page.html'
16
+ 'echo "<div class=\'page\'>{{ page.title }}{{ content }}</div>" > _layouts/page.html',
17
+ 'echo "timezone: GMT" > _config.yml'
17
18
  ],
18
19
  expect: "New jekyll site installed in ."
19
20
  })
data/test/test_suite.rb CHANGED
@@ -62,7 +62,11 @@ end
62
62
  def test(options)
63
63
  if cmd = options[:cmd]
64
64
  cmd = [cmd] unless cmd.is_a? Array
65
- output = `#{cmd.join('; ')}`.gsub(/#{Dir.pwd}\/*/,'').strip
65
+ if options[:debug]
66
+ system cmd.join('; ')
67
+ else
68
+ output = `#{cmd.join('; ')}`.gsub(/#{Dir.pwd}\/*/,'').strip
69
+ end
66
70
  if options[:expect].strip == output
67
71
  pout '.'.green
68
72
  else
@@ -93,7 +97,7 @@ def print_results
93
97
  if test[:message]
94
98
  puts test[:message].yellow
95
99
  else
96
- puts test[:expected].green
100
+ puts (test[:expected] || '').green
97
101
  puts test[:result].red
98
102
  end
99
103
  # print a newline for easier reading
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.7
4
+ version: 3.0.0.rc.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
@@ -9,96 +9,96 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-25 00:00:00.000000000 Z
12
+ date: 2014-05-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mercenary
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: 0.3.2
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
27
  version: 0.3.2
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: jekyll
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ~>
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
34
  version: '1.5'
35
- - - '>='
35
+ - - ">="
36
36
  - !ruby/object:Gem::Version
37
37
  version: 1.5.0
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - ~>
42
+ - - "~>"
43
43
  - !ruby/object:Gem::Version
44
44
  version: '1.5'
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.5.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: octopress-ink
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: bundler
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.3'
69
69
  type: :development
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.3'
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: pry-debugger
78
78
  requirement: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  - !ruby/object:Gem::Dependency
91
91
  name: rake
92
92
  requirement: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  description: Octopress is an obsessively designed framework for Jekyll blogging. It’s
@@ -111,8 +111,8 @@ executables:
111
111
  extensions: []
112
112
  extra_rdoc_files: []
113
113
  files:
114
- - .gitignore
115
- - .travis.yml
114
+ - ".gitignore"
115
+ - ".travis.yml"
116
116
  - CHANGELOG.md
117
117
  - Gemfile
118
118
  - LICENSE
@@ -143,6 +143,7 @@ files:
143
143
  - scaffold/_octopress.yml
144
144
  - scaffold/_templates/page
145
145
  - scaffold/_templates/post
146
+ - test/expected/_config.yml
146
147
  - test/expected/_drafts/stupid-idea.markdown
147
148
  - test/expected/_layouts/page.html
148
149
  - test/expected/_layouts/post.html
@@ -181,22 +182,23 @@ require_paths:
181
182
  - lib
182
183
  required_ruby_version: !ruby/object:Gem::Requirement
183
184
  requirements:
184
- - - '>='
185
+ - - ">="
185
186
  - !ruby/object:Gem::Version
186
187
  version: '0'
187
188
  required_rubygems_version: !ruby/object:Gem::Requirement
188
189
  requirements:
189
- - - '>'
190
+ - - ">"
190
191
  - !ruby/object:Gem::Version
191
192
  version: 1.3.1
192
193
  requirements: []
193
194
  rubyforge_project:
194
- rubygems_version: 2.1.11
195
+ rubygems_version: 2.2.2
195
196
  signing_key:
196
197
  specification_version: 4
197
198
  summary: Octopress is an obsessively designed framework for Jekyll blogging. It’s
198
199
  easy to configure and easy to deploy. Sweet huh?
199
200
  test_files:
201
+ - test/expected/_config.yml
200
202
  - test/expected/_drafts/stupid-idea.markdown
201
203
  - test/expected/_layouts/page.html
202
204
  - test/expected/_layouts/post.html