-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This monkeypatches some core libraries.... I don't know that I'm ok with it, but at the same time, I don't want to build in big icky hacks to make it work on old Ruby. With this approach, when we decide to drop 2.0, we can just yank the monkeypatches.rb file and be done with it.
- Loading branch information
Showing
8 changed files
with
79 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
source 'https://rubygems.org' | ||
|
||
gemspec | ||
|
||
gem 'public_suffix', '2.0.5' | ||
gem 'i18n', '1.2.0' | ||
gem 'nokogiri', '1.6.8.1' | ||
|
||
group :development do | ||
gem "turn" | ||
gem "rack-test" | ||
gem "pdf-inspector" | ||
end | ||
|
||
group :optional do | ||
gem "pdfkit" | ||
end | ||
|
||
group :test do | ||
gem 'rake' | ||
gem 'rspec' | ||
gem 'pry' | ||
end | ||
|
||
gem 'rack-contrib' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Yay for Ruby 2.0! | ||
class Hash | ||
unless Hash.method_defined? :dig | ||
def dig(*args) | ||
args.reduce(self) do |iter, arg| | ||
break nil unless iter.is_a? Enumerable | ||
break nil unless iter.include? arg | ||
iter[arg] | ||
end | ||
end | ||
end | ||
|
||
end | ||
|
||
class Nokogiri::XML::Element | ||
unless Nokogiri::XML::Element.method_defined? :add_class | ||
def add_class(classlist) | ||
self[:class] = [self[:class], classlist].join(' ') | ||
end | ||
end | ||
|
||
unless Nokogiri::XML::Element.method_defined? :classes | ||
def classes | ||
self[:class] ? self[:class].split(' ') : [] | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters