octopress 3.0.0.alpha2 → 3.0.0.alpha3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +6 -14
  2. data/.gitignore +15 -18
  3. data/Gemfile +3 -1
  4. data/LICENSE +20 -0
  5. data/README.md +66 -0
  6. data/Rakefile +1 -76
  7. data/bin/octopress +14 -58
  8. data/lib/octopress.rb +40 -79
  9. data/lib/octopress/command.rb +10 -4
  10. data/lib/octopress/commands/new.rb +50 -12
  11. data/lib/octopress/commands/publish.rb +18 -0
  12. data/lib/octopress/core_ext.rb +1 -0
  13. data/lib/octopress/draft.rb +43 -0
  14. data/lib/octopress/page.rb +109 -0
  15. data/lib/octopress/post.rb +30 -0
  16. data/lib/octopress/version.rb +1 -1
  17. data/octopress.gemspec +7 -32
  18. metadata +31 -437
  19. data/.editorconfig +0 -22
  20. data/.gitattributes +0 -1
  21. data/.powrc +0 -4
  22. data/.rspec +0 -5
  23. data/.rubocop.yml +0 -119
  24. data/.slugignore +0 -3
  25. data/.travis.yml +0 -6
  26. data/CHANGELOG.markdown +0 -46
  27. data/CONTRIBUTING.markdown +0 -17
  28. data/README.markdown +0 -37
  29. data/lib/console +0 -17
  30. data/lib/guard/jekyll.rb +0 -33
  31. data/lib/octopress/commands.rb +0 -14
  32. data/lib/octopress/commands/build.rb +0 -17
  33. data/lib/octopress/commands/build_javascripts.rb +0 -11
  34. data/lib/octopress/commands/build_jekyll.rb +0 -42
  35. data/lib/octopress/commands/build_stylesheets.rb +0 -13
  36. data/lib/octopress/commands/install.rb +0 -44
  37. data/lib/octopress/commands/scaffold.rb +0 -102
  38. data/lib/octopress/commands/serve.rb +0 -25
  39. data/lib/octopress/configuration.rb +0 -237
  40. data/lib/octopress/dependency_installer.rb +0 -287
  41. data/lib/octopress/errors.rb +0 -3
  42. data/lib/octopress/filters/content.rb +0 -66
  43. data/lib/octopress/filters/date.rb +0 -46
  44. data/lib/octopress/filters/post.rb +0 -175
  45. data/lib/octopress/filters/url.rb +0 -34
  46. data/lib/octopress/formatters.rb +0 -9
  47. data/lib/octopress/formatters/base_formatter.rb +0 -17
  48. data/lib/octopress/formatters/simple_formatter.rb +0 -9
  49. data/lib/octopress/formatters/verbose_formatter.rb +0 -9
  50. data/lib/octopress/generators/category_generator.rb +0 -196
  51. data/lib/octopress/generators/sitemap_generator.rb +0 -308
  52. data/lib/octopress/guardfile +0 -43
  53. data/lib/octopress/helpers/titlecase.rb +0 -37
  54. data/lib/octopress/ink.rb +0 -12
  55. data/lib/octopress/inquirable_string.rb +0 -12
  56. data/lib/octopress/installer.rb +0 -96
  57. data/lib/octopress/js_assets_manager.rb +0 -97
  58. data/lib/octopress/liquid_helpers/conditional.rb +0 -36
  59. data/lib/octopress/liquid_helpers/config.rb +0 -58
  60. data/lib/octopress/liquid_helpers/include.rb +0 -33
  61. data/lib/octopress/liquid_helpers/url.rb +0 -29
  62. data/lib/octopress/liquid_helpers/vars.rb +0 -30
  63. data/lib/octopress/plugin.rb +0 -33
  64. data/lib/octopress/rake.rb +0 -16
  65. data/lib/octopress/scaffold/.gitignore +0 -18
  66. data/lib/octopress/scaffold/site/Gemfile +0 -3
  67. data/lib/octopress/scaffold/site/config.ru +0 -25
  68. data/lib/octopress/scaffold/site/config/compass.rb +0 -27
  69. data/lib/octopress/scaffold/site/config/rack.rb +0 -25
  70. data/lib/octopress/scaffold/site/config/site.yml +0 -0
  71. data/lib/octopress/scaffold/site/javascripts/lib/ios-rotate-scaling-fix.js +0 -19
  72. data/lib/octopress/scaffold/site/javascripts/lib/jquery-1.9.1.js +0 -9598
  73. data/lib/octopress/scaffold/site/javascripts/lib/jquery.cookie.js +0 -93
  74. data/lib/octopress/scaffold/site/stylesheets/_config.scss +0 -1
  75. data/lib/octopress/scaffold/site/stylesheets/_style.scss +0 -1
  76. data/lib/octopress/scaffold/site/stylesheets/site.scss +0 -16
  77. data/lib/octopress/tags/assign.rb +0 -34
  78. data/lib/octopress/tags/capture.rb +0 -31
  79. data/lib/octopress/tags/config-tag.rb +0 -23
  80. data/lib/octopress/tags/include.rb +0 -63
  81. data/lib/octopress/tags/js-assets.rb +0 -23
  82. data/lib/octopress/tags/puts.rb +0 -39
  83. data/lib/octopress/tags/render-partial.rb +0 -89
  84. data/lib/octopress/tags/return.rb +0 -21
  85. data/lib/rake/clean.rake +0 -8
  86. data/lib/rake/clobber.rake +0 -5
  87. data/lib/rake/console.rake +0 -5
  88. data/lib/rake/deploy.rake +0 -4
  89. data/lib/rake/gen_deploy.rake +0 -2
  90. data/lib/rake/generate.rake +0 -4
  91. data/lib/rake/generate_only.rake +0 -14
  92. data/lib/rake/hygiene.rake +0 -29
  93. data/lib/rake/install.rake +0 -8
  94. data/lib/rake/integrate.rake +0 -4
  95. data/lib/rake/isolate.rake +0 -13
  96. data/lib/rake/list_drafts.rake +0 -7
  97. data/lib/rake/new.rake +0 -7
  98. data/lib/rake/new_page.rake +0 -49
  99. data/lib/rake/new_post.rake +0 -32
  100. data/lib/rake/nuke.rake +0 -4
  101. data/lib/rake/preview.rake +0 -4
  102. data/lib/rake/push.rake +0 -37
  103. data/lib/rake/rsync.rake +0 -20
  104. data/lib/rake/set_root_dir.rake +0 -35
  105. data/lib/rake/setup_github_pages.rake +0 -115
  106. data/lib/rake/watch.rake +0 -11
  107. data/lib/scaffold/Rakefile +0 -142
  108. data/lib/scaffold/plugin-name.gemspec +0 -43
  109. data/lib/spec/fixtures/env/defaults/classic.yml +0 -2
  110. data/lib/spec/fixtures/no_override/defaults/classic.yml +0 -11
  111. data/lib/spec/fixtures/override/defaults/classic.yml +0 -11
  112. data/lib/spec/fixtures/override/site.yml +0 -11
  113. data/lib/spec/octopress/configuration_spec.rb +0 -67
  114. data/lib/spec/octopress/dependency_installer_spec.rb +0 -66
  115. data/lib/spec/octopress/ink_spec.rb +0 -10
  116. data/lib/spec/octopress/octopress_spec.rb +0 -97
  117. data/lib/spec/spec_helper.rb +0 -22
  118. data/lib/spec/support/env.rb +0 -36
  119. data/lib/spec/support/simplecov.rb +0 -52
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MzIyMmUzODkxNzk0ODFlYjlhZmVhYTUzMjE2ZmNlNjVmYTdiMGMwZA==
5
- data.tar.gz: !binary |-
6
- NTIwYzkxODI5ZTI5Y2M5MTliZTBkNTJlODE1ODI0YWEyOWFjZTdjNA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- Nzg4YTgwYWZkMmNlYWZmYTZiN2VhNmJjNzQzZGM2MDFkNWZkN2Q2YjI0ZDFi
10
- NjNmZjQ4YzcyZWY3NGNhNWMwMWNmZGE0NThkOTNjYjgxOTg2NmYyZjA5MDM0
11
- YWE4MTJkNDc3Y2E0YzI0NjVjMGNjOWVjY2FhNzQ1NDdiY2VjODA=
12
- data.tar.gz: !binary |-
13
- OTE5YzI3NzYwOTg4YTdlMjczNWRkZGE1NWZhNmY1MjIzODVmZTU0OTQ2ZjAw
14
- NDkyMThmOWNhMDEyMmY0MDE2M2E1NDJhY2U2MGY5MDQ3YWMyMWExZGViZTMy
15
- MjU5NzU1ZjBiZjllMjE5YTkyOWI0NjA1NWI3YWViMWM0NjJhZWM=
2
+ SHA1:
3
+ metadata.gz: 43594e6b5026cdfe8c0b63659e8c6d23073153b4
4
+ data.tar.gz: 13fe34f1bfa868adebaf7fbbe9f875a7ba4cffe3
5
+ SHA512:
6
+ metadata.gz: bd87b4fee80759d6791deb6bb974a0ae92d538babcc9ee57df1308d0bae65fcd0fb0b14d924fcea6e528748d71071c10737be6b436d59f5949c05245fed6d507
7
+ data.tar.gz: 622aef0de4f00a34f80a2d8f595ff95f1ba3f8c6ac55d0897f898aa278a0b4ec6636300454873b1d9a1635ece49a8ead7e97bcccfefaea99378898b7285050af
data/.gitignore CHANGED
@@ -1,20 +1,17 @@
1
+ *.gem
2
+ *.rbc
1
3
  .bundle
