Class: Opsk::Clean

Inherits:
Thor::Group
  • Object
show all
Includes:
Thorable, Thor::Actions
Defined in:
lib/opskeleton/clean.rb

Instance Method Summary collapse

Methods included from Thorable

#artifact, #artifact_path, #check_root, included, #machines, #type_of

Instance Method Details

#cleanupObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/opskeleton/clean.rb', line 18

def cleanup
	remove_dir('pkg')
	if(File.exists?('dockerfiles'))
	  images = Dir['dockerfiles/*'].select{|file| File.ftype(file) == 'directory'}
	  images.each do |path|
 if(File.ftype(path) == 'directory')
		remove_dir("#{path}/pkg")
 end
	  end
	end
end

#metaObject



10
11
12
# File 'lib/opskeleton/clean.rb', line 10

def meta 
	OpenStruct.new(YAML.load_file('opsk.yaml'))
end

#nameObject



14
15
16
# File 'lib/opskeleton/clean.rb', line 14

def name 
	File.basename(Dir.getwd)
end

#validateObject



5
6
7
# File 'lib/opskeleton/clean.rb', line 5

def validate
	check_root
end