notifyor 0.5.2 → 0.5.3

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
  SHA1:
3
- metadata.gz: b7d0600630b383fa33449a5f4594bb6db244bb15
4
- data.tar.gz: 812777cdb554049059ad9b8347b6d39b8b02b31a
3
+ metadata.gz: e9e242dcbf0034ef3dad8c6d042b89f61409db2c
4
+ data.tar.gz: 2dca225b3198b28e373648783a01078edf553dad
5
5
  SHA512:
6
- metadata.gz: e31e4de75a3529d738a38be22bd9af7f436d80ca7ec3304862fb170395a33297b18eb4b1285a72afbff118efa6dfb17d1f6796748d0e13bb6d48f2197604eaa9
7
- data.tar.gz: 6c3dd1363429139675104d9f9ed3359d72b40a6c71508dc0d72bd04bd1f5f28359ddb28b9f5c83f1cbde4782abc057f3ba52d491cb721c798ab9fac303efc3bd
6
+ metadata.gz: 6a3c1f3c12b0437d34013a38ab4e81d90b41560464b3a6ffd527871d06d1de06865673d572e04030fb13ec09d87b1c0b938a1b857a8d35619b6ab82a8750ddba
7
+ data.tar.gz: 2473a4b4fcfd4160fc986422d1a994b3862f2fdb4dedab5f40cef669f63fcb11ad1ac0d6839fcf804d93f204c24a75ee7cf9bf25c7eacce642f489893fc74d8c
data/lib/notifyor/cli.rb CHANGED
@@ -1,10 +1,16 @@
1
- require 'notifyor'
1
+ require 'notifyor/version'
2
2
  require 'active_support/dependencies'
3
3
 
4
4
  module Notifyor
5
5
  class CLI
6
6
 
7
7
  def parse
8
+ # Default configuration.
9
+ ENV['ssh_host'] = 'localhost'
10
+ ENV['ssh_port'] = '22'
11
+ ENV['ssh_tunnel_port'] = '2000'
12
+ ENV['ssh_redis_port'] = '6379'
13
+
8
14
  OptionParser.new do |opts|
9
15
  opts.banner = 'Usage: notify_me [options]'
10
16
 
@@ -14,23 +20,23 @@ module Notifyor
14
20
  end
15
21
 
16
22
  opts.on('--ssh-host host', 'Provide the host address to your deployment/remote server') do |host|
17
- ::Notifyor.configuration.ssh_host = host
23
+ ENV['ssh_host'] = host
18
24
  end
19
25
 
20
26
  opts.on('--ssh-port port', 'Provide the ssh port for the deployment/remote server') do |port|
21
- ::Notifyor.configuration.ssh_port = port
27
+ ENV['ssh_port'] = port
22
28
  end
23
29
 
24
30
  opts.on('--ssh-user user', 'Provide the ssh user for the deployment/remote server') do |user|
25
- ::Notifyor.configuration.ssh_user = user
31
+ ENV['ssh_user'] = user
26
32
  end
27
33
 
28
34
  opts.on('--tunnel-port tunnel_port', 'Provide the ssh user for the deployment/remote server') do |tunnel_port|
29
- ::Notifyor.configuration.tunnel_port = tunnel_port
35
+ ENV['ssh_tunnel_port'] = tunnel_port
30
36
  end
31
37
 
32
38
  opts.on('--redis-port redis_port', 'Provide the ssh user for the deployment/remote server') do |redis_port|
33
- ::Notifyor.configuration.redis_port = redis_port
39
+ ENV['ssh_redis_port'] = redis_port
34
40
  end
35
41
  end.parse!
36
42
  end
@@ -3,18 +3,9 @@ require 'connection_pool'
3
3
  module Notifyor
4
4
  class Configuration
5
5
  attr_accessor :redis_connection
6
- attr_accessor :ssh_host
7
- attr_accessor :ssh_user
8
- attr_accessor :ssh_port
9
- attr_accessor :tunnel_port
10
- attr_accessor :redis_port
11
6
 
12
7
  def initialize
13
8
  @redis_connection = ::Redis.new
14
- @ssh_port = '22'
15
- @ssh_host = 'localhost'
16
- @tunnel_port ='2000'
17
- @redis_port = '6379'
18
9
  end
19
10
  end
20
11
  end
@@ -1,19 +1,17 @@
1
1
  require 'redis-objects'
2
- require 'notifyor'
3
2
  require 'notifyor/growl'
4
3
  require 'notifyor/util/formatter'
5
- require 'notifyor/errors/ssh_error'
6
4
  require 'net/ssh/gateway'
7
5
  module Notifyor
8
6
  module Remote
9
7
  class Connection
10
8
 
11
9
  def initialize
12
- @ssh_host = ::Notifyor.configuration.ssh_host
13
- @ssh_port = ::Notifyor.configuration.ssh_port
14
- @ssh_user = ::Notifyor.configuration.ssh_user
15
- @tunnel_port = ::Notifyor.configuration.tunnel_port
16
- @redis_port = ::Notifyor.configuration.redis_port
10
+ @ssh_host = ENV['ssh_host']
11
+ @ssh_port = ENV['ssh_port']
12
+ @ssh_user = ENV['ssh_user']
13
+ @tunnel_port = ENV['ssh_tunnel_port']
14
+ @redis_port = ENV['ssh_redis_port']
17
15
  @ssh_gateway = nil
18
16
  @redis_tunnel_connection = nil
19
17
  end
@@ -1,3 +1,3 @@
1
1
  module Notifyor
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifyor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erwin Schens
@@ -123,7 +123,6 @@ files:
123
123
  - lib/notifyor.rb
124
124
  - lib/notifyor/cli.rb
125
125
  - lib/notifyor/configuration.rb
126
- - lib/notifyor/errors/ssh_error.rb
127
126
  - lib/notifyor/growl.rb
128
127
  - lib/notifyor/growl/adapters/terminal_notifier.rb
129
128
  - lib/notifyor/plugin.rb
@@ -1,6 +0,0 @@
1
- module Notifyor
2
- module Errors
3
- class SSHError < StandardError
4
- end
5
- end
6
- end