Skip to content

Instantly share code, notes, and snippets.

@hunj
hunj / path_stripper.rb
Created Jun 25, 2015
Strip path from domain, off from sitemap xml file.
View path_stripper.rb
def path_strip(input_file, domain, output_file)
raise "domain must be string form" unless domain.is_a? String
raise "invalid input file name" unless input_file.is_a? String
raise "invalid output file name" unless output_file.is_a? String
file = File.open(input_file, "r")
data = file.read
file.close
data_lines = data.lines
cleared_arr = []
@hunj
hunj / rdoc_example.rb
Created May 28, 2015
Ruby RDoc Example
View rdoc_example.rb
## Found in: http://blog.firsthand.ca/2010/09/ruby-rdoc-example.html
# * Style guide based on Rails documention
module Namespace #:nodoc: don't document this
# Generic Namespace exception class
class NamespaceError < StandardError
end
# Raised when...