Merge pull request #3234 from jekyll/ruby-2-2
This commit is contained in:
commit
a098dc80cd
|
@ -2,6 +2,7 @@ language: ruby
|
||||||
cache: bundler
|
cache: bundler
|
||||||
sudo: false
|
sudo: false
|
||||||
rvm:
|
rvm:
|
||||||
|
- 2.2
|
||||||
- 2.1
|
- 2.1
|
||||||
- 2.0
|
- 2.0
|
||||||
env:
|
env:
|
||||||
|
|
4
Gemfile
4
Gemfile
|
@ -6,7 +6,7 @@ gem 'rdoc', '~> 3.11'
|
||||||
gem 'redgreen', '~> 1.2'
|
gem 'redgreen', '~> 1.2'
|
||||||
gem 'shoulda', '~> 3.5'
|
gem 'shoulda', '~> 3.5'
|
||||||
gem 'rr', '~> 1.1'
|
gem 'rr', '~> 1.1'
|
||||||
gem 'cucumber', '1.3.11'
|
gem 'cucumber', '1.3.18'
|
||||||
gem 'RedCloth', '~> 4.2'
|
gem 'RedCloth', '~> 4.2'
|
||||||
gem 'maruku', '~> 0.7.0'
|
gem 'maruku', '~> 0.7.0'
|
||||||
gem 'rdiscount', '~> 1.6'
|
gem 'rdiscount', '~> 1.6'
|
||||||
|
@ -20,7 +20,7 @@ gem 'jekyll_test_plugin_malicious'
|
||||||
gem 'rouge', '~> 1.7'
|
gem 'rouge', '~> 1.7'
|
||||||
gem 'liquid-c', '~> 0.0.3'
|
gem 'liquid-c', '~> 0.0.3'
|
||||||
gem 'minitest' if RUBY_PLATFORM =~ /cygwin/
|
gem 'minitest' if RUBY_PLATFORM =~ /cygwin/
|
||||||
gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/
|
gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2")
|
||||||
|
|
||||||
if ENV['BENCHMARK']
|
if ENV['BENCHMARK']
|
||||||
gem 'rbtrace'
|
gem 'rbtrace'
|
||||||
|
|
|
@ -47,7 +47,7 @@ Feature: Markdown
|
||||||
And I should see "My awesome code" in "_site/index.html"
|
And I should see "My awesome code" in "_site/index.html"
|
||||||
And I should see "<pre><code>My awesome code</code></pre>" in "_site/index.html"
|
And I should see "<pre><code>My awesome code</code></pre>" in "_site/index.html"
|
||||||
|
|
||||||
Scenario: Maruku fenced codeblocks
|
Scenario: Maruku fenced codeblocks with syntax highlighting
|
||||||
Given I have a configuration file with "markdown" set to "maruku"
|
Given I have a configuration file with "markdown" set to "maruku"
|
||||||
And I have an "index.markdown" file with content:
|
And I have an "index.markdown" file with content:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -24,6 +24,7 @@ end
|
||||||
After do
|
After do
|
||||||
FileUtils.rm_rf(TEST_DIR) if File.exist?(TEST_DIR)
|
FileUtils.rm_rf(TEST_DIR) if File.exist?(TEST_DIR)
|
||||||
FileUtils.rm(JEKYLL_COMMAND_OUTPUT_FILE) if File.exist?(JEKYLL_COMMAND_OUTPUT_FILE)
|
FileUtils.rm(JEKYLL_COMMAND_OUTPUT_FILE) if File.exist?(JEKYLL_COMMAND_OUTPUT_FILE)
|
||||||
|
Dir.chdir(File.dirname(TEST_DIR))
|
||||||
end
|
end
|
||||||
|
|
||||||
World(Test::Unit::Assertions)
|
World(Test::Unit::Assertions)
|
||||||
|
@ -192,7 +193,15 @@ Then /^I should see escaped "(.*)" in "(.*)"$/ do |text, file|
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^the "(.*)" file should +exist$/ do |file|
|
Then /^the "(.*)" file should +exist$/ do |file|
|
||||||
assert File.file?(file), "The file \"#{file}\" does not exist"
|
file_does_exist = File.file?(file)
|
||||||
|
unless file_does_exist
|
||||||
|
all_steps_to_path(file).each do |dir|
|
||||||
|
STDERR.puts ""
|
||||||
|
STDERR.puts "Dir #{dir}:"
|
||||||
|
STDERR.puts Dir["#{dir}/**/*"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
assert file_does_exist, "The file \"#{file}\" does not exist.\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^the "(.*)" file should not exist$/ do |file|
|
Then /^the "(.*)" file should not exist$/ do |file|
|
||||||
|
|
|
@ -13,6 +13,17 @@ def source_dir(*files)
|
||||||
File.join(TEST_DIR, *files)
|
File.join(TEST_DIR, *files)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def all_steps_to_path(path)
|
||||||
|
source = Pathname.new(source_dir('_site')).expand_path
|
||||||
|
dest = Pathname.new(path).expand_path
|
||||||
|
paths = []
|
||||||
|
dest.ascend do |f|
|
||||||
|
break if f.eql? source
|
||||||
|
paths.unshift f.to_s
|
||||||
|
end
|
||||||
|
paths
|
||||||
|
end
|
||||||
|
|
||||||
def jekyll_output_file
|
def jekyll_output_file
|
||||||
JEKYLL_COMMAND_OUTPUT_FILE
|
JEKYLL_COMMAND_OUTPUT_FILE
|
||||||
end
|
end
|
||||||
|
|
|
@ -309,7 +309,7 @@ module Jekyll
|
||||||
else
|
else
|
||||||
Jekyll.logger.error "Invalid Date:", "'#{input}' is not a valid datetime."
|
Jekyll.logger.error "Invalid Date:", "'#{input}' is not a valid datetime."
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end.localtime
|
||||||
end
|
end
|
||||||
|
|
||||||
def groupable?(element)
|
def groupable?(element)
|
||||||
|
|
|
@ -90,7 +90,7 @@ module Jekyll
|
||||||
# Returns the parsed date if successful, throws a FatalException
|
# Returns the parsed date if successful, throws a FatalException
|
||||||
# if not
|
# if not
|
||||||
def parse_date(input, msg = "Input could not be parsed.")
|
def parse_date(input, msg = "Input could not be parsed.")
|
||||||
Time.parse(input)
|
Time.parse(input).localtime
|
||||||
rescue ArgumentError
|
rescue ArgumentError
|
||||||
raise Errors::FatalException.new("Invalid date '#{input}': " + msg)
|
raise Errors::FatalException.new("Invalid date '#{input}': " + msg)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
script/branding
|
script/branding
|
||||||
bundle install
|
bundle install -j8
|
||||||
|
|
10
script/test
10
script/test
|
@ -10,7 +10,15 @@ else
|
||||||
TEST_FILES="$@"
|
TEST_FILES="$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RAKE_LIB_DIR=$(ruby -e "puts Gem::Specification.find_by_name('rake').gem_dir + '/lib'")
|
# bundle exec gem env
|
||||||
|
GEM_DIR=$(bundle exec gem env | grep -C 1 "GEM PATHS" | tail -1 | cut -d '-' -f2 | cut -d' ' -f2)
|
||||||
|
RAKE_LIB_WITH_VERSION=$(bundle exec ruby -e "puts Gem::Specification.find_by_name('rake').gem_dir.split('/').last + '/lib'")
|
||||||
|
RAKE_LIB_DIR="${GEM_DIR}/gems/${RAKE_LIB_WITH_VERSION}"
|
||||||
|
|
||||||
|
test -d "${RAKE_LIB_DIR}" || {
|
||||||
|
echo "No ${RAKE_LIB_DIR}. Installing Rake."
|
||||||
|
bundle show rake | cut -d'/' -f12 | cut -d'-' -f 2 | xargs bundle exec gem install rake -v
|
||||||
|
}
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
|
|
@ -72,11 +72,11 @@ class TestFilters < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should "format a time with xmlschema" do
|
should "format a time with xmlschema" do
|
||||||
assert_equal "2013-03-27T11:22:33Z", @filter.date_to_xmlschema(@sample_time)
|
assert_equal "2013-03-27T11:22:33+00:00", @filter.date_to_xmlschema(@sample_time)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "format a time according to RFC-822" do
|
should "format a time according to RFC-822" do
|
||||||
assert_equal "Wed, 27 Mar 2013 11:22:33 -0000", @filter.date_to_rfc822(@sample_time)
|
assert_equal "Wed, 27 Mar 2013 11:22:33 +0000", @filter.date_to_rfc822(@sample_time)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -90,11 +90,11 @@ class TestFilters < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should "format a time with xmlschema" do
|
should "format a time with xmlschema" do
|
||||||
assert_equal "2001-09-11T12:46:30Z", @filter.date_to_xmlschema(@time_as_string)
|
assert_equal "2001-09-11T12:46:30+00:00", @filter.date_to_xmlschema(@time_as_string)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "format a time according to RFC-822" do
|
should "format a time according to RFC-822" do
|
||||||
assert_equal "Tue, 11 Sep 2001 12:46:30 -0000", @filter.date_to_rfc822(@time_as_string)
|
assert_equal "Tue, 11 Sep 2001 12:46:30 +0000", @filter.date_to_rfc822(@time_as_string)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue