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 |
|---|---|---|---|---|---|
33f59e8d3e46e7fb9b183522440918b1bb3f0c15 | 819 | # frozen_string_literal: true
class InvoiceExporter
HEADERS = [
'Kdnr', 'Name1', 'Name2', 'Strasse', 'Plz', 'Ort',
'RG-Nummer', 'Inkl. MWST', 'exkl. MWST', 'ESR-Ref.Nr.'
].freeze
def initialize(invoices = Invoice.all)
@invoices = invoices
end
def export(options = {})
CSV.generate(**csv_opti... | 22.135135 | 91 | 0.632479 |
791768014a38c510b75c79efab8ad3930a33be84 | 417 | require 'spec_helper'
describe Inquiry::Node::Base, type: :model, dbscope: :example do
let(:item) { create :inquiry_node_base }
it_behaves_like "cms_node#spec"
end
describe Inquiry::Node::Form, type: :model, dbscope: :example do
let(:item) { create :inquiry_node_form }
it_behaves_like "cms_node#spec"
it do... | 24.529412 | 64 | 0.736211 |
33e00dc3445699b5e9ce4f98a070c9f185c2be42 | 2,140 | # frozen_string_literal: true
module SamsonSlackWebhooks
class SlackWebhooksService
# users in the format jquery mentions input needs
# see _notify_buddy_box.html.erb
def users
unless slack_api_token
Rails.logger.error('Set the SLACK_API_TOKEN env variable to enabled user mention autocomplet... | 33.4375 | 117 | 0.600935 |
f83298d024c2af185d226cd06eb29b42d415ca60 | 5,364 | # frozen_string_literal: true
module Results
module CSV
# Temporarily holds the next row of the CSV output while it is being populated.
# Responsible for preparing the row to receive new answer data by copying common data
# (response data and parent group data) from the previous row of the CSV output.
... | 38.589928 | 108 | 0.656972 |
2889cb26ce60087343b3da59f2b2ada6881907c6 | 2,793 | ##
# $Id$
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
class Metasploit3 < Msf::Expl... | 27.93 | 93 | 0.620122 |
91b070ad17c4f229a9e33056afef4dd24f500fd9 | 1,080 | class Team < ApplicationRecord
has_many :primaries
has_many :users, through: :primaries
has_many :shares
has_many :users, through: :shares
has_many :users, through: :alternates
has_many :alternates
has_many :users, through: :trainees
has_many :trainees
has_many :rosters
def get_lead
if self.lea... | 18.947368 | 60 | 0.631481 |
1a3cb0101998101bc7163b9dfc8ac5aba80ddf88 | 10,622 | #
# Author: James M. Lawrence <quixoticsycophant@gmail.com>.
#
require 'net/ftp'
require 'rbconfig'
require 'ostruct'
require 'fileutils'
require 'optparse'
require 'pathname'
class Installer
include FileUtils
CONFIG = Config::CONFIG
BIT64 = (1.size == 8)
RB_BASENAME = Pathname.new "P4.rb"
SO_BASENAME = P... | 22.129167 | 74 | 0.573715 |
ffae24f261c2a4085e94c3d0f0dabd43b76e62fc | 1,221 | module DL
module Win32Types
def included(m)
m.module_eval{
typealias "DWORD", "unsigned long"
typealias "PDWORD", "unsigned long *"
typealias "WORD", "unsigned short"
typealias "PWORD", "unsigned short *"
typealias "BOOL", "int"
typealias "ATOM", "int... | 29.780488 | 46 | 0.568387 |
f8d80d9383d351595078cc55e0ac758d1ec29d9e | 1,894 | require 'rails_helper'
RSpec.describe 'Sign Up' do
let(:user) { User.create(Username: 'Foo Bar', Email: 'foo@bar.com', Password: '12345678') }
scenario 'Sign up ' do
visit new_user_registration_path
fill_in 'Username', with: 'Foo Bar'
fill_in 'Email', with: 'foo@bar.com'
fill_in 'Password', with: ... | 28.268657 | 93 | 0.671595 |
87bed5c4f141090f2dae67a2f7febbb13e6832cf | 1,161 | # Copyright 2017 OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 34.147059 | 78 | 0.78553 |
034253507fa3321528d587bd0ce58cd16c1de195 | 136 | module Api
module Private
class TopProfileImageSerializer < ActiveModel::Serializer
attributes :image_url
end
end
end
| 17 | 61 | 0.742647 |
28e109b5f9bb35c78cd5d250b1d6e41d535e20c4 | 157 | require "iso3166_ru/version"
require "iso3166_ru/country_list"
module Iso3166Ru
def self.find_by(query)
CountryList.instance.find_by(query)
end
end
| 17.444444 | 39 | 0.789809 |
391d6c0c5ab7bd50dc9cc7f2bc20ea9c20ebe6f3 | 107 | # frozen_string_literal: true
module TTY
class Spinner
VERSION = "10.0.0"
end # Spinner
end # TTY
| 13.375 | 29 | 0.682243 |
264d323544300e5cf490a30877b22433b7a4669c | 34,785 | #
# Autogenerated by Thrift Compiler (0.9.3)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
require 'BoxalinoPackage/thrift'
module DateRangeGap
SECOND = 1
MINUTE = 2
HOUR = 3
DAY = 4
WEEK = 5
MONTH = 6
YEAR = 7
DECADE = 8
CENTURY = 9
VALUE_MAP = {1 => "SECOND", 2 => "MINUT... | 31.479638 | 208 | 0.654707 |
ac681b2b41f3c7114178b51b74b15d41b9ac891e | 545 | module WordsGenerator
module Api
class Words < Grape::API
format :json
namespace :words do
get '/' do
words = Words.generate_words
{words: words.sample(1 + rand(words.length)).join(' ')}
end
end
private
def self.generate_words
[
... | 19.464286 | 65 | 0.537615 |
33ff29a2ce2ed6ad2b98df96a9468a8fa8338691 | 832 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... | 41.6 | 111 | 0.727163 |
acec66544907bc94fbc60acfddfa3d8082d75b34 | 911 | # frozen_string_literal: true
module GraphQL
module Language
# Emitted by the lexer and passed to the parser.
# Contains type, value and position data.
class Token
if !String.method_defined?(:-@)
using GraphQL::StringDedupBackport
end
# @return [Symbol] The kind of token this is... | 23.358974 | 57 | 0.586169 |
269ba588d9809081ec3598beb60b77bd131e1740 | 4,882 | # This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require it in any
# file... | 49.313131 | 92 | 0.742933 |
6262b89470f63324d0845fed877db3af72e1ff3f | 532 | # Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'
# Get your Account SID and Auth Token from twilio.com/console
# To set up environmental variables, see http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account... | 38 | 73 | 0.680451 |
33471eaaa2514eeaa211f88d41d9cb6a51af4615 | 2,203 | require 'rantly'
require 'rantly/rspec_extensions'
require 'rantly/shrinks'
require 'English'
PROGRAM = './circular_buffer'.freeze
FILE = 'circular_buffer.txt'.freeze
class Operation < Array
def operation
self[0]
end
def parameter
self[1]
end
def to_s
case self[0]
when :get
'get()'
... | 22.479592 | 91 | 0.533364 |
188f0e623046ca983a73f17d2b35b31c2226cc68 | 1,093 | class Api::V1::Accounts::CustomFiltersController < Api::V1::Accounts::BaseController
before_action :fetch_custom_filters, except: [:create]
before_action :fetch_custom_filter, only: [:show, :update, :destroy]
DEFAULT_FILTER_TYPE = 'conversation'.freeze
def index; end
def show; end
def create
@custom_... | 21.86 | 84 | 0.717292 |
ff3d2c6ca3117a6519dd627e141ed0ad437a001c | 1,324 | module Asposeocrjava
module ReadPartInformationOfText
def initialize()
data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
# Initialize an instance of OcrEngine
ocr_engine = Rjb::import('com.aspose.ocr.OcrEngine').new
# Set the I... | 37.828571 | 101 | 0.573263 |
2885fba68b362c41801b4fc4eb9b2150e7c73d46 | 88 | def fib(n)
if n <= 1
n
else
fib(n - 1) + fib(n - 2)
end
end
fib(33) | 11 | 28 | 0.420455 |
1c33f5cc5bbbee81341638c884fbe16bb5009aab | 4,267 | require 'spec_helper'
describe "Properties", type: :feature, js: true do
stub_authorization!
before(:each) do
visit spree.admin_products_path
end
context "Property index" do
before do
create(:property, name: 'shirt size', presentation: 'size')
create(:property, name: 'shirt fit', presenta... | 30.049296 | 97 | 0.682681 |
215cd121c2234c6d17e9aea6374f93907fb1437e | 1,019 | # This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort('The Rails environment is running in production mode!') if Rails.env.production?
requ... | 30.878788 | 86 | 0.782139 |
3902ce8f5e336f000f7890cbf631d65ea7b738b8 | 989 | # Write a method that takes a string in and returns true if the letter
# "z" appears within three letters **after** an "a". You may assume
# that the string contains only lowercase letters.
#
# Difficulty: medium.
def nearby_az(string)
for i in string.split('')
if i == "a" && string[i.to_i..3].include?('z')
... | 34.103448 | 70 | 0.616785 |
acd8eee2ea747c6fa6e44434390583dcafe0c53d | 3,760 | module SimpleNavigation
module Renderer
describe Breadcrumbs do
let!(:navigation) { setup_navigation('nav_id', 'nav_class') }
let(:item) { nil }
let(:options) {{ level: :all }}
let(:output) { HTML::Document.new(raw_output).root }
let(:raw_output) { renderer.render(navigation) }
... | 31.596639 | 77 | 0.551596 |
03bfcec3cd7bceb772836c8a4fcd38af414a5d73 | 1,850 | require 'spec_helper'
module ChefSpec::Error
describe CommandNotStubbed do
let(:instance) { described_class.new(args: ['cat']) }
it 'raises an exception with the correct message' do
instance
expect { raise instance }.to raise_error { |error|
expect(error).to be_a(described_class)
... | 31.896552 | 88 | 0.630811 |
f72f02337cc788c49d971913a9221dfc10ee4e16 | 26,748 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... | 18 | 111 | 0.662031 |
b9bc4409aa0854a4342e5b51385e33067855fee0 | 457 | module Xxx
class Youporn
HOST = "youporn.com"
URI = "http://#{HOST}"
BROWSE_TIME_PATH = "/browse/time"
ENTER_WEBSITE = lambda { |page| page.forms.first.click_button }
def agent
@agent ||= Mechanize.new
end
def latest
agent.get(uri(BROWSE_TIME_PATH), &ENTER_WEBSITE)
path... | 19.869565 | 67 | 0.601751 |
ff1c48fd7c3425b6df241a178aa2daf181a78823 | 659 | # Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to diction... | 50.692308 | 174 | 0.814871 |
1d495f9ed747e859bf1cbf5a1eb7afbdd4b3d095 | 1,439 | # require 'rails_helper'
# describe "On the login page" do
# describe "a user that is not logged in" do
# it "should be able to sign up or log in as a student or teacher" do
# visit '/'
# expect(page).to have_link('', href:"/auth/teacher_login")
# expect(page).to have_link('', href:"/auth/teac... | 32.704545 | 74 | 0.591383 |
bf1423ffe50fc177b72f73a650311fd3269aa74d | 1,870 | require "rails_helper"
RSpec.describe "Session API", type: :request do
describe "GET /auth/logged_in" do
context "when user is not logged in" do
before { get "/api/v1/auth/logged_in" }
it "returns logged_in false" do
expect(json["payload"]["logged_in"]).to eq(false)
end
it "retu... | 25.27027 | 77 | 0.613904 |
ff0d80e6abdbf82e135b51822a40cf3078374fcc | 121 | json.array! @suggested_alternatives, partial: "suggested_alternatives/suggested_alternative", as: :suggested_alternative
| 60.5 | 120 | 0.859504 |
abe95f5c44d432d67a04f910c8ec0e63ea2c8f87 | 1,316 | # frozen_string_literal: true
class SnippetBlobPresenter < BlobPresenter
include GitlabRoutingHelper
def rich_data
return unless blob.rich_viewer
render_rich_partial
end
def plain_data
return if blob.binary?
highlight(plain: false)
end
def raw_path
snippet_blob_raw_route(only_path:... | 21.933333 | 117 | 0.724924 |
ab0a23727bc89b82e973f3aa351d805c88ebd44d | 831 | class Ddate < Formula
desc "Converts boring normal dates to fun Discordian Date"
homepage "https://github.com/bo0ts/ddate"
url "https://github.com/bo0ts/ddate/archive/v0.2.2.tar.gz"
sha256 "d53c3f0af845045f39d6d633d295fd4efbe2a792fd0d04d25d44725d11c678ad"
bottle do
cellar :any
sha256 "8b7017ecb63545d... | 33.24 | 95 | 0.758123 |
877bf8e43af83d7164aff87751d345b2ac954ba7 | 2,367 | require 'spec_helper'
RSpec.describe 'Coinfield integration specs' do
let(:client) { Cryptoexchange::Client.new }
let(:btc_cad_pair) { Cryptoexchange::Models::MarketPair.new(base: 'BTC', target: 'CAD', market: 'coinfield') }
it 'fetch pairs' do
pairs = client.pairs('coinfield')
expect(pairs).not_to be_e... | 34.304348 | 112 | 0.724968 |
d5688a3fb75861d657c970553a203c4a91027fb2 | 2,760 | ##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRankin... | 23.793103 | 105 | 0.613768 |
6a9df0e5099f178a01249027128709606c99697f | 2,246 | # frozen_string_literal: true
require 'spec_helper'
describe Bitbucket::Representation::PullRequest do
describe '#iid' do
it { expect(described_class.new('id' => 1).iid).to eq(1) }
end
describe '#author' do
it { expect(described_class.new({ 'author' => { 'nickname' => 'Ben' } }).author).to eq('Ben') }
... | 44.039216 | 147 | 0.685663 |
ff9ee2907c6312aac30e15438272aa5235fdb093 | 1,524 | # -*- encoding: utf-8 -*-
# stub: jekyll-sass-converter 1.5.2 ruby lib
Gem::Specification.new do |s|
s.name = "jekyll-sass-converter".freeze
s.version = "1.5.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.a... | 38.1 | 112 | 0.667323 |
877f0787e1a21d506921e2f8bda91f2b8813298f | 228 | class AddAnnouncementManagerCourseRelationships < ActiveRecord::Migration[6.1]
def change
add_reference :courses, :announcement_manager, index: true
add_reference :announcement_managers, :course, index: true
end
end
| 32.571429 | 78 | 0.798246 |
ab6cf319900ebae992c4f956338751531fe60eb2 | 922 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'json_structure/version'
Gem::Specification.new do |spec|
spec.name = "json_structure"
spec.version = JsonStructure::VERSION
spec.authors = ["Kaido Iwamoto"]
spec.emai... | 32.928571 | 104 | 0.636659 |
ac9f57487862082bb0451a597e76a7e6abf368fc | 344 | module SHD
class EnvironmentChecker
def self.check!
return if !ENV["GITHUB_TOKEN"].nil? && !ENV["GITHUB_TOKEN"].empty?
REQUIRED_ENV.each do |key|
if ENV[key].nil? || ENV[key].empty?
Logger.fatal "`#{key}` is missing from the environment, exiting"
exit(-1)
end
... | 21.5 | 74 | 0.584302 |
791bd383c8b4db7f9f5bf18385b8fb4d7e366167 | 400 | require 'spec_helper'
describe "Comparisons" do
describe "create a new comparison" do
it "should show a flash message on success" do
=begin
visit msruns_path
click_button("Add To Comparison Set One")
click_button("Add To Comparison Set Two")
click_button("Compare")
page.should have_... | 23.529412 | 50 | 0.6925 |
7944802f29a4719c1533376cfe62d1323c2e3d4f | 7,371 | require 'whimsy/asf/memapps'
class Committer
def self.serialize(id, env)
response = {}
person = ASF::Person.find(id)
person.reload!
return unless person.attrs['cn']
response[:id] = id
response[:member] = person.asf_member?
# reformat the timestamp
m = person.createTimestamp.match(... | 30.458678 | 120 | 0.622711 |
d57cc1470cd2069d9f079af9f1a0493ff1cd4d44 | 6,494 | require 'generators/ember/generator_helpers'
require 'net/http'
require 'uri'
require 'fileutils'
module Ember
module Generators
class InstallGenerator < ::Rails::Generators::Base
class InvalidChannel < ::Thor::Error; end
class ConflictingOptions < ::Thor::Error; end
class InsufficientOptions... | 32.633166 | 130 | 0.590391 |
916371613778b9559b6c5fb50f60007dce76e0fe | 933 | # frozen_string_literal: true
module Gitlab
module ImportExport
module Group
class RelationFactory < Base::RelationFactory
OVERRIDES = {
labels: :group_labels,
priorities: :label_priorities,
label: :group_label,
parent: :epic
}.freeze
... | 21.697674 | 85 | 0.573419 |
181a8424ec9e5f2b3609c145f9d4adda2ad2e44e | 530 | require 'yaml'
require 'hashr'
require 'travis/config/helpers'
module Travis
class Config < Hashr
class Files
include Helpers
def load
filenames.inject({}) do |config, filename|
deep_merge(config, load_file(filename)[Config.env] || {})
end
end
private
... | 18.928571 | 69 | 0.581132 |
62704946a07aa0ab0cf162acfd696be58a0d429b | 122 | class AddTimestampsToPrayers < ActiveRecord::Migration[5.1]
def change
add_timestamps :prayers, null: true
end
end
| 20.333333 | 59 | 0.770492 |
0382fd5a9310e033a08f7bf0ededcdba3bbe99b2 | 4,570 | ##
# Generated by "rake sinatra:from_rails:classic OUTPUT_FILE=/Users/nwiger/Workspace/sinatra_from_rails/spec/output/main_xml.rb FORMAT=xml RENDER=builder"
# Keep up to date: http://github.com/nateware/sinatra_from_rails
#
# Categories
get '/categories.xml' do
@categories = Category.all
@categories.to_xml
end
ge... | 19.869565 | 182 | 0.698687 |
28d9d922ab1d064e92485be7cf7be9ce23f0c95b | 3,589 | # encoding: UTF-8
# frozen_string_literal: true
require_relative '../validations'
module API
module V2
module Account
class Deposits < Grape::API
before { deposits_must_be_permitted! }
desc 'Get your deposits history.',
is_array: true,
success: API::V2::Entities::Depo... | 42.223529 | 135 | 0.555865 |
5d8440123e6231f5716c902b65d9663511693ec6 | 12,061 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Database::LoadBalancing::LoadBalancer, :request_store do
let(:conflict_error) { Class.new(RuntimeError) }
let(:db_host) { ActiveRecord::Base.connection_pool.db_config.host }
let(:lb) { described_class.new([db_host, db_host]) }
let(:req... | 29.417073 | 117 | 0.67996 |
79fdd22cf1083df5fbcc2c4026e30bf34646172c | 1,435 | class Lambchop::Cat
def self.cat(function_name, invoke_args, options = {})
self.new(function_name, invoke_args, options).cat
end
def initialize(function_name, invoke_args, options = {})
@function_name = function_name
@invoke_args = invoke_args
@client = options[:client] || Aws::Lambda::C... | 27.596154 | 100 | 0.634843 |
e8b2c0d4adbd71568b15f28d8d36a2cda134056b | 315 | class AddNewCommunitySettings < ActiveRecord::Migration[5.2]
def change
add_column :communities, :facebook_connect_id, :string
add_column :communities, :facebook_connect_secret, :string
add_column :communities, :google_analytics_key, :string
add_column :communities, :favicon_url, :string
end
end
| 35 | 62 | 0.784127 |
abf29f9d95c6cc12094d930420de84b494487c4a | 2,142 | # This code is derived from the SOM benchmarks, see AUTHORS.md file.
#
# Copyright (c) 2015-2016 Stefan Marr <git@stefan-marr.de>
#
# 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 res... | 28.945946 | 79 | 0.681139 |
87b5af08aa631e84a44afe99f0089ce85cf121b7 | 212 | class Taxonomy < ActiveRecord::Base
has_many :taxons, inverse_of: :taxonomy, dependent: :destroy
has_many :classifications, inverse_of: :taxonomy, dependent: :destroy
validates :name, presence: true
end
| 23.555556 | 71 | 0.764151 |
7af450b2132a47b03817d56d863b428b0fff6b27 | 232 | class AddAssigneeToTarget < ActiveRecord::Migration[6.0]
def change
add_column :targets, :assignee_id, :integer
add_column :targets, :assignee_type, :string
add_index :targets, [:assignee_id, :assignee_type]
end
end
| 29 | 56 | 0.74569 |
08f8009ce6545d47532b1e4e19869efdf6fb949d | 431 | cask :v1 => 'radiant-player' do
version '1.3.3'
sha256 '93fe48f191c5b670704266eec8c25040d153051397420ce36cdf669a322270cf'
url "https://github.com/kbhomes/radiant-player-mac/releases/download/v#{version}/Radiant.Player.zip"
appcast 'https://github.com/kbhomes/radiant-player-mac/releases.atom'
name 'Radiant Pl... | 33.153846 | 102 | 0.763341 |
abed80c0a81ce10f8147c8eeb58fdd58b6426ea3 | 1,558 | # frozen_string_literal: true
require_relative '../test_helper'
SingleCov.covered! uncovered: 7
describe FlowdockNotification do
let(:deploy) { deploys(:succeeded_test) }
let(:notification) { FlowdockNotification.new(deploy) }
let(:endpoint) { "https://api.flowdock.com/v1/messages/team_inbox/x123yx" }
let(:ch... | 29.961538 | 120 | 0.735558 |
b96d02d9fa7add5055758682ab9ddf575d192281 | 18,479 | require_relative '../test_helper'
class MultiversionTest < Test::Unit::TestCase
def test_autodetect_stu3
root = File.expand_path '..', File.dirname(File.absolute_path(__FILE__))
capabilitystatement = File.read(File.join(root, 'fixtures', 'capabilitystatement.json'))
stub_request(:get, /autodetect/).to_r... | 41.713318 | 133 | 0.702203 |
6aac3aff8c67c9f121bc77dd41765d52bb55aa5e | 1,741 | # frozen_string_literal: true
lib = File.expand_path('../lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require_relative 'config/config'
Gem::Specification.new do |spec|
spec.name = 'facter-ng'
spec.version = FACTER_VERSION
spec.authors = ['Bogdan Irimie']
spec.ema... | 38.688889 | 98 | 0.686387 |
5df51091f58578b8faa00d650c645b65d146be2a | 1,119 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'cocoapods-rocket/gem_version.rb'
Gem::Specification.new do |spec|
spec.name = 'cocoapods-rocket'
spec.version = CocoapodsRocket::VERSION
spec.authors = ['asynclog']
s... | 36.096774 | 74 | 0.698838 |
0360737e2f51fdcb040ce23d7028b2076007b9ec | 742 | module Barometer
module Query
module Service
class GoogleGeocode
class Api < Utils::Api
def url
'http://maps.googleapis.com/maps/api/geocode/json'
end
def params
format_params
end
def unwrap_nodes
['results', 0]
... | 20.611111 | 78 | 0.490566 |
b9c6e6238fef2105605ee412b7b10075fa19906a | 20,688 | # 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::EventGrid::Mgmt::V2020_06_01
#
# Azure EventGrid Management Client
#
class PrivateLinkResources
include MsRestAzure
#
# C... | 48.792453 | 224 | 0.705095 |
1d187b139c70157302eca453d4f1422fc2cd877b | 117 | class AddUserIdToJobs < ActiveRecord::Migration[5.0]
def change
add_column :jobs, :user_id, :integer
end
end
| 19.5 | 52 | 0.735043 |
615fc1cf3148530fc28bebc3759c36f4e3e275e4 | 31,816 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::ChimeSDKMeetings
# @api private
module ClientApi
include ... | 73.990698 | 211 | 0.775302 |
b93aad7764fc78a8da8d7450c68772588353fde5 | 3,543 | # encoding: UTF-8
# Copyright © 2012, 2013, 2014, 2015, Carousel Apps
require "bigdecimal"
require "net/http"
require "net/https"
require "json"
require "uri"
# Nexmo response
class ActionTexter::NexmoResponse < ActionTexter::Response
SUCCESS_RESPONSE_CODE = "0"
# TODO: Some of these should be moved to Response ... | 36.153061 | 190 | 0.631668 |
f7e6c4f95e7e33b8da993bf5905d42e4f79103f2 | 1,555 | cask "visual-studio-code-insiders" do
version "1.58.0,a81fff00c9dab105800118fcf8b044cd84620419"
if Hardware::CPU.intel?
sha256 "5f68ea465959f9c157e11493c5812c4b566424819313e841381360a0a53b30f9"
url "https://az764295.vo.msecnd.net/insider/#{version.after_comma}/VSCode-darwin.zip",
verified: "az7642... | 35.340909 | 111 | 0.717042 |
61629e5680b168b7af6aed547443c588fe2f1e73 | 1,648 | # 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::Compute::Mgmt::V2019_12_01
module Models
#
# The properties describe the recommended machine configuration for this
# Image Defi... | 27.016393 | 76 | 0.54551 |
33b0e7f0dabdcd298ee8926b1a344940b3953ec5 | 256 | module Kata
module Kyu7
class << self
def growth_of_a_population(p0, percent, aug, p)
loop.with_index(1) do |_, years|
return years unless (p0 += (p0 * percent/100.0 + aug).floor) < p
end
end
end
end
end
| 18.285714 | 74 | 0.570313 |
e950dbc6233b0de93f3fd8f71607f3cdf06d22de | 5,452 | # frozen_string_literal: true
require 'active_support/core_ext/integer/time'
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 mos... | 43.967742 | 114 | 0.765407 |
f80abb06fca31b828fc80dafd03d1f7477fc413d | 45,827 | require 'spec_helper'
describe 'Git LFS API and storage' do
include WorkhorseHelpers
include ProjectForksHelper
let(:user) { create(:user) }
let!(:lfs_object) { create(:lfs_object, :with_file) }
let(:headers) do
{
'Authorization' => authorization,
'X-Sendfile-Type' => sendfile
}.compact... | 32.945363 | 210 | 0.570493 |
e83105c62fe7971c9d5307c775427e30bc2a915a | 143 | module OfficeUiFabric
module Rails
FABRIC_CORE_VERSION = "4.0.0"
FABRIC_JS_VERSION = "3.0.0-beta2"
VERSION = "4.0.0.2"
end
end
| 17.875 | 37 | 0.664336 |
6ab067120e5a68e0fabd866fc121747ef7bddc05 | 626 | Pod::Spec.new do |s|
s.name = 'VOLoginCommponet'
s.ios.deployment_target = "9.0"
s.version = '1.1.2'
s.license = "Copyright (c) 2018年 Gavin. All rights reserved."
s.homepage = 'https://github.com/feidaoGavin/VOLoginCommponet.git'
s.summary = 'VOLoginCommponet登录模块'
s.author = 'heguangzhong2009@gmai... | 34.777778 | 71 | 0.664537 |
2672ca127d7cae9418cb227cd407f41101c00693 | 472 | class FontBigShouldersStencilText < Formula
head "https://github.com/google/fonts/raw/main/ofl/bigshouldersstenciltext/BigShouldersStencilText%5Bwght%5D.ttf", verified: "github.com/google/fonts/"
desc "Big Shoulders Stencil Text"
desc "Superfamily of condensed American Gothic typefaces"
homepage "https://fonts.... | 39.333333 | 153 | 0.78178 |
26d2258cd865eb7a26b521e8f5e9114e73540dd0 | 1,047 | name "pip3"
default_version "21.3.1"
dependency "setuptools3"
source :url => "https://github.com/pypa/pip/archive/#{version}.tar.gz",
:sha256 => "cbfb6a0b5bc2d1e4b4647729ee5b944bb313c8ffd9ff83b9d2e0f727f0c79714",
:extract => :seven_zip
relative_path "pip-#{version}"
build do
license "MIT"
license_... | 31.727273 | 127 | 0.707736 |
183240f488c8695ceba45174ff0478ad4e1281d5 | 1,305 | module JSON
class Schema
class OneOfAttribute < Attribute
def self.validate(current_schema, data, fragments, processor, validator, options = {})
validation_errors = 0
current_schema.schema['oneOf'].each do |element|
schema = JSON::Schema.new(element,current_schema.uri,validator)
... | 39.545455 | 133 | 0.658238 |
1c08ab9bbef8272a86bf247994942332ff4e1c84 | 131 | # frozen_string_literal: true
module CXML
class SupplierSetup < DocumentNode
accessible_nodes %i[
url
]
end
end
| 13.1 | 36 | 0.694656 |
bf00033b781d4f23f72b2efb9cfd105a57f03225 | 2,408 | require "spec_helper"
require "mvcli/validatable"
describe "a validator" do
use_natural_assertions
Given(:object) { Object.new }
Given(:validator) { MVCLI::Validatable::Validator.new }
Given(:validation) { validator.validate object }
Given(:violations) { validation.violations }
context "when it validates ... | 35.940299 | 93 | 0.659053 |
79d66660f6346fae3540f3c26229f6a525c7e096 | 749 | # frozen_string_literal: true
Rails.application.routes.draw do
devise_for :fans, :controllers => {:sessions => "sessions"}
namespace :last_fm do
resource :connection, :only => %i[ new show destroy ]
end
get "/auth/spotify/callback", :to => "spotify/connections#create"
namespace :spotify do
resourc... | 25.827586 | 67 | 0.655541 |
62e654e1361c92ca970864d8dcc56975fff81710 | 1,428 | class AvailabilityStatusUpdateJob < ApplicationJob
queue_as :availability
def perform(event, headers)
payload = JSON.parse(event)
model_class = payload["resource_type"].classify.constantize
validate_resource_type(model_class)
record_id = payload["resource_id"]
object = model_class.find(record... | 36.615385 | 127 | 0.742297 |
61ccb73d69b1c9d7ee4e1d0498bfe8d408fae812 | 241 | # -*- encoding: utf-8 -*-
require_relative 'common'
require 'hexapdf/encryption/fast_arc4'
describe HexaPDF::Encryption::FastARC4 do
include ARC4EncryptionTests
before do
@algorithm_class = HexaPDF::Encryption::FastARC4
end
end
| 18.538462 | 52 | 0.755187 |
6a9e9582b3cb4458fce43293bea6f030c24ebc39 | 39 |
module Xample
VERSION = "0.0.1"
end
| 7.8 | 19 | 0.641026 |
5d5e515f8c092fbb120bb9053c1e494821725523 | 3,880 | # -*- coding: utf-8 -*-
require 'pp'
require 'ostruct'
require 'uri'
require '../lib/jekyll/msgcat'
# mock
module Site_ru
def initialize *a, &b
super
@context = OpenStruct.new("registers" => {
site: OpenStruct.new("config" => {
... | 32.333333 | 132 | 0.621649 |
e9aefe91e18f32e7212c24afdd775dfcc361adc3 | 155 | class CreateEditors < ActiveRecord::Migration[6.0]
def change
create_table :editors do |t|
t.string :key
t.timestamps
end
end
end
| 15.5 | 50 | 0.658065 |
26d15d2fb717681ae3e4014f19555bfaf8a6be0b | 17,808 | require File.dirname(__FILE__) + '/../../spec_helper.rb'
describe "OracleEnhancedAdapter establish connection" do
it "should connect to database" do
ActiveRecord::Base.establish_connection(CONNECTION_PARAMS)
ActiveRecord::Base.connection.should_not be_nil
ActiveRecord::Base.connection.class.should == Ac... | 32.144404 | 128 | 0.716981 |
ff52567a0f9b90d2e15ff119842c963bc08064ad | 1,650 | require 'test_helper'
class UsersEditTest < ActionDispatch::IntegrationTest
def setup
@user = users(:morna)
end
test "unsuccessful edit" do
log_in_as(@user)
get edit_user_path(@user)
assert_template 'users/edit'
patch user_path(@user), params: { user: { name: "blah",
... | 31.730769 | 78 | 0.550909 |
bfb6a33ebdbecdf813051de7e8095b14fb8aa67b | 156 | # frozen_string_literal: true
class AddIncomeToPeople < ActiveRecord::Migration[6.0]
def change
add_column :people, :income_level, :string
end
end
| 19.5 | 54 | 0.762821 |
7977e387301bcf99febb5bb808d6168937532e92 | 118 | if Rails.env.development? || Rails.env.test?
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
end
| 19.666667 | 44 | 0.720339 |
1ad4e0ec10a80b02299d5cfae0b392f7377837f5 | 1,163 | # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... | 52.863636 | 79 | 0.77644 |
abf23b88c843ec7cc269a9a339875eafe8c49c90 | 4,548 | module Cache
module Cacheable
include ResponseWrapper
# thin wrapper around Rails.cache.fetch. Reads the value of key from cache if it exists, otherwise executes
# the passed block and caches the result. Set force_write=true to make it always execute the block and write
# to the cache.
def fetch... | 35.255814 | 175 | 0.636324 |
7a7c3e1704c9f926c6980d06bcc62bc28d64ad49 | 623 | require 'test_helper'
class UsersProfileTest < ActionDispatch::IntegrationTest
include ApplicationHelper
def setup
@user = users(:michael)
end
test "profile display" do
log_in_as(@user)
get user_path(@user)
assert_template 'users/show'
assert_select 'title', full_title(@user.name)
ass... | 27.086957 | 59 | 0.723917 |
b92098b7a383bcd8aa50455fb2d9b869f4a6ca7a | 1,882 | include QuadiconHelper
describe "layouts/listnav/_security_group.html.haml" do
before :each do
set_controller_for_view("security_group")
assign(:panels, "ems_prop" => true, "ems_rel" => true)
allow(view).to receive(:truncate_length).and_return(15)
allow(view).to receive(:role_allows).and_return(true)... | 50.864865 | 162 | 0.602019 |
396b71c36e1795567aeb9491879eb2b37f064aaa | 4,285 | require 'net/http'
require 'json'
require 'openssl'
class ZabbixApi
class Client
# @param (see ZabbixApi::Client#initialize)
# @return [Hash]
attr_reader :options
# @return [Integer]
def id
rand(100_000)
end
# Returns the API version from the Zabbix Server
#
# @return [Str... | 29.756944 | 157 | 0.616569 |
8793a0fb3e7c41fa39f9deb609bd8b83344c3747 | 1,299 | lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require_relative 'lib/learnosity_utils/version'
Gem::Specification.new do |spec|
spec.name = 'learnosity_utils'
spec.version = LearnosityUtils::VERSION
spec.authors = ['Chris Connell']
spec.e... | 38.205882 | 93 | 0.672825 |
edf22add8f710480be4a06942666c513bd09832b | 560 | require 'net/ssh'
module AmiSpec
class WaitForRC
def self.wait(ip_address, user, key)
Net::SSH.start(ip_address, user, keys: [key], paranoid: false) do |ssh|
# Wait for SystemV to start
# This only works for Ubuntu with upstart.
# Detecting OS and Release will need something like th... | 32.941176 | 109 | 0.669643 |
e8cc878c41e2a418920686d39d93afc5165745ec | 534 | # frozen_string_literal: true
require "yaframework"
app = Yaframework::Application
app.get "/" do
response.redirect "/html"
end
app.get "/html" do
response.html "This is <b>HTML</b>, where you cat use some <small>tags</small>.
<br/>JSON <a href=\"/json\">here</a>,
<br/>Plain text <a href=\"/text\">here</a>"
... | 21.36 | 81 | 0.662921 |
5dfff5cd949992a5b631fce360a2ad3631f8bab0 | 962 | #
# Be sure to run `pod spec lint WZJBaseViewController.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see https://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see htt... | 32.066667 | 97 | 0.685031 |
1df670c1b4170eaeaba296db8c8de93b694b4bf5 | 16,524 | module ActiveRecord
module ConnectionAdapters
module Redshift
class SchemaCreation < SchemaCreation
private
def visit_ColumnDefinition(o)
o.sql_type = type_to_sql(o.type, limit: o.limit, precision: o.precision, scale: o.scale)
super
end
def add_column_op... | 39.342857 | 197 | 0.599129 |
e2e0b47af866de5e2950340381b54acaad0be396 | 2,182 | require 'spec_helper'
describe 'apache::dev', :type => :class do
context "on a Debian OS" do
let :facts do
{
:lsbdistcodename => 'squeeze',
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '6',
:is_pe ... | 29.486486 | 64 | 0.512374 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.