rib 1.6.0 → 1.6.1
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 +4 -4
- data/.gitlab-ci.yml +40 -0
- data/.gitmodules +1 -1
- data/CHANGES.md +12 -0
- data/README.md +2 -2
- data/lib/rib/app/rack.rb +1 -1
- data/lib/rib/extra/byebug.rb +9 -0
- data/lib/rib/more/color.rb +4 -1
- data/lib/rib/test/multiline.rb +18 -2
- data/lib/rib/test.rb +3 -1
- data/lib/rib/version.rb +1 -1
- data/rib.gemspec +5 -5
- data/task/README.md +2 -2
- data/task/gemgem.rb +3 -1
- data/test/more/test_multiline_history.rb +2 -0
- metadata +7 -8
- data/.travis.yml +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62dad317e197fde4c11688f03c450205b2e47a7536175b9ec4fbd74bf1ba40e5
|
4
|
+
data.tar.gz: 59b8c6ac55c4fd1a95d640710e01930d8d68a636e61c86a5c2d63f0546c25123
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc4de9174c2a49db81d42ea3c91361c6f4a88435e9f169127914c94921fb7f3ddbc27673c8f5e7f70d31fbd25a163147e3dfe48c31bdeee34fcca0df38451a1a
|
7
|
+
data.tar.gz: b74d9fa8f2c8a63c92a44378e0db0a0848fd2275223fad29c885c48d67beb9b201fc24f25c639ee276e74337d195bf4e80fcc53dcf07fe42b6fc595df3cd5f3b
|
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
stages:
|
3
|
+
- test
|
4
|
+
|
5
|
+
.test:
|
6
|
+
stage: test
|
7
|
+
image: ruby:${RUBY_VERSION}-bullseye
|
8
|
+
variables:
|
9
|
+
GIT_DEPTH: "1"
|
10
|
+
GIT_SUBMODULE_STRATEGY: recursive
|
11
|
+
GIT_SUBMODULE_PATHS: task
|
12
|
+
RUBYOPT: --enable-frozen-string-literal
|
13
|
+
before_script:
|
14
|
+
- bundle install --retry=3
|
15
|
+
- unset CI # Coverage doesn't work well with frozen literal
|
16
|
+
script:
|
17
|
+
- ruby -vr bundler/setup -S rake test
|
18
|
+
|
19
|
+
ruby:3.0:
|
20
|
+
extends:
|
21
|
+
- .test
|
22
|
+
variables:
|
23
|
+
RUBY_VERSION: '3.0'
|
24
|
+
|
25
|
+
ruby:3.1:
|
26
|
+
extends:
|
27
|
+
- .test
|
28
|
+
variables:
|
29
|
+
RUBY_VERSION: '3.1'
|
30
|
+
|
31
|
+
ruby:3.2:
|
32
|
+
extends:
|
33
|
+
- .test
|
34
|
+
variables:
|
35
|
+
RUBY_VERSION: '3.2'
|
36
|
+
|
37
|
+
jruby:latest:
|
38
|
+
extends:
|
39
|
+
- .test
|
40
|
+
image: jruby:latest
|
data/.gitmodules
CHANGED
data/CHANGES.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# CHANGES
|
2
2
|
|
3
|
+
## Rib 1.6.1 -- 2022-12-30
|
4
|
+
|
5
|
+
### Bugs fixed
|
6
|
+
|
7
|
+
* Fixed `rib rack` for constant resolution.
|
8
|
+
|
9
|
+
### Enhancement
|
10
|
+
|
11
|
+
* [more/color] Instead of using `$1` and `$2`, use `Regexp.last_match`.
|
12
|
+
It should be the same for MRI, but seems to be working better for JRuby.
|
13
|
+
Perhaps `$1` and `$2` is not thread local on JRuby?
|
14
|
+
|
3
15
|
## Rib 1.6.0 -- 2018-06-20
|
4
16
|
|
5
17
|
* [core/multiline] Support for JRuby 9.2.0.0 is fixed
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rib [](https://gitlab.com/godfat/rib/-/pipelines)
|
2
2
|
|
3
3
|
by Lin Jen-Shin ([godfat](http://godfat.org))
|
4
4
|
|
@@ -479,7 +479,7 @@ simple, simpler than rib-rails.
|
|
479
479
|
|
480
480
|
Apache License 2.0 (Apache-2.0)
|
481
481
|
|
482
|
-
Copyright (c) 2011-
|
482
|
+
Copyright (c) 2011-2022, Lin Jen-Shin (godfat)
|
483
483
|
|
484
484
|
Licensed under the Apache License, Version 2.0 (the "License");
|
485
485
|
you may not use this file except in compliance with the License.
|
data/lib/rib/app/rack.rb
CHANGED
@@ -12,7 +12,7 @@ module Rib; module Rack
|
|
12
12
|
def load_rack
|
13
13
|
require 'rack'
|
14
14
|
Rib.abort("Error: Cannot find config.ru") unless rack?
|
15
|
-
app, _ = Rack::Builder.parse_file(configru_path)
|
15
|
+
app, _ = ::Rack::Builder.parse_file(configru_path)
|
16
16
|
self.app = app
|
17
17
|
Rib.shell.eval_binding.eval('def app; Rib::Rack.app; end')
|
18
18
|
Rib.say("Access your app via :app method")
|
data/lib/rib/extra/byebug.rb
CHANGED
@@ -8,6 +8,13 @@ module Rib; module Byebug
|
|
8
8
|
extend Plugin
|
9
9
|
Shell.use(self)
|
10
10
|
|
11
|
+
def before_loop
|
12
|
+
return super if Rib::Byebug.disabled?
|
13
|
+
|
14
|
+
super
|
15
|
+
# ::Byebug::RibProcessor.start
|
16
|
+
end
|
17
|
+
|
11
18
|
module Imp
|
12
19
|
def byebug
|
13
20
|
return if Rib::Byebug.disabled?
|
@@ -73,6 +80,8 @@ module Byebug
|
|
73
80
|
end
|
74
81
|
|
75
82
|
def resume_rib
|
83
|
+
return if Rib.shell.running?
|
84
|
+
|
76
85
|
byebug_binding = frame._binding
|
77
86
|
|
78
87
|
print_location
|
data/lib/rib/more/color.rb
CHANGED
@@ -88,7 +88,10 @@ module Rib; module Color
|
|
88
88
|
path, msgs = b.split(':', 2)
|
89
89
|
dir, sep, file = path.rpartition('/')
|
90
90
|
msgs ||= (line - 1).to_s # msgs would be nil when input is next/break
|
91
|
-
msg = msgs.sub(/(\d+)(:?)/)
|
91
|
+
msg = msgs.sub(/(\d+)(:?)/) do
|
92
|
+
m = Regexp.last_match
|
93
|
+
"#{red{m[1]}}#{m[2]}"
|
94
|
+
end.sub(/`.+?'/){green{Regexp.last_match[0]}}
|
92
95
|
|
93
96
|
"#{dir+sep}#{yellow{file}}:#{msg}"
|
94
97
|
}
|
data/lib/rib/test/multiline.rb
CHANGED
@@ -25,6 +25,8 @@ copy :setup_multiline do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def check str, err=nil
|
28
|
+
yield if block_given?
|
29
|
+
|
28
30
|
lines = str.split("\n")
|
29
31
|
lines[0...-1].each{ |line|
|
30
32
|
input(line)
|
@@ -135,9 +137,17 @@ copy :multiline do
|
|
135
137
|
end
|
136
138
|
|
137
139
|
would 'be hash treated as a block SyntaxError' do
|
138
|
-
|
140
|
+
code = <<~RUBY
|
139
141
|
puts { :x => 10 }.class
|
140
142
|
RUBY
|
143
|
+
|
144
|
+
if RUBY_VERSION >= '3.0.0'
|
145
|
+
check code do
|
146
|
+
stub(shell.config[:binding_object]).puts{}
|
147
|
+
end
|
148
|
+
else
|
149
|
+
check code, SyntaxError
|
150
|
+
end
|
141
151
|
end
|
142
152
|
|
143
153
|
would 'SyntaxError' do
|
@@ -175,10 +185,16 @@ copy :multiline do
|
|
175
185
|
end
|
176
186
|
|
177
187
|
would 'binary operator /' do
|
178
|
-
|
188
|
+
code = <<~RUBY
|
179
189
|
1+1.to_i /
|
180
190
|
1
|
181
191
|
RUBY
|
192
|
+
|
193
|
+
if RUBY_VERSION >= '3.0.0'
|
194
|
+
check code.lines.first, SyntaxError
|
195
|
+
else
|
196
|
+
check code
|
197
|
+
end
|
182
198
|
end
|
183
199
|
|
184
200
|
would 'binary operator |' do
|
data/lib/rib/test.rb
CHANGED
@@ -20,8 +20,10 @@ copy :rib do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def new_shell opts={}
|
23
|
+
binding_object = Object.new
|
23
24
|
result = Rib::Shell.new(
|
24
|
-
{:binding =>
|
25
|
+
{:binding => binding_object.instance_eval{binding},
|
26
|
+
:binding_object => binding_object}.
|
25
27
|
merge(opts))
|
26
28
|
yield(result) if block_given?
|
27
29
|
result.before_loop
|
data/lib/rib/version.rb
CHANGED
data/rib.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: rib 1.6.
|
2
|
+
# stub: rib 1.6.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "rib".freeze
|
6
|
-
s.version = "1.6.
|
6
|
+
s.version = "1.6.1"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Lin Jen-Shin (godfat)".freeze]
|
11
|
-
s.date = "
|
11
|
+
s.date = "2022-12-30"
|
12
12
|
s.description = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell\n\nRib is based on the design of [ripl][] and the work of [ripl-rc][], some of\nthe features are also inspired by [pry][]. The aim of Rib is to be fully\nfeatured and yet very easy to opt-out or opt-in other features. It shall\nbe simple, lightweight and modular so that everyone could customize Rib.\n\n[ripl]: https://github.com/cldwalker/ripl\n[ripl-rc]: https://github.com/godfat/ripl-rc\n[pry]: https://github.com/pry/pry".freeze
|
13
13
|
s.email = ["godfat (XD) godfat.org".freeze]
|
14
14
|
s.executables = [
|
@@ -20,8 +20,8 @@ Gem::Specification.new do |s|
|
|
20
20
|
"rib-rails".freeze]
|
21
21
|
s.files = [
|
22
22
|
".gitignore".freeze,
|
23
|
+
".gitlab-ci.yml".freeze,
|
23
24
|
".gitmodules".freeze,
|
24
|
-
".travis.yml".freeze,
|
25
25
|
"CHANGES.md".freeze,
|
26
26
|
"Gemfile".freeze,
|
27
27
|
"LICENSE".freeze,
|
@@ -93,7 +93,7 @@ Gem::Specification.new do |s|
|
|
93
93
|
"test/test_shell.rb".freeze]
|
94
94
|
s.homepage = "https://github.com/godfat/rib".freeze
|
95
95
|
s.licenses = ["Apache-2.0".freeze]
|
96
|
-
s.rubygems_version = "
|
96
|
+
s.rubygems_version = "3.4.1".freeze
|
97
97
|
s.summary = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell".freeze
|
98
98
|
s.test_files = [
|
99
99
|
"test/core/test_completion.rb".freeze,
|
data/task/README.md
CHANGED
@@ -13,7 +13,7 @@ Provided tasks:
|
|
13
13
|
|
14
14
|
## REQUIREMENTS:
|
15
15
|
|
16
|
-
* Tested with MRI (official CRuby)
|
16
|
+
* Tested with MRI (official CRuby) and JRuby.
|
17
17
|
|
18
18
|
## INSTALLATION:
|
19
19
|
|
@@ -39,7 +39,7 @@ end
|
|
39
39
|
|
40
40
|
Apache License 2.0 (Apache-2.0)
|
41
41
|
|
42
|
-
Copyright (c) 2011-
|
42
|
+
Copyright (c) 2011-2021, Lin Jen-Shin (godfat)
|
43
43
|
|
44
44
|
Licensed under the Apache License, Version 2.0 (the "License");
|
45
45
|
you may not use this file except in compliance with the License.
|
data/task/gemgem.rb
CHANGED
@@ -42,6 +42,7 @@ module Gemgem
|
|
42
42
|
|
43
43
|
def gem_install
|
44
44
|
require 'rubygems/commands/install_command'
|
45
|
+
require 'rubygems/package'
|
45
46
|
# read ~/.gemrc
|
46
47
|
Gem.use_paths(Gem.configuration[:gemhome], Gem.configuration[:gempath])
|
47
48
|
Gem::Command.extra_args = Gem.configuration[:gem]
|
@@ -51,7 +52,8 @@ module Gemgem
|
|
51
52
|
cmd.handle_options([])
|
52
53
|
|
53
54
|
# install
|
54
|
-
|
55
|
+
gem_package = Gem::Package.new(gem_path)
|
56
|
+
install = Gem::Installer.new(gem_package, cmd.options)
|
55
57
|
install.install
|
56
58
|
puts "\e[35mGem installed: \e[33m#{strip_path(install.gem_dir)}\e[0m"
|
57
59
|
end
|
@@ -9,6 +9,7 @@ describe Rib::MultilineHistory do
|
|
9
9
|
|
10
10
|
def check str, err=nil
|
11
11
|
shell.history.clear
|
12
|
+
yield if block_given?
|
12
13
|
with_history(str, err)
|
13
14
|
|
14
15
|
@shell = nil
|
@@ -16,6 +17,7 @@ describe Rib::MultilineHistory do
|
|
16
17
|
|
17
18
|
shell.history.clear
|
18
19
|
shell.history << 'old history'
|
20
|
+
yield if block_given?
|
19
21
|
with_history(str, err, 'old history')
|
20
22
|
end
|
21
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lin Jen-Shin (godfat)
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
|
@@ -34,8 +34,8 @@ extensions: []
|
|
34
34
|
extra_rdoc_files: []
|
35
35
|
files:
|
36
36
|
- ".gitignore"
|
37
|
+
- ".gitlab-ci.yml"
|
37
38
|
- ".gitmodules"
|
38
|
-
- ".travis.yml"
|
39
39
|
- CHANGES.md
|
40
40
|
- Gemfile
|
41
41
|
- LICENSE
|
@@ -109,7 +109,7 @@ homepage: https://github.com/godfat/rib
|
|
109
109
|
licenses:
|
110
110
|
- Apache-2.0
|
111
111
|
metadata: {}
|
112
|
-
post_install_message:
|
112
|
+
post_install_message:
|
113
113
|
rdoc_options: []
|
114
114
|
require_paths:
|
115
115
|
- lib
|
@@ -124,9 +124,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
|
-
|
128
|
-
|
129
|
-
signing_key:
|
127
|
+
rubygems_version: 3.4.1
|
128
|
+
signing_key:
|
130
129
|
specification_version: 4
|
131
130
|
summary: Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
|
132
131
|
test_files:
|
data/.travis.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
|
4
|
-
install: 'gem install bundler; bundle install --retry=3'
|
5
|
-
before_script: unset CI
|
6
|
-
script: 'ruby -vr bundler/setup -S rake test'
|
7
|
-
|
8
|
-
matrix:
|
9
|
-
include:
|
10
|
-
- rvm: 2.4
|
11
|
-
env: RUBYOPT=--enable-frozen-string-literal
|
12
|
-
- rvm: 2.5
|
13
|
-
env: RUBYOPT=--enable-frozen-string-literal
|
14
|
-
- rvm: ruby-head
|
15
|
-
env: RUBYOPT=--enable-frozen-string-literal
|
16
|
-
- rvm: jruby
|
17
|
-
env: JRUBY_OPTS=--debug
|