Class: Dckerize::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/dckerize/runner.rb

Constant Summary collapse

ERROR_MESSAGE =
'USAGE: dckerize up APP_NAME'
CONF_FOLDER_EXISTS =
'ERROR: conf folder already exists.'
DOCKERFILE_EXISTS =
'ERROR: Dockerfile.development already exists.'
DOCKERCOMPOSE_EXISTS =
'ERROR: docker-compose already exists.'

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Runner

Returns a new instance of Runner.



8
9
10
# File 'lib/dckerize/runner.rb', line 8

def initialize(options)
  @options = options
end

Instance Method Details

#executeObject

Raises:



12
13
14
15
# File 'lib/dckerize/runner.rb', line 12

def execute
  raise ERROR_MESSAGE unless valid?
  Dckerize::Generator.new(@options[1]).up
end

#valid?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
# File 'lib/dckerize/runner.rb', line 17

def valid?
  # first option should always be up
  return false if @options[0] != 'up'
  true
end