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 |
|---|---|---|---|---|---|---|---|---|
coinbase/coinbase-exchange-ruby | https://github.com/coinbase/coinbase-exchange-ruby/blob/3e01d2ea5ade324bec82233ca29304c80b1058d2/lib/coinbase/exchange/websocket.rb | lib/coinbase/exchange/websocket.rb | module Coinbase
module Exchange
# Websocket client for Coinbase Exchange
class Websocket
def initialize(options = {})
@ws_url = options[:ws_url] || "wss://ws-feed.gdax.com"
@product = options[:product_id] || 'BTC-USD'
@keepalive = options[:keepalive] || false
@message_cb... | ruby | Apache-2.0 | 3e01d2ea5ade324bec82233ca29304c80b1058d2 | 2026-01-04T17:55:58.161349Z | false |
coinbase/coinbase-exchange-ruby | https://github.com/coinbase/coinbase-exchange-ruby/blob/3e01d2ea5ade324bec82233ca29304c80b1058d2/lib/coinbase/exchange/adapters/em_http.rb | lib/coinbase/exchange/adapters/em_http.rb | module Coinbase
module Exchange
# EM-Http Adapter
class EMHTTPClient < APIClient
def initialize(api_key = '', api_secret = '', api_pass = '', options = {})
super(api_key, api_secret, api_pass, options)
end
private
def http_verb(method, path, body = nil)
if !EventMachi... | ruby | Apache-2.0 | 3e01d2ea5ade324bec82233ca29304c80b1058d2 | 2026-01-04T17:55:58.161349Z | false |
coinbase/coinbase-exchange-ruby | https://github.com/coinbase/coinbase-exchange-ruby/blob/3e01d2ea5ade324bec82233ca29304c80b1058d2/lib/coinbase/exchange/adapters/net_http.rb | lib/coinbase/exchange/adapters/net_http.rb | module Coinbase
module Exchange
# Net-HTTP adapter
class NetHTTPClient < APIClient
def initialize(api_key = '', api_secret = '', api_pass = '', options = {})
super(api_key, api_secret, api_pass, options)
@conn = Net::HTTP.new(@api_uri.host, @api_uri.port)
@conn.use_ssl = true if ... | ruby | Apache-2.0 | 3e01d2ea5ade324bec82233ca29304c80b1058d2 | 2026-01-04T17:55:58.161349Z | false |
mydrive/capistrano-deploytags | https://github.com/mydrive/capistrano-deploytags/blob/6ef8f3ec466a1374cd0257de7d66e8063938d0e2/spec/capistrano_deploy_tags_spec.rb | spec/capistrano_deploy_tags_spec.rb | require 'rspec'
describe 'Capistrano::Deploytags' do
pending "capistrano-spec doesn't support Capistrano 3"
end
| ruby | BSD-2-Clause | 6ef8f3ec466a1374cd0257de7d66e8063938d0e2 | 2026-01-04T17:55:58.084597Z | false |
mydrive/capistrano-deploytags | https://github.com/mydrive/capistrano-deploytags/blob/6ef8f3ec466a1374cd0257de7d66e8063938d0e2/lib/capistrano-deploytags.rb | lib/capistrano-deploytags.rb | ruby | BSD-2-Clause | 6ef8f3ec466a1374cd0257de7d66e8063938d0e2 | 2026-01-04T17:55:58.084597Z | false | |
mydrive/capistrano-deploytags | https://github.com/mydrive/capistrano-deploytags/blob/6ef8f3ec466a1374cd0257de7d66e8063938d0e2/lib/capistrano/deploytags.rb | lib/capistrano/deploytags.rb | # Ensure deploy tasks are loaded before we run
require 'capistrano/deploy'
# Load extra tasks into the deploy namespace
load File.expand_path("../tasks/deploytags.rake", __FILE__)
module CapistranoDeploytags
class Helper
def self.git_tag_for(stage)
"#{stage}-#{formatted_time}"
end
def self.format... | ruby | BSD-2-Clause | 6ef8f3ec466a1374cd0257de7d66e8063938d0e2 | 2026-01-04T17:55:58.084597Z | false |
benbalter/jekyll-include-cache | https://github.com/benbalter/jekyll-include-cache/blob/e5613acbf297bc8f8bbac19959b3544ce3485f61/spec/jekyll-include-tag_spec.rb | spec/jekyll-include-tag_spec.rb | # frozen_string_literal: true
RSpec.describe JekyllIncludeCache do
subject { described_class.cache }
context "with an empty cache" do
it "initializess the cache" do
expect(described_class.cache).to respond_to(:[])
expect(described_class.cache).to respond_to(:[]=)
end
end
context "with som... | ruby | MIT | e5613acbf297bc8f8bbac19959b3544ce3485f61 | 2026-01-04T17:56:02.584063Z | false |
benbalter/jekyll-include-cache | https://github.com/benbalter/jekyll-include-cache/blob/e5613acbf297bc8f8bbac19959b3544ce3485f61/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require "jekyll-include-cache"
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.filter... | ruby | MIT | e5613acbf297bc8f8bbac19959b3544ce3485f61 | 2026-01-04T17:56:02.584063Z | false |
benbalter/jekyll-include-cache | https://github.com/benbalter/jekyll-include-cache/blob/e5613acbf297bc8f8bbac19959b3544ce3485f61/spec/jekyll-include-tag/tag_spec.rb | spec/jekyll-include-tag/tag_spec.rb | # frozen_string_literal: true
RSpec.describe JekyllIncludeCache::Tag do
subject { described_class.send(:new, tag_name, markup, parse_context) }
let(:tag_name) { "include_cached" }
let(:cache) { JekyllIncludeCache.cache }
let(:path) { subject.send(:path, context) }
let(:parsed_params) { subject.parse_params(... | ruby | MIT | e5613acbf297bc8f8bbac19959b3544ce3485f61 | 2026-01-04T17:56:02.584063Z | false |
benbalter/jekyll-include-cache | https://github.com/benbalter/jekyll-include-cache/blob/e5613acbf297bc8f8bbac19959b3544ce3485f61/spec/jekyll-include-tag/cache_spec.rb | spec/jekyll-include-tag/cache_spec.rb | # frozen_string_literal: true
RSpec.describe JekyllIncludeCache::Cache do
before { subject["foo"] = "bar" }
it "sets" do
subject["foo2"] = "bar2"
cache = subject.instance_variable_get("@cache")
expect(cache["foo2"]).to eql("bar2")
end
it "gets" do
expect(subject["foo"]).to eql("bar")
end
... | ruby | MIT | e5613acbf297bc8f8bbac19959b3544ce3485f61 | 2026-01-04T17:56:02.584063Z | false |
benbalter/jekyll-include-cache | https://github.com/benbalter/jekyll-include-cache/blob/e5613acbf297bc8f8bbac19959b3544ce3485f61/lib/jekyll-include-cache.rb | lib/jekyll-include-cache.rb | # frozen_string_literal: true
require "jekyll"
module JekyllIncludeCache
autoload :Tag, "jekyll-include-cache/tag"
autoload :Cache, "jekyll-include-cache/cache"
class << self
def cache
@cache ||= if defined? Jekyll::Cache
Jekyll::Cache.new(self.class.name)
else
... | ruby | MIT | e5613acbf297bc8f8bbac19959b3544ce3485f61 | 2026-01-04T17:56:02.584063Z | false |
benbalter/jekyll-include-cache | https://github.com/benbalter/jekyll-include-cache/blob/e5613acbf297bc8f8bbac19959b3544ce3485f61/lib/jekyll-include-cache/tag.rb | lib/jekyll-include-cache/tag.rb | # frozen_string_literal: true
require "digest/md5"
module JekyllIncludeCache
class Tag < Jekyll::Tags::IncludeTag
def self.digest_cache
@digest_cache ||= {}
end
def render(context)
path = path(context)
params = parse_params(context) if @params
key = key(path, params)
ret... | ruby | MIT | e5613acbf297bc8f8bbac19959b3544ce3485f61 | 2026-01-04T17:56:02.584063Z | false |
benbalter/jekyll-include-cache | https://github.com/benbalter/jekyll-include-cache/blob/e5613acbf297bc8f8bbac19959b3544ce3485f61/lib/jekyll-include-cache/version.rb | lib/jekyll-include-cache/version.rb | # frozen_string_literal: true
module JekyllIncludeCache
VERSION = "0.2.1"
end
| ruby | MIT | e5613acbf297bc8f8bbac19959b3544ce3485f61 | 2026-01-04T17:56:02.584063Z | false |
benbalter/jekyll-include-cache | https://github.com/benbalter/jekyll-include-cache/blob/e5613acbf297bc8f8bbac19959b3544ce3485f61/lib/jekyll-include-cache/cache.rb | lib/jekyll-include-cache/cache.rb | # frozen_string_literal: true
# Jekyll 4.x comptable caching class for pre-4.x compatibility
module JekyllIncludeCache
class Cache
extend Forwardable
def_delegators :@cache, :[]=, :key?, :delete, :clear
def initialize(_name = nil)
@cache = {}
end
def getset(key)
if key?(key)
... | ruby | MIT | e5613acbf297bc8f8bbac19959b3544ce3485f61 | 2026-01-04T17:56:02.584063Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/test_helper.rb | test/test_helper.rb | # Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
#ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
#ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __... | ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/app/jobs/application_job.rb | test/dummy/app/jobs/application_job.rb | class ApplicationJob < ActiveJob::Base
end
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/app/helpers/application_helper.rb | test/dummy/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/app/controllers/visitors_controller.rb | test/dummy/app/controllers/visitors_controller.rb | class VisitorsController < ApplicationController
def index
if params[:zh].present?
I18n.locale = 'zh-CN'
end
end
end
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/app/controllers/application_controller.rb | test/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
prepend_before_action :set_locale
def set_locale
if params[:zh].present?
I18n.locale = :'zh-CN'
else
I18n.locale = :'en'
end
end
end
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/app/models/application_record.rb | test/dummy/app/models/application_record.rb | class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/test/controllers/visitors_controller_test.rb | test/dummy/test/controllers/visitors_controller_test.rb | require 'test_helper'
class VisitorsControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get root_url
assert_response :success
end
end
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/application.rb | test/dummy/config/application.rb | require_relative 'boot'
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
require 'action_cable/engine'
Bundler.require(*Rails.groups)
require "browser_warrior"
module Dummy
class Application < Rails::Application
# Settings in conf... | ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/routes.rb | test/dummy/config/routes.rb | Rails.application.routes.draw do
root 'visitors#index'
end
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/spring.rb | test/dummy/config/spring.rb | %w(
.ruby-version
.rbenv-vars
tmp/restart.txt
tmp/caching-dev.txt
).each { |path| Spring.watch(path) }
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/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 sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/initializers/application_controller_renderer.rb | test/dummy/config/initializers/application_controller_renderer.rb | # Be sure to restart your server when you modify this file.
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/initializers/session_store.rb | test/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: '_dummy_session'
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/initializers/wrap_parameters.rb | test/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/initializers/cookies_serializer.rb | test/dummy/config/initializers/cookies_serializer.rb | # Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails.application.config.action_dispatch.cookies_serializer = :json
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/initializers/backtrace_silencers.rb | test/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/initializers/mime_types.rb | test/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/environments/test.rb | test/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/environments/development.rb | test/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/test/dummy/config/environments/production.rb | test/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 | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/lib/browser_warrior.rb | lib/browser_warrior.rb | require "browser_warrior/engine"
require 'browser/version'
require 'browser'
module BrowserWarrior
ROOT = File.expand_path(File.join( File.dirname(__FILE__), '..'))
module Controllers
module Helpers
extend ActiveSupport::Concern
included do
before_action :check_browser_warrior! if Browser... | ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/lib/browser_warrior/version.rb | lib/browser_warrior/version.rb | module BrowserWarrior
VERSION = '0.14.0'
end
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/lib/browser_warrior/engine.rb | lib/browser_warrior/engine.rb | module BrowserWarrior
class Engine < ::Rails::Engine
initializer "browser_warrior.helprs" do
ActiveSupport.on_load(:action_controller) do
include BrowserWarrior::Controllers::Helpers
end
end
end
end
| ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/lib/generators/browser_warrior/views/views_generator.rb | lib/generators/browser_warrior/views/views_generator.rb | module BrowserWarrior
module Generators
class ViewsGenerator < Rails::Generators::Base
source_root ::BrowserWarrior::ROOT
desc "Copy views & css files into main app"
def copy_views
copy_file "app/views/browser_warrior/index.html.erb", "app/views/browser_warrior/index.html.erb"
c... | ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/lib/generators/browser_warrior/install/install_generator.rb | lib/generators/browser_warrior/install/install_generator.rb | module BrowserWarrior
module Generators
class InstallGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
desc "Create a browser_warrior initializer"
def copy_initializer
template "browser_warrior.rb", "config/initializers/browser_warrior.rb"
... | ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
dao42/browser_warrior | https://github.com/dao42/browser_warrior/blob/38aad349679c38a38b3adfa9a125aac47393ba92/lib/generators/browser_warrior/install/templates/browser_warrior.rb | lib/generators/browser_warrior/install/templates/browser_warrior.rb | BrowserWarrior.detect do |browser|
next true if Rails.env.test?
next true if browser.bot?
next true unless browser.known?
# Allow weixin callback
next true if browser.platform.other?
# See https://github.com/fnando/browser#usage for more usage
next true if browser.wechat?
next true if browser.weibo?
... | ruby | MIT | 38aad349679c38a38b3adfa9a125aac47393ba92 | 2026-01-04T17:55:59.897926Z | false |
FTBpro/count-von-count | https://github.com/FTBpro/count-von-count/blob/5585796fddbe713434f8865bc85d190fd427e300/spec/script_loader.rb | spec/script_loader.rb | require 'yaml'
require 'json'
require 'ruby-debug'
class ScriptLoader
class << self
attr_accessor :log_player_reads_hash
end
def self.load
set_config
load_scripts_to_log_player_test_db if self.spec_config["log_player_integration"]
File.open("/usr/local/openresty/nginx/conf/vars.conf", 'w') { |f| f... | ruby | MIT | 5585796fddbe713434f8865bc85d190fd427e300 | 2026-01-04T17:56:02.028410Z | false |
FTBpro/count-von-count | https://github.com/FTBpro/count-von-count/blob/5585796fddbe713434f8865bc85d190fd427e300/spec/spec_helper.rb | spec/spec_helper.rb | require 'open-uri'
require 'script_loader'
require 'rubygems'
require 'spork'
require 'redis'
require 'json'
require 'support/redis_object_factory'
require "integration/log_player_integrator"
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'
HOST = "127.0.0.1"
Spork.prefork ... | ruby | MIT | 5585796fddbe713434f8865bc85d190fd427e300 | 2026-01-04T17:56:02.028410Z | false |
FTBpro/count-von-count | https://github.com/FTBpro/count-von-count/blob/5585796fddbe713434f8865bc85d190fd427e300/spec/support/redis_object_factory.rb | spec/support/redis_object_factory.rb | class RedisObjectFactory
attr_reader :type, :key, :ids, :id
class << self
attr_accessor :redis
end
def initialize(type_, ids_)
@type = type_
@ids = ids_
@id = @ids.values.join("_")
@key = "#{@type}_#{@id}"
key_type = self.class.redis.type(@key)
initial_data if key_type == "hash" ||... | ruby | MIT | 5585796fddbe713434f8865bc85d190fd427e300 | 2026-01-04T17:56:02.028410Z | false |
FTBpro/count-von-count | https://github.com/FTBpro/count-von-count/blob/5585796fddbe713434f8865bc85d190fd427e300/spec/integration/log_player_integrator.rb | spec/integration/log_player_integrator.rb | require 'ruby-debug'
require 'spec_helper'
def self.spec_config
@@spec_config ||= YAML.load_file('spec/config/spec_config.yml') rescue {}
end
Spec::Runner.configure do |config|
if self.spec_config["log_player_integration"]
config.before(:all) do
flush_keys
ScriptLoader.clean_access_log
Scrip... | ruby | MIT | 5585796fddbe713434f8865bc85d190fd427e300 | 2026-01-04T17:56:02.028410Z | false |
FTBpro/count-von-count | https://github.com/FTBpro/count-von-count/blob/5585796fddbe713434f8865bc85d190fd427e300/spec/lib/utils_spec.rb | spec/lib/utils_spec.rb | require "spec_helper"
describe "Utils" do
describe "Android bad Query String with amp;" do
before :each do
@user = create :User
@author = create :User
open("http://#{HOST}/reads?user=#{@user.id}&author=#{@author.id}")
end
context "it should replace & with &" do
it "should... | ruby | MIT | 5585796fddbe713434f8865bc85d190fd427e300 | 2026-01-04T17:56:02.028410Z | false |
FTBpro/count-von-count | https://github.com/FTBpro/count-von-count/blob/5585796fddbe713434f8865bc85d190fd427e300/spec/lib/counting_spec.rb | spec/lib/counting_spec.rb | require 'spec_helper'
require 'ruby-debug'
describe "Counting" do
before :each do
@user = create :User, id: 10
@author = create :User, id: 30
@post = create :Post, id: 100
end
describe "reads action" do
describe "User Hash" do
before do
open("http://#{HOST}/reads?post=#{@post.id}&u... | ruby | MIT | 5585796fddbe713434f8865bc85d190fd427e300 | 2026-01-04T17:56:02.028410Z | false |
FTBpro/count-von-count | https://github.com/FTBpro/count-von-count/blob/5585796fddbe713434f8865bc85d190fd427e300/spec/lib/get_spec.rb | spec/lib/get_spec.rb | require 'spec_helper'
describe "Get" do
before do
@user = create :User
@author= create :User
open("http://#{HOST}/reads?user=#{@user.id}&author=#{@author.id}")
end
def get(query_string)
JSON.parse(open("http://#{HOST}/get?#{query_string}").read.gsub("\n", "") )
end
describe "Header" do
it... | ruby | MIT | 5585796fddbe713434f8865bc85d190fd427e300 | 2026-01-04T17:56:02.028410Z | false |
FTBpro/count-von-count | https://github.com/FTBpro/count-von-count/blob/5585796fddbe713434f8865bc85d190fd427e300/config/deploy.rb | config/deploy.rb | # -------------------------------------------
# Git and deploytment details
# -------------------------------------------
set :application, "count-von-count"
set :repository, "git://github.com/FTBpro/count-von-count.git"
set :scm, :git
set :deploy_to, '/home/deploy/count-von-count'
set :user, "deploy"
set :use_sudo, f... | ruby | MIT | 5585796fddbe713434f8865bc85d190fd427e300 | 2026-01-04T17:56:02.028410Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/test/test_http_cookie.rb | test/test_http_cookie.rb | # -*- coding: utf-8 -*-
# frozen_string_literal: false
require File.expand_path('helper', File.dirname(__FILE__))
require 'psych' if !defined?(YAML) && RUBY_VERSION == "1.9.2"
require 'yaml'
class TestHTTPCookie < Test::Unit::TestCase
def setup
httpdate = 'Sun, 27-Sep-2037 00:00:00 GMT'
@cookie_params = {
... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | true |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/test/simplecov_start.rb | test/simplecov_start.rb | require 'simplecov'
SimpleCov.start
| ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/test/test_http_cookie_jar.rb | test/test_http_cookie_jar.rb | # frozen_string_literal: false
require File.expand_path('helper', File.dirname(__FILE__))
require 'tmpdir'
module TestHTTPCookieJar
class TestAutoloading < Test::Unit::TestCase
def test_nonexistent_store
assert_raises(NameError) {
HTTP::CookieJar::NonexistentStore
}
end
def test_none... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | true |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/test/helper.rb | test/helper.rb | require 'rubygems'
require 'test-unit'
require 'uri'
require 'http/cookie'
module Test
module Unit
module Assertions
def assert_warn(pattern, message = nil, &block)
class << (output = +"")
alias write <<
end
stderr, $stderr = $stderr, output
yield
assert_ma... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http-cookie.rb | lib/http-cookie.rb | require 'http/cookie'
| ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie_jar.rb | lib/http/cookie_jar.rb | # :markup: markdown
require 'http/cookie'
##
# This class is used to manage the Cookies that have been returned from
# any particular website.
class HTTP::CookieJar
class << self
def const_missing(name)
case name.to_s
when /\A([A-Za-z]+)Store\z/
file = 'http/cookie_jar/%s_store' % $1.downcas... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie.rb | lib/http/cookie.rb | # :markup: markdown
# frozen_string_literal: true
require 'http/cookie/version'
require 'http/cookie/uri_parser'
require 'time'
require 'uri'
require 'domain_name'
require 'http/cookie/ruby_compat'
require 'cgi'
module HTTP
autoload :CookieJar, 'http/cookie_jar'
end
# This class is used to represent an HTTP Cookie.... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie/version.rb | lib/http/cookie/version.rb | module HTTP
class Cookie
VERSION = "1.1.0"
end
end
| ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie/uri_parser.rb | lib/http/cookie/uri_parser.rb | module HTTP::Cookie::URIParser
module_function
# Regular Expression taken from RFC 3986 Appendix B
URIREGEX = %r{
\A
(?: (?<scheme> [^:/?\#]+ ) : )?
(?: // (?<authority> [^/?\#]* ) )?
(?<path> [^?\#]* )
(?: \? (?<query> [^\#]* ) )?
(?: \# (?<fragment> .* ) )?
\z
}x
# Escape RFC 3... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie/ruby_compat.rb | lib/http/cookie/ruby_compat.rb | class Array
def select! # :yield: x
i = 0
each_with_index { |x, j|
yield x or next
self[i] = x if i != j
i += 1
}
return nil if i == size
self[i..-1] = []
self
end unless method_defined?(:select!)
def sort_by!(&block) # :yield: x
replace(sort_by(&block))
end unless... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie/scanner.rb | lib/http/cookie/scanner.rb | # frozen_string_literal: true
require 'http/cookie'
require 'strscan'
require 'time'
class HTTP::Cookie::Scanner < StringScanner
# Whitespace.
RE_WSP = /[ \t]+/
# A pattern that matches a cookie name or attribute name which may
# be empty, capturing trailing whitespace.
RE_NAME = /(?!#{RE_WSP})[^,;\\"=]*/
... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie_jar/yaml_saver.rb | lib/http/cookie_jar/yaml_saver.rb | # :markup: markdown
require 'http/cookie_jar'
require 'psych' if !defined?(YAML) && RUBY_VERSION == "1.9.2"
require 'yaml'
# YAMLSaver saves and loads cookies in the YAML format. It can load a
# YAML file saved by Mechanize, but the saving format is not
# compatible with older versions of Mechanize (< 2.7).
class HTT... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie_jar/abstract_store.rb | lib/http/cookie_jar/abstract_store.rb | # :markup: markdown
require 'monitor'
# An abstract superclass for all store classes.
class HTTP::CookieJar::AbstractStore
include MonitorMixin
class << self
@@class_map = {}
# Gets an implementation class by the name, optionally trying to
# load "http/cookie_jar/*_store" if not found. If loading fa... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie_jar/hash_store.rb | lib/http/cookie_jar/hash_store.rb | # :markup: markdown
require 'http/cookie_jar'
class HTTP::CookieJar
# A store class that uses a hash-based cookie store.
#
# In this store, cookies that share the same name, domain and path
# will overwrite each other regardless of the `for_domain` flag
# value. This store is built after the storage model d... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie_jar/mozilla_store.rb | lib/http/cookie_jar/mozilla_store.rb | # :markup: markdown
require 'http/cookie_jar'
require 'sqlite3'
class HTTP::CookieJar
# A store class that uses Mozilla compatible SQLite3 database as
# backing store.
#
# Session cookies are stored separately on memory and will not be
# stored persistently in the SQLite3 database.
class MozillaStore < Abs... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie_jar/abstract_saver.rb | lib/http/cookie_jar/abstract_saver.rb | # :markup: markdown
# An abstract superclass for all saver classes.
class HTTP::CookieJar::AbstractSaver
class << self
@@class_map = {}
# Gets an implementation class by the name, optionally trying to
# load "http/cookie_jar/*_saver" if not found. If loading fails,
# IndexError is raised.
def i... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
sparklemotion/http-cookie | https://github.com/sparklemotion/http-cookie/blob/e5b73f3b0a3331a6591a928c1ad49dbe3aed4065/lib/http/cookie_jar/cookiestxt_saver.rb | lib/http/cookie_jar/cookiestxt_saver.rb | # :markup: markdown
require 'http/cookie_jar'
# CookiestxtSaver saves and loads cookies in the cookies.txt format.
class HTTP::CookieJar::CookiestxtSaver < HTTP::CookieJar::AbstractSaver
# :singleton-method: new
# :call-seq:
# new(**options)
#
# Available option keywords are below:
#
# * `:header`
#
... | ruby | MIT | e5b73f3b0a3331a6591a928c1ad49dbe3aed4065 | 2026-01-04T17:56:01.207236Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair.rb | lib/eclair.rb | # frozen_string_literal: true
module Eclair
end
require "eclair/providers/ec2"
# require "curses"
# require "zlib"
# require "aws-sdk"
# require "string_scorer"
# require "pry"
# require "eclair/item"
# require "eclair/helpers/benchmark_helper"
# require "eclair/helpers/common_helper"
# require "eclair/helpers/aws_he... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/provider.rb | lib/eclair/provider.rb | # frozen_string_literal: true
require "eclair/config"
module Eclair
module Provider
include ConfigHelper
extend self
attr_accessor :items
def filter_items search_buffer
@items.select{ |item| item&.search_key&.include?(search_buffer.downcase) || item.selected }
end
def require_prepare... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/version.rb | lib/eclair/version.rb | # frozen_string_literal: true
module Eclair
VERSION = "3.0.4"
end
| ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/less_viewer.rb | lib/eclair/less_viewer.rb | # frozen_string_literal: true
module Eclair
module LessViewer
extend self
class ColorPP < ::PP
def self.pp(obj, out = $>, width = 79)
q = ColorPP.new(out, width)
q.guard_inspect_key { q.pp obj }
q.flush
out << "\n"
end
def text(str, width = str.length)
... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/item.rb | lib/eclair/item.rb | # frozen_string_literal: true
require "eclair/config"
module Eclair
class Item
include ConfigHelper
attr_accessor :selected, :visible
def initialize
@selected = false
@visible = true
end
def toggle_select
@selected = !@selected
end
def select state
@selected = s... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/grid.rb | lib/eclair/grid.rb | # frozen_string_literal: true
require "eclair/group_item"
require "eclair/color"
module Eclair
class Grid
attr_reader :mode
def initialize keyword = ""
case config.provider
when :ec2
require "eclair/providers/ec2"
@provider = EC2Provider
when :k8s
require "eclair/pr... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/color.rb | lib/eclair/color.rb | # frozen_string_literal: true
require 'curses'
module Eclair
module Color
extend self
def storage
@storage ||= {}
end
def fetch fg, bg, options = 0
@idx ||= 1
unless storage[[fg,bg]]
Curses.init_pair(@idx, fg, bg)
storage[[fg,bg]] = @idx
@idx += 1
end... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/config.rb | lib/eclair/config.rb | # frozen_string_literal: true
require 'curses'
module Eclair
module ConfigHelper
def config
Eclair.config
end
end
class Config
KEYS_DIR = "#{ENV['HOME']}/.ecl/keys"
CACHE_DIR = "#{ENV['HOME']}/.ecl/.cache"
def initialize
@done = false
@config_file = ENV["ECLRC"] || "#{ENV[... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/group_item.rb | lib/eclair/group_item.rb | # frozen_string_literal: true
module Eclair
class GroupItem < Item
attr_reader :label
attr_accessor :visible
def initialize label, items
@label = label
@items = items
@visible = true
end
def toggle_select
if @items.all?(&:selected)
@items.each{|i| i.select(false) ... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/k8s.rb | lib/eclair/providers/k8s.rb | # frozen_string_literal: true
require "eclair/providers/k8s/k8s_provider"
| ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/ec2.rb | lib/eclair/providers/ec2.rb | # frozen_string_literal: true
require "eclair/providers/ec2/ec2_provider"
| ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/gce.rb | lib/eclair/providers/gce.rb | # frozen_string_literal: true
require "eclair/providers/gce/gce_provider"
| ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/ec2/ec2_item.rb | lib/eclair/providers/ec2/ec2_item.rb | # frozen_string_literal: true
require 'shellwords'
require "aws-sdk-ec2"
require "eclair/item"
require "eclair/providers/ec2/ec2_provider"
module Eclair
class EC2Item < Item
attr_reader :instance
def initialize instance
super()
@instance = instance
end
def id
@instance.id
end... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/ec2/ec2_group_item.rb | lib/eclair/providers/ec2/ec2_group_item.rb | # frozen_string_literal: true
require "eclair/group_item"
module Eclair
class EC2GroupItem < GroupItem
def header
running = @items.count{|i| i.instance.state[:code] == 16}
all = @items.count
<<-EOS
Group #{label}
#{running} Instances Running / #{all} Instances Total
EOS
e... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/ec2/ec2_provider.rb | lib/eclair/providers/ec2/ec2_provider.rb | # frozen_string_literal: true
require "aws-sdk-ec2"
require "eclair/provider"
require "eclair/providers/ec2/ec2_item"
require "eclair/providers/ec2/ec2_group_item"
module Eclair
module EC2Provider
extend Provider
extend self
def group_class
EC2GroupItem
end
def item_class
EC2Item
... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/k8s/k8s_item.rb | lib/eclair/providers/k8s/k8s_item.rb | # frozen_string_literal: true
require 'eclair/item'
require 'eclair/providers/k8s/k8s_provider'
require 'time'
module Eclair
class K8sItem < Item
attr_reader :pod
def initialize pod
super()
@pod = pod
end
def id
@pod["metadata"]["uid"]
end
def color
if @selected
... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/k8s/k8s_provider.rb | lib/eclair/providers/k8s/k8s_provider.rb | # frozen_string_literal: true
require 'eclair/provider'
require 'eclair/providers/k8s/k8s_item'
require 'eclair/providers/k8s/k8s_group_item'
require 'oj'
module Eclair
module K8sProvider
extend Provider
extend self
def group_class
K8sGroupItem
end
def item_class
K8sItem
end
... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/k8s/k8s_group_item.rb | lib/eclair/providers/k8s/k8s_group_item.rb | # frozen_string_literal: true
require "eclair/group_item"
module Eclair
class K8sGroupItem < GroupItem
def header
all = @items.count
<<-EOS
Group #{label}
#{all} pods Total
EOS
end
end
end
| ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/gce/gce_group_item.rb | lib/eclair/providers/gce/gce_group_item.rb | # frozen_string_literal: true
require "eclair/group_item"
module Eclair
class GCEGroupItem < GroupItem
def header
all = @items.count
<<-EOS
Group #{label}
#{all} instances Total
EOS
end
end
end
| ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/gce/gce_provider.rb | lib/eclair/providers/gce/gce_provider.rb | # frozen_string_literal: true
require 'eclair/provider'
require 'eclair/providers/gce/gce_item'
require 'eclair/providers/gce/gce_group_item'
require 'oj'
module Eclair
module GCEProvider
extend Provider
extend self
def group_class
GCEGroupItem
end
def item_class
GCEItem
end
... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
devsisters/eclair | https://github.com/devsisters/eclair/blob/792ffb8f965e719cd6c9d240a017f84a515a71e0/lib/eclair/providers/gce/gce_item.rb | lib/eclair/providers/gce/gce_item.rb | # frozen_string_literal: true
require 'eclair/item'
require 'eclair/providers/gce/gce_provider'
require 'time'
module Eclair
class GCEItem < Item
attr_reader :instance
def initialize instance
super()
@instance = instance
end
def id
@instance["id"]
end
def color
if @... | ruby | MIT | 792ffb8f965e719cd6c9d240a017f84a515a71e0 | 2026-01-04T17:56:03.303615Z | false |
jm/matchy | https://github.com/jm/matchy/blob/2e01918ad8d601685386aa9ac5d547ffb9b70b27/setup.rb | setup.rb | #
# setup.rb
#
# Copyright (c) 2000-2005 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
#
unless Enumerable.method_defined?(:map) # Ruby 1.4.6
module Enumerable
alias map collect
end
end
un... | ruby | MIT | 2e01918ad8d601685386aa9ac5d547ffb9b70b27 | 2026-01-04T17:56:08.640464Z | true |
jm/matchy | https://github.com/jm/matchy/blob/2e01918ad8d601685386aa9ac5d547ffb9b70b27/countloc.rb | countloc.rb | # This is here because OptionsParser is SO slow.
def extract_path(argv)
if argv[1].nil?
if argv[0] =~ /-a/
return "/**/*.rb"
elsif argv[0]
if argv[0] =~ /\.rb$/
return argv[0]
end
return argv[0] + "/**/*.rb"
else
return "/**/*.rb"
end
elsif argv[1] =~ /\.rb$/
... | ruby | MIT | 2e01918ad8d601685386aa9ac5d547ffb9b70b27 | 2026-01-04T17:56:08.640464Z | false |
jm/matchy | https://github.com/jm/matchy/blob/2e01918ad8d601685386aa9ac5d547ffb9b70b27/test/test_enumerable_expectations.rb | test/test_enumerable_expectations.rb | require File.dirname(__FILE__) + '/test_helper.rb'
class TestEnumerableExpectations < Test::Unit::TestCase
def test_include
[1,2,3,4].should include(4)
end
def test_include_fail
lambda {
[1,2,3,4].should include(6)
}.should raise_error(Test::Unit::AssertionFailedError)
end
def test_ex... | ruby | MIT | 2e01918ad8d601685386aa9ac5d547ffb9b70b27 | 2026-01-04T17:56:08.640464Z | false |
jm/matchy | https://github.com/jm/matchy/blob/2e01918ad8d601685386aa9ac5d547ffb9b70b27/test/ruby1.9.compatibility_tests.rb | test/ruby1.9.compatibility_tests.rb | # Eval this file with ruby 1.9
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/matchy.rb'
class TestAThing < Test::Unit::TestCase
def setup
@obj = Object.new
end
# ==
def test_operator_eql_eql
1.should == 1
end
def test_operator_eql_eql_fails
lambda {1.should == 2}.should... | ruby | MIT | 2e01918ad8d601685386aa9ac5d547ffb9b70b27 | 2026-01-04T17:56:08.640464Z | false |
jm/matchy | https://github.com/jm/matchy/blob/2e01918ad8d601685386aa9ac5d547ffb9b70b27/test/test_error_expectations.rb | test/test_error_expectations.rb | require File.dirname(__FILE__) + '/test_helper.rb'
class TestErrorExpectations < Test::Unit::TestCase
def test_raises_error
lambda { raise "FAIL" }.should raise_error
end
def test_raises_error_fail
lambda {
lambda { "WIN" }.should raise_error
}.should raise_error(Test::Unit::AssertionFailedE... | ruby | MIT | 2e01918ad8d601685386aa9ac5d547ffb9b70b27 | 2026-01-04T17:56:08.640464Z | false |
jm/matchy | https://github.com/jm/matchy/blob/2e01918ad8d601685386aa9ac5d547ffb9b70b27/test/test_minitest_compatibility.rb | test/test_minitest_compatibility.rb | require 'rubygems'
require 'minitest/unit'
load File.dirname(__FILE__) + '/../lib/matchy.rb'
MiniTest::Unit.autorun
class TestAThing < MiniTest::Unit::TestCase
def test_equal_equal
1.should == 1
end
def test_equal_equal_fails
#1.should == 2
lambda{ 1.should == 2 }.should raise_error
end
d... | ruby | MIT | 2e01918ad8d601685386aa9ac5d547ffb9b70b27 | 2026-01-04T17:56:08.640464Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.