Class: Dubious::CLI::Server

Inherits:
Thor::Group
  • Object
show all
Defined in:
lib/dubious/cli/server.rb

Constant Summary collapse

SERVLET =
AppEngine::SDK::SDK_ROOT + '/lib/shared/servlet-api.jar'
APIS =
AppEngine::SDK::API_JAR
TOOLS =
AppEngine::SDK::TOOLS_JAR

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.subcommand_help(*args) ⇒ Object



41
42
43
# File 'lib/dubious/cli/server.rb', line 41

def self.subcommand_help *args
  %Q(Runs the Appengine dev server along with a file watcher that recompiles the app on changes.)
end

Instance Method Details

#start_serverObject



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/dubious/cli/server.rb', line 28

def start_server   
  
  args = [
    'java', '-cp', TOOLS,
    'com.google.appengine.tools.KickStart',
    'com.google.appengine.tools.development.DevAppServerMain',
    "--address=#{options[:address]}",
    "--port=#{options[:port]}",
    '.']
  system *args
  @done=true
end

#start_watcherObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/dubious/cli/server.rb', line 12

def start_watcher
  @done=false
  Thread.new do
    until @done
      sleep_time = next_time - Time.now
      sleep(sleep_time) if sleep_time > 0
      next_time = Time.now + 5
      #success = `rake compile:reload`
      #          if 
      puts 'foo'
      sleep 5
    end
  end
  
end