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 |
|---|---|---|---|---|---|---|---|---|
Shopify/paquito | https://github.com/Shopify/paquito/blob/e462641cf1c8b3554f8749b86c387729fce2cfc4/lib/paquito/translate_errors.rb | lib/paquito/translate_errors.rb | # frozen_string_literal: true
module Paquito
class TranslateErrors
def initialize(coder)
@coder = Paquito.cast(coder)
end
def dump(object)
@coder.dump(object)
rescue Paquito::Error
raise
rescue => error
raise PackError, error.message
end
def load(payload)
@... | ruby | MIT | e462641cf1c8b3554f8749b86c387729fce2cfc4 | 2026-01-04T17:57:28.878221Z | false |
Shopify/paquito | https://github.com/Shopify/paquito/blob/e462641cf1c8b3554f8749b86c387729fce2cfc4/lib/paquito/compressor.rb | lib/paquito/compressor.rb | # frozen_string_literal: true
module Paquito
class Compressor
def initialize(compressor)
@compressor = compressor
end
def dump(serial)
@compressor.compress(serial)
end
def load(payload)
@compressor.decompress(payload)
end
end
end
| ruby | MIT | e462641cf1c8b3554f8749b86c387729fce2cfc4 | 2026-01-04T17:57:28.878221Z | false |
Shopify/paquito | https://github.com/Shopify/paquito/blob/e462641cf1c8b3554f8749b86c387729fce2cfc4/lib/paquito/types/active_record_packer.rb | lib/paquito/types/active_record_packer.rb | # frozen_string_literal: true
require "paquito/errors"
require "paquito/active_record_coder"
module Paquito
module Types
class ActiveRecordPacker
factory = MessagePack::Factory.new
# These are the types available when packing/unpacking ActiveRecord::Base instances.
Types.register(factory, [Sym... | ruby | MIT | e462641cf1c8b3554f8749b86c387729fce2cfc4 | 2026-01-04T17:57:28.878221Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/rails_helper.rb | spec/rails_helper.rb | require 'spec_helper'
# Load rails and the entire gem
require 'rails/all'
require 'rspec/rails'
require 'progressive_render'
# Debugging doesn't have to be hard
require 'pry-byebug'
# Set the application into the test enviornment
ENV['RAILS_ENV'] = 'test'
# Load the dummy rails app
require File.expand_path('../dumm... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/progressive_render_spec.rb | spec/progressive_render_spec.rb | require 'rails_helper'
describe ProgressiveRender do
it 'has a version number' do
expect(ProgressiveRender::VERSION).not_to be nil
end
end
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/controller_request_spec.rb | spec/controller_request_spec.rb | require 'rails_helper'
def load_test_endpoint(endpoint, name: "Testing #{endpoint}", sections: [], assert_preloaded: nil, assert_loaded: nil)
describe name do
it 'renders the placeholder and can resolve the real partial' do
get endpoint
expect(response.body).to include('progressive-render-placeholder... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/mock_rails_app.rb | spec/mock_rails_app.rb | require 'action_controller/railtie'
module MockRailsApp
class Application < Rails::Application
config.secret_token = '2442e998905e6cdad842eb483e64641a'
end
class ApplicationController < ActionController::Base
end
end
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/spec_helper.rb | spec/spec_helper.rb | #
# spec_helper: base for testing suite. Should be kept
# as light weight as possible. Use rails_helper for
# specs that require the kitchen sink.
#
require 'simplecov'
SimpleCov.start
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'rspec'
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/app/helpers/load_test_helper.rb | spec/dummy/app/helpers/load_test_helper.rb | module LoadTestHelper
end
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/app/helpers/application_helper.rb | spec/dummy/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/app/controllers/load_test_controller.rb | spec/dummy/app/controllers/load_test_controller.rb | class LoadTestController < ApplicationController
def example; end
def index; end
def block; end
def multiple_blocks; end
def custom_placeholder; end
def render_params
render layout: 'custom_layout'
end
def deprecated_explicit_call
progressive_render
end
def deprecated_explicit_call_wi... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/app/controllers/application_controller.rb | spec/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/db/seeds.rb | spec/dummy/db/seeds.rb | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/test/test_helper.rb | spec/dummy/test/test_helper.rb | ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
module ActiveSupport
class TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
# Add more helper methods to be used by all tests here..... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/test/controllers/load_test_controller_test.rb | spec/dummy/test/controllers/load_test_controller_test.rb | require 'test_helper'
class LoadTestControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/application.rb | spec/dummy/config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Dummy
class Application < Rails::Application
end
end
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/environment.rb | spec/dummy/config/environment.rb | # Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/routes.rb | spec/dummy/config/routes.rb | Rails.application.routes.draw do
root 'load_test#index'
scope '/load_test' do
%w[block multiple_blocks custom_placeholder example render_params
deprecated_explicit_call deprecated_explicit_call_with_template
atom_repro].each do |endpoint|
get endpoint => "load_test##{endpoint}", as: "load_t... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/boot.rb | spec/dummy/config/boot.rb | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/initializers/filter_parameter_logging.rb | spec/dummy/config/initializers/filter_parameter_logging.rb | # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/initializers/session_store.rb | spec/dummy/config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_test_pl_session'
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/initializers/wrap_parameters.rb | spec/dummy/config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters f... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/initializers/inflections.rb | spec/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 | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/initializers/cookies_serializer.rb | spec/dummy/config/initializers/cookies_serializer.rb | # Be sure to restart your server when you modify this file.
Rails.application.config.action_dispatch.cookies_serializer = :json
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/initializers/assets.rb | spec/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 | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/initializers/backtrace_silencers.rb | spec/dummy/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/initializers/mime_types.rb | spec/dummy/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/environments/test.rb | spec/dummy/config/environments/test.rb | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# 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 suit... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/environments/development.rb | spec/dummy/config/environments/development.rb | 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 on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/dummy/config/environments/production.rb | spec/dummy/config/environments/production.rb | 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 application in memory, allowing both threaded web serve... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/lib/fragment_name_iterator_spec.rb | spec/lib/fragment_name_iterator_spec.rb | require 'spec_helper'
require 'progressive_render/fragment_name_iterator'
describe ProgressiveRender::FragmentNameIterator do
let(:iter) { ProgressiveRender::FragmentNameIterator.new }
it 'produces new values' do
expect(iter.next!).to_not be iter.next!
end
describe 'with multiple iterators' do
let(:i... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/lib/rack/request_handler_spec.rb | spec/lib/rack/request_handler_spec.rb | require 'progressive_render/rack/request_handler'
FRAGMENT_KEY = ProgressiveRender::Rack::RequestHandler::FRAGMENT_KEY
describe ProgressiveRender::Rack::RequestHandler do
it 'can parse the main load' do
req = double
allow(req).to receive(:GET).and_return({})
allow(req).to receive(:path).and_return('/foo... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/lib/rails/view_renderer_spec.rb | spec/lib/rails/view_renderer_spec.rb | require 'spec_helper'
require 'progressive_render/rails/view_renderer'
describe ProgressiveRender::Rails::ViewRenderer do
specify '#render_partial' do
context = double
allow(context).to receive(:render).and_return(true)
vr = ProgressiveRender::Rails::ViewRenderer.new(context)
expect(vr.render_partia... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/spec/lib/rails/path_resolver_spec.rb | spec/lib/rails/path_resolver_spec.rb | require 'progressive_render/rails/path_resolver'
describe ProgressiveRender::Rails::PathResolver do
describe 'with an empty template context' do
it 'throws when resolving paths' do
pr = ProgressiveRender::Rails::PathResolver.new(nil)
expect { pr.path_for }.to raise_error(ProgressiveRender::Rails::Pat... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render.rb | lib/progressive_render.rb | require 'progressive_render/rack'
require 'progressive_render/fragment_name_iterator'
# Root namespace for the gem
module ProgressiveRender
if defined?(::Rails) && Gem::Requirement.new('>= 3.1').satisfied_by?(Gem::Version.new(::Rails.version))
require 'progressive_render/rails'
else
logger.warn 'progressi... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render/version.rb | lib/progressive_render/version.rb | module ProgressiveRender
VERSION = '0.7.0'.freeze
end
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render/rails.rb | lib/progressive_render/rails.rb | require 'progressive_render/rails/path_resolver'
require 'progressive_render/rails/view_renderer'
require 'progressive_render/rails/engine'
require 'progressive_render/rails/helpers'
require 'progressive_render/rails/view'
require 'progressive_render/rails/controller'
module ProgressiveRender
# Rails specific funct... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render/rack.rb | lib/progressive_render/rack.rb | require 'progressive_render/rack/request_handler'
module ProgressiveRender
# Rack specific functionality
module Rack
end
end
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render/fragment_name_iterator.rb | lib/progressive_render/fragment_name_iterator.rb | module ProgressiveRender
# Generates a prefix for a given progressive_render section in a stable manner.
# This way on each load we assign the outer most progressive_render block with
# the same name. Nested progressive_render blocks are not supported, this approach
# may need to be re-evaluated for that use ca... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render/rack/request_handler.rb | lib/progressive_render/rack/request_handler.rb | require 'uri'
require 'rack/utils'
module ProgressiveRender
module Rack
# Wraps a given rack request to determine what sort of request we're dealing with
# and what specific fragment the request is for when it's a progressive request.
class RequestHandler
FRAGMENT_KEY = 'load_partial'.freeze
... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render/rails/view.rb | lib/progressive_render/rails/view.rb | require 'progressive_render/rails/helpers'
module ProgressiveRender
module Rails
# Provides methods for application view
module View
include Helpers
# Mark a section of content to be loaded after initial view of the page.
#
# == Usage
# <%= progressive_render do %>
# ... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render/rails/path_resolver.rb | lib/progressive_render/rails/path_resolver.rb | module ProgressiveRender
module Rails
# Resolve set of request parameters to a full path to a template file
class PathResolver
# Holds the request parameters.
# Used to decouple the ProgressiveRequest from the renderer.
class TemplateContext
attr_accessor :controller, :action, :type
... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render/rails/helpers.rb | lib/progressive_render/rails/helpers.rb | module ProgressiveRender
module Rails
# Shortcuts to object creation used in the view and controller
module Helpers
def progressive_request
@rh ||= Rack::RequestHandler.new(request)
end
def progressive_renderer
Rails::ViewRenderer.new(self)
end
end
end
end
| ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render/rails/controller.rb | lib/progressive_render/rails/controller.rb | require 'progressive_render/rails/helpers'
module ProgressiveRender
module Rails
# Rails controller methods, this module is installed into ActionController
# These methods should not generally be called by user code besides 'render'
module Controller
include Helpers
def progressive_render(te... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render/rails/engine.rb | lib/progressive_render/rails/engine.rb | module ProgressiveRender
module Rails
# Rails uses this class to install progressive_render into an application
# It is responsible for any setup needed for the gem to function
class Engine < ::Rails::Engine
initializer 'progressive_render.assets.precompile' do |app|
app.config.assets.precom... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
johnsonj/progressive_render | https://github.com/johnsonj/progressive_render/blob/3cf39fe16485e2fd2e21b50120c4f2cb50df8508/lib/progressive_render/rails/view_renderer.rb | lib/progressive_render/rails/view_renderer.rb | require 'nokogiri'
module ProgressiveRender
module Rails
# Responsible for rendering a full page and extracting fragments for a progressive render.
class ViewRenderer
attr_accessor :context
def initialize(view_context)
self.context = view_context
end
def render_partial(path)
... | ruby | MIT | 3cf39fe16485e2fd2e21b50120c4f2cb50df8508 | 2026-01-04T17:57:27.022277Z | false |
czycha/pxlsrt | https://github.com/czycha/pxlsrt/blob/f65880032f441887d77ddfbe5ebb0760edc96e1c/lib/pxlsrt.rb | lib/pxlsrt.rb | require 'pxlsrt/version'
require 'pxlsrt/helpers'
require 'pxlsrt/lines'
require 'pxlsrt/image'
require 'pxlsrt/colors'
require 'pxlsrt/brute'
require 'pxlsrt/smart'
require 'pxlsrt/kim'
require 'pxlsrt/spiral'
require 'pxlsrt/seed'
| ruby | MIT | f65880032f441887d77ddfbe5ebb0760edc96e1c | 2026-01-04T17:57:31.647579Z | false |
czycha/pxlsrt | https://github.com/czycha/pxlsrt/blob/f65880032f441887d77ddfbe5ebb0760edc96e1c/lib/pxlsrt/lines.rb | lib/pxlsrt/lines.rb | module Pxlsrt
##
# "Line" operations used on arrays f colors.
class Lines
##
# ChunkyPNG's rotation was a little slow and doubled runtime.
# This "rotates" an array, based on the width and height.
# It uses math and it's really cool, trust me.
def self.rotateImage(what, width, height, a)
... | ruby | MIT | f65880032f441887d77ddfbe5ebb0760edc96e1c | 2026-01-04T17:57:31.647579Z | false |
czycha/pxlsrt | https://github.com/czycha/pxlsrt/blob/f65880032f441887d77ddfbe5ebb0760edc96e1c/lib/pxlsrt/version.rb | lib/pxlsrt/version.rb | ##
# The main module, your best friend.
module Pxlsrt
VERSION = '1.8.2'.freeze
end
| ruby | MIT | f65880032f441887d77ddfbe5ebb0760edc96e1c | 2026-01-04T17:57:31.647579Z | false |
czycha/pxlsrt | https://github.com/czycha/pxlsrt/blob/f65880032f441887d77ddfbe5ebb0760edc96e1c/lib/pxlsrt/seed.rb | lib/pxlsrt/seed.rb | require 'oily_png'
module Pxlsrt
##
# Plant seeds, have them spiral out and sort.
class Seed
##
# Uses Pxlsrt::Seed.seed to input and output from one method.
def self.suite(inputFileName, outputFileName, o = {})
kml = Pxlsrt::Seed.seed(inputFileName, o)
kml.save(outputFileName) if Pxlsrt:... | ruby | MIT | f65880032f441887d77ddfbe5ebb0760edc96e1c | 2026-01-04T17:57:31.647579Z | false |
czycha/pxlsrt | https://github.com/czycha/pxlsrt/blob/f65880032f441887d77ddfbe5ebb0760edc96e1c/lib/pxlsrt/helpers.rb | lib/pxlsrt/helpers.rb | module Pxlsrt
##
# Methods not having to do with image or color manipulation.
class Helpers
##
# Determines if a value has content.
def self.contented(c)
!c.nil?
end
##
# Used to output a red string to the terminal.
def self.red(what)
"\e[31m#{what}\e[0m"
end
##
... | ruby | MIT | f65880032f441887d77ddfbe5ebb0760edc96e1c | 2026-01-04T17:57:31.647579Z | false |
czycha/pxlsrt | https://github.com/czycha/pxlsrt/blob/f65880032f441887d77ddfbe5ebb0760edc96e1c/lib/pxlsrt/brute.rb | lib/pxlsrt/brute.rb | require 'oily_png'
module Pxlsrt
##
# Brute sorting creates bands for sorting using a range to determine the bandwidths,
# as opposed to smart sorting which uses edge-finding to create bands.
class Brute
##
# Uses Pxlsrt::Brute.brute to input and output from one method.
def self.suite(inputFileName... | ruby | MIT | f65880032f441887d77ddfbe5ebb0760edc96e1c | 2026-01-04T17:57:31.647579Z | false |
czycha/pxlsrt | https://github.com/czycha/pxlsrt/blob/f65880032f441887d77ddfbe5ebb0760edc96e1c/lib/pxlsrt/kim.rb | lib/pxlsrt/kim.rb | require 'oily_png'
module Pxlsrt
##
# Uses Kim Asendorf's pixel sorting algorithm, orginally written in Processing. https://github.com/kimasendorf/ASDFPixelSort
class Kim
##
# Uses Pxlsrt::Kim.kim to input and output from one method.
def self.suite(inputFileName, outputFileName, o = {})
kml = P... | ruby | MIT | f65880032f441887d77ddfbe5ebb0760edc96e1c | 2026-01-04T17:57:31.647579Z | false |
czycha/pxlsrt | https://github.com/czycha/pxlsrt/blob/f65880032f441887d77ddfbe5ebb0760edc96e1c/lib/pxlsrt/smart.rb | lib/pxlsrt/smart.rb | require 'oily_png'
module Pxlsrt
##
# Smart sorting uses sorted-finding algorithms to create bands to sort,
# as opposed to brute sorting which doesn't care for the content or
# sorteds, just a specified range to create bands.
class Smart
##
# Uses Pxlsrt::Smart.smart to input and output from pne met... | ruby | MIT | f65880032f441887d77ddfbe5ebb0760edc96e1c | 2026-01-04T17:57:31.647579Z | false |
czycha/pxlsrt | https://github.com/czycha/pxlsrt/blob/f65880032f441887d77ddfbe5ebb0760edc96e1c/lib/pxlsrt/spiral.rb | lib/pxlsrt/spiral.rb | module Pxlsrt
##
# Spiral iteration.
class Spiral
def initialize(x, y)
@x = x
@y = y
@direction = 'up'
@step = 1
@at = 0
@count = 0
@cycles = -1
end
##
# Return current x value.
attr_reader :x
##
# Return current y value.
attr_reader :y
... | ruby | MIT | f65880032f441887d77ddfbe5ebb0760edc96e1c | 2026-01-04T17:57:31.647579Z | false |
czycha/pxlsrt | https://github.com/czycha/pxlsrt/blob/f65880032f441887d77ddfbe5ebb0760edc96e1c/lib/pxlsrt/colors.rb | lib/pxlsrt/colors.rb | require 'oily_png'
module Pxlsrt
##
# Includes color operations.
class Colors
##
# List of sorting methods.
METHODS = ['sum-rgb', 'red', 'green', 'blue', 'sum-hsb', 'hue', 'saturation', 'brightness', 'uniqueness', 'luma', 'random', 'cyan', 'magenta', 'yellow', 'alpha', 'sum-rgba', 'sum-hsba', 'none']... | ruby | MIT | f65880032f441887d77ddfbe5ebb0760edc96e1c | 2026-01-04T17:57:31.647579Z | false |
czycha/pxlsrt | https://github.com/czycha/pxlsrt/blob/f65880032f441887d77ddfbe5ebb0760edc96e1c/lib/pxlsrt/image.rb | lib/pxlsrt/image.rb | module Pxlsrt
##
# Image class for handling ChunkyPNG images.
class Image
def initialize(png)
@original = png
@modified = ChunkyPNG::Image.from_canvas(png)
@width = png.width
@height = png.height
@grey = Array.new(@original.height) do |y|
Array.new(@original.width) do |x|... | ruby | MIT | f65880032f441887d77ddfbe5ebb0760edc96e1c | 2026-01-04T17:57:31.647579Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/spec/helper.rb | spec/helper.rb | # -*- coding: utf-8 -*-
$LOAD_PATH << File.expand_path('../lib', __FILE__)
require 'simplecov'
SimpleCov.start do
add_filter '/spec/'
end
| ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/spec/grooveshark/client_spec.rb | spec/grooveshark/client_spec.rb | require_relative '../helper'
require 'grooveshark'
describe 'Client' do
context 'initialization' do
it 'should have a valid session' do
@gs = Grooveshark::Client.new
expect(@gs.session).to_not be_nil
expect(@gs.session).to match(/^[abcdef\d]{32}$/i)
end
it 'should have a valid country... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/spec/grooveshark/utils_spec.rb | spec/grooveshark/utils_spec.rb | require_relative '../helper'
require 'grooveshark'
describe 'String' do
it 'should normalize attributes' do
vars = %w(key_name keyName KeyName KeyNAME)
target = 'key_name'
vars.each { |s| expect(s.normalize_attribute).to eq(target) }
end
end
describe 'Hash' do
it 'should normalize simple keys' do
... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/spec/grooveshark/song_spec.rb | spec/grooveshark/song_spec.rb | require_relative '../helper'
require 'grooveshark'
describe 'Song' do
it 'should initialize without data' do
expect(Grooveshark::Song.new.id).to be_nil
end
it 'should initialize with data' do
song = Grooveshark::Song.new('song_id' => '2',
'song_name' => 'Test',
... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/spec/grooveshark/broadcast_spec.rb | spec/grooveshark/broadcast_spec.rb | require_relative '../helper'
require 'grooveshark'
describe Grooveshark::Broadcast do
let(:client) { Grooveshark::Client.new }
describe 'search' do
let(:result) { client.top_broadcasts(10) }
it 'returns an array' do
expect(result).to be_an Array
expect(result.size).to eq 10
end
it '... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/spec/grooveshark/errors_spec.rb | spec/grooveshark/errors_spec.rb | require_relative '../helper'
require 'grooveshark'
describe 'Errors' do
it 'should test ApiError' do
fault = {
'code' => '25',
'message' => 'Something went wrong'
}
error = Grooveshark::ApiError.new(fault)
expect(error.to_s).to eq('25 - Something went wrong')
end
end
| ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/spec/grooveshark/user_spec.rb | spec/grooveshark/user_spec.rb | require_relative '../helper'
require 'grooveshark'
describe 'User' do
it 'should initialize without data' do
expect(Grooveshark::User.new(double).id).to be_nil
end
it 'should initialize with data' do
user = Grooveshark::User.new(double,
'user_id' => '1',
... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/spec/grooveshark/playlist_spec.rb | spec/grooveshark/playlist_spec.rb | require_relative '../helper'
require 'grooveshark'
describe 'Playlist' do
it 'should initialize without data' do
expect(Grooveshark::Playlist.new(double).id).to be_nil
end
it 'should initialize with data' do
playlist = Grooveshark::Playlist
.new(double,
'playlist_id' ... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/lib/grooveshark.rb | lib/grooveshark.rb | require 'digest'
require 'json'
require 'rest-client'
require 'uuid'
require 'grooveshark/version'
require 'grooveshark/utils'
require 'grooveshark/errors'
require 'grooveshark/client'
require 'grooveshark/user'
require 'grooveshark/playlist'
require 'grooveshark/song'
require 'grooveshark/broadcast'
| ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/lib/grooveshark/playlist.rb | lib/grooveshark/playlist.rb | # Grooveshark module
module Grooveshark
# Playlist class
class Playlist
attr_reader :id, :user_id
attr_reader :name, :about, :picture, :username
attr_reader :songs, :num_songs
def initialize(client, data = nil, user_id = nil)
@client = client
@songs = []
return if data.nil?
... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/lib/grooveshark/version.rb | lib/grooveshark/version.rb | # Grooveshark module
module Grooveshark
VERSION = '0.2.14'
end
| ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/lib/grooveshark/errors.rb | lib/grooveshark/errors.rb | # Grooveshark module
module Grooveshark
class InvalidAuthentication < Exception
end
class ReadOnlyAccess < Exception
end
class GeneralError < Exception
end
# Api error
class ApiError < Exception
attr_reader :code
def initialize(fault)
@code = fault['code']
@message = fault['messa... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/lib/grooveshark/broadcast.rb | lib/grooveshark/broadcast.rb | # Grooveshark module
module Grooveshark
# Broadcast class
class Broadcast
attr_reader :id, :user_ids
attr_reader :is_active, :is_playing
attr_reader :name, :usernames
attr_reader :active_song, :next_song
def initialize(client, broadcast_id = nil, data = nil)
@client = client
if bro... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/lib/grooveshark/utils.rb | lib/grooveshark/utils.rb | # String class
class String
def normalize_attribute
gsub(/^.*::/, '')
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
.downcase
end
end
# Hash class
class Hash
def normalize
h = {}
each_pair do |k, v|
attr = k.to_s.normalize_attribute
case v
... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/lib/grooveshark/client.rb | lib/grooveshark/client.rb | # Grooveshark module
module Grooveshark
# Client class
class Client
attr_accessor :session, :comm_token
attr_reader :user, :comm_token_ttl, :country
def initialize(params = {})
@ttl = params[:ttl] || 120 # 2 minutes
@uuid = UUID.new.generate.upcase
token_data
end
# Authentica... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/lib/grooveshark/song.rb | lib/grooveshark/song.rb | # Grooveshark module
module Grooveshark
# Song class
class Song
attr_reader :data
attr_reader :id, :artist_id, :album_id
attr_reader :name, :artist, :album, :track, :year
attr_reader :duration, :artwork, :playcount
def initialize(data = nil)
return if data.nil?
@data = data
... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
sosedoff/grooveshark | https://github.com/sosedoff/grooveshark/blob/e55686c620c13848fa6d918cc2980fd44cf40e35/lib/grooveshark/user.rb | lib/grooveshark/user.rb | # Grooveshark module
module Grooveshark
# User class
class User
attr_reader :id, :name, :email, :premium, :data
attr_reader :city, :country, :sex
attr_reader :playlists, :favorites
# Init user account object
def initialize(client, data = nil)
if data
@data = data
@id ... | ruby | MIT | e55686c620c13848fa6d918cc2980fd44cf40e35 | 2026-01-04T17:57:26.418568Z | false |
breakpointHQ/chrome-bandit | https://github.com/breakpointHQ/chrome-bandit/blob/dcf9b650cb09f3404a9c61427ca70d52ae9df6ef/commands/decrypt.rb | commands/decrypt.rb | require_relative '../utils/http_server'
class DecryptCommand
def initialize
@origin_url = nil
@fake = Tempfile.new('fake')
@backup = "/tmp/login_data_backup_#{Time.now.to_i}.db"
@options = {
id: nil,
url: nil,
port: 5678,
format: 'te... | ruby | MIT | dcf9b650cb09f3404a9c61427ca70d52ae9df6ef | 2026-01-04T17:57:31.990096Z | false |
breakpointHQ/chrome-bandit | https://github.com/breakpointHQ/chrome-bandit/blob/dcf9b650cb09f3404a9c61427ca70d52ae9df6ef/commands/list.rb | commands/list.rb | require 'sqlite3'
require 'optparse'
require 'tempfile'
require 'fileutils'
class ListCommand
def initialize
@options = {
format: 'text',
login_data: nil
}
parser = OptionParser.new do |opts|
opts.banner = 'Usage: chrome-bandit list [options]'
... | ruby | MIT | dcf9b650cb09f3404a9c61427ca70d52ae9df6ef | 2026-01-04T17:57:31.990096Z | false |
breakpointHQ/chrome-bandit | https://github.com/breakpointHQ/chrome-bandit/blob/dcf9b650cb09f3404a9c61427ca70d52ae9df6ef/utils/rprint.rb | utils/rprint.rb | def rprint(rows, space = 10)
str = ""
max_cell_size = 0
for row in rows
for cell in row
cell = cell.to_s
max_cell_size = [max_cell_size, cell.length].max
end
end
max_cell_size = max_cell_size + space
for row in rows
str = ""
for cell... | ruby | MIT | dcf9b650cb09f3404a9c61427ca70d52ae9df6ef | 2026-01-04T17:57:31.990096Z | false |
breakpointHQ/chrome-bandit | https://github.com/breakpointHQ/chrome-bandit/blob/dcf9b650cb09f3404a9c61427ca70d52ae9df6ef/utils/http_server.rb | utils/http_server.rb | require 'socket'
def start_http_server(html, port, credentials)
return Thread.new do
server = TCPServer.open(port)
loop {
socket = server.accept
headers = {}
method, path = socket.gets.split
while line = socket.gets.split(" ", 2)
... | ruby | MIT | dcf9b650cb09f3404a9c61427ca70d52ae9df6ef | 2026-01-04T17:57:31.990096Z | false |
breakpointHQ/chrome-bandit | https://github.com/breakpointHQ/chrome-bandit/blob/dcf9b650cb09f3404a9c61427ca70d52ae9df6ef/utils/tableprint.rb | utils/tableprint.rb | def tableprint(col_labels, data)
columns = col_labels.each_with_object({}) { |(col,label),h|
h[col] = {
label: label,
width: [data.map { |g| g[col].size }.max, label.size].max
}
}
write_divider columns
write_header columns
write_divider columns
data.each {... | ruby | MIT | dcf9b650cb09f3404a9c61427ca70d52ae9df6ef | 2026-01-04T17:57:31.990096Z | false |
breakpointHQ/chrome-bandit | https://github.com/breakpointHQ/chrome-bandit/blob/dcf9b650cb09f3404a9c61427ca70d52ae9df6ef/utils/colorize.rb | utils/colorize.rb | class String
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
def red
colorize(31)
end
def gray
colorize(90)
end
def green
colorize(32)
end
def yellow
colorize(33)
end
def blue
colorize(34)
end
def pink
... | ruby | MIT | dcf9b650cb09f3404a9c61427ca70d52ae9df6ef | 2026-01-04T17:57:31.990096Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/app/controllers/bitcoin_payable/bitcoin_payment_transaction_controller.rb | app/controllers/bitcoin_payable/bitcoin_payment_transaction_controller.rb | require 'bitcoin_payable/commands/payment_processor'
module BitcoinPayable
class BitcoinPaymentTransactionController < ActionController::Base
http_basic_authenticate_with(
name: ENV['BITCOIN_PAYABLE_WEBHOOK_USER'],
password: ENV['BITCOIN_PAYABLE_WEBHOOK_PASS']
)
def notify_transaction
... | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/features/support/env.rb | features/support/env.rb | ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../../../spec/dummy/config/environment.rb", __FILE__)
ENV["RAILS_ROOT"] ||= File.dirname(__FILE__) + "../../../spec/dummy"
require 'cucumber/rails'
#require 'cucumber/rspec/doubles'
# Remove/comment out the lines below if your app doesn't have a database.
# For ... | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/features/step_definitions/processor_steps.rb | features/step_definitions/processor_steps.rb | When /^the payment_processor is run$/ do
BitcoinPayable::PaymentProcessor.perform
end
When /^the pricing processor is run$/ do
BitcoinPayable::PricingProcessor.perform
end | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/features/step_definitions/widget_steps.rb | features/step_definitions/widget_steps.rb | Given /^the widget should have (\d+) bitcoin_payments$/ do |n|
expect(@widget.bitcoin_payments.count).to eq(n.to_i)
end | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/features/step_definitions/model_step.rb | features/step_definitions/model_step.rb | Given /^an unsaved widget$/ do
@widget = Widget.new
end
Given /^a saved widget$/ do
@widget = Widget.create
end
Given /^a new bitcoin_payment$/ do
@bitcoin_payment = @widget.bitcoin_payments.new
end
| ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/features/step_definitions/bitcoin_payment_steps.rb | features/step_definitions/bitcoin_payment_steps.rb | Given /^the bitcoin_payment field (\S*) is set to (.*)/ do |field, value|
@bitcoin_payment.send("#{field}=", value)
end
Given /^the bitcoin_payment is saved$/ do
@bitcoin_payment.save
expect(@bitcoin_payment.reload.new_record?).to be(false)
end
Given /^the bitcoin_payment should have an address$/ do
expect(@b... | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/features/step_definitions/currency_conversion_steps.rb | features/step_definitions/currency_conversion_steps.rb | Given /^there should be (\d+) currency_conversions?$/ do |n|
expect(@currency_conversions).to_not be_nil
expect(@currency_conversions.count).to eq(n.to_i)
end
Given /^the currency_conversion is (\d+)$/ do |conversion_rate|
BitcoinPayable::CurrencyConversion.create!(
currency: 1,
btc: conversion_rate.to_i... | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/app/helpers/application_helper.rb | spec/dummy/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/app/controllers/application_controller.rb | spec/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
| ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/app/models/widget.rb | spec/dummy/app/models/widget.rb | class Widget < ActiveRecord::Base
has_bitcoin_payments
end
| ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/db/schema.rb | spec/dummy/db/schema.rb | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/db/migrate/20140511021326_create_currency_conversions.rb | spec/dummy/db/migrate/20140511021326_create_currency_conversions.rb | class CreateCurrencyConversions < ActiveRecord::Migration
def change
create_table :currency_conversions do |t|
t.float "currency"
t.integer "btc"
t.datetime "created_at"
t.datetime "updated_at"
end
end
end | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/db/migrate/20140917144413_add_btc_conversion_to_bitcoin_payments.rb | spec/dummy/db/migrate/20140917144413_add_btc_conversion_to_bitcoin_payments.rb | class AddBtcConversionToBitcoinPayments < ActiveRecord::Migration
def change
add_column :bitcoin_payments, :btc_conversion, :integer
end
end | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/db/migrate/20140902213338_create_bitcoin_payment_transactions.rb | spec/dummy/db/migrate/20140902213338_create_bitcoin_payment_transactions.rb | class CreateBitcoinPaymentTransactions < ActiveRecord::Migration
def change
create_table :bitcoin_payment_transactions do |t|
t.integer :estimated_value
t.string :transaction_hash
t.string :block_hash
t.datetime :block_time
t.datetime :estimated_time
t.integer :bitcoin_payment_... | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/db/migrate/20140902213337_create_bitcoin_payments.rb | spec/dummy/db/migrate/20140902213337_create_bitcoin_payments.rb | class CreateBitcoinPayments < ActiveRecord::Migration
def change
create_table :bitcoin_payments do |t|
t.string :payable_type
t.integer :payable_id
t.string :currency
t.string :reason
t.integer :price
t.float :btc_amount_due, default: 0
t.string :address
... | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/db/migrate/20140510023211_create_widgets.rb | spec/dummy/db/migrate/20140510023211_create_widgets.rb | class CreateWidgets < ActiveRecord::Migration
def change
create_table :widgets do |t|
t.timestamps
end
end
end
| ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/test/models/widget_test.rb | spec/dummy/test/models/widget_test.rb | require 'test_helper'
class WidgetTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/config/application.rb | spec/dummy/config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
require "bitcoin_payable"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in c... | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/config/environment.rb | spec/dummy/config/environment.rb | # Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Dummy::Application.initialize!
| ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Sailias/bitcoin_payable | https://github.com/Sailias/bitcoin_payable/blob/14e8c4fb9e2bc181869ea9fb76c97b78ecea429b/spec/dummy/config/routes.rb | spec/dummy/config/routes.rb | Dummy::Application.routes.draw do
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
# root 'welcome#index'
# Example of regular route:
# get 'products/:id' => 'c... | ruby | MIT | 14e8c4fb9e2bc181869ea9fb76c97b78ecea429b | 2026-01-04T17:57:32.429118Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.