Class: Gaku::Container

Inherits:
Object
  • Object
show all
Defined in:
lib/gaku/container.rb

Class Method Summary collapse

Class Method Details

._exe(command) ⇒ Object



39
40
41
# File 'lib/gaku/container.rb', line 39

def self._exe(command)
  `#{_goto_root_dir} && #{command}`
end

._goto_root_dirObject



35
36
37
# File 'lib/gaku/container.rb', line 35

def self._goto_root_dir
  "cd #{__dir__}/../../"
end

.ConsoleObject



15
16
17
# File 'lib/gaku/container.rb', line 15

def self.Console
  _exe 'docker-compose exec web bundle exec rails console'
end

.DeleteObject



11
12
13
# File 'lib/gaku/container.rb', line 11

def self.Delete
  _exe 'docker-compose down -v'
end

.DetachObject



27
28
29
# File 'lib/gaku/container.rb', line 27

def self.Detach
  _exe 'docker-compose up -d'
end

.SampleObject



23
24
25
# File 'lib/gaku/container.rb', line 23

def self.Sample
  _exe 'docker-compose exec web bundle exec rake db:sample'
end

.StartObject



3
4
5
# File 'lib/gaku/container.rb', line 3

def self.Start
  _exe 'docker-compose up -d'
end

.StopObject



7
8
9
# File 'lib/gaku/container.rb', line 7

def self.Stop
  _exe 'docker-compose down'
end

.TerminalObject



19
20
21
# File 'lib/gaku/container.rb', line 19

def self.Terminal
  _exe 'docker-compose exec web bundle exec /bin/bash'
end

.TestingObject



31
32
33
# File 'lib/gaku/container.rb', line 31

def self.Testing
  _exe 'docker-compose exec web bundle exec rake testing:env_setup'
end