arkrb 0.4.0 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f89caa0d9553e01f410477c841adba4a032e1b967a378a275c5cf5e5ad214c3
4
- data.tar.gz: 181a4e4cd5907594ca00556daf13330db18075160cc5df0f953ef790ed54fab7
3
+ metadata.gz: 861713679df17a88ef78c42a2cd6421abe3c7f8b00e3bbaa1f4cd711a515e560
4
+ data.tar.gz: bd67fd5f0e660eb7f95d2632739e731e5decfe04c74c2828be38d0bad4fb1852
5
5
  SHA512:
6
- metadata.gz: bca63d3a181aba21dab33ff4415a9e1867dbb727b8d9735dfc96c3e10af5a7d84ad521e04512c91d2e16e8501eb4ea8aad5b7fca1828ad988397b66cd56ebe77
7
- data.tar.gz: cb9da4afb9ece8f489613b893fb24dd176ef49d4be87b2006609f233c36a830af6da74ce680245ff4f58ab0f156b8f9e40abb08571acc4c29f368d1824b2a8b7
6
+ metadata.gz: 645e69c587722c21a5e2645e76b74a895f57043709440103cd8d1d9b29697d9706401ef8ee2fc10ddc4161d2547f2683f5739b8d687901fd5682e57ff36696d2
7
+ data.tar.gz: 70863d8c9ccb29fdd9bb5a162e8363a8201d3856f9e564b83183fcb8814b6e950f93c8cc6497f1c6f211c6c63eda95a23b720682e5d0facb85e2a6690e2e789c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arkrb (0.3.0)
4
+ arkrb (0.4.0)
5
5
  colorize (~> 0.8.1)
6
6
  oga (~> 2.14)
7
7
  thor (~> 0.20.0)
@@ -34,6 +34,9 @@ module Arkrb
34
34
  class ServerAlreadyStopped < CustomError
35
35
  end
36
36
 
37
+ class ServerOffline < CustomError
38
+ end
39
+
37
40
  class SanitizationUnsupportedForThisMethod < CustomError
38
41
  end
39
42
 
@@ -4,6 +4,8 @@ module Arkrb
4
4
  def sanitize!(command, error_output, command_opts = nil)
5
5
  ark_exe_not_found = potential_errors[:ark_exe_not_found]
6
6
  raise ark_exe_not_found[:class], ark_exe_not_found[:message] if error_output =~ /#{ark_exe_not_found[:cause]}/im
7
+ server_offline = potential_errors[:server_offline]
8
+ raise server_offline[:class], server_offline[:message] if error_output =~ /#{server_offline[:cause]}/im
7
9
 
8
10
  case command
9
11
  when :install
@@ -27,23 +29,28 @@ module Arkrb
27
29
 
28
30
  def potential_errors
29
31
  @potential_errors ||= {
30
- missing_32_gcc: {
31
- cause: '/steamcmd/linux32/steamcmd: No such file or directory',
32
- class: Arkrb::Error::SteamCMDError,
33
- message: 'It appears that you are missing the lib32gcc1 package please have an Administrator install it!'
34
- },
35
- ark_exe_not_found: {
36
- cause: 'ARK server exec could not be found',
37
- class: Arkrb::Error::ArkExecutableNotFound,
38
- message: 'Whooah! The Ark Server Executable was not found, please install the ark server using `arkrb install ark`'
39
- }
32
+ missing_32_gcc: {
33
+ cause: '/steamcmd/linux32/steamcmd: No such file or directory',
34
+ class: Arkrb::Error::SteamCMDError,
35
+ message: 'It appears that you are missing the lib32gcc1 package please have an Administrator install it!'
36
+ },
37
+ ark_exe_not_found: {
38
+ cause: 'ARK server exec could not be found',
39
+ class: Arkrb::Error::ArkExecutableNotFound,
40
+ message: 'Whooah! The Ark Server Executable was not found, please install the ark server using `arkrb install ark`'
41
+ },
42
+ server_offline: {
43
+ cause: 'connection refused',
44
+ class: Arkrb::Error::ServerOffline,
45
+ message: 'The server appears to be offline!'
46
+ }
40
47
  }
41
48
  end
42
49
 
43
50
  def raise_unknown_error(command, error_output, command_opts = nil)
44
51
  error_message = (command_opts.nil?) ?
45
- format("An unknown error has occurred while attempting to run command %s\n%s", command, error_output) :
46
- format("An unknown error has occurred while attempting to run command %s with opts %s\n%s", command, command_opts, error_output)
52
+ format("An unknown error has occurred while attempting to run command %s\n%s", command, error_output) :
53
+ format("An unknown error has occurred while attempting to run command %s with opts %s\n%s", command, command_opts, error_output)
47
54
  raise Arkrb::Error::UnknownError, error_message
48
55
  end
49
56
 
@@ -1,3 +1,3 @@
1
1
  module Arkrb
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arkrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bruno