Class: Tags

Inherits:
Object
  • Object
show all
Defined in:
lib/ctags_ruby/tags.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename = ".tags", mask = '*.rb') ⇒ Tags

Returns a new instance of Tags.



4
5
6
# File 'lib/ctags_ruby/tags.rb', line 4

def initialize(filename = ".tags", mask = '*.rb')
  @filename, @mask = filename, mask
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



3
4
5
# File 'lib/ctags_ruby/tags.rb', line 3

def filename
  @filename
end

#maskObject (readonly)

Returns the value of attribute mask.



3
4
5
# File 'lib/ctags_ruby/tags.rb', line 3

def mask
  @mask
end

Instance Method Details

#find_expressionObject



12
13
14
# File 'lib/ctags_ruby/tags.rb', line 12

def find_expression
  "find . -name '#{mask}' | ctags -f #{filename} -L -"
end

#generateObject



8
9
10
# File 'lib/ctags_ruby/tags.rb', line 8

def generate
  system find_expression
end