ruby_branch 0.2.0 → 1.0.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
- SHA1:
3
- metadata.gz: b84f50702fdfb01cb7a33b4ebb33ce549dac9ba9
4
- data.tar.gz: e7774df26bfc7714928729b4edf44f603947d7da
2
+ SHA256:
3
+ metadata.gz: 603d8d0e81395449ce310acdae3359af3f12479191e7f80ffb8f046967740dc9
4
+ data.tar.gz: 6b9b82683e7d2d5890135fc10137572e2e36257bdd8d152a9018e9f72d0081b0
5
5
  SHA512:
6
- metadata.gz: b11727d831a98553dfd119634ab49c787736c4047d553fbc20c8505501f8e47e17b6e536a8f833f0e228cc304f0d655429cbb0e1f46009d06d647fb9d9cb54fe
7
- data.tar.gz: b197e4ce4b2ef3815cffbcc3e1570dc60a9d7aadcf80afe1c8eb83bb8d49d55d0bbd2958426822590096b8fb6317baa61db605dcb530ea2edc7fdf031990482f
6
+ metadata.gz: 10956485e8922b268106b94b3dcf225d8054e7e9111b2b382c60d5d220e48d06ef6f5fcfbd014c172c5a3fb91d9b1f51f9ffb620063c4ead4dada9f4066d41ca
7
+ data.tar.gz: '094b6bcc29c50477ce24a0fbd312942f67a13bb783f567ec9297c81736c7f2d7054664ad2b5d705f6f09e274e4dd35ebe27b6645db902fd54d3afb7168e671fc'
data/.gitignore CHANGED
@@ -7,6 +7,7 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
10
11
 
11
12
  # rspec failure tracking
12
13
  .rspec_status
data/.travis.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.3.0
5
4
  - 2.4.0
6
- before_install: gem install bundler -v 1.14.6
5
+ - 2.7.1
6
+ - 3.0.1
7
+ before_install: gem install bundler
data/README.md CHANGED
@@ -50,6 +50,9 @@ Methods:
50
50
  # Update existing link through branch api
51
51
  link.update(url: url, analytics: {}, data: {}, settings: {})
52
52
 
53
+ # Delete link
54
+ link.delete(url: url)
55
+
53
56
  ## Development
54
57
 
55
58
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -20,6 +20,14 @@ module RubyBranch
20
20
  Response.new(response)
21
21
  end
22
22
 
23
+ def delete(resource)
24
+ response = connection.delete do |request|
25
+ request.url resource
26
+ request.headers['Content-Type'] = 'application/json'
27
+ end
28
+ Response.new(response)
29
+ end
30
+
23
31
  def connection
24
32
  @connection ||=
25
33
  Faraday.new(url: BRANCH_API_ENDPOINT) do |connection|
@@ -38,6 +38,15 @@ module RubyBranch
38
38
  false
39
39
  end
40
40
 
41
+ def delete(url:)
42
+ response = do_delete_request(url)
43
+
44
+ return true if response.success?
45
+
46
+ process_error(response)
47
+ false
48
+ end
49
+
41
50
  def build(analytics: {}, data: {}, settings: {})
42
51
  params = {}
43
52
  params.merge!(prepare_analytics(analytics))
@@ -66,6 +75,11 @@ module RubyBranch
66
75
  request.put("v1/url?url=#{url}", request_body.to_json)
67
76
  end
68
77
 
78
+ def do_delete_request(url)
79
+ request = Request.new
80
+ request.delete("v1/url?url=#{url}")
81
+ end
82
+
69
83
  def build_request_body(analytics, settings, data)
70
84
  body = { branch_key: RubyBranch.config.api_key, branch_secret: RubyBranch.config.secret_key }
71
85
  body.merge! prepare_analytics(analytics)
@@ -1,3 +1,3 @@
1
1
  module RubyBranch
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '1.0.0'.freeze
3
3
  end
data/ruby_branch.gemspec CHANGED
@@ -32,9 +32,9 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency "faraday"
33
33
  spec.add_dependency "addressable"
34
34
 
35
- spec.add_development_dependency "bundler", "~> 1.14"
36
- spec.add_development_dependency "rake", "~> 10.0"
37
- spec.add_development_dependency "rspec", "~> 3.0"
35
+ spec.add_development_dependency "bundler"
36
+ spec.add_development_dependency "rake"
37
+ spec.add_development_dependency "rspec"
38
38
  spec.add_development_dependency "rubocop"
39
39
  spec.add_development_dependency "webmock"
40
40
  spec.add_development_dependency "pry"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_branch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Morskov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-20 00:00:00.000000000 Z
11
+ date: 2021-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -42,44 +42,44 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.14'
47
+ version: '0'
48
48
  type: :development
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: '1.14'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '3.0'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '3.0'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -155,7 +155,7 @@ licenses:
155
155
  - MIT
156
156
  metadata:
157
157
  allowed_push_host: https://rubygems.org
158
- post_install_message:
158
+ post_install_message:
159
159
  rdoc_options: []
160
160
  require_paths:
161
161
  - lib
@@ -170,9 +170,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  requirements: []
173
- rubyforge_project:
174
- rubygems_version: 2.6.13
175
- signing_key:
173
+ rubygems_version: 3.1.2
174
+ signing_key:
176
175
  specification_version: 4
177
176
  summary: Ruby client for https://branch.io API
178
177
  test_files: []