Class: Dockerfiroonga::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/dockerfiroonga/command.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments) ⇒ Command

Returns a new instance of Command.



9
10
11
12
13
14
15
16
# File 'lib/dockerfiroonga/command.rb', line 9

def initialize(arguments)
  @platform_name = arguments[0]
  @platform = Platform.new(@platform_name)
  @_roonga = arguments[1] || "groonga"
  unless @platform.respond_to?("installation_#{@_roonga}")
    raise ArgumentError, "Not supported yet: <#{@_roonga}>"
  end
end

Class Method Details

.run(arguments) ⇒ Object



5
6
7
# File 'lib/dockerfiroonga/command.rb', line 5

def self.run(arguments)
  new(arguments).run
end

Instance Method Details

#runObject



18
19
20
21
22
23
24
25
# File 'lib/dockerfiroonga/command.rb', line 18

def run
  puts <<-END_OF_FILE
FROM #{@platform_name}
MAINTAINER Masafumi Yokoyama <[email protected]>
#{@platform.__send__("installation_#{@_roonga}")}
CMD ["groonga", "--version"]
  END_OF_FILE
end