Commit 3e77c598 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman 💥
Browse files

Renaming gem to peak.

parent 530dd487
......@@ -5,4 +5,4 @@ html
Gemfile.lock
.idea/
*.gem
apex.conf
peak.conf
# Changelog
## 1.0.0
* Initial release
\ No newline at end of file
source 'https://rubygems.org'
# Specify your gem's dependencies in apex.gemspec
# Specify your gem's dependencies in peak.gemspec
gemspec
# Apex
# Peak
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/apex`. To experiment with that code, run `bin/console` for an interactive prompt.
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/peak`. To experiment with that code, run `bin/console` for an interactive prompt.
TODO: Delete this and the text above, and describe your gem
......@@ -9,7 +9,7 @@ TODO: Delete this and the text above, and describe your gem
Add this line to your application's Gemfile:
```ruby
gem 'apex'
gem 'peak'
```
And then execute:
......
#!/usr/bin/env ruby
require "bundler/setup"
require "apex"
require "peak"
# 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.
......
......@@ -2,30 +2,30 @@
require 'optparse'
require 'methadone'
require_relative '../lib/apex'
require 'peak'
class App
include Methadone::Main
include Methadone::CLILogging
main do |needed, maybe|
main do |command, subcommand|
puts options[:switch]
puts options[:flag]
Apex::main
Peak::main
end
description "APEX reference implementation for the APEX protocol."
version Apex::VERSION
description 'Peak: a reference implementation for the APEX protocol.'
version Peak::VERSION
# Proxy to an OptionParser instance's on method
on("--[no]-switch", "Toggles the switch")
on("--flag VALUE", "Sets the flag.")
on('--[no]-switch', 'Toggles the switch')
on('--flag VALUE', 'Sets the flag.')
arg :needed
arg :maybe, :optional
arg :command
arg :subcommand, :optional
defaults_from_env_var 'SOME_VAR'
defaults_from_config_file '.apex.rc'
defaults_from_env_var 'PEAK_CFG'
defaults_from_config_file '.peak.rc'
use_log_level_option :toggle_debug_on_signal => 'USR1'
......
require 'kiss/kiss_serial'
require 'aprs/aprs_kiss'
require 'apex/app_info'
require 'apex/plugins/plugin_factory'
require 'apex/echo'
require 'apex/config_loader'
require 'apex/plugin_loader'
require 'peak/app_info'
require 'peak/plugins/plugin_factory'
require 'peak/echo'
require 'peak/config_loader'
require 'peak/plugin_loader'
module Apex
module Peak
def self.main
config = find_config(true)
......
module Apex
module Peak
VERSION = "0.0.1"
end
require 'yaml'
require 'apex/tnc_port'
require 'peak/tnc_port'
module Apex
module Peak
def self.find_config(verbose, config_paths=[])
config_file = 'apex.conf'
rc_file = '.apexrc'
config_file = 'peak.conf'
rc_file = '.peakrc'
cur_path = config_file
home_path = File.join(Dir.home, rc_file)
etc_path = File.join('', 'etc', config_file)
......
require 'colorize'
module Apex
module Peak
def self.echo_color_frame(frame, port_name, direction_in)
formatted_aprs = [frame[:source].colorize(:green), frame[:destination].colorize(:blue)].join('>')
paths = []
......
require 'apex/plugins/plugin_factory'
require 'peak/plugins/plugin_factory'
module Apex
BUILTIN_PLUGINS = %w(apex/plugins/apex_paradigm apex/plugins/beacon apex/plugins/id apex/plugins/status)
module Peak
BUILTIN_PLUGINS = %w(peak/plugins/apex_paradigm peak/plugins/beacon peak/plugins/id peak/plugins/status)
def self.all_plugins(extra_plugins=[])
return BUILTIN_PLUGINS + extra_plugins
......
module Apex
module Peak
module Plugins
class ApexParadigm
class PeakParadigm
protected
def initialize(config, port_map, aprsis)
puts 'ApexParadigm inited'
puts 'PeakParadigm inited'
end
public
def run
puts 'ApexParadigm ran'
puts 'PeakParadigm ran'
end
public
def stop
puts 'ApexParadigm stop'
puts 'PeakParadigm stop'
end
public
def handle_packet(frame, recv_port, recv_port_name)
puts 'ApexParadigm handled packet'
puts 'PeakParadigm handled packet'
end
end
PluginFactory.register_plugin(ApexParadigm)
PluginFactory.register_plugin(PeakParadigm)
end
end
\ No newline at end of file
module Apex
module Peak
module Plugins
class Beacon
protected
......
module Apex
module Peak
module Plugins
class Id
protected
......
module Apex
module Peak
module Plugins
class PluginFactory
@@plugins = []
......
module Apex
module Peak
module Plugins
class Status
protected
......
require 'apex/echo'
require 'peak/echo'
module Apex
module Peak
class TncPort
protected
def initialize(data_stream, name, identifier, net, echo_frames=false, port=0)
......@@ -35,7 +35,7 @@ module Apex
def write(frame, *args, **kwargs)
@data_stream.write(frame, @port, *args, **kwargs)
if @echo_frames and frame
Apex::echo_color_frame(frame, @name, false)
Peak::echo_color_frame(frame, @name, false)
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment