Class: Playit::Services::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/playit/services/metadata.rb

Class Method Summary collapse

Class Method Details

.restartObject



36
37
38
39
40
# File 'lib/playit/services/metadata.rb', line 36

def restart
  puts '[INFO] Restart metadata service...'
  stop
  start
end

.startObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/playit/services/metadata.rb', line 9

def start
  puts '[INFO] Start metadata service...'
  url = "#{Playit.config.attributes["metadata"]}/start"
  puts url
  begin
  open(url) { |f|
    f.each_line {
        |line| puts line
    }
  }
  rescue OpenURI::HTTPError
    puts "[ERROR] Already started! Call stop or restart methods"
  end

end

.stopObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/playit/services/metadata.rb', line 25

def stop
  puts '[INFO] Stop metadata service...'
  url = "#{Playit.config.attributes["metadata"]}/stop"
  puts url
  open(url) { |f|
    f.each_line {
        |line| puts line
    }
  }
end