userlist 0.8.0 → 0.9.0

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: ee98b5cd1e17b91ed12fce427d0c87ec4593da547349015ca4ed9272dba73100
4
- data.tar.gz: 3ec9d567b7c8c1894841483cd136c76db4e1a667eac7101541fcd3d232b20a8f
3
+ metadata.gz: 569696fa5acbb7f0c5520aff129c6418666e4006039e128dbbe97590a74d10ae
4
+ data.tar.gz: 73a0880766c7e8a17f9a0cae70eb07afdef8a202202f4ab17d4888d8e3ea459f
5
5
  SHA512:
6
- metadata.gz: 68340e08984d801834f1f853102119df452da6455bdca3b1eedf0d743d829c750fc81e234ef661f964402e44173b9951a891f15cb9ed0665929d525fbd0b03df
7
- data.tar.gz: 1d6e7976d2e5486506306b2623135b4addf4cb7c6b6f3c3d81e30fde6d4fb733eb9d289027812ae6390d82b0b7cf4a5742104b0496d88372b0e720a8ed89402d
6
+ metadata.gz: 9f63af4821d7d61af74c0c593ce97a597a6aa1c647b3d61b81fd69e9973daa4d9aedb6cc2a5744bb6fbae2170814e7955e3ff97b59a216146ecf1254be84cc35
7
+ data.tar.gz: 8ec2008d7bf08e60b0d4dc0f43586e9dc62a17dea20f8c704efd8d186236683c4b2a4fd624b99f839247ef22d255f23bf258282d7ea52e7cfe31bcf97171b556
data/CHANGELOG.md ADDED
@@ -0,0 +1,91 @@
1
+ # Userlist for Ruby Changelog
2
+
3
+ ## v0.9.0 (2024-03-19)
4
+
5
+ - Allows deleteing resources by using other identifiers (like email)
6
+ - Relaxes requirement for providing associations. Incomplete resources will not be pushed anyways.
7
+ - Improves checks for whether a resource is pushable or not
8
+ - Fixes a typo in the occurred_at attribute of events while maintaining backwards compatibility
9
+
10
+ ## v0.8.1 (2023-11-30)
11
+
12
+ - Fixes issue with customizability of push? and delete? methods on events and relationships
13
+
14
+ ## v0.8.0 (2023-08-02)
15
+
16
+ - Adds a ActiveJob push strategy
17
+ - Adds support for retries of failed requests
18
+ - Adds response logging to the push client
19
+ - Adds support for payloads on delete requests
20
+
21
+ ## v0.7.2 (2022-10-20)
22
+
23
+ - Improves connection handling between requests
24
+ - Improves handling of arguments passed to Sidekiq
25
+
26
+ ## v0.7.1 (2022-02-10)
27
+
28
+ - Fixes issue with Sidekiq payloads (#4)
29
+
30
+ ## v0.7.0 (2022-02-02)
31
+
32
+ - Allows users without an identifier but with an email address
33
+
34
+ ## v0.6.0 (2021-05-14)
35
+
36
+ - Automatically manage one side of the relationships
37
+ - Always requires a user and a company on relationships
38
+
39
+ ## v0.5.0 (2021-01-22)
40
+
41
+ - Adds support for relationships
42
+ - Adds support for company events
43
+ - Adds support for skipping certain operations
44
+ - Adds lazy lookup for push strategies
45
+ - Adds a Sidekiq push strategy
46
+ - Allow numerics as identifiers
47
+ - Improves Userlist::Token to work with more than just strings
48
+ - Improves the way resources are serialized
49
+ - Improves JSON serialization
50
+ - Replaces userlist.io with userlist.com
51
+ - Require at least Ruby 2.4
52
+
53
+ ## v0.4.1 (2020-03-16)
54
+
55
+ - Fixes a problem when configuring the client (#1)
56
+
57
+ ## v0.4.0 (2020-03-06)
58
+
59
+ - Adds improved error messages for configuration errors
60
+ - Adds support for user token generation
61
+ - Require at least Ruby 2.3
62
+
63
+ ## v0.3.0 (2019-06-27)
64
+
65
+ - Adds additional aliases for the create method
66
+ - Adds resource models for User, Company, and Event
67
+ - Adds a more flexible interface to the push client
68
+ - Adds more HTTP methods to the push client
69
+
70
+ ## v0.2.2 (2019-03-18)
71
+
72
+ - Adds support for Ruby 2.2
73
+
74
+ ## v0.2.1 (2019-03-13)
75
+
76
+ - Adds support for Ruby 2.3
77
+
78
+ ## v0.2.0 (2018-11-21)
79
+
80
+ - Adds the ability to adjust the configuration
81
+ - Adds convenience class methods to Userlist::Push
82
+ - Adds track and identify aliases for event and user push methods
83
+ - Adds null strategy that discards everything for testing purposes
84
+ - Adds logging support
85
+ - Adds threaded push strategy to deliver requests without blocking the main thread
86
+ - Adds Userlist::Push as a nicer interface to the push endpoint
87
+ - Require at least Ruby 2.1
88
+
89
+ ## v0.1.0 (2018-01-18)
90
+
91
+ - Initial release
@@ -11,13 +11,6 @@ module Userlist
11
11
  has_many :relationships, type: 'Userlist::Push::Relationship', inverse: :company
12
12
  has_many :users, type: 'Userlist::Push::User'
13
13
  has_one :user, type: 'Userlist::Push::User'
14
-
15
- def initialize(payload = {}, config = Userlist.config)
16
- raise Userlist::ArgumentError, 'Missing required payload hash' unless payload
17
- raise Userlist::ArgumentError, 'Missing required parameter :identifier' unless payload[:identifier]
18
-
19
- super
20
- end
21
14
  end
22
15
  end
23
16
  end
@@ -9,17 +9,14 @@ module Userlist
9
9
  def initialize(payload = {}, config = Userlist.config)
10
10
  raise Userlist::ArgumentError, 'Missing required payload' unless payload
11
11
  raise Userlist::ArgumentError, 'Missing required parameter :name' unless payload[:name]
12
- raise Userlist::ArgumentError, 'Missing required parameter :user or :company' unless payload[:user] || payload[:company]
13
12
 
14
- super
15
- end
13
+ payload[:occurred_at] ||= payload[:occured_at] || Time.now
16
14
 
17
- def occured_at
18
- payload[:occured_at] || Time.now
15
+ super
19
16
  end
20
17
 
21
18
  def push?
22
- (user.nil? || user.push?) && (company.nil? || company.push?)
19
+ super && (user || company) && (user.nil? || user.push?) && (company.nil? || company.push?)
23
20
  end
24
21
  end
25
22
  end
@@ -6,7 +6,7 @@ module Userlist
6
6
  def delete(payload = {}, config = self.config)
7
7
  return false unless resource = from_payload(payload, config)
8
8
 
9
- strategy.call(:delete, resource.url) if resource.delete?
9
+ strategy.call(:delete, endpoint, resource) if resource.delete?
10
10
  end
11
11
  end
12
12
 
@@ -7,23 +7,8 @@ module Userlist
7
7
  has_one :user, type: 'Userlist::Push::User'
8
8
  has_one :company, type: 'Userlist::Push::Company'
9
9
 
10
- def initialize(payload = {}, config = Userlist.config)
11
- raise Userlist::ArgumentError, 'Missing required payload' unless payload
12
- raise Userlist::ArgumentError, 'Missing required parameter :user' unless payload[:user]
13
- raise Userlist::ArgumentError, 'Missing required parameter :company' unless payload[:company]
14
-
15
- super
16
- end
17
-
18
- def url
19
- raise Userlist::Error, "Cannot generate url for #{self.class.name} without a user" unless user
20
- raise Userlist::Error, "Cannot generate url for #{self.class.name} without a company" unless company
21
-
22
- "#{self.class.endpoint}/#{user.identifier}/#{company.identifier}"
23
- end
24
-
25
10
  def push?
26
- user&.push? && company&.push?
11
+ super && user&.push? && company&.push?
27
12
  end
28
13
  end
29
14
  end
@@ -61,6 +61,8 @@ module Userlist
61
61
  attr_reader :payload, :config
62
62
 
63
63
  def initialize(payload = {}, config = Userlist.config)
64
+ raise Userlist::ArgumentError, 'Missing required payload' unless payload
65
+
64
66
  @payload = payload
65
67
  @config = config
66
68
  end
@@ -79,10 +81,6 @@ module Userlist
79
81
  to_hash.to_json(*args)
80
82
  end
81
83
 
82
- def url
83
- "#{self.class.endpoint}/#{identifier}"
84
- end
85
-
86
84
  def identifier
87
85
  payload[:identifier]
88
86
  end
@@ -7,13 +7,6 @@ module Userlist
7
7
  has_many :relationships, type: 'Userlist::Push::Relationship', inverse: :user
8
8
  has_many :companies, type: 'Userlist::Push::Company'
9
9
  has_one :company, type: 'Userlist::Push::Company'
10
-
11
- def initialize(payload = {}, config = Userlist.config)
12
- raise Userlist::ArgumentError, 'Missing required payload' unless payload
13
- raise Userlist::ArgumentError, 'Missing required parameter :identifier or :email' unless payload[:identifier] || payload[:email]
14
-
15
- super
16
- end
17
10
  end
18
11
  end
19
12
  end
@@ -1,3 +1,3 @@
1
1
  module Userlist
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.9.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: userlist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benedikt Deicke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-02 00:00:00.000000000 Z
11
+ date: 2024-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -91,6 +91,7 @@ files:
91
91
  - ".gitignore"
92
92
  - ".rspec"
93
93
  - ".rubocop.yml"
94
+ - CHANGELOG.md
94
95
  - CODE_OF_CONDUCT.md
95
96
  - Gemfile
96
97
  - Guardfile
@@ -147,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
148
  - !ruby/object:Gem::Version
148
149
  version: '0'
149
150
  requirements: []
150
- rubygems_version: 3.4.6
151
+ rubygems_version: 3.5.3
151
152
  signing_key:
152
153
  specification_version: 4
153
154
  summary: Ruby wrapper for the Userlist API