devnull 0.1.2 → 0.1.3

This diff has not been reviewed by any users.
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
- SHA1:
3
- metadata.gz: ab9b2bd9353de1577f8f63817a253c45737ed89a
4
- data.tar.gz: af8ebecb37ab062fdbfb1486b87fa3e07d626b2a
2
+ SHA256:
3
+ metadata.gz: 30a3665b27660f382a7d97f7f49b7a13def698682d58cfec2cd253820f29acc9
4
+ data.tar.gz: a777f742513fd6a881ce8517a1a968c70e0b87b51ca56c6a88bacdae126e4941
5
5
  SHA512:
6
- metadata.gz: a03f5dbdedf57b83c2754612b19bdc9f492369c87875b4572c29ea6449a6f58facd248161659606cb2c207807356c236ee15fb701413d0dc572896f77b0a27fa
7
- data.tar.gz: abb6eb752a74ba70377f592f77600a67979ed17cd906a973bb7cfc74be307a5a1039854583e8be57873b8bbda28fa387259d4381c436d3a9152abdca561dec10
6
+ metadata.gz: 88cbca218e8ac9a1318b92e7b91d3723470ac49f95ea0bb85d0d39719f9c6a72e9c90a00dbe5b46c128872e9c47169dc1560de846f619d58263e6ff013441324
7
+ data.tar.gz: 299c4bac1b8cdc5827c39f25acc48080cc5362578f2c97380871c04e956634c68bee1dfea36141724ebf2b65eb62d6aa17d53ddbbb1a1f0b110efbac65f15aa2
@@ -13,3 +13,7 @@ https://github.com/maraigue/devnull/pull/1
13
13
  * Moved the location of code 'VERSION = "A.B.C"' (Thanks Patrik Wenger!)
14
14
 
15
15
  https://github.com/maraigue/devnull/commit/5c8d40b7e03c07a96ae647bc302eec74abfc224d#commitcomment-8379713
