mail-sympa 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 80e5a9d1f11092aa68c5908670f85ef32334e279
4
+ data.tar.gz: dce53c46cf3e526dc799d67c00215fab06ed1b0f
5
+ SHA512:
6
+ metadata.gz: dc125416bcbace4986a3b7153ed16618c4db8b839a962173123a1be42c2373b3868d32fe42debba09bdacd47c77767eab7fa859e1f7d309c65eb5c7e303a0368
7
+ data.tar.gz: 08616cb32a4e507e6737df0b89d65a1ad132818f10e4454de618e96739c5bbc65d845830f747a822002e4d7f6e9a381f7a6fe2d6e193afaeaaf3ea30fe665375
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ = 1.2.0 - 12-Mar-2016
2
+ * No longer supports Ruby 1.8, and made corresponding changes to code.
3
+ * Updated the Rakefile tasks. Now assumes Rubygems 2.x.
4
+ * Added a mail-sympa.rb file for convenience.
5
+ * Removed Gemfile.lock.
6
+
1
7
  = 1.1.0 - 19-Jul-2011
2
8
  * Added the authenticate_remote_app_and_run method to run in trusted context
3
9
  and support for Ruby 1.9+. Thanks go to Blair Christensen for patches.
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'http://rubygems.org'
2
+ gem 'soap4r-ruby1.9'
3
+
4
+ group :development, :test do
5
+ gem 'test-unit'
6
+ gem 'dbi-dbrc'
7
+ end
8
+
9
+ # vim: syntax=ruby
data/MANIFEST CHANGED
@@ -3,5 +3,6 @@
3
3
  * README
4
4
  * Rakefile
5
5
  * mail-sympa.gemspec
6
+ * lib/mail-sympa.rb
6
7
  * lib/mail/sympa.rb
7
8
  * test/test_mail_sympa.rb
data/README CHANGED
@@ -33,7 +33,7 @@
33
33
  Artistic 2.0
34
34
 
35
35
  = Copyright
36
- (C) 2010-2011 Daniel J. Berger, Mark Sallee, David Salisbury
36
+ (C) 2010-2011 Daniel J. Berger, Mark Sallee, David Salisbury, Blair Christensen
37
37
  All Rights Reserved
38
38
 
39
39
  = Warranty
@@ -48,3 +48,5 @@
48
48
  Daniel Berger
49
49
  David Salisbury
50
50
  Mark Sallee
51
+ Blair Christensen
52
+
data/Rakefile CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/clean'
3
3
  require 'rake/testtask'
4
- include Config
5
4
 
6
5
  CLEAN.include("**/*.gem", "**/*.rbc")
7
6
 
@@ -13,8 +12,9 @@ namespace 'gem' do
13
12
 
14
13
  desc 'Build the mail-sympa gem'
15
14
  task :build => [:clean] do
15
+ require 'rubygems/package'
16
16
  spec = eval(IO.read('mail-sympa.gemspec'))
17
- Gem::Builder.new(spec).build
17
+ Gem::Package.build(spec, true)
18
18
  end
19
19
 
20
20
  desc 'Install the mail-sympa gem'
@@ -0,0 +1 @@
1
+ require_relative 'mail/sympa'
@@ -1,5 +1,22 @@
1
- gem 'soap4r-ruby1.9' if RUBY_VERSION > '1.9'
2
- require 'soap/rpc/driver'
1
+ # http://mislav.uniqpath.com/2011/06/ruby-verbose-mode/
2
+ module Kernel
3
+ def silence_warnings
4
+ with_warnings(nil) { yield }
5
+ end
6
+
7
+ def with_warnings(flag)
8
+ old_verbose, $VERBOSE = $VERBOSE, flag
9
+ yield
10
+ ensure
11
+ $VERBOSE = old_verbose
12
+ end
13
+ end unless Kernel.respond_to? :silence_warnings
14
+
15
+ silence_warnings do
16
+ gem 'soap4r-ruby1.9'
17
+ require 'soap/rpc/driver'
18
+ end
19
+
3
20
 
4
21
  # The Mail module serves as a namespace only.
5
22
  module Mail
@@ -9,7 +26,7 @@ module Mail
9
26
  class Error < StandardError; end
10
27
 
11
28
  # The version of the mail-sympa library.
12
- VERSION = '1.1.0'
29
+ VERSION = '1.2.0'
13
30
 
14
31
  # The session cookie returned by the login method.
