Module: Nephos::Bin

Defined in:
lib/nephos-server/bin-helpers.rb

Defined Under Namespace

Modules: Daemon

Class Method Summary collapse

Class Method Details

.is_a_valid_application?(dir = ".") ⇒ Boolean

The method check in the parameter directory:

  • if the directory exists

  • if a Gemfile.lock has been generated

  • if it contain nephos-server dependency

note: if the Gemfile includes nephos and not nephos-server, it will work anyway, because nephos require nephos-server

Parameters:

  • dir (String) (defaults to: ".")

Returns:

  • (Boolean)


14
15
16
17
18
19
20
# File 'lib/nephos-server/bin-helpers.rb', line 14

def self.is_a_valid_application? dir="."
  return false if not Dir.exist? dir
  gfl = File.expand_path "Gemfile.lock", dir
  return false if not File.exist? gfl
  return false if not File.read(gfl).split.index("nephos-server")
  return true
end