Skip to content

Commit b9c880f

Browse files
committedOct 25, 2022
[DOC] Improve documentation
·
v0.3.1v0.1.3
1 parent c480226 commit b9c880f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
 

‎.document‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
README.md
2+
lib/

‎lib/tmpdir.rb‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,23 +108,31 @@ def self.mktmpdir(prefix_suffix=nil, *rest, **options)
108108
end
109109
end
110110

111+
# Temporary name generator
111112
module Tmpname # :nodoc:
112113
module_function
113114

114115
def tmpdir
115116
Dir.tmpdir
116117
end
117118

119+
# Unusable characters as path name
118120
UNUSABLE_CHARS = "^,-.0-9A-Z_a-z~"
119121

120-
class << (RANDOM = Random.new)
122+
# Dedicated random number generator
123+
RANDOM = Random.new
124+
class << Random # :nodoc:
125+
# Maximum random number
121126
MAX = 36**6 # < 0x100000000
127+
128+
# Returns new random string upto 6 bytes
122129
def next
123130
rand(MAX).to_s(36)
124131
end
125132
end
126133
private_constant :RANDOM
127134

135+
# Generates and yields random names to create a temporary name
128136
def create(basename, tmpdir=nil, max_try: nil, **opts)
129137
origdir = tmpdir
130138
tmpdir ||= tmpdir()

0 commit comments

Comments
 (0)
Please sign in to comment.