inova_dynamic_link 0.1.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88f1da587f441baa45f5b9e555ab0cc6dff6043962e6885a2b2ad8ad5ae386e6
4
- data.tar.gz: a49f6a6e519d25ed6f061b85b861f1ae7801fe2e21ef14462199ecfa64d87a25
3
+ metadata.gz: a18b50f839234c7774d2baea703f0fb8f1f8fb8d1bafadbda88455d4c721bcc8
4
+ data.tar.gz: e5d56b02c670d08a80bf7ee270837e70762c776f34f887ae6618e46af53f29b3
5
5
  SHA512:
6
- metadata.gz: 812f27a66b5550c9274f10457870e12f8b79c53f84288eabe1b5a10abbb6dcc3bac8a50108a2d2c52f547d330fcff5b9cd02d9a80cad53cd1c8fef51f58036c8
7
- data.tar.gz: bf0bc77d53f7db828044c2c40a4ba6a0540cb2748e930cd47c1903e1bb84994d641fc80ab729eb9c0e56d5795db308ea0eb9e546cb1bd68b2e0498e25a07890c
6
+ metadata.gz: 2a8e325cf2a4f8fde80dd17e314498d3fde1f1dca5c7a2c3ef101d65f6b09a4a7bd0c755a3cdc334ba2ca1bef7abd1de206bdeddd8a110dcec0a0fb5a1bcdfe4
7
+ data.tar.gz: 9146fe7ed23432122147b55814ce778d342ff897766b3b6f60947576284da5318fd954153a1ec4047dd2683bbc9d40212fa4872055b0a1b0b829221518b02f35
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.2.0] - 2024-01-10
2
+
3
+ - Return an array of urls from dynamic link bulk_create
4
+
1
5
  ## [0.1.0] - 2024-01-09
2
6
 
3
7
  - Initial release
data/README.md CHANGED
@@ -7,13 +7,13 @@ InovaDynamicLink is a Ruby gem designed to streamline interactions with the Bran
7
7
  To integrate InovaDynamicLink into your project, add the following line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'inova_dynamic_link', '~> 0.1.0'
10
+ gem 'inova_dynamic_link', '~> 0.2.0'
11
11
  ```
12
12
 
13
13
  Or, install the gem directly using the following command:
14
14
 
15
15
  ```bash
16
- gem install inova_dynamic_link -v 0.1.0
16
+ gem install inova_dynamic_link -v 0.2.0
17
17
  ```
18
18
 
19
19
  ## Requirements
@@ -79,7 +79,7 @@ You can retrieve a dynamic link using the following method:
79
79
 
80
80
  ```ruby
81
81
  url_to_check = "https://your.dynamic.link/url"
82
- response = branch.get(url_to_check)
82
+ response = InovaDynamicLink::Branch.get(url_to_check)
83
83
  puts "Dynamic Link Information: #{response}"
84
84
  ```
85
85
 
@@ -89,7 +89,7 @@ You can delete a dynamic link using the following method:
89
89
 
90
90
  ```ruby
91
91
  url_to_delete = "<https://your.dynamic.link/to/delete>"
92
- result = branch.delete(url_to_delete)
92
+ result = InovaDynamicLink::Branch.delete(url_to_delete)
93
93
  puts "Delete Dynamic Link Result: #{result}"
