mail-sympa 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +8 -2
- data/README +1 -4
- data/lib/mail/sympa.rb +19 -1
- data/mail-sympa.gemspec +1 -3
- data/test/test_mail_sympa.rb +32 -1
- metadata +8 -10
data/CHANGES
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
+
= 1.0.0 - 16-Jun-2011
|
2
|
+
* Added the create_list and close_list methods and corresponding tests. Thanks
|
3
|
+
go to Blair Christensen for both.
|
4
|
+
* Added 0.1.1 changes to this file that I forgot.
|
5
|
+
* Bumped the version to 1.0.0, as I have no more future plans for this library.
|
6
|
+
|
1
7
|
= 0.1.1 - 17-Jan-2011
|
2
|
-
* Fixed two parser warnings caused by missing commas
|
3
|
-
* Added a clean
|
8
|
+
* Fixed two parser warnings caused by missing commas.
|
9
|
+
* Added a clean and default task to the Rakefile.
|
4
10
|
|
5
11
|
= 0.1.0 - 13-Apr-2010
|
6
12
|
* Initial release
|
data/README
CHANGED
@@ -26,14 +26,11 @@
|
|
26
26
|
The Sympa#add and Sympa#del methods return an empty string instead of
|
27
27
|
a boolean. I am unsure why.
|
28
28
|
|
29
|
-
= Future Plans
|
30
|
-
Add wrappers for createList and closeList.
|
31
|
-
|
32
29
|
= License
|
33
30
|
Artistic 2.0
|
34
31
|
|
35
32
|
= Copyright
|
36
|
-
(C) 2010 Daniel J. Berger, Mark Sallee, David Salisbury
|
33
|
+
(C) 2010-2011 Daniel J. Berger, Mark Sallee, David Salisbury
|
37
34
|
All Rights Reserved
|
38
35
|
|
39
36
|
= Warranty
|
data/lib/mail/sympa.rb
CHANGED
@@ -8,7 +8,7 @@ module Mail
|
|
8
8
|
class Error < StandardError; end
|
9
9
|
|
10
10
|
# The version of the mail-sympa library.
|
11
|
-
VERSION = '
|
11
|
+
VERSION = '1.0.0'
|
12
12
|
|
13
13
|
# The session cookie returned by the login method.
|
14
14
|
attr_reader :cookie
|
@@ -229,5 +229,23 @@ module Mail
|
|
229
229
|
alias delete del
|
230
230
|
alias unsubscribe signoff
|
231
231
|
alias url endpoint
|
232
|
+
|
233
|
+
# Creates list +list_name+ with subject +subject+. Returns boolean.
|
234
|
+
#
|
235
|
+
def create_list(list_name, subject, template='discussion_list', description=' ', topics=' ')
|
236
|
+
raise Error, 'must login first' unless @cookie
|
237
|
+
@soap.authenticateAndRun(@email, @cookie, 'createList', [list_name, subject, template, description, topics])
|
238
|
+
end
|
239
|
+
|
240
|
+
alias createList create_list
|
241
|
+
|
242
|
+
# Closes list +list_name+. Returns boolean.
|
243
|
+
#
|
244
|
+
def close_list(list_name)
|
245
|
+
raise Error, 'must login first' unless @cookie
|
246
|
+
@soap.authenticateAndRun(@email, @cookie, 'closeList', [list_name])
|
247
|
+
end
|
248
|
+
|
249
|
+
alias closeList close_list
|
232
250
|
end
|
233
251
|
end
|
data/mail-sympa.gemspec
CHANGED
@@ -2,18 +2,16 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'mail-sympa'
|
5
|
-
gem.version = '0.
|
5
|
+
gem.version = '1.0.0'
|
6
6
|
gem.authors = ['Daniel J. Berger', 'David Salisbury', 'Mark Sallee']
|
7
7
|
gem.license = 'Artistic 2.0'
|
8
8
|
gem.description = 'Ruby interface for the Sympa mailing list server'
|
9
9
|
gem.email = 'djberg96@gmail.com'
|
10
10
|
gem.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
11
11
|
gem.test_files = ['test/test_mail_sympa.rb']
|
12
|
-
gem.has_rdoc = true
|
13
12
|
gem.homepage = 'http://github.com/djberg96/mail-sympa'
|
14
13
|
|
15
14
|
gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
|
16
|
-
gem.rubyforge_project = 'N/A'
|
17
15
|
|
18
16
|
gem.add_dependency('soap4r', '>= 1.5.8')
|
19
17
|
|
data/test/test_mail_sympa.rb
CHANGED
@@ -39,7 +39,7 @@ class MailSympaTest < Test::Unit::TestCase
|
|
39
39
|
end
|
40
40
|
|
41
41
|
test "version constant is expected value" do
|
42
|
-
assert_equal('
|
42
|
+
assert_equal('1.0.0', Mail::Sympa::VERSION)
|
43
43
|
end
|
44
44
|
|
45
45
|
test "endpoint method basic functionality" do
|
@@ -276,6 +276,37 @@ class MailSympaTest < Test::Unit::TestCase
|
|
276
276
|
assert_raise(ArgumentError){ @mail.signoff(@user, @list) }
|
277
277
|
end
|
278
278
|
|
279
|
+
test "create_list basic functionality" do
|
280
|
+
assert_respond_to(@mail, :create_list)
|
281
|
+
end
|
282
|
+
|
283
|
+
test "create_list returns expected result" do
|
284
|
+
login
|
285
|
+
assert_boolean(@mail.create_list("test-#{Time.now.to_i.to_s}", 'Test List'))
|
286
|
+
end
|
287
|
+
|
288
|
+
test "create_list requires at least two arguments" do
|
289
|
+
assert_raise(ArgumentError){ @mail.create_list }
|
290
|
+
assert_raise(ArgumentError){ @mail.create_list("test-#{Time.now.to_i.to_s}") }
|
291
|
+
end
|
292
|
+
|
293
|
+
test "close_list basic functionality" do
|
294
|
+
assert_respond_to(@mail, :close_list)
|
295
|
+
end
|
296
|
+
|
297
|
+
test "close_list returns expected result" do
|
298
|
+
login
|
299
|
+
list_name = "test-#{Time.now.to_i.to_s}"
|
300
|
+
@mail.create_list(list_name, 'Test List')
|
301
|
+
notify("The documentation says this should return a boolean")
|
302
|
+
assert_boolean(@mail.close_list(list_name))
|
303
|
+
end
|
304
|
+
|
305
|
+
test "close_list requires one argument only" do
|
306
|
+
assert_raise(ArgumentError){ @mail.close_list }
|
307
|
+
assert_raise(ArgumentError){ @mail.close_list("A", "B")}
|
308
|
+
end
|
309
|
+
|
279
310
|
def teardown
|
280
311
|
@mail = nil
|
281
312
|
@user = nil
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail-sympa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
7
|
- 1
|
10
|
-
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel J. Berger
|
@@ -17,8 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-
|
21
|
-
default_executable:
|
20
|
+
date: 2011-06-16 00:00:00 Z
|
22
21
|
dependencies:
|
23
22
|
- !ruby/object:Gem::Dependency
|
24
23
|
name: soap4r
|
@@ -54,7 +53,6 @@ files:
|
|
54
53
|
- Rakefile
|
55
54
|
- README
|
56
55
|
- test/test_mail_sympa.rb
|
57
|
-
has_rdoc: true
|
58
56
|
homepage: http://github.com/djberg96/mail-sympa
|
59
57
|
licenses:
|
60
58
|
- Artistic 2.0
|
@@ -83,8 +81,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
81
|
version: "0"
|
84
82
|
requirements: []
|
85
83
|
|
86
|
-
rubyforge_project:
|
87
|
-
rubygems_version: 1.
|
84
|
+
rubyforge_project:
|
85
|
+
rubygems_version: 1.8.2
|
88
86
|
signing_key:
|
89
87
|
specification_version: 3
|
90
88
|
summary: The mail-sympa library provides a Ruby interface to the Sympa mailing list server software. This is a convenient and pretty wrapper for the various SOAP functions that Sympa server publishes. See http://www.sympa.org for more information.
|