expectation 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e82b68f20c078cadb99ae70a9fe2d3f73288680
4
- data.tar.gz: 071efc275974c5a339a4f4178cdaf6dd042f398d
3
+ metadata.gz: 803339254e55ef86bcc85c873f8c482bdf84cc81
4
+ data.tar.gz: 635f402969492b7fb7a0997c4869712344413393
5
5
  SHA512:
6
- metadata.gz: 7cb4aa141fe72c1ca03c748add680c855b8c20e2b946386c3380a342515054fc8de7b32e8f5c32cc3e46f7a18ee1c9a0c16f4e816bed7503a146ad65f455d59b
7
- data.tar.gz: 6b9ebdad0ceadeb168cd26587a5ca0407b7e8c5151fa6daebced22366d0d1cd10ddee17033862ae2c612bf03c71ae4f82f6d33ea9d1c9f8474aafc8580fa1a01
6
+ metadata.gz: 69019c598a80628fde36af429545e2c3db3aa65525a69d2f058f6ade9cdb06f36bc3917cedf2b0ea7bab78e340ceeef4a5ec3106d6cfd43fa6bb2d621f5c2e28
7
+ data.tar.gz: 5d380a6e7d2a2edb3cf7a2832413c20a7162748af694e8e8b42a1f755e311be27643e0378e8960f6e651739194caf75b1196b7ec9aeffebffb8652d251180145
@@ -11,8 +11,10 @@
11
11
  #
12
12
  # We currently support the following annotations:
13
13
  #
14
- # - expects!
15
- # - returns!
14
+ # - +Expects
15
+ # - +Returns
16
+ # - +Nothrows
17
+ # - +Runtime
16
18
  #
17
19
  # == Example
18
20
  #
@@ -0,0 +1,27 @@
1
+ #--
2
+ # Author:: radiospiel (mailto:eno@radiospiel.org)
3
+ # Copyright:: Copyright (c) 2011, 2012 radiospiel
4
+ # License:: Distributes under the terms of the Modified BSD License,
5
+ # see LICENSE.BSD for details.
6
+ #++
7
+
8
+ class Contracts::Deprecated < Contracts::Base
9
+ attr_reader :msg
10
+
11
+ def initialize(msg = nil)
12
+ @msg = msg
13
+ end
14
+
15
+ def before_call(_receiver, *_args, &_blk)
16
+ STDERR.puts "NOTE: #{method_name} is deprecated#{msg && ":#{msg})."
17
+ end
18
+ end
19
+
20
+ module Contracts::ClassMethods
21
+ include Contracts
22
+
23
+ +Expects(msg: [String, nil] )
24
+ def Deprecated(msg = nil)
25
+ Contracts::Deprecated.new msg
26
+ end
27
+ end
@@ -59,5 +59,5 @@ end
59
59
  def expect!(*args, &block)
60
60
  Expectation.expect! *args, &block
61
61
  rescue Expectation::Error
62
- $ERROR_INFO.reraise_with_current_backtrace!
62
+ $!.reraise_with_current_backtrace!
63
63
  end
@@ -5,5 +5,5 @@
5
5
  # see LICENSE.BSD for details.
6
6
  module Expectation
7
7
  # The expectation gem's version.
8
- VERSION = '1.1.0'
8
+ VERSION = '1.1.1'
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expectation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-20 00:00:00.000000000 Z
11
+ date: 2018-01-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Defensive programming with expectations
14
14
  email: eno@radiospiel.org
@@ -18,6 +18,7 @@ extra_rdoc_files: []
18
18
  files:
19
19
  - README.md
20
20
  - lib/contracts.rb
21
+ - lib/contracts/deprecated.rb
21
22
  - lib/contracts/expects.rb
22
23
  - lib/contracts/nothrows.rb
23
24
  - lib/contracts/returns.rb
@@ -80,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  version: '0'
81
82
  requirements: []
82
83
  rubyforge_project:
83
- rubygems_version: 2.4.6
84
+ rubygems_version: 2.5.1
84
85
  signing_key:
85
86
  specification_version: 4
86
87
  summary: Defensive programming with expectations