15
32
  attr_reader :cookie
@@ -251,7 +268,7 @@ module Mail
251
268
 
252
269
  # Run command in trusted context.
253
270
  def authenticate_remote_app_and_run(app_name, app_password, variables, service, parameters)
254
- @soap.authenticateRemoteAppAndRun( app_name, app_password, variables, service, parameters )
271
+ @soap.authenticateRemoteAppAndRun( app_name, app_password, variables, service, parameters )
255
272
  end
256
273
 
257
274
  alias authenticateRemoteAppAndRun authenticate_remote_app_and_run
@@ -1,21 +1,25 @@
1
1
  require 'rubygems'
2
2
 
3
- Gem::Specification.new do |gem|
4
- gem.name = 'mail-sympa'
5
- gem.version = '1.1.0'
6
- gem.authors = ['Daniel J. Berger', 'David Salisbury', 'Mark Sallee']
7
- gem.license = 'Artistic 2.0'
8
- gem.description = 'Ruby interface for the Sympa mailing list server'
9
- gem.email = 'djberg96@gmail.com'
10
- gem.files = Dir['**/*'].reject{ |f| f.include?('git') }
11
- gem.test_files = ['test/test_mail_sympa.rb']
12
- gem.homepage = 'http://github.com/djberg96/mail-sympa'
3
+ Gem::Specification.new do |spec|
4
+ spec.name = 'mail-sympa'
5
+ spec.version = '1.2.0'
6
+ spec.authors = ['Daniel J. Berger', 'David Salisbury', 'Mark Sallee']
7
+ spec.license = 'Artistic 2.0'
8
+ spec.description = 'Ruby interface for the Sympa mailing list server'
9
+ spec.email = 'djberg96@gmail.com'
10
+ spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
11
+ spec.test_files = ['test/test_mail_sympa.rb']
12
+ spec.homepage = 'http://github.com/djberg96/mail-sympa'
13
13
 
14
- gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
14
+ spec.required_ruby_version = '>= 1.9.3'
15
15
 
16
- gem.add_dependency('soap4r', '>= 1.5.8')
16
+ spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
17
17
 
18
- gem.summary = <<-EOF
18
+ spec.add_dependency('soap4r-ruby1.9', '>= 2.0.0')
19
+ spec.add_development_dependency('test-unit', '>= 3.0.0')
20
+ spec.add_development_dependency('dbi-dbrc')
21
+
22
+ spec.summary = <<-EOF
19
23
  The mail-sympa library provides a Ruby interface to the Sympa mailing
20
24
  list server software. This is a convenient and pretty wrapper for the
21
25
  various SOAP functions that Sympa server publishes.
@@ -12,12 +12,9 @@
12
12
  #
13
13
  # For all tests to complete successfully, you must use admin credentials.
14
14
  ##############################################################################
15
- require 'rubygems'
16
- gem 'test-unit'
17
-
18
- require 'test/unit'
19
15
  require 'mail/sympa'
20
16
  require 'dbi/dbrc'
17
+ require 'test-unit'
21
18
 
22
19
  class MailSympaTest < Test::Unit::TestCase
23
20
  def self.startup
@@ -33,13 +30,25 @@ class MailSympaTest < Test::Unit::TestCase
33
30
  @nosub = 'partners'
34
31
  end
35
32
 
33
+ def create_list(name)
34
+ begin
35
+ @mail.info(name)
36
+ rescue
37
+ begin
38
+ @mail.create_list(name, name)
39
+ rescue => e
40
+ fail "list does not exist and could not be created: #{name} - #{e.to_s}"
41
+ end
42
+ end
43
+ end
44
+
36
45
  # Because most methods won't work without logging in first
37
46
  def login
38
47
  @mail.login(@user, @pass)
39
48
  end
40
49
 
41
50
  test "version constant is expected value" do
42
- assert_equal('1.1.0', Mail::Sympa::VERSION)
51
+ assert_equal('1.2.0', Mail::Sympa::VERSION)
43
52
  end
44
53
 
45
54
  test "endpoint method basic functionality" do
@@ -103,6 +112,7 @@ class MailSympaTest < Test::Unit::TestCase
103
112
 
104
113
  test "lists method accepts a topic and subtopic" do
105
114
  login
115
+ create_list(@list)
106
116
  assert_kind_of(Array, @mail.lists(@list))
107
117
  assert_kind_of(Array, @mail.lists(@list, @list))
