houcho 0.0.2 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzYzYmQ5YzQzYmZjZTM1ODk1Yzk5Y2ExMmY3N2JjMGM3ZDk1YTIwYg==
4
+ OTA0ZGY2OTllZjYyMGQ1Y2FiZTVmMDkzYzkwMzMxNGNkOTRiNTg0Nw==
5
5
  data.tar.gz: !binary |-
6
- NWY1YjUyYmZjMmY5YjVhMDVjYjFhMzkxMWNhZDNhMTQ3ZTA4YzExNA==
6
+ NjIwNWRmMjljNWRlZTIxMjhiMjhkOWM2ZjM4MmMzMjhjOWNjNjRmNw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ODFlOGNkZTA0OWJkZjI4MDgzMGI0NmFkOTIxMDgyMzkxYjgyYzhiZGJmZjk5
10
- ZWQ5ODZiMGVkNjhjOTM4NWU2OWY0MTUyNmIwMzJiOTBhMGY3ZGU1N2JkNzk2
11
- MDRlYWQwY2YzMGQ4YmQ0ZGYzMjAwMTNjOGI0ZTM5Zjk1NDk3YTk=
9
+ YjMwMWI2NGNkMDE0OWRlNDViYjEwNjc2Y2E4MjhkZTc1OGM3NWFmMDVkZWUx
10
+ NTUwZjRmNjk3MDBkMzg2YjFiN2YxNmJkMGEwYzFhZTUyYWVlYjM1MTVjNjRh
11
+ ZjFkYjc2N2E2ZTJiNWY3NTQ4YmU3ZmRhZmE0OGU1NTgwMzA5OGY=
12
12
  data.tar.gz: !binary |-
13
- YTUxMzQ3YzE1ZmEyZjk4ZmQyODVkZDc4ZGYwYmFhYTUxZmU5Zjg0YzYyZTZh
14
- YmYwMmUzMGU3ZGQzZWRjNmI5YTUyOWU2NTU5MzA2YWQzMjA0NDY1ODc4YWMz
15
- Y2QzZWQ5MGJhM2Q5ODc2OGQxNjIyYzQ2ZTMwM2I2ZDZhNDViNmE=
13
+ M2IyNTQ4ZmZmYTY4MThlN2YwMzM1MDhhZDMzOThlNTgzNDc3NjJjYmQwZDI5
14
+ YzNlZTBiZDJhYjJjMzcxNzZhNzFlMWRhYzFlNGNhZmY3NzViMTVmMTE0MjBk
15
+ MzZhNTYxNTkwN2M5NTg1MDNhM2E4OWNhYjFiYjNjOGNmYjViOWU=
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Houcho
2
2
  - wrapping to execute serverspec
3
+ - depends on ruby 1.9 later.
3
4
 
4
5
  ## Install and Initialize
5
6
  - install houcho from ruby gems
@@ -9,9 +10,8 @@
9
10
  ```
10
11
 
11
12
  - make working directory and initialize.
12
- - このディレクトリ配下にrole情報やspecなどが蓄積されます。
13
- - `houcho init` `git init`されます。
14
-
13
+ - when `houcho init` then `git init`
14
+
15
15
  ```sh
16
16
  $ mkdir houcho-repo
17
17
  $ cd houcho-repo
@@ -22,15 +22,15 @@ $ houcho init
22
22
  - example of the most simplest use case
23
23
 
24
24
  ```sh
25
- $ houcho spec exec --specs houcho_sample --hosts test.studio3104.com
25
+ $ houcho spec exec houcho_sample --hosts test.studio3104.com
26
26
  ```
27
27
 
28
- - run `houcho_sample_spec.rb` ro `test.studio3104.com`
29
- - arguments of `--specs` and `--hosts` are able to specify multiple space-delimited.
30
- - argument of `--specs` is able to specify exception of `_spec.rb`, and relative path from `spec/` under working directory.
28
+ - run `houcho_sample_spec.rb` to `test.studio3104.com`
29
+ - arguments are able to specify multiple space-delimited.
30
+ - argument of `spec exec` is able to specify exception of `_spec.rb`, and relative path from `spec/` under working directory.
31
31
 
32
32
  ## Create Role, Run Role
33
- よく使う組み合わせをroleとして定義しておくことが出来ます。
33
+ Houcho is able to define role of combination to be used well.
34
34
 
35
35
  - create role at first.
36
36
 
@@ -38,104 +38,92 @@ $ houcho init
38
38
  $ houcho role create studio3104::www
