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 |
|---|---|---|---|---|---|---|---|---|
midnightmonster/activerecord-summarize | https://github.com/midnightmonster/activerecord-summarize/blob/7371f06ce47b2bc6966a5b8297aa95aaee2c59de/lib/activerecord/summarize.rb | lib/activerecord/summarize.rb | # frozen_string_literal: true
require_relative "summarize/version"
require_relative "summarize/calculation_implementation"
require_relative "../chainable_result"
module ActiveRecord::Summarize
class Unsummarizable < StandardError; end
class Summarize
attr_reader :current_result_row, :base_groups, :base_assoc... | ruby | MIT | 7371f06ce47b2bc6966a5b8297aa95aaee2c59de | 2026-01-04T17:49:56.082596Z | false |
midnightmonster/activerecord-summarize | https://github.com/midnightmonster/activerecord-summarize/blob/7371f06ce47b2bc6966a5b8297aa95aaee2c59de/lib/activerecord/summarize/version.rb | lib/activerecord/summarize/version.rb | # frozen_string_literal: true
module ActiveRecord
module Summarize
VERSION = "0.5.1"
end
end
| ruby | MIT | 7371f06ce47b2bc6966a5b8297aa95aaee2c59de | 2026-01-04T17:49:56.082596Z | false |
midnightmonster/activerecord-summarize | https://github.com/midnightmonster/activerecord-summarize/blob/7371f06ce47b2bc6966a5b8297aa95aaee2c59de/lib/activerecord/summarize/calculation_implementation.rb | lib/activerecord/summarize/calculation_implementation.rb | module ActiveRecord::Summarize::CalculationImplementation
def self.new(operation, relation, column_name)
case operation
when "sum" then Sum
when "count" then Count
when "minimum" then Minimum
when "maximum" then Maximum
else raise "Unknown calculation #{operation}"
end.new(relation, column... | ruby | MIT | 7371f06ce47b2bc6966a5b8297aa95aaee2c59de | 2026-01-04T17:49:56.082596Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/test_has_many.rb | test/test_has_many.rb | require 'helper'
require 'json'
class TestHasMany < Test::Unit::TestCase
class Puzzle < Remodel::Entity
has_many :pieces, :class => 'TestHasMany::Piece'
property :topic
end
class Piece < Remodel::Entity
property :color
end
context "association" do
should "exist" do
assert Puzzle.crea... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/test_shortnames.rb | test/test_shortnames.rb | require 'helper'
class TestShortnames < Test::Unit::TestCase
class Foo < Remodel::Entity; end
class Bar < Remodel::Entity
property :test, :short => 'z'
has_one :foo, :short => 'y', :class => Foo
has_many :foos, :short => 'x', :class => Foo
end
context "property shortnames" do
setup do
... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/test_caching_context.rb | test/test_caching_context.rb | # encoding: UTF-8
require 'helper'
class Remodel::CachingContext
attr_accessor :cache
class << self
public :new
end
end
class TestCachingContext < Test::Unit::TestCase
context "CachingContext" do
setup do
@cache = Remodel::CachingContext.new(context)
end
context 'hget' do
should ... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/test_entity_delete.rb | test/test_entity_delete.rb | require 'helper'
class TestEntityDelete < Test::Unit::TestCase
class Group < Remodel::Entity
has_many :members, :class => 'TestEntityDelete::Person'
has_one :room, :class => 'TestEntityDelete::Room'
property :name
end
class Person < Remodel::Entity
property :name
end
class Room < Remodel::... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/test_remodel.rb | test/test_remodel.rb | require 'helper'
class TestRemodel < Test::Unit::TestCase
context "create_context" do
should "create a context" do
context = Remodel.create_context('foo')
assert_equal Remodel::Context, context.class
assert_equal 'foo', context.key
end
should "create a caching context, if specified" d... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/test_has_one.rb | test/test_has_one.rb | require 'helper'
class TestHasOne < Test::Unit::TestCase
class Piece < Remodel::Entity
has_one :puzzle, :class => 'TestHasOne::Puzzle'
property :color
end
class Puzzle < Remodel::Entity
property :topic
end
context "association getter" do
should "exist" do
assert Piece.create(context... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/test_entity_defaults.rb | test/test_entity_defaults.rb | require 'helper'
class TestEntityDefaults < Test::Unit::TestCase
class Bar < Remodel::Entity
property :simple, :default => 123
property :array, :default => [1]
property :hash, :default => { :foo => 1 }
end
context "[default values]" do
should "be returned for missing properties" do
bar = ... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/test_mappers.rb | test/test_mappers.rb | require 'helper'
class Item < Remodel::Entity
property :boolean, :class => Boolean
property :string, :class => String
property :integer, :class => Integer
property :float, :class => Float
property :array, :class => Array
property :hash, :class => Hash
property :time, :class => Time
property :date, :cla... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/test_entity.rb | test/test_entity.rb | require 'helper'
class Foo < Remodel::Entity
property :x
property :y
end
class Bar < Remodel::Entity
property :d, :default => 123
end
class TestEntity < Test::Unit::TestCase
context "new" do
should "set properties" do
foo = Foo.new(context, :x => 1, :y => 2)
assert_equal 1, foo.x
asser... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/helper.rb | test/helper.rb | require 'rubygems'
require 'test/unit'
require 'shoulda'
require 'mocha'
require File.dirname(__FILE__) + '/../lib/remodel.rb'
class Test::Unit::TestCase
def redis
Remodel.redis
end
def context
@context ||= Remodel.create_context('test')
end
end
| ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/test_monkeypatches.rb | test/test_monkeypatches.rb | require 'helper'
class TestMonkeypatches < Test::Unit::TestCase
context "Boolean" do
should "be the superclass of both true and false" do
assert true.is_a?(Boolean)
assert false.is_a?(Boolean)
end
end
context "Class[]" do
should "return given Class objects" do
assert_equal String,... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/test/test_inheritance.rb | test/test_inheritance.rb | require 'helper'
class TestInheritance < Test::Unit::TestCase
class Foo < Remodel::Entity
property :test
end
class Bar < Remodel::Entity
property :test
end
class Person < Remodel::Entity
property :name, :short => 'n'
has_one :foo, :class => Foo
has_many :foos, :class => Foo
end
c... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/example/book.rb | example/book.rb | require File.dirname(__FILE__) + "/../lib/remodel"
class Book < Remodel::Entity
has_many :chapters, :class => 'Chapter'
property :title, :short => 't', :class => 'String'
property :year, :class => 'Integer'
property :author, :class => 'String', :default => '(anonymous)'
end
class Chapter < Remodel::Entity
p... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/lib/remodel.rb | lib/remodel.rb | require 'rubygems'
require 'redis'
require 'date'
require 'set'
# If available, use the superfast YAJL lib to parse JSON.
begin
require 'yajl/json_gem'
rescue LoadError
require 'json'
end
# Define `Boolean` -- the missing superclass of `true` and `false`.
module Boolean; end
true.extend(Boolean)
false.extend(Bool... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/lib/remodel/caching_context.rb | lib/remodel/caching_context.rb | # encoding: UTF-8
module Remodel
class CachingContext
# use Remodel.create_context instead
class << self
private :new
end
def initialize(context)
@context = context
@cache = {}
end
def key
@context.key
end
def batched
raise InvalidUse, "cannot nest ba... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/lib/remodel/entity.rb | lib/remodel/entity.rb | module Remodel
# The superclass of all persistent remodel entities.
class Entity
attr_accessor :context, :key
def initialize(context, attributes = {}, key = nil)
@context = context
@attributes = {}
@key = key
attributes.each do |name, value|
send("#{name}=", value) if respo... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/lib/remodel/has_many.rb | lib/remodel/has_many.rb | module Remodel
# Represents the many-end of a many-to-one or many-to-many association.
class HasMany < Array
def initialize(this, clazz, key)
super _fetch(clazz, this.context, key)
@this, @clazz, @key = this, clazz, key
end
def create(attributes = {})
add(@clazz.create(@this.context,... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/lib/remodel/context.rb | lib/remodel/context.rb | module Remodel
class Context
# use Remodel.create_context instead
class << self
private :new
end
attr_reader :key
def initialize(key)
@key = key
end
def hget(field)
Remodel.redis.hget(@key, field)
end
def hmget(*fields)
Remodel.redis.hmget(@key, *field... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
tlossen/remodel | https://github.com/tlossen/remodel/blob/82a0222e02ab07cc1a6fbb99f749300dc4868315/lib/remodel/mapper.rb | lib/remodel/mapper.rb | module Remodel
# A mapper converts a given value into a native JSON value —
# *nil*, *true*, *false*, *Number*, *String*, *Hash*, *Array* —
# via `pack`, and back again via `unpack`.
#
# Without any arguments, `Mapper.new` returns the identity mapper, which
# maps every value to itself. If `cla... | ruby | MIT | 82a0222e02ab07cc1a6fbb99f749300dc4868315 | 2026-01-04T17:49:55.198629Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/aggregate_delta_spec.rb | spec/aggregate_delta_spec.rb | require 'spec_helper'
class PersonTest
include Sandthorn::AggregateRoot
attr_reader :name
attr_reader :age
attr_reader :relationship_status
attr_reader :my_array
attr_reader :my_hash
def initialize name, age, relationship_status
@name = name
@age = age
@relationship_status = rela... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/event_stores_spec.rb | spec/event_stores_spec.rb | require 'spec_helper'
module Sandthorn
describe EventStores do
let(:stores) { EventStores.new }
before do
class AnAggregate
include Sandthorn::AggregateRoot
end
end
describe "#initialize" do
context "when given a single event_store" do
it "sets it as the defa... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/complex_aggregate_spec.rb | spec/complex_aggregate_spec.rb | require 'spec_helper'
require 'date'
class Hello
attr_reader :foo_bar
attr_accessor :change_me
def initialize foo_bar
@foo_bar = foo_bar
end
def set_foo_bar value
@foo_bar = value
end
end
class IAmComplex
include Sandthorn::AggregateRoot
attr_reader :a_date
attr_reader :hello
def set_he... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/stateless_events_spec.rb | spec/stateless_events_spec.rb | require 'spec_helper'
module Sandthorn
class StatelessEventsSpec
include AggregateRoot
stateless_events :one_event, :some_other_event
attr_reader :name
def initialize name
@name = name
end
end
describe "::stateless_events" do
let(:args) do
{first: "first", other: [1,2... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/constructor_events_spec.rb | spec/constructor_events_spec.rb | require 'spec_helper'
module Sandthorn
class ConstructorEventsSpec
include AggregateRoot
constructor_events :created_event
attr_reader :name
def self.create name
created_event(name) { @name = name }
end
end
describe "::constructor_events" do
let(:subject) do
ConstructorE... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/tracing_spec.rb | spec/tracing_spec.rb | require 'spec_helper'
require 'sandthorn/event_inspector'
class UsualSuspect
include Sandthorn::AggregateRoot
def initialize full_name
@full_name = full_name
@charges = []
end
def charge_suspect_of_crime! crime_name
suspect_was_charged crime_name
end
private
def suspect_was_charged crime... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/aggregate_events_spec.rb | spec/aggregate_events_spec.rb | require 'spec_helper'
require 'sandthorn/event_inspector'
module Sandthorn
class EventsSpec
include AggregateRoot
events :name_changed, :some_other_event, :third_event
attr_reader :name
def change_name(name)
if @name != name
name_changed(name) { @name = name }
end
end
d... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/snapshot_spec.rb | spec/snapshot_spec.rb | require 'spec_helper'
module Sandthorn
module Snapshot
class KlassOne
include Sandthorn::AggregateRoot
snapshot true
end
class KlassTwo
include Sandthorn::AggregateRoot
end
class KlassThree
include Sandthorn::AggregateRoot
end
describe "::snapshot" do
befo... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/default_attributes_spec.rb | spec/default_attributes_spec.rb | require 'spec_helper'
# class DefaultAttributes
# include Sandthorn::AggregateRoot
# def initialize
# end
# end
describe "when the initialize-method changes" do
before do
class DefaultAttributes
include Sandthorn::AggregateRoot
def initialize
end
end
end
#Make sure the Defaul... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/bounded_context_spec.rb | spec/bounded_context_spec.rb | require 'spec_helper'
require 'sandthorn/bounded_context'
module Sandthorn
describe BoundedContext do
it 'should respond to `aggregate_types`' do
expect(BoundedContext).to respond_to(:aggregate_types)
end
end
describe "::aggregate_types" do
module TestModule
include Sandthorn::BoundedCon... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/initialize_signature_change_spec.rb | spec/initialize_signature_change_spec.rb | require 'spec_helper'
class InitChange
include Sandthorn::AggregateRoot
attr_reader :foo
def initialize foo: nil
@foo = foo
end
end
def change_init
InitChange.class_eval do
define_method :initialize, lambda { @foo = :foo }
end
end
describe "when the initialize-method changes" do
it "should be pos... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/benchmark_spec.rb | spec/benchmark_spec.rb | require 'spec_helper'
require 'benchmark'
module Sandthorn
module AggregateRoot
class TestClass
include Sandthorn::AggregateRoot
attr_reader :name
def initialize args = {}
end
def change_name value
unless name == value
@name = value
commit
... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/spec_helper.rb | spec/spec_helper.rb | # This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# Require this file using `require "spec_helper"` to ensure that it is only
# loaded once.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
requir... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/aggregate_root_spec.rb | spec/aggregate_root_spec.rb | require 'spec_helper'
module Sandthorn
module AggregateRoot
class DirtyClass
include Sandthorn::AggregateRoot
attr_reader :name, :age
attr :age
attr_writer :writer
def initialize args = {}
@name = args.fetch(:name, nil)
@age = args.fetch(:age, nil)
@wr... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/spec/support/custom_matchers.rb | spec/support/custom_matchers.rb | require 'rspec/expectations'
RSpec::Matchers.define :have_aggregate_type do |expected|
match do |actual|
actual[:aggregate_type].to_s == expected.to_s
end
end | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/lib/sandthorn.rb | lib/sandthorn.rb | require "sandthorn/version"
require "sandthorn/errors"
require "sandthorn/aggregate_root"
require "sandthorn/event_stores"
require "sandthorn/application_snapshot_store"
require 'yaml'
require 'securerandom'
module Sandthorn
class << self
extend Forwardable
def_delegators :configuration, :event_stores
d... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/lib/sandthorn/aggregate_root.rb | lib/sandthorn/aggregate_root.rb | require 'sandthorn/aggregate_root_base'
require 'sandthorn/aggregate_root_marshal'
module Sandthorn
module AggregateRoot
include Base
include Marshal
def self.included(base)
base.extend(Base::ClassMethods)
end
end
end | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/lib/sandthorn/version.rb | lib/sandthorn/version.rb | module Sandthorn
VERSION = "1.3.0"
end
| ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/lib/sandthorn/aggregate_root_base.rb | lib/sandthorn/aggregate_root_base.rb | module Sandthorn
module AggregateRoot
module Base
attr_reader :aggregate_id
attr_reader :aggregate_events
attr_reader :aggregate_current_event_version
attr_reader :aggregate_originating_version
attr_reader :aggregate_trace_information
alias :id :aggregate_id
alias :aggr... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/lib/sandthorn/aggregate_root_marshal.rb | lib/sandthorn/aggregate_root_marshal.rb | module Sandthorn
module AggregateRoot
module Marshal
def aggregate_initialize *args
@aggregate_attribute_deltas = {}
@aggregate_stored_instance_variables = {}
end
def set_instance_variables! attribute
super attribute
init_vars = extract_relevant_aggregate_insta... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/lib/sandthorn/errors.rb | lib/sandthorn/errors.rb | module Sandthorn
module Errors
class Error < StandardError; end
class AggregateNotFound < Error; end
class ConcurrencyError < Error; end
class ConfigurationError < Error; end
class SnapshotError < Error; end
end
end | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/lib/sandthorn/application_snapshot_store.rb | lib/sandthorn/application_snapshot_store.rb | module Sandthorn
class ApplicationSnapshotStore
def initialize
@store = Hash.new
end
attr_reader :store
def save aggregate_id, aggregate
@store[aggregate_id] = aggregate
end
def find aggregate_id
@store[aggregate_id]
end
end
end
| ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/lib/sandthorn/bounded_context.rb | lib/sandthorn/bounded_context.rb | module Sandthorn
module BoundedContext
module ClassMethods
def aggregate_types
@aggregate_list = p_aggregate_types(self)
end
private
def p_aggregate_types(bounded_context_module)
return [] unless bounded_context_module.respond_to?(:constants)
classe... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/lib/sandthorn/event_inspector.rb | lib/sandthorn/event_inspector.rb | module Sandthorn
module EventInspector
def has_unsaved_event? event_name, options = {}
unsaved = events_with_trace_info
if self.aggregate_events.empty?
unsaved = []
else
unsaved.reject! do |e|
e[:aggregate_version] < self
.aggregate_events.first[:aggregate... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
Sandthorn/sandthorn | https://github.com/Sandthorn/sandthorn/blob/68b37655c857dd588e950cdcde99056060beaf56/lib/sandthorn/event_stores.rb | lib/sandthorn/event_stores.rb | require 'forwardable'
module Sandthorn
class EventStores
extend Forwardable
include Enumerable
def_delegators :stores, :each
def initialize(stores = nil)
@store_map = Hash.new
add_initial(stores)
end
def add(name, event_store)
store_map[name] = event_store
end
ali... | ruby | MIT | 68b37655c857dd588e950cdcde99056060beaf56 | 2026-01-04T17:49:58.000055Z | false |
mainmatter/highlight | https://github.com/mainmatter/highlight/blob/471fec071cd88cca7d29cbcb7c5f774bec883cbc/uninstall.rb | uninstall.rb | puts ''
puts " ** Be sure to delete highlight.css from #{RAILS_ROOT}/public/stylesheets/ if you don't need it anymore! **"
puts '' | ruby | MIT | 471fec071cd88cca7d29cbcb7c5f774bec883cbc | 2026-01-04T17:50:00.678204Z | false |
mainmatter/highlight | https://github.com/mainmatter/highlight/blob/471fec071cd88cca7d29cbcb7c5f774bec883cbc/rails/init.rb | rails/init.rb | require 'action_view'
require 'simplabs/highlight'
if `which pygmentize`.blank?
puts ''
puts " ** [Highlight] pygments cannot be found, falling back to #{Simplabs::Highlight::WEB_API_URL}! **"
puts ' ** If you have pygments installed, make sure it is in your PATH. **'
puts ''
Simplabs... | ruby | MIT | 471fec071cd88cca7d29cbcb7c5f774bec883cbc | 2026-01-04T17:50:00.678204Z | false |
mainmatter/highlight | https://github.com/mainmatter/highlight/blob/471fec071cd88cca7d29cbcb7c5f774bec883cbc/generators/highlight_styles_generator/highlight_styles_generator.rb | generators/highlight_styles_generator/highlight_styles_generator.rb | if Rails::VERSION::MAJOR >= 3
class HighlightStylesGenerator < Rails::Generators::Base
include Rails::Generators::Actions
source_root File.expand_path('../templates', __FILE__)
def create_stylesheet_file
empty_directory('public/stylesheets')
copy_file(
'highlight.css',
'pub... | ruby | MIT | 471fec071cd88cca7d29cbcb7c5f774bec883cbc | 2026-01-04T17:50:00.678204Z | false |
mainmatter/highlight | https://github.com/mainmatter/highlight/blob/471fec071cd88cca7d29cbcb7c5f774bec883cbc/spec/boot.rb | spec/boot.rb | plugin_root = File.join(File.dirname(__FILE__), '..')
require File.join(File.dirname(__FILE__), '/../rails/init.rb')
| ruby | MIT | 471fec071cd88cca7d29cbcb7c5f774bec883cbc | 2026-01-04T17:50:00.678204Z | false |
mainmatter/highlight | https://github.com/mainmatter/highlight/blob/471fec071cd88cca7d29cbcb7c5f774bec883cbc/spec/spec_helper.rb | spec/spec_helper.rb | $:.reject! { |e| e.include? 'TextMate' }
ENV['RAILS_ENV'] = 'test'
require 'rubygems'
require 'bundler'
Bundler.setup
require File.join(File.dirname(__FILE__), 'boot')
| ruby | MIT | 471fec071cd88cca7d29cbcb7c5f774bec883cbc | 2026-01-04T17:50:00.678204Z | false |
mainmatter/highlight | https://github.com/mainmatter/highlight/blob/471fec071cd88cca7d29cbcb7c5f774bec883cbc/spec/lib/view_methods_spec.rb | spec/lib/view_methods_spec.rb | require 'spec_helper'
describe Simplabs::Highlight::ViewMethods do
include Simplabs::Highlight::ViewMethods
let(:code) { 'class Test; end' }
describe '#highlight_code' do
describe 'when invoked with a language and a string' do
it 'should highlight the code' do
Simplabs::Highlight.should_re... | ruby | MIT | 471fec071cd88cca7d29cbcb7c5f774bec883cbc | 2026-01-04T17:50:00.678204Z | false |
mainmatter/highlight | https://github.com/mainmatter/highlight/blob/471fec071cd88cca7d29cbcb7c5f774bec883cbc/spec/lib/pygments_wrapper_spec.rb | spec/lib/pygments_wrapper_spec.rb | require 'spec_helper'
describe Simplabs::Highlight::PygmentsWrapper do
let(:wrapper) do
code = <<-EOC
class Test
def method test
end
end
EOC
Simplabs::Highlight::PygmentsWrapper.new(code, :ruby)
end
describe '#highlight' do
it 'should correctly highlight source code passed as parameter' do
... | ruby | MIT | 471fec071cd88cca7d29cbcb7c5f774bec883cbc | 2026-01-04T17:50:00.678204Z | false |
mainmatter/highlight | https://github.com/mainmatter/highlight/blob/471fec071cd88cca7d29cbcb7c5f774bec883cbc/spec/lib/highlight_spec.rb | spec/lib/highlight_spec.rb | require 'spec_helper'
describe Simplabs::Highlight do
let(:code) do
<<-EOC
class Test
def method test
end
end
EOC
end
describe '#highlight' do
shared_examples 'the highlight method' do
describe 'when the language is not supported' do
it 'should only escape HTML in the passed code' ... | ruby | MIT | 471fec071cd88cca7d29cbcb7c5f774bec883cbc | 2026-01-04T17:50:00.678204Z | false |
mainmatter/highlight | https://github.com/mainmatter/highlight/blob/471fec071cd88cca7d29cbcb7c5f774bec883cbc/lib/simplabs/highlight.rb | lib/simplabs/highlight.rb | require 'cgi'
require 'net/http'
require 'uri'
require 'simplabs/highlight/pygments_wrapper'
module Simplabs
require 'simplabs/highlight/railtie' if defined?(Rails) && Rails::VERSION::MAJOR >= 3
# Highlight is a simple syntax highlighting plugin for Ruby on Rails.
# It's basically a wrapper around the popular ... | ruby | MIT | 471fec071cd88cca7d29cbcb7c5f774bec883cbc | 2026-01-04T17:50:00.678204Z | false |
mainmatter/highlight | https://github.com/mainmatter/highlight/blob/471fec071cd88cca7d29cbcb7c5f774bec883cbc/lib/simplabs/highlight/railtie.rb | lib/simplabs/highlight/railtie.rb | require 'simplabs/highlight'
require 'rails'
module Simplabs
module Highlight
class Railtie < Rails::Railtie
GEM_ROOT = File.join(File.dirname(__FILE__), '..', '..', '..')
initializer 'simplabs.highlight.initialization' do
require File.join(GEM_ROOT, 'rails', 'init')
end
gene... | ruby | MIT | 471fec071cd88cca7d29cbcb7c5f774bec883cbc | 2026-01-04T17:50:00.678204Z | false |
mainmatter/highlight | https://github.com/mainmatter/highlight/blob/471fec071cd88cca7d29cbcb7c5f774bec883cbc/lib/simplabs/highlight/pygments_wrapper.rb | lib/simplabs/highlight/pygments_wrapper.rb | module Simplabs
module Highlight
# Wraps the actual +pygments+ syntax highlighter and
# exposes its functionality to Ruby code.
#
class PygmentsWrapper
# The code the wrapper highlights
#
attr_reader :code
# The language the {Simplabs::Highlight::PygmentsWrapper#code} to hi... | ruby | MIT | 471fec071cd88cca7d29cbcb7c5f774bec883cbc | 2026-01-04T17:50:00.678204Z | false |
sblackstone/auto_sprite | https://github.com/sblackstone/auto_sprite/blob/c54076cf419e7b7fdeddb5d25a1d3b87533376c1/rails/init.rb | rails/init.rb | require 'auto_sprite'
AutoSprite.setup!
ActionView::Helpers.send(:include, AutoSprite::Helpers)
| ruby | MIT | c54076cf419e7b7fdeddb5d25a1d3b87533376c1 | 2026-01-04T17:50:07.321106Z | false |
sblackstone/auto_sprite | https://github.com/sblackstone/auto_sprite/blob/c54076cf419e7b7fdeddb5d25a1d3b87533376c1/lib/auto_sprite.rb | lib/auto_sprite.rb | require 'RMagick'
require 'fileutils'
module AutoSprite
SPRITE_ASSETS_PATH = File.join(RAILS_ROOT, 'public', 'images', 'sprites')
CSS_FILE_PATH = File.join(RAILS_ROOT, 'public', 'stylesheets', 'auto_sprite.css')
SPRITE_IMG_PATH = File.join(RAILS_ROOT, 'public', 'images', 'auto_sprite.png')
SP... | ruby | MIT | c54076cf419e7b7fdeddb5d25a1d3b87533376c1 | 2026-01-04T17:50:07.321106Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/engineyard_spec.rb | spec/engineyard_spec.rb | require 'spec_helper'
describe EY do
it "provides EY errors" do
expect(EY::Error).to be
end
end | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/spec_helper.rb | spec/spec_helper.rb | if self.class.const_defined?(:EY_ROOT)
raise "don't require the spec helper twice!"
end
if ENV['COVERAGE']
require 'simplecov'
SimpleCov.start
end
EY_ROOT = File.expand_path("../..", __FILE__)
require 'rubygems'
require 'bundler/setup'
require 'escape'
require 'net/ssh'
# Bundled gems
require 'fakeweb'
require... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/support/matchers.rb | spec/support/matchers.rb | require 'rspec/matchers'
RSpec::Matchers.define :have_command_like do |regex|
match do |command_list|
@found = command_list.find{|c| c =~ regex }
!!@found
end
failure_message_for_should do |command_list|
"Didn't find a command matching #{regex} in commands:\n\n" + command_list.join("\n\n")
end
... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/support/ruby_ext.rb | spec/support/ruby_ext.rb | module Kernel
def capture_stdio(input = nil, &block)
require 'stringio'
org_stdin, $stdin = $stdin, StringIO.new(input) if input
org_stdout, $stdout = $stdout, StringIO.new
yield
return @out = $stdout.string
ensure
$stdout = org_stdout
$stdin = org_stdin
end
alias capture_stdout capt... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/support/git_repos.rb | spec/support/git_repos.rb | module EY
class << self
def define_git_repo(name, &setup)
git_repo_setup[name] ||= setup
end
def refresh_git_repo(name)
git_repo_dir_cache.delete name
end
def git_repo_dir(name)
return git_repo_dir_cache[name] if git_repo_dir_cache.has_key?(name)
raise ArgumentError, "No ... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/support/helpers.rb | spec/support/helpers.rb | require 'engineyard/cli'
require 'realweb'
require 'open4'
require 'stringio'
module SpecHelpers
module Given
def given(name)
include_examples name
end
end
module IntegrationHelpers
def run_ey(command_options, ey_options={})
if respond_to?(:extra_ey_options) # needed for ssh tests
... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/support/shared_behavior.rb | spec/support/shared_behavior.rb | require 'ostruct'
shared_examples_for "it has an ambiguous git repo" do
use_git_repo('dup test')
before(:all) do
login_scenario "two apps, same git uri"
end
end
shared_examples_for "it requires an unambiguous git repo" do
include_examples "it has an ambiguous git repo"
it "lists disambiguating environ... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/engineyard/eyrc_spec.rb | spec/engineyard/eyrc_spec.rb | require 'spec_helper'
require 'engineyard/eyrc'
describe EY::EYRC do
before { clean_eyrc }
describe ".load" do
it "looks for .eyrc in $EYRC if set" do
expect(EY::EYRC.load.path).to eq(Pathname.new(ENV['EYRC']))
end
it "looks for .eyrc in $HOME/.eyrc by default" do
ENV.delete('EYRC')
... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/engineyard/repo_spec.rb | spec/engineyard/repo_spec.rb | require 'spec_helper'
describe EY::Repo do
let(:path) { p = TMPDIR.join('ey-test'); p.mkpath; p }
before(:each) do
Dir.chdir(path) { `git init -q` }
ENV['GIT_DIR'] = path.join('.git').to_s
end
after(:each) do
path.rmtree
ENV.delete('GIT_DIR')
end
def set_head(head)
path.join('.git','... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/engineyard/cli_spec.rb | spec/engineyard/cli_spec.rb | require 'spec_helper'
require 'engineyard/cli'
describe EY::CLI do
it "provides help" do
out = capture_stdout do
EY::CLI.start(["help"])
end
expect(out).to include("ey deploy")
expect(out).to include("ey ssh")
expect(out).to include("ey web enable")
end
it "delegates help" do
out... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/engineyard/deploy_config_spec.rb | spec/engineyard/deploy_config_spec.rb | require 'spec_helper'
require 'tempfile'
describe EY::DeployConfig do
let(:tempfile) { @tempfile = Tempfile.new('ey.yml') }
let(:parent) { EY::Config.new(tempfile.path) }
let(:ui) { EY::CLI::UI.new }
let(:repo) { double('repo') }
let(:env) { env_config(nil) }
after { @tempfile.unlink if @... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/engineyard/config_spec.rb | spec/engineyard/config_spec.rb | require 'spec_helper'
require 'uri'
describe EY::Config do
describe "environments" do
after { File.unlink('ey.yml') if File.exist?('ey.yml') }
it "get loaded from the config file" do
write_yaml({"environments" => {"production" => {"default" => true}}}, 'ey.yml')
expect(EY::Config.new.environment... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/engineyard/cli/api_spec.rb | spec/engineyard/cli/api_spec.rb | require 'spec_helper'
require 'engineyard/cli'
describe EY::CLI::API do
it "gets the api token from ~/.eyrc if possible" do
write_eyrc({"api_token" => "asdf"})
expect(EY::CLI::API.new('http://fake.local', EY::CLI::UI.new).token).to eq("asdf")
clean_eyrc
end
it "uses the token specified token over th... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/rebuild_spec.rb | spec/ey/rebuild_spec.rb | require 'spec_helper'
describe "ey rebuild" do
given "integration"
def command_to_run(opts)
cmd = ["rebuild"]
cmd << "--environment" << opts[:environment] if opts[:environment]
cmd << "--account" << opts[:account] if opts[:account]
cmd
end
def verify_ran(scenario)
expect(@out).to ... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/list_environments_spec.rb | spec/ey/list_environments_spec.rb | require 'spec_helper'
describe "ey environments" do
given "integration"
before { @succeeds_on_multiple_matches = true }
def command_to_run(opts)
cmd = ["environments"]
cmd << "--environment" << opts[:environment] if opts[:environment]
cmd << "--app" << opts[:app] if opts[:app]
... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/status_spec.rb | spec/ey/status_spec.rb | require 'spec_helper'
describe "ey environments" do
given "integration"
before(:all) do
login_scenario "one app, many environments"
end
it "tells you it's never been deployed" do
fast_failing_ey %w[status -e giblets]
expect(@err).to match(/Application rails232app has not been deployed on giblets... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/deploy_spec.rb | spec/ey/deploy_spec.rb | require 'spec_helper'
describe "ey deploy without an eyrc file" do
given "integration"
it "prompts for authentication before continuing" do
api_scenario "one app, one environment"
ey(%w[deploy --no-migrate], :hide_err => true) do |input|
input.puts(scenario_email)
input.puts(scenario_password... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/console_spec.rb | spec/ey/console_spec.rb | require 'spec_helper'
print_my_args_ssh = "#!/bin/sh\necho ssh $*"
shared_examples_for "running ey console" do
given "integration"
def extra_ey_options
{:prepend_to_path => {'ssh' => "#!/bin/sh\necho ssh $*"}}
end
def command_to_run(opts)
cmd = ["console"]
cmd << "--environment" << opts[:environ... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/scp_spec.rb | spec/ey/scp_spec.rb | require 'spec_helper'
shared_examples_for "running ey scp" do
given "integration"
def extra_ey_options
{:prepend_to_path => {'scp' => "#!/bin/sh\necho scp $*"}}
end
end
shared_examples_for "running ey scp for select role" do
given "integration"
def extra_ey_options
{:prepend_to_path => {'scp' => "... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/rollback_spec.rb | spec/ey/rollback_spec.rb | require 'spec_helper'
describe "ey rollback" do
given "integration"
def command_to_run(opts)
cmd = ["rollback"]
cmd << "-e" << opts[:environment] if opts[:environment]
cmd << "-a" << opts[:app] if opts[:app]
cmd << "-c" << opts[:account] if opts[:account]
cmd << "--verbose" ... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/login_spec.rb | spec/ey/login_spec.rb | require 'spec_helper'
describe "ey login" do
given "integration"
context "logged in" do
before do
login_scenario 'empty'
end
it "returns the logged in user name" do
ey %w[login]
expect(@out).to include("User Name (#{scenario_email})")
end
end
context "not logged in" do
... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/servers_spec.rb | spec/ey/servers_spec.rb | require 'spec_helper'
describe "ey servers" do
given "integration"
def command_to_run(opts)
cmd = ["servers"]
cmd << "--environment" << opts[:environment] if opts[:environment]
cmd << "--account" << opts[:account] if opts[:account]
cmd
end
def verify_ran(scenario)
expect(@out).to... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/logout_spec.rb | spec/ey/logout_spec.rb | require 'spec_helper'
describe "ey logout" do
given "integration"
context "logged in" do
before { login_scenario 'empty' }
it "logs you out" do
ey %w[logout]
expect(@out).to include("API token removed: #{ENV['EYRC']}")
expect(@out).to include("Run any other command to login again.")
... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/ssh_spec.rb | spec/ey/ssh_spec.rb | require 'spec_helper'
print_my_args_ssh = "#!/bin/sh\necho ssh $*"
shared_examples_for "running ey ssh" do
given "integration"
def extra_ey_options
ssh_cmd = <<-RUBY
#!#{`which ruby`}
require "rubygems"
require "escape"
puts "ssh \#{Escape.shell_command(ARGV)}"
RUBY
{:prepend_to_path => {'ssh' => ssh... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/timeout_deploy_spec.rb | spec/ey/timeout_deploy_spec.rb | require 'spec_helper'
describe "ey timeout-deploy" do
given "integration"
it "timeouts the last deployment" do
login_scenario "Stuck Deployment"
fast_ey %w[timeout-deploy]
expect(@out).to match(/Marking last deployment failed.../)
expect(@out).to match(/Finished at:\s+\w+/)
end
it "complains ... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/logs_spec.rb | spec/ey/logs_spec.rb | require 'spec_helper'
describe "ey logs" do
given "integration"
it "prints logs returned by awsm" do
login_scenario "one app, one environment"
fast_ey %w[logs -e giblets]
expect(@out).to match(/MAIN LOG OUTPUT/)
expect(@out).to match(/CUSTOM LOG OUTPUT/)
expect(@err).to eq('')
end
it "com... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/init_spec.rb | spec/ey/init_spec.rb | require 'spec_helper'
describe "ey init" do
given "integration"
let(:default_migration_command) { "rake db:migrate --trace" }
before do
login_scenario "one app, one environment"
end
before { clean_ey_yml }
after { clean_ey_yml }
context "with no ey.yml file" do
it "writes the file" do
... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/whoami_spec.rb | spec/ey/whoami_spec.rb | require 'spec_helper'
describe "ey whoami" do
given "integration"
context "logged in" do
before { login_scenario 'empty' }
it "outputs the currently logged in user" do
ey %w[whoami]
expect(@out).to include("User Name (#{scenario_email})")
end
end
context "not logged in" do
it "pro... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/ey_spec.rb | spec/ey/ey_spec.rb | require 'spec_helper'
describe "ey" do
context "run without arguments" do
it "prints usage information" do
expect(ey).to include("Usage:")
end
end
context "run with an argument that is not a command" do
it "tells the user that is not a command" do
ey %w[foobarbaz], :expect_failure => tru... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/recipes/apply_spec.rb | spec/ey/recipes/apply_spec.rb | require 'spec_helper'
describe "ey recipes apply" do
given "integration"
def command_to_run(opts)
cmd = %w[recipes apply]
cmd << "-e" << opts[:environment] if opts[:environment]
cmd << "--account" << opts[:account] if opts[:account]
cmd
end
def verify_ran(scenario)
expect(@out)... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/recipes/upload_spec.rb | spec/ey/recipes/upload_spec.rb | require 'spec_helper'
describe "ey recipes upload" do
given "integration"
use_git_repo('+cookbooks')
def command_to_run(opts)
cmd = %w[recipes upload]
cmd << "--environment" << opts[:environment] if opts[:environment]
cmd << "--account" << opts[:account] if opts[:account]
cmd
end
d... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/recipes/download_spec.rb | spec/ey/recipes/download_spec.rb | require 'spec_helper'
describe "ey recipes download" do
given "integration"
use_git_repo('default')
before(:each) do
FileUtils.rm_rf('cookbooks')
end
after(:each) do
# This test creates + destroys the cookbooks/ directory, thus
# rendering the git repo unsuitable for reuse.
EY.refresh_git_r... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/web/restart_spec.rb | spec/ey/web/restart_spec.rb | require 'spec_helper'
describe "ey web restart" do
given "integration"
def command_to_run(opts)
cmd = %w[web restart]
cmd << "-e" << opts[:environment] if opts[:environment]
cmd << "-a" << opts[:app] if opts[:app]
cmd << "-c" << opts[:account] if opts[:account]
cmd << "--verbose" ... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/web/enable_spec.rb | spec/ey/web/enable_spec.rb | require 'spec_helper'
describe "ey web enable" do
given "integration"
def command_to_run(opts)
cmd = %w[web enable]
cmd << "-e" << opts[:environment] if opts[:environment]
cmd << "-a" << opts[:app] if opts[:app]
cmd << "-c" << opts[:account] if opts[:account]
cmd << "--verbose" ... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/spec/ey/web/disable_spec.rb | spec/ey/web/disable_spec.rb | require 'spec_helper'
describe "ey web disable" do
given "integration"
def command_to_run(opts)
cmd = %w[web disable]
cmd << "-e" << opts[:environment] if opts[:environment]
cmd << "-a" << opts[:app] if opts[:app]
cmd << "-c" << opts[:account] if opts[:account]
cmd << "--verbose" ... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/engineyard.rb | lib/engineyard.rb | module EY
autoload :Repo, 'engineyard/repo'
autoload :Templates, 'engineyard/templates'
end
require 'engineyard-cloud-client'
require 'engineyard/version'
require 'engineyard/error'
require 'engineyard/config'
| ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor.rb | lib/vendor/thor/lib/thor.rb | require 'set'
require 'thor/base'
class Thor
class << self
# Allows for custom "Command" package naming.
#
# === Parameters
# name<String>
# options<Hash>
#
def package_name(name, options={})
@package_name = name.nil? || name == '' ? nil : name
end
# Sets the default comman... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/command.rb | lib/vendor/thor/lib/thor/command.rb | class Thor
class Command < Struct.new(:name, :description, :long_description, :usage, :options)
FILE_REGEXP = /^#{Regexp.escape(File.dirname(__FILE__))}/
def initialize(name, description, long_description, usage, options=nil)
super(name.to_s, description, long_description, usage, options || {})
end... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/actions.rb | lib/vendor/thor/lib/thor/actions.rb | require 'fileutils'
require 'uri'
require 'thor/core_ext/io_binary_read'
require 'thor/actions/create_file'
require 'thor/actions/create_link'
require 'thor/actions/directory'
require 'thor/actions/empty_directory'
require 'thor/actions/file_manipulation'
require 'thor/actions/inject_into_file'
class Thor
module Act... | ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
engineyard/engineyard | https://github.com/engineyard/engineyard/blob/14a6698100e5210692841dacae4457a0127d8a86/lib/vendor/thor/lib/thor/version.rb | lib/vendor/thor/lib/thor/version.rb | class Thor
VERSION = "0.18.1"
end
| ruby | MIT | 14a6698100e5210692841dacae4457a0127d8a86 | 2026-01-04T17:50:07.755432Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.