userlist-rails 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef228cf5cb636af878d4c252b272ad9cdb4bd6ab462ddcb9ad0cfacc71a191fb
4
- data.tar.gz: e9577e9c3db7171665106a8b10977adeff7a05a90e6a892521667891701e9ec3
3
+ metadata.gz: a8b5550e94f954f69d1b8447349a277afb45612c329088a521d7e1f719248d59
4
+ data.tar.gz: c24fd494b7cf44973a7c1bcb8d472ff8ee2a4672df0d46e1738cdc149f789666
5
5
  SHA512:
6
- metadata.gz: 5b197cf9e6078baa517cd15a6cb8ee156164f37e154378b915bf024767adcdc155ffdb4323be007de9617e6f5194ce92b2e38d314c49513056650c4e2b2d08fe
7
- data.tar.gz: 3f2f7a0c82ae87ec3c66f8595bdd9a994d5c33ea2e806764bc29770248b93931d820ac10caeceafde4469b234e342d5c6d4465ab99f47467ae5c66c30bfb5a01
6
+ metadata.gz: 9763a4bdd5fc8c21eef2fd55982f1ebecaafc3ef2a71af497f9e7000f9473aa4ed885a7174ee29919891e57603285aa100704d886489883a2a9cd7f1343c661d
7
+ data.tar.gz: 81c787f5d451da159443c7d596beab58bb80a264ff05fdd3e4c140a4e8f2e5a114785bde78b32e7397a67d767aab68bcaa2bf6033273853f38e33899b5352813
data/README.md CHANGED
@@ -39,6 +39,18 @@ Userlist.configure do |config|
39
39
  end
40
40
  ```
41
41
 
42
+ ### Disabling in development and test environments
43
+
44
+ As sending test and development data into data into Userlist isn't very desireable, you can disable transmissions by setting the push strategy to `:null`.
45
+
46
+ ```ruby
47
+ # config/initializer/userlist.rb
48
+ Userlist.configure do |config|
49
+ config.push_strategy = :null unless Rails.env.production?
50
+ end
51
+ ```
52
+
53
+
42
54
  ## Usage
43
55
 
44
56
  ### Tracking Users
@@ -68,7 +80,7 @@ end
68
80
  To manually send user data into Userlist, use the `Userlist::Push.user` method.
69
81
 
70
82
  ```ruby
71
- Userlist::Push.event(identifier: user.id, email: user.email, properties: { first_name: user.first_name, last_name: user.last_name })
83
+ Userlist::Push.user(identifier: user.id, email: user.email, properties: { first_name: user.first_name, last_name: user.last_name })
72
84
  ```
73
85
 
74
86
  ### Tracking Events
@@ -7,15 +7,8 @@ module Userlist
7
7
  extend ActiveSupport::Concern
8
8
 
9
9
  included do
10
- block = lambda do
11
- Userlist::Push.company(userlist_payload)
12
- end
13
-
14
- if respond_to?(:after_commit)
15
- after_commit(&block)
16
- elsif respond_to?(:after_save)
17
- after_save(&block)
18
- end
10
+ method = [:after_commit, :after_save].find { |m| respond_to?(m) }
11
+ public_send(method, :userlist_push) if method
19
12
  end
20
13
 
21
14
  def userlist_identifier
@@ -37,6 +30,10 @@ module Userlist
37
30
  def userlist_name
38
31
  return name if respond_to?(:name)
39
32
  end
33
+
34
+ def userlist_push
35
+ Userlist::Push.company(userlist_payload)
36
+ end
40
37
  end
41
38
  end
42
39
  end
@@ -7,15 +7,8 @@ module Userlist
7
7
  extend ActiveSupport::Concern
8
8
 
9
9
  included do
10
- block = lambda do
11
- Userlist::Push.user(userlist_payload)
12
- end
13
-
14
- if respond_to?(:after_commit)
15
- after_commit(&block)
16
- elsif respond_to?(:after_save)
17
- after_save(&block)
18
- end
10
+ method = [:after_commit, :after_save].find { |m| respond_to?(m) }
11
+ public_send(method, :userlist_push) if method
19
12
  end
20
13
 
21
14
  def userlist_identifier
@@ -43,6 +36,10 @@ module Userlist
43
36
  signed_up_at: created_at
44
37
  }
45
38
  end
39
+
40
+ def userlist_push
41
+ Userlist::Push.user(userlist_payload)
42
+ end
46
43
  end
47
44
  end
48
45
  end
@@ -1,5 +1,5 @@
1
1
  module Userlist
2
2
  module Rails
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.2.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: userlist-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benedikt Deicke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-21 00:00:00.000000000 Z
11
+ date: 2019-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -172,8 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  requirements: []
175
- rubyforge_project:
176
- rubygems_version: 2.7.3
175
+ rubygems_version: 3.0.3
177
176
  signing_key:
178
177
  specification_version: 4
179
178
  summary: Rails integration for Userlist.io