This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
fswatch ./ ./rebuild.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Entity | |
def initialize(input:String) | |
@data = input | |
end | |
def get_output | |
@data | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'objective-ruby' | |
class Sandwich | |
end | |
me = Object.new | |
cheese_sandwich = Sandwich.new | |
puts "With Objective Ruby:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is an alias method to give better language to the assert_contain matcher | |
module Webrat::Matchers | |
def page_should_contain content | |
assert_contain content | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < Obvious::Entity | |
value :email, String | |
value :password, String | |
value :id, Fixnum | |
validation :check_email, Proc.new { | |
raise StandardError.new 'invalid email address' unless email =~ /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ObjectiveRuby | |
class << self | |
def included(base) | |
base.extend ClassMethods | |
end | |
end | |
module ClassMethods | |
def obj method, input = {}, &block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Obvious | |
module EntityMixin | |
class << self | |
def included(base) | |
base.extend ClassMethods | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateRequest | |
def initialize request_jack, notification_jack, payment_jack | |
@request_jack = request_jack | |
@notification_jack = notification_jack | |
@payment_jack = payment_jack | |
end | |
def execute input | |
unless input.has_shape? user_id: Fixnum, text: String, amount: Float, who_to_notify: Fixnum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '../entities/user' | |
require_relative '../entities/user_session' | |
class SignInUser | |
def initialize user_jack, user_session_jack | |
@user_jack = user_jack | |
@user_session_jack = user_session_jack | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Action: ExampleAction | |
Description: should do something awesome | |
Code: | |
- c: validate input | |
- c: set default id and values for new Thing entity | |
- c: create/populate Thing object | |
requires: Thing.populate | |
- c: save thing to jack | |
requires: ThingJack.save, Thing.to_hash | |
- c: return the result |
NewerOlder