Class: Dockerfiroonga::Command
- Inherits:
-
Object
- Object
- Dockerfiroonga::Command
- Defined in:
- lib/dockerfiroonga/command.rb
Constant Summary collapse
- USAGE =
"Usage: dockerfiroonga [OPTIONS] PLATFORM [Xroonga]\n PLATFORM:\n* debian[:wheezy] (APT)\n* debian:XXX (.tar.gz)\n* ubuntu (PPA)\n* centos (yum)\n Xroonga:\n* groonga (default)\n* rroonga\n"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(arguments) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
Constructor Details
#initialize(arguments) ⇒ Command
Returns a new instance of Command.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/dockerfiroonga/command.rb', line 23 def initialize(arguments) = (arguments) @platform_name = arguments[0] begin @platform = Platform.new(@platform_name) rescue ArgumentError $stderr.puts("This platform is not supported yet: <#{@platform_name}>") $stderr.puts(USAGE) exit(false) end @_roonga = arguments[1] || "groonga" unless @platform.respond_to?("installation_#{@_roonga}") $stderr.puts("This Xroonga is not supported yet: <#{@_roonga}>") $stderr.puts(USAGE) exit(false) end @maintainer = [:maintainer] || "Masafumi Yokoyama <[email protected]>" end |
Class Method Details
.run(arguments) ⇒ Object
19 20 21 |
# File 'lib/dockerfiroonga/command.rb', line 19 def self.run(arguments) new(arguments).run end |
Instance Method Details
#run ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/dockerfiroonga/command.rb', line 46 def run puts "FROM \#{@platform_name}\nMAINTAINER \#{@maintainer}\n\#{@platform.__send__(\"installation_\#{@_roonga}\")}\nCMD [\"groonga\", \"--version\"]\n END_OF_FILE\nend\n" |