Class: RbTags::Rake::Tasks::Tags
- Defined in:
- lib/rbtags/rake/tasks/tags.rb
Instance Attribute Summary collapse
-
#libs ⇒ Object
Returns the value of attribute libs.
-
#requires ⇒ Object
Returns the value of attribute requires.
Instance Method Summary collapse
- #define ⇒ Object
-
#initialize(libs = nil, requires = nil) {|_self| ... } ⇒ Tags
constructor
A new instance of Tags.
Constructor Details
#initialize(libs = nil, requires = nil) {|_self| ... } ⇒ Tags
Returns a new instance of Tags.
4 5 6 7 8 9 10 11 |
# File 'lib/rbtags/rake/tasks/tags.rb', line 4 def initialize(libs = nil, requires = nil) @libs = libs || 'lib' @requires = requires || @libs.map{ |lib| FileList[lib + '/**/*.rb'].map{ |path| path.sub(%r{\A#{Regexp.escape(lib)}/}, '') } }.flatten.sort yield self if block_given? define end |
Instance Attribute Details
#libs ⇒ Object
Returns the value of attribute libs.
30 31 32 |
# File 'lib/rbtags/rake/tasks/tags.rb', line 30 def libs @libs end |
#requires ⇒ Object
Returns the value of attribute requires.
30 31 32 |
# File 'lib/rbtags/rake/tasks/tags.rb', line 30 def requires @requires end |
Instance Method Details
#define ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rbtags/rake/tasks/tags.rb', line 13 def define desc 'Generate TAGS' task :tags do require 'rbtags' libs.each do |lib| $LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib end File.open('TAGS', 'wb') do || RbTags.with_format RbTags::Formats::Extended.new() do requires.each do |path| require path end end end end end |