logworm_client 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v0.6.2
2
+ Added list_tables command
3
+
1
4
  v0.6.1
2
5
  Added a bit of documentation
3
6
 
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'echoe'
2
- Echoe.new('logworm_client', '0.6.1') do |p|
2
+ Echoe.new('logworm_client', '0.6.2') do |p|
3
3
  p.description = "logworm client utilities"
4
4
  p.url = "http://www.logworm.com"
5
5
  p.author = "Pomelo, LLC"
@@ -31,15 +31,32 @@ end
31
31
  # results_url ==> URL to GET the results for the query
32
32
  # created ==> First creation of the query
33
33
  # updated ==> most recent update of the query and/or its results
34
+ # expires ==> until that datime, the query won't be rerun against the database
34
35
  # execution_time ==> time in ms to run the query
35
36
  # results ==> array of hashmaps. Each element corresponds to a log entry, with its fields
36
37
  #
37
38
  # raises Logworm::DatabaseException, Logworm::ForbiddenAccessException, Logworm::InvalidQueryException
38
39
  # or just a regular Exception if it cannot find the URL to the logging database
39
40
  ###
40
- def lw_query(table, query)
41
+ def lw_query(logname, query = {})
41
42
  db = Logworm::DB.from_config_or_die # Establish connection to DB
42
43
  query = Logworm::QueryBuilder.new(query).to_json if query.is_a? Hash # Turn query into proper JSON string
43
- query_data = db.query(table, query) # POST to create query
44
+ query_data = db.query(logname, query) # POST to create query
44
45
  db.results(query_data["results_uri"]) # GET from query's results uri
45
46
  end
47
+
48
+ ###
49
+ # Returns an array with information about the logging tables in the database
50
+ # Each element in the array has;
51
+ # :tablename => The name of the logging table
52
+ # :url => The URL for POSTing new log entries
53
+ # :last_write => Datetime of last entry
54
+ # :rows => Count of entries
55
+ #
56
+ # raises Logworm::DatabaseException, Logworm::ForbiddenAccessException, Logworm::InvalidQueryException
57
+ # or just a regular Exception if it cannot find the URL to the logging database
58
+ ###
59
+ def lw_list_logs
60
+ db = Logworm::DB.from_config_or_die # Establish connection to DB
61
+ db.tables # Call tables command
62
+ end
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{logworm_client}
5
- s.version = "0.6.1"
5
+ s.version = "0.6.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Pomelo, LLC"]
9
- s.date = %q{2010-04-22}
9
+ s.date = %q{2010-04-23}
10
10
  s.description = %q{logworm client utilities}
11
11
  s.email = %q{schapira@pomelollc.com}
12
12
  s.executables = ["lw-compute", "lw-tail"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 1
9
- version: 0.6.1
8
+ - 2
9
+ version: 0.6.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Pomelo, LLC
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-22 00:00:00 -04:00
17
+ date: 2010-04-23 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency