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 |
|---|---|---|---|---|---|
e21b34126d2f61ae6a63a45af10d6a7908de9adb | 201 | module Datadog
module VERSION
MAJOR = 0
MINOR = 47
PATCH = 0
PRE = nil
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
MINIMUM_RUBY_VERSION = '2.0.0'.freeze
end
end
| 15.461538 | 57 | 0.60199 |
1a34d45914adac0ae5471c2736fc07e1c1a5d6e2 | 306 | require_relative '../../helper'
require_relative 'shared_spec_behaviors'
class Repositext
class Validation
describe Rtfile do
include SharedSpecBehaviors
before {
@common_validation = Rtfile.new(
{:primary => ['_', '_', '_']}, {}
)
}
end
end
end
| 16.105263 | 43 | 0.594771 |
e2f1c58cba35e5a0b92c9353744d3786b180f403 | 492 | require 'yaml'
require 'active_record'
module Models
class RetrosheetEvent < ActiveRecord::Base
attr_accessor :column_mapping_memo
class << self
def column_mapping
column_mapping_memo ||= YAML::load_file(File.join(Retrodb::ROOT, 'config', 'retrosheet_database_mapping.yml'))
end
... | 19.68 | 118 | 0.638211 |
6a12dff699d7ea8372558265854b9019c8304a21 | 1,199 | # @!group /service_manager/
# @method get_services_for_type
# @overload get '/v0/service_manager/persistent_services/:publisher_namespace/:type_path'
# Return array of services attached to the service :publisher_namespace/:type_path
# @return [Array]
get '/v0/service_manager/persistent_services/:publisher_namespace/*'... | 36.333333 | 110 | 0.750626 |
b9cb71ae89a003f830c988914db2463f387409fe | 1,422 | # frozen_string_literal: true
class Profiles::KeysController < Profiles::ApplicationController
skip_before_action :authenticate_user!, only: [:get_keys]
def index
@keys = current_user.keys.order_id_desc
@key = Key.new
end
def show
@key = current_user.keys.find(params[:id])
end
def create
... | 23.311475 | 105 | 0.664557 |
e9ae81c6fe2c3054122e6f66424a718c7a7aca55 | 665 | cask "preference-manager" do
version "4.5.2.0"
sha256 "780626b2e0a557f86e42ab899dadd727c1ef01f029ddd1ae98a4984365639971"
url "https://www.digitalrebellion.com/download/prefman?version=#{version.no_dots}"
name "Preference Manager"
desc "Trash, backup, lock and restore video editor preferences"
homepage "htt... | 30.227273 | 84 | 0.702256 |
e823067c909c446154fdf9a9e00cb66dda9971ef | 387 | # 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::ContainerRegistry::Mgmt::V2019_06_01_preview
module Models
#
# Defines values for TriggerStatus
#
module TriggerStatus
... | 22.764706 | 70 | 0.710594 |
61f7b3c6586fc6173043bdfc48cebdb10f144909 | 236 | class AddQuery < ActiveRecord::Migration[4.2]
def self.up
add_column :web_forms, :query, :text
add_column :web_vulns, :query, :text
end
def self.down
remove_column :web_forms, :query
remove_column :web_vulns, :query
end
end
| 21.454545 | 45 | 0.741525 |
bb234c7b64460886446639cad562cd26dc795ce4 | 1,586 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'bulma/css/version'
Gem::Specification.new do |spec|
spec.name = "bulma-css"
spec.version = Bulma::Css::VERSION
spec.authors = ["Ankur Singh"]
spec.email = ["a... | 37.761905 | 104 | 0.618537 |
e9585590e526dfa946d94f8e8e8559d7387f5de8 | 181 | require "test_helper"
class DashboardControllerTest < ActionDispatch::IntegrationTest
test "should get home" do
get dashboard_home_url
assert_response :success
end
end
| 20.111111 | 63 | 0.790055 |
bb969ec880f727fba5cda57fd94628e125e3a62c | 2,333 | require "rails_helper"
require "shared_rutines"
RSpec.describe LocalesController, type: :controller do
describe "#default_locale" do
before do
I18n.default_locale = :en
I18n.available_locales = %i[en en-US es]
cookies.permanent[:locale] = nil
request.headers["Accept-Language"] = nil
e... | 32.402778 | 78 | 0.657951 |
1da55e93ce9f28db27b3a05d6508428dac9f11b0 | 760 | require 'matrix'
module ML
module Learner
# Implementation of linear regression
class LinearRegressionLearner
include Toolbox
include LinearToolbox
# Intialize linear regression
#
# @param [Integer] dim the input dimension
def initialize dim
@dim = dim
end
... | 22.352941 | 80 | 0.586842 |
d5da59be14fbd4920e3cd155ae95e7c72e965e2d | 176 | class InstanceController < ApplicationController
def getInstance
instance_hash = {current_instance: ENV['INSTANCE']}
render json: instance_hash, status: :ok
end
end | 29.333333 | 55 | 0.767045 |
181d088bfa2eaf041a4632eb77d962ab02ccf058 | 1,497 | class Asymptote < Formula
desc "Powerful descriptive vector graphics language"
homepage "https://asymptote.sourceforge.io"
url "https://downloads.sourceforge.net/project/asymptote/2.62/asymptote-2.62.src.tgz"
sha256 "60b085316b65af6a0e5132a8451c13b642cfe91c9096dc35d43b7b77a9dd2014"
bottle do
sha256 "64b8... | 31.851064 | 93 | 0.728123 |
285681bfb793bfc5a0e03aa5c5580efe5ea22342 | 1,046 | #
# Be sure to run `pod lib lint NavigationRoute.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'Nav... | 30.764706 | 108 | 0.624283 |
2801d57c78c9b479dacf11161061a504048cae7a | 220 | require 'support/file_system_support'
RSpec.configure do |config|
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
config.treat_symbols_as_metadata_keys_with_true_values = true
end
| 24.444444 | 63 | 0.827273 |
bbe1262c2989c44de94d6f33bc62a088c61d2e0b | 300 | #!/usr/bin/env ruby
require 'rubygems'
require 'gosu'
require 'ruby/snake/game/window'
module Ruby
module Snake
# Game entry point
class GameApp
def initialize
@game_window = Game::Window.new
end
def start
@game_window.show
end
end
end
end
| 13.636364 | 39 | 0.623333 |
d52f432ad483f498f6af78b6bc76187db78a09b5 | 22,577 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 52.261574 | 154 | 0.673296 |
1c454aef7e5112fe225d8842a77da77d0b33ec81 | 4,271 | require 'redis'
require 'redis-namespace'
class Ratelimit
# Create a RateLimit object.
#
# @param [String] key A name to uniquely identify this rate limit. For example, 'emails'
# @param [Hash] options Options hash
# @option options [Integer] :bucket_span (600) Time span to track in seconds
# @option opti... | 34.723577 | 162 | 0.681339 |
08641b3e10ae5a4da376eed0a0cd27ce6f1ed13d | 57 | module Corelb
# corelb version
VERSION = "0.1.0"
end
| 11.4 | 19 | 0.666667 |
ed1944f337323262abfc220e01b0d87aa36fb65d | 1,814 | # == Schema Information
#
# Table name: services
#
# id :integer not null, primary key
# type :string(255)
# title :string(255)
# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean defau... | 22.395062 | 92 | 0.647189 |
e9ab5cc7a99e87a646a8e1df98ef7d6e60389a78 | 749 | Pod::Spec.new do |s|
s.name = "YZClockView"
s.version = "0.1.1"
s.summary = "A simple, elegant UIView to express time."
s.homepage = "https://github.com/AustinChou/YZClockView"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author... | 46.8125 | 106 | 0.53271 |
264c916100dae7aca384cd0de3212f894448ffdd | 3,999 | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
require File.expand_path('../shared/enumeratorize', __FILE__)
describe "Array#reject" do
it "returns a new array without elements for which block is true" do
ary = [1, 2, 3, 4, 5]
ary.reject {... | 30.067669 | 101 | 0.623906 |
01d4a6f34cacf61ae5514c4db0cd6e879f856493 | 1,506 | # frozen_string_literal: true
#
# Copyright:: 2020, Chef Software, Inc.
# Author:: Tim Smith (<tsmith@chef.io>)
#
# 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/licen... | 36.731707 | 224 | 0.734396 |
1a0e30b21f87e826f7804b9a10bbf929627e9e5d | 11,026 | # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 46.919149 | 408 | 0.724197 |
2818ec12876a91370d4cd05051f727d19147adc4 | 169 | require 'lib/bitcoin/price'
module Bitcoin
def self.get_current_price
Price.get_current
end
def self.get_past_month_price
Price.get_past_month
end
end
| 14.083333 | 31 | 0.769231 |
1d657e7b1d55f46906d50f2568d9d21f52026490 | 187 | class RemoveCategoryFromStories < ActiveRecord::Migration[6.0]
def change
remove_column :stories, :cateogry_code, :string
add_column :stories, :category_code, :string
end
end
| 26.714286 | 62 | 0.764706 |
08973ec52b5d6b72f7300be61c155ffa68a156a5 | 56 | class Domain < ActiveRecord::Base
has_many :pages
end
| 14 | 33 | 0.767857 |
f7ba8faecc5d34e6393890feb8c04e84240ae629 | 2,523 | class CommentsController < ProtectedController
before_action :skip_policy_scope
before_action :set_comment, only: [:show, :edit, :update, :destroy]
before_action :set_commentable
# GET /commentable/:commentable_id/comments
# GET /commentable/:commentable_id/comments.json
def index
if @commentable.prese... | 27.129032 | 108 | 0.673801 |
089242c53a3a277f06ab2ded5156ca668f3a1f53 | 1,094 | require 'json'
# Returns the version number for a package.json file
pkg_version = lambda do |dir_from_root = '', version = 'version'|
path = File.join(__dir__, dir_from_root, 'package.json')
JSON.parse(File.read(path))[version]
end
# Let the main package.json decide the version number for the pod
package_version ... | 35.290323 | 110 | 0.655393 |
1afc79542cc47005b82ef5a596a45bf7d7f415e5 | 889 | # frozen_string_literal: true
# Copyright 2016-2021 Copado NCS LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 29.633333 | 74 | 0.746907 |
ab36f0823fdec66ed7b1ffb9400ed55d5e063255 | 3,328 | class UserProfilesController < ApplicationController
def show
id = 0
if user_signed_in?
id = current_user.id
end
if params["id"] != nil
id = params["id"].to_i
end
@user_profile = UserProfile.where({:user_id => ... | 32.627451 | 99 | 0.477764 |
28e1004bf39406ddd977efeb9a3c8034465b5f12 | 206 | # TODO: need to figure out something better for measures.yml
# APP_CONFIG.merge! YAML.load_file(Rails.root.join('config', 'measures.yml'))
Dir[Rails.root + 'lib/**/*.rb'].sort.each { |file| require file }
| 41.2 | 77 | 0.708738 |
03a1b0eff9a22aa0bd14ccea2abb1d45216ee584 | 559 | require 'action_view'
module Roll
module Amp
module Style
# The <nosript> tag.
class NoScriptTag
include ActionView::Helpers::TagHelper
# Initializes new instance of the noscript tag.
# @param [String] the content of the tag.
def initialize(content)
@content... | 22.36 | 75 | 0.599284 |
aba5e0a258687e0b840c6bb291d8f2ebe4f571fc | 601 | # 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... | 40.066667 | 111 | 0.71381 |
2641a203a29555d5e3f0df8c8d1d535249ae2fd9 | 1,452 | #!/usr/bin/ruby
require 'dotenv/load'
Pod::Spec.new do |spec|
spec.name = "Contentful"
spec.version = ENV['CONTENTFUL_SDK_VERSION']
spec.summary = "Swift SDK for Contentful's Content Delivery API."
spec.homepage = "https://github.com/contentful/contentful.swift/"
spec.s... | 33 | 101 | 0.632231 |
1c2e0d76d73b48666d3b306b611b6cacecba9d0f | 5,131 | require_relative 'cuda_model'
require_relative 'gen_probe_base.rb'
$all_types = $cuda_api["typedefs"]
$all_structs = $cuda_api["structs"]
$all_unions = $cuda_api["unions"]
$all_enums = $cuda_api["enums"]
$all_funcs = $cuda_api["functions"]
$all_enum_names = []
$all_bitfield_names = []
$all_struct_names = []
$all_unio... | 23.217195 | 108 | 0.53284 |
2685d0a945dc5cea537d74be73ef98dda247ecf4 | 1,260 | class Workflow < ApplicationRecord
has_many :taggings, as: :taggable, dependent: :destroy
has_many :tags, through: :taggings
belongs_to :user
has_many(
:workflow_modules,
-> { order(:position) },
inverse_of: :workflow,
dependent: :destroy,
)
accepts_nested_attributes_for :workflow_modules
... | 20.322581 | 76 | 0.655556 |
4afb18dcb622659ba13ec7f0e5d952039f563e57 | 2,435 |
When(/^I wait until I see "([^"]*)" text$/) do |text|
begin
Timeout.timeout(DEFAULT_TIMEOUT) do
loop do
break if page.has_content?(text)
sleep 3
end
end
rescue Timeout::Error
raise "Couldn't find the #{text} in webpage"
end
end
When(/^I wait until I see "([^"]*)" text, re... | 19.48 | 81 | 0.615606 |
39433ebc1228eccb7ae08311811bf50f17b328f3 | 6,206 | # -*- encoding: utf-8 -*-
require_relative 'spec_helper'
describe Message do
describe 'providing an evaluted message that is not a string' do
let(:subject) { Message.new(ndc: [], message: Rational(1.5)) }
it 'returns the given message' do
assert_equal '3/2', subject.to_s
end
end
describe 'pr... | 24.14786 | 167 | 0.610055 |
edb5899ab9dccb4cf3425f2918b83f2e03902c1a | 283 | module ExceptionList
URI_EXCEPTIONS = [Errno::ETIMEDOUT, Errno::ECONNREFUSED, URI::InvalidURIError, Net::OpenTimeout, SocketError].freeze
REST_CLIENT_EXCEPTIONS = [RestClient::NotFound, RestClient::GatewayTimeout, RestClient::BadRequest, RestClient::MethodNotAllowed].freeze
end
| 56.6 | 138 | 0.819788 |
87016835b7e0b19af0b801cb100caa70af248a7d | 3,891 | # frozen_string_literal: true
module Reality::Describers::Wikidata::Impl
module Modules
# Enumerate pages that contain a given URL.
#
# The "submodule" (MediaWiki API term) is included in action after setting some param, providing
# additional tweaking for this param. Example (for {Reality::Describer... | 41.83871 | 313 | 0.579029 |
7995d383986393a3e9b67a14f49639b2c4f747fc | 434 | class CreateChatTeams < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = "Adding a foreign key"
disable_ddl_transaction!
def change
create_table :chat_teams do |t|
t.references :namespace, null: false, index: { unique: true }, foreign_key: { on_... | 22.842105 | 105 | 0.700461 |
1d97f90f7a41cb88e8a3bb94ff7f5d915c3e948c | 1,414 | describe EdoOracle::SubjectAreas do
subject { described_class.fetch }
before do
allow(EdoOracle::Queries).to receive(:get_subject_areas).and_return subject_areas.map { |area| {'subjectarea' => area} }
end
context 'a variety of subject areas' do
let(:subject_areas) { ['ARABIC', 'COM LIT', 'ENE,RES', 'E... | 38.216216 | 124 | 0.660537 |
613c767ae587992ccdd5df85ae56494e76219d11 | 134 | class Sfn::HasSatisfaction
attr_reader :satisfaction
def initialize(satisfaction)
@satisfaction = satisfaction
end
end | 16.75 | 32 | 0.753731 |
1cbc16348b302dbd3dfcf864d03e37afd618b1bd | 2,860 | class QtPerconaServer < Formula
desc "Qt SQL Database Driver"
homepage "https://www.qt.io/"
url "https://download.qt.io/official_releases/qt/6.1/6.1.3/submodules/qtbase-everywhere-src-6.1.3.tar.xz"
sha256 "1e9abb2ea4daa0fd11f46fc871d9e896b916e1b7130fed74c83d66221bb4fe78"
license all_of: ["LGPL-2.1-only", "LGP... | 29.183673 | 107 | 0.661189 |
26b2edd1eb08193df64f776691229f9d80c8dff5 | 5,128 | #
# Be sure to run `pod spec lint ZWSProgressHUD.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 http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://git... | 36.892086 | 99 | 0.595944 |
e2741040882fe5b3e6ba9e100dec4d5293f1e09e | 1,614 | class GnuTypist < Formula
desc "GNU typing tutor"
homepage "https://www.gnu.org/software/gtypist/"
url "https://ftp.gnu.org/gnu/gtypist/gtypist-2.9.5.tar.xz"
mirror "https://ftpmirror.gnu.org/gtypist/gtypist-2.9.5.tar.xz"
sha256 "c13af40b12479f8219ffa6c66020618c0ce305ad305590fde02d2c20eb9cf977"
revision 1
... | 35.866667 | 99 | 0.722429 |
332df96dc3ae85ac05a6d16203fa2e6bbc449072 | 54 | class Size < ApplicationRecord
has_many :dogs
end
| 13.5 | 30 | 0.759259 |
f81b8fad5dc2a949685b3f00fdb2e13378391d2c | 8,866 | module SalesforceBulk
# Interface for operating the Salesforce Bulk REST API
class Client
# The host to use for authentication. Defaults to login.salesforce.com.
attr_accessor :login_host
# The instance host to use for API calls. Determined from login response.
attr_accessor :instance_host
# ... | 32.47619 | 139 | 0.627453 |
acffd113467443543c6635ec9577feb5b051294c | 1,112 | Pod::Spec.new do |s|
s.name = 'Google-Maps-iOS-SDK'
s.version = '1.1.0'
s.summary = 'Google Maps SDK for iOS.'
s.description = 'With the Google Maps SDK for iOS, you can add maps based on Google maps data to your application.'
s.homepage = 'https://developers.google.com/maps/documentation/ios/'
s.license = ... | 37.066667 | 154 | 0.677158 |
bb956d2b4fc118a540410a75b99d2245c6be5eab | 1,233 | # frozen_string_literal: true
require "simplecov"
# We start it with the rails param to ensure it includes coverage for all code
# started by the rails app, and not just the files touched by our unit tests.
# This gives us the most accurate assessment of our unit test coverage
# https://github.com/colszowka/simplecov... | 36.264706 | 79 | 0.746959 |
ab92512915877daa820f87838fb428da5d970c06 | 265 | #!/usr/bin/ruby
class Poussin < Animal
def initialize
super(2, "Cuit cuit", "Poussin", "Titi")
end
def speak
super
@nb_call ||= 0
@nb_call += 1
get_sick if @nb_call >= 42
end
private
def get_sick
@sound = "Cuo cuo"
end
end
| 12.619048 | 44 | 0.584906 |
33ff7084e30df9f45eb6dc46846f0d940918a4f9 | 1,306 | require_relative 'active_tab'
module SharedProjectTab
include Spinach::DSL
include SharedActiveTab
step 'the active main tab should be Home' do
ensure_active_main_tab('Project')
end
step 'the active main tab should be Files' do
ensure_active_main_tab('Files')
end
step 'the active main tab shou... | 22.912281 | 56 | 0.726646 |
38ef3176df3311b58f87e9bbd5b1b1993a680ec1 | 601 | require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module FirstclimbSite
class Application < Rails::Application
# Initialize configuration defaults for originally generated ... | 31.631579 | 82 | 0.768719 |
ab455dedeb8089b886c26ceebbd7631752bd1a35 | 2,518 | # This code is free software; you can redistribute it and/or modify it under
# the terms of the new BSD License.
#
# Copyright (c) 2012-2017, Sebastian Staudt
class Formula
include Mongoid::Document
include Mongoid::Timestamps::Updated
field :_id, type: String, overwrite: true
field :aliases, type: Array
f... | 26.505263 | 106 | 0.702939 |
33f0dd6e1dca7ebc833c6deb4a81d52df2f02d1e | 1,950 | require 'fellowship'
RSpec.describe Fellowship do
it "has a version number" do
expect(Fellowship::VERSION).not_to be nil
end
it "finds the factorial of 5" do
expect(Fellowship::Fellowship.factorial(5)).to eq(120)
end
it "finds the factorial of 0" do
expect(Fellowship::Fellowship.factorial(0)).t... | 27.083333 | 91 | 0.592308 |
62b4074f4dd0bd3a93c078334cf7cab817e219d9 | 1,117 | module ManageIQ::Providers
module Openshift
class ContainerManager::Refresher < ManageIQ::Providers::BaseManager::Refresher
include ::EmsRefresh::Refreshers::EmsRefresherMixin
include ManageIQ::Providers::Kubernetes::ContainerManager::RefresherMixin
KUBERNETES_EMS_TYPE = ManageIQ::Providers::Ku... | 39.892857 | 101 | 0.713518 |
878f3ec2593cdca0b212b514570337465771d438 | 759 |
module Intrigue
module Ident
module Check
class WordpressWpFastestCache < Intrigue::Ident::Check::Base
def generate_checks(url)
[
{
:type => "fingerprint",
:category => "application",
:tags => ["Wordpress Plugin"],
:vendor =>"Wordpress",
... | 25.3 | 79 | 0.504611 |
4a0e083d0632fb15062f0d9747ccca7582d4beac | 594 | module Closeio
class Client
module SmartView
def list_smart_views
get(smart_view_path)
end
def find_smart_view(id)
get(smart_view_path(id))
end
def create_smart_view(options = {})
post(smart_view_path, options)
end
def update_smart_view(id, opti... | 18.5625 | 52 | 0.597643 |
1db7d121b88c5ad9d3f4a60487bed41a002bef26 | 1,116 | # frozen_string_literal: true
# Copyright 2015-2017, the Linux Foundation, IDA, and the
# CII Best Practices badge contributors
# SPDX-License-Identifier: MIT
require 'test_helper'
load 'Rakefile'
class FeedTest < ActionDispatch::IntegrationTest
# Turn off transactional fixtures for this test since we are loading
... | 31.885714 | 72 | 0.727599 |
33d959f5ce59bbf570736c90e1a23145a0bb817a | 5,301 | #coding: UTF-8
module Kinopoisk
class Movie
attr_accessor :id, :url, :title
# New instance can be initialized with id(integer) or title(string). Second
# argument may also receive a string title to make it easier to
# differentiate Kinopoisk::Movie instances.
#
# Kinopoisk::Movie.new 277537... | 26.638191 | 86 | 0.661762 |
394c41b4d7ca5358d76d0d73f83932621c20dbd4 | 278 | require 'mongoid/markdown'
module ChatEngine
class Message
include Mongoid::Document
include Mongoid::Markdown
field :from
field :sent, :default => Time.now
field :body, :markdown => true
validates_presence_of :body, :on => :create
end
end | 19.857143 | 47 | 0.669065 |
e82d95ab869070a1f1b65bfb6e1c2c4f53650eaa | 1,289 | # == Schema Information
#
# Table name: admin_users
#
# id :bigint(8) not null, primary key
# email :string(255) default(""), not null
# encrypted_password :string(255) default(""), not null
# reset_password_token :string(255)
# reset_password_sent_at :da... | 31.439024 | 75 | 0.650892 |
1dc4dd9bd29d9600097fcdefcf4c6b60c5ccc304 | 3,329 | #!/usr/bin/env rspec
require 'spec_helper'
require 'mcollective/application/plugin'
module MCollective
class Application
describe Plugin do
let(:ddl) { mock }
before do
@app = MCollective::Application::Plugin.new()
@app.configuration[:rpctemplate] = "rspec-helptemplate.erb"
e... | 40.108434 | 132 | 0.620306 |
1d3f71cfc631d1a7015f3a9a640f83cf2e112136 | 841 | $LOAD_PATH.unshift File.expand_path('lib', __dir__)
require 'stream/version'
Gem::Specification.new do |gem|
gem.name = 'stream-ruby'
gem.description = 'Ruby client for getstream.io service'
gem.version = Stream::VERSION
gem.platform = Gem::Platform::RUBY
gem.summary = 'A gem that provides a client interface... | 36.565217 | 73 | 0.73365 |
6a401187cbff6532a5483c51061b8f4ed49b5144 | 216 | # This migration comes from alchemy (originally 20150729151825)
class AddLinkTextToAlchemyEssenceFiles < ActiveRecord::Migration[4.2]
def change
add_column :alchemy_essence_files, :link_text, :string
end
end
| 30.857143 | 69 | 0.805556 |
b92d0ba51f5cd55cb4b24d452f65bfce15a41ae7 | 2,473 | class RemoveLocalAreas < ActiveRecord::Migration
def self.up
drop_table :areas
end
def self.down
create_table "areas", :force => true do |t|
t.string "country"
t.float "co2_price"
t.float "co2_percentage_free"
t.float "el_import_capacity"
t.float "el_export_cap... | 39.253968 | 90 | 0.648605 |
4a5d8dfbd919ab257473bcaadaed490c3182428e | 2,053 | require 'spec_helper'
describe "Analyzer" do
let(:test_data){ [
{
"profile" => {
"username"=>"aaa"
},
"stats" => {
"Ruby" => {"count"=>5, "star"=>0 },
"JavaScript" => { "count"=> 1, "star"=>10 }
}
},
{
"profile" => {
"username"=>"bbb"
... | 23.597701 | 55 | 0.483195 |
189a6f07326a7966bc2810e6234ab8c8102c99fd | 11,608 | # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 48.773109 | 281 | 0.714938 |
f843d76f7af3b0f7637453efbb723cecb6866230 | 3,691 | class Libeemd < Formula
desc "Library for performing the ensemble empirical mode decomposition"
homepage "https://bitbucket.org/luukko/libeemd"
url "https://bitbucket.org/luukko/libeemd/get/v1.4.tar.gz"
sha256 "c484f4287f4469f3ac100cf4ecead8fd24bf43854efa63650934dd698d6b298b"
head "https://bitbucket.org/luukk... | 32.095652 | 94 | 0.663777 |
7ad24790754aa4e8210ad256e11d2a29103a8f7b | 1,013 | json.key_format!(camelize: :lower)
json.call(Pageflow.config,
:confirm_encoding_jobs,
:available_locales,
:available_public_locales,
:available_text_track_kinds,
:available_share_providers)
json.file_types Pageflow.config.file_types do |file_type|
json.collection_name... | 44.043478 | 85 | 0.831194 |
391f462298dc0fe3c4e331424c551a6dbfa721cb | 1,956 | class Location
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Ancestry
include Resourceable
field :resource_owner_id, type: Moped::BSON::ObjectId
field :name
field :type, default: 'generic'
field :device_ids, type: Array, default: []
index({ resource_owner_id: 1 }, { backgrou... | 27.942857 | 106 | 0.731595 |
ff5c0e30c82dbb03f8d9b5a5b0361977fb067349 | 154 | module Ahoy
class Message < ActiveRecord::Base
self.table_name = "ahoy_messages"
belongs_to :user, polymorphic: true, optional: true
end
end
| 19.25 | 55 | 0.727273 |
08f6226a333e7ae000e9018a79f2b4ce0a5731d8 | 1,268 | $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib')
require 'luban/cli'
class HelloApp < Luban::CLI::Application
HelloTexts = { english: 'Hello', french: 'Bonjour',
german: 'Halo', italian: 'Ciao',
chinese: '您好', japanese: 'こんにちは',
korean: '안... | 26.978723 | 75 | 0.638801 |
1cac2bf68a174cd01e3b64db56a2bca7b5205c10 | 1,816 | class BatchCompareService < ApplicationService
attr_reader :datasets, :hierarchy
def initialize(options = {
datasets: [NBS::NewbornRecord.all, OVRS::NewbornRecord.all],
hierarchy: CsvRecord::FIELD_HIERARCHY,
requestor: 'system'
})
raise ArgumentError unless options[:datasets].length == 2
@da... | 29.290323 | 129 | 0.618943 |
f73feb04861e3eb083397fdc26af780fd52cf250 | 2,319 | #
# Author:: Seth Chisamore (<schisamo@chef.io>)
# Author:: Lamont Granquist (<lamont@chef.io>)
# Author:: Marco Betti (<m.betti@gmail.com>)
# Copyright:: Copyright (c) 2011 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | 25.766667 | 78 | 0.605002 |
33a28f1eefbb759d25cf6e30b6bce0c31f2eb92d | 190 | # frozen_string_literal: true
class AddAssignedUserToIdeas < ActiveRecord::Migration[5.2]
def change
add_reference :ideas, :assigned_user, foreign_key: { to_table: :users }
end
end
| 23.75 | 75 | 0.763158 |
18db711cc3c0e23ebe9c72b10784e3fafad071fc | 8,715 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = GreatRanking
include Msf::Exploit::Remote::Udp
include Msf::Exploit::Remote::Seh
include Msf::Exploit::Ca... | 36.012397 | 141 | 0.565232 |
1adb6de00a371be0f351370975e641ca881389f8 | 962 | require "spec_helper"
describe Chartmogul::Import::Plan do
describe ".create" do
it "creates a new plan" do
plan_attributes = {
data_source_uuid: "ds_uuid_001",
name: "Bronze Plan",
interval_count: 1,
interval_unit: "month",
external_id: "plan_001"
}
stu... | 27.485714 | 77 | 0.66632 |
e98c0f1fa6b4b0f0319449cf5afff6b0b3c29eed | 1,367 | #
# Cookbook Name:: chef-odi-base
# Recipe:: default
#
# Copyright (C) 2014 The Open Data Institute
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... | 36.945946 | 72 | 0.776152 |
0819c92a0f9002792ee24508d41f1d7a3473d867 | 130 | class ChangeStartTimeToBigInt2 < ActiveRecord::Migration[5.2]
def change
add_column :routes, :start_time, :bigint
end
end
| 21.666667 | 61 | 0.761538 |
1aee184fe2c35e89ba3e5064eb4faa3cd8df308b | 12,021 | require "spec_helper"
require "ruby_utils/statistic"
require "wrf_forecast/threshold"
require "wrf_forecast/text"
describe WrfForecast::Text::TemperatureText do
describe ".new" do
context "given an array of temperature data for an ice day" do
it "generate and check temperature forecast text" do
te... | 56.70283 | 96 | 0.598536 |
abca4be679a1f1a5edb5839c139bcd19e15836b5 | 1,217 | class Editorconfig < Formula
desc "Maintain consistent coding style between multiple editors"
homepage "https://editorconfig.org/"
url "https://github.com/editorconfig/editorconfig-core-c/archive/v0.12.4.tar.gz"
sha256 "c2671595f1793b498cdf50b9dc03d632cc724891de7909f2ea78588fbffba289"
license "BSD-2-Clause"
... | 39.258065 | 106 | 0.762531 |
1c83232faa55fa417c87f271ce0a63fb46a80759 | 723 | module Postmarkdown
class InstallGenerator < Rails::Generators::Base
desc File.read(File.expand_path('../usage/install.txt', __FILE__)).gsub('{{CURRENT_DATE}}', Time.zone.now.strftime('%Y-%m-%d'))
source_root File.expand_path('../templates', __FILE__)
class_option :skip_example, :type => :boolean, :group ... | 36.15 | 131 | 0.692946 |
bbc39c5e31656876f69b85a2aa5d6ef779a741a2 | 499 | class Builder
attr_accessor :title, :date, :slug, :image, :lectures_path, :templates_path
def initialize(attributes)
attributes.each do |key, value|
send "#{key}=", value
end
end
def html
input = File.read source_file
lecture = Lecture.new input, title, date, image
lecture.render(... | 18.481481 | 77 | 0.669339 |
edcbf40b53e7ea0d17b47ddad2e689c0c1da83a3 | 3,255 | module RailsAdmin
module Config
# Model specific configuration object.
class Model
include RailsAdmin::Config::Proxyable
include RailsAdmin::Config::Configurable
include RailsAdmin::Config::Hideable
include RailsAdmin::Config::Sections
include RailsAdmin::Config::Inspectable
... | 34.263158 | 181 | 0.653149 |
21e7485737111b60da023ab65fcc9af2361eca6b | 543 | require 'lvm/wrapper'
require 'lvm/wrapper/pvs'
require 'lvm/physical_volume_helper'
module LVM
module Wrapper
module VGExtend
# Extend a LVM Volume Group.
# See vor vgextend command http://linux.die.net/man/8/vgextend
def vg_extend(volume_group, physical_volumes)
External.cmd(@server,... | 30.166667 | 174 | 0.736648 |
1aeaa1e9d252816ec1a5a498065c9af437465956 | 1,712 | # 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::CDN::Mgmt::V2020_09_01
module Models
#
# Defines the RemoteAddress condition for the delivery rule.
#
class DeliveryRuleRemo... | 26.338462 | 78 | 0.550234 |
26276ee7b117041ff54a6ad6e4248f16b25c742b | 4,451 | require 'opal'
require 'rack'
require 'opal/builder'
require 'opal/cli_runners'
module Opal
class CLI
attr_reader :options, :file, :compiler_options, :evals, :load_paths, :argv,
:output, :requires, :gems, :stubs, :verbose, :port, :preload,
:filename, :debug, :no_exit
def comp... | 27.81875 | 102 | 0.585037 |
6a241201e576fcfa45db5795c463badcc6538003 | 963 | class Pwgen < Formula
desc "Password generator"
homepage "https://pwgen.sourceforge.io/"
url "https://downloads.sourceforge.net/project/pwgen/pwgen/2.08/pwgen-2.08.tar.gz"
sha256 "dab03dd30ad5a58e578c5581241a6e87e184a18eb2c3b2e0fffa8a9cf105c97b"
bottle do
cellar :any_skip_relocation
sha256 "185f2f56e... | 37.038462 | 93 | 0.719626 |
d584806ac48acb27e9be9c06dddfbe90cc1341fe | 3,929 | # frozen_string_literal: true
require 'test_helper'
class LmcCloudTest < Minitest::Test
def setup
@lmc = LMC::Cloud.new 'example.com', 'user', 'papa', nil, false
end
def test_that_it_can_get_account_objects
cloud = LMC::Cloud.instance
accounts = cloud.get_accounts_objects
refute_empty accounts
... | 30.223077 | 177 | 0.640112 |
1c9f5a89cac594d0ce243754a063693a4084aa18 | 1,647 | require 'spec_helper'
module RailsBestPractices
module Reviews
describe MoveCodeIntoHelperReview do
let(:runner) { Core::Runner.new(reviews: MoveCodeIntoHelperReview.new('array_count' => 2)) }
it "should move code into helper" do
content = <<-EOF
<%= select_tag :state, options_for_se... | 41.175 | 135 | 0.555556 |
bbce767d30feb02f3008821323798bd858b7d2f1 | 703 | Pod::Spec.new do |s|
s.name = 'ObjectiveLibModbus'
s.version = '0.0.1'
s.license = 'GNU'
s.summary = 'Obj-C wrapper for libmodbus.'
s.homepage = 'https://github.com/iUtvikler/ObjectiveLibModbus'
s.author = { 'Lars-Jørgen Kristiansen' => 'LarsJK.84@gmail.com' }
s.source = { :git => 'https://gith... | 50.214286 | 118 | 0.671408 |
bb15f4f06d43741285a6afb42772accb5a7f93bf | 222 | namespace :create do
task user: :environment do
User.create(
email: ENV['email'],
password: ENV['password'],
first_name: 'Mary',
last_name: 'Poppins',
role: 'registered'
)
end
end
| 18.5 | 32 | 0.585586 |
03ca9b7a5746a6261d3d064d6ee19ceec97660de | 650 | require_relative '../spec_helper'
def expect_page_to_be_at_top
page.document.synchronize do |variable|
scroll_top = page.evaluate_script('$("html, body").scrollTop()')
raise Capybara::ElementNotFound, "Page is not at the top. Scroll top = #{scroll_top}" unless scroll_top == 0
end
end
feature 'JQuery Back ... | 29.545455 | 112 | 0.712308 |
b9401b1579c5c5e6615a068b47028b5847fd7f1d | 173 | module Serverspec::Type
class Ipfilter < Base
def has_rule?(rule)
@runner.check_ipfilter_has_rule(rule)
end
def to_s
'ipfilter'
end
end
end
| 14.416667 | 43 | 0.647399 |
3823bd94083229f5d1c60bbb9e06da374adc599f | 919 | # frozen_string_literal: true
module Types
module Tree
# rubocop: disable Graphql/AuthorizeTypes
# This is presented through `Repository` that has its own authorization
class BlobType < BaseObject
implements Types::Tree::EntryType
present_using BlobPresenter
graphql_name 'Blob'
... | 31.689655 | 90 | 0.67247 |
ac146441457816528d929a0bd713500c3b3b38c4 | 206 | <% module_namespacing do -%>
class <%= class_name %>Preview < ActionMailer::Preview
<% actions.each do |action| -%>
def <%= action %>
<%= class_name %>.<%= action %>
end
<% end -%>
end
<% end -%>
| 17.166667 | 54 | 0.567961 |
d58ff2f7ef02ef114355bed4e0790a5f24cf5ae0 | 11,391 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/talent/v4beta1/filters.proto
require 'google/protobuf'
require 'google/api/field_behavior_pb'
require 'google/cloud/talent/v4beta1/common_pb'
require 'google/protobuf/duration_pb'
require 'google/protobuf/field_mask_pb'
require 'google/... | 59.952632 | 183 | 0.755421 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.