Skip to content

Commit

Permalink
Drop support for Ruby 1.8. (#256)
Browse files Browse the repository at this point in the history
* Drop support for Ruby 1.8.

As per the conversation in:

#255

* Address rubocop violation.

* Mention 1.8 support drop in changelog.
  • Loading branch information
frewsxcv authored and egonSchiele committed Apr 20, 2017
1 parent be09367 commit 8e6d4ee
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ bundler_args: --without development

matrix:
include:
- rvm: "1.8.7"
dist: precise
- rvm: "1.9.2"
dist: precise
- rvm: jruby-18mode # JRuby in 1.8 mode
dist: precise
- rvm: jruby-19mode # JRuby in 1.9 mode
dist: precise
4 changes: 4 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.16.0 (unreleased)

- Support for Ruby 1.8 has been discontinued - [#256](https://github.com/egonSchiele/contracts.ruby/pull/256)

## v0.15.0
- Bugfix: Func contract's return value isn't enforced with blocks - [Piotr Szmielew](https://github.com/esse) [#251](https://github.com/egonSchiele/contracts.ruby/pull/251)
- Bugfx: Fix contracts used in AR-models - [Gert Goet](https://github.com/eval) [#237](https://github.com/egonSchiele/contracts.ruby/pull/237)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Using contracts.ruby results in very little slowdown. Check out [this blog post]

**Q.** What Rubies can I use this with?

**A.** It's been tested with `1.8.7`, `1.9.2`, `1.9.3`, `2.0.0`, `2.1`, `2.2`, and `jruby` (both 1.8 and 1.9 modes).
**A.** It's been tested with `1.9.2`, `1.9.3`, `2.0.0`, `2.1`, `2.2`, and `jruby` (1.9 mode).

If you're using the library, please [let me know](https://github.com/egonSchiele) what project you're using it on :)

Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ else
task :default => [:spec]
end


task :add_tag do
`git tag -a v#{Contracts::VERSION} -m 'v#{Contracts::VERSION}'`
end
Expand Down
15 changes: 3 additions & 12 deletions lib/contracts/support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@ class << self
def method_position(method)
return method.method_position if method.is_a?(MethodReference)

if RUBY_VERSION =~ /^1\.8/
if method.respond_to?(:__file__)
method.__file__ + ":" + method.__line__.to_s
else
method.inspect
end
else
file, line = method.source_location
file + ":" + line.to_s
end
file, line = method.source_location
file + ":" + line.to_s
end

def method_name(method)
Expand All @@ -34,8 +26,7 @@ def contract_id(contract)
end

def eigenclass_hierarchy_supported?
return false if RUBY_PLATFORM == "java" && RUBY_VERSION.to_f < 2.0
RUBY_VERSION.to_f > 1.8
RUBY_PLATFORM != "java" || RUBY_VERSION.to_f >= 2.0
end

def eigenclass_of(target)
Expand Down

0 comments on commit 8e6d4ee

Please sign in to comment.