hey-you-nexmo 0.1.3 → 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
2
  SHA256:
3
- metadata.gz: b5c5b0b927d563e4a8d7973bf44d49150a6ba372ef8770ec0819e5935389818b
4
- data.tar.gz: 88d17bc775a17cc4c3ce99e5dce8457d8a1f1ec22e999407f3aaf15affb0bb6a
3
+ metadata.gz: 0d2b060c07cc2b98ae45999e1d8de1bf801c8333824a1d335d0835ce52a7b292
4
+ data.tar.gz: c565cb6c024f0f73015206cacd8f7ebfd34dd3c2d5b2bf8dc9649fab18ebf31e
5
5
  SHA512:
6
- metadata.gz: 8c02d221854af19e687ddbbfafb85001ade1dafeb4ad726225a1a418cb5a9612a99cc063dae2eb0a57ef315749e84bb4539401ddf0a6b35d50ee5074542159df
7
- data.tar.gz: 5d0a133bdcc254088c474a3fb9474ac248e7eebe7a913924bc9a0f35e8c5ac8e8b894a31862825877d7dc20c1642ceb87367b8c3363001096be65aee94e9ae74
6
+ metadata.gz: 065df62f070cd4de88069e4fe971fc69a0d8ae375699c2bba458ffe3cedabf28ee523d412046c107d2f99f3fe518962bf4be6b58edc287a5a2afdf847014fb47
7
+ data.tar.gz: 83cc0036b2d0b6f8b4e8d3ce076394d18064901ab87c8b888d2afa17851e1cb2d08b96c881b9ad0294c8d8db1a3b1a82d29605703a40355c7a8e4fdeaffe72a1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog for hey-you-nexmo gem
2
2
 
3
+ ### 1.0.0
4
+ **BREAKING**:
5
+ - Improvement: Migration from nexmo gem to vonage gem.
6
+ ---
7
+ - Feature: new option `google_autofill_code_hash` for builder
8
+
3
9
  ### 0.1.2
4
10
  - Feature: new `response_handler` configuration for processing `Nexmo::Build` object
5
11
 
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
  [![Build Status](https://travis-ci.com/QNester/hey-you-nexmo.svg?branch=master)](https://travis-ci.com/QNester/hey-you-nexmo#)
3
3
  [![Gem Version](https://badge.fury.io/rb/hey-you-nexmo.svg)](https://badge.fury.io/rb/hey-you-nexmo)
4
4
 
5
- Send Nexmo sms via [hey-you gem](https://github.com/QNester/hey-you). This gem depended on [nexmo-ruby](https://github.com/Nexmo/nexmo-ruby).
5
+ Send Nexmo sms via [hey-you gem](https://github.com/QNester/hey-you).
6
+ This gem depended on [nexmo-ruby](https://github.com/Nexmo/nexmo-ruby) until version 1.0.0.
7
+ After 1.0.0 version gem depended on [vonage-ruby-sdk](https://github.com/Vonage/vonage-ruby-sdk).
6
8
 
7
9
  ## Installation
8
10
 
@@ -42,13 +44,13 @@ HeyYou::Config.configure do
42
44
  # [String] required - your sender number
43
45
  config.nexmo.from = 'myNumber'
44
46
 
45
- # [Nexmo::Client] required - Instance of Nexmo client (check https://github.com/Nexmo/nexmo-ruby for more info)
46
- config.nexmo.client = Nexmo::Client.new(...)
47
+ # [Vonage::Client] required - Instance of Nexmo client (check https://github.com/Nexmo/nexmo-ruby for more info)
48
+ config.nexmo.client = Vonage::Client.new(...)
47
49
 
48
50
  # [Boolean] optional - If you will send unicode texts
49
51
  config.nexmo.is_unicode = true
50
52
 
51
- # [Block] optional - Response handle (block which accept Nexmo::Response object)
53
+ # [Block] optional - Response handle (block which accept Vonage::Response object)
52
54
  config.nexmo.response_hander = proc { |response| CheckActualBalanceJob.perform_async(response.http_response.body) }
53
55
 
54
56
  # Check https://developer.nexmo.com/api/sms#delivery-receipt for more info about settings below
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
 
27
27
  spec.add_runtime_dependency "hey-you", '>= 1.2'
28
- spec.add_runtime_dependency "nexmo", '~> 7.1'
28
+ spec.add_runtime_dependency "vonage", '~> 7.4'
29
29
 
30
30
  spec.add_development_dependency "rake", "~> 13.0"
31
31
  spec.add_development_dependency "rspec", "~> 3.0"
@@ -2,9 +2,14 @@ module HeyYou
2
2
  class Builder
3
3
  class Nexmo < Base
4
4
  attr_reader :text, :from, :is_unicode
5
+ LINE_BREAKS_BEFORE_AUTOFILL_HASH = 2
5
6
 
6
7
  def build
7
8
  @text = interpolate(ch_data.fetch('text'), options)
9
+ if options[:google_autofill_code_hash]
10
+ @text << "\n" * (options[:line_breaks_before_hash] || LINE_BREAKS_BEFORE_AUTOFILL_HASH)
11
+ @text << "#{options[:google_autofill_code_hash]}"
12
+ end
8
13
  @from = ch_data.fetch('from', nil)
9
14
  @is_unicode = ch_data.fetch('is_unicode', false)
10
15
  rescue KeyError => e
@@ -1,4 +1,4 @@
1
- require 'nexmo'
1
+ require 'vonage'
2
2
 
3
3
  module HeyYou
4
4
  module Channels
@@ -26,7 +26,7 @@ module HeyYou
26
26
  config.nexmo.response_handler.call(result) if config.nexmo.response_handler
27
27
 
28
28
  result
29
- rescue ::Nexmo::Error => e
29
+ rescue ::Vonage::Error => e
30
30
  fail ResponseError, e
31
31
  end
32
32
 
@@ -1,3 +1,3 @@
1
1
  module HeyYouNexmo
2
- VERSION = "0.1.3"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hey-you-nexmo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Nesterov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-26 00:00:00.000000000 Z
11
+ date: 2021-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hey-you
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: nexmo
28
+ name: vonage
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '7.1'
33
+ version: '7.4'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '7.1'
40
+ version: '7.4'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -124,7 +124,7 @@ metadata:
124
124
  homepage_uri: https://github.com/QNester/hey-you-nexmo
125
125
  source_code_uri: https://github.com/QNester/hey-you-nexmo
126
126
  changelog_uri: https://github.com/QNester/hey-you-nexmo/blob/master/CHANGELOG.md
127
- post_install_message:
127
+ post_install_message:
128
128
  rdoc_options: []
129
129
  require_paths:
130
130
  - lib
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubygems_version: 3.1.2
143
- signing_key:
143
+ signing_key:
144
144
  specification_version: 4
145
145
  summary: Nexmo SMS sender via `hey-you`
146
146
  test_files: []