userlist-rails 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -4
- data/.rspec +2 -1
- data/CHANEGLOG.md +73 -0
- data/Gemfile +7 -2
- data/README.md +2 -2
- data/lib/userlist/rails/importer.rb +10 -3
- data/lib/userlist/rails/version.rb +1 -1
- data/lib/userlist/rails.rb +1 -1
- data/userlist-rails.gemspec +2 -8
- metadata +11 -107
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa029bf122f3f49769fb1a618bb41a1d6da63994bceb98e214a92cdd36f80a30
|
4
|
+
data.tar.gz: '0097422a814d7321137ea008846e37999355f065bf016ac8fe3e7b9be9fc2466'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a61a015fa3f0b673766568a6093698163eb5a1cee9dd10217c071b487f6a88c64acaefc28ee85ef432336e8e51aa5d189746fb78c395cf347cdfdb194bae6119
|
7
|
+
data.tar.gz: c8d6c754bbe733e2863aeed4708299740b9fca1e6ac1461a9731a45a60b90cd621b2aeecf85a2f8917e20889b5c9beeefd9f14fb080536a85a37436bd2db0ae5
|
data/.github/workflows/test.yml
CHANGED
data/.rspec
CHANGED
data/CHANEGLOG.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Userlist for Ruby on Rails Changelog
|
2
|
+
|
3
|
+
## v0.6.2 (2023-11-30)
|
4
|
+
|
5
|
+
- Upgrades dependencies
|
6
|
+
|
7
|
+
## v0.6.1 (2021-05-14)
|
8
|
+
|
9
|
+
- Upgrades dependencies
|
10
|
+
|
11
|
+
## v0.6.0 (2021-05-14)
|
12
|
+
|
13
|
+
- Improves handling of relationships across different setups (1:1, 1:n, and n:m)
|
14
|
+
- Automatically call userlist_* methods on models in transforms
|
15
|
+
|
16
|
+
## v0.5.3 (2021-04-15)
|
17
|
+
|
18
|
+
- Makes userlist_push? and userlist_delete? methods work as documented
|
19
|
+
|
20
|
+
## v0.5.2 (2021-02-12)
|
21
|
+
|
22
|
+
- Only detect classes as models
|
23
|
+
|
24
|
+
## v0.5.1 (2021-01-22)
|
25
|
+
|
26
|
+
- Adds deprecation warnings for user and company models
|
27
|
+
- Adds documentation about tracking companies and relationships
|
28
|
+
|
29
|
+
## v0.5.0 (2021-01-22)
|
30
|
+
|
31
|
+
- Adds support for relationships between users and companies
|
32
|
+
- Allows setting of global company for events
|
33
|
+
- Improves reliablity of callback initializations
|
34
|
+
- Don’t extend the user and company model anymore
|
35
|
+
- Log errors when pushing instead of raising them
|
36
|
+
- Introduced transforms to wrap models as payloads
|
37
|
+
- Replaces userlist.io with userlist.com
|
38
|
+
- Require at least Ruby 2.3
|
39
|
+
- Upgrades dependencies
|
40
|
+
|
41
|
+
## v0.4.0 (2020-03-10)
|
42
|
+
|
43
|
+
- Adds helper method for adding the Userlist script tag
|
44
|
+
- Require at least Ruby 2.3
|
45
|
+
|
46
|
+
## v0.3.0 (2019-06-27)
|
47
|
+
|
48
|
+
- Use Userlist::Push::Resources to transform payloads
|
49
|
+
- Upgrades dependencies
|
50
|
+
|
51
|
+
|
52
|
+
## v0.2.2 (2019-03-18)
|
53
|
+
|
54
|
+
- Adds support for Ruby 2.2
|
55
|
+
|
56
|
+
## v0.2.1 (2019-03-13)
|
57
|
+
|
58
|
+
- Use an explicit method for callbacks instead of just a block
|
59
|
+
- Adds note about test and development environments
|
60
|
+
|
61
|
+
## v0.2.0 (2018-11-21)
|
62
|
+
|
63
|
+
- Adds basic documentation
|
64
|
+
- Adds support for global defintion of current user
|
65
|
+
- Use created_at as signed_up_at for users
|
66
|
+
- Use global push instance instead of creating one for each model
|
67
|
+
- Properly prepare models in rake tasks
|
68
|
+
- Properly setup models after reloads
|
69
|
+
- Upgrades dependencies
|
70
|
+
|
71
|
+
## v0.1.0 (2018-01-18)
|
72
|
+
|
73
|
+
- Initial release
|
data/Gemfile
CHANGED
@@ -4,7 +4,12 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
gem 'userlist', github: 'userlist/userlist-ruby', branch: 'master'
|
8
|
-
|
9
7
|
gem 'guard-rspec', '~> 4.7'
|
10
8
|
gem 'guard-rubocop', '~> 1.3'
|
9
|
+
|
10
|
+
gem 'activerecord', '>= 5.0'
|
11
|
+
gem 'actionpack', '>= 5.0'
|
12
|
+
gem 'rake', '~> 13.0'
|
13
|
+
gem 'rspec', '~> 3.0'
|
14
|
+
gem 'rspec-rails', '~> 6.0'
|
15
|
+
gem 'sqlite3', '>= 1.4'
|
data/README.md
CHANGED
@@ -265,10 +265,10 @@ end
|
|
265
265
|
|
266
266
|
#### Deleting relationships
|
267
267
|
|
268
|
-
It's also possible to delete a relationship from Userlist, using the `Userlist::Push.
|
268
|
+
It's also possible to delete a relationship from Userlist, using the `Userlist::Push.relationships.delete` method.
|
269
269
|
|
270
270
|
```ruby
|
271
|
-
Userlist::Push.
|
271
|
+
Userlist::Push.relationships.delete(membership)
|
272
272
|
```
|
273
273
|
|
274
274
|
### Tracking Events
|
@@ -8,9 +8,9 @@ module Userlist
|
|
8
8
|
|
9
9
|
def import(model, &block)
|
10
10
|
find_each(model) do |record|
|
11
|
-
print "Pushing #{model.name} #{record.id}..."
|
12
|
-
instance_exec(record, &block)
|
13
|
-
|
11
|
+
print "Pushing #{model.name} #{record.id}... "
|
12
|
+
result = instance_exec(record, &block)
|
13
|
+
puts status(result)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -31,6 +31,13 @@ module Userlist
|
|
31
31
|
raise "Cannot iterate over #{model} because it doesn't implement .find_each, nor .each"
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
def status(result)
|
36
|
+
return '⊝' if result.nil?
|
37
|
+
return '✔' if (200..300).cover?(result.code.to_i)
|
38
|
+
|
39
|
+
'✗'
|
40
|
+
end
|
34
41
|
end
|
35
42
|
end
|
36
43
|
end
|
data/lib/userlist/rails.rb
CHANGED
@@ -83,7 +83,7 @@ module Userlist
|
|
83
83
|
relation = Userlist::Push.public_send(scope)
|
84
84
|
relation.public_send(method, self)
|
85
85
|
rescue Userlist::Error => e
|
86
|
-
Userlist.logger.error "Failed to #{method} #{
|
86
|
+
Userlist.logger.error "Failed to #{method} #{scope.to_s.singularize}: #{e.message}"
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
data/userlist-rails.gemspec
CHANGED
@@ -23,13 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.add_dependency 'activesupport', '>= 5.0'
|
25
25
|
spec.add_dependency 'railties', '>= 5.0'
|
26
|
-
spec.add_dependency 'userlist', '~> 0.
|
26
|
+
spec.add_dependency 'userlist', '~> 0.8', '>= 0.8.1'
|
27
27
|
|
28
|
-
spec.
|
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'
|
32
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
33
|
-
spec.add_development_dependency 'rspec-rails', '~> 3.0'
|
34
|
-
spec.add_development_dependency 'sqlite3', '>= 1.4'
|
28
|
+
spec.metadata = { 'rubygems_mfa_required' => 'true' }
|
35
29
|
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.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benedikt Deicke
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -44,118 +44,20 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
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'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: bundler
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '1.15'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
47
|
+
version: '0.8'
|
94
48
|
- - ">="
|
95
49
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
97
|
-
|
98
|
-
name: rake
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '12.3'
|
104
|
-
- - ">="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: 12.3.3
|
107
|
-
type: :development
|
108
|
-
prerelease: false
|
109
|
-
version_requirements: !ruby/object:Gem::Requirement
|
110
|
-
requirements:
|
111
|
-
- - "~>"
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
version: '12.3'
|
114
|
-
- - ">="
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: 12.3.3
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: rspec
|
119
|
-
requirement: !ruby/object:Gem::Requirement
|
120
|
-
requirements:
|
121
|
-
- - "~>"
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
version: '3.0'
|
124
|
-
type: :development
|
125
|
-
prerelease: false
|
126
|
-
version_requirements: !ruby/object:Gem::Requirement
|
127
|
-
requirements:
|
128
|
-
- - "~>"
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
version: '3.0'
|
131
|
-
- !ruby/object:Gem::Dependency
|
132
|
-
name: rspec-rails
|
133
|
-
requirement: !ruby/object:Gem::Requirement
|
134
|
-
requirements:
|
135
|
-
- - "~>"
|
136
|
-
- !ruby/object:Gem::Version
|
137
|
-
version: '3.0'
|
138
|
-
type: :development
|
50
|
+
version: 0.8.1
|
51
|
+
type: :runtime
|
139
52
|
prerelease: false
|
140
53
|
version_requirements: !ruby/object:Gem::Requirement
|
141
54
|
requirements:
|
142
55
|
- - "~>"
|
143
56
|
- !ruby/object:Gem::Version
|
144
|
-
version: '
|
145
|
-
- !ruby/object:Gem::Dependency
|
146
|
-
name: sqlite3
|
147
|
-
requirement: !ruby/object:Gem::Requirement
|
148
|
-
requirements:
|
149
|
-
- - ">="
|
150
|
-
- !ruby/object:Gem::Version
|
151
|
-
version: '1.4'
|
152
|
-
type: :development
|
153
|
-
prerelease: false
|
154
|
-
version_requirements: !ruby/object:Gem::Requirement
|
155
|
-
requirements:
|
57
|
+
version: '0.8'
|
156
58
|
- - ">="
|
157
59
|
- !ruby/object:Gem::Version
|
158
|
-
version:
|
60
|
+
version: 0.8.1
|
159
61
|
description:
|
160
62
|
email:
|
161
63
|
- benedikt@userlist.com
|
@@ -167,6 +69,7 @@ files:
|
|
167
69
|
- ".gitignore"
|
168
70
|
- ".rspec"
|
169
71
|
- ".rubocop.yml"
|
72
|
+
- CHANEGLOG.md
|
170
73
|
- CODE_OF_CONDUCT.md
|
171
74
|
- Gemfile
|
172
75
|
- Guardfile
|
@@ -197,7 +100,8 @@ files:
|
|
197
100
|
homepage: https://github.com/userlistio/userlist-rails
|
198
101
|
licenses:
|
199
102
|
- MIT
|
200
|
-
metadata:
|
103
|
+
metadata:
|
104
|
+
rubygems_mfa_required: 'true'
|
201
105
|
post_install_message:
|
202
106
|
rdoc_options: []
|
203
107
|
require_paths:
|
@@ -213,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
117
|
- !ruby/object:Gem::Version
|
214
118
|
version: '0'
|
215
119
|
requirements: []
|
216
|
-
rubygems_version: 3.
|
120
|
+
rubygems_version: 3.4.21
|
217
121
|
signing_key:
|
218
122
|
specification_version: 4
|
219
123
|
summary: Rails integration for Userlist
|