-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update with rubocop auto-corrections (#8)
- Loading branch information
Showing
36 changed files
with
582 additions
and
662 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'http_json_hash/service' | ||
|
||
class ExternalSaver | ||
|
||
def initialize(http) | ||
hostname = ENV['CYBER_DOJO_SAVER_HOSTNAME'] | ||
if hostname.nil? | ||
hostname = 'saver' | ||
end | ||
hostname = 'saver' if hostname.nil? | ||
port = ENV['CYBER_DOJO_SAVER_PORT'] | ||
if port.nil? | ||
port = 4537 | ||
end | ||
@http = HttpJsonHash::service(self.class.name, http, hostname, port) | ||
port = 4537 if port.nil? | ||
@http = HttpJsonHash.service(self.class.name, http, hostname, port) | ||
end | ||
|
||
def ready? | ||
@http.get(__method__, {}) | ||
end | ||
|
||
def group_manifest(id) | ||
@http.get(__method__, { id:id }) | ||
@http.get(__method__, { id: id }) | ||
end | ||
|
||
def group_joined(id) | ||
@http.get(__method__, { id:id }) | ||
@http.get(__method__, { id: id }) | ||
end | ||
|
||
def katas_events(ids, indexes) | ||
@http.get(__method__, { ids:ids, indexes:indexes }) | ||
@http.get(__method__, { ids: ids, indexes: indexes }) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
class ExternalTime | ||
|
||
def now | ||
t = Time.now | ||
[t.year, t.month, t.day, t.hour, t.min, t.sec, t.usec] | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'external_http' | ||
require_relative 'external_saver' | ||
require_relative 'external_time' | ||
|
||
class Externals | ||
|
||
def saver | ||
@saver ||= ExternalSaver.new(saver_http) | ||
end | ||
|
||
def saver_http | ||
@saver_http ||= ExternalHttp.new | ||
end | ||
|
||
def time | ||
@time ||= ExternalTime.new | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'gatherer' | ||
require_relative 'avatars_progress' | ||
|
||
module AppHelpers | ||
|
||
def time | ||
externals.time | ||
end | ||
|
||
end |
Oops, something went wrong.