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 |
|---|---|---|---|---|---|
26fca9db697b76aa93cd274e7a12e2e335f92ffb | 634 | module SpecHelpers
def event_hash(options = {})
{
address: options.fetch(:address, ethereum_address),
blockHash: options.fetch(:block_hash, ethereum_txid),
blockNumber: options.fetch(:block_number, rand(1_000_000_000)),
data: options.fetch(:data, SecureRandom.hex),
logIndex: options.... | 39.625 | 71 | 0.711356 |
38ee75f19304d8d22cbaf8a13fd67aacef184eb1 | 24,629 | # -*- encoding: utf-8; frozen_string_literal: true -*-
#
#--
# This file is part of HexaPDF.
#
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
# Copyright (C) 2014-2019 Thomas Leitner
#
# HexaPDF is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero Genera... | 38.066461 | 102 | 0.657152 |
184cec3566abfdc24d79f506f2db3cca15e7974c | 264 | class UserMailer < ActionMailer::Base
default from: "360Fly <welcome@menud.com>"
def signup_email(user)
@user = user
@twitter_message = "#360Fly is changing the game…again!"
mail(:to => user.email, :subject => "Thanks for signing up!")
end
end
| 24 | 65 | 0.67803 |
d5ea01de527761fb956d79727771b8287dd0c1a3 | 3,459 | =begin
#BillForward REST API
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file e... | 37.597826 | 173 | 0.710899 |
01d0b7bc71a41ca287490f0d01223158b6a23d98 | 97 | module ActiveList
module Definition
class StatusColumn < AttributeColumn
end
end
end
| 13.857143 | 40 | 0.752577 |
ff1066e8f941e0d6365205a4870706358e906706 | 735 | # frozen_string_literal: true
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 Friends
class Application < Rails::Application
# Initialize configuration defaults f... | 29.4 | 79 | 0.740136 |
d5bf4c5a901923e7511dabbf2515cd576d07404a | 716 | # frozen_string_literal: true
class RetailChainSummary
def self.process
retail_chain_visitors = retail_chains_with_visitors.map do |retail|
visitors = retail_chains_order(retail)
retail_chains_attrs(retail, visitors)
end
{ total: retail_chains_count, retail_chain_visitors: retail_chain_visito... | 22.375 | 80 | 0.73743 |
01f2214cc78b790beea436a6700a8a1588b73372 | 724 | # encoding: utf-8
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/whois.nic.coop/coop/property_status_single.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec_helper'
r... | 24.133333 | 81 | 0.722376 |
08d92b7f66931d1a7ceff77ba7c08c3f0dc8d394 | 921 | Pod::Spec.new do |s|
s.name = "SimpleIOSViewStackController"
s.version = "0.1"
s.summary = "A view stack based on a UINavigationController which navigates to previously registered UIViewControllers upon receiving NSNotifications."
s.description = "A view stack based on a UINavigationControlle... | 65.785714 | 257 | 0.695983 |
6a37bd9513bb4a9994953ec4833919035c5507d3 | 496 | cask 'consul@1.6.7+ent' do
version '1.6.7+ent'
sha256 'ca298c862cb0e86cdf8b728d94874b7b673410351037f2473b551fceb33f0d4a'
# releases.hashicorp.com was verified as official when first introduced to the cask
url 'https://releases.hashicorp.com/consul/1.6.7+ent/consul_1.6.7+ent_darwin_amd64.zip'
appcast 'https:/... | 31 | 89 | 0.766129 |
ede89333886872801630354c814d53025732cdb7 | 131 | require 'rails_helper'
RSpec.describe ModuleSetting, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
| 21.833333 | 56 | 0.755725 |
330f44ac536babd19b121926f2f892a7e7501bf1 | 655 | module WofWof
class Source
include Comparable
attr_reader :prerequisites
attr_reader :name
attr_accessor :path_handler
def initialize(path_handler=nil)
@prerequisites = []
@name = self.class.name.gsub(/^.*::(\w+)$/, '\1')
@path_handler = path_handler
end
def build_nod... | 22.586207 | 57 | 0.651908 |
91b4aaa0def82f0b7a8241e5f5dfbdef5c3138fe | 2,213 | class UsersController < ApplicationController
# GET: /users
get "/users" do
if logged_in?
erb :"/users/index.html"
else
redirect "/users/new"
end
end
# GET: /users/new
get "/users/new" do
if logged_in?
redirect "/users/" + current_user.id.to_s
else
erb :"/users/ne... | 20.877358 | 103 | 0.551288 |
62d9f4cffee79d6e3cb976d7dd64f457ba64e34a | 847 | require 'test_helper'
describe CommentsController do
describe 'create' do
it 'must create movie comments' do
as_logged_in_user do
movie = FactoryGirl.create :movie
post :create, { :movie_id => movie.friendly_id, :comment => FactoryGirl.attributes_for(:comment) }
response.status.must... | 33.88 | 120 | 0.678867 |
ed7f3f3dc67eaac17f929ead7b15a8d2420114f7 | 416 | require 'formula'
class Giblib < Formula
homepage 'http://freshmeat.net/projects/giblib'
url 'http://linuxbrit.co.uk/downloads/giblib-1.2.4.tar.gz'
sha1 '342e6f7882c67d2277e1765299e1be5078329ab0'
depends_on :x11
depends_on 'imlib2' => :build
def install
system "./configure", "--prefix=#{prefix}"
... | 20.8 | 60 | 0.692308 |
bb78e6356729a55026ab837041a77784cab0fff5 | 623 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Maestrano::Connector::Rails::OrganizationPolicy do
include SharedPunditExample
let!(:instance1) { create(:organization, tenant: 'default') }
let!(:instance2) { create(:organization, tenant: 'production') }
describe 'scope' do
it_behaves_l... | 27.086957 | 66 | 0.730337 |
791f504b36d3d7c4a241d4ac570550562df81bbe | 6,798 | #
# --------------------------------------------------------------------------------------------------------------------
# <copyright company="Aspose Pty Ltd" file="image_load_options.rb">
# Copyright (c) 2003-2021 Aspose Pty Ltd
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to an... | 31.618605 | 119 | 0.612827 |
2137b6a496489ec7a605245af49115010f3a85f4 | 875 | Sequel.migration do
up do
alter_table(:pallet_sequences) do
add_index :pallet_id, name: :pseq_pallet_id_idx
end
alter_table(:load_containers) do
add_index :load_id, name: :load_containers_load_id_idx
end
alter_table(:load_vehicles) do
add_index :load_id, name: :load_vehicles_load... | 27.34375 | 61 | 0.722286 |
1da7c731894c79117b6c3a8e0a401001c9fa6a42 | 568 | require 'OSM/StreamParser'
locations = nil
class OSMTestParserCallbacks < OSM::Callbacks
locations = nil
def self.locations
if locations
locations
else
#parse the test file, so we can later reference nodes and ways by name in tests
locations = {}
file = 'test/data/test.osm'
... | 22.72 | 85 | 0.670775 |
21647caf359ad56dbd5ca29c5cc7ba6d6a7f7c45 | 689 | module PluginScan
module Software
class NameConverter
def as_symbol(name)
case name.downcase
when 'adobe reader'
:ao_reader
when 'phoscode devalvr'
:ao_dvr
when 'adobe flash'
:ao_flash
when 'oracle java'
:ao_java... | 22.225806 | 38 | 0.493469 |
39c9010fe8a48ef2bb9ea1db4ed0a5d6b037f715 | 2,864 | # encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
require File.expand_path(File.join(File.dirname(__FILE__),'..', '..','test_helper'))
require 'new_relic/agent/encoding_normalizer.rb'
class Encodi... | 40.914286 | 93 | 0.758729 |
f730146ec9e5b01f45980380040bdb985123e0ad | 2,261 | module MetaProject
module Project
module Trac
class TracProject < Base
def initialize(trac_base_url, svn_root_url, svn_path)
@trac_base_url = trac_base_url
@svn_path = svn_path
@scm = RSCM::Subversion.new("#{svn_root_url}#{svn_path}", svn_path)
@tracker = ::M... | 41.87037 | 217 | 0.518797 |
2835960e7e7016faff879ab8fc20420748b70476 | 3,836 | 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... | 40.808511 | 102 | 0.756517 |
217554d2707ee2449fb3ba425a8f67e21f74eea3 | 956 | require 'haml_lint/constants'
require 'haml_lint/exceptions'
require 'haml_lint/configuration'
require 'haml_lint/configuration_loader'
require 'haml_lint/parser'
require 'haml_lint/haml_visitor'
require 'haml_lint/lint'
require 'haml_lint/linter_registry'
require 'haml_lint/ruby_parser'
require 'haml_lint/linter'
requ... | 26.555556 | 87 | 0.792887 |
335f298c6345f071e360356b972e3c2b7ba09417 | 14,274 | # frozen_string_literal: true
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 38.474394 | 193 | 0.715076 |
bf8047e951573c587f5cf5cba4ae98aae36b8529 | 916 | require 'thor'
require 'npmdc'
module Npmdc
class Cli < Thor
default_task :check
desc 'check', 'Run check'
method_option :path, desc: 'Path to package.json config'
method_option :color, desc: 'Enable color', type: :boolean, default: true
method_option :types, aliases: [:t],
... | 29.548387 | 78 | 0.562227 |
1c79bf8e226b3722a47d35a073bfaedc09bfe884 | 1,585 | module Fog
module Storage
class AWS
class Real
# Change website configuration for an S3 bucket
#
# @param bucket_name [String] name of bucket to modify
# @param suffix [String] suffix to append to requests for the bucket
# @param options [Hash]
# @option opti... | 24.384615 | 94 | 0.54511 |
5d5351eb9fe15b0ab965ef54f2ecb7f09a2d7890 | 36,505 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Packages::Package, type: :model do
include SortingHelper
it_behaves_like 'having unique enum values'
describe 'relationships' do
it { is_expected.to belong_to(:project) }
it { is_expected.to belong_to(:creator) }
it { is_expected.to... | 39.636265 | 181 | 0.655609 |
f8af4426e6d8e55f464aa6a9ea037c09af9c98f1 | 178 | class AddStripeIdToAccounts < ActiveRecord::Migration[5.0]
def change
add_column :accounts, :stripe_id, :string
add_index :accounts, :stripe_id, unique: true
end
end
| 25.428571 | 58 | 0.747191 |
5d49264e2da968198746b361ad0e2e6a5893daae | 608 | class ClearanceCreateUsers < ActiveRecord::Migration
def self.up
create_table(:users) do |t|
t.string :email
t.string :encrypted_password, :limit => 128
t.string :salt, :limit => 128
t.string :token, :limit => 128
t.datetime :token_expires_at
... | 27.636364 | 68 | 0.590461 |
e9cc9d1031fe14f1ca4dfa8b377a756bd296dd93 | 3,794 | require 'virtualbox/com/ffi/load_ffi'
require 'virtualbox/ext/logger'
module VirtualBox
module COM
class FFIInterface < BaseInterface
extend ::FFI::Library
include Logger
# Constant used to initialize the XPCOM C interface
XPCOMC_VERSION = 0x00020000
# VBOXXPCOMC struct. This typi... | 35.457944 | 118 | 0.666315 |
186bbc35d930e7b02fcc251b5104d87c3146b388 | 590 | Pod::Spec.new do |s|
s.name = "CasualUtility"
s.version = "1.0"
s.summary = "Swift tools for common tasks"
s.homepage = "https://github.com/lacyrhoades/CasualUtility"
s.license = { type: 'MIT', file: 'LICENSE' }
s.author = { "Lacy Rhoades" => "lacy@co... | 39.333333 | 82 | 0.586441 |
183df461318d10517b6fe2328027868a56bb7328 | 3,800 | 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... | 41.304348 | 102 | 0.756579 |
e8805c8c6c277b73ac2ea9babbf34b546c1d40c5 | 299 | class CreateTestResults < ActiveRecord::Migration[6.0]
def change
create_table :test_results do |t|
t.string :client_ip
t.integer :question_version
t.float :economic
t.float :diplomatic
t.float :civil
t.float :societal
t.timestamps
end
end
end
| 19.933333 | 54 | 0.655518 |
79a65cce1d65722a394b043a40756dcd1d29ee00 | 162 | class AlterPlacesAddUserIdColumn < ActiveRecord::Migration[5.0]
def change
add_column :places, :user_id, :integer
add_index :places, :user_id
end
end
| 23.142857 | 63 | 0.746914 |
7a75e3760b06101e558d08f3b9bd29c26ddbcb2f | 83 | class SinglePlatform::Configuration
attr_accessor :client_id,:secret,:api_key
end | 27.666667 | 43 | 0.843373 |
f89b6714fe22b6acb489b9031d9da32cb730b8ea | 1,214 | # frozen_string_literal: true
module Types
module Iterations
class CadenceType < BaseObject
graphql_name 'IterationCadence'
description 'Represents an iteration cadence'
authorize :read_iteration_cadence
field :id, ::Types::GlobalIDType[::Iterations::Cadence], null: false,
descr... | 35.705882 | 101 | 0.712521 |
f747e8f4bffe730dc38e29ea87a9ccf872084889 | 623 | module Xdrgen::AST
module Declarations
class Base < Treetop::Runtime::SyntaxNode
TYPE_NODES = [
Typespecs::Base,
Concerns::NestedDefinition
]
def type
search(type_s) do |node|
TYPE_NODES.any?{|t| node.is_a?(t)}
end
end
private
def sea... | 23.074074 | 54 | 0.598716 |
f741401ad3355be7a458265994ca121a00774181 | 360 | # Have Mini Profiler show up on the right
Rack::MiniProfiler.config.position = "right"
# Have Mini Profiler start in hidden mode - display with short cut (defaulted to 'Alt+P')
# Rack::MiniProfiler.config.start_hidden = true
# Don't collect backtraces on SQL queries that take less than 5 ms to execute
# Rack::MiniPro... | 40 | 89 | 0.772222 |
bfd322bb2c09964709b6292e16a4d2967d3a282d | 593 | # legge un file "merged.txt", seleziona i treni che arrivano il giorno dopo la partenza
# e li ordina per ora di arrivo crescente
dir = File.join(Dir.home, "dev", "ruby", "treni_misc", "liste_treni", "2016-03-04")
lines = File.readlines(File.join(dir, "merged.txt"))
lines.keep_if do |line|
arr = line.split("|")
a... | 39.533333 | 118 | 0.642496 |
e99d476ea152ea2d290e0e76bdcae53a25116fc5 | 2,574 | # 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::ManagedApplications::Mgmt::V2018_06_01
module Models
#
# SKU for the resource.
#
class Sku
include MsRestAzure
... | 25.235294 | 70 | 0.444056 |
0899dad34ca81ab744d4424f080add87c78f0620 | 788 | cask 'termius-beta' do
version '5.4.1'
sha256 '5544d3d79825b59612977295e55d5be58786baafffddae65bd322241d9e26b8c'
# s3.amazonaws.com/termius.desktop.autoupdate/mac was verified as official when first introduced to the cask
url 'https://www.termius.com/beta/download/mac/Termius+Beta.dmg'
name 'Termius Beta'
... | 37.52381 | 110 | 0.663706 |
115d0e37552f7a6543482bb2d418b94a00cda074 | 890 | cask 'splice' do
version '1.6.12-201601071747'
sha256 '49052352bb81cbd104b73241401e4f4a6d333749f12db32839c76e36dfc96784'
# amazonaws.com is the official download host per the appcast feed
url "https://s3-us-west-1.amazonaws.com/spliceosx/Splice.app-#{version}.zip"
appcast 'https://splice.com/appcast.xml',
... | 34.230769 | 88 | 0.660674 |
625d663955d2112b8412ae6ebb6887038eed8527 | 1,349 | # coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "slackdown/version"
Gem::Specification.new do |spec|
spec.name = "slackdown"
spec.version = Slackdown::VERSION
spec.authors = ["Bob Lail"]
spec.email = ["bob.l... | 40.878788 | 121 | 0.693847 |
1d53c32b90b2b187f389fab1943dd6e4aa701490 | 798 | require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../dummy/config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'rspec/rails'
require 'factory_bot_rails'
... | 24.181818 | 86 | 0.793233 |
11308542c380b6973e0c1c8699d45d9619c5c404 | 1,642 | # 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... | 39.095238 | 85 | 0.758222 |
7ac244d6eaff1f2e508c1584fdaae6a79ed8b6ba | 422 | module ApplicationHelper
################
# 定数宣言
# MeetingType IDs
FREE_MEETING_TYPE_ID = 1
PROJECT_MEETING_TYPE_ID = 2
GROUP_MEETING_TYPE_ID = 3
# ReceiverType IDs
TO_TYPE_ID = 1
CC_TYPE_ID = 2
BCC_TYPE_ID = 3
# グループ会議のメンバー範囲
SELECT_GROUP_ID = 1
PROGENY_GROUP_ID = 2
RELATION_GROUP_ID = 3... | 16.230769 | 29 | 0.701422 |
6238fd39f9d4c0b2fbc6338528db3f5b08f226bb | 416 | # frozen_string_literal: true
require 'test_helper'
class ThreadSafetyTest < ActionDispatch::IntegrationTest
include RouteTranslator::ConfigurationHelper
def setup
setup_config
end
def teardown
teardown_config
end
def test_i18n_locale_thread_safe
config_default_locale_settings 'en'
get... | 16.64 | 56 | 0.757212 |
e80a7e0f0cd94d84f928a3e86687d3f794d76747 | 36,564 | require 'rubygems' # Will eventually be removed when this file is deprecated
require 'fileutils'
require 'getoptlong'
require 'net/http'
require 'net/https'
require 'net/ssh'
require 'rhc/vendor/sshkey'
require 'resolv'
require 'uri'
require 'highline/import'
require 'rhc'
require 'rhc/rest'
require 'rhc/helpers'
requi... | 30.318408 | 195 | 0.621431 |
796541fad2198a45ba7c78319bd3f37d84a0e4c1 | 23,937 | require 'fastlane_core/configuration/config_item'
require 'credentials_manager/appfile_config'
module Supply
class Options
# rubocop:disable Metrics/PerceivedComplexity
def self.available_options
@options ||= [
FastlaneCore::ConfigItem.new(key: :package_name,
... | 73.652308 | 227 | 0.432886 |
012ba009d053d35f5c69f459bd89e04da03d3036 | 2,295 | # frozen_string_literal: true
# Copyright (c) 2018 by Jiang Jinyang <jjyruby@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | 33.26087 | 109 | 0.724183 |
e8ef684718a710c5f06af09b80d6ce485848fd66 | 321 | cask "font-leckerli-one" do
version :latest
sha256 :no_check
url "https://github.com/google/fonts/raw/master/ofl/leckerlione/LeckerliOne-Regular.ttf",
verified: "github.com/google/fonts/"
name "Leckerli One"
homepage "https://fonts.google.com/specimen/Leckerli+One"
font "LeckerliOne-Regular.ttf"
end... | 26.75 | 91 | 0.738318 |
d5fe7d313e1cd4a4d200b2228a6d01919b42f292 | 3,432 | require 'devise/multi_email/parent_model_extensions'
module Devise
module Models
module EmailValidatable
extend ActiveSupport::Concern
included do
validates_presence_of :email, if: :email_required?
if Devise.activerecord51?
validates_uniqueness_of :email, allow_blank: tru... | 30.371681 | 114 | 0.652972 |
1c09da551d7305bc4e71b378364c2f18b1eb6ab3 | 1,679 | class Project < ActiveRecord::Base
has_many :rights, :class_name => 'UserProject'
has_many :users, :through => :rights, :class_name => "User"
belongs_to :repository
has_many :events, :order => "created_at DESC"
has_many :tickets
has_many :ticket_changes, :through => :tickets
has_many :milestones
has_man... | 27.52459 | 82 | 0.623585 |
5de0686f0fd25406aac63b7cefdc6030288bd55b | 6,777 | =begin
#Kubernetes
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.2.3
=end
require 'date'
module Kubernetes
# StatefulSetList is a coll... | 30.12 | 279 | 0.626826 |
4a19e2e3542314d37b7e2c6681c7e6259bb1a465 | 1,032 | class Libogg < Formula
desc "Ogg Bitstream Library"
homepage "https://www.xiph.org/ogg/"
url "http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz"
sha256 "e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692"
bottle do
cellar :any
sha256 "e6cd3367b66868d926581ddca05967355456bdf8852... | 29.485714 | 97 | 0.719961 |
ab86c0346cdca35fc6cb27d388788a2b2dfbbaba | 277 | class StaffSerializer < ApplicationSerializer
attributes :id, :first_name, :last_name, :email, :phone, :role, :created_at, :updated_at
has_many :orders
has_many :staff_projects
has_many :user_settings
has_many :notifications
has_many :projects
has_one :cart
end
| 25.181818 | 90 | 0.772563 |
33db59124e9a0a9ff03b9886a8ecbb51cf45bd38 | 3,335 | require_relative '../../spec_helper'
require_relative 'fixtures/classes'
describe "Hash#compare_by_identity" do
before :each do
@h = {}
@idh = {}.compare_by_identity
end
it "causes future comparisons on the receiver to be made by identity" do
@h[[1]] = :a
@h[[1]].should == :a
@h.compare_by_i... | 23.992806 | 89 | 0.621289 |
bb25eba9aa7e1fb53ad7ed9780fe7d89f0bdedae | 209 | FactoryBot.define do
sequence(:repeater_name){ |n| "##{n} Repeater" }
# Article repeater
factory :repeater, class: Binda::Repeater do
association :field_setting, factory: :selection_setting
end
end
| 19 | 57 | 0.732057 |
08925a6f4f6779a9fa2d1cded87bf578b03ecabd | 2,319 | #!/usr/bin/env ruby
require 'puppet'
require 'sqlite3'
require 'yaml'
def puppetdb
db = SQLite3::Database.open "puppet.db"
db.execute "CREATE TABLE IF NOT EXISTS hosts(id INTEGER PRIMARY KEY, host TEXT)"
db.execute "CREATE TABLE IF NOT EXISTS resources(id INTEGER PRIMARY KEY, name TEXT, type TEXT)"
db.execute ... | 31.337838 | 105 | 0.671841 |
2821e10ed7cc396391f7797ac943d1c546295cb8 | 1,018 | module RubyChem
class Lewis
attr_accessor :structure
Valence = {"O" => 6, "C" => 4}
Species = [["C"], ["O", "2"]]
def initialize
@species = Species
determine_configuration
end
private
def determine_configuration
@valence_electrons_available = valence_electrons_av... | 24.829268 | 90 | 0.619843 |
87703285c277126a6e5ce5b433add466c7827cbb | 2,302 | require 'rails_helper'
RSpec.describe WelcomesController, type: :controller do
let(:valid_attributes) {
{':greeting'=>'Initial Greeting'}
}
let(:invalid_attributes) {
{':greeting' => nil}
}
let(:valid_session) { {} }
before do
puts '========>'+' '+ 'Run before of FactoryBot for @welcome'
... | 26.45977 | 93 | 0.652476 |
267366f06e723dd9d398ceb314549532c4efddbc | 36,872 | # 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
module Aws::CloudWatch
# @api private
module ClientApi
include Seahorse::Model
ActionPrefix = Shap... | 68.535316 | 187 | 0.761391 |
ed1650130c1021e737fcd28a21adf7870bc08012 | 294 | # frozen_string_literal: true
FactoryBot.define do
factory(:data_wait_for_open_channel, class: 'FactoryBotWrapper') do
init_fundee { build(:input_init_fundee).get }
initialize_with do
new(Lightning::Channel::Messages::DataWaitForOpenChannel[init_fundee, ''])
end
end
end
| 26.727273 | 80 | 0.755102 |
abcc7772bf40e4178c52dddea2079d628a8782ee | 197 | module Poly
class CleanTrashJob < ApplicationJob
queue_as :default
# Delete the parent record and then remove the trash item
def perform(trash)
trash.destroy
end
end
end
| 17.909091 | 61 | 0.705584 |
b9dac4267053660a150f2529fd12823772b82fa5 | 608 | module IESD
class DMG
# {Install OS X.dmg}[rdoc-ref:IESD::DMG::InstallOSX]
#
# The installer dmg for OS X Mavericks and later.
# It contains an {Install OS X.app}[rdoc-ref:IESD::APP::InstallOSX].
# It's generated by `createinstallmedia`, a tool come with the installer app.
class InstallOSX < ... | 27.636364 | 90 | 0.625 |
acf9d2c20cb65829c960bd408fd02ec581f2ed0f | 1,554 | # frozen_string_literal: true
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 38.85 | 74 | 0.78314 |
ac11ce6906abedb4b2989b1186c5ebb332d293fb | 1,985 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: google/ads/googleads/v6/services/ad_parameter_service.proto for package 'Google.Ads.GoogleAds.V6.Services'
# Original file comments:
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... | 37.45283 | 172 | 0.687657 |
5d6e92a8e87d7f8d25f26c60ab326ea3b04612b9 | 190 | class CreateCourses < ActiveRecord::Migration[5.1]
def change
create_table :courses do |t|
t.string :name
t.integer :enrollment
t.timestamps
end
end
end
| 17.272727 | 50 | 0.636842 |
5d177b10f6e169b7be487796662dd4fea1ce91a7 | 158 | require File.expand_path('../../../../spec_helper', __FILE__)
describe "Gem::Specification#inspect" do
it "needs to be reviewed for spec completeness"
end
| 26.333333 | 61 | 0.727848 |
08d30c3ec69de32f265cc9149aa30444b3ba3ba6 | 1,036 | ENV.delete_if { |name, _| name.start_with?('GIT') }
require 'bundler'
begin
Bundler.setup(:default, :xzibit, :test)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts 'Run `bundle install` to install missing gems'
exit e.status_code
end
require 'jeweler'
require 'mocha'
require 'mocha/api'
W... | 18.5 | 84 | 0.704633 |
1a04d39d784a639ae9a0919bfea6d5e87b3dd2fa | 26,024 | # 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::ApiManagement::Mgmt::V2017_03_01
#
# ApiManagement Client
#
class ApiIssueComment
include MsRestAzure
#
# Creates and ini... | 59.415525 | 233 | 0.697971 |
1affeff60ac89cf90e1db639279930a72948c5e1 | 1,128 | cask "macupdater" do
version "2.0.0,10946"
sha256 "6661a23a00d831acc065fe43bb08471ebb93d9ab8a15c85ab3d84a972842c540"
url "https://www.corecode.io/downloads/macupdater_#{version.before_comma}.dmg"
name "MacUpdater"
desc "Track and update to the latest versions of installed software"
homepage "https://www.co... | 34.181818 | 80 | 0.751773 |
262cb44cc9216dfd8d8cf10174c4619b4eb08fe1 | 684 |
Pod::Spec.new do |s|
s.name = 'ModuleBCategory'
s.version = '0.0.1'
s.summary = '业务模块B组件的路由分类组件'
s.description = <<-DESC
TODO: Add long description of the pod here.
DESC
s.homepage = 'https://github.com/CTPLucky/Modul... | 26.307692 | 104 | 0.530702 |
6235e4ada87b5d903651d618091b31e77c82f61b | 587 | MRuby::Build.new do |conf|
if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
toolchain :visualcpp
conf.yacc do |yacc|
yacc.command = ENV['YACC'] || 'bison.exe'
yacc.compile_options = %q[-o "%{outfile}" "%{infile}"]
end
else
toolchain :gcc
end
conf.gembox 'defau... | 23.48 | 81 | 0.601363 |
623c3a85c97be31d0baea731ee1d4099b6574ab7 | 719 | class DeviseCreateAdmins < ActiveRecord::Migration
def change
create_table(:admins) do |t|
t.database_authenticatable :null => false
t.recoverable
t.rememberable
t.trackable
# t.encryptable
# t.confirmable
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy... | 27.653846 | 80 | 0.646732 |
ab05323b27fd6d0ae55b8be1a7a30138bfe868c6 | 535 | class SaunaController < ApplicationController
before_filter :authenticate_user!, :except => [:home, :maintenance, :error]
layout :set_layout, :except => [:home]
layout 'dashboard', :only => [:home, :maintenance, :error]
def home
redirect_to dashboards_path and return if current_user
end
def navbar
... | 19.814815 | 77 | 0.657944 |
e25b14f2397b29f4b9bb565ef12dfe922577d3cf | 1,107 | module Phony
module NationalSplitters
# This is a national splitter for countries
# which have no NDC / Area Code.
#
class None < Default
# Get a splitter. Caches.
#
def self.instance_for(*)
@instance ||= new
end
# On false:
#
# T... | 22.14 | 73 | 0.552846 |
e8b519bb4e4e33a676a43f929ea6749f763c5c9d | 188 | class AddUrlIdentifierToApplication < ActiveRecord::Migration[5.1]
def change
remove_column :applications, :base_url
add_column :applications, :url_identifier, :string
end
end
| 26.857143 | 66 | 0.781915 |
339b2451fb4bd1fb0835e7ec56e9705736a89817 | 794 | cask 'emclient' do
version '7.2.37961'
sha256 '4b38b07cb6b172e92aeb9b91482b560bda1cb8dbaf728440201ce6e584fcea81'
url "https://cdn-dist.emclient.com/dist/v#{version}_Mac/setup.pkg"
appcast 'https://www.emclient.com/release-history?os=mac'
name 'eM Client'
homepage 'https://www.emclient.com/'
auto_updates... | 33.083333 | 87 | 0.673804 |
aba1a5f73cfa71b26a13ec0654724b7f8b7ae910 | 1,431 | module Campaigns
class ClickStatisticsPresenter < BasePresenter
attr_reader :total_tracker
attr_reader :unique_clicks
delegate :campaign_ids, :start_date, :end_date, to: :shared_context
def present
query
OpenStruct.new(
total_trackers: total_trackers || 0,
uni... | 29.8125 | 109 | 0.692523 |
03573b274d1685d7a92118aeae16cb05ea5566f3 | 14,776 | require "rails/generators/app_base"
module Rails
module ActionMethods # :nodoc:
attr_reader :options
def initialize(generator)
@generator = generator
@options = generator.options
end
private
%w(template copy_file directory empty_directory inside
empty_directory_with_kee... | 29.201581 | 158 | 0.631023 |
4aee433f7be58153eef645704564a6a5a312c341 | 1,271 | class SessionsController < ApplicationController
def new
if logged_in?
redirect_to users_path
end
end
def create
user = User.find_by(username: params[:username])
if user && user.authenticate(params[:password])
session[:user_id] = user.id
... | 28.886364 | 146 | 0.560976 |
ed04353290d3b0a2f06c076f95febe8aaf9b7c81 | 2,120 | # frozen_string_literal: true
module WahWah
module Flac
module StreaminfoBlock
STREAMINFO_BLOCK_SIZE = 34
# STREAMINFO block data structure:
#
# Length(bit) Meaning
#
# 16 The minimum block size (in samples) used in the stream.
#
# 16 The maxi... | 40.769231 | 115 | 0.587736 |
acc786d2e942c035a1b81d42f4b0234be898b4ec | 592 | module E20
module Ops
module Middleware
class HostnameMiddleware
def initialize(app, options = {})
@app = app
@options = options
@hostname = options[:hostname] || Hostname.new
end
def call(env)
status, headers, body = @app.call(env)
... | 23.68 | 71 | 0.52027 |
1af35b8bc6493ca2f7b4a5718d6e0399986bd062 | 782 | 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)
#config.generators do |g|
# g.assets false
#end
#config.assets.paths << Rails.root.join("lib", "videoplayer", "flash")
modu... | 27.928571 | 82 | 0.749361 |
bf1769ae5eeb7b13f5f7dd6a3ae221c02a9ba1de | 174 | module Pod
module Downloader
# @return [String] Downloader’s version, following
# [semver](http://semver.org).
#
VERSION = '1.3.0'.freeze
end
end
| 19.333333 | 54 | 0.603448 |
bfd55fb537e45d28e88caea3e0613bc5de6a9d81 | 693 | class PagesController < ApplicationController
before_action :authenticate_user!
before_action :set_page, only: [:show, :edit, :update, :destroy]
def index
@pages = Page.all
respond_with(@pages)
end
def show
respond_with(@page)
end
def new
@page = Page.new
respond_with(@page)
end
... | 14.744681 | 66 | 0.645022 |
bb8ffb0dca749880dba90afa1c6178c79419ce4a | 649 | require 'spec_helper'
module SoftwareVersion
describe Version do
context "Sort file test" do
before(:all) do
@version_array = fixture("windows_application_version_sort.txt").split("\n")
end
@version_array = fixture("windows_application_version_sort.txt").split("\n")
@version_arra... | 29.5 | 84 | 0.616333 |
ac83682a1bbd62d5088b93f99b4e62e20877298b | 254 | require "seeds_helper"
def seed(file)
load Rails.root.join("db", "seeds", "#{file}.rb")
puts "Seeded #{file}"
end
puts "Seeding #{Rails.env} database..."
seed "developers"
seed "businesses"
seed "admins"
seed "conversations"
puts "Seeded database"
| 18.142857 | 51 | 0.69685 |
61ceff5852fc92cacb60e3c245b72fe7f83aa6d4 | 1,708 | #!/usr/bin/env ruby
# (c) 2011 Rdio Inc
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | 39.72093 | 86 | 0.763466 |
acb1ee13885c8d13f7a65824b9285cc0c4ca2b11 | 1,079 | module TestHelpers
module ParamsFixtures
def params_fixture
DefaultConfiguration.get.merge({
databases: %w(postgresql mysql redis),
background_jobs: %w(delayed_job sidekiq),
server_type: 'nginx_unicorn',
vm_name: 'testapp',
vm_os: 'ubuntu/trusty64',
... | 33.71875 | 54 | 0.600556 |
ffc3d65bd397547c5b2f5e783c473ddd5a252a15 | 155 | class CreateImports < ActiveRecord::Migration
def change
create_table :imports do |t|
t.integer :imports
t.timestamps
end
end
end
| 15.5 | 45 | 0.677419 |
333180e1c083916f1200cb4472c3e2c55b60aadc | 959 | %w( formatter
railtie
log_subscribers/base
log_subscribers/action_controller
log_subscribers/action_dispatch
log_subscribers/action_mailer
log_subscribers/active_job
middleware/request_logger
middleware/routing_error_catcher
extensions/action_controller_helper
extensions/active_... | 25.918919 | 111 | 0.786236 |
f7202140906d188d76a7127ac817ba03cd6bb73e | 1,480 |
Pod::Spec.new do |s|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.name = "XSLPhotoBrowser"
s.version = "0.3.0"
s.swift_version = "4.0"
s.summary = " swift版本的图片浏览器"
# This description is used to generate tags and improve search results.
s.des... | 31.489362 | 103 | 0.440541 |
d507557df6c8124f9a6ad199be3e117dbf005627 | 1,389 | # frozen_string_literal: true
# Derive GraphQL types by convention, linking an {ApplicationRecord}
# subclass to its corresponding {Types::BaseObject} subclass.
module DerivedGraphqlTypes
extend ActiveSupport::Concern
included do
delegate :graphql_node_type, :graphql_node_type_name,
:graphql_connection_... | 26.711538 | 82 | 0.697624 |
211acb6b33dc8ce6d3fad51d0f3e5e475d429873 | 160 | # frozen_string_literal: true
class Mouse; end
module Acme
module Mouse
module AddSqueak
def squeak
'Squeak!'
end
end
end
end
| 11.428571 | 29 | 0.63125 |
5d8aaf141563b3a5aa1b551a249f7666753e0c54 | 4,491 | class ErlangAT17 < Formula
desc "Programming language for highly scalable real-time systems"
homepage "https://www.erlang.org/"
url "https://github.com/erlang/otp/archive/OTP-17.5.6.9.tar.gz"
sha256 "70d9d0a08969f4c51c78088f8c6b7da22a4806b1fd258a9fff1408f56553f378"
bottle do
cellar :any
# sha256 "c043... | 37.739496 | 117 | 0.716767 |
87d1b1f16177ab55395ea18696911c0508c1612d | 1,022 | class SellerMailer < ApplicationMailer
def send_lot_closed_email(lot)
@user = lot.user
@lot = lot
@url = ENV['front_app_url'] + '/lots/' + @lot.id.to_s
mail(to: @user.email, subject: 'Your lot ' + @lot.title + ' was successfully sold')
end
def send_lot_closed_by_timeout_email(lot)
@user = lo... | 30.058824 | 101 | 0.62818 |
1cc946b26af5f214d1cabcef1f7173607753c6a2 | 3,769 | # -*- encoding: utf-8 -*-
# stub: bootstrap-sass 3.4.1 ruby lib
Gem::Specification.new do |s|
s.name = "bootstrap-sass".freeze
s.version = "3.4.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Tho... | 50.932432 | 136 | 0.636774 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.