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 |
|---|---|---|---|---|---|
e94971b3194041eeed201049f6f0243f5c17ea52 | 1,946 | Given /^(provider "[^\"]*") has page partials$/ do |provider|
FactoryBot.create :page_partial, :account => provider
end
Given /^the partial "([^\"]*)" of (provider "[^\"]*") is$/ do |name, provider, body|
FactoryBot.create(:cms_partial, :system_name => name, :provider => provider, :draft => body).publish!
end
Wh... | 29.044776 | 103 | 0.692703 |
ffccc4b7f8432105b7652743033b12abca7720e3 | 407 | # Be sure to restart your server when you modify this file.
Wordy::Application.config.session_store :cookie_store, key: '_Wordy_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails gener... | 45.222222 | 76 | 0.808354 |
01d7a7719b4bde768ca292ea3c3c22c819d257d3 | 108 | class AddColumn < ActiveRecord::Migration
def change
add_column :posts, :overtime, :integer
end
end
| 18 | 42 | 0.740741 |
26c84b5e5d0c91b7ea8510d9f30d0029760da66d | 234 | class Tagging < ApplicationRecord
belongs_to :tag, counter_cache: true
belongs_to :task
# Filter tasks by tag name
def self.task_ids_by_tag(tag_name)
joins(:tag).where(tags: { name: tag_name }).select(:task_id)
end
end
| 23.4 | 64 | 0.730769 |
1d5b44e7a23f428f800c151513a7b3f9afbcd69e | 57,906 | # Copyright 2014 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 applicable law or agreed to in writing, ... | 37.455369 | 184 | 0.701758 |
b96e922c3929a816190882595364655e0dae57c2 | 924 | class LoverInfo < ActiveRecord::Base
include Scrapeable, BetterJson
# ASSOCIATIONS
belongs_to :mod
belongs_to :game, :inverse_of => 'lover_infos'
# VALIDATIONS
validates :game_id, :mod_name, :uploaded_by, :released, presence: true
def self.prepare_for_mod(id)
info = LoverInfo.find_or_initialize_by(... | 22.536585 | 80 | 0.718615 |
e96e314b0f3f264bf9673f11a6749fbc7226db57 | 5,022 | module Podbay
class Components::Aws
class Cluster
attr_reader :name
def initialize(name)
@name = name
end
def formatted_name
name.gsub(/[ _]/, '-').gsub(/[^a-zA-Z0-9-]/, '').downcase
end
def vpc
@__vpc ||= Resources::EC2.vpc(
stack.resource(... | 27.745856 | 80 | 0.558542 |
ab81cf7442c1ee3bdcc4c8ce605f452e824abeef | 782 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'twitter_bro'
require 'rspec/its'
require 'rspec/collection_matchers'
#require 'faraday'
Dir[File.expand_path("../support/**/*.rb", __FILE__)].each { |f| require f }
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expect... | 23 | 76 | 0.746803 |
8760aa5f17d2992faf13f745a200e0a5ea9bf651 | 1,262 | require_relative 'lib/ruby_activerecord_class/version'
Gem::Specification.new do |spec|
spec.name = "ruby_activerecord_class"
spec.version = RubyDb::VERSION
spec.authors = ["Carlos Torrealba"]
spec.email = ["calrrox@gmail.com"]
spec.summary = %q{Write a short summary, beca... | 42.066667 | 87 | 0.662441 |
3837257bdcf90fdbb3c3066172e7013842b7d4fd | 359 | # frozen_string_literal: true
class ConnectNewReportWithVariables < ActiveRecord::Migration[5.0]
def up
default_report = Report.current
Variable.find_each do |variable|
Report.where.not(id: default_report.id).find_each do |report|
Variable.create!(key: variable.key, value: variable.value, repor... | 27.615385 | 82 | 0.724234 |
d555aaa2499d66ab93557f8eb0cf61661b1cb825 | 129 | class CreateLocales < ActiveRecord::Migration
def change
create_table :locales do |t|
t.timestamps
end
end
end
| 16.125 | 45 | 0.697674 |
d5d1150e559150c47436c61beadf26a71545e1a8 | 2,758 | # frozen_string_literal: true
require_relative '../modules/terminal'
# player class
class Player
START_BALANCE = 100
@params = {
print_name_y_coord: 12,
print_score_coords: [52, 20],
print_score_text: 'Сумма очков вашей руки: %i',
print_top_card_y_coord: 14,
available_commands: {
take: ... | 20.42963 | 81 | 0.664249 |
1870745f30eaf60b5b3cbc936734bb02adecbaea | 5,905 | # encoding: utf-8
require 'spec_helper'
describe Ably::Rest do
describe 'transport protocol' do
include Ably::Modules::Conversions
let(:client_options) { {} }
let(:client) do
Ably::Rest::Client.new(client_options.merge(key: 'appid.keyuid:keysecret', log_retries_as_info: true))
end
let(:no... | 35.14881 | 149 | 0.606435 |
26d7b24ce23e6fdc3a993d6931edb39e1b3f1d54 | 781 | #
#
#
class GDO::DB::Result
def initialize(result)
@table = nil
@result = result
@enum = result.to_enum
@cached = false
end
def finalize
# TODO: Free result
end
def table(table); @table = table; self; end
def cached(cached); @cached = cached; self; end
def ... | 16.617021 | 73 | 0.610755 |
d5186beff15d5fcd04153f844b4b2671e130e544 | 1,531 | =begin
#Custom Workflow Actions
#Create custom workflow actions
The version of the OpenAPI document: v4
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Hubspot::Automation::Actions::ActionFunctionIdentifier
# A... | 29.442308 | 145 | 0.741999 |
915221e9728c012ae42458e9512189ab5267ebfa | 5,301 | require 'brakeman/processors/template_processor'
#Processes HAML templates.
class Brakeman::HamlTemplateProcessor < Brakeman::TemplateProcessor
HAML_FORMAT_METHOD = /format_script_(true|false)_(true|false)_(true|false)_(true|false)_(true|false)_(true|false)_(true|false)/
HAML_HELPERS = s(:colon2, s(:const, :Haml),... | 28.196809 | 129 | 0.561215 |
1a34bf1e215c641ffdac221c2e6024448f2bbd3c | 1,825 | 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... | 40.555556 | 85 | 0.777534 |
62c064cfbe28f8b62429af479ce4e95291e48cdd | 272 |
module EbayTrading # :nodoc:
module Types # :nodoc:
# == Attributes
class AttributeConversionEnabledFeatureDefinition
include XML::Mapping
include Initializer
root_element_name 'AttributeConversionEnabledFeatureDefinition'
end
end
end
| 19.428571 | 69 | 0.735294 |
33cb73649a6c125fe8327951eb5d1e7492b80614 | 18,613 | require_relative 'cspec_span_report_item'
class Cspec_set < Error_holder
attr_accessor :top_commit
attr_accessor :dependency_commits
def initialize(top_commit, dependency_commits)
if top_commit.is_a?(String)
self.top_commit = Cspec.from_repo_and_commit_i... | 51.846797 | 183 | 0.560092 |
182aa9443275af5ea8329b7dfeef818e70b05100 | 3,963 | require 'puppet/provider/package'
require 'puppet/util/windows'
require 'puppet/provider/package/windows/package'
Puppet::Type.type(:package).provide(:windows, :parent => Puppet::Provider::Package) do
desc "Windows package management.
This provider supports either MSI or self-extracting executable installers.
... | 30.484615 | 97 | 0.708049 |
b98cbab42738ed3814e8f77086fe5c58a106deeb | 26 | require 'core_ext/object'
| 13 | 25 | 0.807692 |
ac3834c32ff69d1969637e029e510d34ebb4ee24 | 5,909 | require 'spec_helper'
describe Issues::CreateService, services: true do
let(:project) { create(:empty_project) }
let(:user) { create(:user) }
describe '#execute' do
let(:issue) { described_class.new(project, user, opts).execute }
context 'when params are valid' do
let(:assignee) { create(:user) }... | 31.768817 | 107 | 0.617533 |
1824ba112bc22b792f0dc86a192749714733a35f | 982 | require "language/haskell"
class DhallJson < Formula
include Language::Haskell::Cabal
desc "Dhall to JSON compiler and a Dhall to YAML compiler"
homepage "https://github.com/Gabriel439/Haskell-Dhall-JSON-Library"
url "https://hackage.haskell.org/package/dhall-json-1.2.1/dhall-json-1.2.1.tar.gz"
sha256 "999c... | 32.733333 | 93 | 0.773931 |
2110da9aa220ece3d68925655924cdb84787ecb8 | 14,030 | require 'spec_helper'
RSpec.describe 'puppet_agent', tag: 'win' do
package_version = '5.10.100.1'
collection = 'puppet5'
global_params = {
:package_version => package_version,
:collection => collection
}
['x86', 'x64'].each do |arch|
context "Windows arch #{arch}" do
facts = {
... | 38.125 | 222 | 0.576123 |
3949a8755edc9f685e01836a17e8f47b87e228f4 | 259 | # frozen_string_literal: true
# Generated via
# `rails generate curation_concerns:work Exhibition`
module CurationConcerns
class ExhibitionForm < CurationConcerns::Forms::WorkForm
self.model_class = ::Exhibition
include CitiFormBehaviors
end
end
| 25.9 | 58 | 0.795367 |
6121173c748b737e572950fedc806fbab266ac04 | 656 | # This migration comes from acts_as_taggable_on_engine (originally 2)
class AddMissingUniqueIndices < ActiveRecord::Migration[4.2]
def self.up
add_index :tags, :name, unique: true
remove_index :taggings, :tag_id
remove_index :taggings, [:taggable_id, :taggable_type, :context]
add_index :taggings,
... | 28.521739 | 82 | 0.716463 |
e95b3a2f014dea670b2ca981fef43b224211d066 | 75 | module TwilioSegment
class Analytics
VERSION = '2.2.8.pre'
end
end
| 12.5 | 25 | 0.693333 |
38801214f4927cd5008b9c800ddec714e833d9a3 | 1,553 | require 'test_helper'
class SubscribershipTest < ActiveSupport::TestCase
def setup
@s = subscriptions(:one)
@subscribership = @s.subscriberships.build user: users(:two)
end
test "fixture subscription should be valid" do
assert_valid @subscribership,
"Initial fixture subscribership ... | 37.878049 | 79 | 0.721185 |
5d753601ce4b94139b1d94c7aca49360cf285b3f | 1,916 | require 'formula'
class Pyqt5 < Formula
homepage 'http://www.riverbankcomputing.co.uk/software/pyqt/download5'
url 'https://downloads.sf.net/project/pyqt/PyQt5/PyQt-5.3/PyQt-gpl-5.3.tar.gz'
sha1 '087d75be63351cfb7965075f448df218f688fa75'
option 'enable-debug', "Build with debug symbols"
option 'with-docs', ... | 33.034483 | 80 | 0.623173 |
018d21bce9fd8b4246472898ddd7856eccf0a426 | 4,170 | # Author:: Eric Crane (mailto:eric.crane@mac.com)
# Copyright:: Copyright (c) 2020 Eric Crane. All rights reserved.
#
# A Sqlite3 database connection.
#
# https://www.rubydoc.info/gems/sqlite3/1.3.11
# https://www.devdungeon.com/content/ruby-sqlite-tutorial
#
# db.results_as_hash = true
# Set results to return a... | 26.0625 | 77 | 0.502638 |
4a8f789d7f9e4c8214b84de97d1413a25a3f58f3 | 244 | # frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
default from: 'CodeHarbor <openhpi-support@hpi.uni-potsdam.de>'
default 'Precedence' => 'bulk'
default 'Auto-Submitted' => 'auto-generated'
layout 'mailer'
end
| 27.111111 | 65 | 0.745902 |
1cc1efa178582fc8235048c63e3f32dfcf75abef | 790 | class ServiceRequestSerializer < ActiveModel::Serializer
self.root = 'request'
attributes :service_request_id, :status, :status_notes, :service_name,
:service_code, :description, :requested_datetime, :updated_datetime,
:address, :lat, :long, :media_url
def service_request_id
object.... | 17.555556 | 81 | 0.706329 |
ffb62135375c26fff6f1c122608e5872bfa4044e | 1,538 | # frozen_string_literal: true
class ReceiveEventsFromDiscoveryService
def perform
sqs_results.each do |result|
result.messages.each do |message|
process_message(message)
sqs_client.delete_message(queue_url: queue_url,
receipt_handle: message.receipt_handle... | 22.289855 | 75 | 0.645644 |
39e7adb1f64e744299b7d9151a301ed7266a5992 | 3,107 | module ScoutApm
class Agent
class Preconditions
# The preconditions here must be a 2 element hash, with :message and :check.
# message: Proc that takes the environment, and returns a string
# check: Proc that takes an AgentContext and returns true if precondition was met, if false, we shouldn't ... | 37.890244 | 144 | 0.579015 |
f7c3a895f6de6a30f8798237598d97eb15be22b6 | 5,101 | class PostgresqlAT96 < Formula
desc "Object-relational database system"
homepage "https://www.postgresql.org/"
url "https://ftp.postgresql.org/pub/source/v9.6.20/postgresql-9.6.20.tar.bz2"
sha256 "3d08cba409d45ab62d42b24431a0d55e7537bcd1db2d979f5f2eefe34d487bb6"
license "PostgreSQL"
livecheck do
url "h... | 31.68323 | 108 | 0.666928 |
ab1cd689eeb68ea3836c89646781a05e63375470 | 1,033 | module Brightbox
command [:cloudips] do |cmd|
cmd.desc I18n.t("cloudips.update.desc")
cmd.arg_name "cloudip-id"
cmd.command [:update] do |c|
c.desc "Set reverse DNS for this Cloud IP"
c.flag [:r, "reverse-dns"]
c.desc "Delete the reverse DNS for this Cloud IP"
c.switch ["delete-... | 27.184211 | 95 | 0.610842 |
1c6271f0955867ef8fa2f397c2052de3dd3bab0f | 2,587 | class Pango < Formula
desc "Framework for layout and rendering of i18n text"
homepage "http://www.pango.org/"
url "https://download.gnome.org/sources/pango/1.36/pango-1.36.8.tar.xz"
sha256 "18dbb51b8ae12bae0ab7a958e7cf3317c9acfc8a1e1103ec2f147164a0fc2d07"
revision 1
head do
url "https://git.gnome.org/b... | 26.131313 | 93 | 0.622342 |
1df375565ab19c531bfa44fdaf5ad999c27cee31 | 888 | # encoding: utf-8
require 'rubygems'
require 'mongo'
require 'rest_client'
include Mongo
client = MongoClient.new
db = client['gazetteer']
places = db['place']
i = 0
subjects = places.find(
"$and" => [
{ "parent" => "2043686" },
{ "type" => { "$ne" => "region" } }
]
)
subjects.each do |subject|
candidates =... | 20.181818 | 114 | 0.572072 |
1160dcae2cd3d24741566c5f3b7bfb5cc884fa3a | 25,238 | # frozen_string_literal: true
# Copyright 2021 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... | 50.780684 | 152 | 0.536928 |
032e856fb2bb99d471f36da43ee47069fad8cf1a | 240 | # encoding: UTF-8
module Spontaneous::Model::Core
module Media
extend Spontaneous::Concern
def padded_id
save if media_id.nil?
Spontaneous::Media.pad_id(media_id)
end
def media_id
id
end
end
end
| 14.117647 | 41 | 0.654167 |
ff1cbd153d556ee19c5ff0eb7a72961dc88bc66f | 4,257 | class Swift < Formula
desc "High-performance system programming language"
homepage "https://github.com/apple/swift"
url "https://github.com/apple/swift/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "026d596dd4a24580a5e442409e8c58259197bd73ddbb77e5aade96da982ea39b"
bottle do
cellar :any
sha256 "f283aa347... | 36.698276 | 93 | 0.693211 |
5d1f851990e83ac4aab0b234942f2b1ab497a12c | 1,182 | # 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
Gem::Specification.new do |spec|
spec.name = 'aws-sdk-servicediscovery'
spec.version = File.... | 39.4 | 140 | 0.676819 |
61f6bd72681886d04cb392d2b2a08302bb2c578b | 3,204 | #
# Description: When a VM encounters high CPU % Ready, VMotion VM to a more
# suitable host.
#
def emailresults(vmname, target_host, vm_host, vmotion, event_type)
# Get to_email_address from model unless specified below
to = nil
to ||= $evm.object['to_email_address']
# Get from_email_address from model unles... | 32.363636 | 135 | 0.676966 |
21ee1b97944bf3d0bf42c62f0f1c582b70e61cc5 | 1,217 | #
# Copyright 2015, SUSE Linux GmbH
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 22.537037 | 74 | 0.63599 |
3945537b9f097097f745ed874016d6d505961a9a | 805 | puts
puts "Shopify App Generator"
puts "---------------------"
puts
puts "To get started, first register your app as a Shopify Partner:"
puts
puts " * Go to http://www.shopify.com/partners and create or login to your Partner account."
puts
puts " * Jump over to the Apps tab and hit the 'Create a new app' button"
puts "... | 32.2 | 98 | 0.701863 |
2621c0fecf2c7f30557fbb797f07cc82f4b82c95 | 4,261 | # == Mentionable concern
#
# Contains functionality related to objects that can mention Users, Issues, MergeRequests, or Commits by
# GFM references.
#
# Used by Issue, Note, MergeRequest, and Commit.
#
module Mentionable
extend ActiveSupport::Concern
module ClassMethods
# Indicate which attributes of the Ment... | 32.037594 | 113 | 0.717672 |
28336e785579198c0592f4ab78c20261850170ff | 2,809 | module Constellation
#
# Constellation::Reader observes the given log files for changes and inserts new entries
# into the data store.
#
class Reader
attr_accessor :debug_mode
def initialize(config)
@config = config
@debug_mode = false
@running = true
@threads = []
... | 30.204301 | 137 | 0.626201 |
879f437aea01ea84f7049dfa5bfb2fa546cab584 | 6,530 | #
# Be sure to run `pod lib lint MUKit.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
#
# 先修改podspec文件,然后pod spec lint/pod lib lint验证通过后再git打标签,否则容易... | 40.308642 | 232 | 0.718224 |
ff449920a2d88dbf8d86ffa293fbde07cc549c8e | 133 | require_relative 'strategy'
class AddStrategy < Strategy
def initialize
end
def do_operation(num1, num2)
num1 + num2
end
end | 13.3 | 29 | 0.759398 |
d565fa4955966319f81b7bddea9bea1620e83b89 | 204 | require "squeel"
class Testimonial < ActiveRecord::Base
default_scope -> { order{created_at.desc} }
required_locale_columns :content
validates_presence_of :author
def to_s
author
end
end
| 15.692308 | 45 | 0.75 |
1c9a1a74a4eb91c1502d0735fd1afc2001340414 | 875 | # rubocop:disable all
class MoveSlackServiceToWebhook < ActiveRecord::Migration[4.2]
DOWNTIME = true
DOWNTIME_REASON = 'Move old fields "token" and "subdomain" to one single field "webhook"'
def change
SlackService.all.each do |slack_service|
if ["token", "subdomain"].all? { |property| slack_service.p... | 38.043478 | 97 | 0.696 |
e91a722337dafc41496eb1901dd940d30cc7121b | 144 | require 'ytsearch'
require 'pp'
options = {
"q" => "taylor swift 22",
"part" => "snippet"
}
data = YoutubeSearch.search(options)
pp data
| 12 | 36 | 0.638889 |
b9ed9f281be08c42461c43027e9e8661ba5ade64 | 1,137 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# dat... | 40.607143 | 86 | 0.766051 |
f7719447b92007bf986774dc666de7921643f513 | 1,583 | # frozen_string_literal: true
class IssueBoardEntity < Grape::Entity
include RequestAwareEntity
expose :id
expose :iid
expose :title
expose :confidential
expose :due_date
expose :project_id
expose :relative_position
expose :project do |issue|
API::Entities::Project.represent issue.project, onl... | 31.039216 | 129 | 0.72331 |
e23a62e7ff0b0170887a9d94dc7e175f71edb96b | 923 | # == Schema Information
#
# Table name: levels
#
# id :integer not null, primary key
# game_id :integer
# name :string(255) not null
# created_at :datetime
# updated_at :datetime
# level_num :string... | 25.638889 | 70 | 0.535211 |
d54b9415d43fd17d1cecebcd7a8d11978f879ab9 | 3,621 | class UpdateAccessForWhosOnline < ActiveRecord::Migration
def up
say "adding access restrictions for some customized actions..."
AppParameter.transaction do # -- START TRANSACTION --
ap = AppParameter.find_by_code( AppParameter::PARAM_BLACKLIST_ACCESS_START )
if (ap.nil?)
... | 55.707692 | 207 | 0.606738 |
91708d244187049503fff3aeffd7bf5bd1f44165 | 6,039 | require 'spec_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
... | 37.509317 | 101 | 0.674615 |
6a11523718afff870d58b6b97f7525f544a5cce2 | 1,910 | class UsersController < ApplicationController
before_action :logged_in_user, only: [:index, :edit, :update, :destroy, :following, :followers]
before_action :correct_user, only: [:edit, :update]
before_action :admin_user, only: :destroy
def index
@users = User.paginate(page: params[:page])
end
de... | 21.460674 | 97 | 0.675916 |
39a922be17c7861b6b3bc366c886a156f43c0d82 | 1,308 | # frozen_string_literal: true
require 'barong/security/access_token'
module UserApi
module V1
class SessionJWTGenerator
ALGORITHM = 'RS256'
def initialize(jwt_token:, kid:)
@kid = kid
@jwt_token = jwt_token
@api_key = APIKey.active.find_by!(uid: kid)
end
def ver... | 23.781818 | 85 | 0.571865 |
873bddffa2520e52e88c2dd61f0a6a42873dfcc6 | 165 | require 'spec_helper'
require 'redis'
require 'rhcf/timeseries/manager'
describe Rhcf::Timeseries::RedisHgetallStrategy do
it_behaves_like 'a valid strategy'
end
| 20.625 | 50 | 0.812121 |
017b571f9940dc93f821ff7715f6f624399bf059 | 46 | module ActiveReporter
VERSION = "0.6.5"
end
| 11.5 | 21 | 0.717391 |
6100000c76ff088a0b4a6080401678ffda80a5e4 | 196 | first_number = 1
second_number = 2
sum = first_number + second_number
difference = first_number - second_number
product = first_number * second_number
quotient = first_number / second_number | 17.818182 | 41 | 0.790816 |
619387be10bb3b1b33b0ff745ea3f2005fd5b681 | 181 | require 'just_shogi/pieces/kin_base'
module JustShogi
# = Narikei
#
# The piece that can move 1 space orthogonally or forwards diagonally
class Narikei < KinBase; end
end
| 18.1 | 71 | 0.745856 |
1102835d8850da3b2731be56a496fe989c181a1a | 8,258 | # frozen_string_literal: true
Bundler.require
require_all 'features/support/lib'
describe 'Testrail' do
include Testrail
context 'when the testrail environment
variable is not set' do
it 'will not have tetrail enabled' do
expect(testrail_enabled).to be false
end
end
context 'when the testrai... | 28.1843 | 76 | 0.698474 |
110ee4f5d530a809af9e13714f1cb9ecb36e1cdd | 630 | Pod::Spec.new do |s|
s.name = "CMMapLauncher"
s.version = "0.0.1"
s.summary = "CMMapLauncher is a mini-library for iOS that makes it quick and easy to show directions in various mapping applications."
s.homepage = "https://github.com/citymapper/CMMapLauncher"
s.license = { :type => ... | 45 | 141 | 0.649206 |
d5acc84316715862581f4c6ff1abb3c382633c3e | 269 | require "bundler/setup"
require "typograf_client"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
config.expect_with :rspec do |c|
c.syntax = :expect
end
end
| 22.416667 | 63 | 0.750929 |
f70ea4ec61121b90ce2bb942eb77f7c23a1ebecc | 121 | require 'test_helper'
class DatasetTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 15.125 | 43 | 0.702479 |
113dbcb1b38e2c0512196fb454784f5ddbc785b9 | 1,048 | # frozen_string_literal: true
module RSpec
module Support
module FileFixtureHelpers
def file_fixture(path)
file_fixture_pathname(path).to_s
end
def file_fixture_pathname(path)
::Rails.root.join(file_fixture_path, path)
end
def file_fixture_tempfile(path)
te... | 27.578947 | 95 | 0.648855 |
910f67a128f68d5c30aff3d684e6692cd60e1e54 | 597 | cask 'soulver' do
version '3.3.2-96'
sha256 '997388cb58b95587e73c89e7c1771f413f5164a9633cb3396f9bb1f8b66e0bac'
url "https://soulver.app/mac/sparkle/soulver-#{version}.zip"
appcast 'https://soulver.app/mac/sparkle/appcast.xml'
name 'Soulver'
homepage 'https://soulver.app/'
auto_updates true
depends_on ... | 28.428571 | 75 | 0.663317 |
5de098cdbe5097e8a2a8facf01623e464165dd71 | 884 | # frozen_string_literal: true
module DrawioDsl
module Schema
class NodeList
attr_reader :nodes
def initialize
@nodes = []
end
def add(parent, node)
node.parent = parent
@nodes << node
end
def all
@nodes
end
def shapes
@no... | 15.508772 | 70 | 0.512443 |
1d8e61cc258b87fa594fa4611d498915861885a2 | 371 | module LitecoinPayable::Adapters
class Base
def self.fetch_adapter
case LitecoinPayable.config.adapter
when "blockchain_info"
LitecoinPayable::Adapters::BlockchainInfoAdapter.new
when "blockcypher"
LitecoinPayable::Adapters::BlockcypherAdapter.new
else
raise "Pleas... | 21.823529 | 60 | 0.695418 |
6a45f13c2a2c5d7c79f3145e9e5d5fbb70b51433 | 9,765 | # encoding: utf-8
require 'common/format'
=begin
= ImporterEntityPopulator
- Goggles framework vers.: 6.127
- author: Leega
Strategy that populates importer temporary data structures from json parsed data.
Assumes meeting already exist. Also meeting_sessions should exists with meeting_events defined
Note th... | 36.301115 | 184 | 0.664823 |
1d4c2880129bc9f7a03962204c15e1258c32d422 | 90 | # typed: strict
module Test::Foo::MyPackage
Test::Foo::Bar::OtherPackage::TestUtil
end
| 15 | 40 | 0.733333 |
1d2286c469c19abb04f6a853d766502f7204c690 | 159 | require File.expand_path('../../../../spec_helper', __FILE__)
describe "Net::HTTPHeader#type_params" do
it "needs to be reviewed for spec completeness"
end
| 26.5 | 61 | 0.72956 |
e84415a8687edaecfd30ae44cdb697063c00f856 | 3,213 | # frozen_string_literal: true
require "cases/helper"
require "models/topic"
require "models/person"
class ConfirmationValidationTest < ActiveModel::TestCase
def teardown
Topic.clear_validators!
end
def test_no_title_confirmation
Topic.validates_confirmation_of(:title)
t = Topic.new(author_name: "... | 26.336066 | 84 | 0.708061 |
abe40a516e988080032978859c6c5b73bcc173ec | 294 | class OrganizationObserver < ActiveRecord::Observer
def after_commit(organization)
Webhook::EventRegister.new(organization, created: just_created?(organization))
end
private
def just_created?(organization)
!!organization.send(:transaction_record_state, :new_record)
end
end
| 24.5 | 82 | 0.785714 |
7a6f9ff93f6964d0f48e320d1b19e083a1f8890e | 1,858 | #
# Be sure to run `pod lib lint LPMusicKitiOS.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 https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'LPMus... | 35.056604 | 109 | 0.646932 |
abffa5d206026b9eb6b67d227678771f575b66aa | 1,731 | class Wv < Formula
desc "Programs for accessing Microsoft Word documents"
homepage "https://wvware.sourceforge.io/"
url "https://abisource.com/downloads/wv/1.2.9/wv-1.2.9.tar.gz"
sha256 "4c730d3b325c0785450dd3a043eeb53e1518598c4f41f155558385dd2635c19d"
revision 1
bottle do
sha256 arm64_big_sur: "36bac1... | 39.340909 | 109 | 0.740035 |
61c7b078ae9871d8522a86cc0bc1e150c88571cb | 254 | class CollectibleGem
attr_reader :x, :y
def initialize(image, x, y)
@image = image
@x, @y = x, y
end
def draw
# Draw, slowly rotating
@image.draw_rot(@x, @y, 0, 25 * Math.sin(Gosu.milliseconds / 133.7))
end
end
| 16.933333 | 73 | 0.570866 |
ffaf6b08cbc909839d4911bcbe1c3c77d63f266e | 1,116 | # providers/vhost.rb
#
# Author: Simple Finance <ops@simple.com>
# License: Apache License, Version 2.0
#
# Copyright 2013 Simple Finance Technology Corporation
#
# 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 ... | 25.363636 | 74 | 0.738351 |
33c3bff70588fa49d6480ebd8d57c3880728fb44 | 2,773 | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for developme... | 36.012987 | 87 | 0.771727 |
1119ad46cee10686ca22fa68bb2eb8907e4b77c3 | 377 | require 'base_kde_formula'
class Kmag < BaseKdeFormula
homepage 'http://www.kde.org/'
url 'http://download.kde.org/stable/4.11.4/src/kmag-4.11.4.tar.xz'
sha1 'dac6e1d44d034d9b96013b256ec8e333396abf1d'
devel do
url 'http://download.kde.org/stable/4.12.0/src/kmag-4.12.0.tar.xz'
sha1 'b75992bfe53ab7e22e3... | 25.133333 | 70 | 0.740053 |
ffa29ffac682616b8026a4e1cfbeabe74542b743 | 1,559 | class Bogofilter < Formula
desc "Mail filter via statistical analysis"
homepage "https://bogofilter.sourceforge.io"
url "https://downloads.sourceforge.net/project/bogofilter/bogofilter-stable/bogofilter-1.2.5.tar.xz"
sha256 "3248a1373bff552c500834adbea4b6caee04224516ae581fb25a4c6a6dee89ea"
bottle do
sha2... | 51.966667 | 123 | 0.720975 |
28088dad65feea0123059bb5365a5c82f430a7f9 | 455 | namespace :test do
desc "Setup Test Database"
task setup_test_db: :environment do
unless Dir.exists?(Rails.root.join("db", "neo4j", "test"))
Rake::Task["neo4j:install"].invoke("community-2.1.5","test")
Rake::Task["neo4j:config"].invoke("test","7475")
end
end
desc "clean test db"
task clea... | 30.333333 | 66 | 0.676923 |
ed852716e20ebb30435b8d45967f90c53914a0ec | 3,556 | class ErlangAT22 < Formula
desc "Programming language for highly scalable real-time systems"
homepage "https://www.erlang.org/"
# Download tarball from GitHub; it is served faster than the official tarball.
url "https://github.com/erlang/otp/releases/download/OTP-22.3.4.20/otp_src_22.3.4.20.tar.gz"
sha256 "43... | 32.623853 | 139 | 0.644263 |
bf38ac3d966fb05e61500ff64ab3c5d90282e205 | 1,303 | require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_mailbox/engine"
require "action_text/en... | 34.289474 | 82 | 0.776669 |
39274c04444c00ee3e92dea350329251c6c65be4 | 9,482 | require 'puppet/util/logging'
require 'semver'
require 'puppet/module_tool/applications'
# Support for modules
class Puppet::Module
class Error < Puppet::Error; end
class MissingModule < Error; end
class IncompatibleModule < Error; end
class UnsupportedPlatform < Error; end
class IncompatiblePlatform < Error... | 28.389222 | 139 | 0.653449 |
f7957cea5b5cfbe1632c8f343f85d785866da3f0 | 844 | # encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or ... | 38.363636 | 81 | 0.766588 |
edf350e059bb8ff5929175bd8ddbda32f311bcfd | 1,426 | class Enumerator
include Enumerable
class Chain < Enumerator
def initialize(*enumerables)
@enum_block = Proc.new do |yielder|
enumerables.each do |enumerable|
enumerable.each do |item|
yielder << item
end
end
end
end
end
class Yielder
def... | 16.776471 | 53 | 0.596073 |
794b34367f1e5dce4abf5c088b4c14754bc05076 | 157 | require "rails/generators"
module Ukstyle
class Engine < ::Rails::Engine
Rails::Generators.options.merge!(ukstyle: { orm: :active_record })
end
end
| 19.625 | 70 | 0.719745 |
339b4f2e99abe0e6cf86186b679d188d05b64631 | 1,146 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
#... | 34.727273 | 86 | 0.743455 |
b97b7c54a1258a4882c888cf7cbad228eb68d1e3 | 797 | require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe "Socket::BasicSocket#getpeername" do
before :each do
@server = TCPServer.new("127.0.0.1", SocketSpecs.port)
@client = TCPSocket.new("127.0.0.1", SocketSpecs.port)
end
after :each do... | 30.653846 | 76 | 0.718946 |
e2e6b543cda73cc4b76052efed5e91c1eb1e845b | 423 | # frozen_string_literal: true
module GraphQL
module PersistedQueries
module Analyzers
# Verifies that mutations are not executed using GET requests
class HttpMethodAstAnalyzer < GraphQL::Analysis::AST::Analyzer
def initialize(query)
super
@query = query
end
... | 21.15 | 68 | 0.643026 |
8748f2bd75e5e60c65ecfe578f89dcec9c996604 | 261 | # frozen_string_literal: true
require "rails_helper"
RSpec.describe "application/_masthead_nav_menu_icon.html.erb", type: :view do
# before do
# render partial: "standard_view/breadcrumbs", locals: { material: material }
# end
it "needs specs"
end
| 21.75 | 81 | 0.739464 |
d5afd4a0edf7785c94f65b66789d8278ca1597ef | 2,074 | # frozen_string_literal: true
require "rails_helper"
module WasteCarriersEngine
RSpec.describe "CopyCardsOrderCompletedForm", type: :request do
describe "GET new_copy_cards_order_completed_form_path" do
context "when a valid user is signed in" do
let(:user) { create(:user) }
before(:each) ... | 36.385965 | 141 | 0.650434 |
617b4e71f2e18da944209460145723c5df6ea77b | 44 | cmd = "bundler install"
cmd = "rails serve"
| 14.666667 | 23 | 0.681818 |
bb0f5f2cd72a262d7faf4b1ce4c337404676b9af | 11,412 | require 'action_controller/model_naming'
module ActionDispatch
module Routing
# Polymorphic URL helpers are methods for smart resolution to a named route call when
# given an Active Record model instance. They are to be used in combination with
# ActionController::Resources.
#
# These methods are... | 34.477341 | 98 | 0.574746 |
d5f7100b67cce99e79db0287cc620880876e2566 | 3,031 | # 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::ContainerService::Mgmt::V2019_04_01
module Models
#
# The profile of an orchestrator and its available versions.
#
class Orc... | 30.009901 | 77 | 0.501815 |
e9283cfcb976a69feb0956e6080fd03e9fa1c009 | 386 | # frozen_string_literal: true
class FeedController < ApplicationController
def index
request.format = :atom
@team = Team.where(slug: params[:team], rss_token: params[:rss_token]).first
render("layouts/404", status: 404, formats: :html) && return if @team.nil?
@posts = Post.where(team: @team).last(2... | 24.125 | 80 | 0.678756 |
6a9ae19e23d75ba25eb851bb74bb75c703cfddfc | 720 | require 'rails/generators'
module DateWrapper
module Generators
class JavascriptsGenerator < ::Rails::Generators::Base
desc <<-DOC
date_wrapper/date_wrapper.coffee.erb
date_wrapper.js
DOC
def self.source_root
File.expand_path(File.join(File.dirname(__FILE__), '../../..... | 23.225806 | 119 | 0.669444 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.