ocean_kit 0.1.1 → 0.1.2

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: 3a7c18376eb5ecea1afb1556c36e5737408e62fe0f56f748e3854a2e505256ef
4
- data.tar.gz: 4b8dfd49bd3ccebd047ce80413735eb7b3904d94e8764a5dd8520d889d34e79b
3
+ metadata.gz: 62d343d2e641d29b1d725b8fa28cc31ae1f315c6066301d259690044e5bdec0c
4
+ data.tar.gz: fe8ea0a906be855815be19084fdba93c37cdb39ddafc70fb3d963e56b1294541
5
5
  SHA512:
6
- metadata.gz: 10736e6687f8776e27d85c02efc41f07f0662161f99f46eb74e1b8f177d86f68f87f4d10ea4660711cfeb3da7b6093e801ee8f7ec0a185c576cdbdf0ced31d85
7
- data.tar.gz: 8f8454d175bddb8b5933f5d4a5cfc7afbfe75058f6f3811d69f1d41bb4778272f34db9e1da7c76afe13248bdbe02b87a3629c633b8544732d45385526ecd7b41
6
+ metadata.gz: 18da4133b0419fec8d780d1eeaa5fa7a97e271cc4a99daeb8329d2ca0045757bfd34b9fea68cf346fcac4feca10ab66edbcd264404245bbfa7aa9809d9f73197
7
+ data.tar.gz: 71c1d8033773066e2ae9d6418bcfb2e4ceb274483131cddbe6677b3c9093250276dacba52a12bfb0fdb94e8d65f74d0bac6942938cfa7bed8eb7cbacc72d686a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ocean_kit (0.1.0)
4
+ ocean_kit (0.1.1)
5
5
  droplet_kit (~> 3.16, >= 3.16.1)
6
6
  pastel
7
7
  thor (~> 1.2)
@@ -45,7 +45,7 @@ module OceanKit
45
45
 
46
46
  desc "enable_ssh [firewall_number]", "Enable SSH on given firewall"
47
47
  def enable_ssh(number)
48
- firewall = do_client.firewalls.find(id: fetch_firewall_id(number))
48
+ firewall = fetch_firewall(number)
49
49
  inbound_rules = firewall_inbound_rules(firewall)
50
50
  firewall.inbound_rules = add_ssh_rule(inbound_rules)
51
51
  begin
@@ -58,7 +58,7 @@ module OceanKit
58
58
 
59
59
  desc "disable_ssh [firewall_number]", "Disable SSH on given firewall"
60
60
  def disable_ssh(number)
61
- firewall = do_client.firewalls.find(id: fetch_firewall_id(number))
61
+ firewall = fetch_firewall(number)
62
62
  inbound_rules = firewall_inbound_rules(firewall)
63
63
  firewall.inbound_rules = remove_ssh_rule(inbound_rules)
64
64
  begin
@@ -71,8 +71,8 @@ module OceanKit
71
71
 
72
72
  private
73
73
 
74
- def fetch_firewall_id(number)
75
- do_client.firewalls.all.each_with_index.filter { |firewall, index| index == number.to_i }.flatten.first.id
74
+ def fetch_firewall(number)
75
+ do_client.firewalls.all.each_with_index.filter { |firewall, index| index == number.to_i }.flatten.first
76
76
  end
77
77
 
78
78
  def update_firewall(firewall)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OceanKit
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leo Policastro