Sha256: 3702bf90793536c5dfb9b6de4e52620addf4f63bc136a3c58058396c0b8ffd6a
Contents?: true
Size: 1.2 KB
Versions: 6
Compression:
Stored size: 1.2 KB
Contents
#!/usr/bin/env ruby require 'colorize' require 'optparse' require_relative '../lib/nephos-server/version' require_relative '../lib/nephos-server/bin-helpers' opt = OptionParser.new do |opts| opts.banner = "Usage<#{Nephos::VERSION}>: nephos-status [appli directory]" opts.on("--rm") do $remove = true end opts.on("--debug") do $debug = true end end.parse! $dir = opt[0] || "." begin if Dir.exists? $dir $gfl = File.expand_path "Gemfile.lock", $dir if not File.exists? $gfl or not File.read($gfl).split.index("nephos-server") raise "\"#{$dir}\" is not a valid nephos-server application" else i = File.read($gfl).split.index("nephos-server") + 1 version = File.read($gfl).split[i] path = $gfl.gsub(/Gemfile\.lock$/, "") n_controllers = 0 Dir[File.expand_path 'app/*.rb'].each do |f| n_controllers += 1 if File.read(f).include? "< Nephos::Controller" end puts "Full path: #{path}" puts "Installed nephos-version: #{version}" puts "Controllers (#{n_controllers})" end else raise "\"#{$dir}\" is not a valid directory" end rescue => err puts "Error:".red + " #{err.message}" puts err.backtrace end
Version data entries
6 entries across 6 versions & 1 rubygems