posix_mq 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df411b34002c2ef4be24cd08c876f27d36e1902e
4
- data.tar.gz: b3bb9d8ade45215ec378ffaef6a8e26a43c15801
3
+ metadata.gz: 28c3337592f1850091340d1e8e25434d54f70c01
4
+ data.tar.gz: d639e8b75f7e786d802347440d1260f8104f29a9
5
5
  SHA512:
6
- metadata.gz: 6c2520418f996810ba8100fbefad750726dd05d32fa7cebc6ebc875283282c2aefa0eeee16c88e0f91b33e237ac8f2a6faba5be781869765926b1e3b40cf46c3
7
- data.tar.gz: ffcaeeaede515f86b9348956bc40462d357b617ae76ca66d49eef358a9e43035e5aeeffb4d18f8285345a92e141f82b23bc9387485cd8e4f785bb6ff742cf1bf
6
+ metadata.gz: 9911162a18e4211faf0f1ff1e70e0867b8c7fff3c89a918a1ccacdc1492ddb002a74260fbaa8deefa63c7c6aa59974c9e5da49ac7c1922c010d89b443ee51520
7
+ data.tar.gz: 71d299abc47d5f2b1f03fb11e94b7dd2cfcd1a06af0d1eead9b716b8786df6ab0900cffc0f2f590cb2697cf20f71a1ac152da0754d0407f8e6af8199e9709ff2
data/.olddoc.yml CHANGED
@@ -1,10 +1,9 @@
1
1
  ---
2
- rdoc_url: http://bogomips.org/ruby_posix_mq/
3
- cgit_url: http://bogomips.org/ruby_posix_mq.git
2
+ rdoc_url: https://bogomips.org/ruby_posix_mq/
3
+ cgit_url: https://bogomips.org/ruby_posix_mq.git
4
4
  git_url: git://bogomips.org/ruby_posix_mq.git
5
5
  public_email: ruby-posix-mq@bogomips.org
6
- private_email: bofh@bogomips.org
7
- ml_url: http://bogomips.org/ruby-posix-mq/
6
+ ml_url: https://bogomips.org/ruby-posix-mq/
8
7
  changelog_since: 0.4.0
9
8
  merge_html:
10
9
  posix-mq-rb_1: Documentation/posix-mq-rb.1.html
data/GIT-VERSION-GEN CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v2.3.0
4
+ DEF_VER=v2.4.0
5
5
 
6
6
  LF='
7
7
  '
data/GNUmakefile CHANGED
@@ -17,8 +17,8 @@ man html:
17
17
 
18
18
  pkg_extra += $(man1_paths)
19
19
  $(man1_paths): man
20
- include pkg.mk
21
20
 
22
- doc::
21
+ doc:: html
23
22
  install -m644 COPYING-GPL2 doc/COPYING-GPL2
23
+ include pkg.mk
24
24
  .PHONY: man html
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = posix_mq - POSIX Message Queues for Ruby
1
+ = posix_mq - POSIX message queues for Ruby
2
2
 
3
3
  POSIX message queues allow local processes to exchange data in the form
4
4
  of messages. This API is distinct from that provided by System V
@@ -47,7 +47,7 @@ compiler and the matching Ruby development libraries and headers.
47
47
  If you plan on using the command-line client, a tarball installation
48
48
  starts up faster and is recommended. Just grab the tarball from:
49
49
 
50
- http://bogomips.org/ruby_posix_mq/files/
50
+ https://bogomips.org/ruby_posix_mq/files/
51
51
  Unpack it, and run "ruby setup.rb"
52
52
 
53
53
  Otherwise, via RubyGems: gem install posix_mq
@@ -97,7 +97,7 @@ You can get the latest source via git from the following locations:
97
97
 
98
98
  You may also browse the code from the web:
99
99
 
100
- * http://bogomips.org/ruby_posix_mq.git
100
+ * https://bogomips.org/ruby_posix_mq.git
101
101
  * http://repo.or.cz/w/ruby_posix_mq.git (gitweb)
102
102
 
103
103
  Inline patches (from "git format-patch") to the mailing list are
@@ -123,7 +123,7 @@ will usually get a response within 24-72 hours.
123
123
 
124
124
  Subscription is optional: mailto:ruby-posix-mq+subscribe@bogomips.org
125
125
 
126
- Read-only mail archives are available over HTTP and NNTP:
126
+ Read-only mail archives are available over HTTPS and NNTP:
127
127
 
