log-listener 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/classes/start.rb +30 -0
- data/lib/log-listener/version.rb +1 -1
- data/lib/log-listener.rb +5 -2
- data/spec/unit_test_log_listener_spec.rb +24 -0
- metadata +5 -7
- data/.gitignore +0 -17
- data/LICENSE +0 -22
- data/README.md +0 -29
- data/Rakefile +0 -2
- data/log-listener.gemspec +0 -17
@@ -0,0 +1,30 @@
|
|
1
|
+
module LogListener
|
2
|
+
|
3
|
+
class Start
|
4
|
+
attr_reader :host,:user,:password,:app_udp_log,:result
|
5
|
+
attr_accessor :result
|
6
|
+
|
7
|
+
PATH = '/data/public/log'
|
8
|
+
|
9
|
+
def initialize(*args)
|
10
|
+
@host = args[0]
|
11
|
+
@user = args[1]
|
12
|
+
@password = args[2]
|
13
|
+
@result = []
|
14
|
+
end
|
15
|
+
|
16
|
+
def setup_path_to_udp(path)
|
17
|
+
@app_udp_log = "#{path}"
|
18
|
+
end
|
19
|
+
|
20
|
+
def execute_this_command(actions)
|
21
|
+
|
22
|
+
Net::SSH.start("#{@host}", "#{@user}", :password => "#{password}") do |ssh|
|
23
|
+
go_to_path = ssh.exec!("cd #{PATH}")
|
24
|
+
do_this = ssh.exec!("#{actions}")
|
25
|
+
@result << do_this
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/log-listener/version.rb
CHANGED
data/lib/log-listener.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require "log-listener/version"
|
2
|
+
require "classes/start"
|
3
3
|
require 'pry'
|
4
4
|
require 'net/ssh'
|
5
|
+
#require File.expand_path('log-listener/version', __FILE__)
|
6
|
+
#require File.expand_path('classes/start', __FILE__)
|
7
|
+
|
5
8
|
module LogListener
|
6
9
|
|
7
10
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative '../lib/log-listener.rb'
|
2
|
+
|
3
|
+
describe LogListener do
|
4
|
+
LOGRC = '10.254.150.101'
|
5
|
+
PASSWLOGTEST = 'logger'
|
6
|
+
USERLOGTEST = 'logger'
|
7
|
+
PATH = '/data/public/log'
|
8
|
+
|
9
|
+
|
10
|
+
it "Should be able to set an environment", :dev => true do
|
11
|
+
dev_tester = LogListener::Start.new("#{LOGRC}","#{USERLOGTEST}","#{PASSWLOGTEST}")
|
12
|
+
dev_tester.setup_path_to_udp('logTesting/log')
|
13
|
+
dev_tester.app_udp_log.should be_eql('logTesting/log')
|
14
|
+
end
|
15
|
+
|
16
|
+
it "Should be able to connect after a set up", :despegar_dev => true do
|
17
|
+
connection_test = LogListener::Start.new(LOGRC,USERLOGTEST,PASSWLOGTEST)
|
18
|
+
connection_test.execute_this_command("grep 'Perez' #{PATH}/logPackagesSM/log")
|
19
|
+
connection_test.result.size < 1
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log-listener
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -18,14 +18,11 @@ executables: []
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
-
- .gitignore
|
22
21
|
- Gemfile
|
23
|
-
-
|
24
|
-
- README.md
|
25
|
-
- Rakefile
|
22
|
+
- spec/unit_test_log_listener_spec.rb
|
26
23
|
- lib/log-listener.rb
|
24
|
+
- lib/classes/start.rb
|
27
25
|
- lib/log-listener/version.rb
|
28
|
-
- log-listener.gemspec
|
29
26
|
homepage: ''
|
30
27
|
licenses: []
|
31
28
|
post_install_message:
|
@@ -50,5 +47,6 @@ rubygems_version: 1.8.24
|
|
50
47
|
signing_key:
|
51
48
|
specification_version: 3
|
52
49
|
summary: Really Simple Logging Capture Gem
|
53
|
-
test_files:
|
50
|
+
test_files:
|
51
|
+
- spec/unit_test_log_listener_spec.rb
|
54
52
|
has_rdoc:
|
data/.gitignore
DELETED
data/LICENSE
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2012 euhrig
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# Log::Listener
|
2
|
-
|
3
|
-
TODO: Write a gem description
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
gem 'log-listener'
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install log-listener
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
TODO: Write usage instructions here
|
22
|
-
|
23
|
-
## Contributing
|
24
|
-
|
25
|
-
1. Fork it
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create new Pull Request
|
data/Rakefile
DELETED
data/log-listener.gemspec
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require File.expand_path('../lib/log-listener/version', __FILE__)
|
3
|
-
|
4
|
-
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["euhrig"]
|
6
|
-
gem.email = ["euhrig@despegar.com"]
|
7
|
-
gem.description = %q{Gem to run after tests looking for log ERROR, really simple}
|
8
|
-
gem.summary = %q{Really Simple Logging Capture Gem}
|
9
|
-
gem.homepage = ""
|
10
|
-
|
11
|
-
gem.files = `git ls-files`.split($\)
|
12
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
-
gem.name = "log-listener"
|
15
|
-
gem.require_paths = ["lib"]
|
16
|
-
gem.version = Log::Listener::VERSION
|
17
|
-
end
|