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
13 changed files
with
100 additions
and
215 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,2 +1,4 @@ | ||
.bundle | ||
pkg | ||
Gemfile.lock | ||
.*.sw* |
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 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
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 +1,11 @@ | ||
# encoding: utf-8 | ||
require "bundler/gem_tasks" | ||
|
||
require "rspec/core" | ||
require "rspec/core/rake_task" | ||
RSpec::Core::RakeTask.new(:spec) do |spec| | ||
spec.pattern = 'spec/**/*_spec.rb' | ||
spec.rspec_opts = '--color' | ||
end | ||
|
||
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
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 |
---|---|---|
@@ -1,15 +1,17 @@ | ||
# encoding: utf-8 | ||
|
||
module Virginia | ||
class Plugin < Adhearsion::Plugin | ||
|
||
init :virginia do | ||
logger.warn "Virginia has been loaded" | ||
run :virginia do | ||
logger.info "Virginia has been loaded" | ||
Service.start | ||
end | ||
|
||
config :virginia do | ||
host "0.0.0.0", :desc => "IP to bind the listener to" | ||
port "8080", :desc => "The port to bind the listener to" | ||
handler Virginia::LoggingHandler, :desc => "The object that will be handling the requests. Must be a Reel:App." | ||
rackup 'config.ru', desc: 'Rack configuration file (relative to Adhearsion application root)' | ||
end | ||
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,9 +1,25 @@ | ||
# encoding: utf-8 | ||
require 'reel' | ||
require 'reel/rack' | ||
|
||
module Virginia | ||
class Service | ||
def self.start | ||
Adhearsion.config[:virginia].handler.new Adhearsion.config[:virginia].host, Adhearsion.config[:virginia].port | ||
config = Adhearsion.config.virginia | ||
|
||
# Rack-compatible options | ||
app, options = ::Rack::Builder.parse_file File.join(Adhearsion.root, config[:rackup]) | ||
options = { | ||
Host: config[:host], | ||
Port: config[:port] | ||
}.merge(options) | ||
|
||
app = Rack::CommonLogger.new(app, Adhearsion.logger) | ||
supervisor = ::Reel::Rack::Server.supervise_as(:reel_rack_server, app, options) | ||
|
||
Adhearsion::Events.register_callback :shutdown do | ||
supervisor.terminate | ||
end | ||
end | ||
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,3 +1,3 @@ | ||
module Virginia | ||
VERSION = "0.2.1" | ||
VERSION = "0.3.0" | ||
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
run TestApp |
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
Oops, something went wrong.