flydata 0.0.5.1 → 0.0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5.1
1
+ 0.0.5.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "flydata"
8
- s.version = "0.0.5.1"
8
+ s.version = "0.0.5.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Koichi Fujikawa"]
12
- s.date = "2013-09-18"
12
+ s.date = "2013-09-28"
13
13
  s.description = "FlyData Command Line Interface"
14
14
  s.email = "sysadmin@flydata.co"
15
15
  s.executables = ["flydata"]
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
31
31
  "lib/flydata/cli.rb",
32
32
  "lib/flydata/command/base.rb",
33
33
  "lib/flydata/command/crontab.rb",
34
+ "lib/flydata/command/kill_all.rb",
34
35
  "lib/flydata/command/login.rb",
35
36
  "lib/flydata/command/restart.rb",
36
37
  "lib/flydata/command/routine.rb",
@@ -0,0 +1,10 @@
1
+ module Flydata
2
+ module Command
3
+ class Kill_all < Base
4
+ def run
5
+ sender = Flydata::Command::Sender.new
6
+ sender.kill_all
7
+ end
8
+ end
9
+ end
10
+ end
@@ -54,6 +54,14 @@ EOF
54
54
  start
55
55
  end
56
56
  end
57
+ def kill_all
58
+ if system("ps ax | grep 'flydata' | grep -v grep | awk '{print \"kill \" $1}' | sh")
59
+ say("Done.")
60
+ return true
61
+ else
62
+ raise 'Something has gone wrong...'
63
+ end
64
+ end
57
65
 
58
66
  private
59
67
  def wait_until_server_ready
@@ -111,8 +119,8 @@ EOF
111
119
  process_exist?
112
120
  end
113
121
  def process_exist?
114
- process_count = `ps auxww|grep -v grep|grep ".flydata/flydata.conf"|grep fluentd|wc -l`.to_i
115
- process_count > 0
122
+ # Returns true if the process is running
123
+ `[ -f #{FLYDATA_HOME}/flydata.pid ] && pgrep -P \`cat #{FLYDATA_HOME}/flydata.pid\``.to_i > 0
116
124
  end
117
125
  def uploaded_successfully?(data_port_id)
118
126
  res = flydata.get("/data_ports/#{data_port_id}/tail.json")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flydata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5.1
4
+ version: 0.0.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-18 00:00:00.000000000 Z
12
+ date: 2013-09-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -291,6 +291,7 @@ files:
291
291
  - lib/flydata/cli.rb
292
292
  - lib/flydata/command/base.rb
293
293
  - lib/flydata/command/crontab.rb
294
+ - lib/flydata/command/kill_all.rb
294
295
  - lib/flydata/command/login.rb
295
296
  - lib/flydata/command/restart.rb
296
297
  - lib/flydata/command/routine.rb
@@ -329,7 +330,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
329
330
  version: '0'
330
331
  segments:
331
332
  - 0
332
- hash: 865437798629669317
333
+ hash: 256170490305057208
333
334
  required_rubygems_version: !ruby/object:Gem::Requirement
334
335
  none: false
335
336
  requirements: