btw 0.1.1 → 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/bin/btw +24 -5
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2e1ed9bcb86405ae980f5107dfd3b0872887dd4
|
4
|
+
data.tar.gz: 8981b22eeeab8cb2f9a4ac0c73c876b6eb24fb28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 512b0dca937c4990584919ac3aef6db3002b685fb087557fb7f71cec7dda1e686ccac6bb9699f1c90d9a1aca8d6f514e624cc4d4ae6a97e0b56a6b02e9d094c2
|
7
|
+
data.tar.gz: a1f36fb03f0f415c94c18a9e6504a32674fda65aa2cb963508bb4c8d5909e064b0d9a3c614898e2777db03619f9f894df9fd383253f8d2f7be88119c670b0c44
|
data/bin/btw
CHANGED
@@ -15,8 +15,12 @@ config = {
|
|
15
15
|
|
16
16
|
config_file = File.expand_path('~/.btw.conf')
|
17
17
|
if File.exist?(config_file)
|
18
|
-
config.merge!(MultiJson.load(File.read(config_file), :
|
18
|
+
config.merge!(MultiJson.load(File.read(config_file), :symbolize_keys => true))
|
19
19
|
end
|
20
|
+
if config[:host].kind_of?(String)
|
21
|
+
config[:host] = [ config[:host] ]
|
22
|
+
end
|
23
|
+
pp config if config[:debug]
|
20
24
|
|
21
25
|
# The basics
|
22
26
|
input = ARGV.join(" ")
|
@@ -68,11 +72,26 @@ answer = STDIN.gets.chomp
|
|
68
72
|
|
69
73
|
case answer.downcase
|
70
74
|
when 'yes','y', ''
|
71
|
-
|
72
|
-
|
73
|
-
|
75
|
+
|
76
|
+
sent = false
|
77
|
+
errors = {}
|
78
|
+
config[:host].each do |host|
|
79
|
+
begin
|
80
|
+
puts "Sending to #{host}:#{config[:port]}" if config[:debug]
|
81
|
+
sock = TCPSocket.new(host, config[:port])
|
82
|
+
sock.send(MultiJson.dump(output), 0)
|
83
|
+
sent = true
|
84
|
+
break
|
85
|
+
rescue => error
|
86
|
+
errors[host] = error
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
if sent
|
91
|
+
puts "Sent"
|
74
92
|
else
|
75
|
-
puts
|
93
|
+
puts "Could not send:"
|
94
|
+
pp errors
|
76
95
|
end
|
77
96
|
else
|
78
97
|
puts 'Not sent'
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: btw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fraser Scott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chronic
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.10'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.10'
|
27
27
|
description: A quick and lightweight tool for creating searchable change control logs.
|
@@ -43,19 +43,18 @@ require_paths:
|
|
43
43
|
- lib
|
44
44
|
required_ruby_version: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - '>='
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
55
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.
|
56
|
+
rubygems_version: 2.0.3
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: Send change control messages to logstash (elasticsearch, kibana)
|
60
60
|
test_files: []
|
61
|
-
has_rdoc:
|