valdemaximus-conduit 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,32 +5,28 @@ require 'net/https'
5
5
  require 'uri'
6
6
  require 'cgi'
7
7
 
8
- module Conduit
8
+ module ValdeMaximus
9
9
  class Conduit
10
+ PATH = '/messages.plain'
11
+
10
12
  def initialize(p={})
11
13
  assign_properties(p)
12
14
  end
13
15
 
14
- def send_message(msg, list, props={})
15
- assign_properties(props)
16
-
17
- params = {'user_credentials' => @creds,
18
- 'body' => msg}
19
- params.merge!(formatted_list)
16
+ def send_message(msg, list, properties={})
17
+ assign_properties(properties)
20
18
 
21
19
  @http ||= Net::HTTP.new(@domain, @port)
22
20
  @http.use_ssl = false
23
21
 
24
22
  data = ValdeMaximus::UriUtil.to_url_param({:user_credentials => @creds,
25
23
  :body => msg,
26
- 'list[]' => list})
24
+ 'to[]' => list})
27
25
  @headers = {
28
26
  'Content-Type' => ValdeMaximus::UriUtil::CONTENT_TYPE
29
27
  }
30
- puts ValdeMaximus::UriUtil::CONTENT_TYPE
31
- puts "headers = " + @headers.inspect
32
28
 
33
- resp, data = @http.post2(path, data, @headers)
29
+ resp, data = @http.post2(PATH, data, @headers)
34
30
  end
35
31
 
36
32
  private
@@ -43,10 +39,10 @@ module Conduit
43
39
  end
44
40
 
45
41
  if __FILE__ == $0
46
- c = Conduit::Conduit.new(:domain => 'localhost', :port => 3000, :creds => 'f_Le6kzsCJi5tNP7rFpQ')
47
- res = c.send_message('hello world 10',
48
- ['8016946635, Tom Johnson',
49
- '8016946636, Tom Johnson3',
50
- '8016946637, Tom Johnson4'])
42
+ c = ValdeMaximus::Conduit.new(:domain => 'localhost', :port => 3000, :creds => 'f_Le6kzsCJi5tNP7rFpQ')
43
+ res = c.send_message('hello world 12',
44
+ ['8016946634, Tom Johnson',
45
+ '8016946632',
46
+ '8016946633'])
51
47
  puts res
52
48
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{valdemaximus-conduit}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
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"]
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Johnson