remote_ruby 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37bace854f64fcf07a95e1a8168cef708988610894764afdfadc08c8fb46674d
|
4
|
+
data.tar.gz: 0324ae7519ada602236715247b2dd55b228e33019f5d262024fc3acbbe2fa823
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ed7df90f0a19153b1cc868b21aded8630eb40eaa6c52925c7ffad99fcac69d58733bec402ea3d4eff9fe5eb511d39281539ed292b56f350ecb02f2c68f9662d
|
7
|
+
data.tar.gz: 9ed44ea3c1abee071e574f1a5fb69979464b47d8dd22ad1c7349f118bf5020e1ee6241ed5b8dbecb6a5e99d9906de051ccef11ff1b767c2d732e2a26702d6002
|
data/README.md
CHANGED
@@ -328,6 +328,7 @@ This adapter uses SSH console client to connect to the remote machine, launches
|
|
328
328
|
| working_dir | String | no | ~ | Path to the directory on the remote server where the script should be executed |
|
329
329
|
| user | String | no | - | User on the remote host to connect as |
|
330
330
|
| key_file| String | no | - | Path to the private SSH key |
|
331
|
+
| bundler | Boolean | no | false | Specifies, whether the code should be executed with `bundle exec` on the remote server |
|
331
332
|
|
332
333
|
|
333
334
|
#### Local STDIN adapter
|
@@ -338,6 +339,7 @@ This adapter changes to the specified directory on the **local** machine, launch
|
|
338
339
|
| Parameter | Type | Required | Default value | Description |
|
339
340
|
| --------- | ---- | ---------| ------------- | ----------- |
|
340
341
|
| working_dir | String | no | . | Path to the directory on the local machine where the script should be executed |
|
342
|
+
| bundler | Boolean | no | false | Specifies, whether the code should be executed with `bundle exec` |
|
341
343
|
|
342
344
|
|
343
345
|
#### Evaluating adapter
|
@@ -4,11 +4,12 @@ module RemoteRuby
|
|
4
4
|
# An adapter to expecute Ruby code on the local macine
|
5
5
|
# inside a specified directory
|
6
6
|
class LocalStdinAdapter < ::RemoteRuby::StdinProcessAdapter
|
7
|
-
attr_reader :working_dir
|
7
|
+
attr_reader :working_dir, :bundler
|
8
8
|
|
9
|
-
def initialize(working_dir: '.')
|
9
|
+
def initialize(working_dir: '.', bundler: false)
|
10
10
|
super
|
11
11
|
@working_dir = working_dir
|
12
|
+
@bundler = bundler
|
12
13
|
end
|
13
14
|
|
14
15
|
def connection_name
|
@@ -18,7 +19,11 @@ module RemoteRuby
|
|
18
19
|
private
|
19
20
|
|
20
21
|
def command
|
21
|
-
|
22
|
+
if bundler
|
23
|
+
"cd \"#{working_dir}\" && bundle exec ruby"
|
24
|
+
else
|
25
|
+
"cd \"#{working_dir}\" && ruby"
|
26
|
+
end
|
22
27
|
end
|
23
28
|
end
|
24
29
|
end
|
@@ -3,14 +3,15 @@
|
|
3
3
|
module RemoteRuby
|
4
4
|
# An adapter to execute Ruby code on the remote server via SSH
|
5
5
|
class SSHStdinAdapter < StdinProcessAdapter
|
6
|
-
attr_reader :server, :working_dir, :user, :key_file
|
6
|
+
attr_reader :server, :working_dir, :user, :key_file, :bundler
|
7
7
|
|
8
|
-
def initialize(server:, working_dir: '~', user: nil, key_file: nil)
|
8
|
+
def initialize(server:, working_dir: '~', user: nil, key_file: nil, bundler: false)
|
9
9
|
super
|
10
10
|
@working_dir = working_dir
|
11
11
|
@server = user.nil? ? server : "#{user}@#{server}"
|
12
12
|
@user = user
|
13
13
|
@key_file = key_file
|
14
|
+
@bundler = bundler
|
14
15
|
end
|
15
16
|
|
16
17
|
def connection_name
|
@@ -22,7 +23,12 @@ module RemoteRuby
|
|
22
23
|
def command
|
23
24
|
command = 'ssh'
|
24
25
|
command = "#{command} -i #{key_file}" if key_file
|
25
|
-
|
26
|
+
|
27
|
+
if bundler
|
28
|
+
"#{command} #{server} \"cd #{working_dir} && bundle exec ruby\""
|
29
|
+
else
|
30
|
+
"#{command} #{server} \"cd #{working_dir} && ruby\""
|
31
|
+
end
|
26
32
|
end
|
27
33
|
end
|
28
34
|
end
|
data/lib/remote_ruby/version.rb
CHANGED
data/remote_ruby.gemspec
CHANGED
@@ -28,9 +28,9 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.require_paths = ['lib']
|
30
30
|
|
31
|
-
spec.
|
32
|
-
spec.
|
33
|
-
spec.
|
34
|
-
spec.
|
35
|
-
spec.
|
31
|
+
spec.add_dependency 'base64', '~> 0.2'
|
32
|
+
spec.add_dependency 'colorize', '~> 0.8'
|
33
|
+
spec.add_dependency 'method_source', '~> 1.0'
|
34
|
+
spec.add_dependency 'parser', '~> 3.0'
|
35
|
+
spec.add_dependency 'unparser', '~> 0.6'
|
36
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remote_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikita Chernukhin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base64
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
- !ruby/object:Gem::Version
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
|
-
rubygems_version: 3.5.
|
137
|
+
rubygems_version: 3.5.16
|
138
138
|
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: Execute Ruby code on the remote servers.
|