tww 0.6.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +3 -3
- data/lib/tww.rb +9 -5
- data/lib/tww/client.rb +4 -7
- data/lib/tww/config.rb +2 -12
- data/lib/tww/version.rb +1 -1
- data/tww.gemspec +5 -5
- metadata +14 -14
- data/.rubocop.yml +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 32e10ec80b7df759f3d4d16eb8d6fbd0e663c907
|
4
|
+
data.tar.gz: ed821ffd3d523b5ed15db1bb5fafb19be32ad8ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d910d375287b139891a6b1e048f7e040bdcc6f90511fefcaa85793f4c5f6668b0147baddfc8181210f3ba7a6ba1fbd0ed69bc5f53251aa670efff8edd69537aa
|
7
|
+
data.tar.gz: 3d61587f8b38abf2cc2b4f6e83b0aba59b791037a81e18eb137930532e3f518646a22138cb2f619b62e6765f01f19dd77316bb1292f476dea0877269f78b86bc
|
data/.travis.yml
CHANGED
data/lib/tww.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
require 'tww/version'
|
4
2
|
require 'tww/config'
|
5
3
|
require 'tww/client'
|
@@ -10,20 +8,26 @@ module TWW
|
|
10
8
|
class << self
|
11
9
|
def config
|
12
10
|
@config ||= Config.new
|
13
|
-
@config.tap { |config|
|
11
|
+
@config.tap { |config| yield(config) if block_given? }
|
14
12
|
end
|
15
13
|
|
16
|
-
def client
|
17
|
-
@factory.new
|
14
|
+
def client
|
15
|
+
@client ||= @factory.new
|
18
16
|
end
|
19
17
|
|
20
18
|
def enable_testing!
|
19
|
+
reset_client
|
21
20
|
@factory = TWW::Testing
|
22
21
|
end
|
23
22
|
|
24
23
|
def disable_testing!
|
24
|
+
reset_client
|
25
25
|
@factory = TWW::REST
|
26
26
|
end
|
27
|
+
|
28
|
+
def reset_client
|
29
|
+
@client = nil
|
30
|
+
end
|
27
31
|
end
|
28
32
|
|
29
33
|
disable_testing!
|
data/lib/tww/client.rb
CHANGED
@@ -1,14 +1,11 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
require 'tww/response'
|
4
2
|
|
5
3
|
module TWW
|
6
4
|
class Client
|
7
5
|
attr_reader :config, :sent
|
8
6
|
|
9
|
-
def initialize
|
10
|
-
@config = config
|
11
|
-
@sent = []
|
7
|
+
def initialize
|
8
|
+
@config, @sent = TWW.config, []
|
12
9
|
end
|
13
10
|
|
14
11
|
def clear!
|
@@ -19,11 +16,11 @@ module TWW
|
|
19
16
|
sent.size
|
20
17
|
end
|
21
18
|
|
22
|
-
def deliver(
|
19
|
+
def deliver(phone, message, extras = {})
|
23
20
|
raise 'Need to be implemented'
|
24
21
|
end
|
25
22
|
|
26
|
-
def call(
|
23
|
+
def call(phone, message, extras = {})
|
27
24
|
raise 'Need to be implemented'
|
28
25
|
end
|
29
26
|
end
|
data/lib/tww/config.rb
CHANGED
@@ -1,13 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module TWW
|
4
|
-
Config = Struct.new(:username, :password, :from, :layout) do
|
5
|
-
def merge(attributes = {})
|
6
|
-
attributes.empty? ? self : dup.copy(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
def copy(attributes)
|
10
|
-
tap { attributes.each { |k, v| self[k] = v } }
|
11
|
-
end
|
12
|
-
end
|
1
|
+
class TWW::Config
|
2
|
+
attr_accessor :username, :password, :from, :layout
|
13
3
|
end
|
data/lib/tww/version.rb
CHANGED
data/tww.gemspec
CHANGED
@@ -21,10 +21,10 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.required_ruby_version = '>= 2.1.0'
|
22
22
|
spec.add_dependency 'rest-client', '~> 2.0'
|
23
23
|
|
24
|
-
spec.add_development_dependency 'bundler', '~>
|
25
|
-
spec.add_development_dependency 'rake', '~>
|
26
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
27
|
-
spec.add_development_dependency 'cucumber', '~>
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.11'
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
26
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
27
|
+
spec.add_development_dependency 'cucumber', '~> 2.0'
|
28
28
|
spec.add_development_dependency 'coveralls', '~> 0.8.0'
|
29
|
-
spec.add_development_dependency 'webmock', '~>
|
29
|
+
spec.add_development_dependency 'webmock', '~> 1.0'
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tww
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Libanori
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -30,56 +30,56 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '1.11'
|
34
34
|
type: :development
|
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: '
|
40
|
+
version: '1.11'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '10.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: '
|
54
|
+
version: '10.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
61
|
+
version: '3.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: '3.
|
68
|
+
version: '3.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: cucumber
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2.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: '
|
82
|
+
version: '2.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: coveralls
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '1.0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '1.0'
|
111
111
|
description:
|
112
112
|
email:
|
113
113
|
- daniellibanori@gmail.com
|
@@ -117,7 +117,6 @@ extra_rdoc_files: []
|
|
117
117
|
files:
|
118
118
|
- ".gitignore"
|
119
119
|
- ".rspec"
|
120
|
-
- ".rubocop.yml"
|
121
120
|
- ".travis.yml"
|
122
121
|
- Gemfile
|
123
122
|
- LICENSE.txt
|
@@ -152,7 +151,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
151
|
- !ruby/object:Gem::Version
|
153
152
|
version: '0'
|
154
153
|
requirements: []
|
155
|
-
|
154
|
+
rubyforge_project:
|
155
|
+
rubygems_version: 2.6.11
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: Send SMS from TWW provider
|
data/.rubocop.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
Style/Documentation:
|
2
|
-
Enabled: false
|
3
|
-
|
4
|
-
Style/HashEachMethods:
|
5
|
-
Enabled: true
|
6
|
-
|
7
|
-
Style/HashTransformKeys:
|
8
|
-
Enabled: true
|
9
|
-
|
10
|
-
Style/HashTransformValues:
|
11
|
-
Enabled: true
|
12
|
-
|
13
|
-
Lint/RaiseException:
|
14
|
-
Enabled: true
|
15
|
-
|
16
|
-
Lint/StructNewOverride:
|
17
|
-
Enabled: true
|