locasms 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
- # locasms [![Build Status](https://travis-ci.org/mcorp/locasms.png?branch=master)](https://travis-ci.org/mcorp/locasms) [![Dependency Status](https://gemnasium.com/mcorp/locasms.png)](https://gemnasium.com/mcorp/locasms) [![Code Climate](https://codeclimate.com/github/mcorp/locasms.png)](https://codeclimate.com/github/mcorp/locasms)
1
+ # locasms
2
+ [![Gem Version](https://badge.fury.io/rb/locasms.svg)](http://badge.fury.io/rb/locasms) [![Build Status](https://travis-ci.org/mcorp/locasms.png?branch=master)](https://travis-ci.org/mcorp/locasms) [![Dependency Status](https://gemnasium.com/mcorp/locasms.png)](https://gemnasium.com/mcorp/locasms) [![Code Climate](https://codeclimate.com/github/mcorp/locasms.png)](https://codeclimate.com/github/mcorp/locasms) [![Inline docs](http://inch-ci.org/github/mcorp/locasms.svg?branch=master)](http://inch-ci.org/github/mcorp/locasms)
3
+
4
+ > :warning: After `Jun 1st 2015` the base IP of the service will change as noticed on this [issue](https://github.com/mcorp/locasms/issues/4). If you don't upgrade to version `0.1.6` your app will stop delivering SMS
2
5
 
3
6
  Client to consume [LocaSMS api's][0].
4
7
 
@@ -3,7 +3,11 @@ module LocaSMS
3
3
  # Client to interact with LocaSMS API
4
4
  class Client
5
5
  # Default API address
6
- ENDPOINT = 'http://173.44.33.18/painel/api.ashx'
6
+ ENDPOINT = if Time.now >= Time.parse('2015-06-01T00:00:00-0300')
7
+ 'http://209.133.196.250/painel/api.ashx'
8
+ else
9
+ 'http://173.44.33.18/painel/api.ashx'
10
+ end
7
11
 
8
12
  attr_reader :login, :password
9
13
 
@@ -1,3 +1,3 @@
1
1
  module LocaSMS
2
- VERSION = "0.1.5"
2
+ VERSION = '0.1.6'
3
3
  end
data/locasms.gemspec CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  # test stuff
25
25
  spec.add_development_dependency 'rspec', '~> 3.2'
26
26
  spec.add_development_dependency 'fuubar', '~> 2.0.0'
27
+ spec.add_development_dependency 'timecop', '~> 0.7.3'
27
28
 
28
29
  # run tests automatically
29
30
  spec.add_development_dependency 'guard'
@@ -4,6 +4,40 @@ describe LocaSMS::Client do
4
4
  let(:rest_client) { 'rest_client mock' }
5
5
  subject { LocaSMS::Client.new :login, :password, rest_client: rest_client }
6
6
 
7
+ context '.ENDPOINT' do
8
+ def test_when(moment_in_time)
9
+ Timecop.freeze(Time.parse(moment_in_time)) do
10
+ LocaSMS.send :remove_const, :Client
11
+ load 'lib/locasms/client.rb'
12
+ yield
13
+ end
14
+ end
15
+
16
+ it 'prior to Jun 1st 2015' do
17
+ test_when('2015-05-31T23:59:59-0300') do
18
+ expect(LocaSMS::Client::ENDPOINT).to(
19
+ eq('http://173.44.33.18/painel/api.ashx')
20
+ )
21
+ end
22
+ end
23
+
24
+ it 'is Jun 1st 2015' do
25
+ test_when('2015-06-01T00:00:00-0300') do
26
+ expect(LocaSMS::Client::ENDPOINT).to(
27
+ eq('http://209.133.196.250/painel/api.ashx')
28
+ )
29
+ end
30
+ end
31
+
32
+ it 'after Jun 1st 2015' do
33
+ test_when('2016-01-01T00:00:00-0300') do
34
+ expect(LocaSMS::Client::ENDPOINT).to(
35
+ eq('http://209.133.196.250/painel/api.ashx')
36
+ )
37
+ end
38
+ end
39
+ end
40
+
7
41
  describe '.initialize' do
8
42
  it { expect(subject.login).to be(:login) }
9
43
  it { expect(subject.password).to be(:password) }
data/spec/spec_helper.rb CHANGED
@@ -11,6 +11,8 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
11
11
  require 'locasms'
12
12
  require 'rspec'
13
13
  require 'time'
14
+ require 'timecop'
15
+ Timecop.safe_mode = true
14
16
 
15
17
  RSpec.configure do |config|
16
18
  # see spec.opts
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locasms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adilson Carvalho
@@ -10,160 +10,174 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-03-10 00:00:00.000000000 Z
13
+ date: 2015-05-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ~>
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
21
  version: '1.3'
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ~>
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
28
  version: '1.3'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rake
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ~>
33
+ - - "~>"
34
34
  - !ruby/object:Gem::Version
35
35
  version: 10.4.2
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ~>
40
+ - - "~>"
41
41
  - !ruby/object:Gem::Version
42
42
  version: 10.4.2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rspec
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ~>
47
+ - - "~>"
48
48
  - !ruby/object:Gem::Version
49
49
  version: '3.2'
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ~>
54
+ - - "~>"
55
55
  - !ruby/object:Gem::Version
56
56
  version: '3.2'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: fuubar
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ~>
61
+ - - "~>"
62
62
  - !ruby/object:Gem::Version
63
63
  version: 2.0.0
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ~>
68
+ - - "~>"
69
69
  - !ruby/object:Gem::Version
70
70
  version: 2.0.0
71
+ - !ruby/object:Gem::Dependency
72
+ name: timecop
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: 0.7.3
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - "~>"
83
+ - !ruby/object:Gem::Version
84
+ version: 0.7.3
71
85
  - !ruby/object:Gem::Dependency
72
86
  name: guard
73
87
  requirement: !ruby/object:Gem::Requirement
74
88
  requirements:
75
- - - '>='
89
+ - - ">="
76
90
  - !ruby/object:Gem::Version
77
91
  version: '0'
78
92
  type: :development
79
93
  prerelease: false
80
94
  version_requirements: !ruby/object:Gem::Requirement
81
95
  requirements:
82
- - - '>='
96
+ - - ">="
83
97
  - !ruby/object:Gem::Version
84
98
  version: '0'
85
99
  - !ruby/object:Gem::Dependency
86
100
  name: guard-rspec
87
101
  requirement: !ruby/object:Gem::Requirement
88
102
  requirements:
89
- - - '>='
103
+ - - ">="
90
104
  - !ruby/object:Gem::Version
91
105
  version: '0'
92
106
  type: :development
93
107
  prerelease: false
94
108
  version_requirements: !ruby/object:Gem::Requirement
95
109
  requirements:
96
- - - '>='
110
+ - - ">="
97
111
  - !ruby/object:Gem::Version
98
112
  version: '0'
99
113
  - !ruby/object:Gem::Dependency
100
114
  name: growl
101
115
  requirement: !ruby/object:Gem::Requirement
102
116
  requirements:
103
- - - '>='
117
+ - - ">="
104
118
  - !ruby/object:Gem::Version
105
119
  version: '0'
106
120
  type: :development
107
121
  prerelease: false
108
122
  version_requirements: !ruby/object:Gem::Requirement
109
123
  requirements:
110
- - - '>='
124
+ - - ">="
111
125
  - !ruby/object:Gem::Version
112
126
  version: '0'
113
127
  - !ruby/object:Gem::Dependency
114
128
  name: yard
115
129
  requirement: !ruby/object:Gem::Requirement
116
130
  requirements:
117
- - - '>='
131
+ - - ">="
118
132
  - !ruby/object:Gem::Version
119
133
  version: '0'
120
134
  type: :development
121
135
  prerelease: false
122
136
  version_requirements: !ruby/object:Gem::Requirement
123
137
  requirements:
124
- - - '>='
138
+ - - ">="
125
139
  - !ruby/object:Gem::Version
126
140
  version: '0'
127
141
  - !ruby/object:Gem::Dependency
128
142
  name: redcarpet
129
143
  requirement: !ruby/object:Gem::Requirement
130
144
  requirements:
131
- - - '>='
145
+ - - ">="
132
146
  - !ruby/object:Gem::Version
133
147
  version: '0'
134
148
  type: :development
135
149
  prerelease: false
136
150
  version_requirements: !ruby/object:Gem::Requirement
137
151
  requirements:
138
- - - '>='
152
+ - - ">="
139
153
  - !ruby/object:Gem::Version
140
154
  version: '0'
141
155
  - !ruby/object:Gem::Dependency
142
156
  name: simplecov
143
157
  requirement: !ruby/object:Gem::Requirement
144
158
  requirements:
145
- - - '>='
159
+ - - ">="
146
160
  - !ruby/object:Gem::Version
147
161
  version: '0'
148
162
  type: :development
149
163
  prerelease: false
150
164
  version_requirements: !ruby/object:Gem::Requirement
151
165
  requirements:
152
- - - '>='
166
+ - - ">="
153
167
  - !ruby/object:Gem::Version
154
168
  version: '0'
155
169
  - !ruby/object:Gem::Dependency
156
170
  name: rest-client
157
171
  requirement: !ruby/object:Gem::Requirement
158
172
  requirements:
159
- - - ~>
173
+ - - "~>"
160
174
  - !ruby/object:Gem::Version
161
175
  version: '1.6'
162
176
  type: :runtime
163
177
  prerelease: false
164
178
  version_requirements: !ruby/object:Gem::Requirement
165
179
  requirements:
166
- - - ~>
180
+ - - "~>"
167
181
  - !ruby/object:Gem::Version
168
182
  version: '1.6'
169
183
  description: Cliente para o serviço de disparo de SMS da LocaSMS
@@ -175,9 +189,11 @@ executables: []
175
189
  extensions: []
176
190
  extra_rdoc_files: []
177
191
  files:
178
- - .gitignore
179
- - .travis.yml
180
- - .yardopts
192
+ - ".gitignore"
193
+ - ".hound.yml"
194
+ - ".ruby-style.yml"
195
+ - ".travis.yml"
196
+ - ".yardopts"
181
197
  - Gemfile
182
198
  - Guardfile
183
199
  - LICENSE.txt
@@ -207,12 +223,12 @@ require_paths:
207
223
  - lib
208
224
  required_ruby_version: !ruby/object:Gem::Requirement
209
225
  requirements:
210
- - - '>='
226
+ - - ">="
211
227
  - !ruby/object:Gem::Version
212
228
  version: '0'
213
229
  required_rubygems_version: !ruby/object:Gem::Requirement
214
230
  requirements:
215
- - - '>='
231
+ - - ">="
216
232
  - !ruby/object:Gem::Version
217
233
  version: '0'
218
234
  requirements: []