scone 0.1.9 → 0.1.13
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/Gemfile.lock +3 -1
- data/cache/.gitignore +1 -0
- data/cache/proc.cpuinfo.txt +23 -0
- data/lib/scone/system.rb +43 -0
- data/lib/scone/ubuntu/hardware.rb +31 -0
- data/lib/scone/version.rb +1 -1
- data/scone.gemspec +2 -8
- metadata +20 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76ab13b58dcb1e0d42904a2221d3f5faa01175673f409c9baadf892aceaf711d
|
4
|
+
data.tar.gz: 9428d85419977cac5d6e97e1999368422f12881307c63e7d07e89417d3191e18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aca0ebc40cd6b4e5a5fb10031902243e0296a70fa984e5e5d6139c9d1ab4638cf1d9710ef9c105899217371017588479002a4c8c78c415e943228b18d60eaf8
|
7
|
+
data.tar.gz: 3f04a0c8fd53fe95753f65744e074da53cc32f54ee6a494e75c53006c286450d2e8c661e5d1092e8ece16fea4b17949433589b25d958d389e9a054aa06e5a434
|
data/Gemfile.lock
CHANGED
data/cache/.gitignore
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
processor : 0
|
2
|
+
vendor_id : GenuineIntel
|
3
|
+
cpu family : 6
|
4
|
+
model : 85
|
5
|
+
model name : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
|
6
|
+
stepping : 4
|
7
|
+
microcode : 0x1
|
8
|
+
cpu MHz : 2294.608
|
9
|
+
cache size : 4096 KB
|
10
|
+
physical id : 0
|
11
|
+
siblings : 1
|
12
|
+
core id : 0
|
13
|
+
cpu cores : 1
|
14
|
+
apicid : 0
|
15
|
+
initial apicid : 0
|
16
|
+
fpu : yes
|
17
|
+
fpu_exception : yes
|
18
|
+
cpuid level : 13
|
19
|
+
wp : yes
|
20
|
+
clflush size : 64
|
21
|
+
cache_alignment : 64
|
22
|
+
address sizes : 40 bits physical, 48 bits virtual
|
23
|
+
power management:
|
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
|
@@ -0,0 +1,31 @@
|
|
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
|
+
# Hardware Class
|
24
|
+
class Hardware
|
25
|
+
# Get total cores
|
26
|
+
def total_cores(proc_file = "/proc/cpuinfo")
|
27
|
+
File.readlines(proc_file).count { |line| line =~ /^processor\s+:\s+\d+/ }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/scone/version.rb
CHANGED
data/scone.gemspec
CHANGED
@@ -27,15 +27,13 @@ Gem::Specification.new do |spec|
|
|
27
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
|
-
spec.license = "
|
30
|
+
spec.license = "Apache-2.0"
|
31
31
|
spec.required_ruby_version = ">= 2.6.0"
|
32
32
|
|
33
33
|
spec.metadata["homepage_uri"] = spec.homepage
|
34
34
|
spec.metadata["source_code_uri"] = "https://github.com/Clivern/Scone"
|
35
35
|
spec.metadata["changelog_uri"] = "https://github.com/Clivern/Scone/blob/main/CHANGELOG.md"
|
36
36
|
|
37
|
-
# Specify which files should be added to the gem when it is released.
|
38
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
39
37
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
40
38
|
%x(git ls-files -z).split("\x0").reject do |f|
|
41
39
|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
@@ -46,9 +44,5 @@ Gem::Specification.new do |spec|
|
|
46
44
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
47
45
|
spec.require_paths = ["lib"]
|
48
46
|
|
49
|
-
|
50
|
-
# spec.add_dependency "example-gem", "~> 1.0"
|
51
|
-
|
52
|
-
# For more information and examples about making a new gem, checkout our
|
53
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
47
|
+
spec.add_dependency("awesome_spawn", "~> 1.5")
|
54
48
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- clivern
|
@@ -9,7 +9,21 @@ autorequire:
|
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
11
|
date: 2021-10-25 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
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:
|
@@ -33,13 +47,16 @@ files:
|
|
33
47
|
- bin/setup
|
34
48
|
- cache/.gitignore
|
35
49
|
- cache/ifconfig.txt
|
50
|
+
- cache/proc.cpuinfo.txt
|
36
51
|
- cache/proc.stat.txt
|
37
52
|
- lib/scone.rb
|
38
53
|
- lib/scone/io/directory.rb
|
39
54
|
- lib/scone/io/file.rb
|
40
55
|
- lib/scone/io/system.rb
|
41
56
|
- lib/scone/platform.rb
|
57
|
+
- lib/scone/system.rb
|
42
58
|
- lib/scone/ubuntu/group.rb
|
59
|
+
- lib/scone/ubuntu/hardware.rb
|
43
60
|
- lib/scone/ubuntu/ip.rb
|
44
61
|
- lib/scone/ubuntu/package.rb
|
45
62
|
- lib/scone/ubuntu/stat.rb
|
@@ -49,7 +66,7 @@ files:
|
|
49
66
|
- scone.gemspec
|
50
67
|
homepage: https://github.com/Clivern/Scone
|
51
68
|
licenses:
|
52
|
-
-
|
69
|
+
- Apache-2.0
|
53
70
|
metadata:
|
54
71
|
homepage_uri: https://github.com/Clivern/Scone
|
55
72
|
source_code_uri: https://github.com/Clivern/Scone
|