irb_remote 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/.gitignore +2 -0
- data/bin/irb_remote +4 -0
- data/irb_remote.gemspec +1 -0
- data/lib/irb_remote.rb +4 -1
- data/lib/irb_remote/cli.rb +18 -0
- data/lib/irb_remote/client.rb +0 -1
- data/lib/irb_remote/input_method.rb +1 -3
- data/lib/irb_remote/server.rb +4 -1
- data/lib/irb_remote/version.rb +1 -1
- metadata +18 -3
- data/Gemfile.lock +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55d2d53c9e5aa7683d84de815f0da378b8818c7b4a49aa76358be5a648a2d5e1
|
4
|
+
data.tar.gz: ec96290c6aa9ba9d1efa394a83bd5a893415ef73cb87f48b100ef2efe6089c66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51b75fa4921b9b7e5869201ce1e257b9592e1ab00c692514b6b1912d131de8339ddbad7bda4e9d1eb2586a48b83d1630fcaea5b7459e5e50e6ba37376c2eaaa4
|
7
|
+
data.tar.gz: 1d1b6e27b8cb3089d0af28cda5b42c8bddc59f492526cbb1f5b774eb1fffb0bbf25bfc6ce7a8565f53ca2c3e4477f92365ef1ef77359f0caed54dbadcbe147b7
|
data/.gitignore
CHANGED
data/bin/irb_remote
ADDED
data/irb_remote.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
|
+
spec.add_dependency 'thor'
|
25
26
|
spec.add_development_dependency "bundler", "~> 1.16"
|
26
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
27
28
|
spec.add_development_dependency "rspec", "~> 3.0"
|
data/lib/irb_remote.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
module IRBRemote
|
4
|
+
class CLI < Thor
|
5
|
+
default_task :connect
|
6
|
+
|
7
|
+
desc "connect", "Connect to remote irb server"
|
8
|
+
def connect(*)
|
9
|
+
IRBRemote::Client.new.start
|
10
|
+
end
|
11
|
+
|
12
|
+
map %w[-v --version] => :version
|
13
|
+
desc "-v or --version", "Print the version"
|
14
|
+
def version
|
15
|
+
puts IRBRemote::Version
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/irb_remote/client.rb
CHANGED
data/lib/irb_remote/server.rb
CHANGED
@@ -10,12 +10,14 @@ module IRBRemote
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def start
|
13
|
-
IRB.setup(@binding.eval('__FILE__')
|
13
|
+
IRB.setup(@binding.eval('__FILE__'))
|
14
14
|
DRb.start_service("druby://#{IRBRemote.config.host}:#{IRBRemote.config.port}", self, safe_level: 1)
|
15
15
|
DRb.thread.join
|
16
16
|
end
|
17
17
|
|
18
18
|
def connected(input, output)
|
19
|
+
# irb uses Kernel#puts for output
|
20
|
+
original_stdout = $stdout.dup
|
19
21
|
$stdout = output
|
20
22
|
workspace = IRB::WorkSpace.new(@binding)
|
21
23
|
output.print(workspace.code_around_binding)
|
@@ -23,6 +25,7 @@ module IRBRemote
|
|
23
25
|
irb.run(IRB.conf)
|
24
26
|
rescue DRb::DRbConnError
|
25
27
|
ensure
|
28
|
+
$stdout = original_stdout
|
26
29
|
DRb.stop_service
|
27
30
|
end
|
28
31
|
end
|
data/lib/irb_remote/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irb_remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Iguchi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -63,14 +77,15 @@ files:
|
|
63
77
|
- ".rspec"
|
64
78
|
- ".travis.yml"
|
65
79
|
- Gemfile
|
66
|
-
- Gemfile.lock
|
67
80
|
- LICENSE.txt
|
68
81
|
- README.md
|
69
82
|
- Rakefile
|
70
83
|
- bin/console
|
84
|
+
- bin/irb_remote
|
71
85
|
- bin/setup
|
72
86
|
- irb_remote.gemspec
|
73
87
|
- lib/irb_remote.rb
|
88
|
+
- lib/irb_remote/cli.rb
|
74
89
|
- lib/irb_remote/client.rb
|
75
90
|
- lib/irb_remote/configuration.rb
|
76
91
|
- lib/irb_remote/core_ext/binding.rb
|
data/Gemfile.lock
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
irb_remote (0.1.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
diff-lcs (1.3)
|
10
|
-
rake (10.5.0)
|
11
|
-
rspec (3.7.0)
|
12
|
-
rspec-core (~> 3.7.0)
|
13
|
-
rspec-expectations (~> 3.7.0)
|
14
|
-
rspec-mocks (~> 3.7.0)
|
15
|
-
rspec-core (3.7.1)
|
16
|
-
rspec-support (~> 3.7.0)
|
17
|
-
rspec-expectations (3.7.0)
|
18
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
-
rspec-support (~> 3.7.0)
|
20
|
-
rspec-mocks (3.7.0)
|
21
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
-
rspec-support (~> 3.7.0)
|
23
|
-
rspec-support (3.7.1)
|
24
|
-
|
25
|
-
PLATFORMS
|
26
|
-
ruby
|
27
|
-
|
28
|
-
DEPENDENCIES
|
29
|
-
bundler (~> 1.16)
|
30
|
-
irb_remote!
|
31
|
-
rake (~> 10.0)
|
32
|
-
rspec (~> 3.0)
|
33
|
-
|
34
|
-
BUNDLED WITH
|
35
|
-
1.16.3
|