hexsha stringlengths 40 40 | size int64 2 1.01M | content stringlengths 2 1.01M | avg_line_length float64 1.5 100 | max_line_length int64 2 1k | alphanum_fraction float64 0.25 1 |
|---|---|---|---|---|---|
91a993688cec39143b51eff3e067107554fa3eea | 559 | class JekyllAlfredJson < Jekyll::Generator
safe true
def generate(site)
items = site.posts.docs
.sort_by { |post| -post.date.to_i }
.map do |post|
{
title: post.data['title'],
arg: URI.join(site.config['url'], post.url),
variables: {
filename: post.... | 24.304348 | 70 | 0.549195 |
fffd416a23643c80fd4c818bca27afaf3ab2ba85 | 443 | # Copyright (c) 2002 Cunningham & Cunningham, Inc.
# Released under the terms of the GNU General Public License version 2 or later.
require 'test/unit'
require 'test/column_fixture_test'
require 'test/file_runner_test'
require 'test/fit_server_test'
require 'test/fixture_test'
require 'test/fixture_loader_test'
#requ... | 29.533333 | 80 | 0.810384 |
6a9b244841119876335c12f6ca2545f99b800631 | 759 | class Di < Formula
desc "Advanced df-like disk information utility"
homepage "https://gentoo.com/di/"
url "https://gentoo.com/di/di-4.44.tar.gz"
sha256 "963d00cadbf5a115ff31b31b0d6141be751c7b0a209e50990cb78e36d1a50320"
bottle do
cellar :any_skip_relocation
sha256 "24faa78ee9d622d8316595e38d19e5ba40da... | 33 | 93 | 0.781291 |
7ae09880c80b64d073d9f744bbab8cd8916de1c6 | 2,002 | class Mawk < Formula
desc "Interpreter for the AWK Programming Language"
homepage "https://invisible-island.net/mawk/"
url "https://invisible-mirror.net/archives/mawk/mawk-1.3.4-20200120.tgz"
sha256 "7fd4cd1e1fae9290fe089171181bbc6291dfd9bca939ca804f0ddb851c8b8237"
license "GPL-2.0"
livecheck do
url "h... | 50.05 | 123 | 0.706294 |
5dacb7b8b26573432fe2697ace63832eab9ccbc0 | 194 | class Vehicle::Car < ActiveRecord::Base
has_many :doors, :class_name => 'Vehicle::Door', :dependent => :destroy
has_one :engine, :class_name => 'Vehicle::Engine', :dependent => :destroy
end
| 38.8 | 75 | 0.701031 |
ffc70e656db581bd0ec5ce04017d7ab91ffe9154 | 907 | ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
require "minitest/reporters"
Minitest::Reporters.use!
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
include ApplicationHelper
# Add more... | 28.34375 | 82 | 0.657111 |
1c02debd71a4af8cae86710e03fdb02bc206d7e5 | 726 | require_relative 'base'
module Capistrano::ZomatoDingtalk::Messaging
class Markdown < Base
def initialize(info)
@info = info || {}
end
def markdown_load(_action)
"# food@work:#{application} [#{branch}](#{release_path})\r\n\r\n**#{release_details[:name]}**\n\n###{release_details[:notes]}"
... | 23.419355 | 132 | 0.523416 |
795cc81a69c758af748aa95ae773ca61ded88426 | 322 | require 'test_helper'
class HomeControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end
test "should get board" do
get :board
assert_response :success
end
test "should get donors" do
get :donors
assert_response :success
end
en... | 16.947368 | 53 | 0.71118 |
e2acae3e5f39e95236425cee21a569fa65f286dd | 7,647 | And(/^I tap on the "(.*?)" button$/) do |element|
case element.downcase
when 'hide keyboard'
ReusableFunction.hide_keyboard_option
when 'maybe later'
on(SignUpScreen).tap_maybe_later_btn
when 'add chat'
on(DMInboxScreen).tap_add_chat_btn
when 'see more'
on(StreamScreen).tap_see_more_btn
when... | 30.959514 | 122 | 0.701582 |
acbe4ca0f86dad833de835660cf9ddff9ccf2480 | 1,330 | require 'test_helper'
class UsersLoginTest < ActionDispatch::IntegrationTest
def setup
@user = users(:chase)
end
test "login with invalid information followed by logout" do
get login_path
post login_path, params: { session: { email: @user.email,
passwo... | 30.227273 | 67 | 0.675188 |
bfd466be86f79353dbab99cbe6f1cff8acc73c8c | 4,096 | require 'rails_helper'
require 'tariff_synchronizer'
describe TariffSynchronizer::BaseUpdate do
include BankHolidaysHelper
before do
stub_holidays_gem_between_call
end
describe "#file_path" do
before do
allow(TariffSynchronizer).to receive(:root_path).and_return("data")
end
context "whe... | 34.711864 | 163 | 0.69873 |
ed689c790a3b33f01c61c456521c08ce6cab1afe | 552 | require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
describe "simple cases:" do
before(:each) do
@sm = Statemachine::Statemachine.new
@sm.context = self
@count = 0
@proc = Proc.new {@count = @count + 1}
end
it "reset" do
Statemachine.build(@sm) { |s| s.trans :start, :blah, :e... | 20.444444 | 70 | 0.597826 |
d58dc63263d661b3935e296c0ee53e537642df61 | 1,455 | #!ruby
require 'yaml'
require_relative 'lib/bayonetta'
vertex_type = Hash::new { |hash, key| hash[key] = [] }
if File.exist?("vertex_type_database.yaml")
vertex_type.update YAML::load_file("vertex_type_database.yaml")
else
end
wmb_block = lambda { |name, f, fname|
begin
f.rewind
w = Bayonetta::WMBFile::lo... | 23.852459 | 109 | 0.566323 |
1c70ff71cbb72f9c6cde08956ebfee9ae4d9a36a | 546 | # frozen_string_literal: true
require_dependency 'claims_api/json_marshal'
require_dependency 'claims_api/concerns/file_data'
module ClaimsApi
class SupportingDocument < ApplicationRecord
include FileData
belongs_to :auto_established_claim
validates :auto_established_claim_id, presence: true
alias... | 22.75 | 88 | 0.783883 |
e24c30627ccd847bf4c80bb18cd018e54df15579 | 1,952 | class Abyss < Formula
desc "Genome sequence assembler for short reads"
homepage "http://www.bcgsc.ca/platform/bioinfo/software/abyss"
url "https://github.com/bcgsc/abyss/releases/download/2.0.2/abyss-2.0.2.tar.gz"
sha256 "d87b76edeac3a6fb48f24a1d63f243d8278a324c9a5eb29027b640f7089422df"
revision 3
bottle d... | 34.857143 | 105 | 0.692111 |
b99af7352347c4cd475d6faf45425070711d14f1 | 2,923 | require "rails_helper"
RSpec.describe "/admin/volunteers", type: :request do
before(:each) do
sign_in create(:user, role: :admin)
end
let(:valid_attributes) do
attributes_for(:user)
end
let(:invalid_attributes) do
attributes_for(:user, email: "")
end
describe "GET /index" do
context "w... | 35.646341 | 139 | 0.660965 |
61bed8d46b2ccad72d996fd3399940958caed141 | 4,242 | # encoding: utf-8
require File.expand_path('../../spec_helper.rb', __FILE__)
require 'frank/publish/ftptls'
describe Frank::Publish::FTPTLS do
let(:publisher) do
Frank::Publish::FTPTLS.new(Frank.publish) do |ftp|
ftp.username = 'my_username'
ftp.password = 'my_password'
ftp.hostname = 'ftp.ex... | 29.458333 | 99 | 0.647808 |
f7f839d66eb06d6da9b11ccb42739d3005f0610b | 1,226 | #
# MMMLoadable. Part of MMMTemple.
# Copyright (C) 2015-2020 MediaMonks. All rights reserved.
#
Pod::Spec.new do |s|
s.name = "MMMLoadable"
s.version = "1.5.4"
s.summary = "A simple model for async calculations"
s.description = "#{s.summary}."
s.homepage = "https://github.com/mediamonks/#{s.name}"
s.lice... | 26.085106 | 94 | 0.647635 |
bbd687b81e54c093b7636f6b6c9a6b077e723b90 | 1,763 | require "test_helper"
class UserTest < ActiveSupport::TestCase
def setup
@user = User.new(name: "Example User", email: "user@example.com",
password: "foobar", password_confirmation: "foobar")
end
test "should be valid" do
assert @user.valid?
end
test "name should be present" d... | 26.712121 | 78 | 0.669314 |
e20a64e8f7a6f53fe4c5207b86e1ea0cffa51d94 | 3,184 | require 'sinatra'
require 'sinatra/contrib'
get '/' do
<<-EOHTML
<a href="/link">Link</a>
<a href="/form">Form</a>
<a href="/cookie">Cookie</a>
<a href="/link-template">Link template</a>
EOHTML
end
get '/link' do
<<-EOHTML
<a href="/link/straight#/?input=default">Li... | 23.761194 | 91 | 0.459485 |
ff4dae9e51cb508da370a744bb467709bb8eee42 | 1,322 | ActiveRecord::ConnectionAdapters::SchemaStatements.module_eval do
def initialize_schema_information_with_plugins
initialize_schema_information_without_plugins
begin
execute "CREATE TABLE #{Desert::PluginMigrations::Migrator.schema_info_table_name} (plugin_name #{type_to_sql(:string)}, version #{type_to... | 38.882353 | 165 | 0.747352 |
acc26652a6bc234417821c7911434eb876c812bb | 5,247 | require 'puppet'
require 'spec_helper'
require 'puppet_spec/compiler'
require 'unit/parser/methods/shared'
describe 'the collect method' do
include PuppetSpec::Compiler
before :each do
Puppet[:parser] = "future"
end
context "using future parser" do
context "in Ruby style should be callable as" do
... | 34.071429 | 85 | 0.541262 |
1a16840543015bb4b1c2e748226455c21979b002 | 3,904 | # frozen_string_literal: true
require 'rails_helper'
# rubocop:disable Metrics/BlockLength
RSpec.describe Api::V1::PresentationsController, type: :controller do
let!(:demo) { create(:demo) }
let!(:slide_one) { create(:slide, :web, demo: demo) }
let(:json_body) { JSON.parse(response.body) }
let(:now) { Time.no... | 26.739726 | 86 | 0.613986 |
7af38706dedf3e01cef3cae2ce3ee052f239d4c5 | 329 | require_relative 'version'
module SugarRefinery
module StringOp
refine String do
def -(rem)
gsub( Regexp === rem ? rem : rem.to_s, '' )
end
def ^(pos)
pos = pos.to_i
if pos >= 0
self[pos..-1]
else
self[0...pos]
end
end
end
... | 15.666667 | 51 | 0.483283 |
879390541afad6fe87d8ad31654a719e73bb1ea6 | 484 | require 'securerandom'
require 'base64'
require 'fluent/plugin/filter'
module Fluent::Plugin
class ElasticsearchGenidFilter < Filter
Fluent::Plugin.register_filter('elasticsearch_genid', self)
config_param :hash_id_key, :string, :default => '_hash'
def initialize
super
end
def configure(... | 18.615385 | 70 | 0.696281 |
1dd1d63bdbc8ecb9e0f8209d4a52a8f3f0530698 | 148 | def fizzbuzz(int)
if int % 3 == 0 && int % 5 == 0
"FizzBuzz"
elsif int % 3 == 0
"Fizz"
elsif int % 5 == 0
"Buzz"
else
end
end
| 13.454545 | 33 | 0.486486 |
5d8a90d3d5b79688d8aae8920547b89d1db7005a | 1,432 | class Dcd < Formula
desc "Auto-complete program for the D programming language"
homepage "https://github.com/dlang-community/DCD"
url "https://github.com/dlang-community/DCD.git",
tag: "v0.13.4",
revision: "8dce131a8ec715382a104feed52d08a1aacdc960"
license "GPL-3.0-or-later"
head "https://git... | 34.926829 | 138 | 0.724162 |
03cbb6c58c7f0ab44cc84755db658f94d5de86bd | 1,595 | # frozen_string_literal: true
# The following comments fill some of the gaps in Solargraph's understanding of
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but
# ignored at runtime.
#
# You can put this file anywhere in the project, as long as it gets included in
# the workspace maps. It's rec... | 33.93617 | 79 | 0.705956 |
1afeab17741b3ffaf78d6ddbe31a0058ad038d5b | 2,533 | # == Schema Information
#
# Table name: images
#
# id :integer not null, primary key
# caption :string(255)
# location :string(255)
# credit :string(255)
# original_file_name :string(255)
# original_content_type :string(255)
# original_file... | 26.663158 | 79 | 0.641532 |
b94cede1bdf4774fddba0a7d63ed829fbe84d5ca | 1,698 | class Zeek < Formula
desc "Network security monitor"
homepage "https://www.zeek.org"
url "https://github.com/zeek/zeek.git",
tag: "v4.0.0",
revision: "7b5263139e9909757c38dfca4c99abebf958df67"
license "BSD-3-Clause"
head "https://github.com/zeek/zeek.git"
bottle do
sha256 arm64_big_sur... | 34.653061 | 92 | 0.647821 |
62584b39cc1092c048e9d1f5e10ef91d34000301 | 504 | # frozen_string_literal: true
require 'bundler/setup'
require 'rubybrainz'
require 'vcr'
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = '.rspec_status'
# Disable RSpec exposing methods globally on `Module` and `main`
config.dis... | 21.913043 | 66 | 0.753968 |
f8b897f48479527184bdefa291b60a2a167af892 | 790 | class Api::V1::SessionsController < ApplicationController
include CurrentUserConcern
def create
user = User.find_by(email: params['user']['email'])
if user.present? && user.authenticate(params['user']['password'])
session[:user_id] = user.id
render json: {
status: :created,
log... | 20.789474 | 89 | 0.616456 |
6aa264d766625f7df48b8281854a6ecb9a01ee3d | 5,935 | module ActiveRecord
module ConnectionAdapters
module PostgreSQL
module DatabaseStatements
def explain(arel, binds = [])
sql = "EXPLAIN #{to_sql(arel, binds)}"
PostgreSQL::ExplainPrettyPrinter.new.pp(exec_query(sql, 'EXPLAIN', binds))
end
def select_value(arel, na... | 34.707602 | 100 | 0.560573 |
915fccb626194fb61307872d948005b9c7ca5205 | 639 | require 'rubygems'
require 'rack'
module Rack
class Exceptional
def initialize(app, api_key = nil)
@app = app
if api_key.nil?
exceptional_config = "config/exceptional.yml"
::Exceptional::Config.load(exceptional_config)
else
::Exceptional.configure(api_key)
::Exc... | 22.821429 | 77 | 0.638498 |
bf7be639c82d3b783860ace9998c9b1d704ad461 | 1,812 | require 'rubygems/test_case'
require 'rubygems/commands/which_command'
class TestGemCommandsWhichCommand < Gem::TestCase
def setup
super
Gem::Specification.reset
@cmd = Gem::Commands::WhichCommand.new
end
def test_execute
util_foo_bar
@cmd.handle_options %w[foo_bar]
use_ui @ui do
... | 21.571429 | 81 | 0.663907 |
bf33bcbc33b65b1dedd749b568a2d75ec1d76782 | 275 | # encoding: UTF-8
require 'rack/head'
require 'merb-core/rack/middleware'
module Merb
module Rack
# Merbified Rack::Head
#
# @see Merb::Rack::DeferrableMiddleware
class Head < ::Rack::Head
include Merb::Rack::DeferrableMiddleware
end
end
end
| 16.176471 | 46 | 0.672727 |
1d17f7ed25760b71ea0c9160942c9d884382eae3 | 5,618 | module Hobo
module Dryml
class DrymlSyntaxError < RuntimeError; end
class DrymlException < Exception
def initialize(message, path=nil, line_num=nil)
if path && line_num
super(message + " -- at #{path}:#{line_num}")
else
super(message)
end
end
... | 33.843373 | 115 | 0.61036 |
f781a3976b7bc8fd5c9cd5c0c243635e7d441699 | 534 | class UserMailer < ApplicationMailer
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.user_mailer.account_activation.subject
#
def account_activation(user)
@user = user
mail to: user.email, subject: "Account activation"
end
# Subject can be... | 22.25 | 65 | 0.696629 |
919561cb06da9efb6ceccab072c58fd5a80a75bd | 144 | # frozen_string_literal: true
require 'solidus_core'
require 'solidus_support'
require 'solidus_demo1/version'
require 'solidus_demo1/engine'
| 18 | 31 | 0.826389 |
61975fca009a383c12154d824d8d806b1745ea21 | 211 | # frozen_string_literal: true
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../config/environment', __dir__)
require 'rails/test_help'
module ActiveSupport
class TestCase
fixtures :all
end
end
| 17.583333 | 58 | 0.744076 |
394a9116f5ca7963a42bafc8167369b9dfcd9f94 | 52 | module NormalizedProperties
VERSION = "1.0.0"
end
| 13 | 27 | 0.75 |
4a977e3558d43f7cd2131748bb0e829d4c990a00 | 390 | # frozen_string_literal: true
require_relative './page_size_for_helper'
module Pagination
module TotalPagesForHelper
include Pagination::PageSizeForHelper
def pagination_total_pages_for(set)
total_set_size = set.instructions.dig(:paginate, :count)
return 1 if total_set_size.zero?
(total_... | 22.941176 | 64 | 0.764103 |
ff4228c9b99629de4932c08a014010988e5bc6af | 9,761 | require 'spec_helper'
# user GET /users/:username/
# user_groups GET /users/:username/groups(.:format)
# user_projects GET /users/:username/projects(.:format)
# user_contributed_projects GET /users/:username/contributed(.:format)
# user_snippets ... | 33.775087 | 109 | 0.637025 |
1a6771cc1464353f43fef4c4ec47bffa7d046499 | 1,326 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Cosmosdb::Mgmt::V2020_03_01
module Models
#
# Cosmos DB resource auto-upgrade policy
#
class AutoUpgradePolicyResource
... | 27.061224 | 77 | 0.588235 |
877837dd9b1af0e11bdbe5820e44cf14fe95aaa7 | 1,436 | # frozen_string_literal: true
require 'test_helper'
class HollabackTest < Minitest::Test
def test_version
refute_nil ::Hollaback::VERSION
end
def test_hollaback
stdout, = capture_io { sequence.call(Callbacker.new('Kevin')) }
assert_equal %w[hello before main after goodbye-Kevin], stdout.split("\n")... | 22.092308 | 80 | 0.6539 |
26072bcca0648378d66113e0f6c9e2709ad1cb6d | 122 | class AddUrlToPortfolios < ActiveRecord::Migration[5.2]
def change
add_column :portfolios, :url, :string
end
end
| 20.333333 | 55 | 0.737705 |
ac106a16db6cbb6e46d41a8cdd799d58684bfd51 | 564 | cask "hubstaff" do
version "1.6.1,3510"
sha256 "5c655cb34d4a173a7b888795c6c4618cc89707d13531c63544533e5e0ece1c75"
url "https://app.hubstaff.com/download/#{version.after_comma}-mac-os-x-#{version.before_comma.dots_to_hyphens}-release"
name "Hubstaff"
desc "Work time tracker"
homepage "https://hubstaff.com/"... | 29.684211 | 121 | 0.687943 |
266e04c73a7ae63b7b3a740da6c94f75506147bd | 159 | namespace :grant do
namespace :db_privs do
task :run, [:force] => :environment do |t, params|
Util::DbManager.new.grant_db_privs
end
end
end
| 19.875 | 54 | 0.666667 |
38c751fdda5c23c8a5322db7bc2ace036e56b88a | 2,616 | module MiniTest
module Chef
module Lookup
# Load the test suites.
#
# If the option "path" is specified we use it to load the tests from it.
# The option can be a string or an array of paths.
# Otherwise we load the tests according to the recipes seen.
#
def require_test... | 35.351351 | 90 | 0.629205 |
4a3939df31f95a60be420bd4bd6f6d348af795e3 | 747 | require 'beaker-rspec'
require 'beaker-puppet'
require 'beaker/puppet_install_helper'
require 'beaker/module_install_helper'
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
# Readable te... | 29.88 | 100 | 0.720214 |
28810022374fffd9f4261561bac85856350847ae | 12,167 | require "cli/ui"
module Script
module UI
module ErrorHandler
def self.display(failed_op:, cause_of_error:, help_suggestion:)
$stderr.puts(CLI::UI.fmt(ShopifyCLI::Context.message("script.error.generic")))
full_msg = failed_op ? failed_op.dup : ""
full_msg << " #{cause_of_error}" if c... | 49.060484 | 114 | 0.659324 |
6a90a176e8a258472b84a3b6bce3a56d6db3a808 | 292 | cask "font-esteban" do
version :latest
sha256 :no_check
url "https://github.com/google/fonts/raw/main/ofl/esteban/Esteban-Regular.ttf",
verified: "github.com/google/fonts/"
name "Esteban"
homepage "https://fonts.google.com/specimen/Esteban"
font "Esteban-Regular.ttf"
end
| 24.333333 | 81 | 0.722603 |
1c0da51cd621b4cfca3df6a3b9dc3c0d21fffa94 | 6,245 | require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold... | 39.03125 | 112 | 0.711289 |
6ad502a65b32bd1030bacdd448bd272c1e811f1f | 8,249 | require 'spec_helper'
require 'serverspec_extended_types/http_get'
describe 'Serverspec::Type.bitlbee' do
it 'instantiates the class with the correct parameters' do
expect(Serverspec::Type::Bitlbee).to receive(:new).with(1, 'mynick', 'mypass', false)
bitlbee(1, 'mynick', 'mypass')
end
it 'returns the new... | 43.415789 | 112 | 0.670384 |
393aa18cb46f128f28e3b9d3bfae08fac00bd2b2 | 783 | room(:station_charlie) do
self.exit_north = :food_farm
self.destination = :station_delta
self.desc = <<-DESC
I am standing on a metallic platform in a large dome. A brightly lit
sign above the walkway says TRAVEL-TUBE STATION CHARLIE. A walkway
leads NORTH.
DESC
self.short_desc = "Charlie Station.... | 29 | 72 | 0.67433 |
1870b7d53e5fd5953b4a016182145743562f9c73 | 265 | class CreateCourseLevels < ActiveRecord::Migration
def change
create_table :course_levels do |t|
t.references :course
t.string :title
t.text :description
t.text :question
t.text :answer
t.timestamps
end
end
end
| 17.666667 | 50 | 0.641509 |
d5abdc5f4e2cd14590cda4b037f92ca8da23013c | 908 | require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Comunidadmexico
class Application < Rails::Application
config.generators do |g|
g.test_framework :rspec,
... | 29.290323 | 82 | 0.719163 |
7aa0a3485fb67e8d81fac7a5b87e8eac4b49be38 | 2,445 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::JobWaiter do
describe '.notify' do
it 'pushes the jid to the named queue' do
key = 'gitlab:job_waiter:foo'
jid = 1
redis = double('redis')
expect(Gitlab::Redis::SharedState).to receive(:with).and_yield(redis)
... | 32.6 | 97 | 0.633129 |
e20f30e5dc2b3b90a8aec006fc4d5cf2a514fb8f | 2,565 | require 'capybara'
require 'capybara/poltergeist'
require 'fastimage'
require 'credentials_manager/password_manager'
require 'phantomjs/poltergeist'
# Import all the actions
require 'deliver/itunes_connect/itunes_connect_submission'
require 'deliver/itunes_connect/itunes_connect_reader'
require 'deliver/itunes_connect... | 34.2 | 105 | 0.735673 |
4a20e3e2a648c5cdc660858c61c6da0d3895b802 | 976 | cask 'unity-example@2017.1.0p1' do
version '2017.1.0p1,2f459b492f3c'
sha256 :no_check
url "https://download.unity3d.com/download_unity/2f459b492f3c/MacExampleProjectInstaller/Examples.pkg"
name 'Example Project'
homepage 'https://unity3d.com/unity/'
pkg 'Examples.pkg'
depends_on cask: 'unity@2017.1.0p1... | 27.111111 | 104 | 0.697746 |
1a940d00182744c1cfede8943f2373d3e28ce6e1 | 114 | module OmniAuth
module UserAgent
end
end
require "omniauth/version"
require "omniauth/strategies/useragent"
| 12.666667 | 39 | 0.798246 |
21076384eea0b4ebc41674510cb5b70355458bec | 2,066 | class UwWebResource < ActiveResource::Base
class << self
attr_accessor :caller_class
# Attaches our cert, key, and CA file based on the config options in web_services.yml.
def ssl_options
check_cert_paths!
@ssl_options ||= {
:cert => OpenSSL::X509::Certificate.n... | 37.563636 | 137 | 0.649564 |
f8cacae79a27976f31a82e89cbac9255f3360808 | 3,696 | ENV["RAILS_ENV"] = 'test'
RAILS_ENV = 'test'
BASE_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '../../'))
require 'fileutils'
require 'spec'
require File.join(BASE_ROOT, 'spec/matchers/generator_matchers')
require File.join(BASE_ROOT, 'lib/plugins/string_extensions/lib/string_extensions')
unless defined?(... | 26.589928 | 120 | 0.684524 |
012c775c16b6987531ceb0970a0d97130a560a25 | 1,449 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 's3_html/version'
Gem::Specification.new do |spec|
spec.name = "s3_html"
spec.version = S3Html::VERSION
spec.authors = ["altantur"]
spec.email = ["bayarsaikhan... | 39.162162 | 96 | 0.668047 |
337895e0fbcafa1e52dbe7e871dce9a187ec57c2 | 23,841 | # ==========================================
# CMock Project - Automatic Mock Generation for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
# ==========================================
require File.expand_path(File.dir... | 59.30597 | 207 | 0.676104 |
e8aecc3a4a2f28dcc383a9fe849bdcdc521c9eb9 | 154 | class AddHelpPageCountToGame < ActiveRecord::Migration
def change
add_column :games, :help_pages_count, :integer, default: 0, null: false
end
end
| 25.666667 | 75 | 0.766234 |
bba4f4de8c43a67866bbd78379f8575632146645 | 733 | require 'test_helper'
class BlogCategoriesControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end
test "should get show" do
get :show
assert_response :success
end
test "should get new" do
get :new
assert_response :success
end
... | 16.288889 | 63 | 0.687585 |
03afc2b2953701a1868780c899e78f2bed8ff263 | 5,950 | # -*- encoding: utf-8 -*-
class Library < ActiveRecord::Base
attr_accessible :name, :display_name, :short_display_name, :zip_code, :street,
:locality, :region, :telephone_number_1, :telephone_number_2, :fax_number,
:note, :call_number_rows, :call_number_delimiter, :library_group_id,
:country_id, :opening_... | 33.615819 | 226 | 0.658824 |
ab05b476522068e5f7634d84602873a02873132e | 2,839 | require 'glib2'
require 'gnomevfs.so'
module GnomeVFS
class FileInfo
alias setuid? suid?
alias setgid? sgid?
def <=>(other)
unless other.is_a?(FileInfo)
nil
else
mtime <=> other.mtime
end
end
include Comparable
end
class File
class <<self
def for... | 25.576577 | 62 | 0.579782 |
26ff2efd6b318e05bf39e66676db00676add152a | 4,282 | 1.upto(14) do |i|
Name "gt cds test #{i}"
Keywords "gt_cds"
Test do
run_test "#{$bin}gt cds -minorflen 1 -startcodon yes " +
"-seqfile #{$testdata}gt_cds_test_#{i}.fas -matchdesc " +
"#{$testdata}gt_cds_test_#{i}.in"
run "diff #{last_stdout} #{$testdata}gt_cds_test_#{i}.out"
en... | 32.938462 | 88 | 0.663008 |
ace65ec284adaeca8a5e0fc1c4b7ec02b35b31ba | 2,034 | #
# Be sure to run `pod lib lint iAirportsDB.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'iAirport... | 42.375 | 333 | 0.673058 |
61ea6cd3f4b7aa46f4ee85354769b16adc996f60 | 182 | require 'gom'
require 'gom/couchdb-adapter'
require File.join(File.dirname(__FILE__), "storage")
GOM::Storage::Adapter.register :elasticsearch, GOM::Storage::ElasticSearch::Adapter
| 30.333333 | 83 | 0.785714 |
e9bbdcad7f6db53019a6100f3e92995340cbc79c | 231 | Alchemy::Modules.register_module({
engine_name: 'spree',
name: 'solidus',
navigation: {
controller: 'spree/admin/orders',
action: 'index',
name: 'Shop',
image: 'alchemy/solidus/alchemy_module_icon.png'
}
})
| 21 | 52 | 0.658009 |
ab67504f8513278e414f79b345a6d655d546ecce | 250 | require 'test_helper'
class UserTest < ActiveSupport::TestCase
test 'should not save without email or password' do
invalid = User.new
assert_not invalid.valid?
invalid[:email] = 'abc123@aol.com'
assert_not invalid.valid?
end
end
| 22.727273 | 53 | 0.724 |
e962ddaececec91a575de6dbaef278b34df0e891 | 1,263 | # WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'aws-sdk-core'
require 'aws-sigv4'
require_relative 'aws-sdk-dynamodb/types'
require_relative 'aws-sdk-... | 25.26 | 83 | 0.751386 |
281906e6a30595bbcc0783f81e1bbbcd7c5b001d | 236 | class Users < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.boolean :admin, :default => false
t.string :identifier
t.string :token
end
end
def self.down
drop_table :users
end
end | 18.153846 | 41 | 0.644068 |
7a2bd8d4074a2219ce65b89f66a56e7c65501e05 | 394 | class CreateAbuseReportSubject < ActiveRecord::Migration[5.2]
def change
create_table :abuse_report_subjects, id: :uuid do |t|
t.references :abuse_report, type: :uuid, foreign_key: true
t.references :account, type: :uuid, foreign_key: true
t.references :project, type: :uuid, foreign_key: true
... | 35.818182 | 64 | 0.708122 |
bf28f59631b318663e02ee3c544c2f5e32c706a6 | 212 | module VCAP::CloudController
class OrganizationManager < Sequel::Model(:organizations_managers)
include OrganizationRoleMixin
def type
@type ||= RoleTypes::ORGANIZATION_MANAGER
end
end
end
| 21.2 | 68 | 0.75 |
21325d53fe0ab226dcf40bbde58547d708d63967 | 373 | #!/bin/ruby
require_relative 'player.rb'
require_relative 'gather.rb'
require_relative 'cards.rb'
require_relative 'game.rb'
require_relative 'dealing.rb'
system("clear")
Gather.players(2)
while Game.keep_going?()
Dealing.rotate()
Cards.newdeck()
Cards.shuffle()
Player.draw()
Cards.set_trump()
Game.change_c... | 16.954545 | 29 | 0.745308 |
7a0b3f52717170d8f7363f3deef21438a1d0b442 | 601 | module Doorkeeper
class Application
include Mongoid::Document
include Mongoid::Timestamps
self.store_in collection: :oauth_applications
field :name, :type => String
field :uid, :type => String
field :secret, :type => String
field :redirect_uri, :type => String
index({ uid: 1 }, { un... | 26.130435 | 112 | 0.68386 |
ffe2f4ebf2c00f61ee778dfe9fe0d5eeb7e86f4f | 6,931 | # frozen_string_literal: true
require_relative 'spec_helper'
module Basic101
describe BasicString do
it_behaves_like 'a basic object' do
let(:default_value) {''}
end
describe 'type_name' do
let(:type_name) {'string'}
subject {described_class.new(0)}
specify {expect(subject.cla... | 23.103333 | 68 | 0.562834 |
87513a3eb8c08b7277efa49bc7f76dd88463a22d | 679 | # typed: false
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
describe "brew outdated" do
it_behaves_like "parseable arguments"
it "outputs JSON", :integration_test do
setup_test_formula "testball"
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
expected_json = {
formulae... | 23.413793 | 49 | 0.594993 |
6241c3713c9c61f9af8ec45b541b5f1935f49b84 | 47 | default['traefik']['domain'] = 'home.cobus.io'
| 23.5 | 46 | 0.659574 |
e957e24b5e0c277a8c01481d9f1cd146895e5625 | 1,858 | require 'test_helper'
class TypeTest < Test::Unit::TestCase
def test_create_type
assert_exception(ActiveRecord::StatementInvalid, "Missing columns") {
@connection.create_type("user", {})
}
assert_exception(ActiveRecord::StatementInvalid, "Missing columns") {
@connection.create_type("user", []... | 37.16 | 152 | 0.652853 |
33a0e0f5f885d51751e6e770e89fe7af757db56b | 4,348 | # frozen_string_literal: true
# rubocop:disable Scalability/IdempotentWorker
module ObjectStorage
class MigrateUploadsWorker
include ApplicationWorker
include ObjectStorageQueue
feature_category_not_owned!
loggable_arguments 0, 1, 2, 3
SanityCheckError = Class.new(StandardError)
class Migr... | 30.405594 | 168 | 0.674103 |
e206e9f04ad34373eb8caffcf0a5f34c38a2d181 | 643 | require 'tzinfo'
set :output, "/home/deploy/apps/simple-server/shared/log/cron.log"
env :PATH, ENV['PATH']
DEFAULT_CRON_TIME_ZONE='Asia/Kolkata'
def local(time)
TZInfo::Timezone.get(DEFAULT_CRON_TIME_ZONE).local_to_utc(Time.parse(time))
end
every :day, at: local('11:00 pm').utc, roles: [:cron] do
rake 'appointm... | 29.227273 | 77 | 0.772939 |
28ede88721818d183b70e2e7f140fa8a6cf01c26 | 314 | ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::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...
end
| 28.545455 | 82 | 0.729299 |
6ab50eff2fd1f7f2a29de8eec77835ad2c3f58d8 | 4,177 | RSpec.describe Metric::Common do
let(:host) { FactoryBot.create(:host) }
let(:metric) do
FactoryBot.create(:metric_rollup_host_hr,
:resource => host,
:timestamp => Time.now.next_week(:sunday).utc
)
end
describe "#v_month" do
it "retur... | 39.780952 | 98 | 0.510654 |
ff3751bbbd2d4a28ff244a4e8f17b0af107d3222 | 183 | class ProductDecorator < Draper::Decorator
delegate_all
def as_json *args
{
id: id,
name: name,
description: description,
price: price
}
end
end | 15.25 | 42 | 0.612022 |
ed81bbe1fa3264009fa440de0984589a233ba937 | 282 | require "application_system_test_case"
class InHttpTest < ApplicationSystemTestCase
include ConfigurableDaemonSettings
setup do
login_with(FactoryBot.build(:user))
@type = "in_http"
@form_name = "port"
@form_value = "12345"
@daemon = stub_daemon
end
end
| 20.142857 | 44 | 0.730496 |
3850847ba7a632eaeaa5c0e35cdea321a500e89f | 513 | require File.dirname(__FILE__) + '/spec_helper'
describe "model.specdoc" do
before(:all) do
SpecDoc2.auto_migrate!
end
subject { SpecDoc2.specdoc }
it "should provide the specdoc of model" do
# print subject
should include("- should be present")
should include("- should be unique")
shou... | 20.52 | 51 | 0.678363 |
1c0693986dd8e5262ff9698d456d042b91becf61 | 872 | require 'rails/generators'
require 'rails/generators/migration'
require "rails/generators/active_record/migration"
module Proteus
module Generators
class InstallGenerator < Rails::Generators::Base
include ActiveRecord::Generators::Migration
class_option :encryption_engine, type: :string, default: "no... | 26.424242 | 69 | 0.677752 |
bf19d5c6b53205e2278b234839b94f8d2c86d238 | 1,742 | require 'test_helper'
module CLI
module Kit
class UtilTest < Minitest::Test
def test_to_filesize
assert_equal('0B', CLI::Kit::Util.to_filesize(0))
assert_equal('0 B', CLI::Kit::Util.to_filesize(0, space: true))
assert_equal('10B', CLI::Kit::Util.to_filesize(10 * 1024**0))
... | 40.511628 | 85 | 0.621125 |
615d82de372bfb3585064d39a2c6ff3c2e2bd540 | 1,655 | if RUBY_PLATFORM == "java"
$LOAD_PATH.insert(0, "./lib")
end
unless ENV['MSPEC_RUNNER']
begin
require "pp"
require 'mspec/version'
require 'mspec/helpers'
require 'mspec/guards'
require 'mspec/runner/shared'
require 'mspec/matchers/be_ancestor_of'
require 'mspec/matchers/out... | 30.648148 | 77 | 0.636858 |
f85ced117043b80e960721016a6fad0866906815 | 4,128 | #! /usr/bin/env ruby
#
# check-mesos-cpu-balance
#
# DESCRIPTION:
# This plugin checks that there is less CPU imbalance than specified on a certain mesos cluster
#
# OUTPUT:
# plain text
#
# PLATFORMS:
# Linux
#
# DEPENDENCIES:
# gem: sensu-plugin
# gem: rest-client
# gem: json
#
# USAGE:
# #YELLOW
#
# ... | 26.632258 | 129 | 0.615068 |
33f7d7d68d7db0f786877480edcc74c3d54ea907 | 115 | # frozen_string_literal: true
class DataMigration < ActiveRecord::Base
validates :version, uniqueness: true
end
| 19.166667 | 40 | 0.8 |
1c12a0626d16195c8ebc83a5d0d8b946e3f9bfeb | 1,071 | require 'data_objects'
if RUBY_PLATFORM =~ /java/
require 'do_jdbc'
require 'java'
module DataObjects
module Postgres
JDBC_DRIVER = 'org.postgresql.Driver'
end
end
begin
java.lang.Thread.currentThread.getContextClassLoader().loadClass(DataObjects::Postgres::JDBC_DRIVER, true)
rescue java... | 26.775 | 110 | 0.744164 |
bbb7d36afe0494fa05ce64c8f4e638c5fed65d74 | 1,080 | lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'slimkeyfy/version'
Gem::Specification.new do |s|
s.name = "slimkeyfy"
s.version = SlimKeyfy::VERSION
s.platform = Gem::Platform::RUBY
s.homepage = %q{https://phrase.com/}
s.autho... | 38.571429 | 198 | 0.664815 |
ff457c7a0b460626086ba2562af2775b754e4787 | 2,124 | require 'spec_helper'
describe 'smokeping' do
let :node do
'agent.example.com'
end
on_supported_os.each do |os, facts|
context "on #{os} " do
let :facts do
facts
end
let :params do
{
cgiurl: 'http://some.url/smokeping.cgi',
master_url: 'http://somew... | 25.902439 | 71 | 0.510358 |
f8d7abef24a4a960b9ddc4fee79067cc0c0256b2 | 448 | # frozen_string_literal: true
module RgGen
module Core
class CLI
def initialize(builder = nil)
@builder = builder || Builder.create
@options = Options.new
end
attr_reader :builder
attr_reader :options
def run(args)
options.parse(args)
runner.run(bui... | 16.592593 | 44 | 0.591518 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.