Class: GRI::Updater
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Updater
constructor
A new instance of Updater.
- #update(time, record) ⇒ Object
Methods included from Utils
get_prop, key_encode, load_records, parse_host_key, parse_key, search_records, update_ltsv_file, url_encode
Constructor Details
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/gri/updater.rb', line 11 def @options end |
Class Method Details
.get_tag_ary(description) ⇒ Object
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 38 39 |
# File 'lib/gri/updater.rb', line 13 def self.get_tag_ary description unless @tag_pats @tag_pats = (pats = GRI::Config.getvar 'tag-rule') ? pats.map {|patline| pat, *remain = patline.scan(/^\/([^\/]+)\/\s+(\S+)\s+(\S+)\s+(\S+)/)[0] #/ [Regexp.new(pat), *remain]} : [] end @tag_pats.map {|re, group, subdir, descr_v| if re === description m = $~.to_a if group =~ /^\$(\d+)(\.\w+)?/ group = m[$1.to_i].dup group.downcase! if $2 == '.downcase' end if subdir =~ /^\$(\d+)(\.\w+)?/ subdir = m[$1.to_i].dup subdir.downcase! if $2 == '.downcase' end if descr_v =~ /^\$(\d+)/ descr_v = m[$1.to_i] end [group, subdir, descr_v] else nil end }.compact end |
Instance Method Details
#update(time, record) ⇒ Object
47 48 |
# File 'lib/gri/updater.rb', line 47 def update time, record end |