valdemaximus-conduit 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/valdemaximus-conduit.rb +6 -5
- data/valdemaximus-conduit.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
data/lib/valdemaximus-conduit.rb
CHANGED
@@ -7,25 +7,25 @@ require 'cgi'
|
|
7
7
|
|
8
8
|
module ValdeMaximus
|
9
9
|
class Conduit
|
10
|
-
PATH = '/messages
|
10
|
+
PATH = '/messages'
|
11
11
|
|
12
12
|
def initialize(p={})
|
13
13
|
assign_properties(p)
|
14
14
|
end
|
15
15
|
|
16
|
-
def send_message(
|
16
|
+
def send_message(body, list, node_id='')
|
17
17
|
@http ||= Net::HTTP.new(@domain, @port)
|
18
18
|
@http.use_ssl = false
|
19
19
|
|
20
20
|
data = ValdeMaximus::UriUtil.to_url_param({:user_credentials => @creds,
|
21
|
-
:body =>
|
21
|
+
:body => body,
|
22
22
|
:node_id => node_id.to_s,
|
23
23
|
'to[]' => list})
|
24
24
|
@headers = {
|
25
25
|
'Content-Type' => ValdeMaximus::UriUtil::CONTENT_TYPE
|
26
26
|
}
|
27
27
|
|
28
|
-
resp, data = @http.post2(PATH, data, @headers)
|
28
|
+
resp, data = @http.post2(PATH + @format, data, @headers)
|
29
29
|
end
|
30
30
|
|
31
31
|
private
|
@@ -33,12 +33,13 @@ module ValdeMaximus
|
|
33
33
|
@domain = p[:domain] unless p[:domain].nil?
|
34
34
|
@port = p[:port].to_s unless p[:port].nil?
|
35
35
|
@creds = p[:creds] unless p[:creds].nil?
|
36
|
+
@format = ".#{p[:format]}" || ".plain"
|
36
37
|
end
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
40
41
|
if __FILE__ == $0
|
41
|
-
c = ValdeMaximus::Conduit.new(:domain => 'localhost', :port => 3000, :creds => '
|
42
|
+
c = ValdeMaximus::Conduit.new(:format => 'yml', :domain => 'localhost', :port => 3000, :creds => 'k6DbJgVK5uq5_F_P14if')
|
42
43
|
res = c.send_message('hello world 12',
|
43
44
|
['8016946634, Tom Johnson',
|
44
45
|
'8016946632, Little T Johnson',
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{valdemaximus-conduit}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tom Johnson"]
|
12
|
-
s.date = %q{2009-12-
|
12
|
+
s.date = %q{2009-12-22}
|
13
13
|
s.description = %q{A Library to programmatically interface with portal}
|
14
14
|
s.email = %q{valde.maximus@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valdemaximus-conduit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Johnson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-22 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|