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
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/base.rb
lib/deployinator/base.rb
require "rubygems" require "bundler" Bundler.setup require 'deployinator' $LOAD_PATH.unshift Deployinator.root unless $LOAD_PATH.include? Deployinator.root $LOAD_PATH.unshift Deployinator.root("lib") unless $LOAD_PATH.include? Deployinator.root("lib") require 'deployinator/config' require "socket" require 'pony' r...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/controller.rb
lib/deployinator/controller.rb
require 'deployinator' require 'deployinator/helpers' require 'deployinator/helpers/version' require "deployinator/helpers/plugin" module Deployinator # Public: this class represents the Deploy object with all the properties # the different helper and stack methods need to do the deploy. It is # basically an al...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/config.rb
lib/deployinator/config.rb
require 'deployinator' # Load in the current environment and override settings begin require Deployinator.root(["config", "base"]) require Deployinator.root(["config", Deployinator.env]) rescue LoadError end
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/helpers/stack-tail.rb
lib/deployinator/helpers/stack-tail.rb
module Deployinator module Helpers # Public: helper methods to stack tailer module StackTailHelpers # This is used to make sure the front end javascript loaded matches the # same backend code for the deployinator tailer. Increment this only if # you make protocol changes for the tailer ...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/helpers/version.rb
lib/deployinator/helpers/version.rb
module Deployinator module Helpers module VersionHelpers # Public: wrapper function to get the short SHA of a revision. The function # checks retrieves the part of the string before the first dash. If the part # is a valid default git short rev, i.e. alphanumeric and length 7 it is # retur...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/helpers/view.rb
lib/deployinator/helpers/view.rb
module Deployinator module Helpers module ViewHelpers def username @username end def allowed_to_push_to_prod? true end def groups @groups.join(", ") end def my_url "http://#{@host}" end # TODO: assimilate with plugin ...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/helpers/plugin.rb
lib/deployinator/helpers/plugin.rb
module Deployinator module Helpers module PluginHelpers attr_accessor :plugins @plugins = [] def register_plugins(stack) @plugins = [] global_plugins = Deployinator.global_plugins unless global_plugins.nil? then Deployinator.global_plugins.each do |klass| ...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/helpers/concurrency.rb
lib/deployinator/helpers/concurrency.rb
require 'celluloid' require 'celluloid/autostart' module Deployinator module Helpers module ConcurrencyHelpers extend Celluloid # Hash of future objects that have been instantiated so far @@futures = {} # Public: run block of code in parallel # # Returns Handle to future objec...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/helpers/dsh.rb
lib/deployinator/helpers/dsh.rb
module Deployinator module Helpers module DshHelpers def dsh_fanout @dsh_fanout || 30 end def ignore_failure_command " || test 0 -eq 0" end def group_option_for_dsh(groups) groups = [groups] unless groups.is_a?(Array) groups.map {|group| "-g #{group}...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/helpers/deploy.rb
lib/deployinator/helpers/deploy.rb
module Deployinator module Helpers # Public: helper methods to interact with deploy processes module DeployHelpers # Public: get a list of all currently running deploys # # Returns an array of hashes of the form {:stack => stackname, :stage # => stagename} def get_list...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/helpers/git.rb
lib/deployinator/helpers/git.rb
require 'enumerator' require 'date' module Deployinator module Helpers # Public: module containing helper methods for interacting with git # repositories and extracting information from them. module GitHelpers class AmbiguousRemoteBranchesError < StandardError attr_accessor :requested_bran...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/views/maintenance.rb
lib/deployinator/views/maintenance.rb
module Deployinator::Views class Maintenance < Layout self.template_file = "#{File.dirname(__FILE__)}/../templates/maintenance.mustache" def additional_header_html <<-EOS #{super} <link rel="stylesheet" href="/css/maintenance.css" type="text/css" media="screen"> EOS end de...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/views/deploys_status.rb
lib/deployinator/views/deploys_status.rb
require 'deployinator/helpers/deploy' require 'json' module Deployinator::Views class DeploysStatus < Layout include Deployinator::Helpers::DeployHelpers self.template_file = "#{File.dirname(__FILE__)}/../templates/deploys_status.mustache" def current_deploys ret = [] JSON.parse(get_lis...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/views/index.rb
lib/deployinator/views/index.rb
require 'deployinator/views/layout' module Deployinator::Views class Index < Layout self.template_file = "#{File.dirname(__FILE__)}/../templates/index.mustache" # Public: Gets an array of stacks for use in templating the # index page. # # Retuns an array of non-pinned stacks! def get_other_...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/views/log.rb
lib/deployinator/views/log.rb
module Deployinator::Views class Log < Layout self.template_file = "#{File.dirname(__FILE__)}/../templates/log.mustache" def log_lines @params = @params.inject({}) {|p,(k,v)| p[k.intern] = v; p } puts @params log_to_hash({:no_limit => true}.merge(@params)) end end end
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/views/stack_down.rb
lib/deployinator/views/stack_down.rb
module Deployinator::Views class StackDown < Layout self.template_file = "#{File.dirname(__FILE__)}/../templates/stack_down.mustache" def additional_header_html <<-EOS #{super} <link rel="stylesheet" href="/css/maintenance.css" type="text/css" media="screen"> EOS end def ...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/views/stats.rb
lib/deployinator/views/stats.rb
require 'json' require 'time' module Deployinator::Views class Stats < Layout self.template_file = "#{File.dirname(__FILE__)}/../templates/stats.mustache" @@ignored_stacks = Deployinator.stats_ignored_stacks || [] def deploys @deploys ||= begin log_to_hash({ :no_global => false...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/views/run_logs.rb
lib/deployinator/views/run_logs.rb
module Deployinator::Views class RunLogs < Layout self.template_file = "#{File.dirname(__FILE__)}/../templates/run_logs.mustache" PER_PAGE = 30 # Internal: determines what the next page number is. # # Returns the next page number def next_page page = get_page num_run_logs = get_...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/views/log_table.rb
lib/deployinator/views/log_table.rb
module Deployinator::Views class LogTable < Layout self.template_file = "#{File.dirname(__FILE__)}/../templates/log_table.mustache" def log_lines @params = @params.inject({}) {|p,(k,v)| p[k.intern] = v; p } # this on is called from /log log_to_hash({:no_limit => true, :page => 1}.merge...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/views/layout.rb
lib/deployinator/views/layout.rb
require 'deployinator/helpers/git' require 'deployinator/helpers/stack-tail' require 'mustache/sinatra' require 'deployinator/helpers/version' module Deployinator module Views class Layout < Mustache include Deployinator::Helpers::GitHelpers, Deployinator::Helpers::StackTailHelpers, Deploy...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
etsy/deployinator
https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/plugins/delete_log.rb
lib/deployinator/plugins/delete_log.rb
require 'deployinator/plugin' require 'deployinator/helpers' =begin This plugin enables deploys to optionally delete the log file they just generated. Add the plugin to the stack as you normally would (either globally, or for that stack specifically). And modify the return hash of the deploy method to include a truth...
ruby
MIT
42a863f9377b529b6514ddaceccd69c9b0b9c515
2026-01-04T16:00:19.268213Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/xml_representer_test.rb
test/xml_representer_test.rb
require 'test_helper' require 'roar/decorator' class XMLRepresenterFunctionalTest < MiniTest::Spec class OrderRepresenter < Roar::Decorator include Roar::XML property :id self.representation_wrap = :order end Order = Struct.new(:id, :items) describe "#to_xml" do let (:order) { OrderRepresent...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/json_representer_test.rb
test/json_representer_test.rb
require 'test_helper' require "test_xml/mini_test" require "roar/json" class JsonRepresenterTest < MiniTest::Spec class Order include Roar::JSON property :id property :pending attr_accessor :id, :pending def id=(v) # in ruby 2.2, #id= is not there, all at sudden. what *is* that? @id=v ...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/coercion_feature_test.rb
test/coercion_feature_test.rb
require 'test_helper' require 'roar/coercion' require 'roar/decorator' class CoercionFeatureTest < MiniTest::Spec describe "Coercion" do class SongDecorator < Roar::Decorator include Roar::JSON include Roar::Coercion property :composed_at, type: Types::JSON::DateTime, default: "May 12th, 2012"...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/ssl_client_certs_test.rb
test/ssl_client_certs_test.rb
require 'test_helper' require "roar" require 'roar/transport/net_http/request' require 'roar/transport/net_http' class SslClientCertsTest < MiniTest::Spec describe Roar::Transport::NetHTTP do describe "instance methods" do let(:url) { "http://www.bbc.co.uk" } let(:as) { "application/xml" } ...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/representer_test.rb
test/representer_test.rb
require 'test_helper' class RepresenterTest < MiniTest::Spec describe "Representer" do before do @c = Class.new do include Roar::Representer end end it "aliases #representable_property to #property" do @c.property :title assert_equal "title", @c.representable_attrs.first....
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/test_helper.rb
test/test_helper.rb
# require "pry" require 'minitest/autorun' require 'ostruct' require 'roar/representer' require 'roar/http_verbs' require "roar/json" require "roar/json/hal" require "representable/debug" require "pp" module AttributesConstructor # TODO: remove me. def initialize(attrs={}) attrs.each do |k,v| instance_...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/client_test.rb
test/client_test.rb
require 'test_helper' require 'roar/client' class ClientTest < MiniTest::Spec representer_for([Roar::Representer]) do property :name property :band end let(:song) { Object.new.extend(rpr).extend(Roar::Client) } it "adds accessors" do song.name = "Social Suicide" song.band = "Bad Religion" ...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/hal_json_test.rb
test/hal_json_test.rb
require 'test_helper' require 'roar/json/hal' class HalJsonTest < MiniTest::Spec let(:decorator_class) do Class.new(Roar::Decorator) do include Roar::JSON include Roar::JSON::HAL links :self do [{:lang => "en", :href => "http://en.hit"}, {:lang => "de", :href => "http://de.hit...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/decorator_test.rb
test/decorator_test.rb
require 'test_helper' require 'roar/decorator' class DecoratorTest < MiniTest::Spec class SongRepresentation < Roar::Decorator include Roar::JSON property :name end describe "Decorator" do let (:song) { OpenStruct.new(:name => "Not The Same") } it "exposes ::prepare" do SongRepresentatio...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/hypermedia_test.rb
test/hypermedia_test.rb
require 'test_helper' require 'roar/decorator' class HypermediaTest < MiniTest::Spec describe "inheritance" do class BaseRepresenter < Roar::Decorator include Roar::JSON include Roar::Hypermedia link(:base) { "http://base" } end class Bar < BaseRepresenter link(:bar) { "http://b...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/hypermedia_feature_test.rb
test/hypermedia_feature_test.rb
require 'test_helper' class HypermediaTest < MiniTest::Spec describe "Hypermedia Feature" do let (:song) { Song.new(:title => "Brandy Wine") } before do @bookmarks = Class.new do include AttributesConstructor include Roar::XML include Roar::Hypermedia self.represen...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/lonely_test.rb
test/lonely_test.rb
require 'test_helper' require "roar/json/collection" require "roar/json/hash" class LonelyCollectionTest < MiniTest::Spec it { Roar::JSON::Hash.must_equal Representable::JSON::Hash } end
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/integration/decorator_client_test.rb
test/integration/decorator_client_test.rb
require 'test_helper' require 'integration/runner' require 'roar/decorator' require 'roar/client' class DecoratorClientTest < MiniTest::Spec class Crew attr_accessor :moniker, :company end class CrewDecorator < Roar::Decorator include Roar::JSON include Roar::Hypermedia property :moniker, as: :...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/integration/ssl_server.rb
test/integration/ssl_server.rb
require 'sinatra/base' require 'webrick' require 'webrick/https' require 'openssl' require 'sinatra/multi_route' name = "/C=US/ST=SomeState/L=SomeCity/O=Organization/OU=Unit/CN=localhost" ca = OpenSSL::X509::Name.parse(name) key = OpenSSL::PKey::RSA.new(2048) crt = OpenSSL::X509::Certificate.new crt.version = 2 crt....
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/integration/net_http_transport_test.rb
test/integration/net_http_transport_test.rb
require 'test_helper' require 'integration/runner' require 'roar/transport/net_http' class NetHTTPTransportTest < MiniTest::Spec let(:url) { "http://localhost:4567/method" } let(:body) { "booty" } let(:as) { "application/xml" } let (:transport) { Roar::Transport::NetHTTP.new } it "#get_uri returns response"...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/integration/band_representer.rb
test/integration/band_representer.rb
module Integration module BandRepresenter include Roar::JSON property :name property :label end end
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/integration/runner.rb
test/integration/runner.rb
require "integration/band_representer" require 'sinatra/runner' class ServerRunner < Sinatra::Runner def app_file File.expand_path("../server.rb", __FILE__) end def command "bundle exec ruby #{app_file} -p #{port} -e production" end def ping_path # to be overwritten '/ping' end end class Ssl...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/integration/server.rb
test/integration/server.rb
require "bundler/setup" require "sinatra" require "ostruct" require "roar/json" require "sinatra/multi_route" require File.expand_path("../band_representer.rb", __FILE__) class Band attr_reader :name, :label def name=(value) @name = value.upcase end def label=(value) @label = value.upcase end end ...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/integration/http_verbs_test.rb
test/integration/http_verbs_test.rb
require 'test_helper' require 'integration/runner' require 'roar/http_verbs' require 'roar/json' class HttpVerbsTest < MiniTest::Spec BandRepresenter = Integration::BandRepresenter # keep this class clear of Roar modules. class Band attr_accessor :name, :label def label=(v) # in ruby 2.2, #label= is no...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/integration/json_collection_test.rb
test/integration/json_collection_test.rb
require 'test_helper' require 'roar/json/collection' require 'roar/client' class JsonCollectionTest < MiniTest::Spec class Band < OpenStruct; end class BandRepresenter < Roar::Decorator include Roar::JSON property :name property :label end class BandsRepresenter < Roar::Decorator include Ro...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/test/integration/faraday_http_transport_test.rb
test/integration/faraday_http_transport_test.rb
require 'test_helper' require 'integration/runner' require 'roar/transport/faraday' class FaradayHttpTransportTest < MiniTest::Spec describe 'FaradayHttpTransport' do let(:url) { "http://localhost:4567/method" } let(:body) { "booty" } let(:as) { "application/xml" } before do @transport = Roar::...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/examples/example_server.rb
examples/example_server.rb
#!/usr/bin/env ruby require "bundler/setup" require "sinatra" require "ostruct" require "roar/representer/json" get "/method" do "<method>get</method>" end post "/songs" do '{"id":"1","title":"Roxanne","links":[{"rel":"self","href":"http://localhost/songs/1"}]}' end get "/songs/1" do '{"id":"1","title":"Rox...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/examples/example.rb
examples/example.rb
#!/usr/bin/env ruby require 'bundler' Bundler.setup require 'ostruct' require 'roar/json' def reset_representer(*module_name) module_name.each do |mod| mod.module_eval do @representable_attrs = nil end end end class Song < OpenStruct end module SongRepresenter include Roar::JSON property :t...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar.rb
lib/roar.rb
require 'roar/version' module Roar end require "roar/decorator"
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/version.rb
lib/roar/version.rb
module Roar VERSION = "1.2.0" end
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/representer.rb
lib/roar/representer.rb
require 'representable' module Roar # generic features can be included here and will be available in all format-specific representers. module Representer def self.included(base) super base.send(:include, Representable) end end end
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/http_verbs.rb
lib/roar/http_verbs.rb
require 'roar/transport/net_http' module Roar # Gives HTTP-power to representers. They can serialize, send, process and deserialize HTTP-requests. module HttpVerbs class << self attr_accessor :transport_engine def included(base) base.extend ClassMethods end end self.transpor...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/xml.rb
lib/roar/xml.rb
require 'roar/representer' require 'roar/hypermedia' require 'representable/xml' module Roar # Includes #from_xml and #to_xml into your represented object. # In addition to that, some more options are available when declaring properties. module XML def self.included(base) base.class_eval do inc...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/json.rb
lib/roar/json.rb
require 'roar/representer' require 'roar/hypermedia' require 'representable/json' module Roar module JSON def self.included(base) base.class_eval do include Representer include Representable::JSON extend ClassMethods include InstanceMethods # otherwise Representable overrid...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/hypermedia.rb
lib/roar/hypermedia.rb
module Roar # Define hypermedia links in your representations. # # Example: # # class Order # include Roar:JSON # # property :id # # link :self do # "http://orders/#{id}" # end # # If you want more attributes, just pass a hash to #link. # # link :rel => :next,...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/decorator.rb
lib/roar/decorator.rb
require 'roar/representer' require 'representable/decorator' class Roar::Decorator < Representable::Decorator module HypermediaConsumer def links=(arr) super represented.instance_variable_set :@links, self.links end end end
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/client.rb
lib/roar/client.rb
require "roar/http_verbs" module Roar # Mix in HttpVerbs. module Client include HttpVerbs # Add accessors for properties and collections to modules. def self.extended(base) base.instance_eval do representable_attrs.each do |attr| name = attr.name next if name == "lin...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/coercion.rb
lib/roar/coercion.rb
gem "dry-types", ">= 1.0.0" require "dry-types" require "representable/coercion" module Roar Types = Representable::Coercion::Types # Use the +:type+ option to specify the conversion type. # class ImmigrantSong # include Roar::JSON # include Roar::Coercion # # property :composed_at, :type => DateT...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/json/collection.rb
lib/roar/json/collection.rb
require 'roar/json' module Roar::JSON module Collection include Roar::JSON def self.included(base) base.send :include, Representable::Hash::Collection end end end
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/json/hal.rb
lib/roar/json/hal.rb
require "roar/json" require "representable/json/collection" require "representable/json/hash" module Roar module JSON # Including the JSON::HAL module in your representer will render and parse documents # following the HAL specification: http://stateless.co/hal_specification.html # Links will be embedded...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/json/hash.rb
lib/roar/json/hash.rb
require "representable/json/hash" Roar::JSON::Hash = Representable::JSON::Hash
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/transport/faraday.rb
lib/roar/transport/faraday.rb
gem 'faraday' require 'faraday' module Roar module Transport # Advanced implementation of the HTTP verbs with the Faraday HTTP library # (which can, in turn, use adapters based on Net::HTTP or libcurl) # # Depending on how the Faraday middleware stack is configured, this # Transport can support f...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/transport/net_http.rb
lib/roar/transport/net_http.rb
require 'roar/transport/net_http/request' module Roar # Implements the (HTTP) transport interface with Net::HTTP. module Transport # Low-level interface for HTTP. The #get_uri and friends accept an options and an optional block, invoke # the HTTP request and return the request object. # # The follo...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
trailblazer/roar
https://github.com/trailblazer/roar/blob/365b28be85b61c43181f2868cb8f452f5945b4cf/lib/roar/transport/net_http/request.rb
lib/roar/transport/net_http/request.rb
require "net/http" require "openssl" module Roar module Transport class NetHTTP class Request # TODO: implement me. def initialize(options) @uri = parse_uri(options[:uri]) # TODO: add :uri. @as = options[:as] @body = options[:body] @options = opti...
ruby
MIT
365b28be85b61c43181f2868cb8f452f5945b4cf
2026-01-04T16:00:32.019688Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/test_helper.rb
test/test_helper.rb
ENV['DEBUG'] = 'true' require 'rubygems' require 'bundler/setup' require 'pathname' require 'test/unit' JRUBY = defined?(JRUBY_VERSION) if ENV['JSON_LIBRARY'] puts "Using '#{ENV['JSON_LIBRARY']}' JSON library" require ENV['JSON_LIBRARY'] elsif JRUBY require 'json' else require 'yajl/json_gem' end if JRUBY ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/index_aliases_test.rb
test/integration/index_aliases_test.rb
require 'test_helper' require 'active_support/core_ext/numeric' require 'active_support/core_ext/date/calculations' module Tire class IndexAliasesIntegrationTest < Test::Unit::TestCase include Test::Integration context "With a filtered alias" do setup do @index = Tire.index 'index-original'...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/persistent_model_test.rb
test/integration/persistent_model_test.rb
require 'test_helper' module Tire class PersistentModelIntegrationTest < Test::Unit::TestCase include Test::Integration def setup super PersistentArticle.create_elasticsearch_index PersistentArticleWithDefaults.create_elasticsearch_index PersistentArticleWithStrictMapping.create_ela...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/bulk_test.rb
test/integration/bulk_test.rb
require 'test_helper' module Tire class BulkIntegrationTest < Test::Unit::TestCase include Test::Integration context "Bulk" do setup do @index = Tire.index('bulk-test') { delete; create } @articles = [ { id: '1', type: 'article', title: 'one', tags: ['ruby'] }...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/custom_score_queries_test.rb
test/integration/custom_score_queries_test.rb
require 'test_helper' module Tire class CustomScoreQueriesIntegrationTest < Test::Unit::TestCase include Test::Integration context "Custom score queries" do should "allow to define custom score queries (base score on field value)" do s = Tire.search('articles-test') do query do ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/dsl_search_test.rb
test/integration/dsl_search_test.rb
require 'test_helper' module Tire class DSLSearchIntegrationTest < Test::Unit::TestCase include Test::Integration context "DSL" do should "allow passing search payload as a Hash" do s = Tire.search 'articles-test', :query => { :query_string => { :query => 'ruby' } }, ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/index_update_document_test.rb
test/integration/index_update_document_test.rb
require 'test_helper' module Tire class IndexUpdateDocumentIntegrationTest < Test::Unit::TestCase include Test::Integration context "Updating a document" do setup do Tire.index 'articles-with-tags' do delete create store :type => 'article', :id => 1, :title => ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/index_mapping_test.rb
test/integration/index_mapping_test.rb
require 'test_helper' module Tire class IndexMappingIntegrationTest < Test::Unit::TestCase include Test::Integration context "Default mapping" do teardown { Tire.index('mapped-index').delete; sleep 0.1 } should "create and return the default mapping as a Hash" do index = Tire.index 'm...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/reindex_test.rb
test/integration/reindex_test.rb
require 'test_helper' module Tire class ReindexIntegrationTest < Test::Unit::TestCase include Test::Integration context "Reindex" do setup do Tire.index('reindex-test-new').delete documents = (1..100).map { |i| { id: i, type: 'test', title: "Document #{i}" } } Tire.index 're...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/dis_max_queries_test.rb
test/integration/dis_max_queries_test.rb
require 'test_helper' module Tire class DisMaxQueriesIntegrationTest < Test::Unit::TestCase include Test::Integration context "Dis Max queries" do setup do Tire.index 'dis_max_test' do delete create store title: "It's an Albino, Albino, Albino thing!", text: "Al...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/sort_test.rb
test/integration/sort_test.rb
require 'test_helper' module Tire class SortIntegrationTest < Test::Unit::TestCase include Test::Integration context "Sort" do should "sort by title" do q = '*' s = Tire.search('articles-test') do query { string q } sort { by :title } end assert_...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/highlight_test.rb
test/integration/highlight_test.rb
require 'test_helper' module Tire class HighlightIntegrationTest < Test::Unit::TestCase include Test::Integration context "Highlight" do teardown { Tire.index('highlight-test').delete } should "add 'highlight' field to the result item" do # Tire::Configuration.logger STDERR, :level => ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/results_test.rb
test/integration/results_test.rb
require 'test_helper' module Tire class ResultsIntegrationTest < Test::Unit::TestCase include Test::Integration context "Query results" do should "allow easy access to returned documents" do q = 'title:one' s = Tire.search('articles-test') { query { string q } } assert_equal...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/boosting_queries_test.rb
test/integration/boosting_queries_test.rb
require 'test_helper' module Tire class BoostingQueriesIntegrationTest < Test::Unit::TestCase include Test::Integration context "Boosting queries" do should "allow to set multiple queries per condition" do s = Tire.search('articles-test', search_type: 'dfs_query_then_fetch') do que...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/index_store_test.rb
test/integration/index_store_test.rb
require 'test_helper' module Tire class IndexStoreIntegrationTest < Test::Unit::TestCase include Test::Integration context "Storing the documents in index" do setup do Tire.index 'articles-test-ids' do delete create store :id => 1, :title => 'One' sto...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/active_model_searchable_test.rb
test/integration/active_model_searchable_test.rb
require 'test_helper' require File.expand_path('../../models/supermodel_article', __FILE__) module Tire class ActiveModelSearchableIntegrationTest < Test::Unit::TestCase include Test::Integration def setup super Redis::Persistence.config.redis = Redis.new db: ENV['REDIS_PERSISTENCE_TEST_DATABAS...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/percolator_test.rb
test/integration/percolator_test.rb
require 'test_helper' module Tire class PercolatorIntegrationTest < Test::Unit::TestCase include Test::Integration context "Percolator" do setup do delete_registered_queries delete_percolator_index @index = Tire.index('percolator-test') @index.create end te...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/search_response_test.rb
test/integration/search_response_test.rb
require 'test_helper' #require File.expand_path('../../models/supermodel_article', __FILE__) module Tire class SearchResponseIntegrationTest < Test::Unit::TestCase include Test::Integration class ::ActiveModelArticleWithTitle < ActiveModelArticleWithCallbacks mapping do indexes :title, ty...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/boolean_queries_test.rb
test/integration/boolean_queries_test.rb
require 'test_helper' module Tire class BooleanQueriesIntegrationTest < Test::Unit::TestCase include Test::Integration context "Boolean queries" do should "allow to set multiple queries per condition" do s = Tire.search('articles-test') do query do boolean do ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/explanation_test.rb
test/integration/explanation_test.rb
require 'test_helper' module Tire class ExplanationIntegrationTest < Test::Unit::TestCase include Test::Integration context "Explanation" do teardown { Tire.index('explanation-test').delete } setup do content = "A Fox one day fell into a deep well and could find no means of escape." ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/custom_filters_score_queries_test.rb
test/integration/custom_filters_score_queries_test.rb
require 'test_helper' module Tire class CustomFiltersScoreQueriesIntegrationTest < Test::Unit::TestCase include Test::Integration context "Custom filters score queries" do should "score the document based on a matching filter" do s = Tire.search('articles-test') do query do ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/script_fields_test.rb
test/integration/script_fields_test.rb
require 'test_helper' module Tire class ScriptFieldsIntegrationTest < Test::Unit::TestCase include Test::Integration context "ScriptFields" do should "add multiple fields to the results" do # 1.json > title: "One", words: 125 s = Tire.search('articles-test') do query { str...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/count_test.rb
test/integration/count_test.rb
require 'test_helper' module Tire class CountIntegrationTest < Test::Unit::TestCase include Test::Integration context "Count with search type" do should "return total number of hits for the query, but no hits" do s = Tire.search 'articles-test', :search_type => 'count' do query { t...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/constant_score_queries_test.rb
test/integration/constant_score_queries_test.rb
require 'test_helper' module Tire class ConstantScoreQueriesIntegrationTest < Test::Unit::TestCase include Test::Integration context "Constant score queries" do should "return the same score for all results" do s = Tire.search('articles-test') do query do constant_score ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/filtered_queries_test.rb
test/integration/filtered_queries_test.rb
require 'test_helper' module Tire class FilteredQueriesIntegrationTest < Test::Unit::TestCase include Test::Integration context "Filtered queries" do should "restrict the results with a filter" do # 2.json > Begins with "T" and is tagged "ruby" s = Tire.search('articles-test') do ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/mongoid_searchable_test.rb
test/integration/mongoid_searchable_test.rb
require 'test_helper' require File.expand_path('../../models/mongoid_models', __FILE__) begin require "mongo" Mongo::Connection.new("localhost", 27017) ENV["MONGODB_IS_AVAILABLE"] = 'true' rescue Mongo::ConnectionFailure => e ENV["MONGODB_IS_AVAILABLE"] = nil end if ENV["MONGODB_IS_AVAILABLE"] module Tire ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/facets_test.rb
test/integration/facets_test.rb
require 'test_helper' require 'date' module Tire class FacetsIntegrationTest < Test::Unit::TestCase include Test::Integration context "Facets" do should "return results scoped to current query" do q = 'tags:ruby' s = Tire.search('articles-test') do query { string q } ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/filters_test.rb
test/integration/filters_test.rb
require 'test_helper' module Tire class FiltersIntegrationTest < Test::Unit::TestCase include Test::Integration context "Filters" do should "filter the results" do # 2.json > Begins with "T" and is tagged "ruby" s = Tire.search('articles-test') do query { string 'title:T*'...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/query_return_version_test.rb
test/integration/query_return_version_test.rb
require 'test_helper' module Tire class DslVersionIntegrationTest < Test::Unit::TestCase include Test::Integration context "DSL Version" do setup do Tire.index 'articles-test-ids' do delete create store :id => 1, :title => 'One' store :id => 2, :title...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/range_queries_test.rb
test/integration/range_queries_test.rb
require 'test_helper' module Tire class RangeQueriesIntegrationTest < Test::Unit::TestCase include Test::Integration context "Range queries" do should "allow simple range queries" do s = Tire.search('articles-test') do query do range :words, { :gte => 250 } en...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/match_query_test.rb
test/integration/match_query_test.rb
require 'test_helper' module Tire class MatchQueryIntegrationTest < Test::Unit::TestCase include Test::Integration context "Match query" do setup do Tire.index 'match-query-test' do delete create settings: { index: { number_of_shards: 1, number_of_replicas: 0 } }, ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/query_string_test.rb
test/integration/query_string_test.rb
require 'test_helper' module Tire class QueryStringIntegrationTest < Test::Unit::TestCase include Test::Integration context "Searching for query string" do should "find article by title" do q = 'title:one' assert_equal 1, string_query(q).results.count assert_equal 'One', stri...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/prefix_query_test.rb
test/integration/prefix_query_test.rb
require 'test_helper' module Tire class PrefixQueryTest < Test::Unit::TestCase include Test::Integration context "Prefix queries" do should "search by a prefix" do s = Tire.search('articles-test') do query do # "on" => "One" prefix :title, "on" end...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/suggest_test.rb
test/integration/suggest_test.rb
require 'test_helper' module Tire class SuggestIntegrationTest < Test::Unit::TestCase include Test::Integration context 'Search Suggest' do should 'add suggestions field to the results using the term suggester' do # Tire::Configuration.logger STDERR, :level => 'debug' s = Tire.search...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/active_record_searchable_test.rb
test/integration/active_record_searchable_test.rb
require 'test_helper' module Tire class ActiveRecordSearchableIntegrationTest < Test::Unit::TestCase include Test::Integration def setup super ActiveRecord::Base.establish_connection( :adapter => 'sqlite3', :database => ":memory:" ) ActiveRecord::Migration.verbose = false ActiveRec...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/active_model_indexing_test.rb
test/integration/active_model_indexing_test.rb
require 'test_helper' require File.expand_path('../../models/supermodel_article', __FILE__) module Tire class ActiveModelSearchableIntegrationTest < Test::Unit::TestCase include Test::Integration class ::ActiveModelArticleWithCustomAsSerialization < ActiveModelArticleWithCallbacks mapping do ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/nested_query_test.rb
test/integration/nested_query_test.rb
require 'test_helper' module Tire class NestedQueryTest < Test::Unit::TestCase include Test::Integration context 'Nested queries' do setup do @index = Tire.index('products-test') do delete create mappings: { product: { properties:...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/multi_search_test.rb
test/integration/multi_search_test.rb
require 'test_helper' module Tire class MultiSearchIntegrationTest < Test::Unit::TestCase include Test::Integration context "Multi search" do # Tire.configure { logger STDERR } setup do Tire.index 'multi-search-test-1' do delete create store first_name: 'Jo...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/fuzzy_queries_test.rb
test/integration/fuzzy_queries_test.rb
require 'test_helper' module Tire class FuzzyQueryIntegrationTest < Test::Unit::TestCase include Test::Integration context "Fuzzy query" do should "fuzzily find article by tag" do results = Tire.search('articles-test') { query { fuzzy :tags, 'irlang' } }.results assert_equal 1, ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false
karmi/retire
https://github.com/karmi/retire/blob/1016449cd5bcfd52853f1728452e26962c18790e/test/integration/delete_by_query_test.rb
test/integration/delete_by_query_test.rb
require 'test_helper' module Tire class DeleteByQueryIntegrationTest < Test::Unit::TestCase include Test::Integration should "delete documents matching a query" do assert_python_size(1) delete_by_query assert_python_size(0) end should "leave documents not matching a query" do ...
ruby
MIT
1016449cd5bcfd52853f1728452e26962c18790e
2026-01-04T16:00:24.294681Z
false