amplitude-api 0.3.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.md CHANGED
@@ -3,6 +3,12 @@
3
3
  We would like to think our many [contributors](https://github.com/toothrot/amplitude-api/graphs/contributors) for
4
4
  suggestions, ideas and improvements to Amplitude API.
5
5
 
6
+ ## 0.4.0 (2022-04-28)
7
+ * Increases required Ruby version to supported ones. Minimum Ruby version is now 2.7
8
+ * Allows using version 2 of Faraday
9
+ * Upgrades development dependencies
10
+ * Adds more Rubocop rules
11
+
6
12
  ## 0.3.3 (2021-02-24)
7
13
  * Relaxes Faraday dependency
8
14
 
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  source "https://rubygems.org"
3
4
  gemspec
@@ -20,8 +20,10 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_development_dependency "pry", "~> 0.12.2"
23
- spec.add_development_dependency "rake", "~> 12.0", ">= 12.0"
24
- spec.add_development_dependency "rspec", "~> 2.99", ">= 2.99.0"
25
- spec.add_dependency "faraday", "~> 1.0"
26
- spec.required_ruby_version = ">= 2.4"
23
+ spec.add_development_dependency "rake", ">= 13.0.6", "< 14.0"
24
+ spec.add_development_dependency "rspec", ">= 3.11.0", "< 4.0"
25
+ spec.add_development_dependency "rubocop", ">= 1.28.2", "< 2.0"
26
+ spec.add_development_dependency "rubocop-rspec", ">= 2.10.0", "< 3.0"
27
+ spec.add_dependency "faraday", ">= 1.0", "< 3.0"
28
+ spec.required_ruby_version = ">= 2.7"
27
29
  end
@@ -39,13 +39,13 @@ class AmplitudeAPI
39
39
 
40
40
  def create_setter(attribute_name)
41
41
  self.class.send(:define_method, "#{attribute_name}=".to_sym) do |value|
42
- instance_variable_set("@" + attribute_name.to_s, value)
42
+ instance_variable_set("@#{attribute_name}", value)
43
43
  end
44
44
  end
45
45
 
46
46
  def create_getter(attribute_name)
47
47
  self.class.send(:define_method, attribute_name.to_sym) do
48
- instance_variable_get("@" + attribute_name.to_s)
48
+ instance_variable_get("@#{attribute_name}")
49
49
  end
50
50
  end
51
51
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class AmplitudeAPI
4
- VERSION = "0.3.3"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/amplitude_api.rb CHANGED
@@ -189,7 +189,7 @@ class AmplitudeAPI
189
189
  amplitude_ids = Array(amplitude_ids)
190
190
 
191
191
  faraday = Faraday.new do |conn|
192
- conn.basic_auth config.api_key, config.secret_key
192
+ conn.request :basic_auth, config.api_key, config.secret_key
193
193
  end
194
194
 
195
195
  faraday.post(
@@ -432,7 +432,7 @@ describe AmplitudeAPI do
432
432
  end
433
433
 
434
434
  describe ".delete" do
435
- let(:connection) { instance_double("Faraday::Connection", post: nil, basic_auth: nil) }
435
+ let(:connection) { instance_double("Faraday::Connection", post: nil, request: nil) }
436
436
 
437
437
  before do
438
438
  allow(Faraday).to receive(:new).and_yield(connection).and_return(connection)
@@ -445,7 +445,7 @@ describe AmplitudeAPI do
445
445
 
446
446
  described_class.delete(user_ids: "123")
447
447
 
448
- expect(connection).to have_received(:basic_auth).with(api_key, secret_key)
448
+ expect(connection).to have_received(:request).with(:basic_auth, api_key, secret_key)
449
449
  end
450
450
 
451
451
  it "sends the requester" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amplitude-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rakoczy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2022-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -30,54 +30,100 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '12.0'
34
- - - "~>"
33
+ version: 13.0.6
34
+ - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '12.0'
36
+ version: '14.0'
37
37
  type: :development
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: '12.0'
44
- - - "~>"
43
+ version: 13.0.6
44
+ - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '12.0'
46
+ version: '14.0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 2.99.0
54
- - - "~>"
53
+ version: 3.11.0
54
+ - - "<"
55
55
  - !ruby/object:Gem::Version
56
- version: '2.99'
56
+ version: '4.0'
57
57
  type: :development
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 2.99.0
64
- - - "~>"
63
+ version: 3.11.0
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: '4.0'
67
+ - !ruby/object:Gem::Dependency
68
+ name: rubocop
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 1.28.2
74
+ - - "<"
75
+ - !ruby/object:Gem::Version
76
+ version: '2.0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: 1.28.2
84
+ - - "<"
85
+ - !ruby/object:Gem::Version
86
+ version: '2.0'
87
+ - !ruby/object:Gem::Dependency
88
+ name: rubocop-rspec
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: 2.10.0
94
+ - - "<"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ type: :development
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: 2.10.0
104
+ - - "<"
65
105
  - !ruby/object:Gem::Version
66
- version: '2.99'
106
+ version: '3.0'
67
107
  - !ruby/object:Gem::Dependency
68
108
  name: faraday
69
109
  requirement: !ruby/object:Gem::Requirement
70
110
  requirements:
71
- - - "~>"
111
+ - - ">="
72
112
  - !ruby/object:Gem::Version
73
113
  version: '1.0'
114
+ - - "<"
115
+ - !ruby/object:Gem::Version
116
+ version: '3.0'
74
117
  type: :runtime
75
118
  prerelease: false
76
119
  version_requirements: !ruby/object:Gem::Requirement
77
120
  requirements:
78
- - - "~>"
121
+ - - ">="
79
122
  - !ruby/object:Gem::Version
80
123
  version: '1.0'
124
+ - - "<"
125
+ - !ruby/object:Gem::Version
126
+ version: '3.0'
81
127
  description: Provides an integration for sending events to Amplitude
82
128
  email:
83
129
  - arakoczy@gmail.com
@@ -95,7 +141,6 @@ files:
95
141
  - LICENSE
96
142
  - Rakefile
97
143
  - amplitude-api.gemspec
98
- - lib/amplitude-api.rb
99
144
  - lib/amplitude_api.rb
100
145
  - lib/amplitude_api/config.rb
101
146
  - lib/amplitude_api/event.rb
@@ -118,14 +163,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
163
  requirements:
119
164
  - - ">="
120
165
  - !ruby/object:Gem::Version
121
- version: '2.4'
166
+ version: '2.7'
122
167
  required_rubygems_version: !ruby/object:Gem::Requirement
123
168
  requirements:
124
169
  - - ">="
125
170
  - !ruby/object:Gem::Version
126
171
  version: '0'
127
172
  requirements: []
128
- rubygems_version: 3.0.8
173
+ rubygems_version: 3.1.6
129
174
  signing_key:
130
175
  specification_version: 4
131
176
  summary: Send events to the Amplitude API
data/lib/amplitude-api.rb DELETED
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "amplitude_api"