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 +4 -4
- data/lib/contracts.rb +4 -2
- data/lib/contracts/deprecated.rb +27 -0
- data/lib/expectation.rb +1 -1
- data/lib/expectation/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 803339254e55ef86bcc85c873f8c482bdf84cc81
|
4
|
+
data.tar.gz: 635f402969492b7fb7a0997c4869712344413393
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69019c598a80628fde36af429545e2c3db3aa65525a69d2f058f6ade9cdb06f36bc3917cedf2b0ea7bab78e340ceeef4a5ec3106d6cfd43fa6bb2d621f5c2e28
|
7
|
+
data.tar.gz: 5d380a6e7d2a2edb3cf7a2832413c20a7162748af694e8e8b42a1f755e311be27643e0378e8960f6e651739194caf75b1196b7ec9aeffebffb8652d251180145
|
data/lib/contracts.rb
CHANGED
@@ -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
|
data/lib/expectation.rb
CHANGED
data/lib/expectation/version.rb
CHANGED
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.
|
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:
|
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.
|
84
|
+
rubygems_version: 2.5.1
|
84
85
|
signing_key:
|
85
86
|
specification_version: 4
|
86
87
|
summary: Defensive programming with expectations
|