virtual_sms 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/app/models/virtual_sms/message.rb +2 -1
- data/app/views/virtual_sms/messages/index.html.erb +5 -1
- data/app/views/virtual_sms/messages/show.html.erb +6 -0
- data/lib/virtual_sms/interceptor.rb +9 -0
- data/lib/virtual_sms/version.rb +1 -1
- data/lib/virtual_sms.rb +2 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e46e3ec85d066b7485df875360bceab5257e4aa8
|
4
|
+
data.tar.gz: eee4c1d6c70f39f215716f6f7b0eca73428df9a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b74cc599752b096b50c643c168007bf541f71ad4073893d2c2e95ce279258a2daafe078bd7e2b789d52b630d7b989aeb53f877da6c222aed7b15f075a363dc6
|
7
|
+
data.tar.gz: f062548ed38e1b1760af18e11ca4cbb18a948d54cc84bb2e76a95a4f1126c2a19d1cf1060fd0d539ee9b1fa42466cd0de8fd3747d307c45a436c03cb49184492
|
data/CHANGELOG.md
CHANGED
@@ -4,12 +4,13 @@ module VirtualSms
|
|
4
4
|
class Message
|
5
5
|
include ActionView::Helpers::TagHelper
|
6
6
|
|
7
|
-
attr_accessor :sms
|
7
|
+
attr_accessor :sms, :date
|
8
8
|
delegate :body, :from, to: :sms
|
9
9
|
|
10
10
|
def initialize(sms)
|
11
11
|
@sms = sms
|
12
12
|
@sms[:sms_id] = SecureRandom.uuid
|
13
|
+
self.date = Time.now
|
13
14
|
end
|
14
15
|
|
15
16
|
def id
|
@@ -10,8 +10,9 @@
|
|
10
10
|
<th>From</th>
|
11
11
|
<th>To</th>
|
12
12
|
<th>Body</th>
|
13
|
+
<th>Date</th>
|
13
14
|
</tr>
|
14
|
-
<% @messages.
|
15
|
+
<% @messages.reverse_each do |message| %>
|
15
16
|
<tr>
|
16
17
|
<td>
|
17
18
|
<%= message.from %>
|
@@ -22,6 +23,9 @@
|
|
22
23
|
<td>
|
23
24
|
<%= link_to message.body, message_path(:id => message.id) %>
|
24
25
|
</td>
|
26
|
+
<td>
|
27
|
+
<%= message.date %>
|
28
|
+
</td>
|
25
29
|
</tr>
|
26
30
|
<% end %>
|
27
31
|
</table>
|
data/lib/virtual_sms/version.rb
CHANGED
data/lib/virtual_sms.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
require "sms_carrier"
|
2
2
|
require "virtual_sms/engine"
|
3
3
|
require "virtual_sms/carrier"
|
4
|
+
require "virtual_sms/interceptor"
|
4
5
|
|
5
6
|
module VirtualSms
|
6
7
|
CacheKey = 'virtual_sms'
|
7
8
|
|
8
9
|
SmsCarrier::Base.add_delivery_method :virtual, VirtualSms::Carrier
|
10
|
+
SmsCarrier::Base.register_interceptor(VirtualSms::Interceptor)
|
9
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: virtual_sms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chen Yi-Cyuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -175,6 +175,7 @@ files:
|
|
175
175
|
- lib/virtual_sms.rb
|
176
176
|
- lib/virtual_sms/carrier.rb
|
177
177
|
- lib/virtual_sms/engine.rb
|
178
|
+
- lib/virtual_sms/interceptor.rb
|
178
179
|
- lib/virtual_sms/version.rb
|
179
180
|
homepage: https://github.com/emn178/virtual_sms
|
180
181
|
licenses:
|
@@ -196,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
197
|
version: '0'
|
197
198
|
requirements: []
|
198
199
|
rubyforge_project:
|
199
|
-
rubygems_version: 2.4.
|
200
|
+
rubygems_version: 2.4.5
|
200
201
|
signing_key:
|
201
202
|
specification_version: 4
|
202
203
|
summary: An rails plugin that provides a virtual SMS box and SMS Carrier delivery
|