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 |
|---|---|---|---|---|---|
f735a0dbf783c583629488fa54c4563c2026a359 | 135 | module Ecm
module UserArea
module Backend
class ApplicationController < ActionController::Base
end
end
end
end
| 15 | 58 | 0.696296 |
e9f6852d8bc11cc43414f7266dafdc8d307865fa | 307 | class RemoveStartupLinkFieldsFromUser < ActiveRecord::Migration
def up
remove_columns :users, :startup_link_verifier_id, :startup_verifier_token
end
def down
add_column :users, :startup_verifier_token, :string
add_column :users, :startup_link_verifier_id, :integer, index: true
end
end
| 27.909091 | 77 | 0.785016 |
1d591f36cf5ebd886789ecdbbee2462d0ad8744a | 3,005 | class Cockroach < Formula
desc "Distributed SQL database"
homepage "https://www.cockroachlabs.com"
url "https://binaries.cockroachdb.com/cockroach-v2.0.4.src.tgz"
version "2.0.4"
sha256 "3636017029fccf48b23ee1c45a3412adc36803f53df254035e6e2f82af45fb50"
head "https://github.com/cockroachdb/cockroach.git"
... | 33.764045 | 106 | 0.661564 |
790a94c14e6c07c3cc4b1629bf972fc59745e985 | 8,708 | =begin
#SendinBlue API
#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/or... | 31.550725 | 839 | 0.610358 |
f86939afdcd0951b47f5505afc2844da180d6fe7 | 943 | class Mosml < Formula
desc "Moscow ML"
homepage "http://mosml.org"
url "https://github.com/kfl/mosml/archive/ver-2.10.1.tar.gz"
sha256 "fed5393668b88d69475b070999b1fd34e902591345de7f09b236824b92e4a78f"
bottle do
sha256 "7a888abd233069f837cf9aba4021baa71387a4b720bc53323d40a963433b566a" => :high_sierra
... | 33.678571 | 93 | 0.747614 |
f838a542cff4cd593222650f19207711b8719c0b | 6,121 | #
# shell.rb -
# $Release Version: 0.7 $
# $Revision: 1.9 $
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
#
#
require "e2mmap"
require "thread" unless defined?(Mutex)
require "forwardable"
require "shell/error"
require "shell/command-processor"
require "shell/process-controller"
... | 20.335548 | 97 | 0.618526 |
18750977e5c5f32393ac6a758811760589708b09 | 1,924 | module UserDocumentsController
extend ActiveSupport::Concern
included do
before_action :signed_in_user, :correct_user, except: [:show]
before_action :correct_user_or_shared_page, only: [:show]
before_action :assign_user
before_action :assign_user_document, except: [:new, :create]
end
... | 23.753086 | 81 | 0.677235 |
872f769e37338c93b77a4c42e67544265a9bab33 | 324 | # frozen_string_literal: true
class AddLatitudeAndLongitudeToAddressesCities < ActiveRecord::Migration[6.0]
def change
add_column :addresses_cities, :latitude, :float
add_index :addresses_cities, :latitude
add_column :addresses_cities, :longitude, :float
add_index :addresses_cities, :longitude
end
... | 29.454545 | 77 | 0.783951 |
d51ee8b0b375dd9ca4740b14f27990d3e56f9f4d | 1,501 | # 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::Storage::Mgmt::V2018_07_01
module Models
#
# The response from the List Usages operation.
#
class UsageListResult
inc... | 26.333333 | 72 | 0.49567 |
b935db137d0353ea812342a62e040e1f1c736a85 | 2,183 | module Fog
module Compute
class AWS
class Real
require 'fog/aws/parsers/compute/detach_volume'
# Detach an Amazon EBS volume from a running instance
#
# ==== Parameters
# * volume_id<~String> - Id of amazon EBS volume to associate with instance
# * options<~... | 35.786885 | 131 | 0.551077 |
7909885f647ca5e7c55635f506951bfaaa113dc0 | 7,480 | module YARD::CodeObjects
# A "namespace" is any object that can store other objects within itself.
# The two main Ruby objects that can act as namespaces are modules
# ({ModuleObject}) and classes ({ClassObject}).
class NamespaceObject < Base
attr_writer :constants, :cvars, :mixins, :child, :meths
attr_... | 37.21393 | 97 | 0.617914 |
7adc29bde6f361c4c7b2461e7ef38e419d081e1b | 297 | require 'pry'
require 'active_record'
#uncomment to view SQl command
# ActiveRecord::Base.logger = Logger.new(STDERR)
require './db_config'
require './models/user'
require './models/book'
require './models/comment'
require './models/vote'
require './models/rank'
require './main.rb'
binding.pry | 19.8 | 48 | 0.737374 |
bfd72e32a3acbfcda76c93a79ce1ab3dc17ff3c5 | 459 | #!/usr/bin/env ruby
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Simple script to read a JSON document and export it to Facebook Instant
# Article.
#
# Usage:
#
# ./bin/article_json_export_facebook.rb < my_document.json
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # ... | 28.6875 | 79 | 0.498911 |
26bff219ea9e38ac2b2bac3b380a3ef6c0d90a7d | 3,668 | # Constructs basic login/submission post requests (assumes protect_from_forgery
# is turned off)
if __FILE__ == $0
require 'net/http' # need net/http for constructing requests
require 'uri' # URI parsing lib
require 'fileutils'
require 'digest/md5' # required for boundary MD5 hashing
def get_file_hea... | 35.960784 | 100 | 0.678844 |
6a94466193af88fbb191a80182bf5130137ed4bc | 126 | Then /^the notices have loaded$/ do
using_wait_time(10) do
expect(page).to have_no_content("Loading notices")
end
end
| 21 | 54 | 0.730159 |
5d6b454c07ede7f6224d2781ff4622c313d83c7e | 2,187 | # 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... | 38.368421 | 95 | 0.721994 |
62319c9f444f698837e4c42f16f1dcc1e1a7dda5 | 290 | #!/usr/bin/env ruby
srand(Time.now.to_i + Process.pid + 93) # seed the rand
def rgen()
r = rand(2887453441..2887485696)
if r < 2887483392 || r > 2887485695 && r < 2887458816 || r > 2887459071
return r
else
rgen()
end
end
ip = rgen()
puts [ip].pack('N').unpack('CCCC').join('.')
| 17.058824 | 72 | 0.627586 |
e2b94f624f77f74511ffa34a806e58b7be16ff09 | 909 |
require 'rails_helper'
describe 'People search' do
let(:user) { create :user_admin }
before :each do
sign_in(user)
end
it 'busca uma pessoa que existe' do
person1 = create :person
person2 = create :person
visit people_path
expect(page).to have_content person1.name
expect(page).to ha... | 23.307692 | 49 | 0.708471 |
79b7ce69961868b66ae347cbf765983c5efd93b1 | 1,627 | module DeclarableHelper
def declarable_stw_link(declarable, search, anchor = 'import')
geographical_area = GeographicalArea.find(search.country)
declarable_type = declarable.heading? ? 'heading' : 'commodity'
today = Time.zone.today
stw_options = {
commodity: declarable.code,
originCountr... | 31.288462 | 109 | 0.704978 |
abd2bd82ea43a45a004391e53e9e5ced021b6420 | 1,932 | #
# Cookbook:: cerny-loadbalancer
# Recipe:: proxy
#
# Copyright:: 2018, Nathan Cerny
#
# 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
#
# Un... | 37.153846 | 97 | 0.713251 |
616e086406f03c553247f14f690596a446b5f2a1 | 598 | cask "preform" do
version "3.11.0,691"
sha256 "d69198762918892fca78567cb2b7b085981a97d1550c6081fded7452a18a6cb1"
url "https://s3.amazonaws.com/FormlabsReleases/Release/#{version.before_comma}/PreForm_#{version.before_comma}_release__build_#{version.after_comma}.dmg",
verified: "s3.amazonaws.com/FormlabsRel... | 42.714286 | 156 | 0.780936 |
62cbee959c4132196089aba20abf0a013e0afbe3 | 319 | class AddDescriptionAndHintToErrorTemplate < ActiveRecord::Migration
def change
add_column :error_templates, :description, :text
add_column :error_templates, :hint, :text
add_column :error_template_attributes, :description, :text
add_column :error_template_attributes, :important, :boolean
end
end
| 31.9 | 68 | 0.786834 |
03373964d725d050a2298f10137880642ad023bc | 329 | cask 'amadeus-pro' do
version :latest
sha256 :no_check
# amazonaws.com/AmadeusPro2 was verified as official when first introduced to the cask
url 'https://s3.amazonaws.com/AmadeusPro2/AmadeusPro.dmg'
name 'Amadeus Pro'
homepage 'http://www.hairersoft.com/pro.html'
license :commercial
app 'Amadeus Pro.... | 25.307692 | 88 | 0.74772 |
1ae3c0e8ac2571fab5ccb76b2e243147dceb5b32 | 10,559 | # frozen_string_literal: true
require 'spec_helper'
describe Whois::Server do
describe ".load_json" do
it "loads a definition from a JSON file" do
expect(File).to receive(:read).with("tld.json").and_return(<<~JSON)
{
"ae.org": {
"host": "whois.centralnic.com"
},
... | 34.848185 | 126 | 0.592102 |
79cfd6308ff7d15660f8938306055683c98a878f | 1,290 | require 'geocoder'
class MapCluster
attr_reader :clusters, :zoom, :tile_size
def initialize(zoom: 12, tile_size: 256, distance_in_pixels: 60)
@zoom, @tile_size = [zoom, 3].max, tile_size
@distance_in_pixels = distance_in_pixels
@clusters, @coordinates = [], []
end
def add_coordinate(coordinate)
... | 26.875 | 116 | 0.720155 |
284e8c0baa2652e9dabe9af528f686df167d4c9d | 386 | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'pe... | 35.090909 | 60 | 0.686528 |
e951cd6a38e37d4aa94a529bfa6c0d3785db5315 | 3,640 | # 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::Network::Mgmt::V2018_12_01
module Models
#
# Information about a hop between the source and the destination.
#
class Connect... | 29.12 | 74 | 0.447802 |
f88fbff5e5b0fa546df048ac0b356670f64053a3 | 13,228 | require_relative 'test_api'
module PaypalService
module TestMerchant
def self.build(api_builder)
PaypalService::Merchant.new(nil, TestLogger.new, TestMerchantActions.new.default_test_actions, api_builder)
end
end
class FakePalMerchant
def initialize
@tokens = {}
@payments_by_order... | 34.71916 | 124 | 0.610145 |
f8e3caa81f0dd649fed33a9f9d9bcbb8a0f1fc7c | 2,312 | class RunCampaignJob < ApplicationJob
queue_as :critical
SLOW_ADJUSTMENT_FACTOR = 0.25
FAST_ADJUSTMENT_FACTOR = 0.9
LOWER_BOUND_CONVERSION_RATE = 0.01
V3_JOB_MINUTES_CADENCE = 10
V2_JOB_MINUTES_CADENCE = 5
# Job that decides users the be matched for a given campaign at a given point in time.
# This jo... | 35.030303 | 114 | 0.737024 |
ffddf73ad29686eec3088552fd6d298105460992 | 2,988 | describe Unitpay::Service do
let(:service) { described_class.new('domain', 'public_key', 'secret_key', use_sign) }
let(:sum) { 100 }
let(:account) { 1 }
let(:desc) { 'description' }
let(:valid_signature) { '2053205d12e1b73ca6f42cf1cc9289a05aefd34f6e5ab9cb043e00494ae4b03c' }
let(:use_sign) { true }
descr... | 26.442478 | 139 | 0.631191 |
b93fc2b5b2c81336382eca27f532a6eba1fed10e | 343 | module Lunar
# @private A helper for producing all the characters of a word.
#
# @example
#
# expected = %w(a ab abr abra abrah abraha abraham)
# FuzzyWord.new("Abraham").partials == expected
# # => true
#
class FuzzyWord < String
def partials
(1..length).map { |i| self[0, i].downca... | 21.4375 | 65 | 0.606414 |
18bb44a8b52d33575b415304fd2040b56bebf6ed | 3,960 | 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.684211 | 102 | 0.758838 |
7ab907f2cc0ddc97029f0c12e6811c8f572da000 | 1,636 | class Logstalgia < Formula
desc "Web server access log visualizer with retro style"
homepage "http://logstalgia.io/"
url "https://github.com/acaudwell/Logstalgia/releases/download/logstalgia-1.0.7/logstalgia-1.0.7.tar.gz"
sha256 "5553fd03fb7be564538fe56e871eac6e3caf56f40e8abc4602d2553964f8f0e1"
revision 2
... | 28.701754 | 106 | 0.690709 |
bbb9cbc8aea1c808ff0babdc72ed489008d0c475 | 346 | require 'ostruct'
class Hash
def to_ostruct
o = OpenStruct.new(self)
each do |k,v|
o.send(:"#{k}=", v.to_ostruct) if v.respond_to? :to_ostruct
end
o
end
end
class Array
def to_ostruct
map do |item|
if item.respond_to? :to_ostruct
item.to_ostruct
else
item
... | 14.416667 | 65 | 0.589595 |
1878453b4982300d2f0e157510079c01bf9efefb | 1,055 | class Conserver < Formula
desc "Allows multiple users to watch a serial console at the same time"
homepage "https://www.conserver.com/"
url "https://github.com/conserver/conserver/releases/download/v8.2.2/conserver-8.2.2.tar.gz"
sha256 "05ea1693bf92b42ad2f0a9389c60352ccd35c2ea93c8fc8e618d0153362a7d81"
bottle... | 36.37931 | 94 | 0.759242 |
e229e167150bd6861614ce6b14afd5ad2d5597b0 | 118 | class AddLocationToGroups < ActiveRecord::Migration
def change
add_column :groups, :location, :string
end
end
| 19.666667 | 51 | 0.762712 |
61001f07c655b16fcad1c2dd69a89b4a2d0b4c23 | 9,296 | require "pp"
RSpec.describe ValueSemantics do
around do |example|
# this is necessary for mutation testing to work properly
with_constant(:Doggums, dog_class) { example.run }
end
let(:dog_class) do
Class.new do
include ValueSemantics.for_attributes {
name
trained?
}
e... | 29.141066 | 83 | 0.625323 |
1dbea03d475ce67576b6525581282480cc2c16a9 | 2,242 | require 'sequel'
module Intrigue
module Core
module System
module Database
## no need to namespace?
# database set up
def setup_database
database_config = YAML.load_file("#{$intrigue_basedir}/config/database.yml")
options = {
:max_connections => database_config[$intrigue_environment]["max_conne... | 36.754098 | 131 | 0.699822 |
3992f0eedb58f38fae9224938a26cc995be9d524 | 256 | # Copyright 2020 Google LLC
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
class Post < ActiveRecord::Base
belongs_to :author
has_many :comments
end
| 23.272727 | 53 | 0.753906 |
33ee8a4f10c22290a2985babe9599c86ee0046a4 | 1,024 | require "rubygems"
require "bundler/setup"
require "ruby-transmitsms"
require "test/unit"
require "vcr"
VCR.configure do |c|
c.cassette_library_dir = "fixtures/vcr_cassettes"
c.hook_into :webmock
end
class EmailApiTest < Test::Unit::TestCase
def setup()
@api = EmailApi.new("15ad266c538fb36c4d90f01055aef494... | 24.97561 | 68 | 0.678711 |
e28a1f51a85c6ed68fb270e540d4563a84d3066b | 11,476 | # frozen_string_literal: true
require 'rails_helper'
require_relative '../support/iam_session_helper'
require_relative '../support/matchers/json_schema_matcher'
RSpec.describe 'claims and appeals overview', type: :request do
include JsonSchemaMatchers
before(:all) do
@original_cassette_dir = VCR.configure(&:... | 48.218487 | 109 | 0.64404 |
7ab55e605ac742b0cbc745509c9841ba96a14b6b | 242 | module InputTypes
class CreateMetricInputType < Types::BaseInputObject
description "Attributes for creating a metric and associating it to a user"
argument :name, String, "Name associated with this metric", required: true
end
end
| 34.571429 | 79 | 0.77686 |
6194b755dec32eff8a36776bc0ae939ab9152c62 | 2,103 | # frozen_string_literal: true
module EE
module Types
module QueryType
extend ActiveSupport::Concern
prepended do
field :iteration, ::Types::IterationType,
null: true,
resolve: -> (_obj, args, _ctx) { ::GitlabSchema.find_by_gid(args[:id]) },
descripti... | 42.06 | 151 | 0.636234 |
e9e18acddc7b42e0af97bcffedae6ee34139a8cf | 222 | class ChangeOdsaAttemptsCorrectColumnName < ActiveRecord::Migration
def change
rename_column :odsa_exercise_attempts, :correct, :worth_credit
rename_column :odsa_exercise_attempts, :completed, :correct
end
end
| 31.714286 | 67 | 0.815315 |
d585d895425c037f6925d5378bb506c395733ed7 | 111 | class Admin::AdminController < ApplicationController
layout "admin"
before_filter :authenticate_admin!
end
| 22.2 | 52 | 0.81982 |
4aecdb2fd026ced1e43ec510698246f1e4a5952c | 1,783 | # == Schema Information
#
# Table name: litigations
#
# id :bigint not null, primary key
# title :string not null
# slug :string not null
# citation_reference_number :string
# document_type :string
# geograph... | 32.418182 | 76 | 0.570387 |
5d7ee13ae98ba72244198969c1545f96cb207a75 | 27,690 | require 'spec_helper'
describe Mongo::URI do
describe '.get' do
let(:uri) { described_class.get(string) }
context 'when the scheme is mongodb://' do
let(:string) do
'mongodb://localhost:27017'
end
it 'returns a Mongo::URI object' do
expect(uri).to be_a(Mongo::URI)
... | 27.634731 | 124 | 0.596714 |
911bff78b96753a37d2079c3bb7b361cfbcff6e9 | 709 | require 'rails_helper'
RSpec.describe "affiliates/index", :type => :view do
before(:each) do
assign(:affiliates, [
Affiliate.create!(
:name => "Name",
:adv => "MyText",
:display_count => 1,
:view_count => 2
),
Affiliate.create!(
:name => "Name",
:... | 24.448276 | 62 | 0.533145 |
9122e121ffe2fbb2b400afe4aa7b47f93e291db2 | 2,858 | module Shoulda # :nodoc:
module Matchers
module ActiveModel # :nodoc:
# Ensures that the attribute can be set on mass update.
#
# it { should_not allow_mass_assignment_of(:password) }
# it { should allow_mass_assignment_of(:first_name) }
#
# In Rails 3.1 you can check role... | 27.480769 | 81 | 0.561582 |
1c47d0efc2c1ff71ff7a5d7e080753dbff29625e | 527 | module Keymaker
class BatchGetNodesRequest < BatchRequest
attr_accessor :node_ids
def initialize(service, node_ids)
self.config = service.config
self.node_ids = node_ids
self.service = service
self.opts = build_job_descriptions_collection
end
def build_job_descriptions_coll... | 21.08 | 74 | 0.669829 |
28a5f9ca06a4a45e9550469c013c9c2c2d02ce3f | 5,734 | #!/usr/bin/perl
###########################################################
# Introducing non-breaking spaces into poetic lines
# for better EPUB formatting.
# An example script.
# NB! It is a sample for the simple cases and it does not
# handle poetry with complex predefined formatting.
#
# Copyright (c) 2011... | 26.302752 | 150 | 0.475061 |
0165c305ea34b4dd071d43e6c669fab3db377e57 | 2,141 | require 'helper'
require 'date'
describe Bluecap::Cohort do
before do
Bluecap.redis.flushall
@date = Date.parse('20120701')
@initial_event = 'Sign Up'
@attributes = {:country => 'Australia', :age => 31}
@users = {
:evelyn => Bluecap::Identify.new('Evelyn').handle,
:charlotte => Blue... | 27.448718 | 77 | 0.625876 |
4a11988cdee87228c00ed56968bf638bb101cac5 | 252 | class Category < ApplicationRecord
has_many :tasks
has_many :users, through: :tasks
has_many :group_tasks
has_many :groups, through: :group_tasks
has_many :category_users
validates :name, uniqueness: true
validates_presence_of :name
end
| 25.2 | 42 | 0.777778 |
ff2122c10e4ac89b287f1f7512efa8877cddd8f5 | 1,796 | class GitFilterRepo < Formula
desc "Quickly rewrite git repository history"
homepage "https://github.com/newren/git-filter-repo"
url "https://github.com/newren/git-filter-repo/releases/download/v2.24.0/git-filter-repo-2.24.0.tar.xz"
sha256 "92188d3c44b9ff0dd40dfeed72859e0a088f775c12fb24c4e3e27a8064cfcc84"
bo... | 35.215686 | 105 | 0.722717 |
017cf5081cdf475dad426821784b2f59e2eca7ef | 479 | cask 'vault@1.1.3' do
version '1.1.3'
sha256 'a0a7a242f8299ac4a00af8aa10ccedaf63013c8a068f56eadfb9d730b87155ea'
# releases.hashicorp.com was verified as official when first introduced to the cask
url 'https://releases.hashicorp.com/vault/1.1.3/vault_1.1.3_darwin_amd64.zip'
appcast 'https://github.com/hashico... | 29.9375 | 85 | 0.76618 |
f7a2dae253d6fae44cbb428ab1fec575b5b30cbc | 2,203 | class Post
include Mongoid::Document
include Mongoid::Timestamps
field :subject, :type => String
belongs_to :account, index: true, inverse_of: :posts_as_creator
belongs_to :commentable, polymorphic: true, index: true
has_many :subscriptions, :dependent => :destroy
has_many :comments, :dependent => ... | 31.028169 | 103 | 0.635497 |
7a2e3505d7a25fa0fef57c785835b8c0e641c904 | 1,966 | RSpec.describe 'group by' do
it 'groups words by length' do
words = ["sue", "alice", "steve", "sally", "adam", "fort", "tops", "dog", "cat"]
grouped = words.group_by do |word|
word.length
end
expected = {3=>["sue", "dog", "cat"], 4=>["adam", "fort", "tops"], 5=>["alice", "steve", "sally"]}
e... | 35.107143 | 115 | 0.563072 |
62936c968e344d2d16d696ad92ad33833f43db7d | 16,427 | module Facebooker
module Rails
# ActionMailer like module for publishing Facbook messages
#
# To use, create a subclass and define methods
# Each method should start by calling send_as to specify the type of message
# Valid options are :email and :notification, :user_action, :profile, :ref
#... | 34.510504 | 198 | 0.599683 |
d5a9c174bd808cf90fc6ef79a60aa8f1a4d1fd90 | 109 | require 'spec_helper'
describe InventoryOut do
pending "add some examples to (or delete) #{__FILE__}"
end
| 18.166667 | 56 | 0.761468 |
089e28308e0de8da2187a733dc4b352d57713f99 | 5,166 | Pod::Spec.new do |s|
s.name = 'Firebase'
s.version = '7.5.0'
s.summary = 'Firebase'
s.description = <<-DESC
Simplify your app development, grow your user base, and monetize more effectively with Firebase.
DESC
s.homepage = 'https://firebase.g... | 29.186441 | 113 | 0.65331 |
01d5379e6fc871f5858573a6e735d479266d6e4c | 1,230 | Spree::Order.class_eval do
has_many :fedex_crossborder_order_confirmations, -> { order(created_at: :desc) }
attr_reader :current_fedex_crossborder_confirmation
def current_fedex_crossborder_confirmation
self.fedex_crossborder_order_confirmations.first
end
# Guest checkout doesn't seem to have shipping... | 32.368421 | 104 | 0.687805 |
b9be1a7245daa66dab5b7376d222e6a07c7051bc | 443 | ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require "minitest/reporters"
Minitest::Reporters.use!
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
def is_logged_in?
... | 31.642857 | 82 | 0.749436 |
338a5ebd4f26f42965d33cfe6c64538bc65b61ef | 2,431 | require 'spec_helper'
describe "cms_notices", dbscope: :example, type: :feature do
let(:site) { cms_site }
let(:item) { create(:cms_notice, site: site) }
let(:index_path) { cms_notices_path site.host }
let(:new_path) { new_cms_notice_path site.host }
let(:show_path) { cms_notice_path site.host, item }
let(... | 25.589474 | 62 | 0.611682 |
fff7428873066ee6298c127319f6ff5101e2de13 | 2,483 | # meraki
#
# This file was automatically generated by APIMATIC v2.0
# ( https://apimatic.io ).
module Meraki
# AddNetworkSmProfileClarityModel Model.
class AddNetworkSmProfileClarityModel < BaseModel
# The bundle ID of the application, defaults to com.cisco.ciscosecurity.app
# @return [String]
... | 35.985507 | 80 | 0.634313 |
acd87ea595485c699e8d46017414a5c3da81c736 | 919 | require 'spec_helper'
# from previous install
describe file('c:/Octopus') do
it { should be_directory }
end
describe file('C:/Program Files/Octopus Deploy/Octopus/Octopus.Server.exe') do
it { should be_file }
end
#describe windows_registry_key('HKEY_LOCAL_MACHINE\Software\Octopus\OctopusServer') do
# it { shoul... | 27.848485 | 117 | 0.779108 |
1169fce854b2966c9460fd6defa9f27cb5c9d045 | 76 | class Comment < ActiveRecord::Base
belongs_to :user
belongs_to :post
end | 19 | 34 | 0.776316 |
b96a43414984644de4917c856e1646131696a195 | 102 | require "rails_helper"
RSpec.describe ScoreboardsController, type: :controller do
render_views
end
| 17 | 58 | 0.823529 |
33000f6c20e1e5e5c2183204a39c9f8c1d109bdf | 5,975 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop checks for use of the `File.expand_path` arguments.
# Likewise, it also checks for the `Pathname.new` argument.
#
# Contrastive bad case and good case are alternately shown in
# the following examples.
... | 30.641026 | 80 | 0.577573 |
5ddb20ccd9189b9a56674daa34ebad2458d8241e | 4,910 | # coding: utf-8
module Babushka
class Cmdline
handle('global', "Options that are valid for any handler") {
opt '-v', '--version', "Print the current version"
opt '-h', '--help', "Show this information"
opt '-d', '--debug', "Show more verbose logging, and realtime shell command... | 39.28 | 198 | 0.570672 |
f763178c211f2ffe47be02ed9749b2bb84c1b86a | 3,984 | require 'spec_helper'
describe 'collectd::plugin::write_graphite', :type => :class do
let :facts do
{
:osfamily => 'Debian',
:concat_basedir => tmpfilename('collectd-write_graphite'),
:id => 'root',
:kernel => 'Linux',
:path => '/usr/lo... | 32.655738 | 105 | 0.612952 |
01a2b44ac5a0f3263a137eae0ac5253ad63fddf1 | 156 | require 'test_helper'
module AttachIt
class AttachedFileTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
end
| 15.6 | 50 | 0.685897 |
38b84e0f01238a94dc92bc7406d94d687adc22c9 | 2,252 | require 'spec_helper'
describe 'ensure_not_symlink_target' do
let(:msg) { 'symlink target specified in ensure attr' }
context 'with fix disabled' do
context 'file resource creating a symlink with seperate target attr' do
let(:code) do
<<-END
file { 'foo':
ensure => link,
... | 22.29703 | 81 | 0.546625 |
87e33a45bd2f8d3090a86fdfed17f60e51dfe24a | 244 | module Tassadar
module MPQ
module CryptBuf
def self.[](index)
crypt_buf[index]
end
def self.crypt_buf
@@crypt_buff ||= crypt_buf!
end
def self.crypt_buf!
end
end
end
end
| 14.352941 | 35 | 0.540984 |
e2861ba8aa360eb690d2bb22ed0d7db21cb720c1 | 1,456 | module SpreeBlog
module Archive
# Public: The main class to be accessed when creating a HTML post archive.
class List
# Gets/Sets the list of years for this archive object.
attr_accessor :years
# Gets/Sets the list of _{Archiveable archiveable}_ objects for this Archive List.
attr_a... | 27.471698 | 88 | 0.659341 |
ace05a53fddcbb5c777d408528dec33cfb23014f | 88 | class FoodAccessPoint < ApplicationRecord
has_many :schedules
belongs_to :user
end
| 14.666667 | 41 | 0.806818 |
26337dfd9015381609e730138cf515979d586c2d | 2,605 | # Copyright 2011-2020, The Trustees of Indiana University and Northwestern
# University. 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
#
# ... | 28.315217 | 101 | 0.624184 |
799bdb8d4245f30bd7822cea1e31adf7306ebfbf | 102 | class AddTrigram < ActiveRecord::Migration[6.1]
def change
enable_extension "pg_trgm"
end
end
| 17 | 47 | 0.745098 |
1c0dbed4fdcdf57af4521317594f696c9f3615f0 | 266 | class FontTelex < Formula
head "https://github.com/google/fonts/raw/master/ofl/telex/Telex-Regular.ttf"
desc "Telex"
homepage "https://www.google.com/fonts/specimen/Telex"
def install
(share/"fonts").install "Telex-Regular.ttf"
end
test do
end
end
| 24.181818 | 79 | 0.718045 |
034f4ab2eaaa75addb0638f2d3e090dbaa3057f7 | 715 | # FIX ERROR: uninitialized constant ApplicationCable::ActionCable
require 'rails_helper'
module Bobot
RSpec.describe CommanderJob, type: :job do
subject(:job) { described_class.perform_later(payload) }
let :payload do
{
'sender' => {
'id' => '2'
},
'recipient' => {
... | 22.34375 | 65 | 0.534266 |
611d080a26f5f2c9e55c84d36f524ea7a05ee3fa | 203 | class CreateIngredientLists < ActiveRecord::Migration[6.1]
def change
create_table :ingredient_lists do |t|
t.integer :quantity
t.boolean :checked
t.timestamps
end
end
end
| 18.454545 | 58 | 0.689655 |
ff24ac27bbdaed0e96902db0cbb713d1235f9af8 | 1,426 | # -*- encoding: utf-8 -*-
# stub: bunny 2.12.0 ruby lib
Gem::Specification.new do |s|
s.name = "bunny".freeze
s.version = "2.12.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Chris Duncan".freez... | 39.611111 | 150 | 0.672511 |
1dfc84664e8c5b46e2ddbe1108db99da27b49844 | 824 | module UserFindables
module ClassMethods
##############################
# Finds the User by the slug #
##############################
def find_by_slug(slug)
self.all.find {|s| s.slug == slug}
end
#################################################
# Test to see if the input email a... | 25.75 | 62 | 0.427184 |
7a707e41afb3237501eaa216e431920ded3dded0 | 20,371 | require 'spec_helper'
require 'msf/core/payload_generator'
describe Msf::PayloadGenerator do
include_context 'Msf::Simple::Framework#modules loading'
let(:lhost) { "192.168.172.1"}
let(:lport) { "8443" }
let(:datastore) { { "LHOST" => lhost, "LPORT" => lport } }
let(:add_code) { false }
let(:arch) { "x86"... | 30.771903 | 179 | 0.648029 |
bb8f556dfb63e7191010f88e300ff5a2d15cf09d | 37 | module Mapas
VERSION = "0.0.1"
end
| 9.25 | 19 | 0.648649 |
87e5750ce6eb5dae81e9bd3b77ad1454947eecdb | 17,608 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe MergeRequests::MergeService do
let_it_be(:user) { create(:user) }
let_it_be(:user2) { create(:user) }
let(:merge_request) { create(:merge_request, :simple, author: user2, assignees: [user2]) }
let(:project) { merge_request.project }
before ... | 35.861507 | 169 | 0.655043 |
28f6a44d18268585e366dd8f4d2bbeac5964018c | 140 | class RemoveExpirationFromPassenger < ActiveRecord::Migration[5.1]
def change
remove_column :passengers, :expiration, :date
end
end
| 23.333333 | 66 | 0.778571 |
b903228d721183d0678ab69ac372700397dac73c | 617 | module RuGGby
module Action
# Action invoken when we want to change status
class ChangeStatus < Base
attr_reader :status, :description
def initialize(client, status, description)
@client = client
@block = client.actions[:change_status]
@status = status
@descript... | 19.903226 | 71 | 0.627229 |
3885bf8649714a7aace3dfe199eb1c711c0351a9 | 368 | class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
helper_method :current_user
def current_user
@current_user ||= User.find(session[:user_id]) if session[:user_id]
end
def require_user
redirect_to login_path unless current_user
end
def require_guest
... | 20.444444 | 71 | 0.774457 |
d5661a6ac0ed4227421369feed8c84c7ed72a57e | 263 | module RSpec
module Proverbs
# In RSpec, notifications are value objects that are passed to formatters
# to provide those formatters with information about a particular event.
Notification = Struct.new(:example, :type, :message, :options)
end
end
| 32.875 | 77 | 0.749049 |
39374a3816e749e3196bafedaa7a496d861ceccf | 3,539 | require_relative '../../spec_helper'
describe "Time#getlocal" do
it "returns a new time which is the local representation of time" do
# Testing with America/Regina here because it doesn't have DST.
with_timezone("CST", -6) do
t = Time.gm(2007, 1, 9, 12, 0, 0)
t.localtime.should == Time.local(2007... | 35.747475 | 104 | 0.642837 |
6a47db989aefea9dc0dff8143ec8b534a7d947b2 | 38,471 | #--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++
require 'rubygems/version'
require 'rubygems/requirement'
require 'rubygems/platform'
require 'rubygems/maven_gemify'
# :stopdoc:
class Date; end # for ruby_code if date.rb wasn't re... | 25.579122 | 131 | 0.653505 |
38a69a203d797d071bf10f1a030e3116f6399528 | 973 | # frozen_string_literal: true
require "se_providers_api_client/dsl"
module SeProvidersApiClient
module DSL
module Quotes
# GET /api/providers/v1/quotes
# Get quotes. See https://demo.scienceexchange.com/api-docs/providers#/quotes/getProvidersV1Quotes
# @return [Array].
def get_quotes
... | 34.75 | 108 | 0.663926 |
21beb6f6d6f83ec2938f58e171a4be09ad86725b | 83 | module Bintray
module Error
class NotFound < StandardError
end
end
end
| 11.857143 | 34 | 0.710843 |
1c41e4ef8726382bc0b469cf16d372308545b9f5 | 163 | class UpdateTagsChangeSessionToUser < ActiveRecord::Migration
def change
remove_column :tags, :session_id
add_column :tags, :user_id, :integer
end
end
| 23.285714 | 61 | 0.766871 |
6a9d840831dc11faf092c288c11d930c5f3bde52 | 288 | # frozen_string_literal: true
module Types
class IssueStateEventEnum < BaseEnum
graphql_name 'IssueStateEvent'
description 'Values for issue state events'
value 'REOPEN', 'Reopens the issue', value: 'reopen'
value 'CLOSE', 'Closes the issue', value: 'close'
end
end
| 24 | 56 | 0.722222 |
61cd0e0209f3336de9f9a3ade0f6397db088fe4e | 163 | require 'spec_helper'
describe Tag, type: :model do
it {should validate_presence_of(:name)}
it {should have_many(:stubs)}
it {should have_many(:items)}
end
| 20.375 | 41 | 0.730061 |
917a0951ef82a3c9e362549775bcb5763b8173b9 | 1,106 | require "parallel_tests/gherkin/runner"
module ParallelTests
module Cucumber
class Runner < ParallelTests::Gherkin::Runner
SCENARIOS_RESULTS_BOUNDARY_REGEX = /^(Failing|Flaky) Scenarios:$/
SCENARIO_REGEX = /^cucumber features\/.+:\d+/
class << self
def name
'cucumber'
... | 26.333333 | 100 | 0.579566 |
d549781906aed4670ece5bc830f4bc2b81b45736 | 134 | class AddTimeStampToReferredRecords < ActiveRecord::Migration[4.2]
def change
add_timestamps(:spree_referred_records)
end
end
| 22.333333 | 66 | 0.80597 |
bb47b33905103059f84f293887d37324bd1b7e29 | 642 | require 'simplecov'
module SimpleCov::Configuration
def clean_filters
@filters = []
end
end
SimpleCov.configure do
clean_filters
load_adapter 'test_frameworks'
end
ENV['COVERAGE'] && SimpleCov.start do
add_filter '/.rvm/'
end
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH... | 20.709677 | 71 | 0.732087 |
7a90494e9ec4202bb4a8d875dea862d8c1032d54 | 44 | module Kvm
module Instructions
end
end
| 7.333333 | 21 | 0.75 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.