octopress 3.0.0.alpha7 → 3.0.0.alpha8
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/.gitignore +1 -0
- data/docs/_octopress.yml +1 -0
- data/docs/index.html +1 -0
- data/lib/octopress.rb +2 -1
- data/lib/octopress/commands/build.rb +1 -0
- data/lib/octopress/commands/docs.rb +55 -23
- data/lib/octopress/commands/helpers.rb +2 -1
- data/lib/octopress/commands/new.rb +1 -1
- data/lib/octopress/commands/serve.rb +2 -0
- data/lib/octopress/configuration.rb +1 -1
- data/lib/octopress/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f9b1847085d24d5bdfcfc8c587c68d416bd9d95
|
4
|
+
data.tar.gz: f4dde30b1c537623df72a4d3bca0f99f308292e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 439892300f2b23d9c19547ab05dbd409388db470f78069d2ae53339fea3079f1b0db1f3086a66adc304e4ed86dc45554d6f74b5987c58d5ac4966ec6c07a78e3
|
7
|
+
data.tar.gz: 67f5ca769098c7f138dc24791a8b36c50dc837591095e772bb9fb4570997c03a797649b2f119be9a384b83eb599ba33bcb324b2d7f3ad7600058af418d53e49c
|
data/.gitignore
CHANGED
data/docs/_octopress.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
docs_mode: true
|
data/docs/index.html
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
OMG DOCS
|
data/lib/octopress.rb
CHANGED
@@ -10,6 +10,7 @@ module Octopress
|
|
10
10
|
CommandHelpers.add_build_options(c)
|
11
11
|
|
12
12
|
c.action do |args, options|
|
13
|
+
Octopress.config(options)
|
13
14
|
options = CommandHelpers.normalize_options(options)
|
14
15
|
options = ::Jekyll.configuration(options.to_symbol_keys)
|
15
16
|
::Jekyll::Commands::Build.process(options)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'jekyll'
|
2
|
+
require 'yaml'
|
2
3
|
require File.expand_path('helpers', File.dirname(__FILE__))
|
3
4
|
|
4
5
|
module Octopress
|
@@ -6,35 +7,66 @@ module Octopress
|
|
6
7
|
def self.init_with_program(p)
|
7
8
|
p.command(:docs) do |c|
|
8
9
|
c.syntax 'octopress docs'
|
9
|
-
c.description "
|
10
|
+
c.description "Launch local server with docs for Octopress v#{Octopress::VERSION} and Octopress Ink plugins."
|
10
11
|
|
11
12
|
c.option 'port', '-P', '--port [PORT]', 'Port to listen on'
|
12
13
|
c.option 'host', '-H', '--host [HOST]', 'Host to bind to'
|
14
|
+
if ENV['OCTODEV']
|
15
|
+
c.option 'watch', '--watch', 'Watch docs site for changes and rebuild. (For docs development)'
|
16
|
+
end
|
13
17
|
c.option 'jekyll', '--jekyll', "Launch local server with docs for Jekyll v#{Jekyll::VERSION}"
|
14
18
|
|
15
19
|
c.action do |args, options|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
20
|
+
serve_docs(options)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.serve_docs(options)
|
26
|
+
if options['jekyll']
|
27
|
+
options = init_jekyll_docs(options)
|
28
|
+
else
|
29
|
+
options = init_octopress_docs(options)
|
30
|
+
end
|
31
|
+
options["serving"] = true
|
32
|
+
options = CommandHelpers.normalize_options(options)
|
33
|
+
options = ::Jekyll.configuration(options.to_symbol_keys)
|
34
|
+
::Jekyll::Commands::Build.process(options)
|
35
|
+
::Jekyll::Commands::Serve.process(options)
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.init_octopress_docs(options)
|
39
|
+
Octopress.config({'octopress-config'=>File.join(site_dir, '_octopress.yml')})
|
40
|
+
require_gems
|
41
|
+
options['source'] = site_dir
|
42
|
+
options['destination'] = File.join(site_dir, '_site')
|
43
|
+
options
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.init_jekyll_docs(options)
|
47
|
+
options.delete('jekyll')
|
48
|
+
|
49
|
+
# Find local Jekyll gem path
|
50
|
+
#
|
51
|
+
spec = Gem::Specification.find_by_name("jekyll")
|
52
|
+
gem_path = spec.gem_dir
|
53
|
+
|
54
|
+
options['source'] = "#{gem_path}/site",
|
55
|
+
options['destination'] = "#{gem_path}/site/_site"
|
56
|
+
options
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.site_dir
|
60
|
+
File.expand_path('docs', File.join(File.dirname(__FILE__), '../../../', ))
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.require_gems
|
64
|
+
file = File.join(Dir.pwd, '_config.yml')
|
65
|
+
if File.exist? file
|
66
|
+
config = YAML.safe_load(File.open(file))
|
67
|
+
gems = config['gems']
|
68
|
+
if gems && gems.is_a?(Array)
|
69
|
+
gems.each {|g| require g }
|
38
70
|
end
|
39
71
|
end
|
40
72
|
end
|
@@ -1,7 +1,8 @@
|
|
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 Jekyll configuration file'
|
5
|
+
c.option 'octopress-config', '--octopress-config <CONFIG_FILE>', 'Custom Octopress configuration file'
|
5
6
|
c.option 'future', '--future', 'Publishes posts with a future date'
|
6
7
|
c.option 'limit_posts', '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
|
7
8
|
c.option 'watch', '--watch', 'Watch for changes and rebuild'
|
@@ -4,7 +4,7 @@ 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 'new <
|
7
|
+
c.syntax 'new <PATH>'
|
8
8
|
c.description 'Creates a new Jekyll site scaffold in path'
|
9
9
|
c.option 'force', '--force', 'Force creation even if path already exists'
|
10
10
|
c.option 'blank', '--blank', 'Creates scaffolding but with empty files'
|
@@ -18,6 +18,8 @@ module Octopress
|
|
18
18
|
c.option 'baseurl', '--baseurl URL', 'Base URL'
|
19
19
|
|
20
20
|
c.action do |args, options|
|
21
|
+
Octopress.config(options)
|
22
|
+
|
21
23
|
options.default :serving => true
|
22
24
|
options = CommandHelpers.normalize_options(options)
|
23
25
|
options = ::Jekyll.configuration(options.to_symbol_keys)
|
data/lib/octopress/version.rb
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.
|
4
|
+
version: 3.0.0.alpha8
|
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-
|
12
|
+
date: 2014-03-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mercenary
|
@@ -97,6 +97,9 @@ files:
|
|
97
97
|
- README.md
|
98
98
|
- Rakefile
|
99
99
|
- bin/octopress
|
100
|
+
- docs/_octopress.yml
|
101
|
+
- docs/_site/index.html
|
102
|
+
- docs/index.html
|
100
103
|
- lib/octopress.rb
|
101
104
|
- lib/octopress/command.rb
|
102
105
|
- lib/octopress/commands/build.rb
|