tropo_tail 0.2.3 → 0.2.5

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: c6f371bf97b30b64b28b5f7e8d1a97afc0c61f77
4
- data.tar.gz: 0630efb1cc81193a1f9ce9f249c40ec359c2878f
3
+ metadata.gz: 8cf116087b5f2ce756282a0678bea3ab4e699172
4
+ data.tar.gz: 8bb8e5a3a3c37797b8f81b26a45a79a154bda209
5
5
  SHA512:
6
- metadata.gz: fc004d350cf472bb178870928e78b6313ef591ac0d47566381a79058acd589f0f269b7cc3c3270922826911754b1874b45cbafba1ace060d1163d2ec4f3c5ccc
7
- data.tar.gz: 90087c298c6b8e8bb224c52be8ac593d2a6ea2243204cbaebc8ce863a4da6487f620bcd4a47764bc460719390514942b076a3a0736ff2c098f06c0bdf120c43d
6
+ metadata.gz: 6d81159f7a71b56e65d3605af12fb4109d308948129e7bfaa7c78ddcd0788e1a7542fc70dffaaf326663cf12fc049e991d71379137f3279c7d49b8f44d290815
7
+ data.tar.gz: 12f2eb8979510f61a3a2f5e479a58b78819e43d4ee78129af138a6bedfe224d12e052a68224925cea0e5cfe9d8790d826640353530ca1b6908622e7653072ef1
data/Gemfile.lock ADDED
@@ -0,0 +1,67 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ tropo_tail (0.2.3)
5
+ colorize
6
+ methadone (~> 1.9.2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ aruba (0.14.1)
12
+ childprocess (~> 0.5.6)
13
+ contracts (~> 0.9)
14
+ cucumber (>= 1.3.19)
15
+ ffi (~> 1.9.10)
16
+ rspec-expectations (>= 2.99)
17
+ thor (~> 0.19)
18
+ builder (3.2.2)
19
+ childprocess (0.5.9)
20
+ ffi (~> 1.0, >= 1.0.11)
21
+ colorize (0.8.1)
22
+ contracts (0.14.0)
23
+ cucumber (2.4.0)
24
+ builder (>= 2.1.2)
25
+ cucumber-core (~> 1.5.0)
26
+ cucumber-wire (~> 0.0.1)
27
+ diff-lcs (>= 1.1.3)
28
+ gherkin (~> 4.0)
29
+ multi_json (>= 1.7.5, < 2.0)
30
+ multi_test (>= 0.1.2)
31
+ cucumber-core (1.5.0)
32
+ gherkin (~> 4.0)
33
+ cucumber-wire (0.0.1)
34
+ diff-lcs (1.2.5)
35
+ ffi (1.9.14)
36
+ gherkin (4.0.0)
37
+ json (1.8.3)
38
+ methadone (1.9.2)
39
+ bundler
40
+ multi_json (1.12.1)
41
+ multi_test (0.1.2)
42
+ power_assert (0.2.2)
43
+ rake (10.5.0)
44
+ rdoc (4.2.2)
45
+ json (~> 1.4)
46
+ rspec-expectations (3.5.0)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.5.0)
49
+ rspec-support (3.5.0)
50
+ test-unit (3.0.8)
51
+ power_assert
52
+ thor (0.19.1)
53
+
54
+ PLATFORMS
55
+ ruby
56
+
57
+ DEPENDENCIES
58
+ aruba
59
+ bundler (~> 1.11)
60
+ colorize
61
+ rake (~> 10.0)
62
+ rdoc
63
+ test-unit
64
+ tropo_tail!
65
+
66
+ BUNDLED WITH
67
+ 1.11.2
data/bin/tropo_tail CHANGED
@@ -18,6 +18,7 @@ class App
18
18
  get_latest
19
19
  if @filename.nil?
20
20
  puts "No new logs"
21
+ wait_for_logs
21
22
  else
22
23
  tail
23
24
  end
@@ -25,11 +26,9 @@ class App
25
26
 
26
27
  # supplemental methods here
27
28
  def self.run
28
- puts "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
29
29
  puts "Please type your Tropo Username..."
30
30
  @username = gets.chomp
31
31
  begin
32
- puts "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
33
32
  puts "Please enter your Tropo Password"
34
33
  system 'stty -echo'
35
34
  @password = gets.chomp
@@ -40,6 +39,15 @@ class App
40
39
  end
41
40
  end
42
41
 
42
+ def self.wait_for_logs
43
+ while @filename.nil?
44
+ get_latest
45
+ sleep 15
46
+ print "."
47
+ end
48
+ tail
49
+ end
50
+
43
51
  def self.get_latest
44
52
  @ftp.list.each do |file|
45
53
  if file[-4..-1] == ".txt"
data/exe/tropo_tail CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'optparse'
4
4
  require 'methadone'
5
- require 'tropo_tail.rb'
5
+ #require 'tropo_tail.rb'
6
6
  require 'net/ftp'
7
7
  require 'colorize'
8
8
 
