parent
e9ecb93dec
commit
f05e3f340e
|
@ -1,3 +0,0 @@
|
|||
jekyll
|
||||
site
|
||||
Gemfile.lock
|
|
@ -1,2 +0,0 @@
|
|||
source 'https://rubygems.org'
|
||||
gemspec
|
|
@ -1,60 +0,0 @@
|
|||
task :default => :init
|
||||
|
||||
def name
|
||||
"jekyll-docs".freeze
|
||||
end
|
||||
|
||||
def gemspec_file
|
||||
"#{name}.gemspec"
|
||||
end
|
||||
|
||||
def gem_file
|
||||
"#{name}-#{version}.gem"
|
||||
end
|
||||
|
||||
def version
|
||||
ENV.fetch('JEKYLL_VERSION')
|
||||
end
|
||||
|
||||
task :init do
|
||||
sh "git clone git://github.com/jekyll/jekyll.git jekyll" unless Dir.exist? "jekyll/.git"
|
||||
Dir.chdir("jekyll") { sh "git checkout v#{version}" }
|
||||
rm_rf "site"
|
||||
cp_r "jekyll/site", "site"
|
||||
end
|
||||
|
||||
task :teardown do
|
||||
rm_rf "site"
|
||||
rm_rf "jekyll"
|
||||
end
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# Packaging tasks
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
desc "Release #{name} v#{version}"
|
||||
task :release => :build do
|
||||
unless `git branch` =~ /^\* master$/
|
||||
puts "You must be on the master branch to release!"
|
||||
exit!
|
||||
end
|
||||
unless `git diff`.empty?
|
||||
puts "We cannot proceed with uncommitted changes!"
|
||||
exit!
|
||||
end
|
||||
sh "gem push pkg/#{name}-#{version}.gem"
|
||||
end
|
||||
|
||||
desc "Build #{name} v#{version} into pkg/"
|
||||
task :build => :init do
|
||||
mkdir_p "pkg"
|
||||
sh "gem build #{gemspec_file}"
|
||||
sh "mv #{gem_file} pkg"
|
||||
end
|
||||
|
||||
desc "Install #{name} v#{version} into your gem folder."
|
||||
task :install => :build do
|
||||
sh "gem install -l pkg/#{gem_file}"
|
||||
end
|
|
@ -1,19 +0,0 @@
|
|||
# coding: utf-8
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = 'jekyll-docs'
|
||||
spec.version = ENV.fetch('JEKYLL_VERSION')
|
||||
spec.authors = ['Parker Moore']
|
||||
spec.email = ['parkrmoore@gmail.com']
|
||||
spec.summary = %q{Offline usage documentation for Jekyll.}
|
||||
spec.homepage = 'http://jekyllrb.com'
|
||||
spec.license = 'MIT'
|
||||
|
||||
spec.files = Dir['**/*'].grep(%r{^(lib|site)/})
|
||||
spec.require_paths = ['lib']
|
||||
|
||||
spec.add_dependency 'jekyll', ENV.fetch('JEKYLL_VERSION')
|
||||
|
||||
spec.add_development_dependency 'bundler', '~> 1.7'
|
||||
spec.add_development_dependency 'rake', '~> 10.0'
|
||||
end
|
|
@ -1,37 +0,0 @@
|
|||
require 'rubygems'
|
||||
require 'jekyll'
|
||||
require 'tmpdir'
|
||||
|
||||
module JekyllDocs
|
||||
class DocsCommand < Jekyll::Command
|
||||
class << self
|
||||
def init_with_program(prog)
|
||||
prog.command(:docs) do |cmd|
|
||||
cmd.description "Start a local server for the Jekyll documentation"
|
||||
cmd.syntax "docs [options]"
|
||||
cmd.alias :d
|
||||
|
||||
cmd.option "port", "-P", "--port", "Port to listen on."
|
||||
|
||||
cmd.action do |_, opts|
|
||||
JekyllDocs::DocsCommand.process(opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def process(opts)
|
||||
Dir.mktmpdir do |dest_dir|
|
||||
options = opts.merge({
|
||||
"serving" => true,
|
||||
"watch" => false,
|
||||
"config" => File.expand_path("../../site/_config.yml", __FILE__),
|
||||
"source" => File.expand_path("../../site", __FILE__),
|
||||
"destination" => dest_dir
|
||||
})
|
||||
Jekyll::Commands::Build.process(options)
|
||||
Jekyll::Commands::Serve.process(options)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue