firebase_dynamic_link 0.1.3 → 1.0.4

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
- SHA1:
3
- metadata.gz: 7bbe6a0cad3172b77570b15cff0e5b0f2fe7f269
4
- data.tar.gz: ca41acc8781f8df96553abce36c10a4a17b3cf17
2
+ SHA256:
3
+ metadata.gz: 8ab11d4a89e7db50a374e53454e1d065b7cfc6d066beceab4f8145ac51c93933
4
+ data.tar.gz: e779c35872bfc268e79482b94c6f095f6bbd3fa6dd807e174fed29b3fcbd77db
5
5
  SHA512:
6
- metadata.gz: db1298ece8caed00932db3a5a0e3d6182e2c1284f797fc92635eccb9aa02c79c3da00bf00383928a6376c28532fecd22bfe36068b953179083ca3d95aba20920
7
- data.tar.gz: d3b9e410ffb53da8e8b759ffe15bdd89e5764a2e5b1d104f699c3ddfc64a0328fa92e2963bc64cba32617768393f7ec140a39229bb5ae31c14b963ffb39294fd
6
+ metadata.gz: 1377a22e552150f5a0f25a98a3a55008331d98a485b47d13cb4ce506226d4fd3f003f686d0a475f128f174f96ff2471b82b88e0308c77c24e89e6159b4572a0b
7
+ data.tar.gz: 643222e3a24ad3162c4e6ba6720bc54aa595e356e54b3a4116c109f80f7fbbc62290d6bf43001d47d815d0f19e3a54e9b4e09cea09b1c6877054eaadfcd9fec1
data/.gitignore CHANGED
@@ -13,3 +13,4 @@
13
13
  spec/fixtures/vcr_cassettes/
14
14
  coverage
15
15
  doc
16
+ Gemfile.lock
@@ -3,3 +3,144 @@ Metrics/BlockLength:
3
3
  - 'Rakefile'
4
4
  - '**/*.rake'
5
5
  - 'spec/**/*.rb'
6
+
7
+ # Prefer &&/|| over and/or.
8
+ Style/AndOr:
9
+ Enabled: true
10
+
11
+ # Do not use braces for hash literals when they are the last argument of a
12
+ # method call.
13
+ Style/BracesAroundHashParameters:
14
+ Enabled: true
15
+ EnforcedStyle: context_dependent
16
+
17
+ # Align `when` with `case`.
18
+ Layout/CaseIndentation:
19
+ Enabled: true
20
+
21
+ # Align comments with method definitions.
22
+ Layout/CommentIndentation:
23
+ Enabled: true
24
+
25
+ Layout/ElseAlignment:
26
+ Enabled: true
27
+
28
+ # Align `end` with the matching keyword or starting expression except for
29
+ # assignments, where it should be aligned with the LHS.
30
+ Layout/EndAlignment:
31
+ Enabled: true
32
+ EnforcedStyleAlignWith: variable
33
+ AutoCorrect: true
34
+
35
+ Layout/EmptyLineAfterMagicComment:
36
+ Enabled: true
37
+
38
+ # In a regular class definition, no empty lines around the body.
39
+ Layout/EmptyLinesAroundClassBody:
40
+ Enabled: true
41
+
42
+ # In a regular method definition, no empty lines around the body.
43
+ Layout/EmptyLinesAroundMethodBody:
44
+ Enabled: true
45
+
46
+ # In a regular module definition, no empty lines around the body.
47
+ Layout/EmptyLinesAroundModuleBody:
48
+ Enabled: true
49
+
50
+ Layout/FirstParameterIndentation:
51
+ Enabled: true
52
+
53
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
54
+ Style/HashSyntax:
55
+ Enabled: true
56
+
57
+ # Two spaces, no tabs (for indentation).
58
+ Layout/IndentationWidth:
59
+ Enabled: true
60
+
61
+ Layout/LeadingCommentSpace:
62
+ Enabled: true
63
+
64
+ Layout/SpaceAfterColon:
65
+ Enabled: true
66
+
67
+ Layout/SpaceAfterComma:
68
+ Enabled: true
69
+
70
+ Layout/SpaceAroundEqualsInParameterDefault:
71
+ Enabled: true
72
+
73
+ Layout/SpaceAroundKeyword:
74
+ Enabled: true
75
+
76
+ Layout/SpaceAroundOperators:
77
+ Enabled: true
78
+
79
+ Layout/SpaceBeforeComma:
80
+ Enabled: true
81
+
82
+ Layout/SpaceBeforeFirstArg:
83
+ Enabled: true
84
+
85
+ Style/DefWithParentheses:
86
+ Enabled: true
87
+
88
+ # Defining a method with parameters needs parentheses.
89
+ Style/MethodDefParentheses:
90
+ Enabled: true
91
+
92
+ Style/FrozenStringLiteralComment:
93
+ Enabled: true
94
+ EnforcedStyle: always
95
+
96
+ # Use `foo {}` not `foo{}`.
97
+ Layout/SpaceBeforeBlockBraces:
98
+ Enabled: true
99
+
100
+ # Use `foo { bar }` not `foo {bar}`.
101
+ Layout/SpaceInsideBlockBraces:
102
+ Enabled: true
103
+
104
+ # Use `{ a: 1 }` not `{a:1}`.
105
+ Layout/SpaceInsideHashLiteralBraces:
106
+ Enabled: true
107
+
108
+ Layout/SpaceInsideParens:
109
+ Enabled: true
110
+
111
+ # Check quotes usage according to lint rule below.
112
+ Style/StringLiterals:
113
+ Enabled: true
114
+ EnforcedStyle: double_quotes
115
+
116
+ # Detect hard tabs, no hard tabs.
117
+ Layout/Tab:
118
+ Enabled: true
119
+
120
+ # Blank lines should not have any spaces.
121
+ Layout/TrailingBlankLines:
122
+ Enabled: true
123
+
124
+ # No trailing whitespace.
125
+ Layout/TrailingWhitespace:
126
+ Enabled: true
127
+
128
+ # Use quotes for string literals when they are enough.
129
+ Style/UnneededPercentQ:
130
+ Enabled: true
131
+
132
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
133
+ Lint/RequireParentheses:
134
+ Enabled: true
135
+
136
+ Style/RedundantReturn:
137
+ Enabled: true
138
+ AllowMultipleReturnValues: true
139
+
140
+ Style/Semicolon:
141
+ Enabled: true
142
+ AllowAsExpressionSeparator: true
143
+
144
+ # Prefer Foo.method over Foo::method
145
+ Style/ColonMethodCall:
146
+ Enabled: true
@@ -1,13 +1,14 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2
4
3
  - 2.3
