Class: Renuo::Cli::Commands::CommitLeaderboardSync
- Inherits:
-
Object
- Object
- Renuo::Cli::Commands::CommitLeaderboardSync
- Defined in:
- lib/renuo/cli/commands/commit_leaderboard_sync.rb
Defined Under Namespace
Classes: SyncError
Instance Attribute Summary collapse
-
#api_secret ⇒ Object
Returns the value of attribute api_secret.
-
#leaderboard_api_url ⇒ Object
Returns the value of attribute leaderboard_api_url.
-
#queue_file_path ⇒ Object
Returns the value of attribute queue_file_path.
Instance Method Summary collapse
Instance Attribute Details
#api_secret ⇒ Object
Returns the value of attribute api_secret.
6 7 8 |
# File 'lib/renuo/cli/commands/commit_leaderboard_sync.rb', line 6 def api_secret @api_secret end |
#leaderboard_api_url ⇒ Object
Returns the value of attribute leaderboard_api_url.
6 7 8 |
# File 'lib/renuo/cli/commands/commit_leaderboard_sync.rb', line 6 def leaderboard_api_url @leaderboard_api_url end |
#queue_file_path ⇒ Object
Returns the value of attribute queue_file_path.
6 7 8 |
# File 'lib/renuo/cli/commands/commit_leaderboard_sync.rb', line 6 def queue_file_path @queue_file_path end |
Instance Method Details
#run(args, options) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/renuo/cli/commands/commit_leaderboard_sync.rb', line 22 def run(args, ) process_args(args) print_configuration if .verbose abort(">> Commit queue file does not exist.") unless File.exist?(@queue_file_path) abort(">> Invalid API URL.") unless @leaderboard_api_url.match?(URI::DEFAULT_PARSER.make_regexp) commits = JSON.parse(File.read(@queue_file_path)) send_commits(commits) end |