-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from sferik/ruby_1.8
Add Ruby 1.8.7 compatibility
- Loading branch information
Showing
31 changed files
with
175 additions
and
128 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--order random |
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 |
---|---|---|
@@ -1,10 +1,20 @@ | ||
before_install: | ||
- gem update --system 2.1.11 | ||
- gem --version | ||
bundler_args: --without development | ||
language: ruby | ||
rvm: | ||
- 1.8.7 | ||
- 1.9.2 | ||
- 1.9.3 | ||
- 2.0.0 | ||
- 2.1.0 | ||
- jruby | ||
- jruby-head | ||
- rbx | ||
- ruby-head | ||
matrix: | ||
allow_failures: | ||
- rvm: jruby-head | ||
- rvm: ruby-head | ||
fast_finish: true |
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
Features: | ||
|
||
- New "pebble" mode (Guilherme Carvalho) | ||
|
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,13 @@ | ||
module Naught | ||
if defined? ::BasicObject | ||
class BasicObject < ::BasicObject | ||
end | ||
else | ||
class BasicObject #:nodoc: | ||
keep = %w[! != == __id__ __send__ equal? instance_eval instance_exec method_missing singleton_method_added singleton_method_removed singleton_method_undefined] | ||
instance_methods.each do |method_name| | ||
undef_method(method_name) unless keep.include?(method_name) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
module Naught | ||
module Conversions | ||
|
||
def self.included(null_class) | ||
unless class_variable_defined?(:@@included) && @@included | ||
@@null_class = null_class | ||
@@null_equivs = null_class::NULL_EQUIVS | ||
@@included = true | ||
end | ||
super | ||
end | ||
|
||
def Null(object=:nothing_passed) | ||
case object | ||
when NullObjectTag | ||
object | ||
when :nothing_passed, *@@null_equivs | ||
@@null_class.get(:caller => caller(1)) | ||
else | ||
raise ArgumentError, "#{object.inspect} is not null!" | ||
end | ||
end | ||
|
||
def Maybe(object=nil) | ||
object = yield if block_given? | ||
case object | ||
when NullObjectTag | ||
object | ||
when *@@null_equivs | ||
@@null_class.get(:caller => caller(1)) | ||
else | ||
object | ||
end | ||
end | ||
|
||
def Just(object=nil) | ||
object = yield if block_given? | ||
case object | ||
when NullObjectTag, *@@null_equivs | ||
raise ArgumentError, "Null value: #{object.inspect}" | ||
else | ||
object | ||
end | ||
end | ||
|
||
def Actual(object=nil) | ||
object = yield if block_given? | ||
case object | ||
when NullObjectTag | ||
nil | ||
else | ||
object | ||
end | ||
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -32,4 +32,4 @@ | |
expect(null_class.get.class).to be(null_class) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
expect(null.foobaz).to be(null) | ||
expect(null << "bar").to be(null) | ||
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
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 |
---|---|---|
|
@@ -19,4 +19,4 @@ | |
expect(Actual{ConvertableNull.new}).to be_nil | ||
expect(Actual{"foo"}).to eq("foo") | ||
end | ||
end | ||
end |
Oops, something went wrong.