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 |
|---|---|---|---|---|---|
7abf11f925b844b5454b62dd7ac6f2549d89bd2c | 9,139 | # frozen_string_literal: true
# -----------------------------------------------------------------------------
#
# GEOS toplevel interface
#
# -----------------------------------------------------------------------------
module RGeo
module Geos
class << self
# Returns true if the CAPI GEOS implementation i... | 44.580488 | 87 | 0.632892 |
62c3239f8e17660667de221646d23178b2cfe94a | 720 | # Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
# See ActionController::RequestForgeryProtection for details... | 45 | 85 | 0.786111 |
e2a4175f0810f4bcbf350df36833259289494c78 | 1,247 | require 'spec_helper'
describe "schedule resource" do
let(:client) { Mbta::Client.new( api_key: ENV["API_KEY"] ) }
describe "schedulebystop" do
let(:stop) { "West Roxbury" }
it "retrieves the schedule" do
VCR.use_cassette("mbta_schedule_schedule_by_stop") do
client.schedule_by_stop(stop).... | 25.979167 | 82 | 0.631115 |
7acbea3a13ddab106cf0fc6a64b723815697ed6b | 670 |
Pod::Spec.new do |s|
s.name = "PinCodeTextField"
s.version = "0.3.0"
s.summary = "Simple pin code text input based on UIKeyInput"
s.description = <<-DESC
Simple pin code text input with underlines for each character placeholder
DESC
s.homepage = ... | 27.916667 | 102 | 0.562687 |
f7f8dc5a621cac8af9f05c6332a35feaaf6d7255 | 671 | require 'minitest/autorun'
require 'mockdata/names'
class MockdataTest < Minitest::Test
def test_names
assert Mockdata::Names::CAR_BRANDS.include? Mockdata::Names.car_brand
assert Mockdata::Names::COMPANY_NAMES.include? Mockdata::Names.company
assert Mockdata::Names::FILE_EXTENSIONS.include? Mockd... | 44.733333 | 83 | 0.767511 |
39a731adffcb7cc3be1dc49a2de41d04e853ffda | 21,374 | # Copyright 2019 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, ... | 47.183223 | 175 | 0.584308 |
214460aea3318acb0657ce2afe5588c11f5d71d6 | 7,198 | # frozen_string_literal: true
class WorkQueue::AppealSerializer
include FastJsonapi::ObjectSerializer
extend Helpers::AppealHearingHelper
attribute :assigned_attorney
attribute :assigned_judge
attribute :issues do |object|
object.request_issues.active_or_decided_or_withdrawn.includes(:remand_reasons).m... | 28.117188 | 113 | 0.755765 |
38dc003c9b3b57f171c26059a07ced55a049071b | 404 | #
# Cookbook Name:: newrelic
# Attributes:: dotnet-agent
#
# Copyright 2012-2014, Escape Studios
#
default['newrelic']['dotnet-agent']['https_download'] = 'https://download.newrelic.com/dot_net_agent/release/x64'
default['newrelic']['dotnet-agent']['install_level'] = '1'
default['newrelic']['dotnet-agent']['dotnet_rec... | 33.666667 | 113 | 0.722772 |
1a2c5ccca7de72e2013c3ffce888eaf07bdda483 | 403 | # frozen_string_literal: true
class AddDefaultTargetProject < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
def up
with_lock_retries do
add_column :project_settings, :mr_default_target_self, :boolean, default: false, null: false
end
end
def down
with_lock_retries d... | 22.388889 | 98 | 0.756824 |
0179a7cf896034252e088c93c5fa175e7f3640ee | 402 | class CreateRepositories < ActiveRecord::Migration[5.1]
def change
create_table :repositories do |t|
t.string :name
t.string :owner
t.index [:name, :owner], unique: true
end
add_reference :pull_requests, :repository, foreign_key: true
add_reference :review_rules, :repository, foreig... | 28.714286 | 64 | 0.711443 |
03a14acac084f260f82e02e3d356eb9d43f1e12d | 1,180 | require "test_helper"
class Edition::RoleAppointmentsTest < ActiveSupport::TestCase
test "re-drafting an edition with role appointments copies the appointments" do
appointments = [
create(:role_appointment),
create(:role_appointment),
]
published = create(:published_news_article, role_appoint... | 42.142857 | 101 | 0.766949 |
878312849f0824a6ef434b2f6fe9ce07acea7f36 | 369 | module Mutant
class Mutator
class Node
# Abstract mutator for literal AST nodes
class Literal < self
include AbstractType
private
# Emit values
#
# @return [undefined]
def emit_values
values.each(&method(:emit_type))
end
end # Lit... | 18.45 | 46 | 0.571816 |
5d3e856ddcefde45c67ad7d9d6eb18277d1248bb | 684 | class AddInviteDataToMember < ActiveRecord::Migration
def up
add_column :members, :created_by_id, :integer
add_column :members, :invite_email, :string
add_column :members, :invite_token, :string
add_column :members, :invite_accepted_at, :datetime
change_column :members, :user_id, :integer, null: ... | 28.5 | 59 | 0.741228 |
ac9f7a70900e4cf1a1b0562365f6bfc6d4efc823 | 3,040 | =begin
#ESP Documentation
#The Evident Security Platform API (version 2.0) is designed to allow users granular control over their Amazon Web Service security experience by allowing them to review alerts, monitor signatures, and create custom signatures.
OpenAPI spec version: v2_sdk
Generated by: https://github.com/s... | 29.803922 | 227 | 0.722039 |
7995bcfc4442201d2473a3609efb8469c07784aa | 906 | class Redis
class Store < self
include Ttl, Interface
def initialize(options = { })
super
_extend_marshalling options
_extend_namespace options
end
def self.rails3? #:nodoc:
defined?(::Rails) && ::Rails::VERSION::MAJOR == 3
end
def self.rails31? #:nodoc:
defi... | 22.65 | 91 | 0.613687 |
ed969df977a0dbad59e7eacdcdad40066aee2590 | 5,164 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe User, type: :model do
let(:user) { FactoryBot.create(:user) }
let(:post) { FactoryBot.create(:post) }
let(:other_post) { FactoryBot.create(:post) }
let(:friend_1) { FactoryBot.create(:user) }
let(:friend_2) { FactoryBot.create(:user) }
i... | 33.532468 | 77 | 0.701975 |
38dcc2a7e2174bfe45de3d4f4b492324a910650d | 1,384 | # Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ... | 33.756098 | 78 | 0.700145 |
bf776dde4ac44e219b584604659aaa972d5dcedc | 1,579 | module SessionsHelper
#logs in the given user
#:user_id is arbitary key
def log_in(user)
session[:user_id] = user.id
end
#returns true if the given user is the current user
def current_user?(user)
user == current_user
end
#returns the current logged-in user (if any)
#Returns the user corresponding to the r... | 26.316667 | 70 | 0.744775 |
e9c5219c395f3b43e5937f2c4c392e460e9fc465 | 622 | require 'simplecov'
require 'rspec'
require 'rspec/its'
require 'webmock/rspec'
require 'vcr'
require 'jortt'
SimpleCov.start
if ENV['CI'] == 'true'
require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
end
VCR.configure do |c|
c.cassette_library_dir = "spec/fixtures/vcr_cassettes"
c.hook_into... | 22.214286 | 56 | 0.731511 |
7a70fa9aae6a85aa71ef783a1efd8616d0422b6d | 138 | require 'test_helper'
class Protorails::Test < ActiveSupport::TestCase
test "truth" do
assert_kind_of Module, Protorails
end
end
| 17.25 | 48 | 0.76087 |
eda2b9f653e9bf348ad9549a9c6db4f95fe90e3c | 2,973 | require 'rails_helper'
feature 'Visitor signs up with email address' do
scenario 'visitor can sign up with valid email address' do
email = 'test@example.com'
sign_up_with(email)
expect(page).to have_content t('notices.signed_up_but_unconfirmed.first_paragraph_start')
expect(page).to have_content t('... | 33.033333 | 97 | 0.731248 |
ab3b78d3d8c557fba8fe3bc0c91c0f81d6809beb | 39 | module Blogger
VERSION = "0.0.1"
end
| 9.75 | 19 | 0.666667 |
21c0049a40d76c0d4d49b95a5b1275f02bbef2ac | 527 | package "gmetad"
service "gmetad" do
enabled true
end
provide_service ("#{node[:cluster_name]}-gmetad")
cluster_nodes = { node['cluster_name'] => [ node['ip-address'] ] }
template "/etc/ganglia/gmetad.conf" do
source "gmetad.conf.erb"
backup false
owner "ganglia"
group "ganglia"
mode 0644
variables(:c... | 19.518519 | 83 | 0.696395 |
08e96c02f8c17900e87664b3f23f68f6f4af15fc | 2,576 | class Dropdown < UnscoredQuestion
include ActionView::Helpers
validates :alternatives, presence: true
def edit(_count)
html = '<td align="center"><a rel="nofollow" data-method="delete" href="/questions/' + id.to_s + '">Remove</a></td>'
html += '<td><input size="6" value="' + seq.to_s
html += '" name... | 42.933333 | 154 | 0.600932 |
61ab9430a6dfe12ed4254aa6db009de040424ded | 15,898 | module EneBuildings
module Zip
# ZipFile is modeled after java.util.zip.ZipFile from the Java SDK.
# The most important methods are those inherited from
# ZipCentralDirectory for accessing information about the entries in
# the archive and methods such as get_input_stream and
# get_output_stream for reading ... | 36.463303 | 175 | 0.655869 |
d55120a9e35c3484915f3c87364a30b3bf34ab55 | 837 | #
# This file is auto-generated, do not edit
#
module RecombeeApiClient
require_relative 'request'
require_relative '../errors'
##
#Gets the list of all the item properties in your database.
#
class ListItemProperties < ApiRequest
attr_accessor :timeout
attr_accessor :ensure_https
##
#... | 17.4375 | 61 | 0.624851 |
6169f95e0a3fff5a32bb3565cf2a237fa2bec777 | 1,014 | #
#
#
class PublishedProgrammeItem < ApplicationRecord
self.primary_key = :programmme_item_id
belongs_to :format
belongs_to :programmme_item
has_many :published_programme_assignments, dependent: :destroy do
# get the people with the given role
def role(role)
where(['programme_assignment_role_typ... | 21.125 | 67 | 0.708087 |
7afb5464c8e85925bab5b52c79875d45503afb07 | 9,799 | require 'abstract_unit'
require 'action_dispatch/http/upload'
require 'action_controller/metal/strong_parameters'
class ParametersPermitTest < ActiveSupport::TestCase
def assert_filtered_out(params, key)
assert !params.has_key?(key), "key #{key.inspect} has not been filtered out"
end
setup do
@params = ... | 31.508039 | 96 | 0.666292 |
6aa930d88329d44ba99e9c9dac7101643981cea1 | 1,008 | # coding: utf-8
Gem::Specification.new do |spec|
spec.name = 'agency-jekyll-theme'
spec.version = '1.0.0'
spec.authors = ["Klaudia Alvarez"]
spec.email = 'klaudia.devel@gmail.com'
spec.summary = "Agency Jekyll Theme is a jekyll theme gem, based on Agency theme created by St... | 53.052632 | 230 | 0.688492 |
ffebb823caeac765b22d0c0517a148d5132bc465 | 596 | # lib/gemwarrior/entities/items/throne.rb
# Entity::Item::Throne
require_relative '../item'
module Gemwarrior
class Throne < Item
def initialize
super
self.name = 'throne'
self.name_display = 'Throne'
self.description = 'Made of what appears to be unfulfilled desires and latent... | 27.090909 | 198 | 0.672819 |
ab9ec4a432de09d90c9426bd3e27a79597c3ca15 | 3,425 | #!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
#
# License:: 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
#
# ... | 30.855856 | 79 | 0.64292 |
7989b863781a1d888eb356cdcf433691b8938252 | 5,482 | # frozen_string_literal: true
require 'spec_helper'
describe Gitlab::UrlBuilder do
subject { described_class }
describe '#build' do
it 'delegates to the class method' do
expect(subject).to receive(:build).with(:foo, bar: :baz)
subject.instance.build(:foo, bar: :baz)
end
end
describe '.b... | 45.305785 | 140 | 0.60124 |
2654c77f4e1b47c5cabf7c85a76873aeb020f9ee | 43 | module Daru
VERSION = '0.2.1'.freeze
end
| 10.75 | 26 | 0.674419 |
1d8b49056678382d6f969ea9c0202a028a3bb98b | 1,511 | class TadpolesController < ApplicationController
before_action :set_tadpole, only: [:show, :edit, :update, :destroy, :metamorphose]
def metamorphose
@frog = Frog.new(name: @tadpole.name, color: @tadpole.color, pond_id: @tadpole.frog.pond_id)
@tadpole.destroy
@frog.save
redirect_to frog_path(@frog)
... | 21.28169 | 96 | 0.647253 |
bf4c5871bfb25f3e686ce4f4742db81286ee133c | 1,258 | # -*- encoding: utf-8 -*-
# stub: csl 1.5.1 ruby lib
Gem::Specification.new do |s|
s.name = "csl".freeze
s.version = "1.5.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Sylvester Keil".freeze]
... | 37 | 183 | 0.680445 |
ab0448e148370168f728fd1b592b2168d6ac9c0d | 2,281 | class OracleTableCopier < TableCopier
def run
destination_connection.connect!.synchronize do |jdbc_conn|
copy_manager(jdbc_conn).copy_in(copy_sql, java_stream)
end
ensure
destination_connection.disconnect
end
def self.cancel(import)
connection = import.source_dataset.data_source.connect_a... | 28.5125 | 104 | 0.727751 |
1a83a7b073d41f9a769bc86826abaf3e435f5173 | 38 | module Hunter
VERSION = "0.2.0"
end
| 9.5 | 19 | 0.657895 |
acfaceb40debadcbcac5b11bf5ea14db1d4f3bfe | 3,026 | class Clp < Formula
desc "Linear programming solver"
homepage "https://github.com/coin-or/Clp"
url "https://github.com/coin-or/Clp/archive/releases/1.17.6.tar.gz"
sha256 "afff465b1620cfcbb7b7c17b5d331d412039650ff471c4160c7eb24ae01284c9"
license "EPL-1.0"
revision 1
livecheck do
url :stable
regex(... | 40.891892 | 123 | 0.671183 |
ab3da33e5606e6f16420f24b8302c90a11824038 | 2,800 | class SnapTelemetry < Formula
desc "Snap is an opensource telemetry framework"
homepage "https://snap-telemetry.io/"
url "https://github.com/intelsdi-x/snap/archive/2.0.0.tar.gz"
sha256 "35f6ddcffcff27677309abb6eb4065b9fe029a266c3f7ff77103bf822ff315ab"
license "Apache-2.0"
head "https://github.com/intelsdi-... | 42.424242 | 122 | 0.733214 |
ffa5a5850102ad0f53d6ed1c88b74a861ec8cded | 153 | class UsersUpdateLevel < ActiveRecord::Migration
def self.up
execute "update users set level = 3 where level = 2"
end
def self.down
end
end
| 17 | 56 | 0.712418 |
e27a967bc339a02e56a3916ee6fa1f3588d58164 | 3,844 | class Opensearch < Formula
desc "Open source distributed and RESTful search engine"
homepage "https://github.com/opensearch-project/OpenSearch"
url "https://github.com/opensearch-project/OpenSearch/archive/refs/tags/1.0.0-beta1.tar.gz"
sha256 "d23385aa42f636049ae270bdb496843dc8d2dfd88bd7f4761e305e8193b76399"
... | 37.686275 | 117 | 0.668574 |
e2d4ec7fd8cd77683e14b9e09ff29c5f30524ae4 | 603 |
module EbayTrading # :nodoc:
module Types # :nodoc:
# == Attributes
# text_node :event_type, 'EventType', :optional => true
# text_node :summary_period, 'SummaryPeriod', :optional => true
# text_node :frequency, 'Frequency', :optional => true
class SummaryEventSchedule
include XML::Mappi... | 30.15 | 68 | 0.676617 |
e82e817f8fbefd1cf92532d9ce0f6276b7aa71cf | 2,193 | #
# Cookbook Name:: rvm
# Recipe:: user_install
#
# Copyright 2013, The Open Data Institute
#
# 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 limitati... | 28.480519 | 107 | 0.678067 |
87808a5ee4d9a0c390e1a6fcc7b050bc3362913a | 50 | scp_sql_2014 'developer' do
action :install
end
| 12.5 | 27 | 0.78 |
015fdda4be0d3574482f972dd9a2011b81f6cfe6 | 1,846 | # -*- encoding: utf-8 -*-
class ChatController < ApplicationController
include ChatHelper
include RoomHelper
can_edit_on_the_spot
PageSize = 20
def index
@rooms = Room.all_live(current_user)
end
def show
@id = params[:id]
@message = Message.where(:_id => @id).first
if @message.nil... | 24.613333 | 95 | 0.622427 |
28a9a5426af7e95e364edfc7c2f3e3a935137233 | 75 | FactoryBot.define do
factory :delete_favorites_request do
end
end
| 12.5 | 38 | 0.76 |
61ef7e7933927265765d424b686a7baf4d797d0a | 3,159 | module Intrigue
module Task
module Enrich
class DnsRecord < Intrigue::Task::BaseTask
def self.metadata
{
:name => "enrich/dns_record",
:pretty_name => "Enrich DnsRecord",
:authors => ["jcran"],
:description => "Fills in details for a DnsRecord",
:references => [],
:allowed_typ... | 27.955752 | 87 | 0.635644 |
ff1371b8f566ccbdb869d18dbe07798cb612d087 | 383 | require 'test_helper'
class SentMessagesControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get sent_messages_index_url
assert_response :success
end
test "should get new" do
get sent_messages_new_url
assert_response :success
end
test "should get create" do
get se... | 19.15 | 66 | 0.762402 |
bb11ae8c37c80954c0d6ada82ce628c73c21bdac | 312 | require_relative 'log'
class ClientThread < Thread
def initialize(name)
self.name = name
super() do
execute
end
end
private
def execute
puts "#{name} BEGIN"
10.times do |i|
Log.puts("i = #{i}")
sleep 0.1
end
Log.close
puts "#{name} END"
end
end
| 11.555556 | 27 | 0.560897 |
6a1843e653b14aea80e0a66749cd8be2b0b0e570 | 517 | class SessionsController < ApplicationController
def new
end
def create
if @user = User.find_by(email: params[:email])
if @user.authenticate(params[:password])
session[:user_id] = @user.id
redirect_to root_path, notice: "Welcome back #{@user.email}"
else
redirect_to new_session_path, notice: "Pa... | 22.478261 | 64 | 0.717602 |
b946ccb49f1f13cbb33548af5b30b4867120d167 | 5,553 | require 'rack/session/abstract/id'
module ActionDispatch
class Request < Rack::Request
# Session is responsible for lazily loading the session from store.
class Session # :nodoc:
ENV_SESSION_KEY = Rack::RACK_SESSION # :nodoc:
ENV_SESSION_OPTIONS_KEY = Rack::RACK_SESSION_OPTIONS # :nodoc:
... | 24.570796 | 85 | 0.553214 |
181eaf595b07a9a614427d35ef25aef0fd2c7f45 | 2,271 | Pod::Spec.new do |s|
s.name = 'FirebaseInstanceID'
s.version = '4.3.0'
s.summary = 'Firebase InstanceID for iOS'
s.description = <<-DESC
Instance ID provides a unique ID per instance of your iOS apps. In addition to providing
unique IDs for authentication,Instance ID can gene... | 37.229508 | 89 | 0.653457 |
872c41ce8cde77a10445ab4ad852a01d70e76b4f | 1,210 | class Xkeyboardconfig < Formula
desc "Keyboard configuration database for the X Window System"
homepage "https://xorg.freedesktop.org"
url "https://xorg.freedesktop.org/archive/individual/data/xkeyboard-config/xkeyboard-config-2.26.tar.bz2"
mirror "ftp://ftp.x.org/pub/individual/data/xkeyboard-config/xkeyboard-... | 31.842105 | 107 | 0.710744 |
6187288391e4590d8817a4b7e4aea6cf4ee3ba37 | 5,289 | require File.dirname(__FILE__) + '/../helper'
RE_<%= file_name.capitalize %> = %r{(?:(?:the )? *(\w+) *)}
RE_<%= file_name.capitalize %>_TYPE = %r{(?: *(\w+)? *)}
steps_for(:<%= file_name %>) do
#
# Setting
#
Given "an anonymous <%= file_name %>" do
log_out!
end
Given "$an $<%= file_name %>_... | 34.344156 | 130 | 0.628852 |
03f12724018c2d3ffb2bc5fa774d0217c278b2a8 | 24,152 | require_relative '../spec_helper'
require_relative '../fixtures/constants'
require_relative 'fixtures/constants_sclass'
require_relative 'fixtures/constant_visibility'
# Read the documentation in fixtures/constants.rb for the guidelines and
# rationale for the structure and organization of these specs.
describe "Lite... | 33.49792 | 120 | 0.701557 |
188d3248bd251af62fbe3e4aa79996bd846a6197 | 175 | class AddRatingToCommunityTools < ActiveRecord::Migration[5.0]
def change
add_column :community_tools, :rating, :float
add_index :community_tools, :rating
end
end
| 25 | 62 | 0.765714 |
5d6967f34665244c0ee2889bc58dd0ccab8cc462 | 1,120 | module Rester
module Service::Middleware
##
# Create a Request object for this thread, store the correlation ID, and
# perform the necessary logging. Cleanup the request once it's complete.
class RequestHandler < Base
def call(env)
Rester.wrap_request do
Rester.request = reques... | 37.333333 | 80 | 0.641964 |
bb82e3fd3a2e5f12b61d848942a4f73d5e9aa01d | 2,878 | module Orbf
module RulesEngine
class Contract
KNOWN_FIELDS = %w[contract_start_date contract_end_date id org_unit date].freeze
attr_reader :id, :start_period, :end_period, :field_values
def initialize(field_values, calendar)
@field_values = field_values
@id = field_values.fetch... | 28.78 | 138 | 0.59312 |
d58ee7a3a4283b5ecfc400c8c6b6297498413476 | 1,064 | Pod::Spec.new do |s|
s.name = 'RPHTTPServiceClient'
s.version = '2.0.0'
s.summary = 'RPHTTPServiceClient is a Type-safe JSON/HTTP client for iOS.'
s.description = <<-DESC
RPHTTPServiceClient enables anyone to simplify the way to consume webservices/APIs and map automagically... | 38 | 163 | 0.62782 |
0394c8be2e8626cbe376a31731f463d7c1a95eb7 | 9,071 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: src/proto/grpc/testing/control.proto
require 'google/protobuf'
require 'src/proto/grpc/testing/payloads_pb'
require 'src/proto/grpc/testing/stats_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("src/proto/grpc/testing/control... | 47.492147 | 131 | 0.717892 |
ff50a8be218cacb9a9145dc823869842fbe5d253 | 1,258 | # frozen_string_literal: true
module Binford
module Github
class ReviewDiscussion
include Binford::Utils
attr_reader :conversation
def initialize(commits, review_comments)
@changes = commits.map { |commit| commit_info(commit) }
@comments = review_comments.map { |comment| comme... | 25.673469 | 96 | 0.588235 |
113d4cf59cc3d4b7ab372812344ab072e957cfc3 | 307 | require_dependency "cor1440_gen/concerns/controllers/indicadorespf_controller"
module Cor1440Gen
class IndicadorespfController < ApplicationController
load_and_authorize_resource class: Cor1440Gen::Proyectofinanciero
include Cor1440Gen::Concerns::Controllers::IndicadorespfController
end
end
| 27.909091 | 78 | 0.85342 |
b96e5528c82863ad5dd32d8d4729c61deefe8c4f | 1,191 | class UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
def new
if logged_in?
redirect_to profile_path(session[:user_id])
else
@user = User.new
end
end
def create
@user = User.new(user_pa... | 19.85 | 95 | 0.563392 |
ab74d579fc259b706483fe9fae07c8baa883ea75 | 2,755 | require 'abstract_unit'
module ActiveSupport
class TestCaseTest < ActiveSupport::TestCase
class FakeRunner
attr_reader :puked
def initialize
@puked = []
end
def puke(klass, name, e)
@puked << [klass, name, e]
end
def options
nil
end
def ... | 26.238095 | 83 | 0.635935 |
394fc873a2eaf76c18e154d08267caa690c74a9a | 816 | # frozen_string_literal: true
module Resolvers
class Comments < Resolvers::Base
type '[Types::Comment]', null: true
description 'Find all comments or filter by approved'
argument :id, String, required: false, default_value: '', as: :uuid
argument :approved, Boolean, required: false
argument :lan... | 24.727273 | 71 | 0.631127 |
3803257499fea7ec8db6907be33b0362f7dbad72 | 465 | require 'active_record'
config = YAML.load(File.read('config/database.yml'))
ActiveRecord::Base.establish_connection(config['test'])
def need_to_migrate?
ActiveRecord::Migrator.new(:up, 'db/migrate').pending_migrations.any?
end
if need_to_migrate?
ActiveRecord::Migrator.up "db/migrate"
end
RSpec.configure do |c... | 21.136364 | 71 | 0.748387 |
e9c09ab90a4f4845ddd17bf04e22ed63ce795687 | 1,744 | exit if jruby?
ENV["DATABASE_URL"] ||= "postgres:///queue_classic_test"
require 'toro'
require 'test_workers'
describe TestWorker do
it_behaves_like "a worker"
end
describe MultiWorker do
context "when Toro is loaded" do
it "defaults to the :toro adapter" do
expect(MultiWorker.default_adapter).to eq(:... | 27.25 | 139 | 0.622133 |
61c182dea7d36b64940b4f60582e4c968ac42722 | 727 | require 'tc_xml'
require 'tc_attributes'
require 'tc_attr'
require 'tc_attr_decl'
require 'tc_document'
require 'tc_document_write'
require 'tc_dtd'
require 'tc_html_parser'
require 'tc_namespaces'
require 'tc_namespace'
require 'tc_node'
require 'tc_node_cdata'
require 'tc_node_comment'
require 'tc_node_copy'
require ... | 22.030303 | 31 | 0.825309 |
333cbe5f0916e901b532098d9ec018fe4db28c87 | 866 | Pod::Spec.new do |s|
s.name = 'iNotify'
s.version = '1.5.2'
s.license = 'zlib'
s.summary = "Lightweight alternative to Apple's push notifications(only launch time) for cross-promoting apps or pointing out non-obvious features."
s.description = "Library for displaying remotely admi... | 61.857143 | 278 | 0.690531 |
03a1a255fb5b22de50489e0c3ee7299ca06cc60e | 210 | # rubocop:disable Naming/FileName
# frozen_string_literal: true
module Elastic
module V12p1
RepositoryInstanceProxy = Elastic::Latest::RepositoryInstanceProxy
end
end
# rubocop:enable Naming/FileName
| 19.090909 | 70 | 0.804762 |
f888151ea6194c4eac94f4dba65527f792408e59 | 819 | # frozen_string_literal: true
# Category model
class Category < ApplicationRecord
serialize :name, Hash
serialize :description, Hash
belongs_to :parent, class_name: 'Category', foreign_key: :parent_id, optional: true
has_many :children, class_name: 'Category', foreign_key: :parent_id
has_many :item_categor... | 19.97561 | 85 | 0.722833 |
01af672537c1fde1bf5c4e60c2adc2ac9fd883da | 8,461 | # frozen_string_literal: true
require 'spec_helper'
require 'rails_helper'
require_relative '../contexts/tag_context'
# rubocop: disable Metrics/BlockLength
describe Api::TagsController, type: :controller do
before(:each) do
TagType.delete_cache
end
include_context 'tags'
let!(:user) { create(:user) }
... | 30.003546 | 90 | 0.551944 |
6adfe75f49731af206adc5cfc8c696d0be95e4c4 | 1,831 | class Mat2 < Formula
desc "Metadata anonymization toolkit"
homepage "https://0xacab.org/jvoisin/mat2"
url "https://0xacab.org/jvoisin/mat2/-/archive/0.12.0/mat2-0.12.0.tar.gz"
sha256 "d2a7a4dd674b084fcd2a63d70cd132a36cea46d98626df3c9258f8327085baa0"
license "LGPL-3.0-or-later"
bottle do
cellar :any_ski... | 35.901961 | 138 | 0.754233 |
6a15f638e3dc2bcfcc8cf7685cd0b7250ed595bb | 1,768 | require "rails_helper"
RSpec.describe "Authentication", type: :system do
context "when guest" do
it "renders sign in page with no flash messages" do
visit "/"
expect(page).to have_text "Log in"
expect(page).to_not have_text "sign in before continuing"
end
%w[volunteer supervisor casa_a... | 28.983607 | 81 | 0.645362 |
0856e13fa522e4fce90023e40e5e8463a284e243 | 748 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Vulnerabilities::Statistics::ScheduleWorker do
let(:worker) { described_class.new }
describe "#perform" do
let(:project) { create(:project) }
let(:deleted_project) { create(:project, pending_delete: true) }
before do
project.pr... | 28.769231 | 112 | 0.741979 |
618ac9fc76bc21068e3f9dd7063359bbd4f75809 | 886 | # frozen_string_literal: true
module SolidusGraphqlApi
module Mutations
class BaseMutation < GraphQL::Schema::RelayClassicMutation
argument_class Types::Base::Argument
field_class Types::Base::Field
input_object_class Types::Base::InputObject
object_class Types::Base::Object
privat... | 21.095238 | 86 | 0.613995 |
1a8543f9d9efd5318860636b3d3803830ba38ceb | 8,588 | =begin
#Selling Partner API for Product Type Definitions
#The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data requirements for product types in the Amazon catalog. Use this API to return the JSON Schema for a product type that you can then use with other Selling Part... | 32.653992 | 706 | 0.638449 |
ab21c532d0a5fddc590d3ce7f60c5211343b11c8 | 1,306 | # frozen_string_literal: true
require "dnsruby"
require "public_suffix"
module GitHubPages
module HealthCheck
class CAA
attr_reader :host
attr_reader :error
def initialize(host)
raise ArgumentError, "host cannot be nil" if host.nil?
@host = host
end
def errored?
... | 22.517241 | 89 | 0.612557 |
91ac327545d98ac4e867a84e778163b2a5d740bb | 1,596 | require 'spec_helper'
require 'ruby_event_store/rom/memory'
require 'ruby_event_store/spec/rom/relations/stream_entries_lint'
module RubyEventStore
module ROM
module Memory
RSpec.describe Relations::StreamEntries do
let(:rom_helper) { SpecHelper.new }
it_behaves_like :stream_entries_relation, Relations:... | 33.957447 | 113 | 0.689223 |
0375cfc55a2e7ceba0a2ad75c2355708ef0c8627 | 1,756 | Pod::Spec.new do |s|
s.name = "AppXperience"
s.version = "1.9.5"
s.summary = "AppXperience is an advertising fmk of mobile applications. Learn more at http://appxperience.com."
s.homepage = "https://github.com/atelierdumobile/AppXperienceFramework.git"
s.license = {
:type => '... | 45.025641 | 118 | 0.666856 |
26dc1189d40fe60096e05afeb8fa16ece8ed1788 | 2,781 | require 'doorkeeper/rails/routes/mapping'
require 'doorkeeper/rails/routes/mapper'
module Doorkeeper
module Rails
class Routes # :nodoc:
module Helper
def use_doorkeeper(options = {}, &block)
Doorkeeper::Rails::Routes.new(self, &block).generate_routes!(options)
end
end
... | 29.273684 | 125 | 0.619561 |
61c784b30a589ff9030766a50245533b1df8da83 | 310 | class Selected_book
attr_accessor :title_and_author, :total_votes, :title, :author, :url, :description, :rating, :number_of_ratings
@@all = []
def initialize(title_and_author, url)
@title_and_author = title_and_author
@url = url
@@all << self
end
def self.all
@@all
end
end | 25.833333 | 114 | 0.670968 |
bf58f011fb7234fb8d6f69541334ff4b84328381 | 1,060 | # frozen_string_literal: true
module API
module Meta
class Base
def initialize(endpoint_klass, opts = {}, &block)
@endpoint_klass = endpoint_klass
@opts = opts
opts[:block] = block if block.present?
decorate
end
private
attr_reader :endpoint_klass, :opts
... | 20.384615 | 71 | 0.595283 |
f7eefeb89251f73a600aaaa3c27efaf11124cd0f | 6,785 | # Spec requirements
require 'models/persistence/sequel/spec_helper'
require 'models/persistence/sequel/page_shared'
require 'lims-core/persistence/multi_criteria_filter'
require 'lims-laboratory-app/organization/order/all'
module Lims::LaboratoryApp
module Lims::Core::Persistence
shared_context "with saved orde... | 40.873494 | 164 | 0.601916 |
1c916e85474a4b81af0f84791aac129e30d69ea9 | 3,725 | # frozen_string_literal: true
require_relative '../../test_helper'
require 'pagy/extras/materialize'
require_relative '../../mock_helpers/pagy_buggy'
require_relative '../../mock_helpers/app'
describe 'pagy/extras/materialize' do
let(:app) { MockApp.new }
describe '#pagy_materialize_nav' do
it 'renders firs... | 45.426829 | 111 | 0.635705 |
acfe861eb5675c84881cfe2b084e4b1a7fae888d | 1,684 | Rails.application.routes.draw do
get '/events/feed' => 'events#feed'
get '/news/feed' => 'news#feed'
get '/people/feed' => 'people#feed'
get '/resources/feed' => 'resources#feed'
resources :resources
resources :news
resources :events
resources :at_who
resources :indications, only: :create
resourc... | 31.773585 | 131 | 0.66924 |
b922cea73259dd8ed37e669cdcf2a1ff65e6a153 | 4,128 | # frozen_string_literal: true
module ActionView
module Helpers # :nodoc:
# = Action View Rendering
#
# Implements methods that allow rendering from a view context.
# In order to use this module, all you need is to implement
# view_renderer that returns an ActionView::Renderer object.
module R... | 37.527273 | 125 | 0.583818 |
617fa7c9af63fc8541482e5506149554e07017ef | 815 | require_relative 'base_information'
require 'json'
require 'rest-client'
class TranslateLanguage < Link::Base #Inherits from Base with Class
attr_accessor :text, :code, :url, :information
def initialize(text, code)
@url = altera_link('translate') #Passa the url/functionality reponsible for Translate
@text... | 30.185185 | 93 | 0.706748 |
287b2dd44086cffe7ba23ff28ee9bc18e70b3403 | 1,378 | =begin
#Datadog API V2 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.0.0-SNAPSHOT
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Dat... | 29.319149 | 102 | 0.75254 |
87905130d62fc23fe6eaa9ad840f8b7c21369358 | 1,421 | # -*- encoding: utf-8 -*-
# stub: notiffany 0.0.8 ruby lib
Gem::Specification.new do |s|
s.name = "notiffany"
s.version = "0.0.8"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Cezary Baginski", "R\u{e9}my Couta... | 36.435897 | 118 | 0.642505 |
180441cb3bd89b3b033188c2b4016d00f4681359 | 909 | Pod::Spec.new do |s|
s.name = "FamilySearchCocoa"
s.version = "0.8.0"
s.summary = "An easy to use library for interacting with the FamilySearch.org API on iOS or OS X"
s.description = <<-DESC
You need to get a developer key from https://devnet.familysearch.org/ first. Then you can easily... | 47.842105 | 127 | 0.657866 |
1c226fd3e16cd536d6b31d4654ae99903e939b5d | 2,798 | # frozen_string_literal: true
require 'java'
require_relative '../../../../java/saxon9he.jar'
java_import 'java.io.StringReader'
java_import 'java.io.StringWriter'
java_import 'javax.xml.parsers.DocumentBuilder'
java_import 'javax.xml.parsers.DocumentBuilderFactory'
java_import 'javax.xml.transform.TransformerFacto... | 30.747253 | 100 | 0.690136 |
bf079a7de109edbcd63c692904a730b659f99024 | 950 | require 'spec_helper'
describe SearchController, type: :controller do
let(:single_events) { double('SingleEvents') }
let(:region_name) { 'koeln' }
let(:region) { double('Region') }
let(:region_slug) { double('RegionSlug', region: region) }
let(:search_params) { 'SearchParams' }
let(:search_results) { doubl... | 33.928571 | 89 | 0.723158 |
61963cbf2967dd8402f300b0100f8998fcde62eb | 288 | require File.dirname(__FILE__) + '/../../spec_helper'
describe "Float#ceil" do
it "returns the smallest Integer greater than or equal to self" do
-1.2.ceil.should == -1
-1.0.ceil.should == -1
0.0.ceil.should == 0
1.3.ceil.should == 2
3.0.ceil.should == 3
end
end
| 24 | 68 | 0.625 |
bbcc73b9bc130b37b50fccdc2bff4e7f352a444d | 4,859 | # spec/sleeping_king_studios/tasks/ci/rspec_runner_spec.rb
require 'sleeping_king_studios/tasks/ci/rspec_runner'
RSpec.describe SleepingKingStudios::Tasks::Ci::RSpecRunner do
let(:default_env) do
{ :ci => true, :bundle_gemfile => ENV['BUNDLE_GEMFILE'] }
end # let
let(:default_opts) { ['--color'] }
let(:in... | 28.751479 | 75 | 0.599712 |
0138033658f6eb46fdf19b9499dd7e269a5bd585 | 30,063 | # frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Chris Read <chris.read@gmail.com>
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance ... | 36.351874 | 243 | 0.599308 |
185d70920c33b545b0c08aa6b536711d751b9cf1 | 1,064 | require File.expand_path('../boot', __FILE__)
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/engine"
# req... | 34.322581 | 82 | 0.770677 |
1d5a87dd0cc4347b93684080ac43eab53530394f | 183 | class AddFeatureStatusToSolusPlans < ActiveRecord::Migration
def change
add_column :solus_plans, :feature_status, :integer
add_index :solus_plans, :feature_status
end
end
| 26.142857 | 60 | 0.79235 |
f82a757ce39720ff4e89635d1e521ffba0e31f92 | 68 | FactoryGirl.define do
factory :import_job_error do
end
end
| 11.333333 | 30 | 0.735294 |
61e1cf994262d01bc7bc59d76d6660b5f481b34a | 539 | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional ... | 41.461538 | 93 | 0.779221 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.