droiuby 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/drby +5 -0
  2. data/lib/droiuby/project.rb +10 -0
  3. metadata +1 -1
data/bin/drby CHANGED
@@ -54,8 +54,13 @@ case command
54
54
  when 'console'
55
55
  puts "droiuby console"
56
56
  project = Project.new
57
+
57
58
  while buf = Readline.readline("droiuby > ", true)
58
59
 
60
+ if buf=='refresh!'
61
+ project.reload($device_ip)
62
+ next
63
+ end
59
64
  exit(1) if buf=='exit' || buf=='quit'
60
65
 
61
66
  begin
@@ -65,6 +65,16 @@ class Project < Thor
65
65
  # Shortcut
66
66
  response = Net::HTTP.get_response(uri)
67
67
  response.body
68
+ end
69
+
70
+ desc "reload [DEVICE_IP]", "Reload app at specified device"
71
+ def reload(device_ip = nil)
72
+ device_ip = map_device_ip(device_ip)
73
+ url_str = "http://#{device_ip}:4000/control?cmd=reload"
74
+ uri = URI.parse(url_str)
75
+ # Shortcut
76
+ response = Net::HTTP.get_response(uri)
77
+ response.body
68
78
  end
69
79
 
70
80
  desc "switch [name] [DEVICE IP]","switch to target app instance identified by name"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: droiuby
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: