fate 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/fate/repl.rb +14 -17
  2. metadata +6 -6
@@ -1,56 +1,53 @@
1
- gem "harp"
1
+ #gem "harp"
2
+ $:.unshift "/Users/mking/projects/oss/harp/lib"
2
3
  require "harp"
3
4
  class Fate
4
5
 
5
6
  include Harp
6
7
 
7
- setup_repl do |repl|
8
+ setup_harp do |harp|
8
9
 
9
- on("help") do
10
- commands = repl.commands.select {|c| c.size > 1 } + ["!"]
10
+ command("help") do
11
+ commands = harp.command_names.select {|c| c.size > 1 } + ["!"]
11
12
  puts "* Available commands: " << commands.sort.join(" ")
12
13
  end
13
14
 
14
- on("quit", "q", "exit") do
15
+ command("quit") do
15
16
  exit
16
17
  end
17
18
 
18
- on("stop") do
19
+ command("stop") do
19
20
  self.stop
20
21
  end
21
22
 
22
- on(/^stop (\S+)$/) do |args|
23
+ command("stop", :process_name) do |args|
23
24
  command = args.first
24
25
  self.stop_command(args.first)
25
26
  end
26
27
 
27
- on(/^start (\S+)$/) do |args|
28
+ command("start", :process_name) do |args|
28
29
  command = args.first
29
30
  self.start_command(args.first)
30
31
  end
31
32
 
32
- on("restart") do
33
+ command("restart") do
33
34
  self.restart
34
35
  end
35
36
 
36
- on(/restart (\S+)$/) do |args|
37
+ command("restart", :process_name) do |args|
37
38
  command = args.first
38
39
  self.restart_command(args.first)
39
40
  end
40
41
 
41
- on_bang do |args|
42
- self.system args.first
43
- end
44
-
45
- on("commands") do
42
+ command("commands") do
46
43
  puts self.service.names
47
44
  end
48
45
 
49
- on("running") do
46
+ command("running") do
50
47
  puts self.running
51
48
  end
52
49
 
53
- on("configuration", "config") do
50
+ command("configuration") do
54
51
  puts JSON.pretty_generate(self.service.specification)
55
52
  end
56
53
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
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: 2012-09-06 00:00:00.000000000 Z
12
+ date: 2012-09-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -32,17 +32,17 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - '='
36
36
  - !ruby/object:Gem::Version
37
- version: 0.2.4
37
+ version: 0.2.6
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - '='
44
44
  - !ruby/object:Gem::Version
45
- version: 0.2.4
45
+ version: 0.2.6
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: open4
48
48
  requirement: !ruby/object:Gem::Requirement