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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ecc838089f689beb373ecd91c03601194d52d5c2276c23fdf8f8f117e40818a
4
- data.tar.gz: a16c10211c14aa86adb0c2a16e8eede844c4ce8fa7f2992d74a0e8b82cb97f1c
3
+ metadata.gz: c563c12ec255dfc166e066cba9bbcb20373202b182206cff794f6451ecfb2b73
4
+ data.tar.gz: a82023fd649e2677a75bc64ce1b875063d24574c4ae748323d4b4574dc6d7b8e
5
5
  SHA512:
6
- metadata.gz: 13860cf8bf0f99acf2c8f6a3e42fbc01a6c47eeffcc6a1108f3f0691dd9bc113e49f97851104811ae6ef5a4ce9d8a588b7effb42dae4ea1ce6e6e2265ec93288
7
- data.tar.gz: a155ac7dd858eb9e669c13b41d7774f07e808279f81d0803260903dc687ba028c8aba09bc660fdbee9b3a1b567c5bdea0b3a91fc141765bf8b5ee03112c62012
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 'Nomansland'
17
+ require 'nomansland'
18
18
 
19
- puts "Running Fedora" if Nomansland::distro? == :fedora
20
- puts "Running Gentoo" if Nomansland::distro? == :gentoo
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 'Nomansland'
30
+ require 'nomansland'
27
31
 
28
32
  case Nomansland::installer?
29
- when :yum
30
- system("sudo yum install tor")
31
- when :apt_get
32
- system("sudo apt-get install tor")
33
- when :pacman
34
- system("sudo pacman -S tor")
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
  ```
@@ -1,12 +1,23 @@
1
1
  module Nomansland
2
+
2
3
  def self.distro?
3
- return :fedora if File.exist?("/etc/fedora-release")
4
- return :redhat if File.exist?("/etc/redhat-release")
5
- return :suse if File.exist?("/etc/SUSE-release")
6
- return :mandrake if File.exist?("/etc/mandrake-release")
7
- return :ubuntu if File.exist?("/etc/ubuntu-release")
8
- return :debian if File.exist?("/etc/debian_version")
9
- return :gentoo if File.exist?("/etc/gentoo-release")
10
- return :archlinux if File.exist?("/etc/arch-release")
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
@@ -1,8 +1,9 @@
1
1
  module Nomansland
2
2
  def self.installer?
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")
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
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  "wiki_uri" => "https://github.com/szorfein/nomansland"
9
9
  }
10
10
 
11
- s.version = "0.0.2"
11
+ s.version = "0.0.3"
12
12
  s.platform = Gem::Platform::RUBY
13
13
  s.author = ['szorfein']
14
14
  s.homepage = 'https://github.com/szorfein/nomansland'
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.2
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
- ZmVpbi9EQz1wcm90b25tYWlsL0RDPWNvbTAeFw0yMDA0MzAxNzAxNDBaFw0yMTA0
15
- MzAxNzAxNDBaMCgxJjAkBgNVBAMMHXN6b3JmZWluL0RDPXByb3Rvbm1haWwvREM9
14
+ ZmVpbi9EQz1wcm90b25tYWlsL0RDPWNvbTAeFw0yMTA1MTEyMTAzNDZaFw0yMjA1
15
+ MTEyMTAzNDZaMCgxJjAkBgNVBAMMHXN6b3JmZWluL0RDPXByb3Rvbm1haWwvREM9
16
16
  Y29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAxCTYZRndCTRy18rE
17
17
  exr2wig/staa0G5kt99xqaBYD0dnIRBr/GO5dFntlBVwmefQlTrNbygVUIYTb8Vg
18
18
  B1oX3v/LLW9SRQcW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+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: 2020-05-04 00:00:00.000000000 Z
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.1.2
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