kanrisuru 0.16.4 → 0.16.8

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: e33daa1aa8d51a7f8a9e6efb4e77933ef5a71e1ce3e428dabc7f44468bde79b3
4
- data.tar.gz: 8cbc4f168fdf88bdd22c8fb237018c65427010356ed8d1bfe9771f2e8ecfc0ca
3
+ metadata.gz: 19051625865d261facba9c6c32d6a91ae68cbc23e6723713c07eee7f674dba04
4
+ data.tar.gz: 62485343ad12ecc892c70ad30168f30366bdcb6cc4dd2eff37aa378e63790186
5
5
  SHA512:
6
- metadata.gz: 992f48fbc7c55a67cd2bfa649cba991620ab0ee6aa97d4c49de918d099a1e9963a30dea99aa71fe738ad39982462e731caf4ab121263a0bbf4870a68ae5a1e83
7
- data.tar.gz: 208b2389785ed015055a3c67b49b433dae7d5388ee32334af5d74f7a2f94db19900a1dba4396b02edc675987fadead7b90d3f961e3eddb9e5e7c35c946ac28fe
6
+ metadata.gz: '08760e0e1d80c29dd4db38984a13aabb554321555820834f4ccb50ba48562af5e1fd932e946bb7fd223d734dcf936c199b24936d0f3a1204e70dc4b204c25f95'
7
+ data.tar.gz: 5d6590c530553c36b0aea32e2dff7fe14f6ced645445d53933b4e564364a44786825fb8ae3cbc886bfe418edcc04c03bba4c8ed297c2b75ac3b31a7a1ce7483c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## Kanrisuru 0.16.8 (December 27, 2021) ##
2
+ * Fix return value of field for dmi parser.
3
+ * Fix upload command to copy contents of directory when transfering directories from tmp location.
4
+
5
+ ## Kanrisuru 0.16.7 (December 27, 2021) ##
6
+ * Update homepage to docs website.
7
+
8
+ ## Kanrisuru 0.16.6 (December 26, 2021) ##
9
+ * Add `delete` to fstab class to delete an entry from the fstab.
10
+
11
+ ## Kanrisuru 0.16.5 (December 25, 2021) ##
12
+ * Refactor `dmi_field_translate` to reduce complexity.
13
+
1
14
  ## Kanrisuru 0.16.4 (December 25, 2021) ##
2
15
  * Refactor `Kanrisuru::Fstab::Entry` and `Kanrisuru::Fstab::Options` classes into separate files.
3
16
 
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- <p align='center'>
2
- <img src="https://s3.us-east-2.amazonaws.com/kanrisuru.com/kanrisuru-banner-02.png" width="600" />
3
- </p>
1
+ <h1>
2
+ <img src="./logo/kanrisuru-logo.png" alt="Kanrisuru" width="400" height="100%"/>
3
+ </h1>
4
4
 
5
- <p align="center">
5
+ <p>
6
6
  <a href="https://rubygems.org/gems/kanrisuru">
7
7
  <img src="https://img.shields.io/gem/v/kanrisuru?style=flat-square" alt="Latest version" />
8
8
  </a>
@@ -15,8 +15,6 @@
15
15
  <img src="https://img.shields.io/codeclimate/maintainability/avamia/kanrisuru?style=flat-square" alt="Code Climate maintainability" />
16
16
  </p>
17
17
 
18
- # Kanrisuru
19
-
20
18
  Kanrisuru (manage) helps you remotely control infrastructure using Ruby. This is done over SSH. I'm working on building up some basic functionality to help quickly provision, deploy and manage a single host or cluster of hosts.
21
19
 
22
20
  The idea behind this project is not to replace the numerous other projects to manage your infrastrucutre, however, I've found there usually meant to be a standalone project that have their own ecosystem. With Kanrisuru, you essentailly plug the library directly into your ruby project.
@@ -104,7 +102,6 @@ HOSTS=ubuntu,debian,centos rspec
104
102
 
105
103
  This will run tests on the ubuntu, debian and centos instances.
106
104
 
107
-
108
105
  Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
109
106
 
110
107
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
data/kanrisuru.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
8
8
  gem.author = 'Ryan Mammina'
9
9
  gem.email = 'ryan@avamia.com'
10
10
  gem.license = 'MIT'
11
- gem.homepage = 'https://github.com/avamia/kanrisuru'
11
+ gem.homepage = 'https://kanrisuru.com'
12
12
  gem.summary = 'Manage remote servers over ssh with ruby.'
13
13
  gem.description = <<-EOF
14
14
  Kanrisuru helps manage remote servers with objected oriented ruby.#{' '}
@@ -93,39 +93,43 @@ module Kanrisuru
93
93
  end
94
94
 
95
95
  def dmi_field_translate(struct, field)
96
- field = field.downcase
97
- field = field.gsub(/\s/, '_')
98
- field = field.gsub('-', '_')
99
- field = field.gsub(':', '')
100
-
96
+ field = dmi_scrub_field(field)
101
97
  case struct.dmi_type
102
98
  when 'Memory Device'
103
99
  case field
104
100
  when 'size'
105
- return 'mem_size'
101
+ field = 'mem_size'
106
102
  end
107
103
  when 'System Slots'
108
104
  case field