@@ -18,6 +18,7 @@ class App
18
18
  get_latest
19
19
  if @filename.nil?
20
20
  puts "No new logs"
21
+ wait_for_logs
21
22
  else
22
23
  tail
23
24
  end
@@ -25,11 +26,9 @@ class App
25
26
 
26
27
  # supplemental methods here
27
28
  def self.run
28
- puts "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
29
29
  puts "Please type your Tropo Username..."
30
30
  @username = gets.chomp
31
31
  begin
32
- puts "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
33
32
  puts "Please enter your Tropo Password"
34
33
  system 'stty -echo'
35
34
  @password = gets.chomp
@@ -40,6 +39,15 @@ class App
40
39
  end
41
40
  end
42
41
 
42
+ def self.wait_for_logs
43
+ while @filename.nil?
44
+ get_latest
45
+ sleep 15
46
+ print "."
47
+ end
48
+ tail
49
+ end
50
+
43
51
  def self.get_latest
44
52
  @ftp.list.each do |file|
45
53
  if file[-4..-1] == ".txt"
@@ -111,3 +119,4 @@ class App
111
119
 
112
120
  go!
113
121
  end
122
+
@@ -1,3 +1,3 @@
1
1
  module TropoTail
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.5"
3
3
  end
Binary file
Binary file
Binary file
Binary file
Binary file
data/tropo_tail.rb ADDED
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env ruby
2
+ require 'net/ftp'
3
+ require 'colorize'
4
+
5
+ class TropoTail
6
+
7
+ def initialize
8
+ @ftp = Net::FTP.new('ftp.tropo.com')
9
+ run
10
+ @ftp.login(@username, @password)
11
+ @ftp.chdir('logs')
12
+ get_latest
13
+ if @filename.nil?
14
+ puts "No new logs"
15
+ else
16
+ tail
17
+ end
18
+ end
19
+
20
+ def run
21
+ puts "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
22
+ puts "Please type your Tropo Username..."
23
+ @username = gets.chomp
24
+ begin
25
+ puts "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
26
+ puts "Please enter your Tropo Password"
27
+ system 'stty -echo'
28
+ @password = gets.chomp
29
+ system 'stty echo'
30
+ rescue
31
+ system 'stty echo'
32
+ exit
33
+ end
34
+ puts "Input 1 for full Tropo logs or 2 for truncated logs"
35
+ @log_display = gets.chomp
36
+ end
37
+
38
+ def get_latest
39
+ @ftp.list.each do |file|
40
+ if file[-4..-1] == ".txt"
41
+ @filename = file[-19..-1]
42
+ end
43
+ end
44
+ end
45
+
46
+ def tail
47
+ maxline = 0
48
+ orig_log = @filename
49
+ while 0 < 1
50
+ get_latest
51
+ if orig_log != @filename
52
+ maxline = 0
53
+ orig_log = @filename
54
+ end
55
+ linecount = 0
56
+ @ftp.gettextfile(@filename, nil) do |line|
57
+ info = /(?<=PRISM )(\d{7})(\/)(\d{7})(\/)(\w{32}\/|0)(\/)(\w{32})(\/)(1)(\/)(\S{1,50}\/)(\[\S{1,50}\])/.match(line).to_s.yellow
58
+ linecount += 1
59
+ if linecount > maxline
60
+ maxline = linecount
61
+ if @log_display == "1"
62
+ puts "#{line[0..19].blue}#{line[21..50].yellow} #{info}#{line[(info.length + 38)..-1]}"
63
+ elsif @log_display == "2"
64
+ puts "#{line[0..19].blue} #{line[(info.length + 38)..-1]}"
65
+ else
66
+ puts "invalid log display option"
67
+ return false
68
+ end
69
+ end
70
+ end
71
+ sleep 3
72
+ end
73
+ end
74
+
75
+ def log_line_break
76
+ Thread.new do
77
+ while 0 < 1
78
+ char = STDIN.getc
79
+ if char == "\r"
80
+ puts ""
81
+ end
82
+ end
83
+ end
84
+ end
85
+
86
+ end
87
+
88
+ tt = TropoTail.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tropo_tail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Gisin
@@ -121,6 +121,7 @@ extra_rdoc_files: []
121
121
  files:
122
122
  - ".gitignore"
123
123
  - Gemfile
124
+ - Gemfile.lock
124
125
  - README.md
125
126
  - README.rdoc
126
127
  - Rakefile
@@ -130,7 +131,13 @@ files:
130
131
  - exe/tropo_tail
131
132
  - lib/tropo_tail.rb
132
133
  - lib/tropo_tail/version.rb
134
+ - tropo_tail-0.1.0.gem
135
+ - tropo_tail-0.2.0.gem
136
+ - tropo_tail-0.2.1.gem
137
+ - tropo_tail-0.2.2.gem
138
+ - tropo_tail-0.2.3.gem
133
139
  - tropo_tail.gemspec
140
+ - tropo_tail.rb
134
141
  homepage: http://www.cloverhound.com
135
142
  licenses:
136
143
  - Nonstandard