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 |
|---|---|---|---|---|---|---|---|---|
picatz/shodanz | https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/lib/shodanz.rb | lib/shodanz.rb | # frozen_string_literal: true
require 'json'
require 'async'
require 'console'
require 'async/http/internet'
require 'shodanz/version'
require 'shodanz/errors'
require 'shodanz/api'
require 'shodanz/client'
Console.logger.level = 4
# Shodanz is a modern Ruby gem for Shodan, the world's
# first search engine for Inte... | ruby | MIT | 134eac5265d700efe1b6eec004dc3c25270cbc6c | 2026-01-04T17:51:46.633447Z | false |
picatz/shodanz | https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/lib/shodanz/version.rb | lib/shodanz/version.rb | # frozen_string_literal: true
module Shodanz
VERSION = '2.0.8'
end
| ruby | MIT | 134eac5265d700efe1b6eec004dc3c25270cbc6c | 2026-01-04T17:51:46.633447Z | false |
picatz/shodanz | https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/lib/shodanz/errors.rb | lib/shodanz/errors.rb | # frozen_string_literal: true
module Shodanz
module Errors
class RateLimited < StandardError
def initialize(msg = 'Request rate limit reached (1 request/ second). Please wait a second before trying again and slow down your API calls.')
super
end
end
class NoInformation < StandardErro... | ruby | MIT | 134eac5265d700efe1b6eec004dc3c25270cbc6c | 2026-01-04T17:51:46.633447Z | false |
picatz/shodanz | https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/lib/shodanz/api.rb | lib/shodanz/api.rb | require_relative 'apis/rest.rb'
require_relative 'apis/streaming.rb'
require_relative 'apis/exploits.rb'
module Shodanz
# There are 2 APIs for accessing Shodan: the REST API
# and the Streaming API. The REST API provides methods
# to search Shodan, look up hosts, get summary information
# on queries and a vari... | ruby | MIT | 134eac5265d700efe1b6eec004dc3c25270cbc6c | 2026-01-04T17:51:46.633447Z | false |
picatz/shodanz | https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/lib/shodanz/client.rb | lib/shodanz/client.rb | # frozen_string_literal: true
module Shodanz
# General client container class for all three
# of the available API endpoints in a
# convenient place to use.
#
# @author Kent 'picat' Gruber
class Client
# @return [Shodanz::API::REST]
attr_reader :rest_api
# @return [Shodanz::API::Streaming]
... | ruby | MIT | 134eac5265d700efe1b6eec004dc3c25270cbc6c | 2026-01-04T17:51:46.633447Z | false |
picatz/shodanz | https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/lib/shodanz/apis/rest.rb | lib/shodanz/apis/rest.rb | require_relative 'utils.rb'
# frozen_string_literal: true
module Shodanz
module API
# The REST API provides methods to search Shodan, look up
# hosts, get summary information on queries and a variety
# of other utilities. This requires you to have an API key
# which you can get from Shodan.
#
... | ruby | MIT | 134eac5265d700efe1b6eec004dc3c25270cbc6c | 2026-01-04T17:51:46.633447Z | false |
picatz/shodanz | https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/lib/shodanz/apis/utils.rb | lib/shodanz/apis/utils.rb | # frozen_string_literal: true
require_relative 'utils.rb'
# fronzen_string_literal: true
module Shodanz
module API
# Utils provides simply get, post, and slurp_stream functionality
# to the client. Under the hood they support both async and non-async
# usage. You should basically never need to use thes... | ruby | MIT | 134eac5265d700efe1b6eec004dc3c25270cbc6c | 2026-01-04T17:51:46.633447Z | false |
picatz/shodanz | https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/lib/shodanz/apis/streaming.rb | lib/shodanz/apis/streaming.rb | require_relative 'utils.rb'
# frozen_string_literal: true
module Shodanz
module API
# The REST API provides methods to search Shodan, look up
# hosts, get summary information on queries and a variety
# of other utilities. This requires you to have an API key
# which you can get from Shodan.
#
... | ruby | MIT | 134eac5265d700efe1b6eec004dc3c25270cbc6c | 2026-01-04T17:51:46.633447Z | false |
picatz/shodanz | https://github.com/picatz/shodanz/blob/134eac5265d700efe1b6eec004dc3c25270cbc6c/lib/shodanz/apis/exploits.rb | lib/shodanz/apis/exploits.rb | require_relative 'utils.rb'
# frozen_string_literal: true
module Shodanz
module API
# The Exploits API provides access to several exploit
# and vulnerability data sources. At the moment, it
# searches across the following:
# - Exploit DB
# - Metasploit
# - Common Vulnerabilities and Expos... | ruby | MIT | 134eac5265d700efe1b6eec004dc3c25270cbc6c | 2026-01-04T17:51:46.633447Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/test/test_file_writer.rb | test/test_file_writer.rb | require_relative './helper'
require 'embulk/output/bigquery/file_writer'
require 'fileutils'
require 'zlib'
module Embulk
class Output::Bigquery
class TestFileWriter < Test::Unit::TestCase
class << self
def startup
FileUtils.mkdir_p('tmp')
end
def shutdown
FileU... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/test/test_value_converter_factory.rb | test/test_value_converter_factory.rb | require_relative './helper'
require 'embulk/output/bigquery/value_converter_factory'
module Embulk
class Output::Bigquery
class TestValueConverterFactory < Test::Unit::TestCase
class TestCreateConverters < Test::Unit::TestCase
def test_create_default_converter
schema = Schema.new([
... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/test/test_transaction.rb | test/test_transaction.rb | require_relative './helper'
require 'embulk/output/bigquery'
Bigquery = Embulk::Output::Bigquery unless defined?(Bigquery)
module Embulk
class Output::Bigquery
class TestTransaction < Test::Unit::TestCase
def least_config
DataSource.new({
'project' => 'your_project_name',
... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/test/test_configure.rb | test/test_configure.rb | require_relative './helper'
require 'embulk/output/bigquery'
Bigquery = Embulk::Output::Bigquery unless defined?(Bigquery)
module Embulk
class Output::Bigquery
class TestConfigure < Test::Unit::TestCase
class << self
def startup
FileUtils.mkdir_p('tmp')
end
def shutdown
... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/test/test_helper.rb | test/test_helper.rb | require_relative './helper'
require 'embulk/output/bigquery/helper'
module Embulk
class Output::Bigquery
class TestHelper < Test::Unit::TestCase
class << self
def startup
FileUtils.mkdir_p('tmp')
end
def shutdown
FileUtils.rm_rf('tmp')
end
end
... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/test/test_bigquery_client.rb | test/test_bigquery_client.rb | require_relative './helper'
require 'embulk/output/bigquery/bigquery_client'
require 'csv'
# 1. Prepare example/your-project-000.json
# 2. bunlde exec ruby test/test_bigquery_client.rb
unless File.exist?(JSON_KEYFILE)
puts "#{JSON_KEYFILE} is not found. Skip test/test_bigquery_client.rb"
else
module Embulk
cl... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/test/helper.rb | test/helper.rb | #!/usr/bin/env ruby
require 'bundler/setup'
require 'test/unit'
require 'test/unit/rr'
# Embulk 0.10.x introduced new bootstrap mechanism.
# https://github.com/embulk/embulk/blob/641f35fec064cca7b1a7314d634a4b64ef8637f1/embulk-ruby/test/vanilla/run-test.rb#L8-L13
static_initializer = Java::org.embulk.EmbulkDependency... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/test/test_example.rb | test/test_example.rb | require_relative './helper'
# 1. Prepare example/your-project-000.json
# 2. embulk bundle
# 3. bundle exec ruby test/test_example.rb
unless File.exist?(JSON_KEYFILE)
puts "#{JSON_KEYFILE} is not found. Skip test/test_example.rb"
else
class TestExample < Test::Unit::TestCase
def embulk_path
if File.exist... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/lib/embulk/output/bigquery.rb | lib/embulk/output/bigquery.rb | require 'uri'
require 'json'
require 'tempfile'
require 'fileutils'
require 'securerandom'
require_relative 'bigquery/bigquery_client'
require_relative 'bigquery/gcs_client'
require_relative 'bigquery/file_writer'
require_relative 'bigquery/value_converter_factory'
module Embulk
module Output
class Bigquery < Ou... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/lib/embulk/output/bigquery/google_client.rb | lib/embulk/output/bigquery/google_client.rb | require_relative 'auth'
module Embulk
module Output
class Bigquery < OutputPlugin
class Error < StandardError; end
class JobTimeoutError < Error; end
class NotFoundError < Error; end
class BackendError < Error; end
class InternalError < Error; end
class RateLimitExceeded < Err... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/lib/embulk/output/bigquery/value_converter_factory.rb | lib/embulk/output/bigquery/value_converter_factory.rb | require 'time'
require 'time_with_zone'
require 'json'
require_relative 'helper'
module Embulk
module Output
class Bigquery < OutputPlugin
class ValueConverterFactory
class NotSupportedType < StandardError; end
class TypeCastError < StandardError; end
# ref. https://cloud.google.co... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/lib/embulk/output/bigquery/file_writer.rb | lib/embulk/output/bigquery/file_writer.rb | require 'zlib'
require 'json'
require 'csv'
require_relative 'value_converter_factory'
module Embulk
module Output
class Bigquery < OutputPlugin
class FileWriter
attr_reader :num_rows
def initialize(task, schema, index, converters = nil)
@task = task
@schema = schema
... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/lib/embulk/output/bigquery/gcs_client.rb | lib/embulk/output/bigquery/gcs_client.rb | require 'uri'
require 'java'
require 'google/apis/storage_v1'
require_relative 'google_client'
require_relative 'helper'
# ToDo: Use https://cloud.google.com/storage/docs/streaming if google-api-ruby-client supports streaming transfers
# ToDo: Tests are not written because this implementation will probably entirely ch... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/lib/embulk/output/bigquery/helper.rb | lib/embulk/output/bigquery/helper.rb | require 'digest/md5'
require 'securerandom'
module Embulk
module Output
class Bigquery < OutputPlugin
class Helper
PARTITION_DECORATOR_REGEXP = /\$.+\z/
def self.field_partitioning?(task)
(task['time_partitioning'] || {}).key?('field')
end
def self.has_partition_... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/lib/embulk/output/bigquery/bigquery_client.rb | lib/embulk/output/bigquery/bigquery_client.rb | require 'google/apis/bigquery_v2'
require 'json'
require 'thwait'
require_relative 'google_client'
require_relative 'helper'
module Embulk
module Output
class Bigquery < OutputPlugin
class BigqueryClient < GoogleClient
BIGQUERY_TABLE_OPERATION_INTERVAL = 2 # https://cloud.google.com/bigquery/quotas... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
embulk/embulk-output-bigquery | https://github.com/embulk/embulk-output-bigquery/blob/e4cc3fcbb6a481a71874c357a947b298ceb2bc23/lib/embulk/output/bigquery/auth.rb | lib/embulk/output/bigquery/auth.rb | require 'googleauth'
module Embulk
module Output
class Bigquery < OutputPlugin
class Auth
attr_reader :auth_method, :json_key, :scope
def initialize(task, scope)
@auth_method = task['auth_method']
@json_key = task['json_keyfile']
@scope = scope
end
... | ruby | MIT | e4cc3fcbb6a481a71874c357a947b298ceb2bc23 | 2026-01-04T17:51:46.760044Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/app/controllers/showcase/previews_controller.rb | app/controllers/showcase/previews_controller.rb | class Showcase::PreviewsController < Showcase::EngineController
def show
@preview = Showcase::Path.new(params[:id]).preview_for view_context
end
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/app/controllers/showcase/engine_controller.rb | app/controllers/showcase/engine_controller.rb | class Showcase::EngineController < ActionController::Base
layout "showcase"
helper Showcase::RouteHelper
if defined?(::ApplicationController)
helper all_helpers_from_path ::ApplicationController.helpers_path
end
def index
end
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/app/models/showcase/path.rb | app/models/showcase/path.rb | class Showcase::Path
class Tree < Struct.new(:id, :children, :root)
def initialize(id, children = [])
super(id, children, false)
end
alias_method :root?, :root
delegate :<<, to: :children
cached_partial_path = "showcase/engine/path/tree"
define_method(:to_partial_path) { cached_partial_... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/app/models/showcase/preview.rb | app/models/showcase/preview.rb | class Showcase::Preview
attr_reader :id, :badges, :samples
def initialize(view_context, id:, title: nil)
@view_context, @id = view_context, id
@badges, @samples = [], []
title title
end
# Set a custom title for the Preview. By default, it's automatically inferred from the sidebar title,
# e.g. s... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/app/models/showcase/sample.rb | app/models/showcase/sample.rb | class Showcase::Sample
attr_reader :name, :id, :events, :details
attr_reader :rendered, :source, :instrumented
def initialize(view_context, name, description: nil, id: name.parameterize, syntax: :erb, events: nil, **details)
@view_context = view_context
@name, @id, @syntax, @details = name, id, syntax, d... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/capybara_extensions.rb | test/capybara_extensions.rb | module CapybaraExtensions
end
require "capybara_extensions/assertions"
require "capybara_extensions/filters/data"
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/test_helper.rb | test/test_helper.rb | # Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require_relative "../test/dummy/config/environment"
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)]
# Don't eager load, since that expects Action Mailbox tables to be present in database.
Rails.configuration.eager... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/template_helpers.rb | test/template_helpers.rb | module TemplateHelpers
def setup
super
@temporary_view_path = Pathname.new(Dir.mktmpdir).join("app", "views")
@view_paths = ActionController::Base.view_paths
ActionController::Base.prepend_view_path(@temporary_view_path)
end
def teardown
super
ActionController::Base.view_paths = @view_pa... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/capybara_extensions/assertions.rb | test/capybara_extensions/assertions.rb | module CapybaraExtensions::Assertions
%i[element disclosure link region section table_row].each do |selector|
class_eval <<~RUBY, __FILE__, __LINE__ + 1
def assert_#{selector}(...)
assert_selector(#{selector.inspect}, ...)
end
def assert_no_#{selector}(...)
assert_no_selector(#{... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/capybara_extensions/filters/data.rb | test/capybara_extensions/filters/data.rb | Capybara::Selector.all.each_key do |selector|
Capybara.modify_selector selector do
# Accept a `data: {...}` filter that transforms nested keys in the same
# style as Action View's `tag` builder:
#
# https://edgeapi.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-tag-label-Options
... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/controllers/showcase/previews_controller_test.rb | test/controllers/showcase/previews_controller_test.rb | require "test_helper"
class Showcase::PreviewsControllerTest < Showcase::IntegrationTest
test "#show renders samples and options" do
get preview_path("components/button")
assert_response :ok
within :section, "Samples" do
assert_button "Button content", class: %w[sc-text-xs]
assert_button "Bu... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/controllers/showcase/engine_controller_test.rb | test/controllers/showcase/engine_controller_test.rb | require "test_helper"
class Showcase::EngineControllerTest < Showcase::IntegrationTest
test "#index renders Welcome content" do
get showcase_path
assert_response :ok
assert_title "Showcase"
within :main, "Showcase" do
within :article, "Welcome to Showcase — your UI Pattern Library" do
... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/views/showcase_test.rb | test/views/showcase_test.rb | require "test_helper"
class ShowcaseTest < Showcase::PreviewsTest
test "it has a version number" do
assert Showcase::VERSION
end
test "defines tests reflectively" do
assert_method /\Atest_Showcase/
end
test "defines tests for deeply nested previews" do
assert_method %r{renders_showcase/previews... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/views/showcase/previews/_sample.html.erb_test.rb | test/views/showcase/previews/_sample.html.erb_test.rb | require "test_helper"
module Showcase::Previews
class SamplePartialTest < ActionView::TestCase
test "showcase/previews/sample renders its name and description" do
sample = showcase_sample "A sample" do |partial|
partial.description { "A description" }
end
render "showcase/engine/sample... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/views/showcase/engine/path/_tree.html.erb_test.rb | test/views/showcase/engine/path/_tree.html.erb_test.rb | require "test_helper"
module Showcase::Engine::Path
class TreePartialTest < ActionView::TestCase
setup { view.extend Showcase::Engine.routes.url_helpers }
setup { @old_opens = Showcase.tree_opens }
teardown { Showcase.tree_opens = @old_opens }
test "tree_opens true" do
Showcase.tree_opens ... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/app/jobs/application_job.rb | test/dummy/app/jobs/application_job.rb | class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
# Most jobs are safe to ignore if the underlying records are no longer available
# discard_on ActiveJob::DeserializationError
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/app/helpers/upcase_helper.rb | test/dummy/app/helpers/upcase_helper.rb | module UpcaseHelper
def upcase_string(string)
string.upcase
end
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/app/helpers/application_helper.rb | test/dummy/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/app/controllers/application_controller.rb | test/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/app/models/application_record.rb | test/dummy/app/models/application_record.rb | class ApplicationRecord < ActiveRecord::Base
respond_to?(:primary_abstract_class) ? primary_abstract_class : abstract_class
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/app/mailers/application_mailer.rb | test/dummy/app/mailers/application_mailer.rb | class ApplicationMailer < ActionMailer::Base
default from: "from@example.com"
layout "mailer"
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/app/channels/application_cable/channel.rb | test/dummy/app/channels/application_cable/channel.rb | module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/app/channels/application_cable/connection.rb | test/dummy/app/channels/application_cable/connection.rb | module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/application.rb | test/dummy/config/application.rb | require_relative "boot"
require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
require "showcase"
module Dummy
class Application < Rails::Application
config.load_defaults Rails::VERSION::STRING.to_f
... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/environment.rb | test/dummy/config/environment.rb | # Load the Rails application.
require_relative "application"
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/puma.rb | test/dummy/config/puma.rb | # Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/routes.rb | test/dummy/config/routes.rb | Rails.application.routes.draw do
get "/main_app_root" => redirect("/"), as: :main_app_root
root to: redirect("/docs/showcase")
mount Showcase::Engine, at: "docs/showcase"
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/boot.rb | test/dummy/config/boot.rb | # Set up gems listed in the Gemfile.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/initializers/content_security_policy.rb | test/dummy/config/initializers/content_security_policy.rb | # Be sure to restart your server when you modify this file.
# Define an application-wide content security policy.
# See the Securing Rails Applications Guide for more information:
# https://guides.rubyonrails.org/security.html#content-security-policy-header
# Rails.application.configure do
# config.content_security... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/initializers/filter_parameter_logging.rb | test/dummy/config/initializers/filter_parameter_logging.rb | # Be sure to restart your server when you modify this file.
# Configure parameters to be filtered from the log file. Use this to limit dissemination of
# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
# notations and behaviors.
Rails.application.config.filter_parameters += [
... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/initializers/inflections.rb | test/dummy/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/initializers/permissions_policy.rb | test/dummy/config/initializers/permissions_policy.rb | # Define an application-wide HTTP permissions policy. For further
# information see https://developers.google.com/web/updates/2018/06/feature-policy
#
# Rails.application.config.permissions_policy do |f|
# f.camera :none
# f.gyroscope :none
# f.microphone :none
# f.usb :none
# f.fullscreen :s... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/initializers/assets.rb | test/dummy/config/initializers/assets.rb | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = "1.0"
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/environments/test.rb | test/dummy/config/environments/test.rb | require "active_support/core_ext/integer/time"
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data the... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/environments/development.rb | test/dummy/config/environments/development.rb | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for developme... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/test/dummy/config/environments/production.rb | test/dummy/config/environments/production.rb | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your applica... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/lib/showcase-rails.rb | lib/showcase-rails.rb | require "showcase"
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/lib/showcase.rb | lib/showcase.rb | require_relative "showcase/version"
module Showcase
autoload :PreviewsTest, "showcase/previews_test"
autoload :RouteHelper, "showcase/route_helper"
autoload :Options, "showcase/options"
singleton_class.attr_reader :tree_opens
def self.tree_opens=(opens)
@tree_opens = opens.respond_to?(:call) ? op... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/lib/showcase/version.rb | lib/showcase/version.rb | module Showcase
VERSION = "0.5.0"
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/lib/showcase/options.rb | lib/showcase/options.rb | require "active_support/option_merger"
class Showcase::Options
include Enumerable
def initialize(view_context)
@view_context = view_context
@options = []
@order = [:name, :required, :type, :default, :description]
end
delegate :empty?, to: :@options
# Showcase.options.define :stimulus do
# ... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/lib/showcase/previews_test.rb | lib/showcase/previews_test.rb | class Showcase::PreviewsTest < ActionView::TestCase
setup { view.extend Showcase::EngineController._helpers }
def self.inherited(test_class)
super
test_class.prepare
end
def self.prepare
tree = Showcase::Path.tree
tree.flat_map(&:ordered_paths).each do |path|
test "Showcase: automaticall... | ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/lib/showcase/route_helper.rb | lib/showcase/route_helper.rb | # frozen_string_literal: true
module Showcase::RouteHelper
def method_missing(name, ...)
if name.end_with?("_path", "_url")
main_app.public_send(name, ...)
else
super
end
end
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/lib/showcase/engine.rb | lib/showcase/engine.rb | module Showcase
class Engine < ::Rails::Engine
isolate_namespace Showcase
initializer "showcase.assets" do
config.assets.precompile += %w[showcase_manifest]
end
end
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
bullet-train-co/showcase | https://github.com/bullet-train-co/showcase/blob/9dac8befb1b8ca446b46ae287a922ed4f2d76c6c/config/routes.rb | config/routes.rb | Showcase::Engine.routes.draw do
get "previews/*id", to: "previews#show", as: :preview
root to: "engine#index"
end
| ruby | MIT | 9dac8befb1b8ca446b46ae287a922ed4f2d76c6c | 2026-01-04T17:51:52.951854Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/app_generators/togify/togify_generator.rb | app_generators/togify/togify_generator.rb | require 'tog'
require 'zip/zip'
require 'net/http'
class TogifyGenerator < RubiGen::Base
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
Config::CONFIG['ruby_install_name'])
default_options :author => nil
attr_reader :name
def initialize(runtime_args, runtime_options = {... | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/app_generators/togify/templates/integrate_tog.rb | app_generators/togify/templates/integrate_tog.rb | class <%= migration_name %> < ActiveRecord::Migration
def self.up<% plugins.each do |plugin| %>
migrate_plugin "<%= plugin[:name] %>", <%= plugin[:current_migration] %><%- end %>
end
def self.down<% plugins.reverse.each do |plugin| %>
migrate_plugin "<%= plugin[:name] %>", 0 <%- end %>
end
end
| ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/test/test_tog_plugin_generator.rb | test/test_tog_plugin_generator.rb | require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
class TestTogPluginGenerator < Test::Unit::TestCase
include RubiGen::GeneratorTestHelper
def setup
bare_setup
end
def teardown
bare_teardown
end
# Some generator-related assertions:
# assert_generated_file(name, &block) #... | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/test/test_generator_helper.rb | test/test_generator_helper.rb | begin
require File.dirname(__FILE__) + '/test_helper'
rescue LoadError
require 'test/unit'
end
require 'fileutils'
# Must set before requiring generator libs.
TMP_ROOT = File.dirname(__FILE__) + "/tmp" unless defined?(TMP_ROOT)
PROJECT_NAME = "tog" unless defined?(PROJECT_NAME)
app_root = File.join(TMP_ROOT, PROJE... | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/test/test_tog.rb | test/test_tog.rb | require File.dirname(__FILE__) + '/test_helper.rb'
class TestTog < Test::Unit::TestCase
def setup
end
def test_truth
assert true
end
end
| ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/test/test_helper.rb | test/test_helper.rb | require 'test/unit'
require File.dirname(__FILE__) + '/../lib/tog'
| ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/test/test_rake_tasks.rb | test/test_rake_tasks.rb | require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
require "rake"
class TestRakeTasks < Test::Unit::TestCase
include RubiGen::GeneratorTestHelper
def setup
setup_fake_tog_app
run_generator('togify', [APP_ROOT], sources)
@rake = Rake::Application.new
Rake.application = @rake
... | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/test/test_togify_generator.rb | test/test_togify_generator.rb | require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
class TestTogifyGenerator < Test::Unit::TestCase
include RubiGen::GeneratorTestHelper
def setup
setup_fake_tog_app
end
def teardown
teardown_fake_tog_app
end
def test_generator_without_options
run_generator('togify', [APP_... | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/test/templates/environment.rb | test/templates/environment.rb | RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
config.time_zone = 'UTC'
config.action_controller.session = {
:session_key => '_tog_app_session',
:secret => 'c06f15cbc11cb6b70d45df5f9b527aeb18003879c5527b... | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/test/templates/routes.rb | test/templates/routes.rb | ActionController::Routing::Routes.draw do |map|
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
| ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/generators/tog_plugin/tog_plugin_generator.rb | generators/tog_plugin/tog_plugin_generator.rb | class TogPluginGenerator < RubiGen::Base
default_options :author => nil
attr_reader :name
def initialize(runtime_args, runtime_options = {})
super
usage if args.empty?
@name = args.shift
extract_options
end
def manifest
record do |m|
# Ensure appropriate folder(s) exists
m.... | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/generators/tog_migration/tog_migration_generator.rb | generators/tog_migration/tog_migration_generator.rb | class TogMigrationGenerator < Rails::Generator::NamedBase
def manifest
record do |m|
m.migration_template 'migration.rb', 'db/migrate', :assigns => get_local_assigns
end
end
private
def get_local_assigns
returning(assigns = {}) do
if class_name.underscore =~ /^integrate_(.*... | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/generators/tog_migration/templates/migration.rb | generators/tog_migration/templates/migration.rb | class <%= class_name.underscore.camelize %> < ActiveRecord::Migration
def self.up<% plugins.each do |plugin| %>
migrate_plugin "<%= plugin[:name] %>", <%= plugin[:to_version] %><%- end %>
end
def self.down<% plugins.reverse.each do |plugin| %>
migrate_plugin "<%= plugin[:name] %>", <%= plugin[:from_versi... | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/lib/tog.rb | lib/tog.rb | $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
module Tog
end
require "tog/version" | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/lib/tasks/tog.rb | lib/tasks/tog.rb | # Load tog rakefile extensions
Dir["#{File.dirname(__FILE__)}/*.rake"].each { |ext| load ext } | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/lib/tog/version.rb | lib/tog/version.rb | module Tog
module Version
MAJOR = 0
MINOR = 6
TINY = 0
MODULE = "Europa"
STRING = [MAJOR, MINOR, TINY].join('.')
class << self
def to_s
STRING
end
def full_version
"#{MODULE} #{STRING}"
end
alias :to_str :to_s
end
end
end | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/config/hoe.rb | config/hoe.rb | require 'tog/version'
DEVELOPERS = [
["Aitor García", "aitor@linkingpaths.com"],
["Alberto Molpeceres", "alberto@linkingpaths.com"],
["Roberto Salicio", "roberto@linkingpaths.com"]
]
GEM_NAME = 'tog'
EXTRA_DEPENDENCIES = [
['mislav-will_paginate', '>= 2.3.2'],
['rubigen', '>= 1.3.2'],
['newgem', '>= 1.0.3... | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
tog/tog | https://github.com/tog/tog/blob/4083b176a982d6d8ba36cc0de30e510e149c6520/config/requirements.rb | config/requirements.rb | require 'fileutils'
include FileUtils
require 'rubygems'
%w[rake hoe rubigen].each do |req_gem|
begin
require req_gem
rescue LoadError
puts "This Rakefile requires the '#{req_gem}' RubyGem."
puts "Installation: gem install #{req_gem} -y"
exit
end
end
$:.unshift(File.join(File.dirname(__FILE__), ... | ruby | MIT | 4083b176a982d6d8ba36cc0de30e510e149c6520 | 2026-01-04T17:51:51.420773Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/db_structure.rb | spec/db_structure.rb | require "active_record"
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => "/tmp/factory_bot_instruments_test.db"
)
ActiveRecord::Schema.define do
unless ActiveRecord::Base.connection.tables.include? 'users'
create_table :users do |table|
table.column :name, :string
... | ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/factory_bot_instruments_spec.rb | spec/factory_bot_instruments_spec.rb | require "spec_helper"
RSpec.describe FactoryBotInstruments do
it "has a version number" do
expect(FactoryBotInstruments::VERSION).not_to be_nil
end
describe ".benchmark_report" do
it "keeps the db clean" do
expect { FactoryBotInstruments.benchmark_report }.to_not change { User.count }
end
... | ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/spec_helper.rb | spec/spec_helper.rb | require "bundler/setup"
require "factory_bot_instruments"
require_relative "db_structure"
require_relative "io_helper"
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
end
| ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/io_helper.rb | spec/io_helper.rb | module IOHelper
def self.capture(&block)
begin
$stdout = StringIO.new
yield
result = $stdout.string
ensure
$stdout = STDOUT
end
result
end
end
| ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/factories/users.rb | spec/factories/users.rb | FactoryBot.define do
factory :user do
name { "Peter Parker" }
username { "spiderman" }
end
end
| ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/factories/comments.rb | spec/factories/comments.rb | FactoryBot.define do
factory :comment do
content { "First!" }
user
article
end
end
| ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/factories/articles.rb | spec/factories/articles.rb | FactoryBot.define do
factory :article do
title { "New Article" }
content { "article content" }
user
end
end
| ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/models/article.rb | spec/models/article.rb | class Article < ActiveRecord::Base
belongs_to :user
has_many :comments
end
| ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/models/comment.rb | spec/models/comment.rb | class Comment < ActiveRecord::Base
belongs_to :user
belongs_to :article
end
| ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/models/user.rb | spec/models/user.rb | class User < ActiveRecord::Base
has_many :articles
has_many :comments
end
| ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/lib/factory_bot_instruments/benchmarking_spec.rb | spec/lib/factory_bot_instruments/benchmarking_spec.rb | require "spec_helper"
RSpec.describe FactoryBotInstruments::Benchmarking do
describe ".benchmark_all" do
it "keeps the db clean" do
expect { FactoryBot.benchmark_all }.to_not change { User.count }
end
it "benchmarks all factories" do
benchmarked_factories = FactoryBot.benchmark_all.map(&:fa... | ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/spec/lib/factory_bot_instruments/tracing_spec.rb | spec/lib/factory_bot_instruments/tracing_spec.rb | require "spec_helper"
RSpec.describe FactoryBotInstruments::Tracing do
describe ".trace" do
context "default options" do
before do
@output = IOHelper.capture do
FactoryBot.trace { FactoryBot.create(:comment) }
end
puts @output
@output = FactoryBotInstruments::Tr... | ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
shiroyasha/factory_bot_instruments | https://github.com/shiroyasha/factory_bot_instruments/blob/8306a388288cc13358463f6666ae836c7e1f0218/lib/factory_bot_instruments.rb | lib/factory_bot_instruments.rb | require "factory_bot_instruments/version"
require "factory_bot"
require "active_record"
require_relative "factory_bot_instruments/benchmarking"
require_relative "factory_bot_instruments/tracing"
FactoryBot.extend(FactoryBotInstruments::Benchmarking)
FactoryBot.extend(FactoryBotInstruments::Tracing)
module FactoryBo... | ruby | MIT | 8306a388288cc13358463f6666ae836c7e1f0218 | 2026-01-04T17:51:48.615283Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.