39
39
  ```
40
40
 
41
- - attach a host to role just created.
41
+ - attach hosts to role just created.
42
42
 
43
43
  ```sh
44
- $ houcho host attach www01.studio3104.com studio3104::www
45
- $ houcho host attach www02.studio3104.com studio3104::www
44
+ $ houcho host attach www01.studio3104.com www02.studio3104.com --roles studio3104::www
46
45
  ```
47
46
 
48
- - attach a spec to role.
47
+ - attach specs to role.
49
48
  - argument is able to specify exception of `_spec.rb`, and relative path from `spec/` under working directory same as simple usage.
50
49
 
51
50
  ```sh
52
- $ houcho spec attach houcho_sample studio3104::www
51
+ $ houcho spec attach houcho_sample houcho_sample2 --roles studio3104::www
53
52
  ```
54
53
 
55
54
  - show details of a role just created.
56
55
 
57
56
  ```sh
58
57
  $ houcho role details studio3104::www
59
- studio3104::www
60
-
61
- [host]
58
+ [studio3104::www]
59
+ host
62
60
  ├─ www01.studio3104.com
63
61
  └─ www02.studio3104.com
64
62
 
65
- [spec]
66
- └─ houcho_sample
63
+ spec
64
+ ├─ houcho_sample
65
+ └─ houcho_sample2
67
66
  ```
68
67
 
69
68
  - execute role.
70
69
  - it can specify multiple space-delimited.
71
70
 
72
71
  ```sh
73
- $ houcho spec exec --roles studio3104::www
72
+ $ houcho role exec studio3104::www
74
73
  ```
75
74
 
76
75
  - it is also possible to use regular expressions.
77
76
 
78
77
  ```sh
79
- $ houcho spec exec --roles studio3104.+
78
+ $ houcho role exec studio3104.+
80
79
  ```
81
80
 
82
81
 
83
82
  ## Include CloudForecast's yaml file
84
- houcho can load yaml of CloudForecast, and attach to the role defined.
83
+ Houcho is able to load yaml of CloudForecast, and attach to the role defined.
85
84
 
86
85
  - install yaml of CloudForecast to `role/cloudforecast/` under working directory.
87
- - 拡張子を`yaml`にしておく必要があります。
86
+ - extension have to be yaml.
88
87
 
89
- - cloudforecastyamlを読み込みます。(例では`role/cloudforecast/houcho_sample.yaml`を読み込んでいます。)
90
- - yamlを置き換えるたびに実行してください。毎回実行する必要はありません。
88
+ - load cloudforecast's yaml.
89
+ - run each time you replace the yaml. do not need to run every time.
91
90
 
92
91
  ```sh
93
- $ houcho cfrole configure
94
- $ houcho cfrole show
92
+ $ houcho cf load
93
+ $ houcho cf show
95
94
  houcho::author::studio3104
96
- $ houcho cfrole details houcho::author::studio3104
97
- [host(s)]
98
- studio3104.test
99
- studio3105.test
100
- studio3106.test
101
- studio3107.test
102
- studio3108.test
103
- studio3109.test
104
- studio3110.test
95
+ $ houcho cf details houcho::author::studio3104
96
+ [houcho::author::studio3104]
97
+ host
98
+ ├─ studio3104.test
99
+ └─ studio3105.test
105
100
  ```
106
101
 
107
- - cloudforecastから読み込んだroleを、定義済みのオリジナルroleにattachします。
108
- - TODO: 複数指定出来るようにする。
102
+ - attach to the original role defined, the role read from cloudforecast.
109
103
 
110
104
  ```sh
111
- $ houcho cfrole attach houcho::author::studio3104 studio3104::www
105
+ $ houcho cf attach houcho::author::studio3104 --roles studio3104::www
112
106
  $ houcho role details studio3104::www
113
- studio3104::www
114
-
115
- [host]
107
+ [studio3104::www]
108
+ host
116
109
  ├─ www01.studio3104.com
117
110
  └─ www02.studio3104.com
118
111
 
