diff options
author | Mingxiang Xue <mingxiangxue@gmail.com> | 2020-03-09 11:18:56 +0800 |
---|---|---|
committer | Mingxiang Xue <mingxiangxue@gmail.com> | 2020-03-09 11:18:56 +0800 |
commit | 990695c4892d8f51a7ce29d4bfc987a8f2738a0e (patch) | |
tree | b25f218aa54cc59acc75564c41a154b39d9a5521 | |
parent | f5f476c95719dda5b621b96c55f6ed006a220d9c (diff) | |
download | net-ssh-990695c4892d8f51a7ce29d4bfc987a8f2738a0e.tar.gz |
Fix rubocop styles
Signed-off-by: Mingxiang Xue <mingxiangxue@gmail.com>
-rw-r--r-- | lib/net/ssh/config.rb | 2 | ||||
-rw-r--r-- | lib/net/ssh/connection/channel.rb | 3 | ||||
-rw-r--r-- | test/test_config.rb | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/lib/net/ssh/config.rb b/lib/net/ssh/config.rb index a40262e..fdc2e09 100644 --- a/lib/net/ssh/config.rb +++ b/lib/net/ssh/config.rb @@ -216,6 +216,7 @@ module Net userknownhostsfile: :user_known_hosts_file, checkhostip: :check_host_ip }.freeze + # rubocop:disable Metrics/CyclomaticComplexity def translate_config_key(hash, key, value, settings) case key when :ciphers @@ -284,6 +285,7 @@ module Net hash[TRANSLATE_CONFIG_KEY_RENAME_MAP[key]] = value end end + # rubocop:enable Metrics/CyclomaticComplexity def setup_proxy(type, value) case type diff --git a/lib/net/ssh/connection/channel.rb b/lib/net/ssh/connection/channel.rb index 7bfee72..e65e5c1 100644 --- a/lib/net/ssh/connection/channel.rb +++ b/lib/net/ssh/connection/channel.rb @@ -682,9 +682,12 @@ module Net # Set a +Hash+ of environment variables in the remote process' environment. # # channel.set_remote_env foo: 'bar', baz: 'whale' + # + # rubocop:disable Naming/AccessorMethodName def set_remote_env(env) env.each { |key, value| self.env(key, value) } end + # rubocop:enable Naming/AccessorMethodName end end diff --git a/test/test_config.rb b/test/test_config.rb index aa21ad6..f71a952 100644 --- a/test/test_config.rb +++ b/test/test_config.rb @@ -163,7 +163,7 @@ class TestConfig < NetSSHTest assert_equal 1024, net_ssh[:rekey_limit] assert_equal "127.0.0.1", net_ssh[:bind_address] assert_equal [/^LC_.*$/], net_ssh[:send_env] - assert_equal Hash['foo'=>'bar', 'baz'=>'whale', 'cat'=>'black hole'], net_ssh[:set_env] + assert_equal Hash['foo' => 'bar', 'baz' => 'whale', 'cat' => 'black hole'], net_ssh[:set_env] assert_equal 123, net_ssh[:number_of_password_prompts] assert_equal 4, net_ssh[:keepalive_maxcount] assert_equal 2, net_ssh[:keepalive_interval] @@ -290,7 +290,7 @@ class TestConfig < NetSSHTest def test_load_with_set_env config = Net::SSH::Config.load(config(:set_env), '1234') net_ssh = Net::SSH::Config.translate(config) - assert_equal Hash['foo'=>'bar', 'baz'=>'whale', 'cat'=>'black hole'], net_ssh[:set_env] + assert_equal Hash['foo' => 'bar', 'baz' => 'whale', 'cat' => 'black hole'], net_ssh[:set_env] end def test_load_with_remote_user |