remote_ruby 0.3.0 → 1.0.0
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/.rspec +1 -2
- data/.rubocop.yml +37 -6
- data/CHANGELOG.md +64 -0
- data/LICENSE.txt +1 -1
- data/README.md +348 -81
- data/lib/remote_ruby/adapter_builder.rb +75 -0
- data/lib/remote_ruby/cache_adapter.rb +41 -0
- data/lib/remote_ruby/{connection_adapter/caching_adapter.rb → caching_adapter.rb} +23 -13
- data/lib/remote_ruby/code_templates/compiler/main.rb.erb +17 -29
- data/lib/remote_ruby/compat_io_reader.rb +36 -0
- data/lib/remote_ruby/compat_io_writer.rb +38 -0
- data/lib/remote_ruby/compiler.rb +8 -8
- data/lib/remote_ruby/connection_adapter.rb +16 -16
- data/lib/remote_ruby/execution_context.rb +56 -74
- data/lib/remote_ruby/extensions.rb +14 -0
- data/lib/remote_ruby/parser_factory.rb +29 -0
- data/lib/remote_ruby/plugin.rb +25 -0
- data/lib/remote_ruby/{flavour/rails_flavour.rb → rails_plugin.rb} +7 -5
- data/lib/remote_ruby/remote_context.rb +52 -0
- data/lib/remote_ruby/remote_error.rb +55 -0
- data/lib/remote_ruby/source_extractor.rb +2 -12
- data/lib/remote_ruby/ssh_adapter.rb +128 -0
- data/lib/remote_ruby/stream_prefixer.rb +25 -0
- data/lib/remote_ruby/tee_writer.rb +16 -0
- data/lib/remote_ruby/text_mode_adapter.rb +63 -0
- data/lib/remote_ruby/text_mode_builder.rb +44 -0
- data/lib/remote_ruby/tmp_file_adapter.rb +62 -0
- data/lib/remote_ruby/version.rb +1 -1
- data/lib/remote_ruby.rb +57 -15
- metadata +72 -28
- data/.github/workflows/main.yml +0 -26
- data/.gitignore +0 -17
- data/Gemfile +0 -23
- data/lib/remote_ruby/connection_adapter/cache_adapter.rb +0 -41
- data/lib/remote_ruby/connection_adapter/eval_adapter.rb +0 -96
- data/lib/remote_ruby/connection_adapter/local_stdin_adapter.rb +0 -29
- data/lib/remote_ruby/connection_adapter/ssh_stdin_adapter.rb +0 -34
- data/lib/remote_ruby/connection_adapter/stdin_process_adapter.rb +0 -35
- data/lib/remote_ruby/flavour.rb +0 -27
- data/lib/remote_ruby/runner.rb +0 -55
- data/lib/remote_ruby/stream_cacher.rb +0 -36
- data/lib/remote_ruby/unmarshaler.rb +0 -59
- data/remote_ruby.gemspec +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4723cad8943a76df4ab284d278ca6ffa49f8a10ac869dabf68d8d172f30baf63
|
4
|
+
data.tar.gz: f80c91b1081e85f463b3b60fbcf58c97c5ad3c2ba93ea81492a08a114ac65cc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e437b61ff5fb4cfe05bf172e3cac77de4fc7147852bc8938bc3a0116a5613610c9460671da4807eb3beb0df3aa694c09b1879003727d0c2721d119307e738bda
|
7
|
+
data.tar.gz: 5ba9e01b990eb6f5f2a2ff4f50c9f49a5005b99c03cc5fd3ecbc0127cdbe2ae75fa70aa2b378994e7c5c665e0e1537c013e74899b6fdeb3732ef6be0654c5fab
|
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,13 +1,44 @@
|
|
1
|
+
plugins:
|
2
|
+
- rubocop-rspec
|
3
|
+
|
1
4
|
AllCops:
|
2
5
|
NewCops: enable
|
3
|
-
TargetRubyVersion: 2.
|
6
|
+
TargetRubyVersion: 2.7
|
7
|
+
|
8
|
+
Metrics/AbcSize:
|
9
|
+
Max: 22
|
10
|
+
|
11
|
+
Metrics/ClassLength:
|
12
|
+
Max: 100
|
13
|
+
|
14
|
+
Metrics/MethodLength:
|
15
|
+
Max: 24
|
16
|
+
|
17
|
+
RSpec/MultipleExpectations:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
RSpec/ExampleLength:
|
21
|
+
Max: 30
|
22
|
+
|
23
|
+
RSpec/MultipleMemoizedHelpers:
|
24
|
+
Max: 10
|
4
25
|
|
5
|
-
|
6
|
-
|
26
|
+
RSpec/NestedGroups:
|
27
|
+
Max: 4
|
7
28
|
|
8
|
-
|
29
|
+
RSpec/DescribeClass:
|
9
30
|
Exclude:
|
10
|
-
- spec/
|
31
|
+
- 'spec/integration/**/*_spec.rb'
|
32
|
+
|
33
|
+
|
34
|
+
RSpec/ContextWording:
|
35
|
+
Prefixes:
|
36
|
+
- and
|
37
|
+
- with
|
38
|
+
- because
|
39
|
+
- when
|
40
|
+
- without
|
41
|
+
- shared
|
11
42
|
|
12
|
-
|
43
|
+
RSpec/RepeatedExampleGroupBody:
|
13
44
|
Enabled: false
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [1.0](https://github.com/Nu-hin/remote_ruby/releases/tag/v1.0)
|
4
|
+
|
5
|
+
### Major changes
|
6
|
+
|
7
|
+
* Full [support of SSH features](README.md#ssh-parameters), including password authentication, private key passphrases, made possible by switching to [net-ssh](https://github.com/net-ssh/net-ssh) gem.
|
8
|
+
* Since RemoteRuby no longer uses system SSH client, use of MacOS Keychain (`UseKeychain` option in MacOS OpenSSH implementation, starting from MacOS Sierra) is no longer possible.
|
9
|
+
* Added [support for STDIN](README.md#input) redirection. It is now possible to make remote scripts interactive, or stream data from local host.
|
10
|
+
* The output and error streams are now automatically synchronized. There is no need to use `STDOUT.flush` in the remote script anymore to avoid delays.
|
11
|
+
* Output and Error streams now work in binary mode, instead of being read line-by-line. It is possible to stream binary data from the remote script.
|
12
|
+
* Added support for dumping compiled code for easier debugging (see [Parameters](README.md#parameters))
|
13
|
+
* Added proper [error handling](README.md#error-handling). Printing remote stack trace and code context on error for easier debugging.
|
14
|
+
* Added advanced, customizable [text mode](README.md#text-mode).
|
15
|
+
* Flavours are renamed to plugins. It is now possible to [add custom plugins in configuration](README.md#plugins).
|
16
|
+
* Added a possibility to ignore specified types globally. Variables of the ignored types won't be attempted for serialization.
|
17
|
+
|
18
|
+
### Minor changes
|
19
|
+
|
20
|
+
* Minimum supported Ruby version is now 2.7
|
21
|
+
* `.remotely` is not included to the global scope by default, and needs to be included [explicitly](README.md#basic-usage).
|
22
|
+
* Connection adapter is now automatically selected based on the presence of the `host` argument.
|
23
|
+
* Only two adapters are now available: SSH adapter, and local temp file adapter. All other adapters are deprecated.
|
24
|
+
* Cache directory is now a [global configuration option](README.md#configuration), rather than an argument to the ExecutionContext.
|
25
|
+
* The default cache location is now in the .remote_ruby/cache, relative to the working directory.
|
26
|
+
* Added a possibility to suppress [Parser warnings](https://github.com/whitequark/parser#compatibility-with-ruby-mri).
|
27
|
+
* Added [changelog](#CHANGELOG.md)
|
28
|
+
|
29
|
+
### Migration from v0.3
|
30
|
+
|
31
|
+
1. To have `.remotely` method in global scope, include the `RemoteRuby::Extensions` module
|
32
|
+
2. Rename `server` parameter to `host`.
|
33
|
+
3. Remove `adapter` parameter.
|
34
|
+
4. Remove `cache_dir` parameter and configure it globally instead.
|
35
|
+
5. Remove `bundler` parameter.
|
36
|
+
6. If you want stdout and stderr to be prefixed, enable Text Mode and configure it.
|
37
|
+
7. Change `key_file` parameter to `keys` and make it an array with one filename instead of single string.
|
38
|
+
8. Optionally remove `STDOUT.flush` from your scripts.
|
39
|
+
|
40
|
+
Here's an example configuration which should resemble the default behaviour of v0.3:
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
RemoteRuby.configure do |c|
|
44
|
+
c.cache_dir = File.join(Dir.pwd, 'cache')
|
45
|
+
end
|
46
|
+
|
47
|
+
include RemoteRuby::Extensions
|
48
|
+
|
49
|
+
ec = RemoteRuby::ExecutionContext.new(
|
50
|
+
host: 'my_ssh_host',
|
51
|
+
text_mode: true
|
52
|
+
)
|
53
|
+
|
54
|
+
ec.execute do
|
55
|
+
# your code
|
56
|
+
end
|
57
|
+
|
58
|
+
# OR
|
59
|
+
|
60
|
+
remotely(host: 'my_ssh_host', text_mode: true) do
|
61
|
+
# your code
|
62
|
+
end
|
63
|
+
|
64
|
+
```
|
data/LICENSE.txt
CHANGED