memotoo 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +14 -0
- data/VERSION +1 -1
- data/lib/memotoo.rb +34 -15
- data/lib/memotoo/main.rb +2 -22
- data/memotoo.gemspec +1 -1
- data/test/test_memotoo.rb +3 -24
- data/test/test_soapobjects.rb +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
|
@@ -108,6 +108,16 @@ dateEnd:: "2011-01-01", Format: YYYY-MM-DD
|
|
|
108
108
|
Task and Event::
|
|
109
109
|
dateBegin:: "2011-06-18T10:00:00", Format: YYYY-MM-DDTHH:II:SS - ISO8601 time format GMT
|
|
110
110
|
dateEnd:: "2011-06-18T10:00:00", Format: YYYY-MM-DDTHH:II:SS - ISO8601 time format GMT
|
|
111
|
+
|
|
112
|
+
==Logging
|
|
113
|
+
|
|
114
|
+
Enable/Disable Savon and HTTPI - Logging
|
|
115
|
+
|
|
116
|
+
@connect=Memotoo.new(username, password, https=true, log=false, requestlog=true)
|
|
117
|
+
|
|
118
|
+
log = Savon logging on/off
|
|
119
|
+
|
|
120
|
+
requestlog = HTTPI loggin on/off
|
|
111
121
|
|
|
112
122
|
==Testing
|
|
113
123
|
|
|
@@ -135,6 +145,10 @@ and memotoo api-documentation
|
|
|
135
145
|
|
|
136
146
|
https://www.memotoo.com/index.php?rub=api#SOAP-server.php
|
|
137
147
|
|
|
148
|
+
== Changelog V. 2.0.2
|
|
149
|
+
|
|
150
|
+
Easy configuring logging options
|
|
151
|
+
|
|
138
152
|
== Changelog V. 2.0.1
|
|
139
153
|
|
|
140
154
|
some code refactoring and support for ruby >=1.9.2
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.0.
|
|
1
|
+
2.0.2
|
data/lib/memotoo.rb
CHANGED
|
@@ -23,35 +23,54 @@ class Memotoo
|
|
|
23
23
|
:task => [:title]}
|
|
24
24
|
|
|
25
25
|
#[https] default:true for the SOAP service. Use false to use http-connection
|
|
26
|
+
#[log] default:false - set to true to see savons logging
|
|
27
|
+
#[requeslog] default:false - set to
|
|
26
28
|
# example:(use https)
|
|
27
29
|
# @connect=Memotoo::Connect.new("myusername","mypassword")
|
|
28
30
|
# example:(use http)
|
|
29
31
|
# @connect=Memotoo::Connect.new("myusername","mypassword", false)
|
|
30
|
-
|
|
32
|
+
# example:(set loggin on and http-request-logging off)
|
|
33
|
+
# @connect=Memotoo::Connect.new("myusername","mypassword", true, true, false)
|
|
34
|
+
def initialize(username, password, https=true, log=false, requestlog=true)
|
|
31
35
|
|
|
32
|
-
#
|
|
36
|
+
# need it for every request - will be merged in
|
|
33
37
|
self.opts= { :param => { :login => username, :password => password}}
|
|
34
38
|
|
|
39
|
+
# set savon logging and erros
|
|
40
|
+
Savon.configure do |config|
|
|
41
|
+
config.raise_errors = true # raise SOAP faults and HTTP errors
|
|
42
|
+
config.log = log # enable/disable logging
|
|
43
|
+
config.log_level = :debug # changing the log level
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
HTTPI.log=requestlog
|
|
47
|
+
|
|
35
48
|
# build dynamically all methods - some magic :-)
|
|
36
49
|
make_methods
|
|
37
50
|
|
|
38
51
|
# creates client with memotoo settings
|
|
39
52
|
client(https)
|
|
40
53
|
end
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
|
|
55
|
+
# Creates the <tt>Savon::Client</tt>.
|
|
56
|
+
def client(https=true)
|
|
57
|
+
#--
|
|
58
|
+
# in any case problems switch back to receiving the wsdl file from memotoo
|
|
59
|
+
# https: wsdl.document = "https://www.memotoo.com/SOAP-server.php?wsdl"
|
|
60
|
+
# http: wsdl.document = "http://www.memotoo.com/SOAP-server.php?wsdl"
|
|
61
|
+
#++
|
|
62
|
+
@client ||= Savon::Client.new do
|
|
63
|
+
wsdl.namespace="urn:memotooSoap"
|
|
64
|
+
if https
|
|
65
|
+
wsdl.endpoint="https://www.memotoo.com/SOAP-server.php"
|
|
66
|
+
http.auth.ssl.verify_mode = :none
|
|
67
|
+
else
|
|
68
|
+
wsdl.endpoint="http://www.memotoo.com/SOAP-server.php"
|
|
69
|
+
end
|
|
70
|
+
http.auth.basic self.opts[:param][:login], self.opts[:param][:password]
|
|
71
|
+
end
|
|
52
72
|
end
|
|
53
|
-
|
|
54
|
-
end
|
|
73
|
+
|
|
55
74
|
end
|
|
56
75
|
|
|
57
76
|
#Finished in 41.165241 seconds.
|
data/lib/memotoo/main.rb
CHANGED
|
@@ -1,26 +1,6 @@
|
|
|
1
1
|
class Memotoo
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
# Creates the <tt>Savon::Client</tt>.
|
|
6
|
-
def client(https=true)
|
|
7
|
-
#--
|
|
8
|
-
# in any case problems switch back to receiving the wsdl file from memotoo
|
|
9
|
-
# https: wsdl.document = "https://www.memotoo.com/SOAP-server.php?wsdl"
|
|
10
|
-
# http: wsdl.document = "http://www.memotoo.com/SOAP-server.php?wsdl"
|
|
11
|
-
#++
|
|
12
|
-
|
|
13
|
-
@client ||= Savon::Client.new do
|
|
14
|
-
wsdl.namespace="urn:memotooSoap"
|
|
15
|
-
if https
|
|
16
|
-
wsdl.endpoint="https://www.memotoo.com/SOAP-server.php"
|
|
17
|
-
http.auth.ssl.verify_mode = :none
|
|
18
|
-
else
|
|
19
|
-
wsdl.endpoint="http://www.memotoo.com/SOAP-server.php"
|
|
20
|
-
end
|
|
21
|
-
http.auth.basic self.opts[:param][:login], self.opts[:param][:password]
|
|
22
|
-
end
|
|
23
|
-
end
|
|
2
|
+
|
|
3
|
+
private
|
|
24
4
|
|
|
25
5
|
def selfclass
|
|
26
6
|
(class << self; self; end)
|
data/memotoo.gemspec
CHANGED
data/test/test_memotoo.rb
CHANGED
|
@@ -5,7 +5,7 @@ class TestMemotoo < Test::Unit::TestCase
|
|
|
5
5
|
context "Memotoo-Soap Api basic tests" do
|
|
6
6
|
|
|
7
7
|
setup do
|
|
8
|
-
@connect=Memotoo.new(MEMOTOO_USERNAME,MEMOTOO_PASSWORD,false)
|
|
8
|
+
@connect=Memotoo.new(MEMOTOO_USERNAME,MEMOTOO_PASSWORD, true, false, false)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
should "have a connect-instance" do
|
|
@@ -13,7 +13,7 @@ class TestMemotoo < Test::Unit::TestCase
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
should "write a message if username/password is not correct" do
|
|
16
|
-
@connect=Memotoo.new(MEMOTOO_USERNAME,"wrongpasswd")
|
|
16
|
+
@connect=Memotoo.new(MEMOTOO_USERNAME,"wrongpasswd", true, false, false)
|
|
17
17
|
assert_raises ArgumentError do
|
|
18
18
|
response = @connect.searchContact(TESTSEARCHDEFAULTS)
|
|
19
19
|
end
|
|
@@ -26,7 +26,7 @@ class TestMemotoo < Test::Unit::TestCase
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
should "also use http request instead of https" do
|
|
29
|
-
@connect=Memotoo.new(MEMOTOO_USERNAME,MEMOTOO_PASSWORD, false)
|
|
29
|
+
@connect=Memotoo.new(MEMOTOO_USERNAME,MEMOTOO_PASSWORD, false, false, false)
|
|
30
30
|
response = @connect.searchContact(TESTSEARCHDEFAULTS)
|
|
31
31
|
assert_not_nil response
|
|
32
32
|
end
|
|
@@ -35,27 +35,6 @@ class TestMemotoo < Test::Unit::TestCase
|
|
|
35
35
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
# uncomment this if you want to see everything in log what happens...it's a lot
|
|
40
|
-
#module Savon
|
|
41
|
-
# module Global
|
|
42
|
-
# def log?
|
|
43
|
-
# true
|
|
44
|
-
# end
|
|
45
|
-
#
|
|
46
|
-
# end
|
|
47
|
-
#end
|
|
48
|
-
|
|
49
|
-
# comment this to see http requests logged
|
|
50
|
-
module HTTPI
|
|
51
|
-
class << self
|
|
52
|
-
def log?
|
|
53
|
-
@log = false
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
|
|
59
38
|
################## rcov-result ######################
|
|
60
39
|
|
|
61
40
|
#Generated on Wed Jun 08 22:39:46 +0200 2011 with rcov 0.9.8
|
data/test/test_soapobjects.rb
CHANGED
|
@@ -43,7 +43,7 @@ soapobjects.each do |soapobject|
|
|
|
43
43
|
context "what we could do with #{soapobject}'s" do
|
|
44
44
|
|
|
45
45
|
setup do
|
|
46
|
-
@connect=Memotoo.new(MEMOTOO_USERNAME,MEMOTOO_PASSWORD, false)
|
|
46
|
+
@connect=Memotoo.new(MEMOTOO_USERNAME,MEMOTOO_PASSWORD, true, false, false)
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
context "Adding and finding #{soapobject}" do
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: memotoo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 11
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 2
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 2.0.
|
|
9
|
+
- 2
|
|
10
|
+
version: 2.0.2
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Karsten Redmer
|