Commit 25b1e01b authored by Macbook's avatar Macbook

added rake publish

parent b3131aec
Copyright © 2020 theoryforce.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
......@@ -3,3 +3,7 @@ Dir[File.join(__dir__, 'lib', '*.rb')].each { |file| require file }
task :slur do
puts Generate.new().rare_insult
end
task :publish do
Generate.new().slur_and_publish
end
# Simple French Pastry
## Rare insult generator
> Money can’t bring you happiness but it sure is better to cry in a Mercedes than on a bike, you whiny pig croissant.
© theoryforce.com
......@@ -4,6 +4,22 @@ class Generate
require 'csv'
require 'pp'
def slur_and_publish
slur = self.rare_insult
return unless slur.is_a? String
return if slur.empty?
File.open( File.join(__dir__, "../_public/509196bc97a75900160a8aa19506eccc.html"), "w+") {|f| f.puts(slur) }
end
def rare_insult # adjective + slur + noun
garnish = self.get_garnish
if garnish[1]
return "#{garnish[0]}, you #{self.get_phrase}?"
end
return "#{garnish[0]}, you #{self.get_phrase}."
end
def full_slur
return "\n\n Nice work, you #{self.rare_insult}. \n Good thing " + "someone".italic + " around here isn't completely worthless.\n\n\n\n"
end
......@@ -32,12 +48,4 @@ class Generate
return result
end
def rare_insult # adjective + slur + noun
garnish = self.get_garnish
if garnish[1]
return "#{garnish[0]}, you #{self.get_phrase}?"
end
return "#{garnish[0]}, you #{self.get_phrase}."
end
end#class
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment