irb-power_assert 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -39
- data/lib/irb/power_assert/version.rb +1 -1
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c7d86f7b11fc69ce48487d130a5e3b32fb65925ba3f96a99034d676b2ffea0a
|
4
|
+
data.tar.gz: 48c6d1db24acd71805152e9212f4d3f2a1885523f54d773697c31004a9d3a940
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9e5c07f853b5b654bfc53479b213c2c548f1c66f57d625ee835453bccb94c414b25e6d46dd4f09b10e5fdf5334249cda29e4284782a67eac0a5a4846b115417
|
7
|
+
data.tar.gz: 52e92b6370fa6ef874955b7ca859d4b74b578e0dd68e3c6db6699b7197e1db97fd7b2f3548a0b872c832c245cb71cd6f9c1477b4f0331f543394dcf08442e3eb
|
data/README.md
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
# irb-power_assert
|
2
2
|
|
3
|
-
![Build Status](https://github.com/kachick/irb-power_assert/actions/workflows/
|
3
|
+
[![Build Status](https://github.com/kachick/irb-power_assert/actions/workflows/ci-ruby.yml/badge.svg?branch=main)](https://github.com/kachick/irb-power_assert/actions/workflows/ci-ruby.yml?query=branch%3Amain+)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/irb-power_assert.svg)](http://badge.fury.io/rb/irb-power_assert)
|
5
5
|
|
6
6
|
## Overview
|
7
7
|
|
8
8
|
![screenshot - expression](https://user-images.githubusercontent.com/1180335/119386011-efc1bb00-bd01-11eb-80c4-1aea86fa3781.png)
|
9
9
|
|
10
|
-
[ruby/power_assert](https://github.com/ruby/power_assert) is a recent
|
10
|
+
[ruby/power_assert](https://github.com/ruby/power_assert) is a recent my favorites.\
|
11
|
+
(the author is [@k-tsj](https://github.com/k-tsj), thank you!)
|
11
12
|
|
12
13
|
It is super helpful in complex testing.
|
13
14
|
|
14
15
|
Don't say [ruby/irb](https://github.com/ruby/irb) is old-fashioned.
|
15
16
|
|
16
|
-
I just would get irb version of
|
17
|
+
I just would get irb version of
|
18
|
+
[yui-knk/pry-power_assert](https://github.com/yui-knk/pry-power_assert)
|
17
19
|
|
18
20
|
Honor should be bestowed upon them.
|
19
21
|
|
20
22
|
## Usage
|
21
23
|
|
22
|
-
Require Ruby
|
23
|
-
|
24
|
-
This command will install the latest version into your environment
|
24
|
+
Require Ruby 3.1 or higher # Tested only in ruby-head and the last 2 stable versions
|
25
25
|
|
26
26
|
```console
|
27
27
|
$ gem install irb-power_assert
|
@@ -61,29 +61,10 @@ result: false
|
|
61
61
|
=> nil
|
62
62
|
```
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
If you want to directly pass `expression`, below is the hack for single line code.
|
64
|
+
The `pa` just takes strings of the code.
|
67
65
|
|
68
|
-
|
69
|
-
|
70
|
-
```ruby
|
71
|
-
# This logic taken from following reference, @k0kubun thank you!
|
72
|
-
# * https://github.com/k0kubun/dotfiles/blob/8762ee623adae0fba20ed0a5ef7c8ff5825dc20a/config/.irbrc#L241-L262
|
73
|
-
# * https://k0kubun.hatenablog.com/entry/2021/04/02/211455
|
74
|
-
IRB::Context.prepend(Module.new{
|
75
|
-
kwargs = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0') ? ', **' : ''
|
76
|
-
line = __LINE__; eval %q{
|
77
|
-
def evaluate(line, *__ARGS__)
|
78
|
-
case line
|
79
|
-
when /\Apa /
|
80
|
-
line.replace("pa #{line.sub(/\Apa +/, '').strip.dump}\n")
|
81
|
-
end
|
82
|
-
super
|
83
|
-
end
|
84
|
-
}.sub(/__ARGS__/, kwargs), nil, __FILE__, line
|
85
|
-
})
|
86
|
-
```
|
66
|
+
If you want to directly pass `expression`, [.irbrc](examples/.irbrc) is the hack for single line code.\
|
67
|
+
if you don't have the file yet, putting the file as one of your `$IRBRC`, `$XDG_CONFIG_HOME/irb/irbrc` or `$HOME/.irbrc`
|
87
68
|
|
88
69
|
Then you can use the `pa` as below...
|
89
70
|
|
@@ -102,16 +83,8 @@ result: false
|
|
102
83
|
=> nil
|
103
84
|
```
|
104
85
|
|
105
|
-
This repository has the example [.irbrc](examples/.irbrc), if you don't have the file yet, trying it may be fun.
|
106
|
-
|
107
|
-
```shell
|
108
|
-
gem install irb-power_assert
|
109
|
-
wget 'https://raw.githubusercontent.com/kachick/irb-power_assert/main/examples/.irbrc' -P "$HOME"
|
110
|
-
irb
|
111
|
-
```
|
112
|
-
|
113
86
|
## References
|
114
87
|
|
115
|
-
|
116
|
-
|
117
|
-
|
88
|
+
- [power-assert-js/power-assert](https://github.com/power-assert-js/power-assert)
|
89
|
+
- [Power Assert in Ruby](https://speakerdeck.com/k_tsj/power-assert-in-ruby)
|
90
|
+
- [ja - IRB is new than Pry](https://k0kubun.hatenablog.com/entry/2021/04/02/211455)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irb-power_assert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenichi Kamiya
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: irb
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 2.0.
|
39
|
+
version: 2.0.3
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '3.0'
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 2.0.
|
49
|
+
version: 2.0.3
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '3.0'
|
@@ -67,12 +67,11 @@ homepage: https://github.com/kachick/irb-power_assert
|
|
67
67
|
licenses:
|
68
68
|
- MIT
|
69
69
|
metadata:
|
70
|
-
documentation_uri: https://kachick.github.io/irb-power_assert/
|
71
70
|
homepage_uri: https://github.com/kachick/irb-power_assert
|
72
71
|
source_code_uri: https://github.com/kachick/irb-power_assert
|
73
72
|
bug_tracker_uri: https://github.com/kachick/irb-power_assert/issues
|
74
73
|
rubygems_mfa_required: 'true'
|
75
|
-
post_install_message:
|
74
|
+
post_install_message:
|
76
75
|
rdoc_options: []
|
77
76
|
require_paths:
|
78
77
|
- lib
|
@@ -80,15 +79,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
79
|
requirements:
|
81
80
|
- - ">="
|
82
81
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
82
|
+
version: '3.1'
|
84
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
84
|
requirements:
|
86
85
|
- - ">="
|
87
86
|
- !ruby/object:Gem::Version
|
88
87
|
version: '0'
|
89
88
|
requirements: []
|
90
|
-
rubygems_version: 3.4.
|
91
|
-
signing_key:
|
89
|
+
rubygems_version: 3.4.10
|
90
|
+
signing_key:
|
92
91
|
specification_version: 4
|
93
92
|
summary: power_assert in irb
|
94
93
|
test_files: []
|