keen 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -90,7 +90,7 @@ To configure the keen gem credentials in code, do as follows:
90
90
  You can also configure individual client instances as follows:
91
91
 
92
92
  keen = new Keen::Client.new(:project_id => 'your-project-id',
93
- :api_key => 'your-api'key)
93
+ :api_key => 'your-api-key')
94
94
 
95
95
  ##### On keen.io
96
96
 
data/lib/keen.rb CHANGED
@@ -38,7 +38,7 @@ module Keen
38
38
  private
39
39
 
40
40
  def default_client
41
- @default_client || Keen::Client.new(
41
+ @default_client ||= Keen::Client.new(
42
42
  :project_id => ENV['KEEN_PROJECT_ID'],
43
43
  :api_key => ENV['KEEN_API_KEY']
44
44
  )
data/lib/keen/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Keen
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -14,7 +14,7 @@ describe Keen do
14
14
  client.project_id.should == "12345"
15
15
  end
16
16
 
17
- it "should set a project id from the environment" do
17
+ it "should set an api key from the environment" do
18
18
  client.api_key.should == "abcde"
19
19
  end
20
20
 
@@ -25,6 +25,17 @@ describe Keen do
25
25
  end
26
26
  end
27
27
 
28
+ describe "Keen delegation" do
29
+ it "should memoize the default client, retaining settings" do
30
+ Keen.project_id = "new-abcde"
31
+ Keen.project_id.should == "new-abcde"
32
+ end
33
+
34
+ after do
35
+ Keen.instance_variable_set(:@default_client, nil)
36
+ end
37
+ end
38
+
28
39
  describe "forwardable" do
29
40
  before do
30
41
  @default_client = double("client")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-07 00:00:00.000000000 Z
13
+ date: 2013-01-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json