Class: Houcho::CLI::Spec
- Inherits:
-
Thor
- Object
- Thor
- Houcho::CLI::Spec
- Defined in:
- lib/houcho/cli/spec.rb
Constant Summary collapse
Instance Method Summary collapse
- #attach(*args) ⇒ Object
- #check(*args) ⇒ Object
- #delete(*args) ⇒ Object
- #detach(*args) ⇒ Object
- #details(*args) ⇒ Object
- #exec(*args) ⇒ Object
- #list ⇒ Object
- #rename(from, to) ⇒ Object
Instance Method Details
#attach(*args) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/houcho/cli/spec.rb', line 20 def attach(*args) @@s.attach(args, [:roles]) rescue RoleExistenceException, SpecFileException, SQLite3::ConstraintException => e puts e. exit! end |
#check(*args) ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/houcho/cli/spec.rb', line 69 def check(*args) Houcho::CLI::Main.empty_args(self, shell, __method__) if args.empty? runner = Houcho::Spec::Runner.new begin exit! unless runner.check(args, [:samples], false, true) rescue SpecFileException => e puts e. exit! end end |
#delete(*args) ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/houcho/cli/spec.rb', line 49 def delete(*args) if [:force] @@s.delete_file!(args) else @@s.delete_file(args) end rescue SpecFileException => e puts e. exit! end |
#detach(*args) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/houcho/cli/spec.rb', line 30 def detach(*args) @@s.detach(args, [:roles]) rescue RoleExistenceException, SQLite3::ConstraintException => e puts e. exit! end |
#details(*args) ⇒ Object
62 63 64 |
# File 'lib/houcho/cli/spec.rb', line 62 def details(*args) Houcho::CLI::Main.puts_details(@@s.details(args)) end |
#exec(*args) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/houcho/cli/spec.rb', line 85 def exec(*args) Houcho::CLI::Main.empty_args(self, shell, __method__) if args.empty? runner = Houcho::Spec::Runner.new begin exit! unless runner.execute_manually( [:hosts], args, [:dry_run], true #output to console ) rescue Houcho::SpecFileException => e puts e. exit! end end |
#list ⇒ Object
13 14 15 |
# File 'lib/houcho/cli/spec.rb', line 13 def list puts @@s.list.sort.join("\n") end |
#rename(from, to) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/houcho/cli/spec.rb', line 39 def rename(from, to) @@s.rename(from, to) rescue SpecFileException => e puts e. exit! end |