Sha256: f8aafc2f5efd240b2f7d3d9decf4a59b1230f38b6d2191d11bbba1243b27f009

Contents?: true

Size: 694 Bytes

Versions: 2

Compression:

Stored size: 694 Bytes

Contents

module Nephos
  module Bin

    # @param dir [String]
    #
    # 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
    def self.is_a_valid_application? dir="."
      return false if not Dir.exists? dir
      gfl = File.expand_path "Gemfile.lock", dir
      return false if not File.exists? gfl
      return false if not File.read(gfl).split.index("nephos-server")
      return true
    end

  end
end

class BinError < StandardError; end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nephos-server-0.5.4 lib/nephos-server/bin-helpers.rb
nephos-server-0.5.2 lib/nephos-server/bin-helpers.rb