Skip to content
Permalink
Browse files

Got it actually working as a standalone gem, though it still throws a…

… bunch of errors
  • Loading branch information...
netpro2k committed Nov 26, 2011
1 parent 64dbcc0 commit a869d1c7ea64f6804e3df32a53e6c0ab7f5da1fd
Showing with 30 additions and 19 deletions.
  1. +1 −3 Gemfile
  2. +0 −14 bin/siriproxy
  3. +29 −2 lib/siriproxy/command_line.rb
@@ -1,8 +1,6 @@
source :gemcutter

gem 'CFPropertyList'
gem 'eventmachine'
gem 'uuidtools'
gemspec

# load plugins
require 'yaml'
@@ -1,20 +1,6 @@
#!/usr/bin/env ruby
# @todo these 2 lines emulate "bundle exec"
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
#

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')

require 'rubygems'
require 'bundler'
require 'bundler/setup'

require 'yaml'
require 'ostruct'

require 'siriproxy'
require 'siriproxy/command_line'

SiriProxy::CommandLine.new
@@ -1,4 +1,12 @@
require 'optparse'
require 'yaml'
require 'ostruct'

# @todo want to make SiriProxy::Commandline without having to
# require 'siriproxy'. Im sure theres a better way.
class SiriProxy

end

class SiriProxy::CommandLine

@@ -10,7 +18,8 @@ class SiriProxy::CommandLine
Usage: siriproxy COMMAND OPTIONS
Commands:
server (default) Start up the Siri proxy server
server Start up the Siri proxy server
bundle Install any dependancies needed by plugins
console Launch the plugin test console
help Show this usage information
@@ -23,16 +32,22 @@ def initialize
subcommand = ARGV.shift
case command
when 'server' then run_server(subcommand)
when 'bundle' then run_bundle
when 'console' then run_console
when 'help' then usage
else run_server()
else usage
end
end

def run_console
puts "Not yet implemented"
end

def run_bundle
setup_bundler_path
puts `bundle -V`
end

def run_server(subcommand='start')
load_code
start_server
@@ -75,7 +90,19 @@ def parse_options
@option_parser.parse!(ARGV)
end

def setup_bundler_path
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../../Gemfile",
Pathname.new(__FILE__).realpath)
end

def load_code
setup_bundler_path

require 'bundler'
require 'bundler/setup'

require 'siriproxy'
require 'siriproxy/connection'
require 'siriproxy/connection/iphone'
require 'siriproxy/connection/guzzoni'

0 comments on commit a869d1c

Please sign in to comment.
You can’t perform that action at this time.