nomansland 0.0.2 → 0.0.3
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 +14 -10
- data/lib/nomansland/distro.rb +19 -8
- data/lib/nomansland/installer.rb +5 -4
- data/nomansland.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +17 -17
- 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: c563c12ec255dfc166e066cba9bbcb20373202b182206cff794f6451ecfb2b73
|
4
|
+
data.tar.gz: a82023fd649e2677a75bc64ce1b875063d24574c4ae748323d4b4574dc6d7b8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02b349923d2b7dd878fa7030e7aeef14e53f801cd6fe426ac1d9c28d6a210d80ae7570fd0dff5aeaa0618daf5dbdd4933677271d45c6a76149698256334fadb4
|
7
|
+
data.tar.gz: 8f881e380ea7c3845e715f877d88ccb07869957a5892184f1cb382cc6f56adfe66c40e3b08b48b84e5d857258ddb86c675edb239483a92ed1ae8c3a00bb0eb3f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -14,23 +14,27 @@ 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')
|
35
39
|
end
|
36
40
|
```
|
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/nomansland.gemspec
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,18 +1,18 @@
|
|
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.3
|
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
13
|
MIIETTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB1zem9y
|
14
|
-
|
15
|
-
|
14
|
+
ZmVpbi9EQz1wcm90b25tYWlsL0RDPWNvbTAeFw0yMTA1MTEyMTAzNDZaFw0yMjA1
|
15
|
+
MTEyMTAzNDZaMCgxJjAkBgNVBAMMHXN6b3JmZWluL0RDPXByb3Rvbm1haWwvREM9
|
16
16
|
Y29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAxCTYZRndCTRy18rE
|
17
17
|
exr2wig/staa0G5kt99xqaBYD0dnIRBr/GO5dFntlBVwmefQlTrNbygVUIYTb8Vg
|
18
18
|
B1oX3v/LLW9SRQcWaZwou0tARqanm5WhgV1ZYQTs22endTazsDHw0uhM3V+FgDh+
|
@@ -25,17 +25,17 @@ cert_chain:
|
|
25
25
|
BgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUc8XWveAjxS5fVEOZeeZe
|
26
26
|
uUQmbhMwIgYDVR0RBBswGYEXc3pvcmZlaW5AcHJvdG9ubWFpbC5jb20wIgYDVR0S
|
27
27
|
BBswGYEXc3pvcmZlaW5AcHJvdG9ubWFpbC5jb20wDQYJKoZIhvcNAQELBQADggGB
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
28
|
+
AHuRqWvtAx1PSIEcvq1uzgBclzP+Lhp6J1f7McvbfzHAZuLo5Nv9iFHkLl2ad9gx
|
29
|
+
p/X2/p8PmgiUNFSXDdB12Pn/VbX4DdoQujwXvmZbQo2KmooklHIhM6AJMafOHW1N
|
30
|
+
qjHIwGvMY5bJfn+3qEQNV+yip6KnCUQVklw132IFvdusoBOPfEP48p41deXbIhNP
|
31
|
+
GNJQ4qkZfXWdLumikb2Y432kIIeugIIAL57VD+wwDUJ3MciiLufYT7v9WNSFRenV
|
32
|
+
JDNGIh3AYiCnNO2DWIArrW6/jaof3A0OnjRQ64vS+EKhZFp8+y6rfC3Clrfjdjse
|
33
|
+
a4zH3TI57bnzfkx5xhjhIu6LJnBpk0x8Y/N2kVmwB+GonFiRcVzZpIfOLvy03tn5
|
34
|
+
dAHfUn//hrBJAT9EXRHNUoLyEmFsCPabTCXjQH6EM2uBcsrjQN4SlgBNzsKc8bS4
|
35
|
+
F9Dl4EPzjBJOgQWf+NxzxNuNKI46Lp5Q8AI+xtDUHAPbSswHa40BA6ChFehP+j0L
|
36
|
+
fg==
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2021-12-29 00:00:00.000000000 Z
|
39
39
|
dependencies: []
|
40
40
|
description: A simple gem that allows you to search where you fell (distro, OS, kernel,
|
41
41
|
installer...) and adapt your commands accordingly.
|
@@ -57,7 +57,7 @@ licenses:
|
|
57
57
|
metadata:
|
58
58
|
bug_tracker_uri: https://github.com/szorfein/nomansland/issues
|
59
59
|
wiki_uri: https://github.com/szorfein/nomansland
|
60
|
-
post_install_message:
|
60
|
+
post_install_message:
|
61
61
|
rdoc_options: []
|
62
62
|
require_paths:
|
63
63
|
- lib
|
@@ -72,8 +72,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
76
|
-
signing_key:
|
75
|
+
rubygems_version: 3.2.32
|
76
|
+
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: A simple gem that allows you to search where you fell
|
79
79
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|