mkfifo 0.0.1 → 0.1.1

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: 93ea48e1ece73d0f027e015d482c96fa94884e91
4
+ data.tar.gz: 0a98094a40e5a05b147450aae9c738c10c8048e9
5
+ SHA512:
6
+ metadata.gz: 7ad9c6a22351f18da04465fed113fcb0d0413575dd8771ac2e379625f21c3800512af2b9b6e9752dc7fe2e7df2b75f6b87180c7ff7a6d4bfa1f7854eb450a3d0
7
+ data.tar.gz: 17ab52f723d9779b7a01d2b80b576cdb24676a15296082325aec9bdcc4dc538fdae2a2669a01eb92e68261d4c6d4984a409b8a5f28f09af3c3fa0f20c0d37ce0
@@ -0,0 +1,8 @@
1
+ = Changelog
2
+
3
+ == 0.1.0
4
+
5
+ * File::mkfifo now raises +TypeError+ instead of +ArgumentError+ for
6
+ an object of incorrect type. (Quintus)
7
+ * File::mkfifo now accepts Pathname objects. (Quintus)
8
+ * File::mkfifo now raises +IOError+ instead of +Exception+. (Quintus)
@@ -0,0 +1,8 @@
1
+ = mkfifo
2
+ Binds the mkfifo(3) function to Ruby as a class method for Ruby’s
3
+ built-in +File+ class.
4
+
5
+ == Usage
6
+
7
+ require "mkfifo"
8
+ File.mkfifo('/path/to/file')
@@ -1,4 +1,5 @@
1
1
  #include <ruby/ruby.h>
2
+ #include <string.h>
2
3
  #include <sys/stat.h>
3
4
 
4
5
  VALUE rb_cFile_mkfifo(VALUE, VALUE);
@@ -7,14 +8,27 @@ void Init_mkfifo() {
7
8
  rb_define_singleton_method(rb_cFile, "mkfifo", rb_cFile_mkfifo, 1);
8
9
  }
9
10
 
11
+ /* Document-method: File::mkfifo
12
+ *
13
+ * call-seq:
14
+ * mkfifo(path) → an_integer
15
+ *
16
+ * Creates a named pipe at +path+. Raises +IOError+ if
17
+ * the operation fails.
18
+ */
10
19
  VALUE
11
20
  rb_cFile_mkfifo(VALUE self, VALUE name) {
21
+ /* Accept Pathname objects */
22
+ if (strcmp(rb_obj_classname(name), "Pathname") == 0)
23
+ name = rb_funcall(name, rb_intern("to_s"), 0);
24
+
25
+ /* Accept String objects */
12
26
  if (rb_type(name) != T_STRING) {
13
- rb_raise(rb_eArgError, "Argument must be a string");
27
+ rb_raise(rb_eTypeError, "Argument must be a String or Pathname");
14
28
  }
15
29
 
16
30
  if (mkfifo(RSTRING_PTR(name), S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) < 0) {
17
- rb_raise(rb_eException, "Cannot create named pipe");
31
+ rb_raise(rb_eIOError, "Cannot create named pipe");
18
32
  }
19
33
 
20
34
  return INT2FIX(1);
@@ -0,0 +1,3 @@
1
+ module Mkfifo
2
+ VERSION = '0.1.1'
3
+ end
metadata CHANGED
@@ -1,65 +1,58 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mkfifo
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 1
9
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - shura
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2010-09-15 00:00:00 +02:00
18
- default_executable:
11
+ date: 2015-10-15 00:00:00.000000000 Z
19
12
  dependencies: []
20
-
21
- description: ""
13
+ description: |
14
+ Provides Ruby's File class with a new method called ::mkfifo
15
+ that creates a named pipe (FIFO). This gem is a simple C
16
+ extension wrapping the *nixish mkfifo(3) function.
22
17
  email: shura1991@gmail.com
23
18
  executables: []
24
-
25
- extensions:
19
+ extensions:
26
20
  - ext/extconf.rb
27
- extra_rdoc_files: []
28
-
29
- files:
21
+ extra_rdoc_files:
22
+ - README.rdoc
23
+ - CHANGELOG.rdoc
24
+ - ext/mkfifo.c
25
+ files:
26
+ - lib/mkfifo/version.rb
30
27
  - ext/extconf.rb
31
28
  - ext/mkfifo.c
32
- has_rdoc: true
29
+ - README.rdoc
30
+ - CHANGELOG.rdoc
33
31
  homepage: http://github.com/shurizzle/ruby-mkfifo
34
32
  licenses: []
35
-
33
+ metadata: {}
36
34
  post_install_message:
37
- rdoc_options: []
38
-
39
- require_paths:
35
+ rdoc_options:
36
+ - -m
37
+ - README.rdoc
38
+ - -t
39
+ - ruby-mkfifo
40
+ require_paths:
40
41
  - lib
41
- required_ruby_version: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- segments:
47
- - 0
48
- version: "0"
49
- required_rubygems_version: !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- version: "0"
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
57
52
  requirements: []
58
-
59
53
  rubyforge_project:
60
- rubygems_version: 1.3.7
54
+ rubygems_version: 2.0.14
61
55
  signing_key:
62
- specification_version: 3
63
- summary: ""
56
+ specification_version: 4
57
+ summary: Create named pipes (FIFOs) from Ruby
64
58
  test_files: []
65
-