userlist-rails 0.2.1 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Userlist
2
2
  module Rails
3
- VERSION = '0.2.1'.freeze
3
+ VERSION = '0.5.1'.freeze
4
4
  end
5
5
  end
@@ -7,9 +7,9 @@ Gem::Specification.new do |spec|
7
7
  spec.name = 'userlist-rails'
8
8
  spec.version = Userlist::Rails::VERSION
9
9
  spec.authors = ['Benedikt Deicke']
10
- spec.email = ['benedikt@userlist.io']
10
+ spec.email = ['benedikt@userlist.com']
11
11
  spec.homepage = 'https://github.com/userlistio/userlist-rails'
12
- spec.summary = 'Rails integration for Userlist.io'
12
+ spec.summary = 'Rails integration for Userlist'
13
13
  spec.license = 'MIT'
14
14
 
15
15
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -19,13 +19,17 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_dependency 'activesupport', '>= 3.0'
23
- spec.add_dependency 'railties', '>= 3.0'
24
- spec.add_dependency 'userlist', '~> 0.2'
22
+ spec.required_ruby_version = '>= 2.4'
25
23
 
26
- spec.add_development_dependency 'bundler', '~> 1.15'
27
- spec.add_development_dependency 'rake', '~> 10.0'
24
+ spec.add_dependency 'activesupport', '>= 5.0'
25
+ spec.add_dependency 'railties', '>= 5.0'
26
+ spec.add_dependency 'userlist', '~> 0.5'
27
+
28
+ spec.add_development_dependency 'actionpack', '>= 5.0'
29
+ spec.add_development_dependency 'activerecord', '>= 5.0'
30
+ spec.add_development_dependency 'bundler', '>= 1.15'
31
+ spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
28
32
  spec.add_development_dependency 'rspec', '~> 3.0'
29
- spec.add_development_dependency 'sqlite3'
30
- spec.add_development_dependency 'webmock', '~> 1.22'
33
+ spec.add_development_dependency 'rspec-rails', '~> 3.0'
34
+ spec.add_development_dependency 'sqlite3', '>= 1.4'
31
35
  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.1
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benedikt Deicke
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-13 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,54 +16,82 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: '5.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '3.0'
26
+ version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: railties
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: '5.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '3.0'
40
+ version: '5.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: userlist
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.2'
47
+ version: '0.5'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.2'
54
+ version: '0.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: actionpack
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '5.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '5.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: activerecord
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '5.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '5.0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: bundler
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
- - - "~>"
87
+ - - ">="
60
88
  - !ruby/object:Gem::Version
61
89
  version: '1.15'
62
90
  type: :development
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
- - - "~>"
94
+ - - ">="
67
95
  - !ruby/object:Gem::Version
68
96
  version: '1.15'
69
97
  - !ruby/object:Gem::Dependency
@@ -72,14 +100,20 @@ dependencies:
72
100
  requirements:
73
101
  - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: '10.0'
103
+ version: '12.3'
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 12.3.3
76
107
  type: :development
77
108
  prerelease: false
78
109
  version_requirements: !ruby/object:Gem::Requirement
79
110
  requirements:
80
111
  - - "~>"
81
112
  - !ruby/object:Gem::Version
82
- version: '10.0'
113
+ version: '12.3'
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 12.3.3
83
117
  - !ruby/object:Gem::Dependency
84
118
  name: rspec
85
119
  requirement: !ruby/object:Gem::Requirement
@@ -95,44 +129,44 @@ dependencies:
95
129
  - !ruby/object:Gem::Version
96
130
  version: '3.0'
97
131
  - !ruby/object:Gem::Dependency
98
- name: sqlite3
132
+ name: rspec-rails
99
133
  requirement: !ruby/object:Gem::Requirement
100
134
  requirements:
101
- - - ">="
135
+ - - "~>"
102
136
  - !ruby/object:Gem::Version
103
- version: '0'
137
+ version: '3.0'
104
138
  type: :development
105
139
  prerelease: false
106
140
  version_requirements: !ruby/object:Gem::Requirement
107
141
  requirements:
108
- - - ">="
142
+ - - "~>"
109
143
  - !ruby/object:Gem::Version
110
- version: '0'
144
+ version: '3.0'
111
145
  - !ruby/object:Gem::Dependency
112
- name: webmock
146
+ name: sqlite3
113
147
  requirement: !ruby/object:Gem::Requirement
114
148
  requirements:
115
- - - "~>"
149
+ - - ">="
116
150
  - !ruby/object:Gem::Version
117
- version: '1.22'
151
+ version: '1.4'
118
152
  type: :development
119
153
  prerelease: false
120
154
  version_requirements: !ruby/object:Gem::Requirement
121
155
  requirements:
122
- - - "~>"
156
+ - - ">="
123
157
  - !ruby/object:Gem::Version
124
- version: '1.22'
125
- description:
158
+ version: '1.4'
159
+ description:
126
160
  email:
127
- - benedikt@userlist.io
161
+ - benedikt@userlist.com
128
162
  executables: []
129
163
  extensions: []
130
164
  extra_rdoc_files: []
131
165
  files:
166
+ - ".github/workflows/test.yml"
132
167
  - ".gitignore"
133
168
  - ".rspec"
134
169
  - ".rubocop.yml"
135
- - ".travis.yml"
136
170
  - CODE_OF_CONDUCT.md
