logworm 0.7.1 → 0.7.2

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 +3 -0
  2. data/Rakefile +1 -1
  3. data/lib/base/db.rb +16 -5
  4. data/logworm.gemspec +1 -1
  5. metadata +2 -2
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v0.7.2
2
+ Cleaner way to compose the URL for the DB (now logworm://key:secret@host/token/token_secret/)
3
+
1
4
  v0.7.1
2
5
  Added DB.from_config_or_die, to throw exception if DB cannot be initialized
3
6
 
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'echoe'
2
- Echoe.new('logworm', '0.7.1') do |p|
2
+ Echoe.new('logworm', '0.7.2') 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
@@ -9,9 +9,8 @@ module Logworm
9
9
  class DB
10
10
 
11
11
  DEFAULT_HOST = "db.logworm.com"
12
- URL_FORMAT = /lw:\/\/([^:]+):([^!]+)!([^:]+):([^@]+)@([^\/]+)\//
13
- # URI: lw://<consumer_key>:<consumer_secret>!<access_token>:<access_token_secret>@db.logworm.com/
14
-
12
+ URL_FORMAT = /logworm:\/\/([^:]+):([^@]+)@([^\/]+)\/([^\/]+)\/([^\/]+)\//
13
+ # URI: logworm://<consumer_key>:<consumer_secret>@db.logworm.com/<access_token>/<access_token_secret>/
15
14
 
16
15
  def initialize(url)
17
16
  match = DB.parse_url(url)
@@ -30,7 +29,7 @@ module Logworm
30
29
  def self.with_tokens(token, token_secret)
31
30
  consumer_key = ENV["#{ENV['APP_ID']}_APPS_KEY"]
32
31
  consumer_secret = ENV["#{ENV['APP_ID']}_APPS_SECRET"]
33
- DB.new("lw://#{consumer_key}:#{consumer_secret}!#{token}:#{token_secret}@#{DEFAULT_HOST}/")
32
+ DB.new(DB.url(consumer_key, consumer_secret, token, token_secret))
34
33
  end
35
34
 
36
35
  def self.from_config
@@ -54,7 +53,19 @@ module Logworm
54
53
  raise "The application is not properly configured. Either use 'heroku addon:add' to add logworm to your app, or save your project's credentials into the .logworm file" unless db
55
54
  db
56
55
  end
57
-
56
+
57
+ def self.url(consumer_key, consumer_secret, token, token_secret, host = DEFAULT_HOST)
58
+ "logworm://#{consumer_key}:#{consumer_secret}@#{host}/#{token}/#{token_secret}/"
59
+ end
60
+
61
+ def url()
62
+ DB.url(@consumer_key, @consumer_secret, @token, @token_secret, @host)
63
+ end
64
+
65
+ def self.example_url
66
+ self.url("Ub5sOstT9w", "GZi0HciTVcoFHEoIZ7", "OzO71hEvWYDmncbf3C", "J7wq4X06MihhZgqDeB")
67
+ end
68
+
58
69
  def tables()
59
70
  res = db_call(:get, "#{@host}/")
60
71
  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.1"
5
+ s.version = "0.7.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"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 1
9
- version: 0.7.1
8
+ - 2
9
+ version: 0.7.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Pomelo, LLC