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 |
|---|---|---|---|---|---|
f8e2c6c88a39b8d6d76c5dcdea29c58eca571ca8 | 1,069 | class FollowingBecomesInteresting < ActiveRecord::Migration
def up
FactData.all.each do |fact_data|
user_ids = followers_for_comments(fact_data.comments)
user_ids.each do |user_id|
Backend::Facts.set_interesting fact_id: fact_data.fact_id, user_id: user_id
end
end
end
def down
... | 26.725 | 83 | 0.724977 |
e806b8ae988b4827da6e3b67a826119ef93ff45d | 2,972 | # frozen_string_literal: true
require_relative '../../puppet/x/jenkins/type/cli'
Puppet::X::Jenkins::Type::Cli.newtype(:jenkins_credentials) do
@doc = <<-EOS
Manage Jenkins' credentials
XXX The properties specified are not validated against the specified
jenkins class (`impl`)
EOS
ensurable
... | 24.97479 | 122 | 0.716016 |
6a5626a8f310410d1ff478104c2678baa878dc01 | 13,452 | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | 35.4 | 135 | 0.619313 |
8784a75c74bc7ddd20104ada16585f99bd953748 | 5,766 | require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold... | 36.0375 | 95 | 0.688519 |
5dff2680470a3eb86745c8caab984abc8893ac00 | 448 | module Summary
module Sections
class C1aChildrenAbuseDetails < C1aBaseAbuseDetails
def name
:c1a_children_abuse_details
end
def show_header?
false
end
# For children, we filter the `other` abuse, because
# it has its own section later in the PDF.
def fil... | 18.666667 | 58 | 0.622768 |
ab8064b245e287c48e1da5758d708c196abe090c | 7,639 | # frozen_string_literal: true
module Script
module Layers
module Infrastructure
class ScriptProjectRepository
include SmartProperties
property! :ctx, accepts: ShopifyCLI::Context
property :directory, accepts: String
property :initial_directory, accepts: String
MUTAB... | 27.879562 | 113 | 0.586333 |
b9f3312cd3f9e8c96bd30d2f073aa1e12b2c0686 | 4,488 | require 'rails_helper'
RSpec.describe ShopEmployerNotices::RenewalEmployerIneligibilityNotice, dbclean: :after_each do
let(:start_on) { TimeKeeper.date_of_record.beginning_of_month + 1.month - 1.year}
let!(:employer_profile){ create :employer_profile}
let!(:person){ create :person}
let!(:plan_year) { FactoryBo... | 47.744681 | 193 | 0.722371 |
334760e094684d3728cbaa79ef60305d3849227e | 1,249 | # == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# current_sign_in_at :datetime
# current_sign_in_ip :string(255)
# deleted_at :datetime
# email :string(255) default(""), not null
# encrypted_password :st... | 31.225 | 69 | 0.578863 |
5dd2fa226909f5f9446843004683a7b3872bb78c | 4,785 | # frozen_string_literal: true
module API
# Environments RESTfull API endpoints
class Environments < ::API::Base
include PaginationParams
before { authenticate! }
feature_category :continuous_delivery
params do
requires :id, type: String, desc: 'The project ID'
end
resource :project... | 37.093023 | 106 | 0.673145 |
e8c840cc65a7e9cf068cdf8ab5fe09a5b3eda5b2 | 679 | require File.dirname(__FILE__) + "/spec_helper"
describe HostConnect::Client do
it "should have a http connection" do
Client.http_connection.should be_an_instance_of(Net::HTTP)
end
it "should post xml requests" do
request = File.read("./spec/fixtures/requests/ping.xml")
response = File.read("./spec/... | 32.333333 | 73 | 0.733432 |
5df9cd7a2bfffd831eeb540c809e18217fd602a9 | 57 | FactoryBot.define do
factory :author do
end
end
| 9.5 | 20 | 0.684211 |
4a39d89e71b05e975667986c371498c3027f89dd | 1,672 | class Zzuf < Formula
desc "Transparent application input fuzzer"
homepage "http://caca.zoy.org/wiki/zzuf"
url "https://github.com/samhocevar/zzuf/releases/download/v0.15/zzuf-0.15.tar.bz2"
sha256 "04353d94c68391b3945199f100ab47fc5ff7815db1e92581a600d4175e3a6872"
license "WTFPL"
bottle do
sha256 arm64_b... | 41.8 | 96 | 0.75 |
8729af210d1c66ec96e1bf98c0b0b8b3573ec948 | 1,832 | # This file is automatically created by Recurly's OpenAPI generation process
# and thus any edits you make by hand will be lost. If you wish to make a
# change to this file, please create a Github issue explaining the changes you
# need and we will usher them to the appropriate places.
module Recurly
module Resources... | 42.604651 | 529 | 0.698144 |
f785af26762532d77e458ad94a51fd7a07a8f779 | 2,409 | class AssignmentSearch
include ActiveModel::Model
extend ActiveModel::Translation
CLIENT_CODE = "wmsb".freeze
class_attribute :connection, instance_writer: false
self.connection = Faraday.new ENV['BPS_API'], ssl: {
ca_file: Rails.root.join('lib', 'certs', 'SVRIntlG3.crt').to_s
}
attr_reader :assign... | 24.09 | 98 | 0.664591 |
28e6f3ab085fbbf83b83c21ff557a668cd67caa6 | 9,235 | describe "data" do
include Rack::Test::Methods
let(:base_response) do
{
"path" => "/_data/data_file.yml",
"relative_path" => "data_file.yml",
"slug" => "data_file",
"ext" => ".yml",
"title" => "Data File",
"api_url" => "http://localh... | 31.735395 | 89 | 0.570763 |
393d6e5c4aacc95e462d95cfb18462e88f562ed3 | 201 | # frozen_string_literal: true
require "cask/artifact/moved"
module Cask
module Artifact
class Prefpane < Moved
def self.english_name
"Preference Pane"
end
end
end
end
| 14.357143 | 29 | 0.676617 |
ff7c1056968399ee7061b7bd414744c05a5b963d | 117 | class RenameUsersToShepherds < ActiveRecord::Migration[5.0]
def change
rename_table :users, :shepherds
end
end
| 19.5 | 59 | 0.777778 |
e8b526f48747005cb0fc87719e3fab9a8356fd77 | 3,230 | class Nut < Formula
desc "Network UPS Tools: Support for various power devices"
homepage "https://networkupstools.org/"
license "GPL-3.0"
revision 2
stable do
url "https://networkupstools.org/source/2.7/nut-2.7.4.tar.gz"
sha256 "980e82918c52d364605c0703a5dcf01f74ad2ef06e3d365949e43b7d406d25a7"
#... | 30.761905 | 90 | 0.54644 |
389467c1ef6973120b7a72167ac56b5b545e540a | 124 | class AddNameToRiskLevels < ActiveRecord::Migration[5.2]
def change
add_column :risk_levels, :name, :string
end
end
| 20.666667 | 56 | 0.75 |
8702dd4927a9d73fd8acc4da0bba54112c87c0d7 | 133 | class Changeorigintostringnottext < ActiveRecord::Migration[6.1]
def change
change_column :bottles, :origin, :string
end
end
| 22.166667 | 64 | 0.766917 |
5d9197ff97d67b74a652251213920ba91ff0092c | 9,924 | =begin
The PostFinance Checkout API allows an easy interaction with the PostFinance Checkout web service.
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
... | 33.986301 | 147 | 0.662838 |
289e4d3b75f027ba76958398da2c623d187a0149 | 2,693 | class SectionsController < ApplicationController
before_action :filter, only: :index
before_action :authenticate_user!
before_action :ensure_admin!, only: [:delete_term, :toggle_resolved_section]
# GET /sections
# GET /sections.json
def index
@updated_at = Section.maximum(:updated_at)
end
def sho... | 32.841463 | 228 | 0.666172 |
7a03796b98bf8163172a2f53b28de5b25499684f | 1,728 | require 'rails_helper'
RSpec.feature "UsersSignups", type: :feature do
before do
ActionMailer::Base.deliveries.clear
end
it "invalid signup information" do
visit signup_path
expect(page).to have_title full_title("Sign up")
expect(page).to have_selector "form[action='/signup']"
expect(page).t... | 32.603774 | 76 | 0.715278 |
6a257ec2de65c4b038e4412b5837399ae540fdcc | 1,525 | require 'feature_helper'
describe 'Home Page' do
let(:user) { FactoryGirl.create(:user) }
let(:email) { user.email }
let(:message) { "I'm sold. I want to enter all my profile data in MyUSA!" }
let(:display_message) { @home_page.contact_flash }
let(:message_area) { @home_page.contact_form.message }
before ... | 29.326923 | 77 | 0.704918 |
87adb34cc010fb5a919adc222b8ae9c9be142b1c | 1,627 | #
# Be sure to run `pod lib lint Logsene.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = "Logsene"
s... | 41.717949 | 218 | 0.654579 |
9183b5fc290aaacbe6c11190c0971f8ef418d4e5 | 1,922 | require 'bundler'
Bundler.require
require "sinatra"
require "./models.rb"
require 'pycall/import'
class MyApp < Sinatra::Base
get '/' do
erb :index
end
get '/chatBot' do
@num = 0
@history = ""
erb :chatBot
end
get '/survey' do
erb :survey
end
... | 32.576271 | 527 | 0.577523 |
9183ae9a3235cf218837a5ba50981895a1aab790 | 423 | require 'rails_helper'
RSpec.describe "request_categories/index", :type => :view do
before(:each) do
assign(:request_categories, [
RequestCategory.create!(
:service_category => nil
),
RequestCategory.create!(
:service_category => nil
)
])
end
it "renders a list of... | 21.15 | 60 | 0.628842 |
62946497f89814402673a7832b739112fca7391a | 6,983 | OpenDataCertificate::Application.routes.draw do
require 'sidekiq/web'
authenticate :user, lambda { |u| u.admin? } do
mount Sidekiq::Web => '/sidekiq'
end
scope '/:locale', constraints: {locale: Regexp.union(I18n.available_locales.map(&:to_s))} do
root :to => 'main#home'
# 'Static' pages managed by... | 40.836257 | 159 | 0.655019 |
ed557e828d672b5e881e6c7634c1e564959549c7 | 35 | module Zip
VERSION = '2.3.1'
end
| 8.75 | 19 | 0.628571 |
385282c93d2f0312fea3f5a8a61508c91b7bba9c | 65 | class D3Controller < ApplicationController
def index
end
end
| 13 | 42 | 0.8 |
e9ec5e05eb0a864633c9ba0469c25fa6ec0c547f | 886 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'svg_sparklines/version'
Gem::Specification.new do |spec|
spec.name = "svg_sparklines"
spec.version = SvgSparklines::VERSION
spec.authors = ["Starr Horne"]
spec.email ... | 35.44 | 74 | 0.654628 |
1ceb9ce2b1853ef7b337c77544a412a921a25b7e | 780 | # frozen_string_literal: true
require_relative '../base'
module Alchemy
module Generators
class PageLayoutsGenerator < Base
desc "This generator generates your page_layouts view partials."
source_root File.expand_path('templates', __dir__)
def create_partials
@page_layouts = load_alche... | 27.857143 | 132 | 0.692308 |
913ac6af8ef4eb0b3814feab99c9f2ea8ca1b02c | 490 | require 'test_helper'
class SiteLayoutTest < ActionDispatch::IntegrationTest
test "layout links" do
get root_path
assert_template 'static_pages/home'
assert_select "a[href=?]", root_path, count: 2
assert_select "a[href=?]", help_path
assert_select "a[href=?]", about_path
assert_select "a[hre... | 25.789474 | 54 | 0.710204 |
bf5aa81055b52f856cc7078ebfc9e6361d1de067 | 99,704 | require File.expand_path('../../../../../spec_helper', __FILE__)
module Pod
class Installer
class Xcode
class PodsProjectGenerator
describe PodTargetInstaller do # rubocop:disable Metrics/BlockLength
describe 'In General' do # rubocop:disable Metrics/BlockLength
before do
... | 57.732484 | 255 | 0.588211 |
26318d67b08a9e4a4e4cee4d3c9383f5b1e2272f | 8,498 | require "concurrent/atomics"
require "ldclient-rb/expiring_cache"
module LaunchDarkly
module Integrations
module Util
#
# CachingStoreWrapper is a partial implementation of the {LaunchDarkly::Interfaces::FeatureStore}
# pattern that delegates part of its behavior to another object, while provi... | 36.787879 | 123 | 0.608967 |
e8862b9ef7c61befddbc44211e754a5f0bc835e5 | 1,678 | require "log4r"
module VagrantPlugins
module OVirtProvider
module Action
# This action reads the SSH info for the machine and puts it into the
# `:machine_ssh_info` key in the environment.
class ReadSSHInfo
def initialize(app, env)
@app = app
@logger = Log4r::Logg... | 29.438596 | 81 | 0.559595 |
ff9b531c1ea87930b64d8694e741b7f94a626148 | 269 | class Employee < ActiveRecord::Base
belongs_to :manager, class_name: 'Employee'
has_many :directly_managed, class_name: 'Employee', foreign_key: :manager_id
has_ancestors :managers, key: :manager_id
has_descendants :managed, key: :manager_id
end
| 33.625 | 80 | 0.739777 |
1a95f0e6174780644df26f55fbbedf9b059c0085 | 304 | module AlchemyAPI
class TextCategorization < Base
Config.add_mode :text_categorization, self
def web_method
"#{method_prefix}GetCategory"
end
private
def supported_search_types
# TODO: fix html
[:text, :url]
end
def indexer
nil
end
end
end
| 14.47619 | 46 | 0.641447 |
218e6f7ff4477ddbc0f9e69b42d2467940869f6c | 66 | class Telephony::Error::AgentOnACall < Telephony::Error::Base
end
| 22 | 61 | 0.787879 |
338f71c482dab364288d18254aa187b7aa655b5b | 1,197 | class Proteinortho < Formula
desc "Detecting orthologous genes within different species"
homepage "https://gitlab.com/paulklemm_PHD/proteinortho"
url "https://gitlab.com/paulklemm_PHD/proteinortho/-/archive/v6.0.28/proteinortho-v6.0.28.tar.gz"
sha256 "e4489734646e389fbb7bffc6f6e511507093e7ea023253dc9f24d95cd0f0... | 37.40625 | 121 | 0.784461 |
33bf2ea3f14fa29dd0f1a168131b977f54e87b4c | 1,078 | # typed: false
# frozen_string_literal: true
require File.expand_path("../Abstract/abstract-php-extension", __dir__)
# Class for Imagick Extension
class ImagickAT73 < AbstractPhpExtension
init
desc "Imagick PHP extension"
homepage "https://github.com/Imagick/imagick/releases"
url "https://github.com/Imagick/i... | 31.705882 | 98 | 0.782931 |
ff40bef3ef5230efb631c37c75862fbf133d92db | 2,634 | require_relative '../fixtures/classes'
describe :hash_store, shared: true do
it "associates the key with the value and return the value" do
h = { a: 1 }
h.send(@method, :b, 2).should == 2
h.should == { b:2, a:1 }
end
it "duplicates string keys using dup semantics" do
# dup doesn't copy singleton... | 26.606061 | 95 | 0.595292 |
e22ea8aaf51b5eee83e879f68ef01b07f79bd65e | 1,115 | RSpec.describe 'none pattern' do
it 'none are broken' do
things = ["functional", "working", "works", "fixed", "good"]
none_broken = true
things.each do |thing|
none_broken = false if thing == "broken"
end
expect(none_broken).to eq(true)
end
xit 'double negative' do
numbers = [9, 3,... | 24.23913 | 79 | 0.61435 |
e9790595d3cfb534a1692a9bfa9f71af8d7ec048 | 19,887 | require_relative './fast_excel/binding'
require 'set'
# not used for now
#require_relative '../ext/fast_excel/text_width_ext'
module FastExcel
class Formula
attr_accessor :fml
def initialize(fml)
@fml = fml
end
end
class URL
attr_accessor :url
def initialize(url)
@url = url
... | 27.582524 | 148 | 0.647911 |
6242c80b1b65a6ac3c182b3db349ab2f76ebab1f | 74 | class Spree::TaxableZipcode < ApplicationRecord
belongs_to :tax_rate
end | 24.666667 | 47 | 0.837838 |
4a33819cbbf94273f5aadc864eaa4f8a91d7dfcb | 420 | RSpec.describe SolidusSubscriptions::ProcessInstallmentJob do
it 'processes checkout for the installment' do
installment = build_stubbed(:installment)
checkout = instance_spy(SolidusSubscriptions::Checkout)
allow(SolidusSubscriptions::Checkout).to receive(:new).with(installment).and_return(checkout)
... | 35 | 97 | 0.795238 |
1c42a1509eb2c1dca2d31cbcbecc4ce7e6f1a5ea | 2,361 | class AlmCombinedStatsReport
include Reportable::ToCsv
def initialize(alm_report: nil, pmc_report: nil, counter_report: nil, mendeley_report: nil)
@alm_report = alm_report
@pmc_report = pmc_report
@counter_report = counter_report
@mendeley_report = mendeley_report
end
def headers
@alm_repo... | 27.453488 | 93 | 0.695044 |
e99f7b7a032b5867d74c1b7ccd42bd17a089fd55 | 688 | helpers do
def current_user
if session[:user_id]
@current_user ||= User.find_by_id(session[:user_id])
end
end
def logged_in?
!current_user.nil?
end
def logged_in_redirect(login_route, redirect_url)
if logged_in? then
case
when login_route.class == String
redirect ... | 19.657143 | 58 | 0.630814 |
2698d776c5a71c9dcfdc62e9aa0ccfba4a8f20a0 | 65 | module Fastlane
module Cordova
VERSION = "3.2.0"
end
end
| 10.833333 | 21 | 0.661538 |
e2b160f8b07ef61085df46d578cc6d6aa89667b6 | 459 | require 'csv'
desc "Import the known column mappings for the CES and OES imports"
task :import => [:environment] do
file = "lib/data/bls_column_mappers.csv"
puts "Importing BLS Column Data"
CSV.foreach(file, :headers => true, :col_sep => "\t" ) do |row|
BlsColumnMapper.first_or_create(
web_column_nam... | 27 | 67 | 0.671024 |
9121d873cb018c9301a9f7e12b38f9860540c1f9 | 238 | Rails.application.routes.draw do
mount Alchemy::Custom::Model::Engine => '/alchemy-custom-model'
mount Alchemy::Engine => '/'
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
| 29.75 | 102 | 0.739496 |
f7456fb78273c3c23bd4155a065c63e5e0518578 | 335 | class MtWorkerPaymentWorker
include Sidekiq::Worker
def perform(mt_assignment_id, mt_worker_id, reward)
return true
RTurk::GrantBonus.create({
assignment_id: mt_assignment_id,
amount: reward,
feedback: "You have been rewarded with #{reward} for you work!",
worker_id: mt_worker_id
... | 23.928571 | 70 | 0.704478 |
1ce2252881abfad3fe82ac905c77bd66d148dca1 | 47 | module ActiveMerchant
VERSION = "1.36.0"
end
| 11.75 | 21 | 0.723404 |
91b496cf34872fc4b0821724edf0bb0f08207aa7 | 385 | class String
def escape
"\"#{self.to_s}\""
end
def join(elements = [])
File.join(self,elements)
end
def to_absolute()
File.expand_path(self)
end
def remove_template_name
self.gsub(File.extname(self),'')
end
def name_without_template_extension
return remove_template_name
end
def ba... | 14.807692 | 37 | 0.698701 |
910d869c8e330a46eb7771cde30182b1623563fc | 7,309 | =begin
#Tatum API
## Authentication <!-- ReDoc-Inject: <security-definitions> -->
OpenAPI spec version: 3.9.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 3.0.31
=end
require 'date'
module Tatum
class Error403SubscriptionInterval
# subscription.attr.interval.inva... | 30.078189 | 213 | 0.622931 |
87098f9eea0b6b73d344eb5f034a423522d99b2d | 944 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "entasis/version"
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'entasis'
s.summary = %q{A few neat methods for a basic class}
s.description = %q{Entasi... | 42.909091 | 134 | 0.564619 |
b95a63384565fd4a1b93da535a891ba0b0593856 | 1,084 | class Xidel < Formula
desc "XPath/XQuery 3.0, JSONiq interpreter to extract data from HTML/XML/JSON"
homepage "https://www.videlibri.de/xidel.html"
url "https://github.com/benibela/xidel/releases/download/Xidel_0.9.8/xidel-0.9.8.src.tar.gz"
sha256 "72b5b1a2fc44a0a61831e268c45bc6a6c28e3533b5445151bfbdeaf1562af39... | 33.875 | 120 | 0.750923 |
38761ca92bcee85d4b8683eb2afee81ce5c7c69a | 7,899 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.20.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.1.0
=end
require 'date'
require 'time'
module Plaid
# An optional object to filter `... | 33.901288 | 677 | 0.649449 |
21e38a30ef255a68620edfcd5ddb11916436469c | 12,803 | require_relative '../fdw'
module Carto
class Connector
# Base class for ODBC-based providers using odbc_fdw
#
# Requirements:
# * odbc_fdw extension must be installed in the user database
#
# Parameters: except for connection, these parameters correspond to options of odbc_fdw which are no... | 39.76087 | 167 | 0.68398 |
18c2ec4f35c81c2be0560fddba504deba695becf | 2,941 | # -*- coding: binary -*-
require 'rex/text'
require 'rex/arch'
require 'msf/core/framework'
module Rex
module Exploitation
###
#
# This class provides the ability to create a sequence of commands from an executable.
# When this sequence is ran via command injection or a shell, the resulting exe will
# b... | 23.15748 | 87 | 0.620537 |
286627f3dcf87bff5403bbbe6a835c60a8ce740c | 236 | require "test_helper"
class SemanticUiViewsGeneratorTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::SemanticUiViewsGenerator::VERSION
end
def test_it_does_something_useful
assert false
end
end
| 19.666667 | 51 | 0.813559 |
62ac4041b58f1736627f9cfe09d5e8c3a8288def | 1,296 | class Skymaker < Formula
desc "Generates fake astronomical images"
homepage "https://www.astromatic.net/software/skymaker"
url "https://www.astromatic.net/download/skymaker/skymaker-3.10.5.tar.gz"
sha256 "a16f9c2bd653763b5e1629e538d49f63882c46291b479b4a4997de84d8e9fb0f"
bottle do
cellar :any
sha256 "... | 38.117647 | 95 | 0.729938 |
91dffa0d3b7195b5da09f5f8a71dce77f51dabb2 | 1,047 | class RemoveBraintreeAccounts < ActiveRecord::Migration[4.2]
def up
drop_table "braintree_accounts"
end
def down
create_table "braintree_accounts", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "first_... | 38.777778 | 61 | 0.552053 |
1c4ac3f38f018299e292afe5b1429ccc8b8d5ceb | 871 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'draghunt/version'
Gem::Specification.new do |spec|
spec.name = 'draghunt'
spec.version = Draghunt::VERSION
spec.authors = ['jarra']
spec.email = ['suhrawardi@... | 36.291667 | 74 | 0.653272 |
3348127390de94458024caf7ea8cb55072480f46 | 272 | class CreateBarbers < ActiveRecord::Migration
def change
create_table :barbers do |t|
t.text :name
t.timestamps
end
Barber.create :name =>'Jessy Pinkman'
Barber.create :name =>'Walter White'
Barber.create :name =>'Gus Fring'
end
end
| 19.428571 | 45 | 0.654412 |
1861f4b908171b665e917217965457c4daaa5e11 | 96 |
class CryptogramBlueprint < Blueprinter::Base
identifier :identifier
fields :cryptogram
end | 19.2 | 45 | 0.8125 |
380cc626b76a6883cd6f4ad9f76090c94f62ff8f | 3,509 | require 'spec_helper'
describe 'ExperimentLight' do
describe 'Experiment' do
it 'on? works fine' do
allow(Rails).to receive(:env).and_return('development')
expect(ExperimentLight::Experiment.on?(:foo)).to be_truthy
expect(ExperimentLight::Experiment.on?(:bar)).to be_truthy
allow(Rails).... | 38.56044 | 126 | 0.703334 |
6a18620d5324655395eee2c8d43ceed0f2d99257 | 342 | class CreateDocuments < ActiveRecord::Migration[4.2]
def self.up
create_table :documents do |t|
t.string :name
t.string :data_file_name
t.string :data_content_type
t.integer :data_file_size
t.references :equipment_model
t.timestamps
end
end
def self.down
drop_table... | 20.117647 | 52 | 0.681287 |
6213815305f4eb135d5052395e460c44b3886757 | 1,858 | RSpec.describe Pry::ExceptionHandler do
describe ".handle_exception" do
let(:output) { StringIO.new }
let(:pry_instance) { Pry.new }
context "when exception is a UserError and a SyntaxError" do
let(:exception) do
SyntaxError.new('cool syntax error, dude').extend(Pry::UserError)
end
... | 28.584615 | 73 | 0.612487 |
1142bcc981b200b94bdc87fe3a1619947f5caa50 | 869 | # frozen_string_literal: true
require 'spec_helper'
require 'vk/api/stats/period'
RSpec.describe Vk::API::Stats::Period do
subject(:model) { described_class }
it { is_expected.to be < Dry::Struct }
it { is_expected.to be < Vk::Schema::Object }
describe 'attributes' do
subject(:attributes) { model.instance... | 32.185185 | 58 | 0.69275 |
616a83cfcf1f6a49fe38bc981bbfc0ee6bebcb07 | 7,632 | #
# Author:: Serdar Sutay (<serdar@opscode.com>)
# Copyright:: Copyright (c) 2013 Opscode, 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 with the License.
# You may obtain a copy of the License at
#
# ... | 34.378378 | 119 | 0.619628 |
08ef36e653b4bf47573e9f699184969d7cbd5421 | 447 | #http://stackoverflow.com/questions/7157207/how-can-i-read-a-file-with-ruby
contents = File.read(ARGV[0])
#http://stackoverflow.com/questions/17348539/how-to-strip-commas-from-float-input
contents = contents.gsub(',','').gsub('.','')
#http://stackoverflow.com/questions/13537920/ruby-split-by-whitespace
contents = con... | 26.294118 | 81 | 0.740492 |
1dd108a3a00ff0a0ebb32c9cb998132746f8acad | 22,569 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe AjaxDatatablesRails::ORM::ActiveRecord do
let(:datatable) { ComplexDatatable.new(sample_params) }
let(:records) { User.all }
describe '#filter_records' do
it 'requires a records collection as argument' do
expect { datatable.filter_re... | 35.264063 | 140 | 0.60109 |
919581233a17cc9a3702d4b4c38e496303173bf6 | 1,561 | # All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
require "bundler"
Bundler.require(:default, :development)
# Uncomment this if you want to make real requests to GCE (you _will_ be billed!)
# WebMock.disable!
def test
... | 36.302326 | 81 | 0.639334 |
bffb02b694a03df06aadc97099214aa52d5735c9 | 2,898 | # frozen_string_literal: true
RSpec.describe Rustic::Hooks do
let(:hooks) { described_class.new(config) }
let(:config) { instance_double(Rustic::Config, before: before_hook, after: after_hook) }
let(:before_hook) { instance_double(Proc, call: true) }
let(:after_hook) { instance_double(Proc, call: true) }
de... | 29.876289 | 90 | 0.662181 |
ff358c3b875542b286d32dcfb302dd598d600674 | 1,075 | class Hyrax::ArkivoApiGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
desc """
This generator sets up Zotero/Arkivo API integration for your application:
"""
def banner
say_status("info", "ADDING ZOTERO/ARKIVO API INTEGRATION", :blue)
end
# Turn on the ... | 32.575758 | 88 | 0.705116 |
38f61346d099ed647d15849283031d5194c0082f | 94 | require 'bundler/setup'
Bundler.setup
require 'yhsd_app'
RSpec.configure do |config|
end | 10.444444 | 27 | 0.755319 |
28667ffe47c3ce9be50f4ee7878fd9a3b1b1fc0d | 1,318 | # Copyright (c) 2018 Public Library of Science
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, pub... | 43.933333 | 76 | 0.765554 |
f857ab014e62437b1dca917213c823de29fc498d | 28,558 | # frozen_string_literal: true
RSpec.describe RuboCop::Cop::Style::FrozenStringLiteralComment, :config do
context 'always' do
let(:cop_config) { { 'Enabled' => true, 'EnforcedStyle' => 'always' } }
it 'accepts an empty source' do
expect_no_offenses('')
end
it 'accepts a source with no tokens' ... | 26.840226 | 98 | 0.58432 |
083585d4feddc47e2c873371e0155878aa53eaf8 | 1,608 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Integrations::Redmine do
describe 'Associations' do
it { is_expected.to belong_to :project }
it { is_expected.to have_one :service_hook }
end
describe 'Validations' do
# if redmine is set in setting the urls are set to defaults
... | 29.777778 | 82 | 0.698383 |
e25dad31867636e9f8304fc0681984c30200cb29 | 1,134 | # snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]
# snippet-sourceauthor:[Doug-AWS]
# snippet-sourcedescription:[Lists your SNS topic ARNs.]
# snippet-keyword:[Amazon Simple Notification Service]
# snippet-keyword:[Resource.topics method]
# snippet-keyword:[Ruby]
# snippet-s... | 37.8 | 89 | 0.731041 |
e2694abb8cd1f046f44d5ed43f744eb5ccd505ed | 2,989 | # frozen_string_literal: true
require_relative '../../test_helper'
SingleCov.covered!
describe Kubernetes::RoleConfigFile do
let(:content) { read_kubernetes_sample_file('kubernetes_deployment.yml') }
let(:config_file) { Kubernetes::RoleConfigFile.new(content, 'some-file.yml', project: projects(:test)) }
let(:co... | 32.846154 | 119 | 0.692874 |
91da3f4700beda0afc991b38a5c626f46f01fb5d | 953 | cask 'controllermate' do
version '4.9.8'
sha256 'ab0e8bf540c04f691d71e39e6fd03350d96112780ee610f3d68fb284bad16765'
# amazonaws.com is the official download host per the vendor homepage
url "https://s3.amazonaws.com/orderedbytes/ControllerMate#{version.delete('.')}.zip"
name 'ControllerMate'
appcast 'http:/... | 41.434783 | 87 | 0.668416 |
e203bf87607a81ce95610e486b7fc98bcf86f153 | 137 | class Featattr < Physattr
field :value, type: Integer
validates :value, numericality: { only_integer: true }
embedded_in :feat
end
| 22.833333 | 56 | 0.744526 |
28063c9e08a75eed303a3a3e8c82690bade2ebc4 | 8,262 | s = Runners::Testing::Smoke
default_version = "3.6.2"
s.add_test(
"phpcs3/success",
type: "success",
issues: [
{
path: "app.php",
location: { start_line: 6, start_column: 1 },
id: "PSR2.Files.ClosingTag.NotAllowed",
message: "A closing tag is not permitted at the end of a PHP file",
... | 35.008475 | 285 | 0.631929 |
e84713e0ff50d27acea790563ec06aa0aebe1f68 | 1,937 | #
# Author:: Adam Jacob (<adam@opscode.com>)
# Copyright:: Copyright (c) 2008 Opscode, 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 with the License.
# You may obtain a copy of the License at
#
# ht... | 33.982456 | 80 | 0.637584 |
115dcb7747070449fa320e6dfe612038947ddf16 | 908 | require 'liquid'
module Gemtap
#
# A Liquid Drop class which represents a model's property
#
# @author [ryanbaldwin]
#
class Property < Liquid::Drop
#
# The name (symbol) of this property
attr_reader :name
#
# The type (Int, String, Bool?, etc) for this property
attr_reader :type
... | 22.7 | 72 | 0.635463 |
6af7902e0c4db8bb7f2f64cd29e697ef08b35848 | 449 | # frozen_string_literal: true
class MigrateProjectMigrateSidekiqQueue < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
DOWNTIME = false
def up
sidekiq_queue_migrate 'project_migrate_hashed_storage', to: 'hashed_storage:hashed_storage_project_migrate'
end
de... | 24.944444 | 111 | 0.81069 |
ab168124d07098cecf4adf29f7ee5881d0639f92 | 411 | ENV["RAILS_ENV"] = "test"
require 'byebug'
require 'dummy/config/environment'
require 'rspec/rails'
require 'curlybars/safe_buffer'
require 'curlybars/lexer'
require 'curlybars/parser'
require 'curlybars/position'
require 'curlybars/error/base'
require 'curlybars/error/lex'
require 'curlybars/error/parse'
require 'cu... | 24.176471 | 34 | 0.798054 |
1d47d77728af364e71c11a091d2b2482404d8295 | 975 | Pod::Spec.new do |s|
s.name = 'DynamicColor'
s.version = '4.1.0'
s.license = 'MIT'
s.summary = 'Yet another extension to manipulate colors easily in Swift (UIColor and NSColor)'
s.homepage = 'https://github.com/yannickl/DynamicColor.git'
s.social_media_url = 'h... | 39 | 105 | 0.627692 |
083cb57131589d5afc2dbc8401119946ce232068 | 127 | class RemovePublishedToCategory < ActiveRecord::Migration
def change
remove_column :faq_categories, :published
end
end
| 21.166667 | 57 | 0.80315 |
879ded8ac974b40d5f47126eeb370bf2a437c132 | 203 | class CreateComments < ActiveRecord::Migration[5.2]
def change
create_table :comments do |t|
t.text :body
t.references :article, foreign_key: true
t.timestamps
end
end
end
| 18.454545 | 51 | 0.669951 |
5de6fe50eb5d4b93cdd28318368b8ba6af95dd43 | 14,901 | # frozen_string_literal: true
class ReservationsController < ApplicationController
customer_tab :all
before_action :authenticate_user!, except: [:index]
before_action :check_acting_as, only: [:switch_instrument, :list]
before_action :load_basic_resources, only: [:new, :create, :edit, :update]
before_action... | 35.22695 | 154 | 0.707805 |
d5c318351bfcc0565c115a1df0bcd78b053bbeb2 | 17,628 | #
# Author:: Adam Jacob (<adam@opscode.com>)
# Author:: Christopher Brown (<cb@opscode.com>)
# Copyright:: Copyright (c) 2009 Opscode, 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 with the License.
# You... | 33.135338 | 157 | 0.651237 |
9143dee53a21a6cf2fd139816a845fb8ee832eda | 5,801 | require 'test_helper'
class PropertyTest < ActiveSupport::TestCase
def setup
@user = users(:aman)
@property = @user.properties.build(owner_name: "ajay sharma",
property_type: "apartment",
property_status: "sell",
... | 26.981395 | 76 | 0.631443 |
283fc6cdbcbb6328e2a24529b2d99706adff3d31 | 3,978 | # frozen_string_literal: true
require 'forwardable'
require 'capybara/dsl'
require 'active_support/core_ext/array/extract_options'
module QA
module Resource
class Base
extend SingleForwardable
include ApiFabricator
extend Capybara::DSL
NoValueError = Class.new(RuntimeError)
def_d... | 27.246575 | 178 | 0.616893 |
4a11b54fdcd21344f4fa6d15063f5cc847740d3e | 2,349 | require "spec_helper"
require "tempfile"
RSpec::Matchers.define :have_correct_line_coverage do |filename, lines, lineno, strict: false|
match do
@our = DeepCover::Tools.our_coverage(lines.join, filename, lineno, allow_partial: !strict)
answers = DeepCover::Specs::parse_cov_comments_answers(lines)
error... | 34.544118 | 97 | 0.681567 |
5de9ee8700e535a99ffb00cc81b048030f54a8da | 493 | require 'open3'
When(/^I run suitor with "(.*)"$/) do |argument_string|
Dir.chdir("../cli") do
# clean bundler's environment so we can safley nest the bundle exec call
Bundler.with_clean_env do
@output, @status = Open3.capture2e("bundle exec ./bin/suitor #{argument_string}")
end
end
end
Then(/^t... | 25.947368 | 87 | 0.665314 |
013bde3ab1dd1f535d4c0acd883b14bd1cb750f8 | 593 | class CGPoint
def to_opengl_coordinates
Joybox.director.convertToGL(self)
end
def from_opengl_coordinates
Joybox.director.convertToUI(self)
end
def to_pixel_coordinates
CGPointMake(self.x.to_pixels, self.y.to_pixels)
end
def from_pixel_coordinates
CGPointMake(self.x.from_pixels,... | 13.477273 | 60 | 0.688027 |
abf118d264b209f930705363d7433e3b6cebe11b | 155 | class AddDiscoveredToApiDocsServices < ActiveRecord::Migration
def change
add_column :api_docs_services, :discovered, :boolean, null: true
end
end
| 25.833333 | 68 | 0.793548 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.