logworm 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/CHANGELOG +1 -1
  2. data/Rakefile +1 -1
  3. data/lib/base/db.rb +7 -8
  4. data/logworm.gemspec +1 -1
  5. metadata +2 -2
data/CHANGELOG CHANGED
@@ -1,4 +1,4 @@
1
- v0.7.2
1
+ v0.7.3
2
2
  Cleaner way to compose the URL for the DB (now logworm://key:secret@host/token/token_secret/)
3
3
 
4
4
  v0.7.1
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'echoe'
2
- Echoe.new('logworm', '0.7.2') do |p|
2
+ Echoe.new('logworm', '0.7.3') do |p|
3
3
  p.description = "logworm logging tool"
4
4
  p.url = "http://www.logworm.com"
5
5
  p.author = "Pomelo, LLC"
data/lib/base/db.rb CHANGED
@@ -16,14 +16,10 @@ module Logworm
16
16
  match = DB.parse_url(url)
17
17
  raise ForbiddenAccessException.new("Incorrect URL Format #{url}") unless match and match.size == 6
18
18
 
19
- keys = match[1..4]
20
- raise ForbiddenAccessException.new("Incorrect Keys") unless keys.is_a? Array and keys.size == 4
21
- @consumer_key, @consumer_secret, @token, @token_secret = keys
19
+ @consumer_key, @consumer_secret, @host, @token, @token_secret = match[1..5]
22
20
  raise ForbiddenAccessException.new("Missing consumer keys") if @consumer_key.nil? or @consumer_secret.nil?
23
21
  raise ForbiddenAccessException.new("Missing tokens") if @token.nil? or @token_secret.nil?
24
22
  @connection = OAuth::AccessToken.new(OAuth::Consumer.new(@consumer_key, @consumer_secret), @token, @token_secret)
25
-
26
- @host = "http://" + match[5]
27
23
  end
28
24
 
29
25
  def self.with_tokens(token, token_secret)
@@ -67,11 +63,11 @@ module Logworm
67
63
  end
68
64
 
69
65
  def tables()
70
- res = db_call(:get, "#{@host}/")
66
+ res = db_call(:get, "#{host_with_protocol}/")
71
67
  end
72
68
 
73
69
  def query(table, cond)
74
- res = db_call(:post, "#{@host}/queries", {:table => table, :query => cond})
70
+ res = db_call(:post, "#{host_with_protocol}/queries", {:table => table, :query => cond})
75
71
  end
76
72
 
77
73
  def results(uri)
@@ -82,7 +78,7 @@ module Logworm
82
78
  end
83
79
 
84
80
  def batch_log(entries)
85
- db_call(:post, "#{@host}/log", {:entries => $lr_queue.to_json})
81
+ db_call(:post, "#{host_with_protocol}/log", {:entries => $lr_queue.to_json})
86
82
  end
87
83
 
88
84
  private
@@ -107,6 +103,9 @@ module Logworm
107
103
  url.match(URL_FORMAT)
108
104
  end
109
105
 
106
+ def host_with_protocol
107
+ "http://#{@host}"
108
+ end
110
109
  end
111
110
 
112
111
  end
data/logworm.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{logworm}
5
- s.version = "0.7.2"
5
+ s.version = "0.7.3"
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"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 2
9
- version: 0.7.2
8
+ - 3
9
+ version: 0.7.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Pomelo, LLC