119
- [spec]
120
- └─ houcho_sample
121
-
122
- [cloudforecast's]
112
+ spec
113
+ ├─ houcho_sample
114
+ └─ houcho_sample2
115
+
116
+ cf
123
117
  houcho::author::studio3104
124
- [host]
118
+ host
125
119
  ├─ studio3104.test
126
- ├─ studio3105.test
127
- ├─ studio3106.test
128
- ├─ studio3107.test
129
- ├─ studio3108.test
130
- ├─ studio3109.test
131
- └─ studio3110.test
120
+ └─ studio3105.test
132
121
  ```
133
122
 
134
123
  ## Applied Usage
135
- - specを修正したときに、該当のspecが関連付けられているホストを適当にサンプリングして実行する。
136
- - 複数指定可能。
137
- - `--sample-host-count`でサンプル数を指定。(default: 5)
138
- - simple usageと同じように、作業ディレクトリの`spec/`からの相対パスで、`_spec.rb`を除いて指定します。
124
+ - at modified specs, run specs by sampling appropriately host.
125
+ - `--sample-host-count` can specifies the number of samples(default: 5)
126
+ - argument is able to specify exception of `_spec.rb`, and relative path from `spec/` under working directory same as simple usage.
139
127
 
140
128
  ```sh
141
129
  $ houcho spec check houcho_sample hogehogechan
@@ -147,36 +135,11 @@ $ houcho spec check houcho_sample hogehogechan
147
135
  hogehogechan has not attached to any roles
148
136
  ```
149
137
 
150
- - cloudforecastのroleに含まれている一部のホストを実行対象から外す。
138
+ - Run exclude from the target some hosts that are included in the role of cloudforecast.
151
139
 
152
140
  ```sh
153
- $ houcho host ignore studio3109.test
154
- $ houcho role details studio3104::www
155
- studio3104::www
156
-
157
- [host]
158
- ├─ www01.studio3104.com
159
- └─ www02.studio3104.com
160
-
161
- [spec]
162
- └─ houcho_sample
163
-
164
- [cloudforecast's]
165
- houcho::author::studio3104
166
- [host]
167
- ├─ <ignored>studio3109.test</ignored>
168
- ├─ studio3104.test
169
- ├─ studio3105.test
170
- ├─ studio3106.test
171
- ├─ studio3107.test
172
- ├─ studio3108.test
173
- └─ studio3110.test
141
+ $ houcho role exec studio3104::www --exclude-hosts studio3104.test
174
142
  ```
175
143
 
176
144
  ## TODO
177
- - testがない
178
- - attach|detachの引数を複数取れるようにする
179
- - host ignore|disignoreはなにやら変なので他のやりかた考える
180
- - 引数を複数取れるようにもする
181
- - disignoreって英語として変
182
- - include|excludeにすれば実装はそのままでいいかな・・・
145
+ - there is no tests…
data/bin/houcho CHANGED
@@ -1,13 +1,20 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- encoding: utf-8 -*-
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
3
4
 
4
- app_dir = File.expand_path("#{File.dirname(__FILE__)}/..")
5
5
  require 'rubygems'
6
6
  require 'thor'
7
- require app_dir + '/lib/Conductor'
7
+ require 'houcho'
8
8
 
9
- def conduct
10
- Conductor.new
9
+ include Houcho
10
+
11
+ module Helper
12
+ module_function
13
+
14
+ def empty_args(klass, chell, mesod)
15
+ klass.class.task_help(chell, mesod)
16
+ exit
17
+ end
11
18
  end
12
19
 
13
20
  class Thor::MyHelper < Thor
@@ -29,57 +36,51 @@ class Thor::MyHelper < Thor
29
36
  end
30
37
 
31
38
 
32
- class Spec < Thor::MyHelper
39
+ class SpecConduct < Thor::MyHelper
33
40
  namespace :spec
34
41
 
35
- desc 'details [spec]', 'show details about a spec'
36
- def details(spec)
37
- conduct.show_spec_details(spec)
42
+ desc 'details [spec1 spec2 spec3...]', 'show details about spec'
43
+ def details(*args)
44
+ Helper.empty_args(self, shell, __method__) if args.empty?
45
+ puts_details(Spec.details(args))
38
46
  end
39
47
 
40
48
  desc 'show', 'show all of specs'
41
49
  def show
42
- conduct.show_all_specs
50
+ puts Spec.elements.sort.join("\n")
43
51
  end
44
52
 
45
- desc 'attach [spec] [role]', 'attach a spec to a role'
46
- def attach(spec, role)
47
- conduct.attach_spec_to_role(spec, role)
53
+ desc 'attach [spec1 spec2 spec3...] --roles [role1 role2...]', 'attach spec to role'
54
+ option :roles, :type => :array, :required => true, :desc => 'specify the roles separated by spaces.'
55
+ def attach(*args)
56
+ Helper.empty_args(self, shell, __method__) if args.empty?
57
+ Spec.attach(args, options[:roles])
48
58
  end
49
59
 
50
- desc 'detach [spec] [role]', 'detach a spec from a role'
51
- def detach(spec, role)
52
- conduct.detach_spec_from_role(spec, role)
60
+ desc 'detach [spec1 spec2 spec3...] --roles [role1 role2...]', 'detach spec from spec'
61
+ option :roles, :type => :array, :required => true, :desc => 'specify the roles separated by spaces.'
62
+ def detach(*args)
63
+ Helper.empty_args(self, shell, __method__) if args.empty?
64
+ Spec.detach(args, options[:roles])
53
65
  end
54
66
 
55
- desc 'check [options]', '指定specを、関連付けられているhostを適当に選んで実行させる'
56
- option :sample_host_count, :type => :numeric, :default => 5, :desc => 'サンプルホスト数'
67
+ desc 'check [options]', 'run the spec sampled appropriately to the associated host'
68
+ option :sample_host_count, :type => :numeric, :default => 5, :desc => 'number of sample hosts'
57
69
  def check(*args)
58
- if args.empty?
59
- self.class.task_help(shell, __method__)
60
- exit
61
- end
62
- conduct.check_specs(options[:sample_host_count], args)
70
+ Helper.empty_args(self, shell, __method__) if args.empty?
71
+ Spec::Runner.check(args, options[:sample_host_count])
63
72
  end
64
73
 
65
- desc 'exec [options]', 'run serverspec'
66
- option :hosts, :type => :array, :desc => 'hosts that run specs (required: --specs)'
67
- option :specs, :type => :array, :desc => 'run specs (requied: --hosts)'
68
- option :roles, :type => :array, :desc => 'runspecs by role'
74
+ desc 'exec (spec1 spec2..) [options]', 'run serverspec manually'
75
+ option :hosts, :type => :array, :desc => '--hosts host1 host2 host3...', :required => true
69
76
  option :ukigumo, :type => :boolean, :desc => 'post results to UkigumoServer'
70
77
  option :ikachan, :type => :boolean, :desc => 'post fail results to Ikachan'
71
78
  option :dry_run, :type => :boolean, :desc => 'show commands that may exexute'
72
- def exec
73
- hosts, specs, roles =
74
- (options[:hosts]||[]), (options[:specs]||[]), (options[:roles]||[])
75
-
76
- if (hosts + specs + roles).empty? || (hosts.empty? && ! specs.empty?) || (! hosts.empty? && specs.empty?)
77
- self.class.task_help(shell, __method__)
78
- exit
79
- end
79
+ def exec(*args)
80
+ Helper.empty_args(self, shell, __method__) if args.empty?
80
81
 
81
- conduct.runspec_prepare(
82
- roles, hosts, specs,
82
+ Spec::Runner.exec(
83
+ [], [], options[:hosts], args,
83
84
  {
84
85
  ukigumo: options[:ukigumo],
85
86
  ikachan: options[:ikachan],
@@ -90,152 +91,132 @@ class Spec < Thor::MyHelper
90
91
  end
91
92
 
92
93
 
93
- class Host < Thor::MyHelper
94
+ class HostConduct < Thor::MyHelper
94
95
  namespace :host
95
96
 
96
- desc 'details [host]', 'show details about a host'
97
- def details(host)
98
- conduct.show_host_details(host)
97
+ desc 'details [host1 host2 host3...]', 'show details about host'
98
+ def details(*args)
99
+ Helper.empty_args(self, shell, __method__) if args.empty?
100
+ puts_details(Host.details(args))
99
101
  end
100
102
 
101
103
  desc 'show', 'show all of hosts'
102
104
  def show
103
- conduct.show_all_hosts
104
- end
105
-
106
- desc 'attach [host] [role]', 'attach a host to a role'
107
- def attach(host, role)
108
- conduct.attach_host_to_role(host, role)
109
- end
110
-
111
- desc 'detach [host] [role]', 'detach a host from a role'
112
- def detach(host, role)
113
- conduct.detach_host_from_role(host, role)
105
+ puts (Host.elements + CloudForecast::Host.all).join("\n")
114
106
  end
115
107
 
116
- desc "ignore [host]", "add host to ignore list"
117
- def ignore(host)
118
- conduct.ignore_host(host)
108
+ desc 'attach [host1 host2 host3...] --roles [role1 role2...]', 'attach host to role'
109
+ option :roles, :type => :array, :required => true, :desc => 'specify the roles separated by spaces.'
110
+ def attach(*args)
111
+ Helper.empty_args(self, shell, __method__) if args.empty?
112
+ Host.attach(args, options[:roles])
119
113
  end
120
114
 
121
- desc "disignore [host]", "delete host from ignore list"
122
- def disignore(host)
123
- conduct.disignore_host(host)
115
+ desc 'detach [host1 host2 host3...] --roles [role1 role2...]', 'detach host from role'
116
+ option :roles, :type => :array, :required => true, :desc => 'specify the roles separated by spaces.'
117
+ def detach(*args)
118
+ Helper.empty_args(self, shell, __method__) if args.empty?
119
+ Host.detach(args, options[:roles])
124
120
  end
125
121
  end
126
122
 
127
123
 
128
- class Role < Thor::MyHelper
124
+ class RoleConduct < Thor::MyHelper
129
125
  namespace :role
130
126
 
131
- desc 'create [role]', 'cretate a role'
132
- def create(role)
133
- conduct.create_role(role)
127
+ desc 'create [role1 role2 role3...]', 'cretate role'
128
+ def create(*args)
129
+ Helper.empty_args(self, shell, __method__) if args.empty?
130
+ Role.create(args)
134
131
  end
135
132
 
136
- desc 'delete [role]', 'delete a role'
137
- def delete(role)
138
- conduct.delete_role(role)
133
+ desc 'delete [role1 role2 role3...]', 'delete a role'
134
+ def delete(*args)
135
+ Helper.empty_args(self, shell, __method__) if args.empty?
136
+ Role.delete(args)
139
137
  end
140
138
 
141
139
  desc 'rename [exist role] [name]', 'rename a role'
142
140
  def rename(role, rename)
143
- conduct.rename_role(role, rename)
141
+ Role.rename(role, rename)
144
142
  end
145
143
 
146
- desc 'details [role]', 'show details about a role'
147
- def details(role)
148
- conduct.show_role_details(role)
144
+ desc 'details [role1 role2...]', 'show details about role'
145
+ def details(*args)
146
+ Helper.empty_args(self, shell, __method__) if args.empty?
147
+ puts_details(Role.details(args))
149
148
  end
150
149
 
151
150
  desc 'show', 'show all of roles'
152
151
  def show
153
- conduct.show_all_roles
154
- end
155
- end
156
-
157
-
158
- class CloudForecast < Thor::MyHelper
159
- namespace :cfrole
160
-
161
- desc "details [cfrole]", "show details about a cf's role"
162
- def details(cf_role)
163
- conduct.show_cf_role_details(cf_role)
152
+ puts Role.all.join("\n")
164
153
  end
165
154
 
166
- desc 'show', "show all of cf's roles"
167
- def show
168
- conduct.show_all_cf_roles
169
- end
170
-
171
- desc 'attach [cfrole] [role]', 'attach a cf role to a role'
172
- def attach(cf_role, role)
173
- conduct.attach_cfrole_to_role(cf_role, role)
174
- end
175
-
176
- desc 'detach [cfrole] [role]', 'detach a cf role from a role'
177
- def detach(cf_role, role)
178
- conduct.detach_cfrole_from_role(cf_role, role)
179
- end
155
+ desc 'exec (role1 role2..) [options]', 'run role'
156
+ option :exclude_hosts, :type => :array, :desc => '--exclude-hosts host1 host2 host3...'
157
+ option :ukigumo, :type => :boolean, :desc => 'post results to UkigumoServer'
158
+ option :ikachan, :type => :boolean, :desc => 'post fail results to Ikachan'
159
+ option :dry_run, :type => :boolean, :desc => 'show commands that may exexute'
160
+ def exec(*args)
161
+ Helper.empty_args(self, shell, __method__) if args.empty?
180
162
 
181
- desc 'configure', '(re)loading yamls of cloudforecast'
182
- def configure
183
- conduct.configure_houcho
163
+ Spec::Runner.exec(
164
+ args, (options[:exclude_hosts]||[]), [], [],
165
+ {
166
+ ukigumo: options[:ukigumo],
167
+ ikachan: options[:ikachan],
168
+ },
169
+ options[:dry_run],
170
+ )
184
171
  end
185
-
186
172
  end
187
173
 
188
174
 
189
- class Runlist < Thor::MyHelper
190
- namespace :runlist
191
-
192
- desc 'create [runlist]', 'cretate a runlist'
193
- def create(runlist)
194
- conduct.create_runlist(runlist)
195
- end
175
+ class CFConduct < Thor::MyHelper
176
+ namespace :cf
196
177
 
197
- desc 'delete [runlist]', 'delete a runlist'
198
- def delete(runlist)
199
- conduct.delete_runlist(runlist)
178
+ desc "details [cf1 cf2 cf3...]", "show details about cloudforecast's role"
179
+ def details(*args)
180
+ Helper.empty_args(self, shell, __method__) if args.empty?
181
+ puts_details(CloudForecast::Role.details(args))
200
182
  end
201
183
 
202
- desc 'include [role] [runlist]', 'include a role among a runlist'
203
- def include(role, runlist)
204
- conduct.include_role_among_runlist(role, runlist)
205
- end
206
-
207
- desc 'exclude [role] [runlist]', 'exclude a role from a runlist'
208
- def exclude(role, runlist)
209
- conduct.exclude_role_from_runlist(role, runlist)
184
+ desc 'show', "show all of cloudforecast's roles"
185
+ def show
186
+ puts CloudForecast::Role.all.sort.join("\n")
210
187
  end
211
188
 
212
- desc 'rename [exist runlist] [name]', 'rename a runlist'
213
- def rename(runlist, rename)
214
- conduct.rename_runlist(runlist, rename)
189
+ desc 'attach [cf1 cf2 cf3...] --roles [role1 role2...]', "attach cloudforecast's role to role"
190
+ option :roles, :type => :array, :required => true, :desc => 'specify the roles separated by spaces.'
191
+ def attach(*args)
192
+ Helper.empty_args(self, shell, __method__) if args.empty?
193
+ CloudForecast::Role.attach(args, options[:roles])
215
194
  end
216
195
 
217
- desc 'details [runlist]', 'show details about a runlist'
218
- def details(runlist)
219
- conduct.show_runlist_details(runlist)
196
+ desc 'detach [cf1 cf2 cf3...] --roles [role1 role2...]', "detach cloudforecast's role from role"
197
+ option :roles, :type => :array, :required => true, :desc => 'specify the roles separated by spaces.'
198
+ def detach(*args)
199
+ Helper.empty_args(self, shell, __method__) if args.empty?
200
+ CloudForecast::Role.detach(args, options[:roles])
220
201
  end
221
202
 
222
- desc 'show', 'show all of runlists'
223
- def show
224
- conduct.show_all_runlists
203
+ desc 'load', '(re)loading yamls of cloudforecast'
204
+ def load
205
+ CloudForecast.load_yaml
225
206
  end
226
207
  end
227
208
 
228
209
 
229
- class Houcho < Thor
230
- register(CloudForecast, 'cfrole', 'cfrole [attach|detach|show|details|configure]', 'cloudforecastをのyamlから情報を読み込んで操作します')
231
- register(Role, 'role', 'role [create|delete|rename|details|show]', 'roleを追加したり情報を表示したり')
232
- register(Host, 'host', 'host [attach|detach|show|details|ignore|disignore]', 'hostを追加したり情報を表示したり')
233
- register(Spec, 'spec', 'spec [attach|detach|show|details|exec|check]', 'specを追加したり情報を表示したり')
210
+ class Main < Thor
211
+ register(CFConduct, 'cf', 'cf [attach|detach|show|details|load]', 'operate relevant to CloudForecast')
212
+ register(RoleConduct, 'role', 'role [create|delete|rename|show|details|exec]', 'operate roles')
213
+ register(HostConduct, 'host', 'host [attach|detach|show|details]', 'operate hosts')
214
+ register(SpecConduct, 'spec', 'spec [attach|detach|show|details|exec|check]', 'operate specs')
234
215
 
235
216
  class_option :help, :type => :boolean, :aliases => '-h', :desc => 'Help message.'
236
217
  no_tasks do
237
218
  def invoke_task(task, *args)
238
- if options[:help] && ! %w{role host spec exec cf help}.include?(task.name)
219
+ if options[:help] && ! %w{role host spec cf help}.include?(task.name)
239
220
  Houcho.task_help(shell, task.name)
240
221
  else
241
222
  super
@@ -245,10 +226,10 @@ class Houcho < Thor
245
226
 
246
227
  desc 'init', 'set houcho repository on current directory'
247
228
  def init
248
- conduct.initialize_houcho
229
+ Initialize
249
230
  end
250
231
 
251
232
  end
252
233
 
253
- Houcho.start
254
- exit! if $fail_runspec
234
+ Main.start
235
+ exit! if $houcho_fail