Class: Simp::Rake::Build::Clean
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Simp::Rake::Build::Clean
- Includes:
- Constants
- Defined in:
- lib/simp/rake/build/clean.rb
Instance Method Summary collapse
-
#advanced_clean(type, _args) ⇒ Object
This just abstracts the clean/clobber space in such a way that clobber can actally be used!.
- #define_tasks ⇒ Object
-
#initialize(base_dir) ⇒ Clean
constructor
A new instance of Clean.
Methods included from Constants
#distro_build_dir, #init_member_vars
Constructor Details
#initialize(base_dir) ⇒ Clean
Returns a new instance of Clean.
11 12 13 14 |
# File 'lib/simp/rake/build/clean.rb', line 11 def initialize(base_dir) init_member_vars(base_dir) define_tasks end |
Instance Method Details
#advanced_clean(type, _args) ⇒ Object
This just abstracts the clean/clobber space in such a way that clobber can actally be used!
36 37 38 39 40 |
# File 'lib/simp/rake/build/clean.rb', line 36 def advanced_clean(type, _args) raise "Type must be one of 'clean' or 'clobber'" unless ['clean', 'clobber'].include?(type) Rake::Task["pkg:#{type}"].invoke end |
#define_tasks ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/simp/rake/build/clean.rb', line 16 def define_tasks ::CLEAN.include( "#{@dist_dir}/*", '.discinfo', @dvd_dir, "#{@build_dir}/SIMP", "#{@base_dir}/SIMP_ISO*", ) if $simp6_build_dirs ::CLEAN.include($simp6_clean_dirs) end ::CLOBBER.include( @dist_dir, "#{@build_dir}/build_keys/dev", "#{@build_dir}/yum_data/*/packages", ) # This just abstracts the clean/clobber space in such a way that clobber can actally be used! def advanced_clean(type, _args) raise "Type must be one of 'clean' or 'clobber'" unless ['clean', 'clobber'].include?(type) Rake::Task["pkg:#{type}"].invoke end task :clobber do |_t, args| advanced_clean('clobber', args) end task :clean do |_t, args| advanced_clean('clean', args) end end |