cellular 1.1.0 → 1.2.0
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 +4 -4
- data/README.md +7 -1
- data/lib/cellular/configuration.rb +2 -0
- data/lib/cellular/models/sms.rb +3 -3
- data/lib/cellular/version.rb +1 -1
- data/spec/cellular/configuration_spec.rb +7 -0
- data/spec/cellular/models/sms_spec.rb +31 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2b557a411a9a042061ab2725cc29921a353cf55
|
4
|
+
data.tar.gz: b3c248d7b158b41ce1015f68431b395e1c278db8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4cf9e5c7b6b22d90ed3cc99d60fbb9d44051d6e789b33463136bfceeaf0202ce012a248a946e07a3ef4892d1fa699dab57b8d557027a3b921cbc252aa360ca7
|
7
|
+
data.tar.gz: 0850f3123d23661353059947a672e2a56ba5774d2e90b2e0d856fd5658a3dd55f5be341092bf2bf4259d31230b13b183fcb9eff460aeedc98d4eb6bfd9589680
|
data/README.md
CHANGED
@@ -37,6 +37,7 @@ Cellular.configure do |config|
|
|
37
37
|
config.username = 'username'
|
38
38
|
config.password = 'password'
|
39
39
|
config.backend = Cellular::Backends::Sendega
|
40
|
+
config.sender = 'Default custom sender'
|
40
41
|
end
|
41
42
|
```
|
42
43
|
|
@@ -55,7 +56,6 @@ The options supported may differ between backends.
|
|
55
56
|
sms = Cellular::SMS.new(
|
56
57
|
recipient: '47xxxxxxxx',
|
57
58
|
sender: 'Custom sender',
|
58
|
-
country: 'NO',
|
59
59
|
message: 'This is an SMS message'
|
60
60
|
)
|
61
61
|
|
@@ -70,3 +70,9 @@ sms.deliver
|
|
70
70
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
71
71
|
4. Push to the branch (`git push origin my-new-feature`)
|
72
72
|
5. Create pull request
|
73
|
+
|
74
|
+
|
75
|
+
## Credits
|
76
|
+
|
77
|
+
Hyper made this. We're a digital communications agency with a passion for good code,
|
78
|
+
and if you're using this library we probably want to hire you.
|
data/lib/cellular/models/sms.rb
CHANGED
@@ -7,10 +7,10 @@ module Cellular
|
|
7
7
|
@backend = Cellular.config.backend
|
8
8
|
|
9
9
|
@recipient = options[:recipient]
|
10
|
-
@sender = options[:sender]
|
10
|
+
@sender = options[:sender] || Cellular.config.sender
|
11
11
|
@message = options[:message]
|
12
|
-
@price = options[:price]
|
13
|
-
@country = options[:country]
|
12
|
+
@price = options[:price] || Cellular.config.price
|
13
|
+
@country = options[:country] || Cellular.config.country_code
|
14
14
|
|
15
15
|
@delivered = false
|
16
16
|
end
|
data/lib/cellular/version.rb
CHANGED
@@ -11,4 +11,11 @@ describe Cellular::Configuration do
|
|
11
11
|
it { should respond_to :backend= }
|
12
12
|
it { should respond_to :backend }
|
13
13
|
|
14
|
+
it { should respond_to :price= }
|
15
|
+
it { should respond_to :price }
|
16
|
+
it { should respond_to :country_code= }
|
17
|
+
it { should respond_to :country_code }
|
18
|
+
it { should respond_to :sender= }
|
19
|
+
it { should respond_to :sender }
|
20
|
+
|
14
21
|
end
|
@@ -6,7 +6,7 @@ describe Cellular::SMS do
|
|
6
6
|
let(:sender) { 'Custom sender' }
|
7
7
|
let(:message) { 'This is an SMS message' }
|
8
8
|
let(:price) { 100 }
|
9
|
-
let(:country) { 'NO
|
9
|
+
let(:country) { 'NO'}
|
10
10
|
|
11
11
|
subject do
|
12
12
|
described_class.new(
|
@@ -30,6 +30,36 @@ describe Cellular::SMS do
|
|
30
30
|
its(:country) { should eq country }
|
31
31
|
|
32
32
|
it { should_not be_delivered }
|
33
|
+
|
34
|
+
context 'when sender omitted' do
|
35
|
+
before do
|
36
|
+
Cellular.config.sender = 'Hyper'
|
37
|
+
end
|
38
|
+
|
39
|
+
subject { described_class.new }
|
40
|
+
|
41
|
+
its(:sender) { should eq 'Hyper' }
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'when price omitted' do
|
45
|
+
before do
|
46
|
+
Cellular.config.price = 5
|
47
|
+
end
|
48
|
+
|
49
|
+
subject { described_class.new }
|
50
|
+
|
51
|
+
its(:price) { should eq 5 }
|
52
|
+
end
|
53
|
+
|
54
|
+
context 'when country omitted' do
|
55
|
+
before do
|
56
|
+
Cellular.config.country_code = 'NL'
|
57
|
+
end
|
58
|
+
|
59
|
+
subject { described_class.new }
|
60
|
+
|
61
|
+
its(:country) { should eq 'NL' }
|
62
|
+
end
|
33
63
|
end
|
34
64
|
|
35
65
|
describe '#deliver' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cellular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sindre Moen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|