Merge branch 'master' into sort-gems

This commit is contained in:
Frank Taillandier 2017-01-09 23:14:21 +01:00 committed by GitHub
commit 6748f100d5
3 changed files with 55 additions and 49 deletions

View File

@ -41,6 +41,7 @@
* Bump to rake 12.0 (#5670)
* Rubocop Gemfile (#5671)
* update Classifier-Reborn to 2.1.0 (#5711)
* Rubocop: fix Rakefile and gemspec (#5745)
### Documentation

View File

@ -1,13 +1,13 @@
require 'rubygems'
require 'rake'
require 'rdoc'
require 'date'
require 'yaml'
require "rubygems"
require "rake"
require "rdoc"
require "date"
require "yaml"
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[lib]))
require 'jekyll/version'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "lib"))
require "jekyll/version"
Dir.glob('rake/**.rake').each { |f| import f }
Dir.glob("rake/**.rake").each { |f| import f }
#############################################################################
#
@ -36,21 +36,21 @@ def gemspec_file
end
def gem_file
"#{name}-#{Gem::Version.new(version).to_s}.gem"
"#{name}-#{Gem::Version.new(version)}.gem"
end
def normalize_bullets(markdown)
markdown.gsub(/\n\s{2}\*{1}/, "\n-")
markdown.gsub(%r!\n\s{2}\*{1}!, "\n-")
end
def linkify_prs(markdown)
markdown.gsub(/#(\d+)/) do |word|
markdown.gsub(%r!#(\d+)!) do |word|
"[#{word}]({{ site.repository }}/issues/#{word.delete("#")})"
end
end
def linkify_users(markdown)
markdown.gsub(/(@\w+)/) do |username|
markdown.gsub(%r!(@\w+)!) do |username|
"[#{username}](https://github.com/#{username.delete("@")})"
end
end
@ -60,13 +60,13 @@ def linkify(markdown)
end
def liquid_escape(markdown)
markdown.gsub(/(`{[{%].+[}%]}`)/, "{% raw %}\\1{% endraw %}")
markdown.gsub(%r!(`{[{%].+[}%]}`)!, "{% raw %}\\1{% endraw %}")
end
def custom_release_header_anchors(markdown)
header_regexp = /^(\d{1,2})\.(\d{1,2})\.(\d{1,2}) \/ \d{4}-\d{2}-\d{2}/
section_regexp = /^### \w+ \w+$/
markdown.split(/^##\s/).map do |release_notes|
header_regexp = %r!^(\d{1,2})\.(\d{1,2})\.(\d{1,2}) \/ \d{4}-\d{2}-\d{2}!
section_regexp = %r!^### \w+ \w+$!
markdown.split(%r!^##\s!).map do |release_notes|
_, major, minor, patch = *release_notes.match(header_regexp)
release_notes
.gsub(header_regexp, "\\0\n{: #v\\1-\\2-\\3}")
@ -75,11 +75,11 @@ def custom_release_header_anchors(markdown)
end
def sluffigy(header)
header.gsub(/#/, '').strip.downcase.gsub(/\s+/, '-')
header.delete("#").strip.downcase.gsub(%r!\s+!, "-")
end
def remove_head_from_history(markdown)
index = markdown =~ /^##\s+\d+\.\d+\.\d+/
index = markdown =~ %r!^##\s+\d+\.\d+\.\d+!
markdown[index..-1]
end
@ -88,13 +88,17 @@ def converted_history(markdown)
custom_release_header_anchors(
liquid_escape(
linkify(
normalize_bullets(markdown)))))
normalize_bullets(markdown)
)
)
)
)
end
def siteify_file(file, overrides_front_matter = {})
abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exists?(file)
abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exist?(file)
title = begin
File.read(file).match(/\A# (.*)$/)[1]
File.read(file).match(%r!\A# (.*)$!)[1]
rescue
File.basename(file, ".*").downcase.capitalize
end
@ -115,7 +119,7 @@ def content_for(file)
when "History.markdown"
converted_history(contents)
else
contents.gsub(/\A# .*\n\n?/, "")
contents.gsub(%r!\A# .*\n\n?!, "")
end
end
@ -128,23 +132,23 @@ end
multitask :default => [:test, :features]
task :spec => :test
require 'rake/testtask'
require "rake/testtask"
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.libs << "lib" << "test"
test.pattern = "test/**/test_*.rb"
test.verbose = true
end
require 'rdoc/task'
require "rdoc/task"
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.rdoc_dir = "rdoc"
rdoc.title = "#{name} #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.rdoc_files.include("README*")
rdoc.rdoc_files.include("lib/**/*.rb")
end
begin
require 'cucumber/rake/task'
require "cucumber/rake/task"
Cucumber::Rake::Task.new(:features) do |t|
t.profile = "travis"
end
@ -152,9 +156,9 @@ begin
t.profile = "html_report"
end
rescue LoadError
desc 'Cucumber rake task not available'
desc "Cucumber rake task not available"
task :features do
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
abort "Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin"
end
end

View File

@ -1,33 +1,33 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'jekyll/version'
require "jekyll/version"
Gem::Specification.new do |s|
s.specification_version = 2 if s.respond_to? :specification_version=
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
s.rubygems_version = '2.2.2'
s.required_ruby_version = '>= 2.0.0'
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.rubygems_version = "2.2.2"
s.required_ruby_version = ">= 2.0.0"
s.name = 'jekyll'
s.name = "jekyll"
s.version = Jekyll::VERSION
s.license = 'MIT'
s.license = "MIT"
s.summary = 'A simple, blog aware, static site generator.'
s.description = 'Jekyll is a simple, blog aware, static site generator.'
s.summary = "A simple, blog aware, static site generator."
s.description = "Jekyll is a simple, blog aware, static site generator."
s.authors = ['Tom Preston-Werner']
s.email = 'tom@mojombo.com'
s.homepage = 'https://github.com/jekyll/jekyll'
s.authors = ["Tom Preston-Werner"]
s.email = "tom@mojombo.com"
s.homepage = "https://github.com/jekyll/jekyll"
all_files = `git ls-files -z`.split("\x0")
s.files = all_files.grep(%r{^(exe|lib)/|^.rubocop.yml$})
s.executables = all_files.grep(%r{^exe/}) { |f| File.basename(f) }
s.files = all_files.grep(%r!^(exe|lib)/|^.rubocop.yml$!)
s.executables = all_files.grep(%r!^exe/!) { |f| File.basename(f) }
s.bindir = "exe"
s.require_paths = ['lib']
s.require_paths = ["lib"]
s.rdoc_options = ['--charset=UTF-8']
s.extra_rdoc_files = %w[README.markdown LICENSE]
s.rdoc_options = ["--charset=UTF-8"]
s.extra_rdoc_files = %w(README.markdown LICENSE)
s.add_runtime_dependency("addressable", "~> 2.4")
s.add_runtime_dependency("colorator", "~> 1.0")
@ -39,4 +39,5 @@ Gem::Specification.new do |s|
s.add_runtime_dependency("pathutil", "~> 0.9")
s.add_runtime_dependency("rouge", "~> 1.7")
s.add_runtime_dependency("safe_yaml", "~> 1.0")
end