5
4
  - 2.4
5
+ - 2.5
6
+ - 2.6
6
7
  gemfile:
7
- - gemfiles/version_2016.gemfile
8
- - gemfiles/version_2017a.gemfile
9
- - gemfiles/version_2017b.gemfile
10
- - gemfiles/version_2018.gemfile
8
+ - gemfiles/version_2018.gemfile
9
+ - gemfiles/version_2017b.gemfile
10
+ - gemfiles/version_2017a.gemfile
11
+ - gemfiles/version_2020.gemfile
11
12
  env:
12
13
  global:
13
14
  - CC_TEST_REPORTER_ID=22b531be7956bd878ec8ce211da98c483c9724eebc8eb72f99d064f00aa6e985
@@ -18,4 +19,6 @@ before_script:
18
19
  script:
19
20
  - COVERAGE=1 bundle exec rspec
20
21
  after_script:
21
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
22
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
23
+ before_install:
24
+ - gem install bundler
data/Appraisals CHANGED
@@ -1,19 +1,21 @@
1
- appraise 'version-2018' do
2
- gem 'dry-configurable', '0.7.0'
3
- gem 'faraday', '0.14.0'
1
+ # frozen_string_literal: true
2
+
3
+ appraise "version-2018" do
4
+ gem "dry-configurable", "0.7.0"
5
+ gem "faraday", "0.14.0"
4
6
  end
5
7
 
6
- appraise 'version-2017b' do
7
- gem 'dry-configurable', '0.6.0'
8
- gem 'faraday', '0.11.0'
8
+ appraise "version-2017b" do
9
+ gem "dry-configurable", "0.6.0"
10
+ gem "faraday", "0.11.0"
9
11
  end
10
12
 
11
- appraise 'version-2017a' do
12
- gem 'dry-configurable', '0.6.0'
13
- gem 'faraday', '0.10.1'
13
+ appraise "version-2017a" do
14
+ gem "dry-configurable", "0.6.0"
15
+ gem "faraday", "0.10.1"
14
16
  end
15
17
 
16
- appraise 'version-2016' do
17
- gem 'dry-configurable', '0.5.0'
18
- gem 'faraday', '0.9.2'
18
+ appraise "version-2020" do
19
+ gem "dry-configurable", "0.11.6"
20
+ gem "faraday", "1.0.1"
19
21
  end
data/Gemfile CHANGED
@@ -1,6 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
6
 
5
7
  # Specify your gem's dependencies in firebase_dynamic_link.gemspec
6
8
  gemspec
