Sha256: b4d6df77fa2f02b7b0b4ca30c0d019b4f0341e11fcecf4699c3fe31c6c7e2db2

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

#!/usr/bin/ruby

$DEBUG = true
$VERBOSE = true

QASIM_INCLUDE_DIR = "lib"
QASIM_DATA_DIR = "."

$:.push QASIM_INCLUDE_DIR
p $:.inspect

#
# external libraries
#
require 'bundler/setup'
require 'pp'
#require 'thor'

#
# project libraries
#
require 'qasim'

module Qasim

	class QasimCli
		#
		#
		#
		def initialize
			@all_maps = nil
			@active_maps = nil

			puts "-- sshfs-mapper --"
			@config = Config.new
			@config.parse_cmd_line ARGV
			@config.parse_file

			@all_maps = {}
			pp @config
		end


		# create default map for each selected map
		# or default.map if none selected
		def run_init
		end

		def run_mount

			# asynchronous mount
			selected_maps = @config.maps.select do |map|
				pp map
				map.online?
				# if map.available? then
				#  map.connect!
				# end
			end

		end

		def run_umount
		end

		#
		#
		#
		def run
			case @config.action 
			when Config::ACTION_INIT
				run_init
			when Config::ACTION_MOUNT
				run_mount
			when Config::ACTION_UMOUNT
				run_umount
			else 
				raise RuntimeError, "Unknown action"
			end

			puts "--run"
		end

	end
end

app = Qasim::Qasim.new
app.run


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qasim-0.1.11.dev.2014102811 bin/qasim-cli