scone 0.1.6 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -24
- data/Gemfile +1 -0
- data/Gemfile.lock +6 -1
- data/Rakefile +1 -1
- data/cache/.gitignore +1 -0
- data/cache/ifconfig.txt +18 -0
- data/lib/scone/io/{Directory.rb → directory.rb} +0 -0
- data/lib/scone/io/{File.rb → file.rb} +0 -0
- data/lib/scone/io/{System.rb → system.rb} +0 -0
- data/lib/scone/system.rb +43 -0
- data/lib/scone/ubuntu/{Group.rb → group.rb} +0 -0
- data/lib/scone/ubuntu/ip.rb +27 -0
- data/lib/scone/ubuntu/{Package.rb → package.rb} +0 -0
- data/lib/scone/ubuntu/stat.rb +17 -17
- data/lib/scone/ubuntu/{User.rb → user.rb} +0 -0
- data/lib/scone/version.rb +1 -1
- data/scone.gemspec +3 -2
- metadata +27 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 628420bef6125a203fabb6bace042dde435fe4ee933339d35c41ae8f02ff0b1e
|
4
|
+
data.tar.gz: ca72b097160484c8183182a653288b85c2323d79df18483d0c8c855a3231188b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c22ecc280c169899d391842a4502160fc94668e40e9a3de86db66a37b7b87899db77d6f77e169e474abe6eb040e4ac3290c262d8e21a29c1b4da6ae022100b2
|
7
|
+
data.tar.gz: f6d5aa8edcfe8b13520029842ccd07ec6e71393951153aedf54b55b3f50a5f692154c5cae83b9f126d246b2e0965b5c767aebfc03518d36d9fab333c53b59f65
|
data/.rubocop.yml
CHANGED
@@ -1,30 +1,9 @@
|
|
1
|
+
inherit_gem:
|
2
|
+
rubocop-shopify: rubocop.yml
|
3
|
+
|
1
4
|
AllCops:
|
2
5
|
NewCops: enable
|
3
6
|
TargetRubyVersion: 2.6
|
4
7
|
|
5
|
-
Style/StringLiterals:
|
6
|
-
Enabled: true
|
7
|
-
EnforcedStyle: double_quotes
|
8
|
-
|
9
|
-
Style/StringLiteralsInInterpolation:
|
10
|
-
Enabled: true
|
11
|
-
EnforcedStyle: double_quotes
|
12
|
-
|
13
|
-
Layout/LineLength:
|
14
|
-
Enabled: true
|
15
|
-
Max: 320
|
16
|
-
|
17
|
-
Metrics/BlockLength:
|
18
|
-
Enabled: true
|
19
|
-
Max: 50
|
20
|
-
|
21
|
-
Metrics/MethodLength:
|
22
|
-
Enabled: true
|
23
|
-
Max: 50
|
24
|
-
|
25
|
-
Metrics/AbcSize:
|
26
|
-
Enabled: true
|
27
|
-
Max: 50
|
28
|
-
|
29
8
|
Style/SymbolProc:
|
30
9
|
Enabled: false
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
scone (0.1.
|
4
|
+
scone (0.1.9)
|
5
|
+
awesome_spawn (~> 1.5)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
9
10
|
ast (2.4.2)
|
11
|
+
awesome_spawn (1.5.0)
|
10
12
|
diff-lcs (1.4.4)
|
11
13
|
parallel (1.21.0)
|
12
14
|
parser (3.0.2.0)
|
@@ -39,6 +41,8 @@ GEM
|
|
39
41
|
unicode-display_width (>= 1.4.0, < 3.0)
|
40
42
|
rubocop-ast (1.12.0)
|
41
43
|
parser (>= 3.0.1.1)
|
44
|
+
rubocop-shopify (2.3.0)
|
45
|
+
rubocop (~> 1.22)
|
42
46
|
ruby-progressbar (1.11.0)
|
43
47
|
unicode-display_width (2.1.0)
|
44
48
|
|
@@ -49,6 +53,7 @@ DEPENDENCIES
|
|
49
53
|
rake (~> 13.0)
|
50
54
|
rspec (~> 3.0)
|
51
55
|
rubocop (~> 1.21)
|
56
|
+
rubocop-shopify (~> 2.3.0)
|
52
57
|
scone!
|
53
58
|
|
54
59
|
BUNDLED WITH
|
data/Rakefile
CHANGED
data/cache/.gitignore
CHANGED
data/cache/ifconfig.txt
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
|
2
|
+
inet 104.248.58.9 netmask 255.255.240.0 broadcast 104.248.63.255
|
3
|
+
inet6 2604:a880:400:d0::1986:5001 prefixlen 64 scopeid 0x0<global>
|
4
|
+
inet6 fe80::5074:3eff:fe15:d08b prefixlen 64 scopeid 0x20<link>
|
5
|
+
ether 52:74:3e:15:d0:8b txqueuelen 1000 (Ethernet)
|
6
|
+
RX packets 663200 bytes 90827363 (90.8 MB)
|
7
|
+
RX errors 0 dropped 0 overruns 0 frame 0
|
8
|
+
TX packets 652332 bytes 479484344 (479.4 MB)
|
9
|
+
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
10
|
+
|
11
|
+
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
|
12
|
+
inet 127.0.0.1 netmask 255.0.0.0
|
13
|
+
inet6 ::1 prefixlen 128 scopeid 0x10<host>
|
14
|
+
loop txqueuelen 1000 (Local Loopback)
|
15
|
+
RX packets 0 bytes 0 (0.0 B)
|
16
|
+
RX errors 0 dropped 0 overruns 0 frame 0
|
17
|
+
TX packets 0 bytes 0 (0.0 B)
|
18
|
+
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
File without changes
|
File without changes
|
File without changes
|
data/lib/scone/system.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Scone - A Unified SDK for Linux OS Distributions in Ruby
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require "awesome_spawn"
|
20
|
+
|
21
|
+
# Scone Module
|
22
|
+
module Scone
|
23
|
+
# Command Class
|
24
|
+
class Command
|
25
|
+
def initialize(command)
|
26
|
+
@command = command
|
27
|
+
end
|
28
|
+
|
29
|
+
def run
|
30
|
+
result = AwesomeSpawn.run(@command)
|
31
|
+
@exit_status = result.exit_status
|
32
|
+
@command_line = result.command_line
|
33
|
+
@output = result.output
|
34
|
+
@error = result.error
|
35
|
+
@exit_status
|
36
|
+
end
|
37
|
+
|
38
|
+
attr_reader :exit_status
|
39
|
+
attr_reader :command_line
|
40
|
+
attr_reader :output
|
41
|
+
attr_reader :error
|
42
|
+
end
|
43
|
+
end
|
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Scone - A Unified SDK for Linux OS Distributions in Ruby
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
# Scone Module
|
20
|
+
module Scone
|
21
|
+
# Ubuntu Module
|
22
|
+
module Ubuntu
|
23
|
+
# IP Address Class
|
24
|
+
class IPAddr
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
File without changes
|
data/lib/scone/ubuntu/stat.rb
CHANGED
@@ -43,23 +43,23 @@ module Scone
|
|
43
43
|
next if info.empty?
|
44
44
|
|
45
45
|
hash[info.first.to_sym] = if info.first =~ /^cpu/i
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
46
|
+
{
|
47
|
+
user: info[1].to_i,
|
48
|
+
nice: info[2].to_i,
|
49
|
+
system: info[3].to_i,
|
50
|
+
idle: info[4].to_i,
|
51
|
+
iowait: info[5].to_i,
|
52
|
+
irq: info[6].to_i,
|
53
|
+
softirq: info[7].to_i,
|
54
|
+
steal: info[8].to_i,
|
55
|
+
guest: info[9].to_i,
|
56
|
+
guest_nice: info[10].to_i,
|
57
|
+
}
|
58
|
+
elsif info.size > 2
|
59
|
+
info[1..].map { |e| e.to_i }
|
60
|
+
else
|
61
|
+
info[1].to_i
|
62
|
+
end
|
63
63
|
end
|
64
64
|
hash
|
65
65
|
end
|
File without changes
|
data/lib/scone/version.rb
CHANGED
data/scone.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.authors = ["clivern"]
|
25
25
|
spec.email = ["hello@clivern.com"]
|
26
26
|
|
27
|
-
spec.summary = "A
|
27
|
+
spec.summary = "A Ruby SDK for Different Linux Operating System Distributions."
|
28
28
|
spec.description = "A Set of Modules to work with a different Linux Operating System Distributions in Ruby."
|
29
29
|
spec.homepage = "https://github.com/Clivern/Scone"
|
30
30
|
spec.license = "MIT"
|
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
# Specify which files should be added to the gem when it is released.
|
38
38
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
39
39
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
40
|
-
|
40
|
+
%x(git ls-files -z).split("\x0").reject do |f|
|
41
41
|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
42
42
|
end
|
43
43
|
end
|
@@ -48,6 +48,7 @@ Gem::Specification.new do |spec|
|
|
48
48
|
|
49
49
|
# Uncomment to register a new dependency of your gem
|
50
50
|
# spec.add_dependency "example-gem", "~> 1.0"
|
51
|
+
spec.add_dependency("awesome_spawn", "~> 1.5")
|
51
52
|
|
52
53
|
# For more information and examples about making a new gem, checkout our
|
53
54
|
# guide at: https://bundler.io/guides/creating_gem.html
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- clivern
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
12
|
-
dependencies:
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: awesome_spawn
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
13
27
|
description: A Set of Modules to work with a different Linux Operating System Distributions
|
14
28
|
in Ruby.
|
15
29
|
email:
|
@@ -32,16 +46,19 @@ files:
|
|
32
46
|
- bin/console
|
33
47
|
- bin/setup
|
34
48
|
- cache/.gitignore
|
49
|
+
- cache/ifconfig.txt
|
35
50
|
- cache/proc.stat.txt
|
36
51
|
- lib/scone.rb
|
37
|
-
- lib/scone/io/
|
38
|
-
- lib/scone/io/
|
39
|
-
- lib/scone/io/
|
52
|
+
- lib/scone/io/directory.rb
|
53
|
+
- lib/scone/io/file.rb
|
54
|
+
- lib/scone/io/system.rb
|
40
55
|
- lib/scone/platform.rb
|
41
|
-
- lib/scone/
|
42
|
-
- lib/scone/ubuntu/
|
43
|
-
- lib/scone/ubuntu/
|
56
|
+
- lib/scone/system.rb
|
57
|
+
- lib/scone/ubuntu/group.rb
|
58
|
+
- lib/scone/ubuntu/ip.rb
|
59
|
+
- lib/scone/ubuntu/package.rb
|
44
60
|
- lib/scone/ubuntu/stat.rb
|
61
|
+
- lib/scone/ubuntu/user.rb
|
45
62
|
- lib/scone/version.rb
|
46
63
|
- renovate.json
|
47
64
|
- scone.gemspec
|
@@ -70,5 +87,5 @@ requirements: []
|
|
70
87
|
rubygems_version: 3.1.6
|
71
88
|
signing_key:
|
72
89
|
specification_version: 4
|
73
|
-
summary: A
|
90
|
+
summary: A Ruby SDK for Different Linux Operating System Distributions.
|
74
91
|
test_files: []
|