diff options
| author | mo khan <mo@mokhan.ca> | 2014-08-28 22:11:19 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-08-28 22:11:19 -0600 |
| commit | 2eab9013329a495b2c30c9645f4376a3b28aa657 (patch) | |
| tree | 6aa7beb48c15cdf97fad231d0b2e24936bf14964 | |
| parent | 9553b4daa78ba6f04ca0178eaf65d82266b1e7e0 (diff) | |
move cli into separate file.
| -rwxr-xr-x | bin/camtasy | 21 | ||||
| -rw-r--r-- | lib/camtasy/cli.rb | 19 |
2 files changed, 20 insertions, 20 deletions
diff --git a/bin/camtasy b/bin/camtasy index 43001bf..4d0d141 100755 --- a/bin/camtasy +++ b/bin/camtasy @@ -1,24 +1,5 @@ #!/usr/bin/env ruby - require 'camtasy' -require "thor" - -module Camtasy - class CLI < Thor - DEFAULT_URI='druby://localhost:8787' - - desc 'server', 'starts a server.' - method_options uri: :string - def server - PhotoServer.new.run(options[:uri] || DEFAULT_URI) - end - - desc 'client', 'connect to a server' - method_options uri: :string - def client - Client.new(options[:uri] || DEFAULT_URI).run - end - end -end +require "camtasy/cli" Camtasy::CLI.start diff --git a/lib/camtasy/cli.rb b/lib/camtasy/cli.rb new file mode 100644 index 0000000..fc07fd6 --- /dev/null +++ b/lib/camtasy/cli.rb @@ -0,0 +1,19 @@ +require "thor" + +module Camtasy + class CLI < Thor + DEFAULT_URI='druby://localhost:8787' + + desc 'server', 'starts a server.' + method_options uri: :string + def server + PhotoServer.new.run(options[:uri] || DEFAULT_URI) + end + + desc 'client', 'connect to a server' + method_options uri: :string + def client + Client.new(options[:uri] || DEFAULT_URI).run + end + end +end |
