Top Level Namespace
Defined Under Namespace
Modules: ArrayExt, FileExt, HashExt, IAM, IOExt, IPv4NetExt, IamExt, ObjectExt, OpenSSLExt, Processes, QueryParamsMixin, StringExt, URI
Classes: CaseInsensitiveHash, GithubClient, Glob
Instance Method Summary
collapse
Instance Method Details
#error(msg, pref = '[!] ') ⇒ Object
10
11
12
|
# File 'lib/w-stdlib/prelude.rb', line 10
def error(msg, pref='[!] ')
STDERR.puts pref + msg
end
|
#fatal(msg, code = 1, pref = '[!] ') ⇒ Object
1
2
3
4
|
# File 'lib/w-stdlib/prelude.rb', line 1
def fatal(msg, code=1, pref='[!] ')
STDERR.puts pref + msg
exit code
end
|
#home_join(*paths) ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/w-stdlib/prelude.rb', line 18
def home_join(*paths)
home = ENV['HOME']
if paths.empty?
home
else
File.join home, *paths
end
end
|
#info(msg, pref = '[+] ') ⇒ Object
6
7
8
|
# File 'lib/w-stdlib/prelude.rb', line 6
def info(msg, pref='[+] ')
STDERR.puts pref + msg
end
|
#json_file(name) ⇒ Object
14
15
16
|
# File 'lib/w-stdlib/prelude.rb', line 14
def json_file(name)
JSON.parse File.read(name)
end
|