termy 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +3 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +1 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +340 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/termy +6 -0
- data/lib/termy/info.rb +48 -0
- data/lib/termy/system_facts.rb +121 -0
- data/lib/termy/version.rb +3 -0
- data/lib/termy.rb +13 -0
- data/termy.gemspec +30 -0
- metadata +161 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0bfcf5689941ba059bf1f0f3271c7b5f76bee8b4
|
4
|
+
data.tar.gz: 10a2eb708be656d1df46bd48ffac5ecea9a45c68
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 840652a14fc15697f2e75d6a229576b344948d0bd3bdb69819bdafdd941affa6a378be715c1da13ed8db6700835720f3455fed7591c482a47e7c8c27ab2706fe
|
7
|
+
data.tar.gz: 428fdb3ae2396afa2fda6219a476c5acad97469a7351608757c02e543fc1d64c3eb0cd1c6129d7db28fe24d97fd3a603a55fdcdba4a8cc684c6867fb00b2b4d1
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Don't be an asshole and have fun
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 bronzdoc
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,340 @@
|
|
1
|
+
# Termy [![Build Status](https://travis-ci.org/bronzdoc/termy.svg?branch=master)](https://travis-ci.org/bronzdoc/termy)
|
2
|
+
Get facts about a Linux system.
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
|
6
|
+
```
|
7
|
+
$ gem install termy
|
8
|
+
```
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
### Print a single fact
|
13
|
+
```
|
14
|
+
$ termy system:kernel
|
15
|
+
|
16
|
+
{
|
17
|
+
"name": "Linux",
|
18
|
+
"release": "3.16.0-4-amd64",
|
19
|
+
"version": "#1 SMP Debian 3.16.7-ckt25-2 (2016-04-08)"
|
20
|
+
}
|
21
|
+
```
|
22
|
+
|
23
|
+
### Print all facts
|
24
|
+
```
|
25
|
+
{
|
26
|
+
"system": {
|
27
|
+
"architecture": "x86_64",
|
28
|
+
"boot_id": "375bb137-321e-4554-b0ed-d28aa511b539",
|
29
|
+
"date": "2016-05-16 23:04:50 -0600",
|
30
|
+
"domainname": "(none)",
|
31
|
+
"hostname": "doczilla",
|
32
|
+
"network": {
|
33
|
+
"lo": {
|
34
|
+
"name": "lo",
|
35
|
+
"ip_addresses": [
|
36
|
+
"127.0.0.1",
|
37
|
+
"::1"
|
38
|
+
],
|
39
|
+
"ipv4_adresses": [
|
40
|
+
{
|
41
|
+
"ip": "127.0.0.1",
|
42
|
+
"netmask": "255.0.0.0"
|
43
|
+
}
|
44
|
+
],
|
45
|
+
"ipv6_adresses": [
|
46
|
+
{
|
47
|
+
"ip": "::1",
|
48
|
+
"netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
|
49
|
+
}
|
50
|
+
]
|
51
|
+
},
|
52
|
+
"wlan0": {
|
53
|
+
"name": "wlan0",
|
54
|
+
"ip_addresses": [
|
55
|
+
"192.168.1.4",
|
56
|
+
"fe80::3602:86ff:fe95:6e01"
|
57
|
+
],
|
58
|
+
"ipv4_adresses": [
|
59
|
+
{
|
60
|
+
"ip": "192.168.1.4",
|
61
|
+
"netmask": "255.255.255.0"
|
62
|
+
}
|
63
|
+
],
|
64
|
+
"ipv6_adresses": [
|
65
|
+
{
|
66
|
+
"ip": "fe80::3602:86ff:fe95:6e01",
|
67
|
+
"netmask": "ffff:ffff:ffff:ffff::"
|
68
|
+
}
|
69
|
+
]
|
70
|
+
},
|
71
|
+
"docker0": {
|
72
|
+
"name": "docker0",
|
73
|
+
"ip_addresses": [
|
74
|
+
"172.17.0.1"
|
75
|
+
],
|
76
|
+
"ipv4_adresses": [
|
77
|
+
{
|
78
|
+
"ip": "172.17.0.1",
|
79
|
+
"netmask": "255.255.0.0"
|
80
|
+
}
|
81
|
+
],
|
82
|
+
"ipv6_adresses": [
|
83
|
+
|
84
|
+
]
|
85
|
+
}
|
86
|
+
},
|
87
|
+
"file_systems": {
|
88
|
+
"rootfs": {
|
89
|
+
"device": "rootfs",
|
90
|
+
"mount_point": "/",
|
91
|
+
"type": "rootfs",
|
92
|
+
"options": [
|
93
|
+
"rw"
|
94
|
+
],
|
95
|
+
"dump_freq": "0",
|
96
|
+
"pass_no": "0"
|
97
|
+
},
|
98
|
+
"sysfs": {
|
99
|
+
"device": "sysfs",
|
100
|
+
"mount_point": "/sys",
|
101
|
+
"type": "sysfs",
|
102
|
+
"options": [
|
103
|
+
"rw",
|
104
|
+
"nosuid",
|
105
|
+
"nodev",
|
106
|
+
"noexec",
|
107
|
+
"relatime"
|
108
|
+
],
|
109
|
+
"dump_freq": "0",
|
110
|
+
"pass_no": "0"
|
111
|
+
},
|
112
|
+
"proc": {
|
113
|
+
"device": "proc",
|
114
|
+
"mount_point": "/proc",
|
115
|
+
"type": "proc",
|
116
|
+
"options": [
|
117
|
+
"rw",
|
118
|
+
"nosuid",
|
119
|
+
"nodev",
|
120
|
+
"noexec",
|
121
|
+
"relatime"
|
122
|
+
],
|
123
|
+
"dump_freq": "0",
|
124
|
+
"pass_no": "0"
|
125
|
+
},
|
126
|
+
"udev": {
|
127
|
+
"device": "udev",
|
128
|
+
"mount_point": "/dev",
|
129
|
+
"type": "devtmpfs",
|
130
|
+
"options": [
|
131
|
+
"rw",
|
132
|
+
"relatime",
|
133
|
+
"size=10240k",
|
134
|
+
"nr_inodes=981691",
|
135
|
+
"mode=755"
|
136
|
+
],
|
137
|
+
"dump_freq": "0",
|
138
|
+
"pass_no": "0"
|
139
|
+
},
|
140
|
+
"devpts": {
|
141
|
+
"device": "devpts",
|
142
|
+
"mount_point": "/dev/pts",
|
143
|
+
"type": "devpts",
|
144
|
+
"options": [
|
145
|
+
"rw",
|
146
|
+
"nosuid",
|
147
|
+
"noexec",
|
148
|
+
"relatime",
|
149
|
+
"gid=5",
|
150
|
+
"mode=620",
|
151
|
+
"ptmxmode=000"
|
152
|
+
],
|
153
|
+
"dump_freq": "0",
|
154
|
+
"pass_no": "0"
|
155
|
+
},
|
156
|
+
"tmpfs": {
|
157
|
+
"device": "tmpfs",
|
158
|
+
"mount_point": "/run/user/1000",
|
159
|
+
"type": "tmpfs",
|
160
|
+
"options": [
|
161
|
+
"rw",
|
162
|
+
"nosuid",
|
163
|
+
"nodev",
|
164
|
+
"relatime",
|
165
|
+
"size=787240k",
|
166
|
+
"mode=700",
|
167
|
+
"uid=1000",
|
168
|
+
"gid=1000"
|
169
|
+
],
|
170
|
+
"dump_freq": "0",
|
171
|
+
"pass_no": "0"
|
172
|
+
},
|
173
|
+
"/dev/sda7": {
|
174
|
+
"device": "/dev/sda7",
|
175
|
+
"mount_point": "/",
|
176
|
+
"type": "ext4",
|
177
|
+
"options": [
|
178
|
+
"rw",
|
179
|
+
"relatime",
|
180
|
+
"errors=remount-ro",
|
181
|
+
"data=ordered"
|
182
|
+
],
|
183
|
+
"dump_freq": "0",
|
184
|
+
"pass_no": "0"
|
185
|
+
},
|
186
|
+
"securityfs": {
|
187
|
+
"device": "securityfs",
|
188
|
+
"mount_point": "/sys/kernel/security",
|
189
|
+
"type": "securityfs",
|
190
|
+
"options": [
|
191
|
+
"rw",
|
192
|
+
"nosuid",
|
193
|
+
"nodev",
|
194
|
+
"noexec",
|
195
|
+
"relatime"
|
196
|
+
],
|
197
|
+
"dump_freq": "0",
|
198
|
+
"pass_no": "0"
|
199
|
+
},
|
200
|
+
"cgroup": {
|
201
|
+
"device": "cgroup",
|
202
|
+
"mount_point": "/sys/fs/cgroup/perf_event",
|
203
|
+
"type": "cgroup",
|
204
|
+
"options": [
|
205
|
+
"rw",
|
206
|
+
"nosuid",
|
207
|
+
"nodev",
|
208
|
+
"noexec",
|
209
|
+
"relatime",
|
210
|
+
"perf_event"
|
211
|
+
],
|
212
|
+
"dump_freq": "0",
|
213
|
+
"pass_no": "0"
|
214
|
+
},
|
215
|
+
"pstore": {
|
216
|
+
"device": "pstore",
|
217
|
+
"mount_point": "/sys/fs/pstore",
|
218
|
+
"type": "pstore",
|
219
|
+
"options": [
|
220
|
+
"rw",
|
221
|
+
"nosuid",
|
222
|
+
"nodev",
|
223
|
+
"noexec",
|
224
|
+
"relatime"
|
225
|
+
],
|
226
|
+
"dump_freq": "0",
|
227
|
+
"pass_no": "0"
|
228
|
+
},
|
229
|
+
"systemd-1": {
|
230
|
+
"device": "systemd-1",
|
231
|
+
"mount_point": "/proc/sys/fs/binfmt_misc",
|
232
|
+
"type": "autofs",
|
233
|
+
"options": [
|
234
|
+
"rw",
|
235
|
+
"relatime",
|
236
|
+
"fd=22",
|
237
|
+
"pgrp=1",
|
238
|
+
"timeout=300",
|
239
|
+
"minproto=5",
|
240
|
+
"maxproto=5",
|
241
|
+
"direct"
|
242
|
+
],
|
243
|
+
"dump_freq": "0",
|
244
|
+
"pass_no": "0"
|
245
|
+
},
|
246
|
+
"hugetlbfs": {
|
247
|
+
"device": "hugetlbfs",
|
248
|
+
"mount_point": "/dev/hugepages",
|
249
|
+
"type": "hugetlbfs",
|
250
|
+
"options": [
|
251
|
+
"rw",
|
252
|
+
"relatime"
|
253
|
+
],
|
254
|
+
"dump_freq": "0",
|
255
|
+
"pass_no": "0"
|
256
|
+
},
|
257
|
+
"mqueue": {
|
258
|
+
"device": "mqueue",
|
259
|
+
"mount_point": "/dev/mqueue",
|
260
|
+
"type": "mqueue",
|
261
|
+
"options": [
|
262
|
+
"rw",
|
263
|
+
"relatime"
|
264
|
+
],
|
265
|
+
"dump_freq": "0",
|
266
|
+
"pass_no": "0"
|
267
|
+
},
|
268
|
+
"debugfs": {
|
269
|
+
"device": "debugfs",
|
270
|
+
"mount_point": "/sys/kernel/debug",
|
271
|
+
"type": "debugfs",
|
272
|
+
"options": [
|
273
|
+
"rw",
|
274
|
+
"relatime"
|
275
|
+
],
|
276
|
+
"dump_freq": "0",
|
277
|
+
"pass_no": "0"
|
278
|
+
},
|
279
|
+
"fusectl": {
|
280
|
+
"device": "fusectl",
|
281
|
+
"mount_point": "/sys/fs/fuse/connections",
|
282
|
+
"type": "fusectl",
|
283
|
+
"options": [
|
284
|
+
"rw",
|
285
|
+
"relatime"
|
286
|
+
],
|
287
|
+
"dump_freq": "0",
|
288
|
+
"pass_no": "0"
|
289
|
+
},
|
290
|
+
"rpc_pipefs": {
|
291
|
+
"device": "rpc_pipefs",
|
292
|
+
"mount_point": "/run/rpc_pipefs",
|
293
|
+
"type": "rpc_pipefs",
|
294
|
+
"options": [
|
295
|
+
"rw",
|
296
|
+
"relatime"
|
297
|
+
],
|
298
|
+
"dump_freq": "0",
|
299
|
+
"pass_no": "0"
|
300
|
+
},
|
301
|
+
"gvfsd-fuse": {
|
302
|
+
"device": "gvfsd-fuse",
|
303
|
+
"mount_point": "/run/user/1000/gvfs",
|
304
|
+
"type": "fuse.gvfsd-fuse",
|
305
|
+
"options": [
|
306
|
+
"rw",
|
307
|
+
"nosuid",
|
308
|
+
"nodev",
|
309
|
+
"relatime",
|
310
|
+
"user_id=1000",
|
311
|
+
"group_id=1000"
|
312
|
+
],
|
313
|
+
"dump_freq": "0",
|
314
|
+
"pass_no": "0"
|
315
|
+
}
|
316
|
+
},
|
317
|
+
"os_release": {
|
318
|
+
"pretty_name": "Debian GNU/Linux 8 (jessie)",
|
319
|
+
"name": "Debian GNU/Linux",
|
320
|
+
"version_id": "8",
|
321
|
+
"version": "8 (jessie)",
|
322
|
+
"id": "debian",
|
323
|
+
"home_url": "http://www.debian.org/",
|
324
|
+
"support_url": "http://www.debian.org/support",
|
325
|
+
"bug_report_url": "https://bugs.debian.org/"
|
326
|
+
},
|
327
|
+
"kernel": {
|
328
|
+
"name": "Linux",
|
329
|
+
"release": "3.16.0-4-amd64",
|
330
|
+
"version": "#1 SMP Debian 3.16.7-ckt25-2 (2016-04-08)"
|
331
|
+
},
|
332
|
+
"machine_id": "87d7918b2961434bb05ed8bff341eb59"
|
333
|
+
}
|
334
|
+
}
|
335
|
+
|
336
|
+
```
|
337
|
+
|
338
|
+
## License
|
339
|
+
|
340
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "termy"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/bin/termy
ADDED
data/lib/termy/info.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require "termy/system_facts"
|
2
|
+
require "json"
|
3
|
+
|
4
|
+
module Termy
|
5
|
+
class Info
|
6
|
+
attr_reader :info
|
7
|
+
def initialize
|
8
|
+
sf = Termy::SystemFacts.new
|
9
|
+
@info = {
|
10
|
+
"system" => {
|
11
|
+
"architecture" => sf.arch,
|
12
|
+
"boot_id" => sf.boot_id,
|
13
|
+
"date" => sf.date,
|
14
|
+
"domainname" => sf.domainname,
|
15
|
+
"hostname" => sf.hostname,
|
16
|
+
"network" => sf.network,
|
17
|
+
"file_systems" => sf.file_systems,
|
18
|
+
"os_release" => sf.os_release,
|
19
|
+
"kernel" => sf.kernel,
|
20
|
+
"machine_id" => sf.machine_id,
|
21
|
+
}
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def show_all
|
26
|
+
puts JSON.pretty_generate(@info)
|
27
|
+
end
|
28
|
+
|
29
|
+
def show(user_info_keys)
|
30
|
+
keys = user_info_keys.first.split(":")
|
31
|
+
info_keys = @info.keys
|
32
|
+
|
33
|
+
info = @info
|
34
|
+
data = nil
|
35
|
+
begin
|
36
|
+
keys.each do |key|
|
37
|
+
data = info[key]
|
38
|
+
info = data.is_a?(String) ? { key => data } : data
|
39
|
+
raise key if info.nil?
|
40
|
+
end
|
41
|
+
rescue => e
|
42
|
+
puts "InvalidKeyError: key \"#{e}\" not found"
|
43
|
+
exit
|
44
|
+
end
|
45
|
+
puts JSON.pretty_generate(info)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
require "time"
|
2
|
+
require "system/getifaddrs"
|
3
|
+
require "sys/uname"
|
4
|
+
|
5
|
+
class Termy::SystemFacts
|
6
|
+
attr_reader :kernel, :arch, :hostname, :domainname
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@kernel = {
|
10
|
+
"name" => uname[:sysname],
|
11
|
+
"release" => uname[:release],
|
12
|
+
"version" => uname[:version]
|
13
|
+
}
|
14
|
+
|
15
|
+
@arch = uname[:machine]
|
16
|
+
@hostname = uname[:nodename]
|
17
|
+
@domainname = uname[:domainname]
|
18
|
+
end
|
19
|
+
|
20
|
+
def date
|
21
|
+
Time.now
|
22
|
+
end
|
23
|
+
|
24
|
+
def boot_id
|
25
|
+
f = File.open("/proc/sys/kernel/random/boot_id")
|
26
|
+
data = f.read.strip
|
27
|
+
f.close
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
def file_systems
|
32
|
+
file = "/etc/mtab"
|
33
|
+
file_systems = {}
|
34
|
+
return file_systems unless File.file?(file)
|
35
|
+
|
36
|
+
f = File.open(file)
|
37
|
+
f.read.scan(/.*\n/).each do |line|
|
38
|
+
record = line.strip.split(" ")
|
39
|
+
file_systems[record.first] = {
|
40
|
+
"device" => record[0],
|
41
|
+
"mount_point" => record[1],
|
42
|
+
"type" => record[2],
|
43
|
+
"options" => record[3].split(","),
|
44
|
+
"dump_freq" => record[4],
|
45
|
+
"pass_no" => record[5],
|
46
|
+
}
|
47
|
+
end
|
48
|
+
f.close
|
49
|
+
file_systems
|
50
|
+
end
|
51
|
+
|
52
|
+
def os_release
|
53
|
+
file = "/etc/os-release"
|
54
|
+
os_release = {}
|
55
|
+
return os_release unless File.file?(file)
|
56
|
+
|
57
|
+
f = File.open(file)
|
58
|
+
f.read.scan(/.*\n/).each do |line|
|
59
|
+
key, val = line.split("=")
|
60
|
+
os_release[key.downcase] = val.strip.gsub("\"","")
|
61
|
+
end
|
62
|
+
f.close
|
63
|
+
os_release
|
64
|
+
end
|
65
|
+
|
66
|
+
def machine_id
|
67
|
+
file = "/etc/machine-id"
|
68
|
+
return "" unless File.file?(file)
|
69
|
+
|
70
|
+
f = File.open(file)
|
71
|
+
machine_id = f.read.strip
|
72
|
+
f.close
|
73
|
+
machine_id
|
74
|
+
end
|
75
|
+
|
76
|
+
def network
|
77
|
+
# TODO refactor this in the near future
|
78
|
+
interfaces = {}
|
79
|
+
System.get_all_ifaddrs.each do |info|
|
80
|
+
key = info[:interface]
|
81
|
+
if interfaces.has_key?(key)
|
82
|
+
interfaces[key]["ip_addresses"] << info[:inet_addr].to_s
|
83
|
+
if info[:inet_addr].ipv4?
|
84
|
+
interfaces[key]["ipv4_adresses"] << {
|
85
|
+
"ip" => info[:inet_addr].to_s,
|
86
|
+
"netmask" => info[:netmask].to_s
|
87
|
+
}
|
88
|
+
elsif info[:inet_addr].ipv6?
|
89
|
+
interfaces[key]["ipv6_adresses"] << {
|
90
|
+
"ip" => info[:inet_addr].to_s,
|
91
|
+
"netmask" => info[:netmask].to_s
|
92
|
+
}
|
93
|
+
end
|
94
|
+
else
|
95
|
+
interfaces[key] = {
|
96
|
+
"name" => key,
|
97
|
+
"ip_addresses" => [info[:inet_addr].to_s],
|
98
|
+
"ipv4_adresses" => [],
|
99
|
+
"ipv6_adresses" => [],
|
100
|
+
}
|
101
|
+
if info[:inet_addr].ipv4?
|
102
|
+
interfaces[key]["ipv4_adresses"] << {
|
103
|
+
"ip" => info[:inet_addr].to_s,
|
104
|
+
"netmask" => info[:netmask].to_s
|
105
|
+
}
|
106
|
+
elsif info[:inet_addr].ipv6?
|
107
|
+
interfaces[key]["ipv6_adresses"] << {
|
108
|
+
"ip" => info[:inet_addr].to_s,
|
109
|
+
"netmask" => info[:netmask].to_s
|
110
|
+
}
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
interfaces
|
115
|
+
end
|
116
|
+
|
117
|
+
private
|
118
|
+
def uname
|
119
|
+
Sys::Uname.uname.to_h
|
120
|
+
end
|
121
|
+
end
|
data/lib/termy.rb
ADDED
data/termy.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "termy/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "termy"
|
8
|
+
spec.version = Termy::VERSION
|
9
|
+
spec.authors = ["bronzdoc"]
|
10
|
+
spec.email = ["lsagastume1990@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Get facts from your system}
|
13
|
+
spec.description = %q{Get facts from your system}
|
14
|
+
spec.homepage = "https://github.com/bronzdoc/termy"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "bin"
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency "system-getifaddrs", "~> 0.2"
|
23
|
+
spec.add_dependency "sys-uname", "~> 1.0"
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
spec.add_development_dependency "rspec", "~> 3.3"
|
28
|
+
spec.add_development_dependency "pry", "~> 0.10"
|
29
|
+
spec.add_development_dependency "fakefs", "~> 0.8"
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: termy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- bronzdoc
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: system-getifaddrs
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sys-uname
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.11'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.11'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.3'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.3'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.10'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.10'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: fakefs
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.8'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.8'
|
111
|
+
description: Get facts from your system
|
112
|
+
email:
|
113
|
+
- lsagastume1990@gmail.com
|
114
|
+
executables:
|
115
|
+
- console
|
116
|
+
- setup
|
117
|
+
- termy
|
118
|
+
extensions: []
|
119
|
+
extra_rdoc_files: []
|
120
|
+
files:
|
121
|
+
- ".gitignore"
|
122
|
+
- ".rspec"
|
123
|
+
- ".travis.yml"
|
124
|
+
- CODE_OF_CONDUCT.md
|
125
|
+
- Gemfile
|
126
|
+
- LICENSE.txt
|
127
|
+
- README.md
|
128
|
+
- Rakefile
|
129
|
+
- bin/console
|
130
|
+
- bin/setup
|
131
|
+
- bin/termy
|
132
|
+
- lib/termy.rb
|
133
|
+
- lib/termy/info.rb
|
134
|
+
- lib/termy/system_facts.rb
|
135
|
+
- lib/termy/version.rb
|
136
|
+
- termy.gemspec
|
137
|
+
homepage: https://github.com/bronzdoc/termy
|
138
|
+
licenses:
|
139
|
+
- MIT
|
140
|
+
metadata: {}
|
141
|
+
post_install_message:
|
142
|
+
rdoc_options: []
|
143
|
+
require_paths:
|
144
|
+
- lib
|
145
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
requirements: []
|
156
|
+
rubyforge_project:
|
157
|
+
rubygems_version: 2.6.3
|
158
|
+
signing_key:
|
159
|
+
specification_version: 4
|
160
|
+
summary: Get facts from your system
|
161
|
+
test_files: []
|