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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f537a283fed2eef2c6e07ede1e4cc027dc28f4a4f3d4c59cee58338b02cad9c
4
- data.tar.gz: c25ade3869c7319ce557c1ab50d7029126af6d171fc892d0032a259c848efa97
3
+ metadata.gz: 62dad317e197fde4c11688f03c450205b2e47a7536175b9ec4fbd74bf1ba40e5
4
+ data.tar.gz: 59b8c6ac55c4fd1a95d640710e01930d8d68a636e61c86a5c2d63f0546c25123
5
5
  SHA512:
6
- metadata.gz: eba78ab629e758e66963db826cd39a2b9ec7b392c4b451f26ab680ab9924a7d3748f9d1ddd9966f2296f5e5aef0ac30cd389d2449505f55f1662b43a1fb3605e
7
- data.tar.gz: f35eac4d8ed09a0e6ab1dc21a63ed1aea6fde118f110adf280044cbf3fb39a1ce748a77f558fe4d7115ec7b519428cefb28c11ad31b655794529ad3b89758d56
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
@@ -1,3 +1,3 @@
1
1
  [submodule "task"]
2
2
  path = task
3
- url = git://github.com/godfat/gemgem.git
3
+ url = https://github.com/godfat/gemgem.git
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 [![Build Status](https://secure.travis-ci.org/godfat/rib.svg?branch=master)](http://travis-ci.org/godfat/rib) [![Coverage Status](https://coveralls.io/repos/github/godfat/rib/badge.svg)](https://coveralls.io/github/godfat/rib) [![Join the chat at https://gitter.im/godfat/rib](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/godfat/rib)
1
+ # Rib [![Pipeline status](https://gitlab.com/godfat/rib/badges/master/pipeline.svg)](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-2018, Lin Jen-Shin (godfat)
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")
@@ -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
@@ -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+)(:?)/){red{$1}+$2}.sub(/`.+?'/){green{$&}}
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
  }
@@ -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
- check <<~RUBY, SyntaxError
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
- check <<~RUBY
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 => Object.new.instance_eval{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
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Rib
3
- VERSION = '1.6.0'
3
+ VERSION = '1.6.1'
4
4
  end
data/rib.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: rib 1.6.0 ruby lib
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.0"
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 = "2018-06-20"
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 = "2.7.7".freeze
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), Rubinius and JRuby.
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-2017, Lin Jen-Shin (godfat)
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
- install = Gem::Installer.new(gem_path, cmd.options)
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.0
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: 2018-06-20 00:00:00.000000000 Z
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
- rubyforge_project:
128
- rubygems_version: 2.7.7
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