irb-remote 0.1.0 → 0.1.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/README.md +4 -3
- data/lib/irb-remote/binding.rb +0 -20
- data/lib/irb-remote/cli.rb +1 -1
- data/lib/irb-remote/completor.rb +24 -0
- data/lib/irb-remote/input_method.rb +1 -3
- data/lib/irb-remote/version.rb +1 -1
- metadata +2 -3
- data/.standard.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce9c8bbaedcb1996de974c079f697bf49e59c8708817260634953055f34489a5
|
4
|
+
data.tar.gz: e1ef81d82e7a6e6a6d9ff630ed8fd901b209658a342f668d3528198e1d573fff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a9f61314180c29267ad05642a4161f71fa3f7594a382b9d56d08bad9f2483a54b448e3d77b13111cffce167730364ed9477a7d43756d18912a29147c80af99f
|
7
|
+
data.tar.gz: fe15200df21ea0451fdc314aa50d851adacc50a55201cfb906bb7835c484f4e6f27d11208e25db8c18da95b3b533e52c9253fecccd44b84a30622a19394b297f
|
data/README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# IrbRemote
|
2
|
-
Inspired by [pry-remote](https://github.com/Mon-Ouie/pry-remote) and [irb_remote](https://github.com/iguchi1124/irb_remote).
|
3
|
-
IrbRemote is a
|
2
|
+
Inspired by [pry-remote](https://github.com/Mon-Ouie/pry-remote) and [irb_remote](https://github.com/iguchi1124/irb_remote).
|
3
|
+
IrbRemote is a Gem that allows the Irb session of a remote process to be manipulated using the local process's Reline. It uses druby for inter-process communication.
|
4
|
+

|
4
5
|
|
5
6
|
## Caution
|
6
|
-
This gem is still in development and may not work as expected. Please use with caution.
|
7
|
+
This gem is still in development and may not work as expected. Please use it with caution.
|
7
8
|
|
8
9
|
## Installation
|
9
10
|
|
data/lib/irb-remote/binding.rb
CHANGED
@@ -8,25 +8,5 @@ module IrbRemote
|
|
8
8
|
IrbRemote::Server.run(self, host, port, options)
|
9
9
|
end
|
10
10
|
alias remote_irb irb_remote
|
11
|
-
|
12
|
-
def eval_methods
|
13
|
-
::Kernel.instance_method(:methods).bind(eval('self')).call
|
14
|
-
end
|
15
|
-
|
16
|
-
def eval_private_methods
|
17
|
-
::Kernel.instance_method(:private_methods).bind(eval('self')).call
|
18
|
-
end
|
19
|
-
|
20
|
-
def eval_instance_variables
|
21
|
-
::Kernel.instance_method(:instance_variables).bind(eval('self')).call
|
22
|
-
end
|
23
|
-
|
24
|
-
def eval_global_variables
|
25
|
-
::Kernel.instance_method(:global_variables).bind(eval('self')).call
|
26
|
-
end
|
27
|
-
|
28
|
-
def eval_class_constants
|
29
|
-
::Module.instance_method(:constants).bind(eval('self.class')).call
|
30
|
-
end
|
31
11
|
end
|
32
12
|
end
|
data/lib/irb-remote/cli.rb
CHANGED
@@ -22,7 +22,7 @@ module IrbRemote
|
|
22
22
|
puts "Connected to remote session on #{uri}"
|
23
23
|
IRB.setup(client.binding.source_location[0], argv: [])
|
24
24
|
client.thread = Thread.current
|
25
|
-
client.input_method = InputMethod.new(
|
25
|
+
client.input_method = InputMethod.new(client.binding)
|
26
26
|
client.output = $stdout
|
27
27
|
client.stderr = $stderr
|
28
28
|
sleep
|
data/lib/irb-remote/completor.rb
CHANGED
@@ -4,6 +4,30 @@ require 'irb'
|
|
4
4
|
|
5
5
|
module IrbRemote
|
6
6
|
class Completor < IRB::RegexpCompletor
|
7
|
+
using(Module.new do
|
8
|
+
refine ::DRb::DRbObject do
|
9
|
+
def eval_methods
|
10
|
+
::Kernel.instance_method(:methods).bind(eval('self')).call
|
11
|
+
end
|
12
|
+
|
13
|
+
def eval_private_methods
|
14
|
+
::Kernel.instance_method(:private_methods).bind(eval('self')).call
|
15
|
+
end
|
16
|
+
|
17
|
+
def eval_instance_variables
|
18
|
+
::Kernel.instance_method(:instance_variables).bind(eval('self')).call
|
19
|
+
end
|
20
|
+
|
21
|
+
def eval_global_variables
|
22
|
+
::Kernel.instance_method(:global_variables).bind(eval('self')).call
|
23
|
+
end
|
24
|
+
|
25
|
+
def eval_class_constants
|
26
|
+
::Module.instance_method(:constants).bind(eval('self.class')).call
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end)
|
30
|
+
|
7
31
|
def eval(expr, bind)
|
8
32
|
bind.eval(expr)
|
9
33
|
end
|
@@ -4,10 +4,8 @@ require_relative 'completor'
|
|
4
4
|
|
5
5
|
module IrbRemote
|
6
6
|
class InputMethod < IRB::RelineInputMethod
|
7
|
-
def initialize(
|
7
|
+
def initialize(binding)
|
8
8
|
super(IrbRemote::Completor.new)
|
9
|
-
@stdin = stdin
|
10
|
-
@stdout = stdout
|
11
9
|
@binding = binding
|
12
10
|
Reline.completion_proc = lambda { |target, preposing, postposing|
|
13
11
|
@completion_params = [preposing, target, postposing, @binding]
|
data/lib/irb-remote/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irb-remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- qwyng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Connect to IRB remotely using DRb
|
14
14
|
email:
|
@@ -20,7 +20,6 @@ extra_rdoc_files: []
|
|
20
20
|
files:
|
21
21
|
- ".rubocop.yml"
|
22
22
|
- ".rubocop_todo.yml"
|
23
|
-
- ".standard.yml"
|
24
23
|
- CHANGELOG.md
|
25
24
|
- CODE_OF_CONDUCT.md
|
26
25
|
- LICENSE.txt
|
data/.standard.yml
DELETED