octopress 3.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.editorconfig +22 -0
- data/.gitattributes +1 -0
- data/.gitignore +20 -0
- data/.powrc +4 -0
- data/.rspec +5 -0
- data/.rubocop.yml +119 -0
- data/.slugignore +3 -0
- data/.themes/classic/.editorconfig +44 -0
- data/.themes/classic/_config/adn-timeline.yml +10 -0
- data/.themes/classic/_config/delicious-feed.yml +4 -0
- data/.themes/classic/_config/deploy/gh_pages.yml +9 -0
- data/.themes/classic/_config/deploy/rsync.yml +14 -0
- data/.themes/classic/_config/disqus.yml +11 -0
- data/.themes/classic/_config/facebook-like.yml +2 -0
- data/.themes/classic/_config/gauges-analytics.yml +6 -0
- data/.themes/classic/_config/github-repos.yml +24 -0
- data/.themes/classic/_config/google-analytics.yml +6 -0
- data/.themes/classic/_config/google-plus.yml +13 -0
- data/.themes/classic/_config/jekyll.yml +37 -0
- data/.themes/classic/_config/pinboard-feed.yml +4 -0
- data/.themes/classic/_config/require-js.yml +19 -0
- data/.themes/classic/_config/theme.yml +54 -0
- data/.themes/classic/_config/twitter-timeline.yml +9 -0
- data/.themes/classic/assets/javascripts/lib/ios-rotate-scaling-fix.js +18 -0
- data/.themes/classic/assets/javascripts/lib/jquery.cookie.js +92 -0
- data/.themes/classic/assets/javascripts/lib/modernizr.js +447 -0
- data/.themes/classic/assets/javascripts/lib/octopress.js +83 -0
- data/.themes/classic/assets/javascripts/modules/adn-timeline.coffee +68 -0
- data/.themes/classic/assets/javascripts/modules/delicious-feed.coffee +38 -0
- data/.themes/classic/assets/javascripts/modules/github-repos.coffee +60 -0
- data/.themes/classic/assets/javascripts/modules/github.coffee +60 -0
- data/.themes/classic/assets/javascripts/modules/helpers.coffee +96 -0
- data/.themes/classic/assets/javascripts/modules/pinboard-feed.coffee +42 -0
- data/.themes/classic/assets/javascripts/modules/site.coffee +11 -0
- data/.themes/classic/assets/stylesheets/_base.scss +5 -0
- data/.themes/classic/assets/stylesheets/_partials.scss +8 -0
- data/.themes/classic/assets/stylesheets/base/_layout.scss +191 -0
- data/.themes/classic/assets/stylesheets/base/_solarized.scss +75 -0
- data/.themes/classic/assets/stylesheets/base/_theme.scss +92 -0
- data/.themes/classic/assets/stylesheets/base/_typography.scss +168 -0
- data/.themes/classic/assets/stylesheets/base/_utilities.scss +27 -0
- data/.themes/classic/assets/stylesheets/custom/_colors.scss +49 -0
- data/.themes/classic/assets/stylesheets/custom/_fonts.scss +10 -0
- data/.themes/classic/assets/stylesheets/custom/_layout.scss +17 -0
- data/.themes/classic/assets/stylesheets/custom/_styles.scss +2 -0
- data/.themes/classic/assets/stylesheets/partials/_archive.scss +77 -0
- data/.themes/classic/assets/stylesheets/partials/_blog.scss +165 -0
- data/.themes/classic/assets/stylesheets/partials/_footer.scss +19 -0
- data/.themes/classic/assets/stylesheets/partials/_header.scss +18 -0
- data/.themes/classic/assets/stylesheets/partials/_navigation.scss +136 -0
- data/.themes/classic/assets/stylesheets/partials/_sharing.scss +73 -0
- data/.themes/classic/assets/stylesheets/partials/_sidebar.scss +4 -0
- data/.themes/classic/assets/stylesheets/partials/_syntax.scss +234 -0
- data/.themes/classic/assets/stylesheets/partials/sidebar/_base.scss +106 -0
- data/.themes/classic/assets/stylesheets/partials/sidebar/_delicious.scss +4 -0
- data/.themes/classic/assets/stylesheets/partials/sidebar/_googleplus.scss +26 -0
- data/.themes/classic/assets/stylesheets/partials/sidebar/_pinboard.scss +12 -0
- data/.themes/classic/assets/stylesheets/plugins/_plugins.scss +5 -0
- data/.themes/classic/assets/stylesheets/screen.scss +11 -0
- data/.themes/classic/source/404.markdown +9 -0
- data/.themes/classic/source/_includes/after_footer.html +7 -0
- data/.themes/classic/source/_includes/archive_post.html +12 -0
- data/.themes/classic/source/_includes/article.html +23 -0
- data/.themes/classic/source/_includes/comments.html +9 -0
- data/.themes/classic/source/_includes/custom/after_footer.html +3 -0
- data/.themes/classic/source/_includes/custom/after_page.html +1 -0
- data/.themes/classic/source/_includes/custom/after_post.html +0 -0
- data/.themes/classic/source/_includes/custom/comments.html +5 -0
- data/.themes/classic/source/_includes/custom/footer.html +4 -0
- data/.themes/classic/source/_includes/custom/head.html +7 -0
- data/.themes/classic/source/_includes/custom/header.html +6 -0
- data/.themes/classic/source/_includes/custom/navigation.html +4 -0
- data/.themes/classic/source/_includes/custom/page_meta.html +1 -0
- data/.themes/classic/source/_includes/custom/post_meta.html +1 -0
- data/.themes/classic/source/_includes/custom/sharing.html +3 -0
- data/.themes/classic/source/_includes/disqus.html +22 -0
- data/.themes/classic/source/_includes/facebook_like.html +10 -0
- data/.themes/classic/source/_includes/feed_entry.xml +10 -0
- data/.themes/classic/source/_includes/footer.html +1 -0
- data/.themes/classic/source/_includes/gauges_analytics.html +15 -0
- data/.themes/classic/source/_includes/google_analytics.html +13 -0
- data/.themes/classic/source/_includes/google_plus_one.html +9 -0
- data/.themes/classic/source/_includes/head.html +33 -0
- data/.themes/classic/source/_includes/header.html +1 -0
- data/.themes/classic/source/_includes/navigation.html +15 -0
- data/.themes/classic/source/_includes/post/author.html +8 -0
- data/.themes/classic/source/_includes/post/categories.html +10 -0
- data/.themes/classic/source/_includes/post/date.html +15 -0
- data/.themes/classic/source/_includes/post/disqus_thread.html +1 -0
- data/.themes/classic/source/_includes/post/meta.html +3 -0
- data/.themes/classic/source/_includes/post/sharing.html +36 -0
- data/.themes/classic/source/_includes/post/title.html +5 -0
- data/.themes/classic/source/_includes/post/variables.html +14 -0
- data/.themes/classic/source/_includes/sidebars/blog_index_default.html +3 -0
- data/.themes/classic/source/_includes/sidebars/page_default.html +4 -0
- data/.themes/classic/source/_includes/sidebars/post_default.html +4 -0
- data/.themes/classic/source/_includes/sidebars/sections/delicious.html +8 -0
- data/.themes/classic/source/_includes/sidebars/sections/github.html +9 -0
- data/.themes/classic/source/_includes/sidebars/sections/google_plus.html +5 -0
- data/.themes/classic/source/_includes/sidebars/sections/pinboard.html +17 -0
- data/.themes/classic/source/_includes/sidebars/sections/recent_posts.html +10 -0
- data/.themes/classic/source/_includes/twitter_sharing.html +11 -0
- data/.themes/classic/source/_layouts/category_feed.xml +24 -0
- data/.themes/classic/source/_layouts/category_index.html +19 -0
- data/.themes/classic/source/_layouts/default.html +14 -0
- data/.themes/classic/source/_layouts/page.html +34 -0
- data/.themes/classic/source/_layouts/post.html +39 -0
- data/.themes/classic/source/archives/index.html +20 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/background.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/blankButton.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/divider.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/fullscreenButton.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/fullscreenButtonOver.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/muteButton.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/muteButtonOver.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/normalscreenButton.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/normalscreenButtonOver.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/pauseButton.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/pauseButtonOver.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/playButton.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/playButtonOver.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/timeSliderBuffer.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/timeSliderCapLeft.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/timeSliderCapRight.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/timeSliderProgress.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/timeSliderRail.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/unmuteButton.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/controlbar/unmuteButtonOver.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/display/background.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/display/bufferIcon.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/display/muteIcon.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/display/playIcon.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/dock/button.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/glow.xml +115 -0
- data/.themes/classic/source/assets/jwplayer/glow/playlist/item.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/playlist/itemOver.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/playlist/sliderCapBottom.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/playlist/sliderCapTop.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/playlist/sliderRail.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/playlist/sliderThumb.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/sharing/embedIcon.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/sharing/embedScreen.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/sharing/shareIcon.png +0 -0
- data/.themes/classic/source/assets/jwplayer/glow/sharing/shareScreen.png +0 -0
- data/.themes/classic/source/assets/jwplayer/player.swf +0 -0
- data/.themes/classic/source/atom.xml +23 -0
- data/.themes/classic/source/images/bird_32_gray.png +0 -0
- data/.themes/classic/source/images/bird_32_gray_fail.png +0 -0
- data/.themes/classic/source/images/code_bg.png +0 -0
- data/.themes/classic/source/images/dotted-border.png +0 -0
- data/.themes/classic/source/images/email.png +0 -0
- data/.themes/classic/source/images/icon/facebook.png +0 -0
- data/.themes/classic/source/images/icon/github.png +0 -0
- data/.themes/classic/source/images/icon/googleplus.png +0 -0
- data/.themes/classic/source/images/icon/twitter-bird.png +0 -0
- data/.themes/classic/source/images/icon/twitter.png +0 -0
- data/.themes/classic/source/images/line-tile.png +0 -0
- data/.themes/classic/source/images/noise.png +0 -0
- data/.themes/classic/source/images/rss.png +0 -0
- data/.themes/classic/source/images/search.png +0 -0
- data/.themes/classic/source/index.html +30 -0
- data/.themes/classic/source/javascripts/jquery.min.js +5 -0
- data/.themes/classic/source/octopress-favicon.png +0 -0
- data/.themes/classic/source/robots.txt +7 -0
- data/.travis.yml +6 -0
- data/CHANGELOG.markdown +46 -0
- data/CONTRIBUTING.markdown +17 -0
- data/Gemfile +2 -0
- data/README.markdown +37 -0
- data/Rakefile +76 -0
- data/bin/octopress +66 -0
- data/lib/console +17 -0
- data/lib/guard/jekyll.rb +33 -0
- data/lib/octopress.rb +89 -0
- data/lib/octopress/command.rb +9 -0
- data/lib/octopress/commands.rb +14 -0
- data/lib/octopress/commands/build.rb +17 -0
- data/lib/octopress/commands/build_javascripts.rb +11 -0
- data/lib/octopress/commands/build_jekyll.rb +25 -0
- data/lib/octopress/commands/build_stylesheets.rb +13 -0
- data/lib/octopress/commands/install.rb +45 -0
- data/lib/octopress/commands/new.rb +21 -0
- data/lib/octopress/commands/scaffold.rb +101 -0
- data/lib/octopress/commands/serve.rb +25 -0
- data/lib/octopress/configuration.rb +231 -0
- data/lib/octopress/core_ext.rb +44 -0
- data/lib/octopress/dependency_installer.rb +287 -0
- data/lib/octopress/errors.rb +3 -0
- data/lib/octopress/filters/content.rb +66 -0
- data/lib/octopress/filters/date.rb +46 -0
- data/lib/octopress/filters/post.rb +175 -0
- data/lib/octopress/filters/url.rb +34 -0
- data/lib/octopress/formatters.rb +9 -0
- data/lib/octopress/formatters/base_formatter.rb +17 -0
- data/lib/octopress/formatters/simple_formatter.rb +9 -0
- data/lib/octopress/formatters/verbose_formatter.rb +9 -0
- data/lib/octopress/generators/category_generator.rb +196 -0
- data/lib/octopress/generators/sitemap_generator.rb +308 -0
- data/lib/octopress/guardfile +43 -0
- data/lib/octopress/helpers/titlecase.rb +37 -0
- data/lib/octopress/ink.rb +12 -0
- data/lib/octopress/inquirable_string.rb +12 -0
- data/lib/octopress/installer.rb +92 -0
- data/lib/octopress/js_asset_manager.rb +98 -0
- data/lib/octopress/liquid_helpers/conditional.rb +36 -0
- data/lib/octopress/liquid_helpers/config.rb +58 -0
- data/lib/octopress/liquid_helpers/include.rb +33 -0
- data/lib/octopress/liquid_helpers/url.rb +29 -0
- data/lib/octopress/liquid_helpers/vars.rb +30 -0
- data/lib/octopress/plugin.rb +33 -0
- data/lib/octopress/rake.rb +16 -0
- data/lib/octopress/scaffold/.gitignore +18 -0
- data/lib/octopress/scaffold/site/Gemfile +3 -0
- data/lib/octopress/scaffold/site/config/compass.rb +27 -0
- data/lib/octopress/scaffold/site/config/rack.rb +25 -0
- data/lib/octopress/scaffold/site/config/site.yml +0 -0
- data/lib/octopress/scaffold/site/javascripts/lib/ios-rotate-scaling-fix.js +19 -0
- data/lib/octopress/scaffold/site/javascripts/lib/jquery-1.9.1.js +9598 -0
- data/lib/octopress/scaffold/site/javascripts/lib/jquery.cookie.js +93 -0
- data/lib/octopress/scaffold/site/stylesheets/_config.scss +1 -0
- data/lib/octopress/scaffold/site/stylesheets/_style.scss +1 -0
- data/lib/octopress/scaffold/site/stylesheets/site.scss +16 -0
- data/lib/octopress/tags/assign.rb +34 -0
- data/lib/octopress/tags/capture.rb +31 -0
- data/lib/octopress/tags/config-tag.rb +23 -0
- data/lib/octopress/tags/include.rb +63 -0
- data/lib/octopress/tags/js-assets.rb +23 -0
- data/lib/octopress/tags/puts.rb +39 -0
- data/lib/octopress/tags/render-partial.rb +89 -0
- data/lib/octopress/tags/return.rb +21 -0
- data/lib/octopress/version.rb +3 -0
- data/lib/rake/clean.rake +8 -0
- data/lib/rake/clobber.rake +5 -0
- data/lib/rake/console.rake +5 -0
- data/lib/rake/deploy.rake +4 -0
- data/lib/rake/gen_deploy.rake +2 -0
- data/lib/rake/generate.rake +4 -0
- data/lib/rake/generate_only.rake +14 -0
- data/lib/rake/hygiene.rake +29 -0
- data/lib/rake/install.rake +8 -0
- data/lib/rake/integrate.rake +4 -0
- data/lib/rake/isolate.rake +13 -0
- data/lib/rake/list_drafts.rake +7 -0
- data/lib/rake/new.rake +7 -0
- data/lib/rake/new_page.rake +49 -0
- data/lib/rake/new_post.rake +32 -0
- data/lib/rake/nuke.rake +4 -0
- data/lib/rake/preview.rake +4 -0
- data/lib/rake/push.rake +37 -0
- data/lib/rake/rsync.rake +20 -0
- data/lib/rake/set_root_dir.rake +35 -0
- data/lib/rake/setup_github_pages.rake +115 -0
- data/lib/rake/watch.rake +11 -0
- data/lib/scaffold/Rakefile +142 -0
- data/lib/scaffold/plugin-name.gemspec +43 -0
- data/lib/spec/fixtures/env/defaults/classic.yml +2 -0
- data/lib/spec/fixtures/no_override/defaults/classic.yml +11 -0
- data/lib/spec/fixtures/override/defaults/classic.yml +11 -0
- data/lib/spec/fixtures/override/site.yml +11 -0
- data/lib/spec/octopress/configuration_spec.rb +67 -0
- data/lib/spec/octopress/dependency_installer_spec.rb +66 -0
- data/lib/spec/octopress/ink_spec.rb +10 -0
- data/lib/spec/octopress/octopress_spec.rb +97 -0
- data/lib/spec/spec_helper.rb +22 -0
- data/lib/spec/support/env.rb +36 -0
- data/lib/spec/support/simplecov.rb +52 -0
- data/octopress.gemspec +52 -0
- metadata +697 -0
data/lib/rake/watch.rake
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
desc "Watch the site and regenerate when it changes"
|
2
|
+
task :watch do
|
3
|
+
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." if Octopress.configuration[:source].nil? || !File.directory?(Octopress.configuration[:source])
|
4
|
+
puts "Starting to watch source with Jekyll and Compass."
|
5
|
+
guardPid = Process.spawn("guard --guardfile #{Octopress.root}/lib/octopress/guardfile")
|
6
|
+
trap("INT") {
|
7
|
+
Process.kill(9, guardPid) rescue Errno::ESRCH
|
8
|
+
exit 0
|
9
|
+
}
|
10
|
+
Process.wait guardPid
|
11
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
Bundler.require
|
4
|
+
require 'rake/clean'
|
5
|
+
require 'safe_yaml'
|
6
|
+
|
7
|
+
#############################################################################
|
8
|
+
#
|
9
|
+
# Configure Rake's clean/clobber tasks.
|
10
|
+
#
|
11
|
+
#############################################################################
|
12
|
+
|
13
|
+
# 'rake clean' is for intermediate/temporary files not meant for direct
|
14
|
+
# consumption by the user. Output from Compass, cache directories, etc are
|
15
|
+
# good examples here.
|
16
|
+
# CLEAN.include(...)
|
17
|
+
|
18
|
+
# 'rake clobber' is for generated files meant for direct consumption by the
|
19
|
+
# user. Release packages, generated docs/coverage reports, etc are good
|
20
|
+
# examples here.
|
21
|
+
CLOBBER.include('pkg/*')
|
22
|
+
|
23
|
+
|
24
|
+
#############################################################################
|
25
|
+
#
|
26
|
+
# Helper functions
|
27
|
+
#
|
28
|
+
#############################################################################
|
29
|
+
|
30
|
+
def manifest
|
31
|
+
@manifest ||= YAML.safe_load_file(File.expand_path("../MANIFEST.yml", __FILE__))
|
32
|
+
end
|
33
|
+
|
34
|
+
def name
|
35
|
+
@name ||= manifest["slug"]
|
36
|
+
end
|
37
|
+
|
38
|
+
def ruby_name
|
39
|
+
name.gsub(/-/, '_')
|
40
|
+
end
|
41
|
+
|
42
|
+
require "./lib/#{ruby_name}"
|
43
|
+
|
44
|
+
def version
|
45
|
+
manifest["version"]
|
46
|
+
end
|
47
|
+
|
48
|
+
def date
|
49
|
+
Date.today.to_s
|
50
|
+
end
|
51
|
+
|
52
|
+
def gemspec_file
|
53
|
+
"#{name}.gemspec"
|
54
|
+
end
|
55
|
+
|
56
|
+
def gem_file
|
57
|
+
"#{name}-#{version}.gem"
|
58
|
+
end
|
59
|
+
|
60
|
+
def replace_header(head, header_name)
|
61
|
+
head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
|
62
|
+
end
|
63
|
+
|
64
|
+
#############################################################################
|
65
|
+
#
|
66
|
+
# Standard tasks
|
67
|
+
#
|
68
|
+
#############################################################################
|
69
|
+
|
70
|
+
task :default => :test
|
71
|
+
|
72
|
+
desc "Open an irb session preloaded with this library"
|
73
|
+
task :console do
|
74
|
+
require 'irb'
|
75
|
+
ARGV.clear
|
76
|
+
IRB.start
|
77
|
+
end
|
78
|
+
|
79
|
+
#############################################################################
|
80
|
+
#
|
81
|
+
# Packaging tasks
|
82
|
+
#
|
83
|
+
#############################################################################
|
84
|
+
|
85
|
+
desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
|
86
|
+
task :release => :build do
|
87
|
+
unless `git branch` =~ /^\* master$/
|
88
|
+
puts "You must be on the master branch to release!"
|
89
|
+
exit!
|
90
|
+
end
|
91
|
+
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
92
|
+
sh "git tag v#{version}"
|
93
|
+
sh "git push origin master"
|
94
|
+
sh "git push origin v#{version}"
|
95
|
+
sh "gem push pkg/#{name}-#{version}.gem"
|
96
|
+
end
|
97
|
+
|
98
|
+
desc "Build #{gem_file} into the pkg directory"
|
99
|
+
task :build => :gemspec do
|
100
|
+
sh "mkdir -p pkg"
|
101
|
+
sh "gem build #{gemspec_file}"
|
102
|
+
sh "mv #{gem_file} pkg"
|
103
|
+
end
|
104
|
+
|
105
|
+
desc "Generate #{gemspec_file}"
|
106
|
+
task :gemspec => :validate do
|
107
|
+
# read spec file and split out manifest section
|
108
|
+
spec = File.read(gemspec_file)
|
109
|
+
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
110
|
+
|
111
|
+
replace_header(head, :date)
|
112
|
+
|
113
|
+
# determine file list from git ls-files
|
114
|
+
# TODO: Certain files don't belong in the gem...
|
115
|
+
files = `git ls-files`.
|
116
|
+
split("\n").
|
117
|
+
sort.
|
118
|
+
reject { |file| file =~ /^\./ }.
|
119
|
+
reject { |file| file =~ /^(rdoc|pkg)/ }.
|
120
|
+
reject { |file| file =~ /^Gemfile(\.lock)?$/ }.
|
121
|
+
map { |file| " #{file}" }.
|
122
|
+
join("\n")
|
123
|
+
|
124
|
+
# piece file back together and write
|
125
|
+
manifest = " octo.files = %w[\n#{files}\n ]\n"
|
126
|
+
spec = [head, manifest, tail].join(" # = MANIFEST =\n")
|
127
|
+
File.open(gemspec_file, 'w') { |io| io.write(spec) }
|
128
|
+
puts "Updated #{gemspec_file}"
|
129
|
+
end
|
130
|
+
|
131
|
+
desc "Validate #{gemspec_file}"
|
132
|
+
task :validate do
|
133
|
+
libfiles = Dir['lib/*'] - ["lib/#{ruby_name}.rb", "lib/#{ruby_name}"]
|
134
|
+
unless libfiles.empty?
|
135
|
+
puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir."
|
136
|
+
exit!
|
137
|
+
end
|
138
|
+
if Dir['MANIFEST.yml'].empty?
|
139
|
+
puts "A `MANIFEST.yml` file must exist in your root with at least your plugin slug and version."
|
140
|
+
exit!
|
141
|
+
end
|
142
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require "safe_yaml"
|
4
|
+
|
5
|
+
def manifest
|
6
|
+
@manifest ||= YAML.safe_load_file(File.expand_path("../MANIFEST.yml", __FILE__))
|
7
|
+
end
|
8
|
+
|
9
|
+
Gem::Specification.new do |plugin|
|
10
|
+
plugin.specification_version = 2 if plugin.respond_to? :specification_version=
|
11
|
+
plugin.required_rubygems_version = Gem::Requirement.new(">= 0") if plugin.respond_to? :required_rubygems_version=
|
12
|
+
plugin.rubygems_version = '1.3.5'
|
13
|
+
|
14
|
+
plugin.name = manifest["name"]
|
15
|
+
plugin.version = manifest["version"]
|
16
|
+
plugin.date = '2013-05-23'
|
17
|
+
plugin.authors = manifest["authors"]
|
18
|
+
plugin.email = manifest["emails"]
|
19
|
+
plugin.description = manifest["description"]
|
20
|
+
plugin.summary = manifest["summary"]
|
21
|
+
plugin.homepage = manifest["homepage"]
|
22
|
+
|
23
|
+
plugin.rdoc_options = ["--charset=UTF-8"]
|
24
|
+
plugin.extra_rdoc_files = manifest["extra_rdoc_files"]
|
25
|
+
|
26
|
+
# = MANIFEST =
|
27
|
+
plugin.files = %w[
|
28
|
+
]
|
29
|
+
# = MANIFEST =
|
30
|
+
|
31
|
+
plugin.require_paths = %w[lib]
|
32
|
+
plugin.executables = plugin.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
33
|
+
plugin.test_files = plugin.files.grep(%r{^(test|spec|features)/})
|
34
|
+
|
35
|
+
{
|
36
|
+
"octopress" => "~> 3.0.0"
|
37
|
+
}.each do |gem_name, version|
|
38
|
+
plugin.add_runtime_dependency(gem_name, version)
|
39
|
+
end
|
40
|
+
|
41
|
+
plugin.add_development_dependency('rake', '~> 10.0.3')
|
42
|
+
plugin.add_development_dependency('rspec', '~> 2.13.0')
|
43
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
# ------------------------------- #
|
3
|
+
# Classic Theme Configuration #
|
4
|
+
# ------------------------------- #
|
5
|
+
|
6
|
+
url: http://yoursite.com
|
7
|
+
title: My Octopress Blog
|
8
|
+
subtitle: A blogging framework for hackers.
|
9
|
+
author: Your Name
|
10
|
+
simple_search: http://google.com/search
|
11
|
+
description:
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
# ------------------------------- #
|
3
|
+
# Classic Theme Configuration #
|
4
|
+
# ------------------------------- #
|
5
|
+
|
6
|
+
url: http://yoursite.com
|
7
|
+
title: My Octopress Blog
|
8
|
+
subtitle: A blogging framework for hackers.
|
9
|
+
author: Your Name
|
10
|
+
simple_search: http://google.com/search
|
11
|
+
description:
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
# ------------------------------- #
|
3
|
+
# Classic Theme Configuration #
|
4
|
+
# ------------------------------- #
|
5
|
+
|
6
|
+
url: http://myownsite.com
|
7
|
+
title: My Octopress custom Blog
|
8
|
+
subtitle: "How did this get here? I'm not good with computers"
|
9
|
+
author: John Doe
|
10
|
+
simple_search: http://google.com/search
|
11
|
+
description:
|
@@ -0,0 +1,67 @@
|
|
1
|
+
describe Octopress do
|
2
|
+
describe ".configurator" do
|
3
|
+
it "should accept a path pointing to a config directory" do
|
4
|
+
Octopress.configurator(fixture_path('env'))
|
5
|
+
|
6
|
+
Octopress.env.should eq('config_specified_environment')
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
describe ".configuration" do
|
11
|
+
before do
|
12
|
+
Octopress.configurator(fixture_path('env'))
|
13
|
+
end
|
14
|
+
let(:configuration) { Octopress.configuration }
|
15
|
+
|
16
|
+
it "should provide access to the specified configuration" do
|
17
|
+
configuration[:env].should eq('config_specified_environment')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe Octopress::Configuration do
|
23
|
+
describe '#read_configuration' do
|
24
|
+
describe "when no override" do
|
25
|
+
before do
|
26
|
+
@octo_config = Octopress::Configuration.new(fixture_path('no_override'))
|
27
|
+
end
|
28
|
+
let(:configuration) { @octo_config.read_configuration }
|
29
|
+
let(:expected_config) {
|
30
|
+
{ :url => "http://yoursite.com",
|
31
|
+
:title => "My Octopress Blog",
|
32
|
+
:subtitle => "A blogging framework for hackers.",
|
33
|
+
:author => "Your Name",
|
34
|
+
:simple_search => "http://google.com/search",
|
35
|
+
:description => nil }
|
36
|
+
|
37
|
+
}
|
38
|
+
|
39
|
+
%w[url title subtitle author simple_search description].each do |key|
|
40
|
+
it "returns the correct value for #{key}" do
|
41
|
+
configuration[key.to_sym].should eq(expected_config[key.to_sym])
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe "when override" do
|
47
|
+
before do
|
48
|
+
@octo_config = Octopress::Configuration.new(fixture_path('override'))
|
49
|
+
end
|
50
|
+
let(:configuration) { @octo_config.read_configuration }
|
51
|
+
let(:expected_config) {
|
52
|
+
{ :url => "http://myownsite.com",
|
53
|
+
:title => "My Octopress custom Blog",
|
54
|
+
:subtitle => "How did this get here? I'm not good with computers",
|
55
|
+
:author => "John Doe",
|
56
|
+
:simple_search => "http://google.com/search",
|
57
|
+
:description => nil }
|
58
|
+
}
|
59
|
+
|
60
|
+
%w[url title subtitle author simple_search description].each do |key|
|
61
|
+
it "returns the correct value for #{key}" do
|
62
|
+
configuration[key.to_sym].should eq(expected_config[key.to_sym])
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
describe Octopress::DependencyInstaller do
|
2
|
+
# describe "#namespace" do
|
3
|
+
# context "when just a repo name is specified" do
|
4
|
+
# let(:plugin) { "adn-timeline" }
|
5
|
+
# subject { Octopress::DependencyInstaller.new.namespace(plugin) }
|
6
|
+
# it { should eq("adn-timeline") }
|
7
|
+
# end
|
8
|
+
# context "when a username and repo name are specified" do
|
9
|
+
# let(:plugin) { "imathis/adntimeline" }
|
10
|
+
# subject { Octopress::DependencyInstaller.new.namespace(plugin) }
|
11
|
+
# it { should eq("imathis-adntimeline") }
|
12
|
+
# end
|
13
|
+
# context "when a username and repo name are specified (with dash)" do
|
14
|
+
# let(:plugin) { "imathis-/adn-timeline" }
|
15
|
+
# subject { Octopress::DependencyInstaller.new.namespace(plugin) }
|
16
|
+
# it { should eq("imathis-adn-timeline") }
|
17
|
+
# end
|
18
|
+
# context "when a full git:// URL is specified" do
|
19
|
+
# let(:plugin) { "git://github.com/parkr/cool-plugin.git" }
|
20
|
+
# subject { Octopress::DependencyInstaller.new.namespace(plugin) }
|
21
|
+
# it { should eq("parkr-cool-plugin") }
|
22
|
+
# end
|
23
|
+
# context "when a full https:// URL is specified" do
|
24
|
+
# let(:plugin) { "https://bitbucket.com/parkr/cool-plugin.git" }
|
25
|
+
# subject { Octopress::DependencyInstaller.new.namespace(plugin) }
|
26
|
+
# it { should eq("parkr-cool-plugin") }
|
27
|
+
# end
|
28
|
+
# context "when a full git SSH path is specified" do
|
29
|
+
# let(:plugin) { "git@octopress.org:parkr/cool-plugin.git" }
|
30
|
+
# subject { Octopress::DependencyInstaller.new.namespace(plugin) }
|
31
|
+
# it { should eq("parkr-cool-plugin") }
|
32
|
+
# end
|
33
|
+
# end
|
34
|
+
describe "#git_url" do
|
35
|
+
context "when just a repo name is specified" do
|
36
|
+
let(:plugin) { "adn-timeline" }
|
37
|
+
subject { Octopress::DependencyInstaller.new.git_url(plugin) }
|
38
|
+
it { should eq("git://github.com/octopress/#{plugin}.git") }
|
39
|
+
end
|
40
|
+
context "when a username and repo name are specified" do
|
41
|
+
let(:plugin) { "imathis/adntimeline" }
|
42
|
+
subject { Octopress::DependencyInstaller.new.git_url(plugin) }
|
43
|
+
it { should eq("git://github.com/#{plugin}.git") }
|
44
|
+
end
|
45
|
+
context "when a username and repo name are specified (with dash)" do
|
46
|
+
let(:plugin) { "imathis-/adn-timeline" }
|
47
|
+
subject { Octopress::DependencyInstaller.new.git_url(plugin) }
|
48
|
+
it { should eq("git://github.com/#{plugin}.git") }
|
49
|
+
end
|
50
|
+
context "when a full git:// URL is specified" do
|
51
|
+
let(:plugin) { "git://github.com/parkr/cool-plugin.git" }
|
52
|
+
subject { Octopress::DependencyInstaller.new.git_url(plugin) }
|
53
|
+
it { should eq(plugin) }
|
54
|
+
end
|
55
|
+
context "when a full https:// URL is specified" do
|
56
|
+
let(:plugin) { "https://bitbucket.com/parkr/cool-plugin.git" }
|
57
|
+
subject { Octopress::DependencyInstaller.new.git_url(plugin) }
|
58
|
+
it { should eq(plugin) }
|
59
|
+
end
|
60
|
+
context "when a full git SSH path is specified" do
|
61
|
+
let(:plugin) { "git@octopress.org:parkr/cool-plugin.git" }
|
62
|
+
subject { Octopress::DependencyInstaller.new.git_url(plugin) }
|
63
|
+
it { should eq(plugin) }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
describe Octopress do
|
2
|
+
describe '#env' do
|
3
|
+
context "when ENV['OCTOPRESS_ENV'] is specified" do
|
4
|
+
before do
|
5
|
+
ENV['OCTOPRESS_ENV'] = 'some_environment'
|
6
|
+
end
|
7
|
+
|
8
|
+
subject do
|
9
|
+
Octopress.env
|
10
|
+
end
|
11
|
+
|
12
|
+
it "returns the environment as something that quacks like a string" do
|
13
|
+
should eq('some_environment')
|
14
|
+
end
|
15
|
+
|
16
|
+
# For the InquirableString functionality...
|
17
|
+
describe "#some_environment?" do
|
18
|
+
subject do
|
19
|
+
Octopress.env.some_environment?
|
20
|
+
end
|
21
|
+
|
22
|
+
it "returns true when the environment is set to 'some_environment'" do
|
23
|
+
should be_true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "#some_other_environment?" do
|
28
|
+
subject do
|
29
|
+
Octopress.env.some_other_environment?
|
30
|
+
end
|
31
|
+
|
32
|
+
it "returns false when the environment is set to 'some_environment'" do
|
33
|
+
should be_false
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe "when ENV['OCTOPRESS_ENV'] is NOT specified and a value is specified in config files" do
|
39
|
+
before do
|
40
|
+
@old_value = ENV['OCTOPRESS_ENV']
|
41
|
+
ENV['OCTOPRESS_ENV'] = nil
|
42
|
+
Octopress.configurator(File.join(File.dirname(__FILE__), '..', 'fixtures', 'env'))
|
43
|
+
end
|
44
|
+
|
45
|
+
after do
|
46
|
+
ENV['OCTOPRESS_ENV'] = @old_value
|
47
|
+
Octopress.clear_config!
|
48
|
+
end
|
49
|
+
|
50
|
+
subject do
|
51
|
+
Octopress.env
|
52
|
+
end
|
53
|
+
|
54
|
+
it "returns the environment as something that quacks like a string" do
|
55
|
+
should eq('config_specified_environment')
|
56
|
+
end
|
57
|
+
|
58
|
+
# For the InquirableString functionality...
|
59
|
+
describe "#config_specified_environment?" do
|
60
|
+
subject do
|
61
|
+
Octopress.env.config_specified_environment?
|
62
|
+
end
|
63
|
+
|
64
|
+
it "returns true when the environment is set to 'config_specified_environment'" do
|
65
|
+
should be_true
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
describe "#some_other_environment?" do
|
70
|
+
subject do
|
71
|
+
Octopress.env.some_other_environment?
|
72
|
+
end
|
73
|
+
|
74
|
+
it "returns false when the environment is set to 'config_specified_environment'" do
|
75
|
+
should be_false
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe "when the configuration value changes mid-execution" do
|
81
|
+
before do
|
82
|
+
@old_value = ENV['OCTOPRESS_ENV']
|
83
|
+
ENV['OCTOPRESS_ENV'] = 'value_a'
|
84
|
+
end
|
85
|
+
|
86
|
+
after do
|
87
|
+
ENV['OCTOPRESS_ENV'] = @old_value
|
88
|
+
end
|
89
|
+
|
90
|
+
it "returns the initial environment value, then after it's changed, returns the new one" do
|
91
|
+
Octopress.env.should eq('value_a')
|
92
|
+
ENV['OCTOPRESS_ENV'] = 'value_b'
|
93
|
+
Octopress.env.should eq('value_b')
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|