Class: RTagsTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- RTagsTask
- Defined in:
- lib/rtagstask.rb,
lib/rtagstask/version.rb
Constant Summary collapse
- VERSION =
'0.0.4'
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#quiet ⇒ Object
Returns the value of attribute quiet.
-
#rtags_dir ⇒ Object
Returns the value of attribute rtags_dir.
-
#tagfile ⇒ Object
Returns the value of attribute tagfile.
-
#vi ⇒ Object
Returns the value of attribute vi.
Instance Method Summary collapse
-
#initialize(name = :tags) {|_self| ... } ⇒ RTagsTask
constructor
A new instance of RTagsTask.
Constructor Details
#initialize(name = :tags) {|_self| ... } ⇒ RTagsTask
Returns a new instance of RTagsTask.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rtagstask.rb', line 8 def initialize(name = :tags) @name, @rtags_dir = name, %w[lib test] @vi, @quiet = true, true yield self if block_given? @tagfile ||= vi ? 'tags' : 'TAGS' desc "Build the tags file used by #{vi ? 'vi' : 'emacs'}" task @name do cmd = "rtags" cmd << ' --quiet' if quiet cmd << ' --vi' if vi cmd << " -f #{tagfile}" cmd << " -R #{.join(' ')}" sh cmd puts end task :default => @name desc 'Remove rtags products' task "clobber_#{@name}" do rm_f @tagfile end task :clobber => :"clobber_#{@name}" end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/rtagstask.rb', line 6 def name @name end |
#quiet ⇒ Object
Returns the value of attribute quiet.
6 7 8 |
# File 'lib/rtagstask.rb', line 6 def quiet @quiet end |
#rtags_dir ⇒ Object
Returns the value of attribute rtags_dir.
6 7 8 |
# File 'lib/rtagstask.rb', line 6 def @rtags_dir end |
#tagfile ⇒ Object
Returns the value of attribute tagfile.
6 7 8 |
# File 'lib/rtagstask.rb', line 6 def tagfile @tagfile end |
#vi ⇒ Object
Returns the value of attribute vi.
6 7 8 |
# File 'lib/rtagstask.rb', line 6 def vi @vi end |