16
+
17
+ === 0.1.3 / 2019-05-24
18
+
19
+ * Updated the document
@@ -1,84 +1,100 @@
1
- = devnull
2
-
3
- home :: https://rubygems.org/gems/devnull
4
- code :: https://github.com/maraigue/devnull
5
-
6
- == DESCRIPTION:
7
-
8
- Ruby implementation of null file (like /dev/null on Un*x, NUL on Windows)
9
-
10
- == SYNOPSIS:
11
-
12
- DevNull instance works like an IO object. For example:
13
-
14
- dn = DevNull.new
15
- dn.puts "foo" # => nil (do nothing)
16
- dn.gets # => nil
17
- dn.read # => ""
18
-
19
- The library may be a good solution if you would like to switch whether an input/output file is needed. For example:
20
-
21
- def some_process(arg, logfile = nil)
22
- # You may set an IO object as 'logfile'.
23
- # If so, logs are written to the file.
24
-
25
- result = process1(arg)
26
- logfile.puts result if logfile
27
-
28
- result = process2(arg)
29
- logfile.puts result if logfile
30
-
31
- result = process3(arg)
32
- logfile.puts result if logfile
33
- end
34
-
35
- can be rewritten as follows:
36
-
37
- def some_process(arg, logfile = DevNull.new)
38
- logfile.puts process1(arg)
39
- logfile.puts process2(arg)
40
- logfile.puts process3(arg)
41
- end
42
-
43
- == INSTALLATION:
44
-
45
- Installed by RubyGems with the command (recommended):
46
-
47
- $ gem install devnull
48
-
49
- Or you can use it with downloading devnull.rb file and load it by `require "./devnull"`.
50
-
51
- == DEVELOPERS:
52
-
53
- (auto-generation by Hoe https://rubygems.org/gems/hoe)
54
-
55
- After checking out the source, run:
56
-
57
- $ rake newb
58
-
59
- This task will install any missing dependencies, run the tests/specs, and generate the RDoc.
60
-
61
- == LICENSE
62
-
63
- (The MIT License)
64
-
65
- Copyright (c) 2011 H.Hiro (Maraigue)
66
-
67
- Permission is hereby granted, free of charge, to any person obtaining
68
- a copy of this software and associated documentation files (the
69
- "Software"), to deal in the Software without restriction, including
70
- without limitation the rights to use, copy, modify, merge, publish,
71
- distribute, sublicense, and/or sell copies of the Software, and to
72
- permit persons to whom the Software is furnished to do so, subject to
73
- the following conditions:
74
-
75
- The above copyright notice and this permission notice shall be
76
- included in all copies or substantial portions of the Software.
77
-
78
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
79
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
80
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
81
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
82
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
83
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
84
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ # devnull
2
+
3
+ website :: http://rubygems.org/gems/devnull
4
+
5
+ Source code / Documentation :: https://github.com/maraigue/devnull
6
+
7
+ ## Description
8
+
9
+ Ruby implementation of null file (like /dev/null on Un*x, NUL on Windows)
10
+
11
+ ## Note
12
+
13
+ You can do the similar with a built-in constant [File::NULL](https://docs.ruby-lang.org/ja/latest/method/File=3a=3aConstants/c/NULL.html): the object `open(File::NULL, "rw")` behaves almost the same as the object `DevNull.new`.
14
+
15
+ After the library is developed ([at Ruby 1.9.3](https://svn.ruby-lang.org/repos/ruby/tags/v1_9_3_0/NEWS)), Ruby introduced the built-in constant `File::NULL` that represents the *name* of the (environment-dependent) null file.
16
+ Notice that, different from `open(File::NULL, "rw")`, `DevNull.new` does *not* use file-opening API.
17
+
18
+ ## Synopsis
19
+
20
+ DevNull instance works like an IO object. For example:
21
+
22
+ ```ruby
23
+ dn = DevNull.new
24
+ dn.puts "foo" # => nil (do nothing)
25
+ dn.gets # => nil
26
+ dn.read # => ""
27
+ ```
28
+
29
+ The library may be a good solution if you would like to switch whether an input/output file is needed. For example:
30
+
31
+ ```ruby
32
+ def some_process(arg, logfile = nil)
33
+ # You may set an IO object as 'logfile'.
34
+ # If so, logs are written to the file.
35
+
36
+ result = process1(arg)
37
+ logfile.puts result if logfile
38
+
39
+ result = process2(arg)
40
+ logfile.puts result if logfile
41
+
42
+ result = process3(arg)
43
+ logfile.puts result if logfile
44
+ end
45
+ ```
46
+
47
+ can be rewritten as follows:
48
+
49
+ ```ruby
50
+ def some_process(arg, logfile = DevNull.new)
51
+ logfile.puts process1(arg)
52
+ logfile.puts process2(arg)
53
+ logfile.puts process3(arg)
54
+ end
55
+ ```
56
+
57
+ ## Installation
58
+
59
+ Installed by RubyGems with the command (recommended):
60
+
61
+ $ gem install devnull
62
+
63
+ Or you can use it with downloading devnull.rb file and load it by `require "./devnull"`.
64
+
65
+ ## Developers
66
+
67
+ (auto-generation by Hoe https://rubygems.org/gems/hoe)
68
+
69
+ After checking out the source, run:
70
+
71
+ ```sh
72
+ $ rake newb
73
+ ```
74
+
75
+ This task will install any missing dependencies, run the tests/specs, and generate the RDoc.
76
+
77
+ ## License
78
+
79
+ (The MIT License)
80
+
81
+ Copyright (c) 2011- H.Hiro (Maraigue)
82
+
83
+ Permission is hereby granted, free of charge, to any person obtaining
84
+ a copy of this software and associated documentation files (the
85
+ "Software"), to deal in the Software without restriction, including
86
+ without limitation the rights to use, copy, modify, merge, publish,
87
+ distribute, sublicense, and/or sell copies of the Software, and to
88
+ permit persons to whom the Software is furnished to do so, subject to
89
+ the following conditions:
90
+
91
+ The above copyright notice and this permission notice shall be
92
+ included in all copies or substantial portions of the Software.
93
+
94
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
95
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
96
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
97
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
98
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
99
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
100
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -34,7 +34,7 @@
34
34
  require "enumerator"
35
35
 
36
36
  class DevNull
37
- VERSION = "0.1.2"
37
+ VERSION = "0.1.3"
38
38
 
39
39
  def initialize
40
40
  # do nothing
metadata CHANGED
@@ -1,65 +1,70 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devnull
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - H.Hiro (maraigue)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-20 00:00:00.000000000 Z
11
+ date: 2019-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '7'
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '4.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '7'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: hoe
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - "~>"
32
38
  - !ruby/object:Gem::Version
33
- version: '3.13'
39
+ version: '3.17'
34
40
  type: :development
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
44
  - - "~>"
39
45
  - !ruby/object:Gem::Version
40
- version: '3.13'
46
+ version: '3.17'
41
47
  description: Ruby implementation of null file (like /dev/null on Un*x, NUL on Windows)
42
- email:
43
- - main@hhiro.net
48
+ email: main@hhiro.net
44
49
  executables: []
45
50
  extensions: []
46
51
  extra_rdoc_files:
47
52
  - History.txt
48
- - README.txt
53
+ - README.md
49
54
  files:
50
55
  - History.txt
51
- - README.txt
56
+ - README.md
52
57
  - lib/devnull.rb
53
58
  - spec/devnull_spec.rb
54
59
  - spec/spec_helper.rb
55
- homepage: https://rubygems.org/gems/devnull
60
+ homepage: http://rubygems.org/gems/devnull
56
61
  licenses:
57
62
  - MIT
58
63
  metadata: {}
59
64
  post_install_message:
60
65
  rdoc_options:
61
66
  - "--main"
62
- - README.txt
67
+ - README.md
63
68
  require_paths:
64
69
  - lib
65
70
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -73,8 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
78
  - !ruby/object:Gem::Version
74
79
  version: '0'
75
80
  requirements: []
76
- rubyforge_project:
77
- rubygems_version: 2.4.5
81
+ rubygems_version: 3.0.3
78
82
  signing_key:
79
83
  specification_version: 4
80
84
  summary: Ruby implementation of null file (like /dev/null on Un*x, NUL on Windows)