Merge pull request #1780 from mojombo/kill-1-8
This commit is contained in:
commit
39b6fe732f
|
@ -6,7 +6,6 @@ rvm:
|
|||
- 2.0.0
|
||||
- 1.9.3
|
||||
- 1.9.2
|
||||
- 1.8.7
|
||||
script: bundle exec rake
|
||||
notifications:
|
||||
irc:
|
||||
|
|
2
Rakefile
2
Rakefile
|
@ -84,7 +84,7 @@ end
|
|||
#
|
||||
#############################################################################
|
||||
|
||||
if RUBY_VERSION > '1.9' && ENV["TRAVIS"] == "true"
|
||||
if ENV["TRAVIS"] == "true"
|
||||
require 'coveralls/rake/task'
|
||||
Coveralls::RakeTask.new
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
if RUBY_VERSION > '1.9'
|
||||
require 'coveralls'
|
||||
Coveralls.wear_merged!
|
||||
end
|
||||
|
||||
require 'fileutils'
|
||||
require 'rr'
|
||||
|
@ -56,15 +54,8 @@ def file_contents(path)
|
|||
end
|
||||
|
||||
def seconds_agnostic_datetime(datetime = Time.now)
|
||||
pieces = datetime.to_s.split(" ")
|
||||
if pieces.size == 6 # Ruby 1.8.7
|
||||
date = pieces[0..2].join(" ")
|
||||
time = seconds_agnostic_time(pieces[3])
|
||||
zone = pieces[4..5].join(" ")
|
||||
else # Ruby 1.9.1 or greater
|
||||
date, time, zone = pieces
|
||||
date, time, zone = datetime.to_s.split(" ")
|
||||
time = seconds_agnostic_time(time)
|
||||
end
|
||||
[
|
||||
Regexp.escape(date),
|
||||
"#{time}:\\d{2}",
|
||||
|
@ -79,6 +70,3 @@ def seconds_agnostic_time(time)
|
|||
hour, minutes, _ = time.split(":")
|
||||
"#{hour}:#{minutes}"
|
||||
end
|
||||
|
||||
# work around "invalid option: --format" cucumber bug (see #296)
|
||||
Test::Unit.run = true if RUBY_VERSION < '1.9'
|
||||
|
|
|
@ -2,6 +2,7 @@ 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 = '1.3.5'
|
||||
s.required_ruby_version = '>= 1.9.2'
|
||||
|
||||
s.name = 'jekyll'
|
||||
s.version = '1.4.0'
|
||||
|
|
|
@ -35,7 +35,7 @@ module Jekyll
|
|||
# Returns nothing.
|
||||
def read_yaml(base, name, opts = {})
|
||||
begin
|
||||
self.content = File.read_with_options(File.join(base, name),
|
||||
self.content = File.read(File.join(base, name),
|
||||
merged_file_read_opts(opts))
|
||||
if self.content =~ /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m
|
||||
self.content = $POSTMATCH
|
||||
|
|
|
@ -54,14 +54,6 @@ class Hash
|
|||
end
|
||||
end
|
||||
|
||||
# Thanks, ActiveSupport!
|
||||
class Date
|
||||
# Converts datetime to an appropriate format for use in XML
|
||||
def xmlschema
|
||||
strftime("%Y-%m-%dT%H:%M:%S%Z")
|
||||
end if RUBY_VERSION < '1.9'
|
||||
end
|
||||
|
||||
module Enumerable
|
||||
# Returns true if path matches against any glob pattern.
|
||||
# Look for more detail about glob pattern in method File::fnmatch.
|
||||
|
@ -69,18 +61,3 @@ module Enumerable
|
|||
any? { |exp| File.fnmatch?(exp, e) }
|
||||
end
|
||||
end
|
||||
|
||||
# Ruby 1.8's File.read don't support option.
|
||||
# read_with_options ignore optional parameter for 1.8,
|
||||
# and act as alias for 1.9 or later.
|
||||
class File
|
||||
if RUBY_VERSION < '1.9'
|
||||
def self.read_with_options(path, opts = {})
|
||||
self.read(path)
|
||||
end
|
||||
else
|
||||
def self.read_with_options(path, opts = {})
|
||||
self.read(path, opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -128,7 +128,7 @@ eos
|
|||
|
||||
# This method allows to modify the file content by inheriting from the class.
|
||||
def source(file, context)
|
||||
File.read_with_options(file, file_read_opts(context))
|
||||
File.read(file, file_read_opts(context))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
if RUBY_VERSION > '1.9'
|
||||
require 'simplecov'
|
||||
require 'simplecov-gem-adapter'
|
||||
SimpleCov.start('gem')
|
||||
|
||||
require 'coveralls'
|
||||
Coveralls.wear_merged!
|
||||
end
|
||||
|
||||
require 'rubygems'
|
||||
require 'test/unit'
|
||||
|
@ -19,7 +17,6 @@ require 'rdiscount'
|
|||
require 'kramdown'
|
||||
require 'redcarpet'
|
||||
|
||||
require 'redgreen' if RUBY_VERSION < '1.9'
|
||||
require 'shoulda'
|
||||
require 'rr'
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ class TestConvertible < Test::Unit::TestCase
|
|||
assert_no_match /undefined class\/module DoesNotExist/, out
|
||||
end
|
||||
|
||||
if RUBY_VERSION >= '1.9.2'
|
||||
should "not parse if there is encoding error in file" do
|
||||
name = 'broken_front_matter3.erb'
|
||||
out = capture_stdout do
|
||||
|
@ -48,4 +47,3 @@ class TestConvertible < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue