Module: GemGrep

Extended by:
GemGrep
Included in:
GemGrep
Defined in:
lib/gem_grep.rb,
lib/gem_grep/version.rb

Defined Under Namespace

Classes: Index

Constant Summary collapse

VERSION =
'0.1.2'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#display_fieldsObject

Returns the value of attribute display_fields.



9
10
11
# File 'lib/gem_grep.rb', line 9

def display_fields
  @display_fields
end

#grep_fieldsObject

Returns the value of attribute grep_fields.



9
10
11
# File 'lib/gem_grep.rb', line 9

def grep_fields
  @grep_fields
end

Instance Method Details

#parse_input(input) ⇒ Object



22
23
24
25
26
# File 'lib/gem_grep.rb', line 22

def parse_input(input)
  input.split(/\s*,\s*/).map {|e|
    valid_gemspec_columns.detect {|c| c =~ /^#{e}/ }
  }.compact
end

#valid_gemspec_columnsObject



18
19
20
# File 'lib/gem_grep.rb', line 18

def valid_gemspec_columns
  @valid_gemspec_columns ||= Gem::Specification.attribute_names.map {|e| e.to_s}.sort
end