This file contains hidden or 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
# Before running this make sure you have Ruby installed | |
# preference to version > 2.4 | |
# | |
# Also install the clearbit library, after the ruby | |
# installation, to do it you just run: | |
# $ gem install clearbit | |
# | |
# Then, you run a ruby console on the same directory of this file | |
# and the following commands: | |
# |
This file contains hidden or 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 'nokogiri' | |
require 'open-uri' | |
class PageScrapper | |
attr_accessor :url, :selector | |
IMG_SRC_REGEX = /src="([a-zA-Z\/0-9:.-_]+\.[a-zA-Z]{3})/ | |
URL_REGEX = /http[s]?:\/\/[a-zA-Z0-9].+\.[a-z]{2,3}(\.[a-z]{2})?/ | |
def initialize(url) |
This file contains hidden or 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
## | |
## SCENARIO One Driver one Passenger (current_user) and Two pending invitations | |
## | |
# 1 Ride | |
{email: "[email protected]", password: "dtyyx", id: 3608} | |
{email: "[email protected]", password: "xxyjk", id: 3607} | |
# 2 Ride | |
{email: "[email protected]", password: "tsqyv", id: 3610} |
This file contains hidden or 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
## | |
## SCENARIO: One Driver one Passenger (current_user) and Two pending invitations | |
## | |
{:email=>"[email protected]", :password=>"dtyyx", :id=>3608} | |
{:email=>"[email protected]", :password=>"xxyjk", :id=>3607} | |
{:email=>"[email protected]", :password=>"tsqyv", :id=>3610} | |
{:email=>"[email protected]", :password=>"ozsdp", :id=>3609} | |
## |
This file contains hidden or 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
## | |
## SCENARIO: One Driver one Passenger (current_user) and Two pending invitations | |
## | |
{:email=>"[email protected]", :password=>"dtyyx", :id=>3608} | |
{:email=>"[email protected]", :password=>"xxyjk", :id=>3607} | |
{:email=>"[email protected]", :password=>"tsqyv", :id=>3610} | |
{:email=>"[email protected]", :password=>"ozsdp", :id=>3609} | |
## |
This file contains hidden or 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
## | |
## SCENARIO: One Driver one Passenger (current_user) and Two pending invitations | |
## | |
{:email=>"[email protected]", :password=>"dtyyx", :id=>3608} | |
{:email=>"[email protected]", :password=>"xxyjk", :id=>3607} | |
{:email=>"[email protected]", :password=>"tsqyv", :id=>3610} | |
{:email=>"[email protected]", :password=>"ozsdp", :id=>3609} | |
## |
This file contains hidden or 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
## | |
## SCENARIO: One Driver one Passenger (current_user) and Two pending invitations | |
## | |
{:email=>"[email protected]", :password=>"dtyyx", :id=>3608} | |
{:email=>"[email protected]", :password=>"xxyjk", :id=>3607} | |
{:email=>"[email protected]", :password=>"tsqyv", :id=>3610} | |
{:email=>"[email protected]", :password=>"ozsdp", :id=>3609} | |
## |
This file contains hidden or 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
## | |
## SCENARIO: One Driver one Passenger (current_user) and Two pending invitations | |
## | |
{:email=>"[email protected]", :password=>"dtyyx", :id=>3608} | |
{:email=>"[email protected]", :password=>"xxyjk", :id=>3607} | |
{:email=>"[email protected]", :password=>"tsqyv", :id=>3610} | |
{:email=>"[email protected]", :password=>"ozsdp", :id=>3609} | |
## |
This file contains hidden or 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
diff --cc lib/active_model/serializer/adapter/json_api.rb | |
index f604b67,cd8de8e..0000000 | |
--- a/lib/active_model/serializer/adapter/json_api.rb | |
+++ b/lib/active_model/serializer/adapter/json_api.rb | |
@@@ -16,18 -17,19 +17,33 @@@ module ActiveMode | |
end | |
def serializable_hash(options = {}) |
This file contains hidden or 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 PostSerializer < ActiveModel::Serializer | |
cache cache_key: 'my-posts', expires_in: 3.days | |
attributes :title, :body | |
has_many :comments | |
url :post | |
end |
NewerOlder