octopress 3.0.0.rc.10 → 3.0.0.rc.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -3
- data/README.md +2 -2
- data/assets/docs/changelog.markdown +8 -3
- data/assets/docs/index.markdown +2 -2
- data/lib/octopress.rb +1 -2
- data/lib/octopress/configuration.rb +5 -5
- data/lib/octopress/page.rb +1 -1
- data/lib/octopress/utils.rb +42 -0
- data/lib/octopress/version.rb +1 -1
- data/octopress.gemspec +2 -2
- metadata +15 -8
- data/lib/octopress/ext/hash.rb +0 -45
- data/lib/octopress/ext/titlecase.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f890b49b0468bf8cea9498b00ab637505eb9bf62
|
4
|
+
data.tar.gz: 8e9b290d772534b231f13eef5cedf218aa4f46e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bad3975b63a5d5c4d35451f62b1fd6609824df851ce780d3534c12ad88fb85e67832a0c7a6ccfa8856e5b83dd04d02fa83bad193308ef52c4beaeb5ae77fd6f
|
7
|
+
data.tar.gz: 49f2e67e03d06fba6f38c11eba0f98436cb0f0c7f711907974493658fbd1042beb7924eeef79db1f4e8a51b0708aeda99a58d6dbe4f5805454b30fa217ff9826
|
data/CHANGELOG.md
CHANGED
@@ -2,9 +2,16 @@
|
|
2
2
|
|
3
3
|
## Current released version
|
4
4
|
|
5
|
+
### 3.0.0 RC11 - 2014-19-07
|
6
|
+
|
7
|
+
- Replaced Hash extensions with Jekyll utility methods
|
8
|
+
- Replaced String extension "titlecase" with Octopress utility method
|
9
|
+
|
10
|
+
## Past versions
|
11
|
+
|
5
12
|
### 3.0.0 RC10 - 2014-05-07
|
6
13
|
|
7
|
-
- Now using SafeYAML.load instead of YAML.safe_load
|
14
|
+
- Now using SafeYAML.load instead of YAML.safe_load [#38](https://github.com/octopress/octopress/issues/38)
|
8
15
|
|
9
16
|
### 3.0.0 RC9 - 2014-05-07
|
10
17
|
|
@@ -19,8 +26,6 @@
|
|
19
26
|
- Fixed Time.parse with `--date` option on new posts and pages.
|
20
27
|
- Bumped Jekyll to 1.5.
|
21
28
|
|
22
|
-
## Past versions
|
23
|
-
|
24
29
|
### 3.0.0 RC6 - 2014-03-22
|
25
30
|
|
26
31
|
- Added support for octopress-ink documentation system.
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Octopress is an obsessively designed toolkit for writing and deploying Jekyll bl
|
|
10
10
|
|
11
11
|
Add this line to your application's Gemfile:
|
12
12
|
|
13
|
-
gem 'octopress', '~> 3.0.0.rc.
|
13
|
+
gem 'octopress', '~> 3.0.0.rc.11'
|
14
14
|
|
15
15
|
And then execute:
|
16
16
|
|
@@ -40,7 +40,7 @@ Run `octopress [command] --help` to learn more about any command and see its opt
|
|
40
40
|
|
41
41
|
### Deployment
|
42
42
|
|
43
|
-
You can deploy your Octopress or
|
43
|
+
You can deploy your Octopress or Jekyll blog via git, rsync or Amazon S3. The deployment system ships with the [octopress-deploy][] gem which extends the Octopress CLI with the `deploy` command.
|
44
44
|
|
45
45
|
[octopress-deploy]: https://github.com/octopress/deploy
|
46
46
|
|
@@ -5,9 +5,16 @@ permalink: /changelog/
|
|
5
5
|
|
6
6
|
## Current released version
|
7
7
|
|
8
|
+
### 3.0.0 RC11 - 2014-19-07
|
9
|
+
|
10
|
+
- Replaced Hash extensions with Jekyll utility methods
|
11
|
+
- Replaced String extension "titlecase" with Octopress utility method
|
12
|
+
|
13
|
+
## Past versions
|
14
|
+
|
8
15
|
### 3.0.0 RC10 - 2014-05-07
|
9
16
|
|
10
|
-
- Now using SafeYAML.load instead of YAML.safe_load
|
17
|
+
- Now using SafeYAML.load instead of YAML.safe_load [#38](https://github.com/octopress/octopress/issues/38)
|
11
18
|
|
12
19
|
### 3.0.0 RC9 - 2014-05-07
|
13
20
|
|
@@ -22,8 +29,6 @@ permalink: /changelog/
|
|
22
29
|
- Fixed Time.parse with `--date` option on new posts and pages.
|
23
30
|
- Bumped Jekyll to 1.5.
|
24
31
|
|
25
|
-
## Past versions
|
26
|
-
|
27
32
|
### 3.0.0 RC6 - 2014-03-22
|
28
33
|
|
29
34
|
- Added support for octopress-ink documentation system.
|
data/assets/docs/index.markdown
CHANGED
@@ -12,7 +12,7 @@ Octopress is an obsessively designed toolkit for writing and deploying Jekyll bl
|
|
12
12
|
|
13
13
|
Add this line to your application's Gemfile:
|
14
14
|
|
15
|
-
gem 'octopress', '~> 3.0.0.rc.
|
15
|
+
gem 'octopress', '~> 3.0.0.rc.11'
|
16
16
|
|
17
17
|
And then execute:
|
18
18
|
|
@@ -42,7 +42,7 @@ Run `octopress [command] --help` to learn more about any command and see its opt
|
|
42
42
|
|
43
43
|
### Deployment
|
44
44
|
|
45
|
-
You can deploy your Octopress or
|
45
|
+
You can deploy your Octopress or Jekyll blog via git, rsync or Amazon S3. The deployment system ships with the [octopress-deploy][] gem which extends the Octopress CLI with the `deploy` command.
|
46
46
|
|
47
47
|
[octopress-deploy]: https://github.com/octopress/deploy
|
48
48
|
|
data/lib/octopress.rb
CHANGED
@@ -16,13 +16,13 @@ module Octopress
|
|
16
16
|
user_config = {}
|
17
17
|
|
18
18
|
if File.exist? file
|
19
|
-
user_config = SafeYAML.
|
19
|
+
user_config = SafeYAML.load_file(file) || {}
|
20
20
|
end
|
21
21
|
|
22
|
-
user_config =
|
23
|
-
user_config = (options['defaults'] || {}
|
22
|
+
user_config = Jekyll::Utils.deep_merge_hashes(user_config, options['override'] || {})
|
23
|
+
user_config = Jekyll::Utils.deep_merge_hashes(options['defaults'] || {}, user_config)
|
24
24
|
|
25
|
-
@config =
|
25
|
+
@config = Jekyll::Utils.deep_merge_hashes(DEFAULTS, user_config)
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.jekyll_config(options={})
|
@@ -32,7 +32,7 @@ module Octopress
|
|
32
32
|
|
33
33
|
(options['config'] || ['_config.yml']).each do |file|
|
34
34
|
if File.exist? file
|
35
|
-
configs = configs
|
35
|
+
configs = Jekyll::Utils.deep_merge_hashes(configs, SafeYAML.load_file(file) || {})
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
data/lib/octopress/page.rb
CHANGED
@@ -106,7 +106,7 @@ module Octopress
|
|
106
106
|
# Render Liquid vars in YAML front-matter.
|
107
107
|
def parse_template(input)
|
108
108
|
|
109
|
-
@options['title']
|
109
|
+
Octopress::Utils.titlecase!(@options['title']) if @config['titlecase']
|
110
110
|
# If possible only parse the YAML front matter.
|
111
111
|
# If YAML front-matter dashes aren't present parse the whole
|
112
112
|
# template and add dashes.
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Octopress
|
2
|
+
module Utils
|
3
|
+
|
4
|
+
# Smart capitalization for titles
|
5
|
+
#
|
6
|
+
def self.titlecase(input)
|
7
|
+
small_words = %w(a an and as at but by en for if in of on or the to v v. via vs vs.)
|
8
|
+
|
9
|
+
x = input.split(" ").map do |word|
|
10
|
+
# note: word could contain non-word characters!
|
11
|
+
# downcase all small_words, capitalize the rest
|
12
|
+
small_words.include?(word.gsub(/\W/, "").downcase) ? word.downcase! : smart_capitalize!(word)
|
13
|
+
word
|
14
|
+
end
|
15
|
+
# capitalize first and last words
|
16
|
+
smart_capitalize!(x.first)
|
17
|
+
smart_capitalize!(x.last)
|
18
|
+
# small words are capitalized after colon, period, exclamation mark, question mark
|
19
|
+
x.join(" ").gsub(/(:|\.|!|\?)\s?(\W*#{small_words.join("|")}\W*)\s/) { "#{$1} #{smart_capitalize($2)} " }
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.titlecase!(input)
|
23
|
+
input.replace(titlecase(input))
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.smart_capitalize(input)
|
27
|
+
target = input.dup
|
28
|
+
# ignore any leading crazy characters and capitalize the first real character
|
29
|
+
if target =~ /^['"\(\[']*([a-z])/
|
30
|
+
i = input.index($1)
|
31
|
+
x = target[i,target.length]
|
32
|
+
# word with capitals and periods mid-word are left alone
|
33
|
+
target[i,1] = target[i,1].upcase unless x =~ /[A-Z]/ or x =~ /\.\w+/
|
34
|
+
end
|
35
|
+
target
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.smart_capitalize!(input)
|
39
|
+
input.replace(smart_capitalize(input))
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/octopress/version.rb
CHANGED
data/octopress.gemspec
CHANGED
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_runtime_dependency "mercenary", "~> 0.3.2"
|
22
|
-
spec.add_runtime_dependency "jekyll", "~> 2.0"
|
22
|
+
spec.add_runtime_dependency "jekyll", "~> 2.0"
|
23
23
|
|
24
|
-
|
24
|
+
spec.add_development_dependency "octopress-ink"
|
25
25
|
spec.add_development_dependency "bundler", "~> 1.3"
|
26
26
|
spec.add_development_dependency "pry-debugger"
|
27
27
|
spec.add_development_dependency "rake"
|
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.11
|
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-05-
|
12
|
+
date: 2014-05-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mercenary
|
@@ -32,9 +32,6 @@ dependencies:
|
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '2.0'
|
35
|
-
- - ">="
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: 2.0.0
|
38
35
|
type: :runtime
|
39
36
|
prerelease: false
|
40
37
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,9 +39,20 @@ dependencies:
|
|
42
39
|
- - "~>"
|
43
40
|
- !ruby/object:Gem::Version
|
44
41
|
version: '2.0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: octopress-ink
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
45
46
|
- - ">="
|
46
47
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
48
56
|
- !ruby/object:Gem::Dependency
|
49
57
|
name: bundler
|
50
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -119,11 +127,10 @@ files:
|
|
119
127
|
- lib/octopress/configuration.rb
|
120
128
|
- lib/octopress/docs.rb
|
121
129
|
- lib/octopress/draft.rb
|
122
|
-
- lib/octopress/ext/hash.rb
|
123
|
-
- lib/octopress/ext/titlecase.rb
|
124
130
|
- lib/octopress/page.rb
|
125
131
|
- lib/octopress/post.rb
|
126
132
|
- lib/octopress/scaffold.rb
|
133
|
+
- lib/octopress/utils.rb
|
127
134
|
- lib/octopress/version.rb
|
128
135
|
- octopress.gemspec
|
129
136
|
- scaffold/_octopress.yml
|
data/lib/octopress/ext/hash.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
class Hash
|
2
|
-
# Merges self with another hash, recursively.
|
3
|
-
#
|
4
|
-
# This code was lovingly stolen from some random gem:
|
5
|
-
# http://gemjack.com/gems/tartan-0.1.1/classes/Hash.html
|
6
|
-
#
|
7
|
-
# Thanks to whoever made it.
|
8
|
-
def deep_merge(hash)
|
9
|
-
target = dup
|
10
|
-
hash.keys.each do |key|
|
11
|
-
if hash[key].is_a? Hash and self[key].is_a? Hash
|
12
|
-
target[key] = target[key].deep_merge(hash[key])
|
13
|
-
next
|
14
|
-
end
|
15
|
-
target[key] = hash[key]
|
16
|
-
end
|
17
|
-
|
18
|
-
target
|
19
|
-
end
|
20
|
-
|
21
|
-
def to_symbol_keys
|
22
|
-
inject({}) do |memo, (k, v)|
|
23
|
-
if v.is_a? Hash
|
24
|
-
memo[k.to_sym] = v.to_symbol_keys
|
25
|
-
else
|
26
|
-
memo[k.to_sym] = v
|
27
|
-
end
|
28
|
-
|
29
|
-
memo
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def to_string_keys
|
34
|
-
inject({}) do |memo, (k, v)|
|
35
|
-
if v.is_a? Hash
|
36
|
-
memo[k.to_s] = v.to_string_keys
|
37
|
-
else
|
38
|
-
memo[k.to_s] = v
|
39
|
-
end
|
40
|
-
|
41
|
-
memo
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
@@ -1,37 +0,0 @@
|
|
1
|
-
class String
|
2
|
-
def titlecase
|
3
|
-
small_words = %w(a an and as at but by en for if in of on or the to v v. via vs vs.)
|
4
|
-
|
5
|
-
x = split(" ").map do |word|
|
6
|
-
# note: word could contain non-word characters!
|
7
|
-
# downcase all small_words, capitalize the rest
|
8
|
-
small_words.include?(word.gsub(/\W/, "").downcase) ? word.downcase! : word.smart_capitalize!
|
9
|
-
word
|
10
|
-
end
|
11
|
-
# capitalize first and last words
|
12
|
-
x.first.to_s.smart_capitalize!
|
13
|
-
x.last.to_s.smart_capitalize!
|
14
|
-
# small words are capitalized after colon, period, exclamation mark, question mark
|
15
|
-
x.join(" ").gsub(/(:|\.|!|\?)\s?(\W*#{small_words.join("|")}\W*)\s/) { "#{$1} #{$2.smart_capitalize} " }
|
16
|
-
end
|
17
|
-
|
18
|
-
def titlecase!
|
19
|
-
replace(titlecase)
|
20
|
-
end
|
21
|
-
|
22
|
-
def smart_capitalize
|
23
|
-
target = dup
|
24
|
-
# ignore any leading crazy characters and capitalize the first real character
|
25
|
-
if target =~ /^['"\(\[']*([a-z])/
|
26
|
-
i = index($1)
|
27
|
-
x = target[i,target.length]
|
28
|
-
# word with capitals and periods mid-word are left alone
|
29
|
-
target[i,1] = target[i,1].upcase unless x =~ /[A-Z]/ or x =~ /\.\w+/
|
30
|
-
end
|
31
|
-
target
|
32
|
-
end
|
33
|
-
|
34
|
-
def smart_capitalize!
|
35
|
-
replace(smart_capitalize)
|
36
|
-
end
|
37
|
-
end
|