<commit_before>require 'uri'
require 'cgi'

module Rtopia
  # In order to be able to do `Rtopia::R`, Rtopia needs to extend itself
  extend self

  # @example
  #
  #    R(:items) # => /items
  #    
  #    @person = Person.new # has a to_param of john-doe
  #    R(@person) # => '/john-doe'
  #    R(@person, :posts) # => '/john-doe/posts'
  #    R(@person, :posts, :replied) # => '/john-doe/posts/replied'
  #
  #    @entry = Entry.create # has an id of 1001 for example and Ruby1.9
  #    R(@entry) # => '/1001'
  #    R(:entry, @entry) # => '/entry/1001'
  #   
  #    R(:search, :q => 'Ruby', :page => 1) => '/search?q=Ruby&page=1'
  #    R(:q => 'Ruby', :page => 1) => '?q=Ruby&page=1'
  #    R(:q => ['first, 'second']) => '?q[]=first&q[]=second'
  #    R(:user => { :lname => 'Doe', :fname => 'John' })
  #    => '?user[lname]=Doe&user[fname]=John'
  #
  # @overload R()<commit_msg>updated documentation<commit_after>require 'uri'
require 'cgi'

module Rtopia
  # In order to be able to do `Rtopia::R`, Rtopia needs to extend itself
  extend self

  # @example
  #
  #    R(:items) # => /items
  #    
  #    @person = Person.new # has a to_param of john-doe
  #    R(@person) # => '/john-doe'
  #    R(@person, :posts) # => '/john-doe/posts'
  #    R(@person, :posts, :replied) # => '/john-doe/posts/replied'
  #
  #    @entry = Entry.create # has an id of 1001 for example and Ruby1.9
  #    R(@entry) # => '/1001'
  #    R(:entry, @entry) # => '/entry/1001'
  #   
  #    R(:search, :q => 'Ruby', :page => 1) => '/search?q=Ruby&page=1'
  #    R(:q => 'Ruby', :page => 1) => '?q=Ruby&page=1'
  #    R(:q => ['first, 'second']) => '?q[]=first&q[]=second'
  #    R(:user => { :lname => 'Doe', :fname => 'John' })
  #    => '?user[lname]=Doe&user[fname]=John'
  #
  #    R("http://google.com/search", :q => "Robots")
  #    => 'http://google.com/search?q=Robots'
  #
  # @overload R()
{'fraction_non_alphanumeric': 0.23532522474881015, 'fraction_numerical': 0.019037546271813855, 'mean_word_length': 2.717092337917485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 41, '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': '2826538', 'n_tokens_mistral': 827, 'n_tokens_neox': 782, 'n_words': 162}