scone 0.1.7 → 0.1.11

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: 13a944eb96de16c0a854f02db6bf2bf168cc250eddd8c63bc51ed351b56a17e4
4
- data.tar.gz: 742b0229c57d877249f0c3f996bea565c57d419d332b0c57e5fd7fd0ec833cde
3
+ metadata.gz: 5ed4ed0cf6c5edae323bb179ea3a1808b4bd0f70d98e4636386793784fa078cc
4
+ data.tar.gz: ad36dfa08a7bf170c8a36f2c1f9671441b7edd9330abab8ed0a7686d09904699
5
5
  SHA512:
6
- metadata.gz: 7fd7fcc1a6606fe266c6a1f225ac3d557e5186e0a77584d9f14b32b260927c2750e3aceb8c5601f6fe83eb41132c00fb45174cfa1c4496f3f14c3e30f79c9c6e
7
- data.tar.gz: e3aeb2de01bb6c1bc1b15efed951ea3ba1b7a0306cf545bf6d89a04519b1835880087dc448a60d59e9c1f49e67323430127bd97cd42b0a6a59f8a207b762ac08
6
+ metadata.gz: f1c383cacf44e6a89726cabd53d1dc275fa8305c57633218c3d02d184132895634bec5d83b826c613d3baeb3314c6c6575f327f6159b4c7e00d3ca208b932f17
7
+ data.tar.gz: 0f963ae43273996ed330852264f90a3e24cd43dcb49013d13292cc04f3f24cb01c3e66ae1184d70e8a174405e7725d259768b82445a561902f8506091eddd0b7
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
@@ -8,3 +8,4 @@ gemspec
8
8
  gem "rake", "~> 13.0"
9
9
  gem "rspec", "~> 3.0"
10
10
  gem "rubocop", "~> 1.21"
11
+ gem "rubocop-shopify", "~> 2.3.0"
data/Gemfile.lock CHANGED
@@ -1,12 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- scone (0.1.0)
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
@@ -9,4 +9,4 @@ require "rubocop/rake_task"
9
9
 
10
10
  RuboCop::RakeTask.new
11
11
 
12
- task default: %i[spec rubocop]
12
+ task default: [:spec, :rubocop]
data/cache/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  *
2
2
  !proc.stat.txt
3
+ !ifconfig.txt
3
4
  !.gitignore
@@ -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
@@ -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,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
@@ -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
- 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
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
data/lib/scone/version.rb CHANGED
@@ -18,5 +18,5 @@
18
18
 
19
19
  # Scone Module
20
20
  module Scone
21
- VERSION = "0.1.7"
21
+ VERSION = "0.1.11"
22
22
  end
data/scone.gemspec CHANGED
@@ -24,10 +24,10 @@ Gem::Specification.new do |spec|
24
24
  spec.authors = ["clivern"]
25
25
  spec.email = ["hello@clivern.com"]
26
26
 
27
- spec.summary = "A Unified SDK for Linux OS Distributions in Ruby."
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
@@ -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
- `git ls-files -z`.split("\x0").reject do |f|
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.7
4
+ version: 0.1.11
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-24 00:00:00.000000000 Z
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,13 +46,16 @@ 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
52
  - lib/scone/io/directory.rb
38
53
  - lib/scone/io/file.rb
39
54
  - lib/scone/io/system.rb
40
55
  - lib/scone/platform.rb
56
+ - lib/scone/system.rb
41
57
  - lib/scone/ubuntu/group.rb
58
+ - lib/scone/ubuntu/ip.rb
42
59
  - lib/scone/ubuntu/package.rb
43
60
  - lib/scone/ubuntu/stat.rb
44
61
  - lib/scone/ubuntu/user.rb
@@ -47,7 +64,7 @@ files:
47
64
  - scone.gemspec
48
65
  homepage: https://github.com/Clivern/Scone
49
66
  licenses:
50
- - MIT
67
+ - Apache-2.0
51
68
  metadata:
52
69
  homepage_uri: https://github.com/Clivern/Scone
53
70
  source_code_uri: https://github.com/Clivern/Scone
@@ -70,5 +87,5 @@ requirements: []
70
87
  rubygems_version: 3.1.6
71
88
  signing_key:
72
89
  specification_version: 4
73
- summary: A Unified SDK for Linux OS Distributions in Ruby.
90
+ summary: A Ruby SDK for Different Linux Operating System Distributions.
74
91
  test_files: []