108
118
  end
@@ -135,13 +145,13 @@ class MailSympaTest < Test::Unit::TestCase
135
145
  assert_kind_of(Array, @mail.complex_lists(@list, @list))
136
146
  end
137
147
 
138
- test "lists method returns empty array if topic or subtopic is not found" do
148
+ test "complex_lists method returns empty array if topic or subtopic is not found" do
139
149
  login
140
150
  assert_equal([], @mail.complex_lists('bogus'))
141
151
  assert_equal([], @mail.complex_lists(@list, 'bogus'))
142
152
  end
143
153
 
144
- test "lists method accepts a maximum of two arguments" do
154
+ test "complex_lists method accepts a maximum of two arguments" do
145
155
  assert_raise(ArgumentError){ @mail.complex_lists(@list, @list, @list) }
146
156
  end
147
157
 
@@ -170,6 +180,7 @@ class MailSympaTest < Test::Unit::TestCase
170
180
 
171
181
  test "review method returns 'no_subscribers' if list has no subscribers" do
172
182
  login
183
+ create_list(@nosub)
173
184
  assert_equal(['no_subscribers'], @mail.review(@nosub))
174
185
  end
175
186
 
metadata CHANGED
@@ -1,90 +1,105 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mail-sympa
3
- version: !ruby/object:Gem::Version
4
- hash: 19
5
- prerelease:
6
- segments:
7
- - 1
8
- - 1
9
- - 0
10
- version: 1.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Daniel J. Berger
14
8
  - David Salisbury
15
9
  - Mark Sallee
16
10
  autorequire:
17
11
  bindir: bin
18
12
  cert_chain: []
19
-
20
- date: 2011-07-19 00:00:00 Z
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
23
- name: soap4r
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
13
+ date: 2016-03-12 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: soap4r-ruby1.9
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
28
19
  - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 19
31
- segments:
32
- - 1
33
- - 5
34
- - 8
35
- version: 1.5.8
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0
36
22
  type: :runtime
37
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 2.0.0
29
+ - !ruby/object:Gem::Dependency
30
+ name: test-unit
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: 3.0.0
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 3.0.0
43
+ - !ruby/object:Gem::Dependency
44
+ name: dbi-dbrc
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
38
57
  description: Ruby interface for the Sympa mailing list server
39
58
  email: djberg96@gmail.com
40
59
  executables: []
41
-
42
60
  extensions: []
43
-
44
- extra_rdoc_files:
61
+ extra_rdoc_files:
45
62
  - README
46
63
  - CHANGES
47
64
  - MANIFEST
48
- files:
65
+ files:
49
66
  - CHANGES
67
+ - Gemfile
68
+ - lib
69
+ - lib/mail
50
70
  - lib/mail/sympa.rb
71
+ - lib/mail-sympa.rb
51
72
  - mail-sympa.gemspec
52
73
  - MANIFEST
53
74
  - Rakefile
54
75
  - README
76
+ - test
55
77
  - test/test_mail_sympa.rb
56
78
  homepage: http://github.com/djberg96/mail-sympa
57
- licenses:
79
+ licenses:
58
80
  - Artistic 2.0
81
+ metadata: {}
59
82
  post_install_message:
60
83
  rdoc_options: []
61
-
62
- require_paths:
84
+ require_paths:
63
85
  - lib
64
- required_ruby_version: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
67
88
  - - ">="
68
- - !ruby/object:Gem::Version
69
- hash: 3
70
- segments:
71
- - 0
72
- version: "0"
73
- required_rubygems_version: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
89
+ - !ruby/object:Gem::Version
90
+ version: 1.9.3
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
76
93
  - - ">="
77
- - !ruby/object:Gem::Version
78
- hash: 3
79
- segments:
80
- - 0
81
- version: "0"
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
82
96
  requirements: []
83
-
84
97
  rubyforge_project:
85
- rubygems_version: 1.8.3
98
+ rubygems_version: 2.4.5.1
86
99
  signing_key:
87
- specification_version: 3
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.
89
- test_files:
100
+ specification_version: 4
101
+ summary: The mail-sympa library provides a Ruby interface to the Sympa mailing list
102
+ server software. This is a convenient and pretty wrapper for the various SOAP functions
103
+ that Sympa server publishes. See http://www.sympa.org for more information.
104
+ test_files:
90
105
  - test/test_mail_sympa.rb