Class: Higgs::Storage::ClientSideLocalhostCheckHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/higgs/storage.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, messg) ⇒ ClientSideLocalhostCheckHandler

Returns a new instance of ClientSideLocalhostCheckHandler.



1193
1194
1195
1196
# File 'lib/higgs/storage.rb', line 1193

def initialize(path, messg)
  @path = File.expand_path(path)
  @messg = messg
end

Instance Method Details

#callObject



1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
# File 'lib/higgs/storage.rb', line 1198

def call
  unless (File.exist? @path) then
    raise 'client should exist in localhost.'
  end

  File.open(@path, 'r') {|f|
    f.binmode
    if (f.read != @messg) then
      raise 'client should exist in localhost.'
    end
  }
  nil
end