109
105
  when 'length'
110
- return 'slot_length'
106
+ field = 'slot_length'
111
107
  end
112
108
  when 'OEM Strings'
113
109
  case field
114
110
  when /^string/
115
- return 'strings'
111
+ field = 'strings'
116
112
  end
117
113
  when 'Boot Integrity Services'
118
114
  case field
119
115
  when '16_bit_entry_point_address'
120
- return 'sixteen_bit_entry_point_address'
116
+ field = 'sixteen_bit_entry_point_address'
121
117
  when '32_bit_entry_point_address'
122
- return 'thirty_two_bit_entry_point_address'
118
+ field = 'thirty_two_bit_entry_point_address'
123
119
  end
124
120
  end
125
121
 
126
122
  field
127
123
  end
128
124
 
125
+ def dmi_scrub_field(field)
126
+ field = field.downcase
127
+ field = field.gsub(/\s/, '_')
128
+ field = field.gsub('-', '_')
129
+ field = field.gsub(':', '')
130
+ field
131
+ end
132
+
129
133
  def dmi_type_to_struct(type)
130
134
  type =
131
135
  case type
@@ -10,6 +10,15 @@ module Kanrisuru
10
10
  result = ssh.scp.upload!(local_path, tmp_path, opts)
11
11
  raise 'Unable to upload file' unless result
12
12
 
13
+ ## Need to copy internal dir contents, not the tmp dir itself
14
+ if opts[:recursive]
15
+ tmp_path = "#{tmp_path}/*"
16
+
17
+ unless dir?(remote_path)
18
+ mkdir(remote_path, silent: true)
19
+ end
20
+ end
21
+
13
22
  result = mv(tmp_path, remote_path)
14
23
  raise 'Unable to move file to remote path' unless result.success?
15
24
 
@@ -100,4 +100,4 @@ module Kanrisuru
100
100
  end
101
101
  end
102
102
  end
103
- end
103
+ end
@@ -21,6 +21,12 @@ module Kanrisuru
21
21
  get_entry(device)
22
22
  end
23
23
 
24
+ def delete(device)
25
+ return false unless @entries.key?(device)
26
+
27
+ @entries.delete(device)
28
+ end
29
+
24
30
  def get_entry(device)
25
31
  result = @entries[device]
26
32
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kanrisuru
4
- VERSION = '0.16.4'
4
+ VERSION = '0.16.8'
5
5
  end
Binary file
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Kanrisuru::Remote::Fstab do
6
+ before(:all) do
7
+ StubNetwork.stub!
8
+ end
9
+
10
+ after(:all) do
11
+ StubNetwork.unstub!
12
+ end
13
+
14
+ let(:host) do
15
+ Kanrisuru::Remote::Host.new(
16
+ host: 'localhost',
17
+ username: 'ubuntu',
18
+ keys: ['id_rsa']
19
+ )
20
+ end
21
+ end
@@ -68,7 +68,7 @@ RSpec.shared_examples 'transfer' do |os_name, host_json, spec_dir|
68
68
  end
69
69
 
70
70
  it 'uploads a dir' do
71
- path = '../meta/'
71
+ path = '/home/ubuntu/kanrisuru/meta/'
72
72
  dest_path = "#{spec_dir}/meta"
73
73
 
74
74
  result = host.upload(path, dest_path, recursive: true)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanrisuru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.4
4
+ version: 0.16.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Mammina
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-25 00:00:00.000000000 Z
11
+ date: 2021-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel_tests
@@ -149,8 +149,6 @@ files:
149
149
  - ".gitignore"
150
150
  - ".rspec"
151
151
  - ".rubocop.yml"
152
- - ".rubocop_todo.yml"
153
- - ".travis.yml"
154
152
  - CHANGELOG.md
155
153
  - CODE_OF_CONDUCT.md
156
154
  - Gemfile
@@ -442,6 +440,7 @@ files:
442
440
  - lib/kanrisuru/util/os_family.rb
443
441
  - lib/kanrisuru/util/signal.rb
444
442
  - lib/kanrisuru/version.rb
443
+ - logo/kanrisuru-logo.png
445
444
  - spec/functional/core/apt_spec.rb
446
445
  - spec/functional/core/archive_spec.rb
447
446
  - spec/functional/core/disk_spec.rb
@@ -470,6 +469,7 @@ files:
470
469
  - spec/functional/remote/cluster_spec.rb
471
470
  - spec/functional/remote/cpu_spec.rb
472
471
  - spec/functional/remote/env_spec.rb
472
+ - spec/functional/remote/fstab_spec.rb
473
473
  - spec/functional/result_spec.rb
474
474
  - spec/helper/expect_helpers.rb
475
475
  - spec/helper/hosts.json
@@ -683,7 +683,7 @@ files:
683
683
  - spec/unit/remote/fstab_spec.rb
684
684
  - spec/unit/template_spec.rb
685
685
  - spec/unit/util_spec.rb
686
- homepage: https://github.com/avamia/kanrisuru
686
+ homepage: https://kanrisuru.com
687
687
  licenses:
688
688
  - MIT
689
689
  metadata:
data/.rubocop_todo.yml DELETED
File without changes
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.7.1
6
- before_install: gem install bundler -v 2.1.4