<commit_before>gem 'redis-objects'

class Links
  autoload :Link, 'links/link'

  include October::Plugin

  self.prefix = /^!links?(?:\s+)?/

  match /add\s+(\S+)(?:\s+)?(.+)?$/, method: :add
  match /rem(?:ove)?\s+(\d+)$/, method: :remove
  match /list/, method: :list
  match '', method: :list

  register_help 'link[s] add uri [description]', 'add uri to database with optional description'
  register_help 'link[s] [list]', 'list all saved links in this scope (channel of nick)'
  register_help 'link[s] rem[ove] id', 'remove specific link'

  def add m, url, desc = nil
    link = Link.create url, scope(m), description: desc, user: m.user.nick
    m.reply 'Link added'
  end
<commit_msg>fix ruby warnings about regexps<commit_after>gem 'redis-objects'

class Links
  autoload :Link, 'links/link'

  include October::Plugin

  self.prefix = /^!links?(?:\s*)/

  match /add\s+(\S+)(?:\s*)(.*)$/, method: :add
  match /rem(?:ove)?\s+(\d+)$/, method: :remove
  match /list/, method: :list
  match '', method: :list

  register_help 'link[s] add uri [description]', 'add uri to database with optional description'
  register_help 'link[s] [list]', 'list all saved links in this scope (channel of nick)'
  register_help 'link[s] rem[ove] id', 'remove specific link'

  def add m, url, desc = nil
    link = Link.create url, scope(m), description: desc, user: m.user.nick
    m.reply 'Link added'
  end

{'fraction_non_alphanumeric': 0.17462580185317178, 'fraction_numerical': 0.0, 'mean_word_length': 3.9263157894736844, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4691932', 'n_tokens_mistral': 497, 'n_tokens_neox': 482, 'n_words': 156}