Skip to content

Instantly share code, notes, and snippets.

View rolandobrown's full-sized avatar

Rolando Brown rolandobrown

View GitHub Profile
@rolandobrown
rolandobrown / shouldbe_expect.rb
Created August 25, 2015 09:46
RSpec Syntax should_be Expect
Old: my_object.should_not_be_a_kind_of(Foo)
New: expect(my_object).not_to be_a_kind_of(Foo)
@rolandobrown
rolandobrown / aretha.rb
Created August 25, 2015 11:51
Aretha.rb
class Aretha
def done_you_wrong!
false
end
def wanna_do_you_wrong(truth)
@truth = truth
false unless truth != "False"
@rolandobrown
rolandobrown / aretha_spec.rb
Created August 25, 2015 11:53
Aretha RSpec
# aretha_spec.rb
require_relative '../aretha.rb' #connect test to code
aretha = Aretha.new
RSpec.describe Aretha do
describe "#done_you_wrong!" do
it "ain't gonna do you wrong while you're gone" do
expect(aretha.done_you_wrong!).not_to be_truthy
end
@rolandobrown
rolandobrown / hump_day.rb
Last active August 27, 2015 03:05
Ruby & I NESTED FORMS
# Ruby and I
$ cat hump_day.rb
# needs_expressed? = true
@rolandobrown
rolandobrown / config.ru
Created August 27, 2015 03:04
config.ru NESTED FORMS
# config.ru
require './config/environment'
if defined?(ActiveRecord::Migrator) && ActiveRecord::Migrator.needs_migration?
raise 'Migrations pending run `rake db:migrate` to resolve the issue.'
end
use FormController
use RequestSpecificationController
run TravelController
@rolandobrown
rolandobrown / run_file.rb
Last active August 27, 2015 03:18
run_file.rb NESTED FORMS
$ cat run_file.rb
# route_found? = true
$ bundle
# Fetching gem metadata from https://rubygems.org/.........
# Using sinatra 1.4.6
# Bundle complete! 1 Gemfile dependencies, 35 gems now installed.
# Use `bundle show [gemname]` to see where a bundled gem is installed.
$ cat recursive_open_struct.rb
@rolandobrown
rolandobrown / ruby_knows.rb
Created August 27, 2015 03:06
ruby_knows.rb NESTED FORMS
# When he goes for the phone...
$ cat ruby_knows.rb
# him.send("we're not here to store anything. We're here to enjoy.each {|other| ... }")
@rolandobrown
rolandobrown / rubyAI.rb
Created October 8, 2015 07:37
# Required Gems RubyAI
# Required Gems
source "https://rubygems.org"
gem 'pry'
gem 'talks'
gem 'formatador'
gem 'lita-ascii-art'
@rolandobrown
rolandobrown / parable.rb
Last active October 8, 2015 07:38
Octavia Class
# "Class"
#----------#
# In object-oriented programming, a class is an extensible program-code-template for creating objects
# providing initial values for state (member variables) and implementations of behavior (member functions or methods).
class Parable
require "./lib/concerns/think"
@@octavia_butler_golden_hash = {
@rolandobrown
rolandobrown / data.rb
Created October 8, 2015 07:43
Sample of Data Class from Ruby AI
# "String"
#----------#
# A string is any finite sequence of characters (i.e., letters, numerals, symbols and punctuation marks).
# Strings are wrapped in quotes: "String"
# Strings can be stores in variables. Below are a few @@globalvariables
# MINASWAN is a Ruby programming motto designed to promote positivity and goodwill among community members.
@@minaswan = 'Matz is Nice And So We Are Nice.'
# [Arrays]