128
- http://bogomips.org/ruby-posix-mq/
128
+ https://bogomips.org/ruby-posix-mq/
129
129
  nntp://news.public-inbox.org/inbox.comp.lang.ruby.posix-mq
@@ -317,11 +317,22 @@ static void _free(void *ptr)
317
317
  xfree(ptr);
318
318
  }
319
319
 
320
+ static size_t memsize(const void *ptr)
321
+ {
322
+ return sizeof(struct posix_mq);
323
+ }
324
+
325
+ static const rb_data_type_t mqtype = {
326
+ "posix_mq",
327
+ { mark, _free, memsize, /* reserved */ },
328
+ /* parent, data, [ flags ] */
329
+ };
330
+
320
331
  /* automatically called at creation (before initialize) */
321
332
  static VALUE alloc(VALUE klass)
322
333
  {
323
334
  struct posix_mq *mq;
324
- VALUE rv = Data_Make_Struct(klass, struct posix_mq, mark, _free, mq);
335
+ VALUE rv = TypedData_Make_Struct(klass, struct posix_mq, &mqtype, mq);
325
336
 
326
337
  mq->des = MQD_INVALID;
327
338
  mq->autoclose = 1;
@@ -341,7 +352,7 @@ static struct posix_mq *get(VALUE self, int need_valid)
341
352
  {
342
353
  struct posix_mq *mq;
343
354
 
344
- Data_Get_Struct(self, struct posix_mq, mq);
355
+ TypedData_Get_Struct(self, struct posix_mq, &mqtype, mq);
345
356
 
346
357
  if (need_valid && mq->des == MQD_INVALID)
347
358
  rb_raise(rb_eIOError, "closed queue descriptor");
@@ -512,7 +523,7 @@ static VALUE init(int argc, VALUE *argv, VALUE self)
512
523
  rb_sys_fail("mq_open");
513
524
  }
514
525
 
515
- mq->name = rb_str_dup(name);
526
+ mq->name = rb_str_new_frozen(name);
516
527
  if (x.oflags & O_NONBLOCK)
517
528
  mq->attr.mq_flags = O_NONBLOCK;
518
529
 
@@ -876,6 +887,7 @@ static VALUE name(VALUE self)
876
887
  rb_raise(rb_eArgError, "can not get name of an adopted socket");
877
888
  }
878
889
 
890
+ /* XXX compatibility: in retrospect, we could return a frozen string */
879
891
  return rb_str_dup(mq->name);
880
892
  }
881
893
 
@@ -896,6 +908,7 @@ static int lookup_sig(VALUE sig)
896
908
  VALUE mSignal = rb_const_get(rb_cObject, rb_intern("Signal"));
897
909
 
898
910
  list = rb_funcall(mSignal, rb_intern("list"), 0, 0);
911
+ rb_obj_freeze(list);
899
912
  rb_global_variable(&list);
900
913
  }
901
914
 
@@ -1213,11 +1226,11 @@ void Init_posix_mq_ext(void)
1213
1226
  rb_define_method(cPOSIX_MQ, "autoclose=", setautoclose, 1);
1214
1227
  #ifdef MQD_TO_FD
1215
1228
  rb_define_method(cPOSIX_MQ, "to_io", to_io, 0);
1229
+ id_setautoclose = rb_intern("autoclose=");
1216
1230
  #endif
1217
1231
 
1218
1232
  #ifdef FD_TO_MQD
1219
1233
  rb_define_module_function(cPOSIX_MQ, "for_fd", for_fd, 1);
1220
- id_setautoclose = rb_intern("autoclose=");
1221
1234
  #endif
1222
1235
 
1223
1236
  id_new = rb_intern("new");
data/posix_mq.gemspec CHANGED
@@ -1,23 +1,25 @@
1
1
  # -*- encoding: binary -*-
2
- ENV["VERSION"] or abort "VERSION= must be specified"
3
- manifest = File.readlines('.manifest').map! { |x| x.chomp! }
4
- require 'olddoc'
5
- extend Olddoc::Gemspec
6
- name, summary, title = readme_metadata
2
+ ENV["VERSION"] ||= '2.4.0'
3
+ if File.exist?('.manifest')
4
+ manifest = IO.readlines('.manifest').map!(&:chomp!)
5
+ else
6
+ manifest = `git ls-files`.split("\n")
7
+ end
7
8
 
8
9
  Gem::Specification.new do |s|
9
10
  s.name = %q{posix_mq}
10
11
  s.version = ENV["VERSION"].dup
