memotoo 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +37 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +76 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/lib/memotoo.rb +5 -0
- data/lib/memotoo/connect.rb +86 -0
- data/lib/memotoo/contact/contact.rb +192 -0
- data/lib/memotoo/core-ext/hash.rb +40 -0
- data/lib/memotoo/core-ext/kernel.rb +10 -0
- data/test/helper.rb +18 -0
- data/test/test_memotoo.rb +7 -0
- metadata +169 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
gem "savon"
|
6
|
+
|
7
|
+
# Add dependencies to develop your gem here.
|
8
|
+
# Include everything needed to run rake, tests, features, etc.
|
9
|
+
group :development do
|
10
|
+
gem "shoulda", ">= 0"
|
11
|
+
gem "bundler", "~> 1.0.0"
|
12
|
+
gem "jeweler", "~> 1.5.2"
|
13
|
+
gem "rcov", ">= 0"
|
14
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
builder (3.0.0)
|
5
|
+
git (1.2.5)
|
6
|
+
gyoku (0.4.3)
|
7
|
+
builder (>= 2.1.2)
|
8
|
+
httpi (0.9.3)
|
9
|
+
ntlm-http (>= 0.1.1)
|
10
|
+
rack
|
11
|
+
jeweler (1.5.2)
|
12
|
+
bundler (~> 1.0.0)
|
13
|
+
git (>= 1.2.5)
|
14
|
+
rake
|
15
|
+
nokogiri (1.4.4)
|
16
|
+
nori (0.2.0)
|
17
|
+
ntlm-http (0.1.1)
|
18
|
+
rack (1.2.2)
|
19
|
+
rake (0.8.7)
|
20
|
+
rcov (0.9.9)
|
21
|
+
savon (0.9.2)
|
22
|
+
builder (>= 2.1.2)
|
23
|
+
gyoku (>= 0.4.0)
|
24
|
+
httpi (>= 0.7.8)
|
25
|
+
nokogiri (>= 1.4.0)
|
26
|
+
nori (>= 0.2.0)
|
27
|
+
shoulda (2.11.3)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
ruby
|
31
|
+
|
32
|
+
DEPENDENCIES
|
33
|
+
bundler (~> 1.0.0)
|
34
|
+
jeweler (~> 1.5.2)
|
35
|
+
rcov
|
36
|
+
savon
|
37
|
+
shoulda
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Karsten Redmer
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
= memotoo-gem
|
2
|
+
|
3
|
+
<b>This is not an official gem from the provider of memotoo !!!</b>
|
4
|
+
|
5
|
+
The memotoo-gem is a soap(savon)-wrapper to (easy) access your {memotoo}[http://www.memotoo.com/index-saleshype.php] contacts.
|
6
|
+
|
7
|
+
Add, get, search, modify and delete your memotoo contacts.
|
8
|
+
|
9
|
+
I searched for an memotoo-gem and could't find anyone. There are only php-scripts provided to use the memotoo-soap-api.
|
10
|
+
|
11
|
+
Here is the first available ruby version and my first gem.
|
12
|
+
|
13
|
+
== You need
|
14
|
+
you need a memotoo-credential (usetrname/passwd) to use this gem
|
15
|
+
|
16
|
+
<b>get a free account here: {www.memotoo.com}[http://www.memotoo.com/index-saleshype.php]</b>
|
17
|
+
|
18
|
+
|
19
|
+
==Install
|
20
|
+
|
21
|
+
if you use <b>bundler</b> add gem 'memotoo' to your Gemfile run
|
22
|
+
bundle install
|
23
|
+
else put it in your <b>environment.rb</b> and run
|
24
|
+
rake gems:install
|
25
|
+
|
26
|
+
==Use
|
27
|
+
|
28
|
+
give a first try in irb: ./script/console
|
29
|
+
|
30
|
+
@connect=Memotoo::Connect.new("myusername","mypassword")
|
31
|
+
|
32
|
+
[Add a contact:]
|
33
|
+
|
34
|
+
@response = @connect.addContact({:title => "Mr",:lastname => "Wonder",:firstname => "Test"})
|
35
|
+
|
36
|
+
get a contact from id
|
37
|
+
|
38
|
+
@response = @connect.getContact(12345)
|
39
|
+
|
40
|
+
search for contacts:
|
41
|
+
|
42
|
+
@response = @connect.searchContact("ka")
|
43
|
+
|
44
|
+
modify a contact:
|
45
|
+
|
46
|
+
@response = @connect.modifyContact({:id=>"12345",:lastname=>"New",:jobtitle => "cat-doctor",:otherphone => "12345"})
|
47
|
+
|
48
|
+
==Documentation
|
49
|
+
|
50
|
+
see rdoc
|
51
|
+
|
52
|
+
start rdoc server with: gem server
|
53
|
+
|
54
|
+
==To-Dos
|
55
|
+
1. I havn't wrote any tests, but tested a lot.
|
56
|
+
2. Exception handling should be done
|
57
|
+
3. I only implemented contacts - these soap-objects are missing: bookmark, bookmark's folder, contact's group, event, holiday, task, note
|
58
|
+
|
59
|
+
It would be nice if *someone* could help me with the missing parts .
|
60
|
+
|
61
|
+
|
62
|
+
== Contributing to memotoo-gem
|
63
|
+
|
64
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
65
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
66
|
+
* Fork the project
|
67
|
+
* Start a feature/bugfix branch
|
68
|
+
* Commit and push until you are happy with your contribution
|
69
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
70
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
71
|
+
|
72
|
+
== Copyright
|
73
|
+
|
74
|
+
Copyright (c) 2011 Karsten Redmer. See LICENSE.txt for
|
75
|
+
further details.
|
76
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
gem.name = "memotoo"
|
15
|
+
gem.homepage = "http://github.com/kredmer/memotoo"
|
16
|
+
gem.license = "MIT"
|
17
|
+
gem.summary = "A gem for connecting to the memotoo soap-api"
|
18
|
+
gem.description = "A gem for connecting to the memotoo soap-api and handle your contact needs"
|
19
|
+
gem.email = "k.redmer@yahoo.de"
|
20
|
+
gem.authors = ["Karsten Redmer"]
|
21
|
+
gem.add_dependency 'savon'
|
22
|
+
end
|
23
|
+
Jeweler::RubygemsDotOrgTasks.new
|
24
|
+
|
25
|
+
require 'rake/testtask'
|
26
|
+
Rake::TestTask.new(:test) do |test|
|
27
|
+
test.libs << 'lib' << 'test'
|
28
|
+
test.pattern = 'test/**/test_*.rb'
|
29
|
+
test.verbose = true
|
30
|
+
end
|
31
|
+
|
32
|
+
require 'rcov/rcovtask'
|
33
|
+
Rcov::RcovTask.new do |test|
|
34
|
+
test.libs << 'test'
|
35
|
+
test.pattern = 'test/**/test_*.rb'
|
36
|
+
test.verbose = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :test
|
40
|
+
|
41
|
+
require 'rake/rdoctask'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "memotoo #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
data/lib/memotoo.rb
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
require "savon"
|
2
|
+
require "memotoo/core-ext/hash"
|
3
|
+
require "memotoo/core-ext/kernel"
|
4
|
+
require "memotoo/contact/contact"
|
5
|
+
|
6
|
+
module Memotoo
|
7
|
+
|
8
|
+
# = Memotoo::Connect
|
9
|
+
#
|
10
|
+
# Memotoo::Connect is the main object for connecting
|
11
|
+
# to the {memotoo}[http://www.memotoo.com/index-saleshype.php] SOAP service.
|
12
|
+
|
13
|
+
class Connect
|
14
|
+
|
15
|
+
# will hold username and password in a hash style (used for all requests)
|
16
|
+
attr_accessor :opts
|
17
|
+
|
18
|
+
#[https] default:true for the SOAP service.
|
19
|
+
# example: @connect=Memotoo::Connect.new("myusername","mypassword")
|
20
|
+
def initialize(username, password, https=true)
|
21
|
+
|
22
|
+
# we will need it for every request - will be merged in
|
23
|
+
self.opts= {
|
24
|
+
:param => {
|
25
|
+
:login => username,
|
26
|
+
:password => password,
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
# set savon logging and erros
|
31
|
+
Savon.configure do |config|
|
32
|
+
config.raise_errors = false # do not raise SOAP faults and HTTP errors
|
33
|
+
config.log = false # disable logging
|
34
|
+
config.log_level = :info # changing the log level
|
35
|
+
config.logger = Rails.logger # using the Rails logger
|
36
|
+
end
|
37
|
+
|
38
|
+
# creates client with memotoo settings
|
39
|
+
client(https)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Creates the <tt>Savon::Client</tt>.
|
43
|
+
def client(https=true)
|
44
|
+
#--
|
45
|
+
# TODO: dont fetch wdsl-file - make setting by myself - it's faster
|
46
|
+
# # Directly accessing a SOAP endpoint
|
47
|
+
# client = Savon::Client.new do
|
48
|
+
# wsdl.endpoint = "http://example.com/UserService"
|
49
|
+
# wsdl.namespace = "http://users.example.com"
|
50
|
+
# end
|
51
|
+
#++
|
52
|
+
|
53
|
+
@client ||= Savon::Client.new do
|
54
|
+
if https
|
55
|
+
wsdl.document = "https://www.memotoo.com/SOAP-server.php?wsdl"
|
56
|
+
http.auth.ssl.verify_mode = :none
|
57
|
+
else
|
58
|
+
wsdl.document = "https://www.memotoo.com/SOAP-server.php?wsdl"
|
59
|
+
end
|
60
|
+
http.auth.basic self.opts[:param][:login], self.opts[:param][:password]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# used internally for a request
|
65
|
+
def apicall(action, parameter)
|
66
|
+
|
67
|
+
response=@client.request :wsdl, action do
|
68
|
+
soap.body = { :param => parameter }.deep_merge!(self.opts)
|
69
|
+
end
|
70
|
+
response
|
71
|
+
|
72
|
+
#--
|
73
|
+
# TODO: error-handling - I was tooo lazy.....
|
74
|
+
#++
|
75
|
+
|
76
|
+
rescue Savon::Error => error
|
77
|
+
if error.message.nil?
|
78
|
+
puts "invalid username/password"
|
79
|
+
else
|
80
|
+
puts error.to_s
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
end # class
|
85
|
+
|
86
|
+
end # module
|
@@ -0,0 +1,192 @@
|
|
1
|
+
|
2
|
+
module Memotoo
|
3
|
+
|
4
|
+
class Connect
|
5
|
+
|
6
|
+
|
7
|
+
#--
|
8
|
+
# == Examples
|
9
|
+
#
|
10
|
+
# # Setting up the client
|
11
|
+
# @connect=Memotoo::Connect.new("myusername","mypassword")
|
12
|
+
|
13
|
+
# # retrieving search results
|
14
|
+
# @response = @connect.searchContact("ka")
|
15
|
+
|
16
|
+
# # get a contact from id
|
17
|
+
# @response = @connect.getContact(12345)
|
18
|
+
|
19
|
+
# # Add a contact
|
20
|
+
# @response = @connect.addContact({:title => "Mr",:lastname => "Wonder",:firstname => "Test"})
|
21
|
+
|
22
|
+
# # modify a contact
|
23
|
+
# @response = @connect.modifyContact({:id=>"12345",:lastname=>"New",:jobtitle => "cat-doctor",:otherphone => "12345"})
|
24
|
+
|
25
|
+
#
|
26
|
+
# # extracting lastnames of search results
|
27
|
+
# # use this in console only for a few results - the output is to big !
|
28
|
+
#++ @response.each {|contact|puts contact[:id]+"-"+contact[:firstname]+" "+contact[:lastname]}
|
29
|
+
|
30
|
+
|
31
|
+
#[searchparameter:]
|
32
|
+
# {:search=>"something", :limit_start=>0, :limit_nb=>100}
|
33
|
+
#* required:
|
34
|
+
# search
|
35
|
+
#* optional:
|
36
|
+
# limit_start
|
37
|
+
# limit_nb
|
38
|
+
#e.g. @connect.searchContact({:search=>"ka", :limit_nb=>50})
|
39
|
+
|
40
|
+
def searchContact(searchparameter={})
|
41
|
+
check=has_fields(searchparameter, :search)
|
42
|
+
if check[0]
|
43
|
+
search = { :limit_start => '0',
|
44
|
+
:limit_nb => '100'
|
45
|
+
}.merge!(searchparameter)
|
46
|
+
search_response = apicall(:searchContact, search)
|
47
|
+
# returns an array of contacts from search result
|
48
|
+
search_response.to_hash.seek :search_contact_response, :return, :contact
|
49
|
+
else
|
50
|
+
# returns false and a message
|
51
|
+
go_home(check[1])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# id = integer
|
56
|
+
# e.g. @connect.getContact(12345)
|
57
|
+
def getContact(id)
|
58
|
+
contact = apicall(:getContact, { :id => id })
|
59
|
+
# returns the contact
|
60
|
+
contact.to_hash.seek :get_contact_response, :return, :contact
|
61
|
+
end
|
62
|
+
|
63
|
+
|
64
|
+
# id = integer
|
65
|
+
# e.g. @connect.deleteContact(12345)
|
66
|
+
def deleteContact(id)
|
67
|
+
contact = apicall(:deleteContact, { :id => id })
|
68
|
+
# deletes the contact - returns true when contact is deleted
|
69
|
+
contact.to_hash.seek :delete_contact_response, :ok
|
70
|
+
end
|
71
|
+
|
72
|
+
# required: lastname and id
|
73
|
+
#
|
74
|
+
# optional: all other \contact_details - see contact fields at bottom
|
75
|
+
def modifyContact(details={})
|
76
|
+
check=has_fields(details, :lastname, :id)
|
77
|
+
if check[0]
|
78
|
+
contact = apicall(:modifyContact, { :contact => details })
|
79
|
+
# return true if the changed happened
|
80
|
+
contact.to_hash.seek :modify_contact_response, :ok
|
81
|
+
else
|
82
|
+
# returns false, if lastname and id is not given
|
83
|
+
go_home(check[1])
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# required: lastname
|
88
|
+
#
|
89
|
+
# optional: all other contact_details
|
90
|
+
def addContact(details={})
|
91
|
+
check=has_fields(details, :lastname)
|
92
|
+
if check[0]
|
93
|
+
contact = apicall(:addContact, { :contact => details })
|
94
|
+
# return the id from the new contact -> get it in my own db? maybe
|
95
|
+
contact.to_hash.seek :add_contact_response, :id
|
96
|
+
else
|
97
|
+
# returns false, if lastname is not given
|
98
|
+
go_home(check[1])
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# ----------------------------------------
|
103
|
+
#:section: contact_details
|
104
|
+
# all contacts fields
|
105
|
+
# :id
|
106
|
+
# :title => 'Mr.',
|
107
|
+
# :lastname => 'test',
|
108
|
+
# :firstname => 'user',
|
109
|
+
# :middlename => '',
|
110
|
+
# :nickname => 'bob',
|
111
|
+
# :suffix => '',
|
112
|
+
# :birthday => '1975-02-14', // Format YYYY-MM-DD
|
113
|
+
# :homeaddress => '',
|
114
|
+
# :homecity => 'new york',
|
115
|
+
# :homepostalcode => '',
|
116
|
+
# :homestate => '',
|
117
|
+
# :homecountry => 'usa',
|
118
|
+
# :homeemail => '',
|
119
|
+
# :homephone => '',
|
120
|
+
# :homemobile => '',
|
121
|
+
# :homefax => '',
|
122
|
+
# :homewebpage => '',
|
123
|
+
# :businessaddress => '',
|
124
|
+
# :businesscity => '',
|
125
|
+
# :businesspostalcode => '',
|
126
|
+
# :businessstate => '',
|
127
|
+
# :businesscountry => '',
|
128
|
+
# :businessemail => '',
|
129
|
+
# :businessphone => '',
|
130
|
+
# :businessmobile => '',
|
131
|
+
# :businessfax => '',
|
132
|
+
# :businesswebpage => '',
|
133
|
+
# :company => '',
|
134
|
+
# :department => '',
|
135
|
+
# :jobtitle => '',
|
136
|
+
# :notes => '',
|
137
|
+
# :otheraddress => '',
|
138
|
+
# :othercity => '',
|
139
|
+
# :otherpostalcode => '',
|
140
|
+
# :otherstate => '',
|
141
|
+
# :othercountry => '',
|
142
|
+
# :otheremail => '',
|
143
|
+
# :otherphone => '',
|
144
|
+
# :othermobile => '',
|
145
|
+
# :otherfax => '',
|
146
|
+
# :skypeid => '',
|
147
|
+
# :msnid => '',
|
148
|
+
# :aimid => '',
|
149
|
+
# :pager => '',
|
150
|
+
# :carphone => '',
|
151
|
+
# :managersname => '',
|
152
|
+
# :assistantsname => '',
|
153
|
+
# :assistantsphone => '',
|
154
|
+
# :parent => '',
|
155
|
+
# :spouse => '',
|
156
|
+
# :children => '',
|
157
|
+
# :custom1 => '',
|
158
|
+
# :custom2 => '',
|
159
|
+
# :custom3 => '',
|
160
|
+
# :custom4 => '',
|
161
|
+
# :group => '0',
|
162
|
+
# :photo => '', // Photo encoded with Base64
|
163
|
+
# ----------------------------------------
|
164
|
+
|
165
|
+
|
166
|
+
private
|
167
|
+
|
168
|
+
def go_home(message)
|
169
|
+
puts "missing fields: " + message.to_s
|
170
|
+
false
|
171
|
+
end
|
172
|
+
|
173
|
+
def has_fields(thehash, *args)
|
174
|
+
valid=true
|
175
|
+
retarr=[]
|
176
|
+
args.each do |arg_item|
|
177
|
+
unless thehash.has_key?(arg_item)
|
178
|
+
valid = false
|
179
|
+
retarr << arg_item
|
180
|
+
end
|
181
|
+
end
|
182
|
+
[valid, retarr]
|
183
|
+
end
|
184
|
+
|
185
|
+
|
186
|
+
end # class
|
187
|
+
|
188
|
+
end # module
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# found here: http://coryodaniel.com/index.php/2009/12/30/ruby-getting-deeply-nested-values-from-a-hash-in-one-line-of-code/
|
2
|
+
|
3
|
+
# use with: @key_i_need = @event.seek :coordinator, :api_license, :key
|
4
|
+
# instead of: @key_i_need = @event[:coordinator][:api_license][:key]
|
5
|
+
|
6
|
+
class Hash # :nodoc: all
|
7
|
+
def seek(*_keys_)
|
8
|
+
last_level = self
|
9
|
+
sought_value = nil
|
10
|
+
|
11
|
+
_keys_.each_with_index do |_key_, _idx_|
|
12
|
+
if last_level.is_a?(Hash) && last_level.has_key?(_key_)
|
13
|
+
if _idx_ + 1 == _keys_.length
|
14
|
+
sought_value = last_level[_key_]
|
15
|
+
else
|
16
|
+
last_level = last_level[_key_]
|
17
|
+
end
|
18
|
+
else
|
19
|
+
break
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
sought_value
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns a new Hash with +self+ and +other_hash+ merged recursively.
|
27
|
+
# Modifies the receiver in place.
|
28
|
+
# => already in savon gem
|
29
|
+
# => in case a time come and it will be away - just uncomment it
|
30
|
+
# def deep_merge!(other_hash)
|
31
|
+
# other_hash.each_pair do |k,v|
|
32
|
+
# tv = self[k]
|
33
|
+
# self[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? tv.deep_merge(v) : v
|
34
|
+
# end
|
35
|
+
# self
|
36
|
+
# end unless defined? deep_merge!
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'memotoo'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,169 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: memotoo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Karsten Redmer
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-05-14 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
prerelease: false
|
23
|
+
name: savon
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
requirement: *id001
|
34
|
+
type: :runtime
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
prerelease: false
|
37
|
+
name: shoulda
|
38
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
requirement: *id002
|
48
|
+
type: :development
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
prerelease: false
|
51
|
+
name: bundler
|
52
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ~>
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 23
|
58
|
+
segments:
|
59
|
+
- 1
|
60
|
+
- 0
|
61
|
+
- 0
|
62
|
+
version: 1.0.0
|
63
|
+
requirement: *id003
|
64
|
+
type: :development
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
prerelease: false
|
67
|
+
name: jeweler
|
68
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ~>
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 7
|
74
|
+
segments:
|
75
|
+
- 1
|
76
|
+
- 5
|
77
|
+
- 2
|
78
|
+
version: 1.5.2
|
79
|
+
requirement: *id004
|
80
|
+
type: :development
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
prerelease: false
|
83
|
+
name: rcov
|
84
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 3
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
version: "0"
|
93
|
+
requirement: *id005
|
94
|
+
type: :development
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
prerelease: false
|
97
|
+
name: savon
|
98
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
hash: 3
|
104
|
+
segments:
|
105
|
+
- 0
|
106
|
+
version: "0"
|
107
|
+
requirement: *id006
|
108
|
+
type: :runtime
|
109
|
+
description: A gem for connecting to the memotoo soap-api and handle your contact needs
|
110
|
+
email: k.redmer@yahoo.de
|
111
|
+
executables: []
|
112
|
+
|
113
|
+
extensions: []
|
114
|
+
|
115
|
+
extra_rdoc_files:
|
116
|
+
- LICENSE.txt
|
117
|
+
- README.rdoc
|
118
|
+
files:
|
119
|
+
- .document
|
120
|
+
- Gemfile
|
121
|
+
- Gemfile.lock
|
122
|
+
- LICENSE.txt
|
123
|
+
- README.rdoc
|
124
|
+
- Rakefile
|
125
|
+
- VERSION
|
126
|
+
- lib/memotoo.rb
|
127
|
+
- lib/memotoo/connect.rb
|
128
|
+
- lib/memotoo/contact/contact.rb
|
129
|
+
- lib/memotoo/core-ext/hash.rb
|
130
|
+
- lib/memotoo/core-ext/kernel.rb
|
131
|
+
- test/helper.rb
|
132
|
+
- test/test_memotoo.rb
|
133
|
+
has_rdoc: true
|
134
|
+
homepage: http://github.com/kredmer/memotoo
|
135
|
+
licenses:
|
136
|
+
- MIT
|
137
|
+
post_install_message:
|
138
|
+
rdoc_options: []
|
139
|
+
|
140
|
+
require_paths:
|
141
|
+
- lib
|
142
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
+
none: false
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
hash: 3
|
148
|
+
segments:
|
149
|
+
- 0
|
150
|
+
version: "0"
|
151
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
+
none: false
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
hash: 3
|
157
|
+
segments:
|
158
|
+
- 0
|
159
|
+
version: "0"
|
160
|
+
requirements: []
|
161
|
+
|
162
|
+
rubyforge_project:
|
163
|
+
rubygems_version: 1.3.7
|
164
|
+
signing_key:
|
165
|
+
specification_version: 3
|
166
|
+
summary: A gem for connecting to the memotoo soap-api
|
167
|
+
test_files:
|
168
|
+
- test/helper.rb
|
169
|
+
- test/test_memotoo.rb
|