9
+
10
+ # group :development do
11
+ # gem 'guard'
12
+ # gem 'guard-rspec'
13
+ # end
@@ -0,0 +1,70 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Note: The cmd option is now required due to the increasing number of ways
19
+ # rspec may be run, below are examples of the most common uses.
20
+ # * bundler: 'bundle exec rspec'
21
+ # * bundler binstubs: 'bin/rspec'
22
+ # * spring: 'bin/rspec' (This will use spring if running and you have
23
+ # installed the spring binstubs per the docs)
24
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
25
+ # * 'just' rspec: 'rspec'
26
+
27
+ guard :rspec, cmd: "bundle exec rspec" do
28
+ require "guard/rspec/dsl"
29
+ dsl = Guard::RSpec::Dsl.new(self)
30
+
31
+ # Feel free to open issues for suggestions and improvements
32
+
33
+ # RSpec files
34
+ rspec = dsl.rspec
35
+ watch(rspec.spec_helper) { rspec.spec_dir }
36
+ watch(rspec.spec_support) { rspec.spec_dir }
37
+ watch(rspec.spec_files)
38
+
39
+ # Ruby files
40
+ ruby = dsl.ruby
41
+ dsl.watch_spec_files_for(ruby.lib_files)
42
+
43
+ # Rails files
44
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
45
+ dsl.watch_spec_files_for(rails.app_files)
46
+ dsl.watch_spec_files_for(rails.views)
47
+
48
+ watch(rails.controllers) do |m|
49
+ [
50
+ rspec.spec.call("routing/#{m[1]}_routing"),
51
+ rspec.spec.call("controllers/#{m[1]}_controller"),
52
+ rspec.spec.call("acceptance/#{m[1]}")
53
+ ]
54
+ end
55
+
56
+ # Rails config changes
57
+ watch(rails.spec_helper) { rspec.spec_dir }
58
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
59
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
60
+
61
+ # Capybara features specs
62
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
63
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
64
+
65
+ # Turnip features and steps
66
+ watch(%r{^spec/acceptance/(.+)\.feature$})
67
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
68
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
69
+ end
70
+ end
data/README.md CHANGED
@@ -1,3 +1,21 @@
1
+
2
+ <!-- vim-markdown-toc GFM -->
3
+
4
+ + [FirebaseDynamicLink](#firebasedynamiclink)
5
+ - [Information](#information)
6
+ * [Installation](#installation)
7
+ * [Usage](#usage)
8
+ - [Configure the HTTP client](#configure-the-http-client)
9
+ - [Shorten a link](#shorten-a-link)
10
+ - [Shorten parameters](#shorten-parameters)
11
+ * [CHANGES](#changes)
12
+ * [Development](#development)
13
+ * [Contributing](#contributing)
14
+ * [License](#license)
15
+ * [Code of Conduct](#code-of-conduct)
16
+
17
+ <!-- vim-markdown-toc -->
18
+
1
19
  # FirebaseDynamicLink
2
20
 
3
21
  [![Build Status](https://travis-ci.org/saiqulhaq/firebase_dynamic_link.svg?branch=master)](https://travis-ci.org/saiqulhaq/firebase_dynamic_link)
@@ -9,13 +27,17 @@ Opiniated Ruby Firebase Dynamic Links Short Links client
9
27
 
10
28
  based on reference https://firebase.google.com/docs/reference/dynamic-links/link-shortener
11
29
 
30
+ This library is considered complete and in maintenance mode. New features will be added if Firebase Dynamic Links released new updates
31
+
32
+ ### Information
33
+ Travis CI build is failing because dry-configurable v0.11 is not compatible with
34
+ Ruby 2.3. However Bundler will install lower version if your ruby is 2.3. So there is nothing to worry about
35
+
12
36
  ## Installation
13
37
 
14
38
  Add this line to your application's Gemfile:
15
39
 
16
- ```ruby
17
- gem 'firebase_dynamic_link'
18
- ```
40
+ gem 'firebase_dynamic_link'
19
41
 
20
42
  And then execute:
21
43
 
@@ -30,74 +52,115 @@ Or install it yourself as:
30
52
  ### Configure the HTTP client
31
53
 
32
54
  ```ruby
33
- FirebaseDynamicLink.configure do |config|
34
- # the adapter should be supported by Faraday
35
- # more info look at https://github.com/lostisland/faraday/tree/master/test/adapters
36
- # Faraday.default_adapter is the default adapter
37
- config.adapter = :httpclient
55
+ FirebaseDynamicLink.configure do |config|
56
+ # the adapter should be supported by Faraday
57
+ # more info look at https://github.com/lostisland/faraday/tree/master/test/adapters
58
+ # Faraday.default_adapter is the default adapter
59
+ config.adapter = :httpclient
38
60
 
39
- # required
40
- config.api_key = 'API_KEY'
61
+ # required
62
+ config.api_key = 'API_KEY'
41
63
 
42
- # default 'UNGUESSABLE'
43
- config.default.suffix.option = 'SHORT' or 'UNGUESSABLE'
64
+ # default 'UNGUESSABLE'
65
+ config.suffix_option = 'SHORT' or 'UNGUESSABLE'
44
66
 
45
- # required
46
- config.default.dynamic_link_domain = 'http://xyz.app.goo.gl'
67
+ # required
68
+ config.dynamic_link_domain = 'https://xyz.app.goo.gl'
47
69
 
48
- # default 3 seconds
49
- config.timeout = 3
70
+ # default 3 seconds
71
+ config.timeout = 3
50
72
 
51
- # default 3 seconds
52
- config.open_timeout = 3
53
- end
73
+ # default 3 seconds
74
+ config.open_timeout = 3
75
+ end
76
+ ```
77
+
78
+ ### Shorten a link
79
+
80
+ ```ruby
81
+ client = FirebaseDynamicLink::Client.new
82
+ link = "http://domain.com/path/path"
83
+ options = {
84
+ # optional, to override default suffix default config
85
+ suffix_option: '',
54
86
 
55
- client = FirebaseDynamicLink::Client.new
56
- options = {
57
- # optional, to override default suffix default config
58
- suffix_option: '',
87
+ # optional, to override default dynamic_link_domain default config
88
+ dynamic_link_domain: '',
59
89
 
60
- # optional, to override default dynamic_link_domain default config
61
- dynamic_link_domain: '',
90
+ # optional, timeout of each request of this instance
91
+ timeout: 10,
62
92
 
63
- # optional, timeout of each request of this instance
64
- timeout: 10,
93
+ # optional, open timeout of each request of this instance
94
+ open_timeout: 10
95
+ }
65
96
 
66
- # optional, open timeout of each request of this instance
67
- open_timeout: 10
68
- }
97
+ # options argument is optional
98
+ result = client.shorten_link(link, options)
99
+ ```
69
100
 
70
- # options argument is optional
71
- result = client.shorten_link(link, options)
101
+ ### Shorten parameters
72
102
 
103
+ ```ruby
104
+ client = FirebaseDynamicLink::Client.new
105
+ options = {
106
+ # optional, to override default suffix default config
107
+ suffix_option: '',
108
+
109
+ # optional, to override default dynamic_link_domain default config
110
+ dynamic_link_domain: '',
111
+
112
+ # optional, timeout of each request of this instance
113
+ timeout: 10,
114
+
115
+ # optional, open timeout of each request of this instance
116
+ open_timeout: 10
117
+ }
118
+
119
+ parameters = {
120
+ link: link,
121
+ android_info: {
122
+ android_package_name: name,
123
+ }
124
+ ios_info: {},
125
+ navigation_info: {},
126
+ analytics_info: {},
127
+ social_meta_tag_info: {}
128
+ }
129
+
130
+ # options argument is optional
131
+ result = client.shorten_parameters(parameters, options)
73
132
  ```
74
133
 
75
134
  if request successful, then the result should be like following hash object
76
135
 
136
+ or if the request reached daily quota, client will throw `FirebaseDynamicLink::QuotaExceeded` error
137
+
77
138
  ```ruby
78
- {
79
- :link=>"https://--.app.goo.gl/ukph",
80
- :preview_link=>"https://--.app.goo.gl/ukph?d=1",
81
- :warning=>[
82
- {
83
- "warningCode"=>"UNRECOGNIZED_PARAM",
84
- "warningMessage"=>"..."},
85
- {
86
- "warningCode"=>"..."
87
- },
88
- {
89
- "warningCode"=>"..."
90
- }
91
- ]
92
- }
139
+ {
140
+ :link=>"https://--.app.goo.gl/ukph",
141
+ :preview_link=>"https://--.app.goo.gl/ukph?d=1",
142
+ :warning=>[
143
+ {
144
+ "warningCode"=>"UNRECOGNIZED_PARAM",
145
+ "warningMessage"=>"..."},
146
+ {
147
+ "warningCode"=>"..."
148
+ },
149
+ {
150
+ "warningCode"=>"..."
151
+ }
152
+ ]
153
+ }
93
154
  ```
94
155
 
95
- otherwise it raises `FirebaseDynamicLink::ConnectionError`, with message = http error message
156
+ otherwise it will throw `FirebaseDynamicLink::ConnectionError` error, with message = http error message
157
+
158
+ ## CHANGES
96
159
 
97
- # NOTE
160
+ VERSION:
98
161
 
99
- this gem only implemented to shorten long dynamic link til now, next version is supposed to
100
- be able shorten a JSON object
162
+ * 1.0.3
163
+ Update Dry-configurable dependencies to version 0.6.0
101
164
 
102
165
  ## Development
103
166