Class: Reap::ChmodTask

Inherits:
Task
  • Object
show all
Defined in:
lib/reap/tasks/chmod-task.rb

Constant Summary

Constants inherited from Task

Task::DEFAULT_INCLUDE, Task::MUST_EXCLUDE, Task::RUBY

Instance Attribute Summary

Attributes inherited from Task

#config, #section

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Task

#[], inherited, #initialize, #package_name, registry, #ruby, #sh, tasks

Constructor Details

This class inherits a constructor from Reap::Task

Class Method Details

.descObject



8
# File 'lib/reap/tasks/chmod-task.rb', line 8

def self.desc; "Change the permissions of package files." ; end

.taskObject



6
# File 'lib/reap/tasks/chmod-task.rb', line 6

def self.task; :chmod ; end

Instance Method Details

#runObject



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
# File 'lib/reap/tasks/chmod-task.rb', line 17

def run
  puts "Reap is shelling out work to chmod..."
  
  # misc
  misc = FileList.new
  misc.include('[A-Z]*')
  misc.exclude('InstalledFiles')
  chmod( misc ) unless misc.empty?

  # lib
  libs = FileList.new
  libs.include('lib/**/*')
  libs.exclude('lib/CVS/**/*')
  libs.include('packages/*/lib/**/*')
  libs.exclude('packages/*/lib/CVS/**/*')
  libs.exclude('packages/CVS/**/*')
  chmod( libs ) unless libs.empty?

  # bin
  bins = FileList.new
  bins.include('bin/**/*')
  bins.exclude('bin/CVS/**/*')
  bins.include('packages/*/bin/**/*')
  bins.exclude('packages/*/bin/CVS/**/*')
  bins.exclude('packages/CVS/**/*')
  chmod( bins, 755 ) unless bins.empty?      
end

#set(section) ⇒ Object



11
12
13
14
15
# File 'lib/reap/tasks/chmod-task.rb', line 11

def set( section )
#       @user = section['user']
#       @group = section['group']
#       #raise "USER and GROUP are required CHMOD fields." unless @user and @group
end