repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/comment_spec.rb | spec/highrise/comment_spec.rb | require 'spec_helper'
describe Highrise::Comment do
it { should be_a_kind_of Highrise::Base }
end
| ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/user_spec.rb | spec/highrise/user_spec.rb | require 'spec_helper'
describe Highrise::User do
it { should be_a_kind_of Highrise::Base }
it ".me" do
Highrise::User.should_receive(:find).with(:one, {:from => "/me.xml"}).and_return(subject)
Highrise::User.me.should == subject
end
it "#join" do
group_mock = mock("group")
group_mock.shou... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/note_spec.rb | spec/highrise/note_spec.rb | require 'spec_helper'
describe Highrise::Note do
subject { Highrise::Note.new(:id => 1) }
it { should be_a_kind_of Highrise::Base }
it_should_behave_like "a paginated class"
it "#comments" do
Highrise::Comment.should_receive(:find).with(:all, {:from=>"/notes/1/comments.xml"}).and_return("comments")
... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/spec/highrise/subject_data_spec.rb | spec/highrise/subject_data_spec.rb | require 'spec_helper'
describe Highrise::SubjectData do
it { should be_a_kind_of Highrise::Base }
it "Two different subject datas with different values are not equal" do
martini = Highrise::SubjectData.new({:id => 1, :value => "Martini", :subject_field_id => 3, :subject_field_label => "Cocktail"})
sli... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/examples/extending.rb | examples/extending.rb | #
# Example of extending a class when you need to synthesize an attribute.
#
# Adds Highrise::Person.{phone,fax,email} to the Person class inside your
# module
#
module MyModule
include Highrise
Highrise::Person.class_eval do
class << self
def lookup(id, list, item, location)
module_eval <<-EO... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/examples/sample.rb | examples/sample.rb | require 'highrise'
require 'pp'
Highrise::Base.site = 'https://yoursite.highrisehq.com'
Highrise::Base.user = 'xxx'
@tags = Highrise::Tag.find(:all)
pp @tags | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/examples/config_initializers_highrise.rb | examples/config_initializers_highrise.rb | if Rails.env != 'test' then
Highrise::Base.site = 'https://example.com.i'
Highrise::Base.user = 'my_fancy_auth_token'
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise.rb | lib/highrise.rb | require 'highrise/base'
require 'highrise/pagination'
require 'highrise/taggable'
require 'highrise/searchable'
require 'highrise/custom_fields'
require 'highrise/subject'
require 'highrise/comment'
require 'highrise/company'
require 'highrise/email'
require 'highrise/group'
require 'highrise/kase'
require 'highrise/me... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/tag.rb | lib/highrise/tag.rb | module Highrise
class Tag < Base
def ==(object)
(object.instance_of?(self.class) && object.id == self.id && object.name == self.name)
end
end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/task.rb | lib/highrise/task.rb | module Highrise
class Task < Base
# find(:all, :from => :upcoming)
# find(:all, :from => :assigned)
# find(:all, :from => :completed)
def complete!
load_attributes_from_response(post(:complete))
end
end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/version.rb | lib/highrise/version.rb | module Highrise
VERSION = "3.2.3"
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/membership.rb | lib/highrise/membership.rb | module Highrise
class Membership < Base; end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/group.rb | lib/highrise/group.rb | module Highrise
class Group < Base; end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/searchable.rb | lib/highrise/searchable.rb | module Highrise
module Searchable
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
# List By Search Criteria
# Ex: Highrise::Person.search(:email => "john.doe@example.com", :country => "CA")
# Available criteria are: city, state, country, zip, phone, email... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/account.rb | lib/highrise/account.rb | module Highrise
class Account < Base
def self.me
find(:one, :from => "/account.xml")
end
end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/recording.rb | lib/highrise/recording.rb | module Highrise
class Recording < Base
include Pagination
end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/custom_fields.rb | lib/highrise/custom_fields.rb | module Highrise
module CustomFields
def field(field_label)
custom_fields = attributes["subject_datas"] ||= []
field = custom_fields.detect do |field|
field.subject_field_label == field_label
end
field ? field.value : nil
end
def new_subject_data(field, value)
Highris... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/task_category.rb | lib/highrise/task_category.rb | module Highrise
class TaskCategory < Base; end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/pagination.rb | lib/highrise/pagination.rb | module Highrise
module Pagination
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def find_all_across_pages(options = {})
records = []
each(options) { |record| records << record }
records
end
# This only is usefull for company, pe... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/email.rb | lib/highrise/email.rb | module Highrise
class Email < Base
include Pagination
def comments
Comment.find(:all, :from => "/emails/#{id}/comments.xml")
end
end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/comment.rb | lib/highrise/comment.rb | module Highrise
class Comment < Base; end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/base.rb | lib/highrise/base.rb | require 'active_resource'
module Highrise
class Base < ActiveResource::Base
protected
class << self
# If headers are not defined in a given subclass, then obtain
# headers from the superclass.
# http://opensoul.org/blog/archives/2010/02/16/active-resource-in-practice/
def headers
... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/note.rb | lib/highrise/note.rb | module Highrise
class Note < Base
include Pagination
def comments
Comment.find(:all, :from => "/notes/#{id}/comments.xml")
end
end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/kase.rb | lib/highrise/kase.rb | module Highrise
class Kase < Subject
include Pagination
def open!
update_attribute(:closed_at, nil)
end
def close!
update_attribute(:closed_at, Time.now.utc)
end
def self.open
Kase.find(:all, :from => "/kases/open.xml")
end
def self.closed
Kase.find(:all, :f... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/party.rb | lib/highrise/party.rb | module Highrise
class Party < Base
def self.recently_viewed
find(:all, :from => "/parties/recently_viewed.xml")
end
def self.deletions_since(time)
find(:all, :from => "/parties/deletions.xml", :params => { :since => time.utc.strftime("%Y%m%d%H%M%S") })
end
end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/taggable.rb | lib/highrise/taggable.rb | module Highrise
module Taggable
def tags
unless self.attributes.has_key?("tags")
person_or_company = self.class.find(id)
self.attributes["tags"] = person_or_company.attributes.has_key?("tags") ? person_or_company.tags : []
end
self.attributes["tags"]
end
def tag!(tag_na... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/subject.rb | lib/highrise/subject.rb | module Highrise
class Subject < Base
def notes(options={})
options.merge!(:from => "/#{self.class.collection_name}/#{id}/notes.xml")
Note.find_all_across_pages(options)
end
def add_note(attrs={})
attrs[:subject_id] = self.id
attrs[:subject_type] = self.label
Note.create attr... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/person.rb | lib/highrise/person.rb | module Highrise
class Person < Subject
include Pagination
include Taggable
include Searchable
include CustomFields
def company
Company.find(company_id) if company_id
end
def name
"#{first_name rescue ''} #{last_name rescue ''}".strip
end
def address
contact_dat... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/subject_field.rb | lib/highrise/subject_field.rb | module Highrise
class SubjectField < Base
def initialize(attributes = {}, persisted = false)
super
@use_cache = false
end
def self.use_cache(use_cache = true)
@use_cache = use_cache
end
def self.find_every(options)
if @use_cache
@subject_field_cache ||= super
... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/deal.rb | lib/highrise/deal.rb | module Highrise
class Deal < Subject
include Pagination
def update_status(status)
raise ArgumentError, "status must be one of 'pending', 'won', or 'lost'" unless %w[pending won lost].include?(status)
self.put(:status, :status => {:name => status})
end
end
end
| ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/subject_data.rb | lib/highrise/subject_data.rb | module Highrise
class SubjectData < Base
def==other
attributes["value"] == other.attributes["value"] &&
attributes["subject_field_label"] == other.attributes["subject_field_label"]
end
end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/deal_category.rb | lib/highrise/deal_category.rb | module Highrise
class DealCategory < Base; end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/company.rb | lib/highrise/company.rb | module Highrise
class Company < Subject
include Pagination
include Taggable
include Searchable
include CustomFields
def people
Person.find_all_across_pages(:from => "/companies/#{id}/people.xml")
end
def label
'Party'
end
end
end | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
tapajos/highrise | https://github.com/tapajos/highrise/blob/1a1d4a2ea38dce8aa7ade974604f81d829d9c359/lib/highrise/user.rb | lib/highrise/user.rb | module Highrise
class User < Base
def join(group)
Membership.create(:user_id => id, :group_id => group.id)
end
# Permits API-key retrieval using name and password.
# Highrise::User.site = "https://yourcompany.highrise.com"
# Highrise::User.user = "your_user_name"
# Highrise:... | ruby | MIT | 1a1d4a2ea38dce8aa7ade974604f81d829d9c359 | 2026-01-04T17:54:47.038387Z | false |
sensu/sensu-ansible | https://github.com/sensu/sensu-ansible/blob/94d7a004970bf67c8673b0feb98b3a8cdfc63bd9/molecule/shared/tests/test_default.rb | molecule/shared/tests/test_default.rb | # Verify that redis, rabbitmq-server, sensu-{api,client}, and Uchiwa
# are all listening as expected
# frozen_string_literal: true
# Redis
describe port(6379) do
it { should be_listening }
its('protocols') { should include 'tcp' }
its('addresses') { should be_in ['0.0.0.0'] }
end
# RabbitMQ Server
describe port... | ruby | MIT | 94d7a004970bf67c8673b0feb98b3a8cdfc63bd9 | 2026-01-04T17:54:41.726534Z | false |
trunkclub/faceted | https://github.com/trunkclub/faceted/blob/b9a6822024f63f7b48b5fcdb601b4f06f17abbb3/spec/collector_spec.rb | spec/collector_spec.rb | require 'spec_helper'
class Musician # Mock AR model
attr_accessor :id, :name, :rating, :errors, :birthplace_id
def initialize(params={}); params.each{|k,v| self.send("#{k}=",v) if self.respond_to?(k)}; end
def attributes; {:id => self.id, :name => self.name, :rating => self.rating}; end
end
class Birthplace # ... | ruby | MIT | b9a6822024f63f7b48b5fcdb601b4f06f17abbb3 | 2026-01-04T17:54:46.250539Z | false |
trunkclub/faceted | https://github.com/trunkclub/faceted/blob/b9a6822024f63f7b48b5fcdb601b4f06f17abbb3/spec/controller_spec.rb | spec/controller_spec.rb | require 'spec_helper'
class Birthplace # Mock AR model
attr_accessor :id, :city, :state
def initialize(params={}); params.each{|k,v| self.send("#{k}=",v) if self.respond_to?(k)}; end
def attributes; {:id => self.id, :city => self.city, :state => self.state}; end
def reload; self; end
end
module MyApi
class... | ruby | MIT | b9a6822024f63f7b48b5fcdb601b4f06f17abbb3 | 2026-01-04T17:54:46.250539Z | false |
trunkclub/faceted | https://github.com/trunkclub/faceted/blob/b9a6822024f63f7b48b5fcdb601b4f06f17abbb3/spec/presenter_spec.rb | spec/presenter_spec.rb | require 'spec_helper'
class Musician # pretend that this is an AR model
attr_accessor :id, :name, :rating, :errors, :birthplace_id, :alive
def initialize(params={}); params.each{|k,v| self.send("#{k}=",v) if self.respond_to?(k)}; end
def attributes; {:id => self.id, :name => self.name, :rating => self.rating, :a... | ruby | MIT | b9a6822024f63f7b48b5fcdb601b4f06f17abbb3 | 2026-01-04T17:54:46.250539Z | false |
trunkclub/faceted | https://github.com/trunkclub/faceted/blob/b9a6822024f63f7b48b5fcdb601b4f06f17abbb3/spec/spec_helper.rb | spec/spec_helper.rb | require 'rubygems'
require 'active_model'
require 'active_support'
require 'bundler/setup'
require 'faceted'
require 'rails/all'
require 'rspec'
require 'rspec/rails' | ruby | MIT | b9a6822024f63f7b48b5fcdb601b4f06f17abbb3 | 2026-01-04T17:54:46.250539Z | false |
trunkclub/faceted | https://github.com/trunkclub/faceted/blob/b9a6822024f63f7b48b5fcdb601b4f06f17abbb3/lib/faceted.rb | lib/faceted.rb | module Faceted
require 'faceted/model'
require 'faceted/has_object'
require 'faceted/collector'
require 'faceted/controller'
require 'faceted/presenter'
end | ruby | MIT | b9a6822024f63f7b48b5fcdb601b4f06f17abbb3 | 2026-01-04T17:54:46.250539Z | false |
trunkclub/faceted | https://github.com/trunkclub/faceted/blob/b9a6822024f63f7b48b5fcdb601b4f06f17abbb3/lib/faceted/presenter.rb | lib/faceted/presenter.rb | module Faceted
module Presenter
include Faceted::HasObject
# Class methods ===========================================================
def self.included(base)
base.extend ActiveModel::Naming
base.extend ClassMethods
base.extend Faceted::Model::ModelClassMethods
base.send(:attr_... | ruby | MIT | b9a6822024f63f7b48b5fcdb601b4f06f17abbb3 | 2026-01-04T17:54:46.250539Z | false |
trunkclub/faceted | https://github.com/trunkclub/faceted/blob/b9a6822024f63f7b48b5fcdb601b4f06f17abbb3/lib/faceted/collector.rb | lib/faceted/collector.rb | module Faceted
module Collector
include Faceted::Model
def self.included(base)
base.extend ActiveModel::Naming
base.send(:attr_accessor, :errors)
base.send(:attr_accessor, :success)
base.send(:attr_accessor, :fields)
base.extend ClassMethods
base.extend Faceted::Model::M... | ruby | MIT | b9a6822024f63f7b48b5fcdb601b4f06f17abbb3 | 2026-01-04T17:54:46.250539Z | false |
trunkclub/faceted | https://github.com/trunkclub/faceted/blob/b9a6822024f63f7b48b5fcdb601b4f06f17abbb3/lib/faceted/interface.rb | lib/faceted/interface.rb | module Faceted
module Interface
include Faceted::HasObject
# Class methods ===========================================================
def self.included(base)
base.extend ActiveModel::Naming
base.extend ClassMethods
base.extend Faceted::Model::ModelClassMethods
base.send(:attr_... | ruby | MIT | b9a6822024f63f7b48b5fcdb601b4f06f17abbb3 | 2026-01-04T17:54:46.250539Z | false |
trunkclub/faceted | https://github.com/trunkclub/faceted/blob/b9a6822024f63f7b48b5fcdb601b4f06f17abbb3/lib/faceted/has_object.rb | lib/faceted/has_object.rb | module Faceted
module HasObject
module ClassMethods
def fields
@fields ||= [:id]
end
def materialize(objects=[])
objects.compact.inject([]) do |a, object|
instance = self.new
instance.send(:object=, object)
instance.send(:initialize_with_object)
... | ruby | MIT | b9a6822024f63f7b48b5fcdb601b4f06f17abbb3 | 2026-01-04T17:54:46.250539Z | false |
trunkclub/faceted | https://github.com/trunkclub/faceted/blob/b9a6822024f63f7b48b5fcdb601b4f06f17abbb3/lib/faceted/controller.rb | lib/faceted/controller.rb | module Faceted
module Controller
# For rendering a response with a single object, e.g.
# render_response(@address)
def render_response(obj, code=nil)
render :json => {
success: obj.success,
response: obj.to_hash,
errors: obj.errors
}, :status => code || obj.success... | ruby | MIT | b9a6822024f63f7b48b5fcdb601b4f06f17abbb3 | 2026-01-04T17:54:46.250539Z | false |
trunkclub/faceted | https://github.com/trunkclub/faceted/blob/b9a6822024f63f7b48b5fcdb601b4f06f17abbb3/lib/faceted/model.rb | lib/faceted/model.rb | module Faceted
module Model
require 'json'
require 'active_support/core_ext/hash'
# Class methods ============================================================
module ModelClassMethods
def build_association_from(field)
bare_name = field.gsub(/_id$/, '')
if field =~ /_id$/
... | ruby | MIT | b9a6822024f63f7b48b5fcdb601b4f06f17abbb3 | 2026-01-04T17:54:46.250539Z | false |
anjlab/rails-data-migrations | https://github.com/anjlab/rails-data-migrations/blob/727f933eec032a8f8e53364c5134d16d4bef1d75/spec/data_migrations_spec.rb | spec/data_migrations_spec.rb | # frozen_string_literal: true
require 'spec_helper'
describe RailsDataMigrations do
it 'checks for migration log table existence' do
expect(RailsDataMigrations::Migrator.migrations_table_exists?(ActiveRecord::Base.connection)).to be_truthy
expect(RailsDataMigrations::Migrator.get_all_versions).to be_blank
... | ruby | MIT | 727f933eec032a8f8e53364c5134d16d4bef1d75 | 2026-01-04T17:54:52.718645Z | false |
anjlab/rails-data-migrations | https://github.com/anjlab/rails-data-migrations/blob/727f933eec032a8f8e53364c5134d16d4bef1d75/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require 'rails/generators'
require 'rake'
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
require 'rails-data-migrations'
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
RSpec.configure do |config|
config.raise_errors_for_deprecations!
confi... | ruby | MIT | 727f933eec032a8f8e53364c5134d16d4bef1d75 | 2026-01-04T17:54:52.718645Z | false |
anjlab/rails-data-migrations | https://github.com/anjlab/rails-data-migrations/blob/727f933eec032a8f8e53364c5134d16d4bef1d75/lib/rails-data-migrations.rb | lib/rails-data-migrations.rb | # frozen_string_literal: true
require 'rails'
require 'active_record'
require 'active_record/data_migration'
require 'rails_data_migrations/version'
require 'rails_data_migrations/log_entry'
require 'rails_data_migrations/migrator'
require 'rails_data_migrations/railtie'
| ruby | MIT | 727f933eec032a8f8e53364c5134d16d4bef1d75 | 2026-01-04T17:54:52.718645Z | false |
anjlab/rails-data-migrations | https://github.com/anjlab/rails-data-migrations/blob/727f933eec032a8f8e53364c5134d16d4bef1d75/lib/rails_data_migrations/version.rb | lib/rails_data_migrations/version.rb | # frozen_string_literal: true
module RailsDataMigrations
VERSION = '1.3.0'
end
| ruby | MIT | 727f933eec032a8f8e53364c5134d16d4bef1d75 | 2026-01-04T17:54:52.718645Z | false |
anjlab/rails-data-migrations | https://github.com/anjlab/rails-data-migrations/blob/727f933eec032a8f8e53364c5134d16d4bef1d75/lib/rails_data_migrations/railtie.rb | lib/rails_data_migrations/railtie.rb | # frozen_string_literal: true
require 'rails'
module RailsDataMigrations
class Railtie < ::Rails::Railtie
rake_tasks do
load File.join(File.dirname(__FILE__), '..', 'tasks/data_migrations.rake')
end
end
end | ruby | MIT | 727f933eec032a8f8e53364c5134d16d4bef1d75 | 2026-01-04T17:54:52.718645Z | false |
anjlab/rails-data-migrations | https://github.com/anjlab/rails-data-migrations/blob/727f933eec032a8f8e53364c5134d16d4bef1d75/lib/rails_data_migrations/log_entry.rb | lib/rails_data_migrations/log_entry.rb | # frozen_string_literal: true
module RailsDataMigrations
module SharedMethods
def table_name
"#{ActiveRecord::Base.table_name_prefix}data_migrations#{ActiveRecord::Base.table_name_suffix}"
end
def index_name
"#{table_name_prefix}unique_data_migrations#{table_name_suffix}"
end
end
if... | ruby | MIT | 727f933eec032a8f8e53364c5134d16d4bef1d75 | 2026-01-04T17:54:52.718645Z | false |
anjlab/rails-data-migrations | https://github.com/anjlab/rails-data-migrations/blob/727f933eec032a8f8e53364c5134d16d4bef1d75/lib/rails_data_migrations/migrator.rb | lib/rails_data_migrations/migrator.rb | # frozen_string_literal: true
module RailsDataMigrations
class Migrator < ::ActiveRecord::Migrator
MIGRATOR_SALT = 2053462855
def record_version_state_after_migrating(version)
if down?
migrated.delete(version)
LogEntry.where(version: version.to_s).delete_all
else
migrated... | ruby | MIT | 727f933eec032a8f8e53364c5134d16d4bef1d75 | 2026-01-04T17:54:52.718645Z | false |
anjlab/rails-data-migrations | https://github.com/anjlab/rails-data-migrations/blob/727f933eec032a8f8e53364c5134d16d4bef1d75/lib/generators/data_migration_generator.rb | lib/generators/data_migration_generator.rb | # frozen_string_literal: true
require 'rails/generators'
require 'rails-data-migrations'
class DataMigrationGenerator < Rails::Generators::NamedBase
source_root File.expand_path('templates', __dir__)
def create_migration_file
migration_file_name =
"#{RailsDataMigrations::Migrator.migrations_path}/#{Tim... | ruby | MIT | 727f933eec032a8f8e53364c5134d16d4bef1d75 | 2026-01-04T17:54:52.718645Z | false |
anjlab/rails-data-migrations | https://github.com/anjlab/rails-data-migrations/blob/727f933eec032a8f8e53364c5134d16d4bef1d75/lib/generators/templates/data_migration_generator.rb | lib/generators/templates/data_migration_generator.rb | # frozen_string_literal: true
class ClassName < ActiveRecord::DataMigration
def up
# put your code here
end
end | ruby | MIT | 727f933eec032a8f8e53364c5134d16d4bef1d75 | 2026-01-04T17:54:52.718645Z | false |
anjlab/rails-data-migrations | https://github.com/anjlab/rails-data-migrations/blob/727f933eec032a8f8e53364c5134d16d4bef1d75/lib/active_record/data_migration.rb | lib/active_record/data_migration.rb | # frozen_string_literal: true
require 'rails/version'
module ActiveRecord
class DataMigration < (Rails::VERSION::MAJOR >= 5 ? Migration[5.0] : Migration)
# base class (extend with any useful helpers)
def down
raise IrreversibleMigration
end
end
end | ruby | MIT | 727f933eec032a8f8e53364c5134d16d4bef1d75 | 2026-01-04T17:54:52.718645Z | false |
PeriscopeData/redshift-udfs | https://github.com/PeriscopeData/redshift-udfs/blob/d9cd02c9bbd5aec39a24996ac2548f96ffa5c381/udf.rb | udf.rb | require_relative 'udf_harness'
class Runner
ARGS_HELP = """
Usage:
ruby #{__FILE__} <action> [udf_name]
Actions:
load Loads UDFs into your database
drop Removes UDFs from your database
test Runs UDF unit tests on your database
print Pretty-print SQL for making the UD... | ruby | MIT | d9cd02c9bbd5aec39a24996ac2548f96ffa5c381 | 2026-01-04T17:54:54.457515Z | false |
PeriscopeData/redshift-udfs | https://github.com/PeriscopeData/redshift-udfs/blob/d9cd02c9bbd5aec39a24996ac2548f96ffa5c381/udf_harness.rb | udf_harness.rb | require 'pg'
require 'yaml'
Dir[File.join(File.dirname(__FILE__), 'lib', '*.rb')].each do |file|
require_relative File.join('lib', File.basename(file))
end
class UdfHarness
def initialize(only_udf = nil)
@udfs = [
UdfJsonArrays::UDFS,
UdfMysqlCompat::UDFS,
UdfTimeHelpers::UDFS,
... | ruby | MIT | d9cd02c9bbd5aec39a24996ac2548f96ffa5c381 | 2026-01-04T17:54:54.457515Z | false |
PeriscopeData/redshift-udfs | https://github.com/PeriscopeData/redshift-udfs/blob/d9cd02c9bbd5aec39a24996ac2548f96ffa5c381/lib/udf_string_utils.rb | lib/udf_string_utils.rb | class UdfStringUtils
UDFS = [
{
type: :function,
name: :email_name,
description: "Gets the part of the email address before the @ sign",
params: "email varchar(max)",
return_type: "varchar(max)",
body: %~
if not em... | ruby | MIT | d9cd02c9bbd5aec39a24996ac2548f96ffa5c381 | 2026-01-04T17:54:54.457515Z | false |
PeriscopeData/redshift-udfs | https://github.com/PeriscopeData/redshift-udfs/blob/d9cd02c9bbd5aec39a24996ac2548f96ffa5c381/lib/udf_time_helpers.rb | lib/udf_time_helpers.rb | class UdfTimeHelpers
UDFS = [
{
type: :function,
name: :now,
description: "Returns the current time as a timestamp in UTC",
params: nil,
return_type: "timestamp",
body: %~
from datetime import datetime
... | ruby | MIT | d9cd02c9bbd5aec39a24996ac2548f96ffa5c381 | 2026-01-04T17:54:54.457515Z | false |
PeriscopeData/redshift-udfs | https://github.com/PeriscopeData/redshift-udfs/blob/d9cd02c9bbd5aec39a24996ac2548f96ffa5c381/lib/udf_json_arrays.rb | lib/udf_json_arrays.rb | class UdfJsonArrays
UDFS = [
{
type: :function,
name: :json_array_first,
description: "Returns the first element of a JSON array as a string",
params: "j varchar(max)",
return_type: "varchar(max)",
body: %~
import ... | ruby | MIT | d9cd02c9bbd5aec39a24996ac2548f96ffa5c381 | 2026-01-04T17:54:54.457515Z | false |
PeriscopeData/redshift-udfs | https://github.com/PeriscopeData/redshift-udfs/blob/d9cd02c9bbd5aec39a24996ac2548f96ffa5c381/lib/udf_mysql_compat.rb | lib/udf_mysql_compat.rb | class UdfMysqlCompat
UDFS = [
{
type: :function,
name: :mysql_year,
description: "Extract the year from a datetime",
params: "ts timestamp",
return_type: "integer",
body: %~
if not ts:
return None
... | ruby | MIT | d9cd02c9bbd5aec39a24996ac2548f96ffa5c381 | 2026-01-04T17:54:54.457515Z | false |
PeriscopeData/redshift-udfs | https://github.com/PeriscopeData/redshift-udfs/blob/d9cd02c9bbd5aec39a24996ac2548f96ffa5c381/lib/utils.rb | lib/utils.rb | class Object
def present?
!nil?
end
end
| ruby | MIT | d9cd02c9bbd5aec39a24996ac2548f96ffa5c381 | 2026-01-04T17:54:54.457515Z | false |
PeriscopeData/redshift-udfs | https://github.com/PeriscopeData/redshift-udfs/blob/d9cd02c9bbd5aec39a24996ac2548f96ffa5c381/lib/udf_number_utils.rb | lib/udf_number_utils.rb | class UdfNumberUtils
UDFS = [
{
type: :function,
name: :format_num,
description: "Format a number with Python's string format notation",
params: "num float, format varchar",
return_type: "varchar",
body: %~
if not ... | ruby | MIT | d9cd02c9bbd5aec39a24996ac2548f96ffa5c381 | 2026-01-04T17:54:54.457515Z | false |
PeriscopeData/redshift-udfs | https://github.com/PeriscopeData/redshift-udfs/blob/d9cd02c9bbd5aec39a24996ac2548f96ffa5c381/lib/udf_stats.rb | lib/udf_stats.rb | class UdfStats
UDFS = [
{
type: :function,
name: :experiment_result_p_value,
description: "Returns a p-value for a controlled experiment to determine statistical significance",
params: "control_size float, control_conversion float, experiment_size f... | ruby | MIT | d9cd02c9bbd5aec39a24996ac2548f96ffa5c381 | 2026-01-04T17:54:54.457515Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/spec_helper.rb | spec/spec_helper.rb | require 'aldous'
Dir[File.join(File.dirname(__FILE__), 'support', '**', "*.rb").to_s].each {|file| require file }
RSpec.configure do |config|
config.filter_run :focus
config.run_all_when_everything_filtered = true
if config.files_to_run.one?
config.default_formatter = 'doc'
end
config.profile_examples... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/dummy_logger_spec.rb | spec/aldous/dummy_logger_spec.rb | RSpec.describe Aldous::DummyLogger do
describe "::info" do
it "responds to the info method correctly" do
expect(described_class.info('blah')).to eq nil
end
end
end
| ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/controller_action_spec.rb | spec/aldous/controller_action_spec.rb | RSpec.describe Aldous::ControllerAction do
before do
class ExampleControllerAction < Aldous::ControllerAction
end
end
after do
Object.send :remove_const, 'ExampleControllerAction'
end
let(:action) {ExampleControllerAction.new(controller)}
let(:controller) {double 'controller', view_context: v... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/logging_wrapper_spec.rb | spec/aldous/logging_wrapper_spec.rb | RSpec.describe Aldous::LoggingWrapper do
describe "::log" do
subject(:log) {described_class.log(error)}
let(:error) {"hello world"}
let(:aldous_config) {
double "aldous_config", error_reporter: error_reporter, logger: logger
}
let(:error_reporter) {double "error_reporter", report: nil}
... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/configuration_spec.rb | spec/aldous/configuration_spec.rb | RSpec.describe Aldous::Configuration do
subject(:config) {described_class.new}
describe "#error_reporter" do
it "is configured to use the dummy error reporter by default" do
expect(config.error_reporter).to eq ::Aldous::DummyErrorReporter
end
end
describe "#logger" do
it "is configured to us... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/controller_spec.rb | spec/aldous/controller_spec.rb | RSpec.describe Aldous::Controller do
before do
class ExampleController
include Aldous::Controller
end
end
describe "::controller_actions" do
before do
ExampleController.controller_actions(:hello, :world)
end
context "a controller instance" do
let(:controller) {ExampleContro... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/service_spec.rb | spec/aldous/service_spec.rb | describe Aldous::Service do
before do
class ExampleService < Aldous::Service
end
end
after do
Object.send :remove_const, 'ExampleService'
end
describe '.build' do
subject(:build) { ExampleService.build argument }
let(:argument) { 'argument' }
let(:service) { instance_double ExampleS... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/params_spec.rb | spec/aldous/params_spec.rb | RSpec.describe Aldous::Params do
describe "::build" do
it "instantiates a new params object" do
expect(described_class).to receive(:new)
described_class.build({})
end
end
describe "#fetch" do
let(:params_object) {described_class.new(params)}
let(:params) { {} }
context "when erro... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/view_builder_spec.rb | spec/aldous/view_builder_spec.rb | RSpec.describe Aldous::ViewBuilder do
let(:view_builder) { described_class.new(view_context, default_view_data) }
let(:view_context) { double "view_context" }
let(:default_view_data) { {hello: 1} }
let(:respondable_class) { double "respondable_class"}
let(:extra_data) { {world: 2} }
let(:status... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/simple_dto_spec.rb | spec/aldous/simple_dto_spec.rb | RSpec.describe Aldous::SimpleDto do
let(:dto) {described_class.new(data)}
let(:data) {Hash.new}
context "errors passed in are available as errors list" do
let(:data) { {errors: 'hello'} }
it "can get the right error" do
expect(dto.errors.first).to eq 'hello'
end
end
context "messages pass... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/dummy_error_reporter_spec.rb | spec/aldous/dummy_error_reporter_spec.rb | RSpec.describe Aldous::DummyErrorReporter do
describe "::report" do
let(:error) {RuntimeError.new('blah')}
let(:data) { Hash.new }
it "responds to the report method correctly" do
expect(described_class.report(error, data)).to eq nil
end
end
end
| ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/controller/action_execution_service_spec.rb | spec/aldous/controller/action_execution_service_spec.rb | RSpec.describe Aldous::Controller::ActionExecutionService do
let(:action_execution_service) {described_class.new(controller, controller_action_class)}
let(:controller) {double "controller", head: nil, performed?: false}
let(:controller_action_class) {double "controller_action_class", build: action}
let(:actio... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/controller/preconditions_execution_service_spec.rb | spec/aldous/controller/preconditions_execution_service_spec.rb | RSpec.describe Aldous::Controller::PreconditionsExecutionService do
let(:preconditions_execution_service) {described_class.new(action_wrapper, controller)}
let(:controller) {double "controller"}
let(:action_wrapper) {double 'action wrapper', preconditions: preconditions, controller_action: action}
let(:action)... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/controller/action/precondition_spec.rb | spec/aldous/controller/action/precondition_spec.rb | RSpec.describe Aldous::Controller::Action::Precondition do
before do
class ExamplePrecondition < Aldous::Controller::Action::Precondition
end
end
after do
Object.send :remove_const, 'ExamplePrecondition'
end
let(:precondition) {ExamplePrecondition.new(action, controller, view_builder)}
let(:a... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/controller/action/result_execution_service_spec.rb | spec/aldous/controller/action/result_execution_service_spec.rb | RSpec.describe Aldous::Controller::Action::ResultExecutionService do
let(:result_execution_service) {described_class.new(controller, respondable, default_view_data)}
let(:controller) {double "controller", view_context: view_context}
let(:view_context) {double "view_context"}
let(:respondable) do
double "... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/controller/action/wrapper_spec.rb | spec/aldous/controller/action/wrapper_spec.rb | RSpec.describe Aldous::Controller::Action::Wrapper do
let(:wrapper) { described_class.new controller_action }
let(:controller_action) { double 'controller action',
default_view_data: default_view_data,
preconditions: preconditions,
... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/controller/action/precondition/wrapper_spec.rb | spec/aldous/controller/action/precondition/wrapper_spec.rb | RSpec.describe Aldous::Controller::Action::Precondition::Wrapper do
let(:wrapper) { described_class.new precondition }
let(:precondition) {double 'precondition',
action: controller_action,
view_builder: view_builder,
perform: nil }
let(:controlle... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/service/wrapper_spec.rb | spec/aldous/service/wrapper_spec.rb | RSpec.describe Aldous::Service::Wrapper do
let(:wrapper) { described_class.new service }
let(:service) { double 'service', perform: service_result, default_result_data: default_result_data, raisable_error: raisable_error }
let(:service_result) { Aldous::Service::Result::Success.new service_result_data }
let(:d... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/service/result/success_spec.rb | spec/aldous/service/result/success_spec.rb | RSpec.describe Aldous::Service::Result::Success do
subject(:result) {described_class.new}
describe "#failure?" do
it {expect(result.failure?).to eq false}
end
describe "#success?" do
it {expect(result.success?).to eq true}
end
end
| ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/service/result/failure_spec.rb | spec/aldous/service/result/failure_spec.rb | RSpec.describe Aldous::Service::Result::Failure do
subject(:result) {described_class.new}
describe "#failure?" do
it {expect(result.failure?).to eq true}
end
describe "#success?" do
it {expect(result.success?).to eq false}
end
end
| ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/view/blank/atom_view_spec.rb | spec/aldous/view/blank/atom_view_spec.rb | RSpec.describe Aldous::View::Blank::AtomView do
subject(:view) {described_class.new(status, view_data, view_context)}
let(:status) {nil}
let(:view_data) {double("result")}
let(:view_context) {double("view context")}
it "inherits from Renderable" do
expect(described_class.ancestors.include?(Aldous::Respo... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/view/blank/html_view_spec.rb | spec/aldous/view/blank/html_view_spec.rb | RSpec.describe Aldous::View::Blank::HtmlView do
subject(:view) {described_class.new(status, view_data, view_context)}
let(:status) {nil}
let(:view_data) {double("result")}
let(:view_context) {double("view context")}
it "inherits from Renderable" do
expect(described_class.ancestors.include?(Aldous::Respo... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/view/blank/json_view_spec.rb | spec/aldous/view/blank/json_view_spec.rb | RSpec.describe Aldous::View::Blank::JsonView do
subject(:view) {described_class.new(status, view_data, view_context)}
let(:status) {nil}
let(:view_data) {double("result")}
let(:view_context) {double("view context")}
it "inherits from Renderable" do
expect(described_class.ancestors.include?(Aldous::Respo... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/respondable/headable_spec.rb | spec/aldous/respondable/headable_spec.rb | RSpec.describe Aldous::Respondable::Headable do
subject(:headable) {described_class.new(status, view_data, view_context)}
let(:status) {:foo}
let(:view_data) {double("view_data")}
let(:view_context) {double("view context")}
describe "::action" do
let(:controller) {double("controller")}
it "returns ... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/respondable/renderable_spec.rb | spec/aldous/respondable/renderable_spec.rb | RSpec.describe Aldous::Respondable::Renderable do
class Aldous::Respondable::Renderable::Dummy < described_class
def template_data
{
locals: {hello: 1}
}
end
def default_template_locals
{
hello: 2
}
end
end
subject(:renderable) {Aldous::Respondable::Render... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/respondable/redirectable_spec.rb | spec/aldous/respondable/redirectable_spec.rb | RSpec.describe Aldous::Respondable::Redirectable do
class Aldous::Respondable::Redirectable::Dummy < described_class
def location
'hello'
end
end
subject(:redirectable) {Aldous::Respondable::Redirectable::Dummy.new(status, view_data, view_context)}
let(:status) {:foo}
let(:view_data) {double("... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/respondable/send_data_spec.rb | spec/aldous/respondable/send_data_spec.rb | RSpec.describe Aldous::Respondable::SendData do
class Aldous::Respondable::SendData::Dummy < described_class
def data
'hello'
end
def options
'world'
end
end
subject(:send_data) {Aldous::Respondable::SendData::Dummy.new(status, view_data, view_context)}
let(:status) {:foo}
let(:... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/respondable/base_spec.rb | spec/aldous/respondable/base_spec.rb | RSpec.describe Aldous::Respondable::Base do
let(:status) {:foo}
let(:view_data) {double("view_data")}
let(:view_context) {double("view context")}
describe "::new" do
it "object can be instantiated with the right params" do
expect{described_class.new(status, view_data, view_context)}.to_not raise_erro... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/respondable/request_http_basic_authentication_spec.rb | spec/aldous/respondable/request_http_basic_authentication_spec.rb | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false | |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/respondable/redirectable/redirect_action_spec.rb | spec/aldous/respondable/redirectable/redirect_action_spec.rb | RSpec.describe Aldous::Respondable::Redirectable::RedirectAction do
subject(:respondable) {described_class.new(location, controller, view_data, status)}
let(:location) {"hello"}
let(:controller) {double 'controller', redirect_to: nil, flash: flash }
let(:view_data) {"blah"}
let(:response_status) {'world'}
... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/respondable/headable/head_action_spec.rb | spec/aldous/respondable/headable/head_action_spec.rb | RSpec.describe Aldous::Respondable::Headable::HeadAction do
subject(:respondable) {described_class.new(controller, status)}
let(:controller) {double 'controller'}
let(:status) {'hello'}
before do
allow(controller).to receive(:head).with(status)
end
describe "#execute" do
it "calls head on control... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/respondable/send_data/send_data_action_spec.rb | spec/aldous/respondable/send_data/send_data_action_spec.rb | RSpec.describe Aldous::Respondable::SendData::SendDataAction do
subject(:respondable) {described_class.new(data, options, controller, result)}
let(:data) { 'hello' }
let(:options) {'world'}
let(:controller) {double 'controller', render: nil}
let(:result) {"blah"}
describe "#execute" do
it "calls rende... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/respondable/renderable/render_action_spec.rb | spec/aldous/respondable/renderable/render_action_spec.rb | RSpec.describe Aldous::Respondable::Renderable::RenderAction do
subject(:respondable) {described_class.new(template, status, controller, view_data)}
let(:status) {:foo}
let(:template) { {hello: 'world'} }
let(:controller) {double 'controller', render: nil, flash: flash }
let(:view_data) {"blah"}
let(:respo... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/spec/aldous/respondable/shared/flash_spec.rb | spec/aldous/respondable/shared/flash_spec.rb | RSpec.describe Aldous::Respondable::Shared::Flash do
let(:flash) {described_class.new(result, flash_container)}
let(:controller) {double 'controller', flash: flash_container}
let(:result) {double 'result', errors: errors}
let(:errors) {['1', '2']}
let(:flash_container) {double 'flash container', now: flash_n... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
envato-archive/aldous | https://github.com/envato-archive/aldous/blob/0eb0a18b511345ad5fea3072a7111ea5ebcfb30d/examples/basic_todo/app/controller_actions/base_action.rb | examples/basic_todo/app/controller_actions/base_action.rb | class BaseAction < ::Aldous::ControllerAction
def default_view_data
{
current_user: current_user,
current_ability: current_ability,
}
end
def preconditions
[Shared::EnsureUserNotDisabledPrecondition]
end
def default_error_handler(error)
Defaults::ServerErrorView
end
def curr... | ruby | MIT | 0eb0a18b511345ad5fea3072a7111ea5ebcfb30d | 2026-01-04T17:54:58.048556Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.