137
171
  - Gemfile
138
172
  - Guardfile
@@ -142,22 +176,28 @@ files:
142
176
  - bin/console
143
177
  - bin/setup
144
178
  - bin/test
145
- - lib/tasks/userlist.rake
146
179
  - lib/userlist/rails.rb
147
- - lib/userlist/rails/company.rb
148
180
  - lib/userlist/rails/config.rb
181
+ - lib/userlist/rails/extensions/company.rb
182
+ - lib/userlist/rails/extensions/event.rb
183
+ - lib/userlist/rails/extensions/relationship.rb
184
+ - lib/userlist/rails/extensions/user.rb
185
+ - lib/userlist/rails/helpers.rb
149
186
  - lib/userlist/rails/importer.rb
150
187
  - lib/userlist/rails/logger.rb
151
- - lib/userlist/rails/push.rb
152
188
  - lib/userlist/rails/railtie.rb
153
- - lib/userlist/rails/user.rb
189
+ - lib/userlist/rails/tasks/userlist.rake
190
+ - lib/userlist/rails/transform.rb
191
+ - lib/userlist/rails/transforms/company.rb
192
+ - lib/userlist/rails/transforms/relationship.rb
193
+ - lib/userlist/rails/transforms/user.rb
154
194
  - lib/userlist/rails/version.rb
155
195
  - userlist-rails.gemspec
156
196
  homepage: https://github.com/userlistio/userlist-rails
157
197
  licenses:
158
198
  - MIT
159
199
  metadata: {}
160
- post_install_message:
200
+ post_install_message:
161
201
  rdoc_options: []
162
202
  require_paths:
163
203
  - lib
@@ -165,15 +205,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
165
205
  requirements:
166
206
  - - ">="
167
207
  - !ruby/object:Gem::Version
168
- version: '0'
208
+ version: '2.4'
169
209
  required_rubygems_version: !ruby/object:Gem::Requirement
170
210
  requirements:
171
211
  - - ">="
172
212
  - !ruby/object:Gem::Version
173
213
  version: '0'
174
214
  requirements: []
175
- rubygems_version: 3.0.3
176
- signing_key:
215
+ rubygems_version: 3.1.4
216
+ signing_key:
177
217
  specification_version: 4
178
- summary: Rails integration for Userlist.io
218
+ summary: Rails integration for Userlist
179
219
  test_files: []
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.5.0
7
- before_install: gem install bundler -v 1.17.1
@@ -1,39 +0,0 @@
1
- require 'active_support/concern'
2
- require 'userlist/push'
3
-
4
- module Userlist
5
- module Rails
6
- module Company
7
- extend ActiveSupport::Concern
8
-
9
- included do
10
- method = [:after_commit, :after_save].find { |m| respond_to?(m) }
11
- public_send(method, :userlist_push) if method
12
- end
13
-
14
- def userlist_identifier
15
- "#{self.class.name}-#{id}".parameterize
16
- end
17
-
18
- def userlist_properties
19
- {}
20
- end
21
-
22
- def userlist_payload
23
- {
24
- identifier: userlist_identifier,
25
- name: userlist_name,
26
- properties: userlist_properties
27
- }
28
- end
29
-
30
- def userlist_name
31
- return name if respond_to?(:name)
32
- end
33
-
34
- def userlist_push
35
- Userlist::Push.company(userlist_payload)
36
- end
37
- end
38
- end
39
- end
@@ -1,39 +0,0 @@
1
- module Userlist
2
- module Rails
3
- module Push
4
- def event(payload = {})
5
- payload[:user] ||= Userlist::Rails.current_user
6
-
7
- super(transform_payload(payload))
8
- end
9
- alias track event
10
-
11
- def user(payload = {})
12
- super(transform_payload(payload))
13
- end
14
- alias identify user
15
-
16
- private
17
-
18
- def transform_payload(payload)
19
- payload = transform_value(payload)
20
-
21
- return payload unless payload.is_a?(Hash)
22
-
23
- payload.transform_values do |value|
24
- result = transform_value(value)
25
- result = transform_payload(result) if result.is_a?(Hash)
26
- result
27
- end
28
- end
29
-
30
- def transform_value(value)
31
- if value.respond_to?(:userlist_payload)
32
- value.send(:userlist_payload)
33
- else
34
- value
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,45 +0,0 @@
1
- require 'active_support/concern'
2
- require 'userlist/push'
3
-
4
- module Userlist
5
- module Rails
6
- module User
7
- extend ActiveSupport::Concern
8
-
9
- included do
10
- method = [:after_commit, :after_save].find { |m| respond_to?(m) }
11
- public_send(method, :userlist_push) if method
12
- end
13
-
14
- def userlist_identifier
15
- "#{self.class.name}-#{id}".parameterize
16
- end
17
-
18
- def userlist_properties
19
- {}
20
- end
21
-
22
- def userlist_email
23
- return email if respond_to?(:email)
24
- end
25
-
26
- def userlist_company
27
- nil
28
- end
29
-
30
- def userlist_payload
31
- {
32
- identifier: userlist_identifier,
33
- email: userlist_email,
34
- company: userlist_company,
35
- properties: userlist_properties,
36
- signed_up_at: created_at
37
- }
38
- end
39
-
40
- def userlist_push
41
- Userlist::Push.user(userlist_payload)
42
- end
43
- end
44
- end
45
- end