vero 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.md +7 -8
- data/Gemfile.lock +1 -1
- data/README.markdown +22 -8
- data/lib/vero/config.rb +5 -13
- data/lib/vero/version.rb +1 -1
- data/spec/lib/api_spec.rb +5 -1
- data/spec/lib/app_spec.rb +6 -6
- data/spec/lib/config_spec.rb +14 -6
- data/spec/lib/context_spec.rb +5 -5
- data/spec/lib/dsl_spec.rb +1 -1
- metadata +4 -3
data/CHANGES.md
CHANGED
@@ -1,14 +1,13 @@
|
|
1
|
+
## 0.8.0
|
2
|
+
|
3
|
+
- **"development_mode" flag has been deprecated.** It is recommended to use a multiple projects (with different API credentials). Please contact support@getvero.com for assistance in upgrading your account.
|
4
|
+
|
1
5
|
## 0.7.0
|
2
6
|
|
3
|
-
- **girl_friday has been replaced by sucker_punch**. The most significant
|
4
|
-
effect of this change is that Ruby 1.8.7 will no longer be supported.
|
7
|
+
- **girl_friday has been replaced by sucker_punch**. The most significant effect of this change is that Ruby 1.8.7 will no longer be supported.
|
5
8
|
|
6
9
|
## 0.6.0
|
7
10
|
|
8
|
-
- **All APIs using the `trackable` interface will now pass up an `:id`** (if
|
9
|
-
it has been made available). In the past the gem would assume that the user's id
|
10
|
-
would always be equal to their email address, but now the gem properly implements
|
11
|
-
the Vero API.
|
11
|
+
- **All APIs using the `trackable` interface will now pass up an `:id`** (if it has been made available). In the past the gem would assume that the user's id would always be equal to their email address, but now the gem properly implements the Vero API.
|
12
12
|
|
13
|
-
- **`update_user!` method no longer takes an optional new email address as a
|
14
|
-
parameter**. It is recommended that the email be made a trackable field.
|
13
|
+
- **`update_user!` method no longer takes an optional new email address as a parameter**. It is recommended that the email be made a trackable field.
|
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
@@ -23,14 +23,32 @@ following:
|
|
23
23
|
|
24
24
|
# config/initializers/vero.rb
|
25
25
|
Vero::App.init do |config|
|
26
|
-
|
27
|
-
|
26
|
+
if Rails.env.production?
|
27
|
+
config.api_key = "Your Production API key goes here"
|
28
|
+
config.secret = "Your Production API secret goes here"
|
29
|
+
else
|
30
|
+
config.api_key = "Your Test API key goes here"
|
31
|
+
config.secret = "Your Test API secret goes here"
|
32
|
+
end
|
28
33
|
end
|
29
34
|
|
30
35
|
You will be able to find your API key and secret by logging into Vero
|
31
36
|
([sign up](http://getvero.com) if you haven't already) and clicking the
|
32
37
|
'Your Account' link at the top of the page then select 'API Keys'.
|
33
38
|
|
39
|
+
Previously all Vero accounts supported two environments: *test* and *live*.
|
40
|
+
This feature has been deprecated in favour of one account with multiple
|
41
|
+
projects.
|
42
|
+
|
43
|
+
The gem will continue to support development_mode but will require
|
44
|
+
you to explicitly set it in the initialiser. We recommend migrating your
|
45
|
+
account as soon as possible. If you have any questions, please contact
|
46
|
+
support@getvero.com.
|
47
|
+
|
48
|
+
Vero::App.init do |config|
|
49
|
+
config.development_mode = !Rails.env.production? # or use true
|
50
|
+
end
|
51
|
+
|
34
52
|
By default, events are sent asynchronously using a background thread.
|
35
53
|
We recommend that you select one of the supported queue-based alternatives:
|
36
54
|
|
@@ -42,17 +60,13 @@ We recommend that you select one of the supported queue-based alternatives:
|
|
42
60
|
**Note:** If you're using Mongoid with DelayedJob, you must add
|
43
61
|
`gem "delayed_job_mongoid"` to your Gemfile.
|
44
62
|
|
45
|
-
vero will automatically choose whether to send requests to your
|
46
|
-
**development** or **live** environment if you are using Rails 3.x. You can
|
47
|
-
override this in your initializer:
|
48
|
-
|
49
|
-
config.development_mode = true # or false
|
50
|
-
|
51
63
|
Finally, if you wish to disable vero requests when running your automated tests,
|
52
64
|
add the following line to your initializer:
|
53
65
|
|
54
66
|
config.disabled = Rails.env.test?
|
55
67
|
|
68
|
+
If you have any additional questions, please contact support@getvero.com.
|
69
|
+
|
56
70
|
## Setup tracking
|
57
71
|
|
58
72
|
You will need to define who should be tracked and what information about them
|
data/lib/vero/config.rb
CHANGED
@@ -18,14 +18,10 @@ module Vero
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def request_params
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
h[symbol] = temp unless temp.blank?
|
26
|
-
end
|
27
|
-
h
|
28
|
-
end
|
21
|
+
{
|
22
|
+
:auth_token => self.auth_token,
|
23
|
+
:development_mode => self.development_mode
|
24
|
+
}.reject { |_, v| v.nil? }
|
29
25
|
end
|
30
26
|
|
31
27
|
def domain
|
@@ -60,10 +56,6 @@ module Vero
|
|
60
56
|
self.logging = false
|
61
57
|
self.api_key = nil
|
62
58
|
self.secret = nil
|
63
|
-
|
64
|
-
if defined?(Rails)
|
65
|
-
self.development_mode = !Rails.env.production?
|
66
|
-
end
|
67
59
|
end
|
68
60
|
|
69
61
|
def update_attributes(attributes = {})
|
@@ -75,4 +67,4 @@ module Vero
|
|
75
67
|
end
|
76
68
|
end
|
77
69
|
end
|
78
|
-
end
|
70
|
+
end
|
data/lib/vero/version.rb
CHANGED
data/spec/lib/api_spec.rb
CHANGED
@@ -11,6 +11,7 @@ describe Vero::Api::Events do
|
|
11
11
|
mock_context = Vero::Context.new
|
12
12
|
mock_context.config.stub(:configured?).and_return(true)
|
13
13
|
mock_context.config.stub(:auth_token).and_return("abc123")
|
14
|
+
mock_context.config.stub(:development_mode).and_return(true)
|
14
15
|
|
15
16
|
Vero::App.stub(:default_context).and_return(mock_context)
|
16
17
|
|
@@ -32,6 +33,7 @@ describe Vero::Api::Users do
|
|
32
33
|
mock_context = Vero::Context.new
|
33
34
|
mock_context.config.stub(:configured?).and_return(true)
|
34
35
|
mock_context.config.stub(:auth_token).and_return("abc123")
|
36
|
+
mock_context.config.stub(:development_mode).and_return(true)
|
35
37
|
|
36
38
|
Vero::App.stub(:default_context).and_return(mock_context)
|
37
39
|
|
@@ -49,6 +51,7 @@ describe Vero::Api::Users do
|
|
49
51
|
mock_context = Vero::Context.new
|
50
52
|
mock_context.config.stub(:configured?).and_return(true)
|
51
53
|
mock_context.config.stub(:auth_token).and_return("abc123")
|
54
|
+
mock_context.config.stub(:development_mode).and_return(true)
|
52
55
|
|
53
56
|
Vero::App.stub(:default_context).and_return(mock_context)
|
54
57
|
|
@@ -66,6 +69,7 @@ describe Vero::Api::Users do
|
|
66
69
|
mock_context = Vero::Context.new
|
67
70
|
mock_context.config.stub(:configured?).and_return(true)
|
68
71
|
mock_context.config.stub(:auth_token).and_return("abc123")
|
72
|
+
mock_context.config.stub(:development_mode).and_return(true)
|
69
73
|
|
70
74
|
Vero::App.stub(:default_context).and_return(mock_context)
|
71
75
|
|
@@ -78,7 +82,7 @@ describe Vero::Api::Users do
|
|
78
82
|
describe :unsubscribe! do
|
79
83
|
it "should call the TrackAPI object via the configured sender" do
|
80
84
|
input = {:email => "james@getvero"}
|
81
|
-
expected = input.merge(:auth_token => "abc123", :development_mode =>
|
85
|
+
expected = input.merge(:auth_token => "abc123", :development_mode => false)
|
82
86
|
|
83
87
|
mock_context = Vero::Context.new
|
84
88
|
mock_context.config.stub(:configured?).and_return(true)
|
data/spec/lib/app_spec.rb
CHANGED
@@ -12,7 +12,7 @@ describe Vero::App do
|
|
12
12
|
describe :init do
|
13
13
|
it "should ignore configuring the config if no block is provided" do
|
14
14
|
Vero::App.init
|
15
|
-
context.configured?.should
|
15
|
+
context.configured?.should be(false)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should pass configuration defined in the block to the config file" do
|
@@ -29,22 +29,22 @@ describe Vero::App do
|
|
29
29
|
Vero::App.init do |c|
|
30
30
|
c.async = false
|
31
31
|
end
|
32
|
-
context.config.async.should
|
32
|
+
context.config.async.should be(false)
|
33
33
|
|
34
34
|
Vero::App.init do |c|
|
35
35
|
c.async = true
|
36
36
|
end
|
37
|
-
context.config.async.should
|
37
|
+
context.config.async.should be(true)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
describe :disable_requests! do
|
42
42
|
it "should change config.disabled" do
|
43
43
|
Vero::App.init {}
|
44
|
-
context.config.disabled.should
|
44
|
+
context.config.disabled.should be(false)
|
45
45
|
|
46
46
|
Vero::App.disable_requests!
|
47
|
-
context.config.disabled.should
|
47
|
+
context.config.disabled.should be(true)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
@@ -55,4 +55,4 @@ describe Vero::App do
|
|
55
55
|
Vero::App.log(Object, "test")
|
56
56
|
end
|
57
57
|
end
|
58
|
-
end
|
58
|
+
end
|
data/spec/lib/config_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe Vero::Config do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
it "should be async by default" do
|
9
|
-
@config.async.should
|
9
|
+
@config.async.should be(true)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe :reset! do
|
@@ -75,21 +75,29 @@ describe Vero::Config do
|
|
75
75
|
end
|
76
76
|
|
77
77
|
describe :development_mode do
|
78
|
-
it "by default it should return
|
78
|
+
it "by default it should return false regardless of Rails environment" do
|
79
79
|
stub_env('development') {
|
80
80
|
config = Vero::Config.new
|
81
|
-
config.development_mode.should
|
81
|
+
config.development_mode.should be(false)
|
82
82
|
}
|
83
83
|
|
84
84
|
stub_env('test') {
|
85
85
|
config = Vero::Config.new
|
86
|
-
config.development_mode.should
|
86
|
+
config.development_mode.should be(false)
|
87
87
|
}
|
88
88
|
|
89
89
|
stub_env('production') {
|
90
90
|
config = Vero::Config.new
|
91
|
-
config.development_mode.should
|
91
|
+
config.development_mode.should be(false)
|
92
92
|
}
|
93
93
|
end
|
94
|
+
|
95
|
+
it "can be overritten with the config block" do
|
96
|
+
@config.development_mode = true
|
97
|
+
@config.request_params[:development_mode].should be(true)
|
98
|
+
|
99
|
+
@config.reset!
|
100
|
+
@config.request_params[:development_mode].should be(false)
|
101
|
+
end
|
94
102
|
end
|
95
|
-
end
|
103
|
+
end
|
data/spec/lib/context_spec.rb
CHANGED
@@ -24,7 +24,7 @@ describe Vero::Context do
|
|
24
24
|
describe :configure do
|
25
25
|
it "should ignore configuring the config if no block is provided" do
|
26
26
|
context.configure
|
27
|
-
context.configured?.should
|
27
|
+
context.configured?.should be(false)
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should pass configuration defined in the block to the config file" do
|
@@ -38,20 +38,20 @@ describe Vero::Context do
|
|
38
38
|
context.configure do |c|
|
39
39
|
c.async = false
|
40
40
|
end
|
41
|
-
context.config.async.should
|
41
|
+
context.config.async.should be(false)
|
42
42
|
|
43
43
|
context.configure do |c|
|
44
44
|
c.async = true
|
45
45
|
end
|
46
|
-
context.config.async.should
|
46
|
+
context.config.async.should be(true)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
50
|
describe :disable_requests! do
|
51
51
|
it "should change config.disabled" do
|
52
|
-
context.config.disabled.should
|
52
|
+
context.config.disabled.should be(false)
|
53
53
|
context.disable_requests!
|
54
|
-
context.config.disabled.should
|
54
|
+
context.config.disabled.should be(true)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
data/spec/lib/dsl_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: '0'
|
218
218
|
requirements: []
|
219
219
|
rubyforge_project:
|
220
|
-
rubygems_version: 1.8.
|
220
|
+
rubygems_version: 1.8.23
|
221
221
|
signing_key:
|
222
222
|
specification_version: 3
|
223
223
|
summary: Ruby gem for Vero
|
@@ -240,3 +240,4 @@ test_files:
|
|
240
240
|
- spec/spec_helper.rb
|
241
241
|
- spec/support/user_support.rb
|
242
242
|
- spec/support/vero_user_support.rb
|
243
|
+
has_rdoc:
|