2
- .DS_Store
4
+ .config
5
+ .yardoc
3
6
  Gemfile.lock
4
- *.sw[mnop]
5
- *~
6
- /.sass-cache
7
- /.gist-cache
8
- /.pygments-cache
9
- /_deploy
10
- /public
11
- /source/_stash
12
- /source/stylesheets/site.css
13
- /source/javascripts/build
14
- /source/images/icon-*.png
15
- /vendor
16
- /lib/vendor
17
- node_modules
18
- /_config.yml
19
- /config/deploy.yml
20
- /coverage/
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in octopress.gemspec
2
4
  gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 octopress
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # Octopress
2
+
3
+ Octopress is an obsessively designed toolkit for writing and deploying Jekyll
4
+ blogs. Pretty sweet, huh?
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'octopress'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install octopress
19
+
20
+ ## Usage
21
+
22
+ ### Generating a new Post
23
+
24
+ ```bash
25
+ $ octopress new post --title "My Title"
26
+ ```
27
+
28
+ "Ok, great? What else can I do?" Great question! Check out these other options:
29
+
30
+ | Option | Type | Description |
31
+ |:-------------|:---------|:------------|
32
+ | `title` | `String` | The title of the new post |
33
+ | `date` | `String` | The date for the post. Should be parseable by [Time#parse](http://ruby-doc.org/stdlib-2.1.0/libdoc/time/rdoc/Time.html#method-i-parse) (defaults to Time.now) |
34
+ | `slug` | `String` | The slug for the new post. |
35
+ | `categories` | `Array` | A comma-separated list of categories to which this post belongs |
36
+ | `tags` | `Array` | A comma-separated list of tags for this post |
37
+
38
+ ### Generating a new Page
39
+
40
+ ```bash
41
+ $ octopress new page --path about/index.markdown
42
+ ```
43
+
44
+ | Option | Type | Description |
45
+ |:-------------|:---------|:------------|
46
+ | `title` | `String` | The title of the new page |
47
+ | `date` | `String` | The date for the page. Should be parseable by [Time#parse](http://ruby-doc.org/stdlib-2.1.0/libdoc/time/rdoc/Time.html#method-i-parse) |
48
+ | `path` | `String` | The path at which the new page should be generated. |
49
+
50
+ ### Other Commands
51
+
52
+ Octopress also has the following commands, bundled as separate gems:
53
+
54
+ | Command | Gem | Description |
55
+ |:---------|:---------------------|:------------|
56
+ | `deploy` | [octopress-deploy][] | Deployment for Octopress and Jekyll blogs. |
57
+
58
+ [octopress-deploy]: https://github.com/octopress/deploy
59
+
60
+ ## Contributing
61
+
62
+ 1. Fork it
63
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
64
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
65
+ 4. Push to the branch (`git push origin my-new-feature`)
66
+ 5. Create new Pull Request
data/Rakefile CHANGED
@@ -1,76 +1 @@
1
- # encoding: utf-8
2
-
3
- $:.unshift File.expand_path("lib", File.dirname(__FILE__)) # For use/testing when no gem is installed
4
- require 'octopress'
5
- require 'tzinfo'
6
-
7
- ### Configuring Octopress:
8
- ### Under config/ you will find:
9
- ### site.yml, deploy.yml
10
- ### Here you can override Octopress's default configurations or add your own.
11
- ### This Rakefile uses those config settings to do what it does.
12
- ### Please do not change anything below if you want help --
13
- ### otherwise, you're on your own ;-)
14
-
15
- #
16
- # Run tests for Octopress module, found in lib/.
17
- #
18
- require 'rspec/core/rake_task'
19
- desc "Run all examples"
20
- RSpec::Core::RakeTask.new(:spec) do |t|
21
- t.pattern = "./lib/spec{,/*/**}/*_spec.rb"
22
- end
23
-
24
- task :test do
25
- sh "bundle exec rake spec"
26
- #sh "bundle exec rake install['classic-theme']"
27
- #sh "bundle exec rake install['video-tag']"
28
- #sh "bundle exec rake install['adn-timeline']"
29
- #sh "bundle exec rake generate"
30
- end
31
-
32
- def get_stdin(message)
33
- print message
34
- STDIN.gets.chomp
35
- end
36
-
37
- def now_in_timezone(timezone)
38
- time = Time.now
39
- unless timezone.nil? || timezone.empty? || timezone == 'local'
40
- tz = TZInfo::Timezone.get(timezone) #setup Timezone object
41
- adjusted_time = tz.utc_to_local(time.utc) #time object without correct offset
42
- #time object with correct offset
43
- time = Time.new(
44
- adjusted_time.year,
45
- adjusted_time.month,
46
- adjusted_time.day,
47
- adjusted_time.hour,
48
- adjusted_time.min,
49
- adjusted_time.sec,
50
- tz.period_for_utc(time.utc).utc_total_offset())
51
- #convert offset to utc instead of just ±0 if that was specified
52
- if ['utc','zulu','universal','uct','gmt','gmt0','gmt+0','gmt-0'].include? timezone.downcase
53
- time = time.utc
54
- end
55
- end
56
- time
57
- end
58
-
59
- def get_unpublished(posts, options={})
60
- result = ""
61
- message = options[:message] || "These Posts will not be published:"
62
- posts.sort.each do |post|
63
- file = File.read(post)
64
- data = YAML.load file.match(/(^-{3}\n)(.+?)(\n-{3})/m)[2]
65
-
66
- if options[:env] == 'production'
67
- future = Time.now < Time.parse(data['date'].to_s) ? "future date: #{data['date']}" : false
68
- end
69
- draft = data['published'] == false ? 'published: false' : false
70
- result << "- #{data['title']} (#{draft or future})\n" if draft or future
71
- end
72
- result = "#{message}\n" + result unless result.empty?
73
- result
74
- end
75
-
76
- Octopress::Rake.init!(self)
1
+ require "bundler/gem_tasks"
data/bin/octopress CHANGED
@@ -1,66 +1,22 @@
1
- #!/usr/bin/env ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
- require 'rubygems'
4
- require File.expand_path("../lib/octopress", File.dirname(__FILE__))
5
- require 'commander/import'
3
+ $LOAD_PATH.unshift(File.expand_path("../lib", File.dirname(__FILE__)))
6
4
 
7
- program :version, Octopress::VERSION
8
- program :description, 'Octopress is an obsessively designed framework for Jekyll blogging.'+
9
- 'It\'s easy to configure and easy to deploy. Sweet huh?'
5
+ require 'mercenary'
6
+ require 'octopress'
10
7
 
11
- command :build do |c|
12
- c.syntax = 'octopress build [options]'
13
- c.summary = 'Build your static site'
8
+ Octopress.require_blessed_gems
14
9
 
15
- c.option '--env ENV', 'Specify the build environment'
16
- c.option '--watch', 'Auto-regenerate with filesystem changes'
17
-
18
- c.action do |args, options|
19
- Octopress::Commands::Build.process(args, options.__hash__)
20
- end
21
- end
22
-
23
- command :install do |c|
24
- c.syntax = 'octopress install NAME'
25
- c.summary = 'Install an Octopress plugin'
26
-
27
- c.action do |args, options|
28
- Octopress::Commands::Install.process(args, options.__hash__)
29
- end
10
+ begin
11
+ require 'bundler'
12
+ Bundler.require(:octopress)
13
+ rescue
30
14
  end
31
15
 
32
- command :new do |c|
33
- c.syntax = 'octopress new PATH'
34
- c.summary = 'Create a new octopress site in the specified directory'
35
-
36
- c.example 'Create new site in current directory', 'octopress build .'
37
- c.example 'Create new site in subdirectory "./blog"', 'octopress build blog'
38
-
39
- c.action do |args, options|
40
- Octopress::Commands::New.process(args, options.__hash__)
41
- end
42
- end
43
-
44
- command :scaffold do |c|
45
- c.syntax = 'octopress scaffold (plugin|theme) [options]'
46
- c.summary = 'Scaffold a new plugin or theme to release'
47
-
48
- c.example 'Create a new plugin called "image_resizer" in "./image_resizer"',
49
- 'octopress scaffold plugin image_resizer'
50
-
51
- c.action do |args, options|
52
- Octopress::Commands::Scaffold.process(args, options.__hash__)
53
- end
54
- end
16
+ Mercenary.program(:octopress) do |p|
17
+ p.version Octopress::VERSION
18
+ p.description "Octopress is an obsessively designed toolkit for Jekyll blogging."
19
+ p.syntax "octopress <subcommand> [options]"
55
20
 
56
- command :serve do |c|
57
- c.syntax = 'octopress serve [options]'
58
- c.summary = 'Build your site locally and start a server for it'
59
-
60
- c.option '--env ENV', 'Specify the build environment'
61
- c.option '--watch', 'Auto-regenerate with filesystem changes'
62
-
63
- c.action do |args, options|
64
- Octopress::Commands::Serve.process(args, options.__hash__)
65
- end
21
+ Octopress::Command.subclasses.each { |c| c.init_with_program(p) }
66
22
  end
data/lib/octopress.rb CHANGED
@@ -1,90 +1,51 @@
1
- $:.unshift File.expand_path(File.dirname(__FILE__)) # For use/testing when no gem is installed
2
-
3
- # stdlib
4
- require 'logger'
5
-
6
- # gems
7
- require 'colorator'
8
- require 'open3'
9
- require 'stringex'
10
- require 'time'
11
- require 'tzinfo'
12
- require 'safe_yaml'
13
-
14
- SafeYAML::OPTIONS[:suppress_warnings] = true
15
-
16
- # octopress
17
- require "octopress/version"
18
- require "octopress/errors"
19
- require "octopress/core_ext"
20
- require "octopress/helpers/titlecase"
21
-
22
1
  module Octopress
23
- autoload :Configuration, 'octopress/configuration'
24
- autoload :Ink, 'octopress/ink'
25
- autoload :Installer, 'octopress/installer'
26
- autoload :Formatters, 'octopress/formatters'
27
- autoload :InquirableString, 'octopress/inquirable_string'
28
- autoload :DependencyInstaller, 'octopress/dependency_installer'
29
- autoload :JSAssetsManager, 'octopress/js_assets_manager'
30
- autoload :Command, 'octopress/command'
31
- autoload :Commands, 'octopress/commands'
32
- autoload :Rake, 'octopress/rake'
33
- autoload :Plugin, 'octopress/plugin'
34
-
35
- # Static: Get absolute file path of the octopress lib directory
36
- #
37
- # Returns the absolute path to the octopress lib directory
38
- def self.lib_root
39
- File.dirname(__FILE__)
40
- end
41
-
42
- # Static: Get absolute file path of the main octopress installation
43
- #
44
- # Returns the absolute path of the main octopress installation
45
- def self.root
46
- Dir.pwd
47
- end
2
+ require 'octopress/core_ext'
3
+ require 'octopress/command'
4
+ require 'octopress/version'
5
+ require 'octopress/commands/new'
6
+ require 'octopress/commands/publish'
7
+
8
+ autoload :Page, 'octopress/page'
9
+ autoload :Post, 'octopress/post'
10
+ autoload :Draft, 'octopress/draft'
11
+
12
+ BLESSED_GEMS = %w[
13
+ octopress-deploy
14
+ octopress-ink
15
+ ]
16
+
17
+ DEFAULTS = { 'octopress' => {
18
+ 'new_post_extension' => 'markdown',
19
+ 'new_page_extension' => 'html',
20
+ 'new_post_layout' => 'post',
21
+ 'new_page_layout' => 'page',
22
+ 'titlecase' => true
23
+ }}
48
24
 
49
- # Static: Fetches the Octopress environment
50
- #
51
- # Returns the Octopress environment as an InquirableString
52
- def self.env
53
- # Not simply memoizing the result in case the configuration changes out
54
- # from under us at runtime... Not sure if that can happen, but just in
55
- # case let's be conservative in our behavior here.
56
- env_raw_tmp = (ENV["OCTOPRESS_ENV"] || self.configuration[:env]).to_s
57
- if(env_raw_tmp != @env_raw)
58
- @env = nil
59
- end
60
- @env_raw = env_raw_tmp
61
- @env ||= InquirableString.new(@env_raw)
62
- end
63
-
64
- # Static: Fetch the logger for Octopress
65
- #
66
- # Returns the Logger, based on Ruby's stdlib Logger
67
25
  def self.logger
68
- @@logger ||= Ink.build
69
- end
70
-
71
- def self.configurator(root_dir = Octopress::Configuration::DEFAULT_CONFIG_DIR)
72
- @configurator ||= Configuration.new(root_dir)
26
+ @logger ||= Logger.new(STDOUT)
27
+ @logger.level = Logger::DEBUG
28
+ @logger
73
29
  end
74
30
 
75
- def self.configuration
76
- @configuration ||= self.configurator.read_configuration
31
+ def self.site(options={})
32
+ @site ||= Jekyll::Site.new(config(options))
77
33
  end
78
34
 
79
- def self.clear_config!
80
- @configurator = nil
81
- @configuration = nil
35
+ def self.config(options={})
36
+ log_level = Jekyll.logger.log_level
37
+ Jekyll.logger.log_level = Jekyll::Stevenson::WARN
38
+ @config ||= DEFAULTS.deep_merge Jekyll.configuration(options)
39
+ Jekyll.logger.log_level = log_level
40
+ @config
82
41
  end
83
- end
84
42
 
85
- def require_all(relative_path)
86
- Dir[File.expand_path("../#{relative_path}/**/*", __FILE__)].entries.each do |f|
87
- require f
43
+ def self.require_blessed_gems
44
+ BLESSED_GEMS.each do |gem|
45
+ begin
46
+ require gem
47
+ rescue LoadError
48
+ end
49
+ end
88
50
  end
89
51
  end
90
-
@@ -1,9 +1,15 @@
1
1
  module Octopress
2
2
  class Command
3
- class << self
4
- def process(args = nil, options = nil)
5
- raise NotImplementedError
6
- end
3
+ def self.inherited(base)
4
+ subclasses << base
5
+ end
6
+
7
+ def self.subclasses
8
+ @subclasses ||= []
9
+ end
10
+
11
+ def init_with_program(p)
12
+ raise NotImplementedError.new("")
7
13
  end
8
14
  end
9
15
  end