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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6b63c35782ff24077f5ba4ba2a03b504f0c553824d5ab57bb871073aecd9137
4
- data.tar.gz: b5b66f51cfe99876190a11361018548b6d4e6b2bb71dd122d59ddf714850c641
3
+ metadata.gz: e91ae02bbb0fb3769135971a33014162995d57329719d1bceb210fa8168edd0f
4
+ data.tar.gz: 25a09c25db350e0f8cbd95deb746ce173b2ee6ac86db08ac05b5692a729df06a
5
5
  SHA512:
6
- metadata.gz: 907792b6704ec36b10cfdfc6ed6b6171b3bc4fcaeb89b9434dc87acfc97aef70b894ec105b7fc174a34d02e4f5cc3986a4d4c393f3b6097bb37c361c4bfaae30
7
- data.tar.gz: 48f401d4b596fe75349853da8ba3ceaf5efc469ceb0e5a1d52c22a412c4ba17623a49ab86905e9036ee83748f8a4292ea2085c2f1e757cf8a41b247348a7b5e8
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 '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')
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
  ```
@@ -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
@@ -0,0 +1,9 @@
1
+ module Nomansland
2
+ def self.init?
3
+ return :systemd if Dir.exist? '/etc/systemd'
4
+
5
+ # https://github.com/void-linux/void-runit
6
+ return :runit if Dir.exist? '/etc/runit'
7
+ return :openrc if Dir.exist? '/etc/init.d'
8
+ end
9
+ 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/lib/nomansland.rb ADDED
@@ -0,0 +1,6 @@
1
+ module Nomansland
2
+ end
3
+
4
+ require 'nomansland/installer'
5
+ require 'nomansland/distro'
6
+ require 'nomansland/init'
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.1"
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.4'
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.1
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
- MIIETTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB1zem9y
14
- ZmVpbi9EQz1wcm90b25tYWlsL0RDPWNvbTAeFw0yMDA0MzAxNzAxNDBaFw0yMTA0
15
- MzAxNzAxNDBaMCgxJjAkBgNVBAMMHXN6b3JmZWluL0RDPXByb3Rvbm1haWwvREM9
16
- Y29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAxCTYZRndCTRy18rE
17
- exr2wig/staa0G5kt99xqaBYD0dnIRBr/GO5dFntlBVwmefQlTrNbygVUIYTb8Vg
18
- B1oX3v/LLW9SRQcWaZwou0tARqanm5WhgV1ZYQTs22endTazsDHw0uhM3V+FgDh+
19
- eR5wM9vU+SkRFHWzjVS1OxyTSCBVWb3+nrYTr/OKZ5Fm3Vo1dEQdwBEWLLXuUBxs
20
- dWEDmBk7iTJbvNdd5Kk2wfMKRMOl9NGicJl3Cb5yl5ITeZsXdOsrLBBPepTpNeq2
21
- k1goew3mEd/4pVXrdw6S5Qr6RTbTCLpKNRxWtx01vue9NN1cQ/Ds5FRkCp/Ntw/k
22
- Xroyofo4MW5fEPq+udgvVpdTfguQkpmuJg7TRiq9F5hDhEMnKUsdM2fSev9u8EvL
23
- OkidKy8bnhUOoG9qDxEG/IyibjRLl1i5jtyHa8Jb/We8poZ5LI8qjHwMPjTBhDgi
24
- EzaYV5rLGs5S1/m58XG6a+620x2tcQZph6FFbnQJ8QBuNz6zAgMBAAGjgYEwfzAJ
25
- BgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUc8XWveAjxS5fVEOZeeZe
26
- uUQmbhMwIgYDVR0RBBswGYEXc3pvcmZlaW5AcHJvdG9ubWFpbC5jb20wIgYDVR0S
27
- BBswGYEXc3pvcmZlaW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zKcM9EGnWRWUb899drCcD4VJhjPtgpn+
36
+ aEJeKq4/BlIwMlXPe+W5C8zp2i8hgG1/OYbwbGE1p2iRi1NIK7G/HyRqQjOqJxzE
37
+ LLknX69FN7/G
37
38
  -----END CERTIFICATE-----
38
- date: 2020-05-04 00:00:00.000000000 Z
39
+ date: 2022-09-08 00:00:00.000000000 Z
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.4'
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.1.2
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