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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca549a5c7c75186591c01aeb7e2b559ceb9015cbdaebc5003761d99df1890b5f
4
- data.tar.gz: fa8724f8f314b8f3bcc8d9d30dbce5e1dc9f8675f7f0add491467489a2855221
3
+ metadata.gz: ce9c8bbaedcb1996de974c079f697bf49e59c8708817260634953055f34489a5
4
+ data.tar.gz: e1ef81d82e7a6e6a6d9ff630ed8fd901b209658a342f668d3528198e1d573fff
5
5
  SHA512:
6
- metadata.gz: 0fc325d2c2685629f15095a59fab4582bddba1dcacd18f07d63b9e8eeed7c9c0e5cee1127877007b8e41da87211e387b845763838cc56c314bf507e2847e7a0c
7
- data.tar.gz: 2754b2723dbdc64567c02ec0a0988dee192600c39ab70a38b26bdb24d610ffe411639e49ebde543b2b3d5f51dc4d6080e8b07beabf22092d1c55fb39a34126f6
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 Ruby gem designed to facilitate remote IRB sessions with Reline.
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
+ ![image](https://github.com/QWYNG/irb-remote/assets/16704596/0651b6f8-75aa-4271-91cb-b714c26a580b)
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
 
@@ -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
@@ -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($stdin, $stdout, client.binding)
25
+ client.input_method = InputMethod.new(client.binding)
26
26
  client.output = $stdout
27
27
  client.stderr = $stderr
28
28
  sleep
@@ -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(stdin, stdout, binding)
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]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IrbRemote
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
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.0
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-06 00:00:00.000000000 Z
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
@@ -1,3 +0,0 @@
1
- # For available configuration options, see:
2
- # https://github.com/standardrb/standard
3
- ruby_version: 3.0