iba 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc9ef58cc2d18bc4e74c789ebed62265cee83bfaf45ee7a7c5e21d2d73c216ca
4
- data.tar.gz: cbae41b9fae66df4aa717008627d1478d54e4cc61a90d48371460a23357d4dee
3
+ metadata.gz: 49e6f73bb978616351ca138d4ff42432c9cfa38cbcb5b4d93eb00b62b23d1021
4
+ data.tar.gz: '09c747c291010e0b9fa5034852140a896207297d3480553a4b7017bf74906447'
5
5
  SHA512:
6
- metadata.gz: 7ba511885b585a67f8a8dec3b0792c2fd4bc63fd2e575580d22f9b1dab158b7f6e87ea32244ddb5461d2a36d3fcc8eb362c5944b28990728295e52f5ea192797
7
- data.tar.gz: 9ef4e73638d5fe567b0ae77a0ac031b3772c71353287aa5fea8a6d3cfd960fb1a1d5b18ca36dd6d8547abeeeaf0b2037b1357b4556c2d55adf4329702910a295
6
+ metadata.gz: 9240c687556f73c3b920b90c35bc82a292cfe649c0cefdb7fbfcc457a5567d57a022ae6436747ac192c88fa510be99a40b12926a5e63a03fc0aff58ede11e24e
7
+ data.tar.gz: 66fb6ec636493085dc8c6670d4eaeb4327d68a12576a89c54a5858c9e6c20b0084160b08a8cb020a25e1634843e21d893c9facd40ac87216b4a5ab8f967aee9d
data/CHANGELOG.md ADDED
@@ -0,0 +1,53 @@
1
+ # Changelog
2
+
3
+ ## 0.0.8 / 2025-10-24
4
+
5
+ * Support Ruby 3.2 through 3.4, and JRuby 10.0 ([#72] and [#74] by [mvz])
6
+
7
+ [#72]: https://github.com/mvz/iba/pull/72
8
+ [#74]: https://github.com/mvz/iba/pull/74
9
+
10
+ ## 0.0.7 / 2024-01-05
11
+
12
+ * Support Ruby 3.0 through 3.3, and JRuby 9.4 ([#63], [#64] and [#68] by [mvz])
13
+
14
+ [#63]: https://github.com/mvz/iba/pull/63
15
+ [#64]: https://github.com/mvz/iba/pull/64
16
+ [#68]: https://github.com/mvz/iba/pull/68
17
+
18
+ ## 0.0.6 / 2022-01-21
19
+
20
+ * Support Ruby 2.6 and up, as well as JRuby 9.3
21
+ * Display more subexpressions ([#13] by [mvz])
22
+ * Add and use VERSION constant ([#49] by [mvz])
23
+
24
+ [#13]: https://github.com/mvz/iba/pull/13
25
+ [#49]: https://github.com/mvz/iba/pull/49
26
+
27
+ ## 0.0.5 / 2018-03-25
28
+
29
+ * Target Ruby 2.2 and up
30
+ * Remove all use of eval ([#1] by [mvz])
31
+
32
+ [mvz]: https://github.com/mvz
33
+
34
+ [#1]: https://github.com/mvz/iba/pull/1
35
+
36
+ ## 0.0.4 / 2017-12-15
37
+
38
+ * Target Ruby 2.1 and up
39
+
40
+ ## 0.0.3 / 2014-05-09
41
+
42
+ * Make Iba work with Ruby 1.9
43
+
44
+ ## 0.0.2 / 2011-02-25
45
+
46
+ * Properly analyse comparison with arrays and strings
47
+ * Allow instance variables in asserted expression
48
+
49
+ ## 0.0.1 / 2011-01-02
50
+
51
+ * Initial release
52
+
53
+ No match for: Prepare version 0.0.7 for release
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010--2011 Matijs van Zuijlen
1
+ Copyright (c) 2010--2011, 2014-2025 Matijs van Zuijlen
2
2
 
3
3
  Iba is free software; you can redistribute it and/or modify it under the
4
4
  terms of the GNU Lesser General Public License as published by the Free Software
@@ -12,5 +12,3 @@ more details.
12
12
 
13
13
  You should have received a copy of the GNU Lesser General Public License
14
14
  along with this library. If not, see <http://www.gnu.org/licenses/>.
15
-
16
-
data/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # Iba
2
+
3
+ by Matijs van Zuijlen
4
+
5
+ ## Description
6
+
7
+ Introspective Block Assertions
8
+
9
+ ## Features/Problems
10
+
11
+ * Write assertions as a (one-expression) block
12
+ * Assertion message deconstructs the block's expression.
13
+ * Not done yet.
14
+
15
+ ## Synopsis
16
+
17
+ ```ruby
18
+ # In your test helper:
19
+ require 'iba'
20
+ class Test::Unit::TestCase
21
+ include Iba::BlockAssertion
22
+ end
23
+
24
+ # In your test:
25
+ foo = 24
26
+ assert { foo == 23 } # => "(foo == 23) is false
27
+ # foo is 24."
28
+ ```
29
+
30
+ ## Details
31
+
32
+ Iba provides an assert method that takes a block. If the block returns
33
+ false, it will try to construct an insightful error message based on the
34
+ contents of the block.
35
+
36
+ Iba's functionality is inspired by [Wrong], but doesn't use an external
37
+ Ruby parser. This means it will work in contexts where Wrong does not
38
+ (generated code, on the command line). It also means there are more limits
39
+ to the contents of the block.
40
+
41
+ Current limits:
42
+
43
+ * Only single-expression blocks are supported.
44
+ * The expression must start with a method-like identifier or an instance
45
+ variable (like `foo` or `@foo`, but not `Foo` or `23`). In practice,
46
+ this produces quite natural results.
47
+ * Local and instance variables whose names start with an underscore should
48
+ not be used inside the block.
49
+
50
+ Iba's implementation is inspired by [Arlo], a generic combinator library
51
+ for Python. The implementation of Arlo is now [on github][arlo-code].
52
+
53
+ ## Install
54
+
55
+ ```
56
+ gem install iba
57
+ ```
58
+
59
+ <!-- Links -->
60
+
61
+ [Wrong]: https://github.com/sconover/wrong
62
+ [Arlo]: https://web.archive.org/web/20081228090759/http://withoutane.com:80/rants/2008/12/arlo-generic-combinators-for-python
63
+ [arlo-code]: https://github.com/tangentstorm/workshop/blob/main/code/arlo.py
64
+
65
+ ## Licence
66
+
67
+ See the LICENSE file
data/lib/iba/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Iba
4
- VERSION = "0.0.6"
4
+ VERSION = "0.0.8"
5
5
  end
data/lib/iba.rb CHANGED
@@ -21,7 +21,7 @@ module Iba
21
21
  end
22
22
 
23
23
  def analyse
24
- str = +"#{self} is #{call.inspect}"
24
+ str = "#{self} is #{call.inspect}"
25
25
  sub = expression._display_subexpressions(@block.binding)
26
26
  str << "\n#{sub}" if sub
27
27
  str
@@ -240,7 +240,7 @@ module Iba
240
240
 
241
241
  def _regular_method_to_s
242
242
  rcv = _receiver_s
243
- str = rcv == "" ? +"" : +"#{rcv}."
243
+ str = rcv == "" ? +"" : "#{rcv}."
244
244
  str << @_method.to_s
245
245
  str << "(#{_args_s.join(', ')})" unless @_args.empty?
246
246
  str
@@ -263,7 +263,7 @@ module Iba
263
263
  end
264
264
  else
265
265
  test, msg = *args
266
- super test, msg
266
+ super(test, msg)
267
267
  end
268
268
  end
269
269
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iba
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matijs van Zuijlen
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2022-01-21 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -44,42 +43,42 @@ dependencies:
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: 1.25.0
46
+ version: '1.52'
48
47
  type: :development
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - "~>"
53
52
  - !ruby/object:Gem::Version
54
- version: 1.25.0
53
+ version: '1.52'
55
54
  - !ruby/object:Gem::Dependency
56
55
  name: rubocop-packaging
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: 0.5.0
60
+ version: 0.6.0
62
61
  type: :development
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: 0.5.0
67
+ version: 0.6.0
69
68
  - !ruby/object:Gem::Dependency
70
69
  name: rubocop-performance
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - "~>"
74
73
  - !ruby/object:Gem::Version
75
- version: 1.13.0
74
+ version: '1.18'
76
75
  type: :development
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
79
  - - "~>"
81
80
  - !ruby/object:Gem::Version
82
- version: 1.13.0
81
+ version: '1.18'
83
82
  - !ruby/object:Gem::Dependency
84
83
  name: test-unit
85
84
  requirement: !ruby/object:Gem::Requirement
@@ -102,13 +101,14 @@ email:
102
101
  executables: []
103
102
  extensions: []
104
103
  extra_rdoc_files:
105
- - README.rdoc
106
- - LICENSE
107
104
  - COPYING.LESSER
105
+ - LICENSE
106
+ - README.md
108
107
  files:
108
+ - CHANGELOG.md
109
109
  - COPYING.LESSER
110
110
  - LICENSE
111
- - README.rdoc
111
+ - README.md
112
112
  - lib/iba.rb
113
113
  - lib/iba/version.rb
114
114
  homepage: http://www.github.com/mvz/iba
@@ -117,26 +117,25 @@ licenses:
117
117
  metadata:
118
118
  homepage_uri: http://www.github.com/mvz/iba
119
119
  source_code_uri: https://github.com/mvz/iba
120
+ changelog_uri: https://github.com/mvz/iba/blob/master/CHANGELOG.md
120
121
  rubygems_mfa_required: 'true'
121
- post_install_message:
122
122
  rdoc_options:
123
123
  - "--main"
124
- - README.rdoc
124
+ - README.md
125
125
  require_paths:
126
126
  - lib
127
127
  required_ruby_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 2.6.0
131
+ version: 3.2.0
132
132
  required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - ">="
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubygems_version: 3.3.3
139
- signing_key:
138
+ rubygems_version: 3.7.2
140
139
  specification_version: 4
141
140
  summary: Introspective Block Assertions
142
141
  test_files: []
data/README.rdoc DELETED
@@ -1,62 +0,0 @@
1
- = Iba
2
-
3
- by Matijs van Zuijlen
4
-
5
- == Description
6
-
7
- Introspective Block Assertions
8
-
9
- == Features/Problems
10
-
11
- * Write assertions as a (one-expression) block
12
- * Assertion message deconstructs the block's expression.
13
- * Not done yet.
14
-
15
- == Synopsis
16
-
17
- # In your test helper:
18
- require 'iba'
19
- class Test::Unit::TestCase
20
- include Iba::BlockAssertion
21
- end
22
-
23
- # In your test:
24
- foo = 24
25
- assert { foo == 23 } # => "(foo == 23) is false
26
- # foo is 24."
27
-
28
- == Details
29
-
30
- Iba provides an assert method that takes a block. If the block returns
31
- false, it will try to construct an insightful error message based on the
32
- contents of the block.
33
-
34
- Iba's functionality is inspired by Wrong[1], but doesn't use an external
35
- Ruby parser. This means it will work in contexts where Wrong does not
36
- (generated code, on the command line). It also means there are more limits
37
- to the contents of the block.
38
-
39
- Current limits:
40
-
41
- * Only single-expression blocks are supported.
42
- * The expression must start with a method-like identifier or an instance
43
- variable (like 'foo' or '@foo', but not 'Foo' or '23'). In practice,
44
- this produces quite natural results.
45
- * Local and instance variables whose names start with an underscore should
46
- not be used inside the block.
47
-
48
- Iba's implementation is inspired by Arlo[2], a generic combinator library
49
- for Python.
50
-
51
- == Install
52
-
53
- gem install iba
54
-
55
- == Links
56
-
57
- [1] https://github.com/sconover/wrong
58
- [2] http://withoutane.com/rants/2008/12/arlo-generic-combinators-for-python
59
-
60
- == Licence
61
-
62
- See the LICENSE file.