scone 0.1.9 → 0.1.13

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: 99500c9ae644a78f8231b5ec64c2931cffd939021ba436b924c4a92544bc16be
4
- data.tar.gz: 95fc4841209e96936bc7b08b4fba987c701ccbc1d7679ed4263049dfde49fd55
3
+ metadata.gz: 76ab13b58dcb1e0d42904a2221d3f5faa01175673f409c9baadf892aceaf711d
4
+ data.tar.gz: 9428d85419977cac5d6e97e1999368422f12881307c63e7d07e89417d3191e18
5
5
  SHA512:
6
- metadata.gz: ffafa062e3fae1b706bae8878330fad4f852082ff70250a79a0fbcf545d6827803719c1c9d206427f9e543c93446c4f454e5370e309832d9c93221be1aa363e7
7
- data.tar.gz: daa854f58fd9acc132b6e06ebacfacdb69c5c357f024178805f5509e7b0b3a745bfcb45cd683b050e7d305d0563916dd0ae675a2e8510dde63a2c4a3e5b7babc
6
+ metadata.gz: 2aca0ebc40cd6b4e5a5fb10031902243e0296a70fa984e5e5d6139c9d1ab4638cf1d9710ef9c105899217371017588479002a4c8c78c415e943228b18d60eaf8
7
+ data.tar.gz: 3f04a0c8fd53fe95753f65744e074da53cc32f54ee6a494e75c53006c286450d2e8c661e5d1092e8ece16fea4b17949433589b25d958d389e9a054aa06e5a434
data/Gemfile.lock CHANGED
@@ -1,12 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- scone (0.1.8)
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)
data/cache/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  *
2
2
  !proc.stat.txt
3
3
  !ifconfig.txt
4
+ !proc.cpuinfo.txt
4
5
  !.gitignore
@@ -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:
@@ -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
@@ -18,5 +18,5 @@
18
18
 
19
19
  # Scone Module
20
20
  module Scone
21
- VERSION = "0.1.9"
21
+ VERSION = "0.1.13"
22
22
  end
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 = "MIT"
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
- # Uncomment to register a new dependency of your gem
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.9
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
- - MIT
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