11
12
  s.authors = ["Ruby POSIX MQ hackers"]
12
- s.description = readme_description
13
+ s.description = File.read('README').split("\n\n")[1]
13
14
  s.email = %q{ruby-posix-mq@bogomips.org}
14
15
  s.executables = %w(posix-mq-rb)
15
16
  s.extensions = %w(ext/posix_mq/extconf.rb)
16
- s.extra_rdoc_files = extra_rdoc_files(manifest)
17
+ s.extra_rdoc_files = IO.readlines('.document').map!(&:chomp!).keep_if do |f|
18
+ File.exist?(f)
19
+ end
17
20
  s.files = manifest
18
- s.homepage = Olddoc.config['rdoc_url']
19
- s.summary = summary
21
+ s.homepage = 'https://bogomips.org/ruby_posix_mq/'
22
+ s.summary = 'POSIX message queues for Ruby'
20
23
  s.test_files = manifest.grep(%r{\Atest/test_.*\.rb\z})
21
- s.add_development_dependency(%q<olddoc>, "~> 1.0")
22
24
  s.licenses = %w(GPL-2.0 LGPL-3.0+)
23
25
  end
@@ -303,9 +303,10 @@ class Test_POSIX_MQ < Test::Unit::TestCase
303
303
  begin
304
304
  @mq.notify = :USR1
305
305
  rescue Errno::EBUSY
306
- exit 0
306
+ exit!(0)
307
307
  rescue => e
308
- p e
308
+ exit!(0) if Errno::EBADF === e && RUBY_PLATFORM =~ /freebsd/
309
+ warn "#{e.message} (#{e.class})\n"
309
310
  end
310
311
  exit! 1
311
312
  end
@@ -326,14 +327,28 @@ class Test_POSIX_MQ < Test::Unit::TestCase
326
327
  end
327
328
 
328
329
  def test_setattr_fork
330
+ return if RUBY_PLATFORM !~ /freebsd/
329
331
  @mq = POSIX_MQ.new @path, IO::CREAT|IO::WRONLY, 0666
330
332
  mq_attr = POSIX_MQ::Attr.new(IO::NONBLOCK)
331
333
  @mq.attr = mq_attr
332
334
  assert @mq.nonblock?
333
335
 
334
- pid = fork { @mq.nonblock = false }
335
- assert Process.waitpid2(pid)[1].success?
336
- assert ! @mq.nonblock?
336
+ pid = fork do
337
+ begin
338
+ @mq.nonblock = false
339
+ rescue => e
340
+ exit!(2) if Errno::EBADF === e && RUBY_PLATFORM =~ /freebsd/
341
+ warn "#{e.message} (#{e.class})\n"
342
+ exit!(1)
343
+ end
344
+ exit!(0)
345
+ end
346
+ _, status = Process.waitpid2(pid)
347
+ if status.success?
348
+ assert ! @mq.nonblock?
349
+ else
350
+ assert_equal 2, status.exitstatus
351
+ end
337
352
  end
338
353
 
339
354
  def test_new_nonblocking
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posix_mq
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruby POSIX MQ hackers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-02 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: olddoc
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.0'
11
+ date: 2017-03-20 00:00:00.000000000 Z
12
+ dependencies: []
27
13
  description: |-
28
14
  POSIX message queues allow local processes to exchange data in the form
29
15
  of messages. This API is distinct from that provided by System V
@@ -37,7 +23,6 @@ extra_rdoc_files:
37
23
  - README
38
24
  - LICENSE
39
25
  - NEWS
40
- - lib/posix_mq.rb
41
26
  - ext/posix_mq/posix_mq.c
42
27
  - posix-mq-rb_1
43
28
  files:
@@ -69,7 +54,7 @@ files:
69
54
  - posix_mq.gemspec
70
55
  - setup.rb
71
56
  - test/test_posix_mq.rb
72
- homepage: http://bogomips.org/ruby_posix_mq/
57
+ homepage: https://bogomips.org/ruby_posix_mq/
73
58
  licenses:
74
59
  - GPL-2.0
75
60
  - LGPL-3.0+
@@ -90,9 +75,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
75
  version: '0'
91
76
  requirements: []
92
77
  rubyforge_project:
93
- rubygems_version: 2.5.2
78
+ rubygems_version: 2.6.10
94
79
  signing_key:
95
80
  specification_version: 4
96
- summary: POSIX Message Queues for Ruby
81
+ summary: POSIX message queues for Ruby
97
82
  test_files:
98
83
  - test/test_posix_mq.rb