papertrail 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) Seven Scale LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -59,9 +59,10 @@ You may want to alias "trail" to "papertrail", like:
59
59
  -c, --configfile PATH Path to config (~/.papertrail.yml)
60
60
  -s, --system SYSTEM System to search
61
61
  -g, --group GROUP Group to search
62
+ -j, --json Output raw json data
62
63
 
63
64
  Usage:
64
- papertrail [-f] [-s system] [-g group] [-d seconds] [-c papertrail.yml] [query]
65
+ papertrail [-f] [-s system] [-g group] [-d seconds] [-c papertrail.yml] [-j] [query]
65
66
 
66
67
  Examples:
67
68
  papertrail -f
data/lib/papertrail.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Papertrail
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
4
4
 
5
5
  require 'papertrail/search_client'
@@ -39,6 +39,9 @@ module Papertrail
39
39
  opts.on("-g", "--group GROUP", "Group to search") do |v|
40
40
  options[:group] = v
41
41
  end
42
+ opts.on("-j", "--json", "Output raw json data") do |v|
43
+ options[:json] = true
44
+ end
42
45
 
43
46
  opts.separator usage
44
47
  end.parse!
@@ -64,15 +67,23 @@ module Papertrail
64
67
 
65
68
  if options[:follow]
66
69
  loop do
67
- search_query.search.events.each do |event|
68
- $stdout.puts event
70
+ if options[:json]
71
+ $stdout.puts search_query.search.data.to_json
72
+ else
73
+ search_query.search.events.each do |event|
74
+ $stdout.puts event
75
+ end
69
76
  end
70
77
  $stdout.flush
71
78
  sleep options[:delay]
72
79
  end
73
80
  else
74
- search_query.search.events.each do |event|
75
- $stdout.puts event
81
+ if options[:json]
82
+ $stdout.puts search_query.search.data.to_json
83
+ else
84
+ search_query.search.events.each do |event|
85
+ $stdout.puts event
86
+ end
76
87
  end
77
88
  end
78
89
  end
@@ -103,7 +114,7 @@ module Papertrail
103
114
  <<-EOF
104
115
 
105
116
  Usage:
106
- papertrail [-f] [-s system] [-g group] [-d seconds] [-c papertrail.yml] [query]
117
+ papertrail [-f] [-s system] [-g group] [-d seconds] [-c papertrail.yml] [-j] [query]
107
118
 
108
119
  Examples:
109
120
  papertrail -f
data/papertrail.gemspec CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'papertrail'
16
- s.version = '0.9.0'
17
- s.date = '2012-02-27'
16
+ s.version = '0.9.1'
17
+ s.date = '2012-03-12'
18
18
  s.rubyforge_project = 'papertrail'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -63,6 +63,7 @@ Gem::Specification.new do |s|
63
63
  # = MANIFEST =
64
64
  s.files = %w[
65
65
  Gemfile
66
+ LICENSE
66
67
  README.md
67
68
  Rakefile
68
69
  bin/papertrail
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 0
9
- version: 0.9.0
8
+ - 1
9
+ version: 0.9.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Papertrail
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-02-27 00:00:00 -08:00
17
+ date: 2012-03-12 00:00:00 -07:00
18
18
  default_executable: papertrail
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -72,6 +72,7 @@ extra_rdoc_files: []
72
72
 
73
73
  files:
74
74
  - Gemfile
75
+ - LICENSE
75
76
  - README.md
76
77
  - Rakefile
77
78
  - bin/papertrail