-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
270 additions
and
238 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
ignore | ||
.DS_Store | ||
|
||
/.bundle/ | ||
/.yardoc | ||
/_yardoc/ | ||
/coverage/ | ||
/doc/ | ||
/pkg/ | ||
/spec/reports/ | ||
/tmp/ | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
example_id | status | run_time | | ||
-------------------------------- | ------ | --------------- | | ||
./spec/command_spec.rb[1:2] | passed | 0.00356 seconds | | ||
./spec/message_spec.rb[1:1:1] | passed | 0.00092 seconds | | ||
./spec/message_spec.rb[1:1:2] | passed | 0.00008 seconds | | ||
./spec/message_spec.rb[1:1:3] | passed | 0.00012 seconds | | ||
./spec/message_spec.rb[1:1:4] | passed | 0.00008 seconds | | ||
./spec/message_spec.rb[1:1:5] | passed | 0.00039 seconds | | ||
./spec/message_spec.rb[1:2:1] | passed | 0.00073 seconds | | ||
./spec/message_spec.rb[1:2:2] | passed | 0.00011 seconds | | ||
./spec/message_spec.rb[1:2:3] | passed | 0.00008 seconds | | ||
./spec/message_spec.rb[1:2:4] | passed | 0.00014 seconds | | ||
./spec/message_spec.rb[1:2:5] | passed | 0.00094 seconds | | ||
./spec/message_spec.rb[1:2:6] | passed | 0.00147 seconds | | ||
./spec/message_spec.rb[1:2:7] | passed | 0.00008 seconds | | ||
./spec/message_spec.rb[1:2:8] | passed | 0.00005 seconds | | ||
./spec/message_spec.rb[1:2:9] | passed | 0.00008 seconds | | ||
./spec/message_spec.rb[1:3:1] | passed | 0.00008 seconds | | ||
./spec/message_spec.rb[1:3:2] | passed | 0.00011 seconds | | ||
./spec/message_spec.rb[1:3:3] | passed | 0.00008 seconds | | ||
./spec/message_spec.rb[1:3:4] | passed | 0.00006 seconds | | ||
./spec/message_spec.rb[1:3:5] | passed | 0.00007 seconds | | ||
./spec/rsmp_spec.rb[1:1] | passed | 0.00046 seconds | | ||
./spec/supervisor_spec.rb[1:1:1] | passed | 0.00008 seconds | | ||
./spec/supervisor_spec.rb[1:1:2] | passed | 0.00006 seconds | | ||
./spec/supervisor_spec.rb[1:1:3] | passed | 0.00988 seconds | |
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,16 +1,4 @@ | ||
# frozen_string_literal: true | ||
source "https://rubygems.org" | ||
|
||
source 'https://rubygems.org' | ||
|
||
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
|
||
gem 'async' | ||
gem 'async-io' | ||
gem 'colorize' | ||
|
||
group :test do | ||
gem 'rspec' | ||
gem 'rspec-expectations' | ||
gem 'timecop' | ||
gem 'rspec-with_params' | ||
end | ||
# Specify your gem's dependencies in rsmp.gemspec | ||
gemspec |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require "bundler/gem_tasks" | ||
require "rspec/core/rake_task" | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task :default => :spec |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require "bundler/setup" | ||
require "rsmp" | ||
|
||
# You can add fixtures and/or initialization code here to make experimenting | ||
# with your gem easier. You can also use a different console, if you like. | ||
|
||
# (If you use this, don't forget to add pry to your Gemfile!) | ||
# require "pry" | ||
# Pry.start | ||
|
||
require "irb" | ||
IRB.start(__FILE__) |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
set -vx | ||
|
||
bundle install | ||
|
||
# Do any other automated setup that you need to do here |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
require 'rsmp/cli' | ||
RSMP::CLI.start |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Feature: Help | ||
|
||
Scenario: Displaying help | ||
When I run `rsmp help` | ||
Then the output should contain "options" |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Feature: Run site | ||
|
||
Scenario: Run with no options | ||
When I run `rsmp site` | ||
Then the output should contain "Starting site" | ||
|
||
Scenario: Port option | ||
When I run `rsmp site --port 12117` | ||
Then the output should contain "Starting site on port 12117" |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
require 'aruba/cucumber' |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
site_id: AXV |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require "rsmp/version" | ||
require "rsmp/supervisor" | ||
require "rsmp/site" | ||
require "rsmp/supervisor_connector" | ||
require "rsmp/site_connector" | ||
require "rsmp/error" | ||
require "rsmp/probe" | ||
require "rsmp/probe_collection" | ||
require "rsmp/message" | ||
require "rsmp/logger" | ||
require "rsmp/archive" |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
require 'thor' | ||
require 'rsmp' | ||
|
||
module RSMP | ||
class CLI < Thor | ||
|
||
desc "site", "Run RSMP site" | ||
method_option :config, :type => :string, :aliases => "-c", banner: 'Path to .yaml config file' | ||
method_option :id, :type => :string, :aliases => "-i", banner: 'RSMP site id' | ||
method_option :supervisors, :type => :string, :aliases => "-s", banner: 'ip:port,... list of supervisor to connect to' | ||
def site | ||
converted = { | ||
site_settings_path: options[:config], | ||
site_settings: { | ||
site_id: options[:id], | ||
} | ||
} | ||
|
||
if options[:supervisors] | ||
options[:supervisors].split(',').each do |supervisor| | ||
converted[:site_settings][:supervisors] ||= [] | ||
ip, port = supervisor.split ':' | ||
ip = '127.0.0.1' if ip.empty? | ||
port = '12111' if port.empty? | ||
converted[:site_settings][:supervisors] << {"ip"=>ip, "port"=>port} | ||
end | ||
end | ||
|
||
converted[:site_settings].compact! | ||
RSMP::Site.new(converted).start | ||
end | ||
|
||
desc "supervisor", "Run RSMP supervisor" | ||
method_option :config, :type => :string, :aliases => "-c", banner: 'Path to .yaml config file' | ||
method_option :id, :type => :string, :aliases => "-i", banner: 'RSMP site id' | ||
method_option :ip, :type => :numeric, banner: 'IP address to listen on' | ||
method_option :port, :type => :string, :aliases => "-p", banner: 'Port to listen on' | ||
def supervisor | ||
converted = { | ||
supervisor_settings_path: options[:config], | ||
supervisor_settings: { | ||
site_id: options[:id], | ||
ip: options[:ip], | ||
port: options[:port] | ||
} | ||
} | ||
converted[:supervisor_settings].compact! | ||
RSMP::Supervisor.new(converted).start | ||
end | ||
|
||
end | ||
end |
Oops, something went wrong.