94
94
  ```
95
95
 
@@ -105,7 +105,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
105
105
 
106
106
  ## Contributing
107
107
 
108
- Bug reports and pull requests are welcome on GitHub at <https://github.com/[ahmedmos3ad]/inova_dynamic_link>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[ahmedmos3ad]/inova_dynamic_link/blob/master/CODE_OF_CONDUCT.md).
108
+ Bug reports and pull requests are welcome on GitHub at <https://github.com/ahmedmos3ad/inova_dynamic_link>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ahmedmos3ad/inova_dynamic_link/blob/master/CODE_OF_CONDUCT.md).
109
109
 
110
110
  ## License
111
111
 
@@ -25,7 +25,7 @@ module InovaDynamicLink
25
25
  def create(branch_link_configuration)
26
26
  raise ArgumentError, "argument must be a InovaDynamicLink::BranchLinkConfiguration" unless branch_link_configuration.is_a?(InovaDynamicLink::BranchLinkConfiguration)
27
27
  body = {
28
- branch_key: @branch_key,
28
+ branch_key: @branch_key
29
29
  }.merge(branch_link_configuration.to_hash)
30
30
 
31
31
  response = HTTParty.post(BRANCH_URI, headers: DEFAULT_HEADERS, body: body.to_json)
@@ -34,6 +34,7 @@ module InovaDynamicLink
34
34
  raise HTTParty::ResponseError, json_resp unless response.code == 200
35
35
  json_resp["url"]
36
36
  end
37
+
37
38
  # branch_link_configuration_array is an array of InovaDynamicLink::BranchLinkConfiguration
38
39
  def bulk_create(branch_link_configuration_array)
39
40
  branch_link_configuration_array = [branch_link_configuration_array].compact_blank unless branch_link_configuration_array.is_a?(Array)
@@ -41,10 +42,10 @@ module InovaDynamicLink
41
42
  unless branch_link_configuration_array.all? { |o| o.is_a?(InovaDynamicLink::BranchLinkConfiguration) }
42
43
  raise ArgumentError, "argument must be an array of InovaDynamicLink::BranchLinkConfiguration"
43
44
  end
44
- config_hash_array = branch_link_configuration_array.map{|config| config.to_hash}
45
+ config_hash_array = branch_link_configuration_array.map { |config| config.to_hash }
45
46
  response = HTTParty.post(BRANCH_URI + "/bulk/" + @branch_key, headers: DEFAULT_HEADERS, body: config_hash_array.to_json)
46
47
  raise HTTParty::ResponseError, response unless response.code == 200
47
- JSON.parse(response.body)
48
+ JSON.parse(response.body).map { |resp| resp["url"] }
48
49
  end
49
50
 
50
51
  def get(url)
@@ -12,9 +12,10 @@ module InovaDynamicLink
12
12
  tags: {},
13
13
  type: 0,
14
14
  duration: 7200,
15
+ extra_data: {},
15
16
  **attributes
16
17
  }
17
- raise ArgumentError, "extra_data must be a hash" if attributes[:extra_data] && !attributes[:extra_data].is_a?(Hash)
18
+ raise ArgumentError, "extra_data must be a hash" unless attributes[:extra_data].is_a?(Hash)
18
19
  attributes.each do |key, value|
19
20
  if respond_to?(:"#{key}=")
20
21
  send(:"#{key}=", value)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InovaDynamicLink
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inova_dynamic_link
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmed Mos`ad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -51,7 +51,6 @@ files:
51
51
  - LICENSE.txt
52
52
  - README.md
53
53
  - Rakefile
54
- - inova_dynamic_link.gemspec
55
54
  - lib/generators/inova_dynamic_link/install_generator.rb
56
55
  - lib/generators/inova_dynamic_link/templates/inova_dynamic_link_initializer.rb
57
56
  - lib/inova_dynamic_link.rb
@@ -84,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
83
  - !ruby/object:Gem::Version
85
84
  version: '0'
86
85
  requirements: []
87
- rubygems_version: 3.3.7
86
+ rubygems_version: 3.5.4
88
87
  signing_key:
89
88
  specification_version: 4
90
89
  summary: Ruby gem to manage dynamic links using branch.io.
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/inova_dynamic_link/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "inova_dynamic_link"
7
- spec.version = InovaDynamicLink::VERSION
8
- spec.authors = ["Ahmed Mos`ad"]
9
- spec.email = ["ahmed.mosad@inovaeg.com"]
10
-
11
- spec.summary = "Ruby gem to manage dynamic links using branch.io."
12
- spec.homepage = "https://github.com/ahmedmos3ad/inova_dynamic_link"
13
- spec.license = "MIT"
14
- spec.required_ruby_version = ">= 3.1.2"
15
- spec.add_dependency "rails", ">= 6.1"
16
- spec.add_dependency "httparty", "~> 0.21.0"
17
-
18
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
19
-
20
- spec.metadata["homepage_uri"] = spec.homepage
21
- spec.metadata["source_code_uri"] = "https://github.com/ahmedmos3ad/inova_dynamic_link"
22
- spec.metadata["changelog_uri"] = "https://github.com/ahmedmos3ad/inova_dynamic_link/blob/master/CHANGELOG.md"
23
-
24
- # Specify which files should be added to the gem when it is released.
25
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
- spec.files = Dir.chdir(__dir__) do
27
- `git ls-files -z`.split("\x0").reject do |f|
28
- (File.expand_path(f) == __FILE__) ||
29
- f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
30
- end
31
- end
32
- spec.bindir = "exe"
33
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
34
- spec.require_paths = ["lib"]
35
-
36
- # Uncomment to register a new dependency of your gem
37
- # spec.add_dependency "example-gem", "~> 1.0"
38
-
39
- # For more information and examples about making a new gem, check out our
40
- # guide at: https://bundler.io/guides/creating_gem.html
41
- end