restpack_service_messaging 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/restpack_service_messaging.rb +2 -3
- data/lib/restpack_service_messaging/commands/activity/create.rb +32 -0
- data/lib/restpack_service_messaging/commands/email/send.rb +6 -5
- data/lib/restpack_service_messaging/commands/email/send_raw.rb +32 -0
- data/lib/restpack_service_messaging/version.rb +1 -1
- data/spec/commands/email/{send_spec.rb → send_raw_spec.rb} +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 663df98703c1316f7a18ea1b323720dd4aff6d4d
|
4
|
+
data.tar.gz: e0a52f44dc91e80fa0ee14fc63969dfa905568ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb38439aaabe7cbf922212c210e83edb32e83b299bfffb476376172a582508dbf42e5bece680c05150a5d4cb530245d740f312ebe94a7d6e081874acf38b81a9
|
7
|
+
data.tar.gz: 5463c0cee01659388d24e7fa6989df23cece65d3f85628e187b77a296de0af0ca4dd026309bee7c55ac66525fb4f88c8c377e918ec4a068660f0d2b9907ce8b0
|
@@ -3,11 +3,10 @@ require 'rubykiq'
|
|
3
3
|
require 'restpack_service'
|
4
4
|
require 'restpack_service_messaging/version'
|
5
5
|
|
6
|
+
require 'restpack_service_messaging/commands/activity/create'
|
6
7
|
require 'restpack_service_messaging/commands/email/send'
|
8
|
+
require 'restpack_service_messaging/commands/email/send_raw'
|
7
9
|
|
8
10
|
#TODO: GJ: load Rubykiq configuration
|
9
11
|
#Rubykiq.url = "redis://127.0.0.1:6379"
|
10
12
|
|
11
|
-
module Commands
|
12
|
-
include RestPack::Service::Messaging::Commands
|
13
|
-
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Messaging
|
2
|
+
module Activity
|
3
|
+
class Create < RestPack::Service::Command
|
4
|
+
required do
|
5
|
+
integer :application_id
|
6
|
+
integer :user_id
|
7
|
+
string :content
|
8
|
+
end
|
9
|
+
|
10
|
+
optional do
|
11
|
+
string :title, empty: true
|
12
|
+
string :tags, empty: true
|
13
|
+
string :access, empty: true
|
14
|
+
float :latitude
|
15
|
+
float :longitude
|
16
|
+
model :data, class: Hash
|
17
|
+
end
|
18
|
+
|
19
|
+
def execute
|
20
|
+
job_id = Rubykiq.push(
|
21
|
+
class: 'Jobs::Activities::Activity::Create',
|
22
|
+
queue: 'activity',
|
23
|
+
args: [inputs]
|
24
|
+
)
|
25
|
+
|
26
|
+
{
|
27
|
+
job_id: job_id
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -1,22 +1,23 @@
|
|
1
|
-
module
|
1
|
+
module Messaging
|
2
2
|
module Email
|
3
3
|
class Send < RestPack::Service::Command
|
4
4
|
required do
|
5
5
|
integer :application_id
|
6
|
-
string :from #TODO: GJ: add email validation
|
7
6
|
string :to
|
8
|
-
string :
|
9
|
-
string :text_body
|
7
|
+
string :template
|
10
8
|
end
|
11
9
|
|
12
10
|
optional do
|
11
|
+
string :from #TODO: GJ: add email validation
|
12
|
+
string :subject
|
13
13
|
string :cc
|
14
14
|
string :bcc
|
15
15
|
string :reply_to
|
16
|
-
|
16
|
+
hash :data
|
17
17
|
end
|
18
18
|
|
19
19
|
def execute
|
20
|
+
inputs[:data] = raw_inputs[:data] if raw_inputs[:data]
|
20
21
|
job_id = Rubykiq.push(
|
21
22
|
class: 'Jobs::Email::Send',
|
22
23
|
queue: 'email',
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Messaging
|
2
|
+
module Email
|
3
|
+
class SendRaw < RestPack::Service::Command
|
4
|
+
required do
|
5
|
+
integer :application_id
|
6
|
+
string :from #TODO: GJ: add email validation
|
7
|
+
string :to
|
8
|
+
string :subject
|
9
|
+
string :text_body
|
10
|
+
end
|
11
|
+
|
12
|
+
optional do
|
13
|
+
string :cc
|
14
|
+
string :bcc
|
15
|
+
string :reply_to
|
16
|
+
string :html_body
|
17
|
+
end
|
18
|
+
|
19
|
+
def execute
|
20
|
+
job_id = Rubykiq.push(
|
21
|
+
class: 'Jobs::Email::SendRaw',
|
22
|
+
queue: 'email',
|
23
|
+
args: [inputs]
|
24
|
+
)
|
25
|
+
|
26
|
+
{
|
27
|
+
job_id: job_id
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restpack_service_messaging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Joyce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mutations
|
@@ -150,10 +150,12 @@ files:
|
|
150
150
|
- README.md
|
151
151
|
- Rakefile
|
152
152
|
- lib/restpack_service_messaging.rb
|
153
|
+
- lib/restpack_service_messaging/commands/activity/create.rb
|
153
154
|
- lib/restpack_service_messaging/commands/email/send.rb
|
155
|
+
- lib/restpack_service_messaging/commands/email/send_raw.rb
|
154
156
|
- lib/restpack_service_messaging/version.rb
|
155
157
|
- restpack_service_messaging.gemspec
|
156
|
-
- spec/commands/email/
|
158
|
+
- spec/commands/email/send_raw_spec.rb
|
157
159
|
- spec/spec_helper.rb
|
158
160
|
homepage: https://github.com/RestPack
|
159
161
|
licenses:
|
@@ -181,5 +183,5 @@ specification_version: 4
|
|
181
183
|
summary: A simple mechanism for sending messages to services without knowing much
|
182
184
|
about them
|
183
185
|
test_files:
|
184
|
-
- spec/commands/email/
|
186
|
+
- spec/commands/email/send_raw_spec.rb
|
185
187
|
- spec/spec_helper.rb
|