Commit 4388fd22 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman 💥
Browse files

removed some of the unused files and renamed some variables to get it ready for being its own gem.

parent 352cca50
source 'https://rubygems.org'
# Specify your gem's dependencies in apex.gemspec
# Specify your gem's dependencies in aprs.gemspec
gemspec
# Apex
# APRS
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.
......@@ -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 'aprs'
```
And then execute:
......@@ -18,7 +18,7 @@ And then execute:
Or install it yourself as:
$ gem install apex
$ gem install aprs
## Usage
......@@ -32,5 +32,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Syncleus/apex-ruby.
Bug reports and pull requests are welcome on GitHub at https://github.com/Syncleus/aprs
= apex - DESCRIBE YOUR GEM
Author:: YOUR NAME (YOUR EMAIL)
Copyright:: Copyright (c) 2016 YOUR NAME
Author:: Jeffrey Phillips Freeman (freemo@gmail.com)
Copyright:: Copyright (c) 2016 Syncleus
DESCRIBE YOUR GEM HERE
== Links
* {Source on Github}[LINK TO GITHUB]
* {Source on Github}[https://github.com/Syncleus/aprs]
* RDoc[LINK TO RDOC.INFO]
== Install
......
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'apex/app_info'
require 'aprs/app_info'
Gem::Specification.new do |spec|
spec.name = 'apex'
spec.version = Apex::VERSION
spec.name = 'aprs'
spec.version = Aprs::VERSION
spec.authors = ['Jeffrey Phillips Freeman']
spec.email = ['jeffrey.freeman@syncleus.com']
spec.summary = %q{Reference implementation for the APEX Radio protocol.}
spec.description = %q{Reference implementation for the APEX Radio protocol.}
spec.homepage = 'http://apexprotocol.com'
spec.summary = %q{Ruby library for APRS communications.}
spec.description = %q{Ruby library for APRS communications.}
spec.homepage = 'https://github.com/Syncleus/aprs'
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
# to allow pushing to a single host or delete this section to allow pushing to any host.
......@@ -31,8 +31,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'colorize'
spec.add_dependency 'abstraction'
spec.add_dependency 'json'
spec.add_dependency 'serialport'
spec.add_dependency 'methadone'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rdoc'
......
#!/usr/bin/env ruby
require 'optparse'
require 'methadone'
require_relative '../lib/apex'
class App
include Methadone::Main
include Methadone::CLILogging
main do |needed, maybe|
puts options[:switch]
puts options[:flag]
Apex::main
end
description "APEX reference implementation for the APEX protocol."
version Apex::VERSION
# Proxy to an OptionParser instance's on method
on("--[no]-switch", "Toggles the switch")
on("--flag VALUE", "Sets the flag.")
arg :needed
arg :maybe, :optional
defaults_from_env_var 'SOME_VAR'
defaults_from_config_file '.apex.rc'
use_log_level_option :toggle_debug_on_signal => 'USR1'
go!
end
#!/usr/bin/env ruby
require "bundler/setup"
require "apex"
# 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
#!/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
require 'aruba/cucumber'
require 'methadone/cucumber'
ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', 'lib')
......
require 'colorize'
require 'kiss/kiss_serial'
require 'aprs/aprs_kiss'
require 'apex/app_info'
module Apex
def self.echo_color_frame(frame, port_name, direction_in)
formatted_aprs = [frame[:source].colorize(:green), frame[:destination].colorize(:blue)].join('>')
paths = []
frame[:path].each do |path|
paths << path.colorize(:cyan)
end
paths = paths.join(',')
if frame[:path] and frame[:path].length > 0
formatted_aprs = [formatted_aprs, paths].join(',')
end
formatted_aprs += ':'
formatted_aprs += frame[:text]
if direction_in
puts (port_name + ' << ').colorize(:magenta) + formatted_aprs
else
# TODO : make this bold and/or blink
puts (port_name + ' >> ').colorize(:color => :magenta, :mode => :bold) + formatted_aprs
end
end
def self.main
kiss = Kiss::KissSerial.new('/dev/ttyUSB1', 9600)
aprs_kiss = Aprs::AprsKiss.new(kiss)
aprs_kiss.connect(Kiss::MODE_INIT_KENWOOD_D710)
# Transmit a beacon when we first start
beacon_frame = {:source => 'WI2ARD-2',
:destination => 'APRS',
:path => ['WIDE1-1', 'WIDE2-2'],
:text => '!/:=i@;N.G& --PHG5790/G/D R-I-R H24 C30'}
aprs_kiss.write(beacon_frame)
echo_color_frame(beacon_frame, 'TNC', false)
# Display any packets we read in.
while true
frame = aprs_kiss.read
if frame
echo_color_frame(frame, 'TNC', true)
else
sleep(1)
end
end
end
end
module Apex
VERSION = "0.0.1"
end
require 'colorize'
require 'kiss/kiss_serial'
require 'aprs/aprs_kiss'
module Aprs
end
module Aprs
VERSION = "1.0.0"
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