nomansland 0.0.1 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.md +29 -10
- data/lib/nomansland/distro.rb +19 -8
- data/lib/nomansland/init.rb +9 -0
- data/lib/nomansland/installer.rb +5 -4
- data/lib/nomansland.rb +6 -0
- data/nomansland.gemspec +2 -2
- data.tar.gz.sig +0 -0
- metadata +34 -31
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e91ae02bbb0fb3769135971a33014162995d57329719d1bceb210fa8168edd0f
|
4
|
+
data.tar.gz: 25a09c25db350e0f8cbd95deb746ce173b2ee6ac86db08ac05b5692a729df06a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 280ead70b8b0a06cacb2d9b650e27fca0e9717592958e28f82da9f9e2e9ce08225af0ca667d09c7401a2d096c610918ac69abe9f0b3fff6ee2190a4daa7c8318
|
7
|
+
data.tar.gz: c61a45cf1f965b99bac3736b403b33726bdf036a842ca6b28f8460bd2cabebb08db5058fcd25d78bfd81a0e23f8a699ec5c3117353d507a6a2ab5afce6f1e1e8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -14,23 +14,42 @@ And install
|
|
14
14
|
By distrib:
|
15
15
|
|
16
16
|
```rb
|
17
|
-
require '
|
17
|
+
require 'nomansland'
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
case Nomansland::distro?
|
20
|
+
when :fedora
|
21
|
+
puts 'Running Fedora'
|
22
|
+
when :gentoo
|
23
|
+
puts 'Running Gentoo'
|
24
|
+
end
|
21
25
|
```
|
22
26
|
|
23
27
|
Sometimes, it is better to search by installer:
|
24
28
|
|
25
29
|
```rb
|
26
|
-
require '
|
30
|
+
require 'nomansland'
|
27
31
|
|
28
32
|
case Nomansland::installer?
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
when :yum
|
34
|
+
system('sudo yum install tor')
|
35
|
+
when :apt_get
|
36
|
+
system('sudo apt-get install tor')
|
37
|
+
when :pacman
|
38
|
+
system('sudo pacman -S tor')
|
39
|
+
end
|
40
|
+
```
|
41
|
+
|
42
|
+
Or by init system:
|
43
|
+
|
44
|
+
```rb
|
45
|
+
require 'nomansland'
|
46
|
+
|
47
|
+
case Nomansland::init?
|
48
|
+
when :runit # Voidlinux
|
49
|
+
system('sv restart tor')
|
50
|
+
when :systemd
|
51
|
+
system('systemctl restart tor')
|
52
|
+
when :openrc # default for Gentoo
|
53
|
+
system('/etc/init.d/tor start')
|
35
54
|
end
|
36
55
|
```
|
data/lib/nomansland/distro.rb
CHANGED
@@ -1,12 +1,23 @@
|
|
1
1
|
module Nomansland
|
2
|
+
|
2
3
|
def self.distro?
|
3
|
-
return :fedora if File.exist?
|
4
|
-
return :redhat if File.exist?
|
5
|
-
return :suse if File.exist?
|
6
|
-
return :mandrake if File.exist?
|
7
|
-
return :ubuntu if File.exist?
|
8
|
-
return :debian if File.exist?
|
9
|
-
return :gentoo if File.exist?
|
10
|
-
return :archlinux if File.exist?
|
4
|
+
return :fedora if File.exist? '/etc/fedora-release'
|
5
|
+
return :redhat if File.exist? '/etc/redhat-release'
|
6
|
+
return :suse if File.exist? '/etc/SUSE-release'
|
7
|
+
return :mandrake if File.exist? '/etc/mandrake-release'
|
8
|
+
return :ubuntu if File.exist? '/etc/ubuntu-release'
|
9
|
+
return :debian if File.exist? '/etc/debian_version'
|
10
|
+
return :gentoo if File.exist? '/etc/gentoo-release'
|
11
|
+
return :archlinux if File.exist? '/etc/arch-release'
|
12
|
+
return :void if self.grep?('/etc/os-release', /void/)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.grep?(file, regex)
|
16
|
+
is_found = false
|
17
|
+
return is_found unless File.exist? file
|
18
|
+
File.open(file) do |f|
|
19
|
+
f.each { |l| is_found = true if l.match(regex) }
|
20
|
+
end
|
21
|
+
is_found
|
11
22
|
end
|
12
23
|
end
|
data/lib/nomansland/installer.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
module Nomansland
|
2
2
|
def self.installer?
|
3
|
-
return :yum if File.exist?
|
4
|
-
return :apt_get if File.exist?
|
5
|
-
return :pacman if File.exist?
|
6
|
-
return :emerge if File.exist?
|
3
|
+
return :yum if File.exist? '/usr/bin/yum'
|
4
|
+
return :apt_get if File.exist? '/usr/bin/apt-get'
|
5
|
+
return :pacman if File.exist? '/usr/bin/pacman'
|
6
|
+
return :emerge if File.exist? '/usr/bin/emerge'
|
7
|
+
return :void if File.exist? '/usr/bin/xbps-install'
|
7
8
|
end
|
8
9
|
end
|
data/lib/nomansland.rb
ADDED
data/nomansland.gemspec
CHANGED
@@ -8,12 +8,12 @@ Gem::Specification.new do |s|
|
|
8
8
|
"wiki_uri" => "https://github.com/szorfein/nomansland"
|
9
9
|
}
|
10
10
|
|
11
|
-
s.version = "0.0.
|
11
|
+
s.version = "0.0.5"
|
12
12
|
s.platform = Gem::Platform::RUBY
|
13
13
|
s.author = ['szorfein']
|
14
14
|
s.homepage = 'https://github.com/szorfein/nomansland'
|
15
15
|
s.email = 'szorfein@protonmail.com'
|
16
|
-
s.required_ruby_version = '>=2.
|
16
|
+
s.required_ruby_version = '>=2.5'
|
17
17
|
s.files = `git ls-files`.split(" ")
|
18
18
|
s.files.reject! { |fn| fn.include? "certs" }
|
19
19
|
s.files.reject! { |fn| fn.include? "Makefile" }
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,41 +1,42 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nomansland
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- szorfein
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
13
|
+
MIIEhTCCAu2gAwIBAgIBATANBgkqhkiG9w0BAQsFADBEMREwDwYDVQQDDAhzem9y
|
14
|
+
ZmVpbjEaMBgGCgmSJomT8ixkARkWCnByb3Rvbm1haWwxEzARBgoJkiaJk/IsZAEZ
|
15
|
+
FgNjb20wHhcNMjIwOTA4MDYyNjE5WhcNMjMwOTA4MDYyNjE5WjBEMREwDwYDVQQD
|
16
|
+
DAhzem9yZmVpbjEaMBgGCgmSJomT8ixkARkWCnByb3Rvbm1haWwxEzARBgoJkiaJ
|
17
|
+
k/IsZAEZFgNjb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDEJNhl
|
18
|
+
Gd0JNHLXysR7GvbCKD+y1prQbmS333GpoFgPR2chEGv8Y7l0We2UFXCZ59CVOs1v
|
19
|
+
KBVQhhNvxWAHWhfe/8stb1JFBxZpnCi7S0BGpqeblaGBXVlhBOzbZ6d1NrOwMfDS
|
20
|
+
6EzdX4WAOH55HnAz29T5KREUdbONVLU7HJNIIFVZvf6ethOv84pnkWbdWjV0RB3A
|
21
|
+
ERYste5QHGx1YQOYGTuJMlu8113kqTbB8wpEw6X00aJwmXcJvnKXkhN5mxd06yss
|
22
|
+
EE96lOk16raTWCh7DeYR3/ilVet3DpLlCvpFNtMIuko1HFa3HTW+57003VxD8Ozk
|
23
|
+
VGQKn823D+ReujKh+jgxbl8Q+r652C9Wl1N+C5C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
|
39
40
|
dependencies: []
|
40
41
|
description: A simple gem that allows you to search where you fell (distro, OS, kernel,
|
41
42
|
installer...) and adapt your commands accordingly.
|
@@ -47,7 +48,9 @@ files:
|
|
47
48
|
- ".gitignore"
|
48
49
|
- LICENSE
|
49
50
|
- README.md
|
51
|
+
- lib/nomansland.rb
|
50
52
|
- lib/nomansland/distro.rb
|
53
|
+
- lib/nomansland/init.rb
|
51
54
|
- lib/nomansland/installer.rb
|
52
55
|
- nomansland.gemspec
|
53
56
|
homepage: https://github.com/szorfein/nomansland
|
@@ -56,7 +59,7 @@ licenses:
|
|
56
59
|
metadata:
|
57
60
|
bug_tracker_uri: https://github.com/szorfein/nomansland/issues
|
58
61
|
wiki_uri: https://github.com/szorfein/nomansland
|
59
|
-
post_install_message:
|
62
|
+
post_install_message:
|
60
63
|
rdoc_options: []
|
61
64
|
require_paths:
|
62
65
|
- lib
|
@@ -64,15 +67,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
67
|
requirements:
|
65
68
|
- - ">="
|
66
69
|
- !ruby/object:Gem::Version
|
67
|
-
version: '2.
|
70
|
+
version: '2.5'
|
68
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
72
|
requirements:
|
70
73
|
- - ">="
|
71
74
|
- !ruby/object:Gem::Version
|
72
75
|
version: '0'
|
73
76
|
requirements: []
|
74
|
-
rubygems_version: 3.
|
75
|
-
signing_key:
|
77
|
+
rubygems_version: 3.3.19
|
78
|
+
signing_key:
|
76
79
|
specification_version: 4
|
77
80
|
summary: A simple gem that allows you to search where you fell
|
78
81
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|