bin/mad_chatter in mad_chatter-0.1.0 vs bin/mad_chatter in mad_chatter-0.1.1
- old
+ new
@@ -1,9 +1,10 @@
#!/usr/bin/env ruby
+# lib_dir = File.expand_path('../lib', __FILE__)
+# $:.unshift( lib_dir ) unless $:.include?( lib_dir )
require 'thor'
-require File.expand_path('../../lib/mad_chatter', __FILE__)
module MadChatter
class Cli < Thor
include Thor::Actions
@@ -21,12 +22,20 @@
copy_file "templates/web/javascript.js", "#{name}/web/javascript.js"
copy_file "templates/web/stylesheets/reset.css", "#{name}/web/stylesheets/reset.css"
copy_file "templates/web/stylesheets/styles.css", "#{name}/web/stylesheets/styles.css"
end
+ desc 'preview', 'Starts both a web server and the Mad Chatter chat server'
+ def preview
+ t1 = Thread.new { require 'mad_chatter/web_server' }
+ t2 = Thread.new { require 'mad_chatter'; MadChatter.start }
+ t2.join()
+ end
+
desc 'start', 'Starts the chat server'
def start
+ require 'mad_chatter'
MadChatter.start
end
desc 'stop', 'Stops the chat server'
def stop
@@ -40,9 +49,10 @@
# not sure how to best implement this part yet
end
desc 'version', 'Displays the current version number'
def version
+ require "mad_chatter/version"
puts MadChatter::VERSION
end
end
end
\ No newline at end of file