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 |
|---|---|---|---|---|---|
01bd562f77c0bbdb442ed522bca7a0a173de31b1 | 56 | class Parties::RoleKind
include Mongoid::Document
end
| 14 | 27 | 0.803571 |
acb31d335e3effe734e825fbd12e8ccc535aef62 | 3,575 | # 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::Web::Mgmt::V2020_09_01
module Models
#
# Model object.
#
#
class AzureActiveDirectoryRegistration < ProxyOnlyResource
... | 28.6 | 80 | 0.46014 |
217b53e1ca588a0e6e8382c2c62f740cdf6e2351 | 250 | class CreateInspirationalQuotes < ActiveRecord::Migration[6.1]
def change
create_table :inspirational_quotes do |t|
t.string :quote
t.string :author
t.string :meaning
t.string :date
t.timestamps
end
end
end
| 19.230769 | 62 | 0.668 |
264692f9aabea0dd7bc935ab1719cb8e10df705a | 3,478 | require 'spec_helper'
describe Qa::Authorities::Getty::TGN do
let(:authority) { described_class.new }
describe "#build_query_url" do
subject { authority.build_query_url("foo") }
it { is_expected.to match(/^http:\/\/vocab\.getty\.edu\//) }
end
describe "#find_url" do
subject { authority.find_url("... | 36.229167 | 282 | 0.586544 |
333e46ae5329a0cdd73bd9c9d2f1f136b7aa5c36 | 3,083 | module SolidusSalePrices
module Spree
module PriceDecorator
def self.prepended(base)
base.has_many :sale_prices, dependent: :destroy
base.has_many :active_sale_prices, -> { merge(::Spree::SalePrice.active) }, class_name: '::Spree::SalePrice'
base.after_save :update_calculated_sale_pr... | 25.691667 | 116 | 0.628933 |
bb6aa2f78ac098ee6a6d989edd5fc974c30917f3 | 844 | # frozen_string_literal: true
class PipelineDetailsEntity < Ci::PipelineEntity
expose :project, using: ProjectEntity
expose :flags do
expose :latest?, as: :latest
end
expose :details do
expose :artifacts do |pipeline, options|
rel = pipeline.downloadable_artifacts
if Feature.enabled?(:no... | 31.259259 | 101 | 0.748815 |
d55eed0739d68a80c746d9d8ba0c2c6ab62da4bf | 795 |
# Configure Rails Envinronment
ENV["RAILS_ENV"] = "test"
ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require "rails/test_help"
ActionMailer::Base.delivery_method = :test
ActionMailer::Base.perform_deliveries = true
ActionMailer... | 24.84375 | 81 | 0.771069 |
796f9ca719b876efc855c18418f2a222429d43ae | 1,764 | require 'test_helper'
class UsersEditTest < ActionDispatch::IntegrationTest
def setup
@user = users(:jack)
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: "",
... | 32.072727 | 78 | 0.501134 |
87ea719b6a8661d401ec4cf58eee387a7b82583f | 13,762 | # encoding: UTF-8
require "csv"
module Jekyll
class Site
attr_reader :source, :dest, :config
attr_accessor :layouts, :pages, :static_files, :drafts,
:exclude, :include, :lsi, :highlighter, :permalink_style,
:time, :future, :unpublished, :safe, :plugins, :limit_posts,
... | 29.280851 | 89 | 0.62767 |
1cb12612616a49dbcfaa01e015baaf42dd152972 | 4,290 | require 'pycall/wrapper_object_cache'
module PyCall
module PyObjectWrapper
attr_reader :__pyptr__
def self.extend_object(obj)
pyptr = obj.instance_variable_get(:@__pyptr__)
unless pyptr.kind_of? PyPtr
raise TypeError, "@__pyptr__ should have PyCall::PyPtr object"
end
super
... | 23.189189 | 97 | 0.59697 |
ff447d24772554ca04886c4fac3c4de831505e2d | 461 | require 'set'
module BotManager
module Alexa
module Manifest
class PublishingOptions
attr_reader :distribution_countries
attr_accessor :is_available_worldwide, :testing_instructions, :category, :distribution_mode
def initialize
@distribution_countries = Set.new
... | 16.464286 | 99 | 0.67462 |
ffcb5a0109121c561e55f870adee9c94e28705b3 | 1,647 | # encoding: utf-8
class AvatarUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
storage :file
# storage :fog
# Override the directory where uploaded file... | 27 | 112 | 0.690953 |
e9d81bd4bed332d597c43c0b898897236c4aa054 | 2,343 | class ProtectedController < ApplicationController
before_action :login_required
protected
def login_required
if logged_in?
@account = Account.find(session[:account_id])
true
else
store_location
flash[:error] = "You must be logged in to the see this page."
redirect_to login_... | 21.897196 | 70 | 0.645327 |
01a09fa861d934e1346ed16dd4f4375986fdfc65 | 813 | class ProgressBar < Struct.new :log, :file_name, :total_units, :completed_units
TOTAL_BAR_LENGTH = 40.freeze
def print
log.print(header + bar + progress_text)
end
private
def header
"\r #{file_name}#{padding_after_file_name}"
end
def padding_after_file_name
' ' * (24 - file_name.size)
e... | 18.906977 | 79 | 0.686347 |
e85be4105d5bf1fe9ad94c600d9337998bfbcd17 | 2,110 | Pod::Spec.new do |s|
s.name = 'MWPhotoBrowser'
s.version = '2.1.3'
s.license = 'MIT'
s.summary = 'A simple iOS photo and video browser with optional grid view, captions and selections.'
s.description = <<-DESCRIPTION
MWPhotoBrowser can display one or more images or videos by providing eithe... | 42.2 | 106 | 0.699052 |
1d9557b5dc6755b0e9f82907da9458bb96329a09 | 151 | class AddUserIdToCategories < ActiveRecord::Migration[6.0]
def change
add_reference :categories, :user, null: false, foreign_key: true
end
end
| 25.166667 | 68 | 0.761589 |
215d2973b5703ac9442510943f660274f94b3d75 | 1,313 | =begin
#Selling Partner API for Catalog Items
#The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog.
OpenAPI spec version: v0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.26
=end
require 'spec_helper'
re... | 27.354167 | 117 | 0.751714 |
f80f4ce6cb4c5400320245d5d4834d8b1bdd6dbe | 826 | RSpec.feature "Session based flow navigation", flow_dir: :fixture do
scenario "User completes a flow" do
visit "/session-based/s"
choose "Response 1"
click_button "Continue"
fill_in "response", with: "Response"
click_button "Continue"
expect(page).to have_text("Results title")
end
scen... | 21.179487 | 68 | 0.684019 |
e821a2b7df11adff60febe500515ed92ba5b1491 | 330 | name 'pw_base'
maintainer 'Christoph Lukas'
maintainer_email 'christoph.lukas@gmx.net'
license 'All rights reserved'
description 'base cookbook to setup hosts file and name resolution'
long_description 'base cookbook to setup hosts file and name resolution'
version '0.2.0'
depe... | 33 | 72 | 0.70303 |
79129255bdb0b2c8bfb4dd0e70254ff730b34b41 | 321 | require "time"
require "date"
require "json"
require "yaml"
require "tmpdir"
require "pathname"
REPO_ROOT = Pathname.new(File.expand_path("../../../", __FILE__)).freeze
require_relative "util"
require_relative "deploy_doc_test"
require_relative "travis"
require_relative "find_changes"
require_relative "test_spawner"
... | 20.0625 | 72 | 0.778816 |
bf468c8ffeffc4254b8a7122e25c1d0df6d59389 | 1,064 | cask "gemini" do
version "2.7.1,357:1605619595"
sha256 "ce1fc36bed622a9419f7ecde0a3c671766bee87e8ec280c2e6c0c58700639aa3"
# dl.devmate.com/com.macpaw.site.Gemini was verified as official when first introduced to the cask
url "https://dl.devmate.com/com.macpaw.site.Gemini#{version.major}/#{version.after_comma.b... | 44.333333 | 191 | 0.739662 |
7a41fac58574d75a64b6334046f6921db3de672e | 155 | require File.expand_path('../../../spec_helper', __FILE__)
describe "MonitorMixin#mon_try_enter" do
it "needs to be reviewed for spec completeness"
end
| 25.833333 | 58 | 0.754839 |
f8416b0adc0932602f35b0b81c833e202402af09 | 43 | sprout_osx_apps_homebrew_cask "virtualbox"
| 21.5 | 42 | 0.906977 |
28874bc0f3ae565c89ea12b2101bcd4fdae4aac6 | 6,101 | #
# Author:: Adam Jacob (<adam@chef.io>)
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://... | 31.611399 | 115 | 0.720865 |
4aa4a2fa446b8c57e7e41ff7fc17be53b04fc618 | 157 | # frozen_string_literal: true
require 'moji_nested_hash/version'
require 'moji_nested_hash/hash/keys'
module MojiNestedHash
# Your code goes here...
end
| 17.444444 | 36 | 0.796178 |
1d1a8fe2ac1ac25f04b4c09762a44ec4777f3422 | 4,905 | Pod::Spec.new do |s|
s.name = 'FirebaseFirestore'
s.version = '8.3.0'
s.summary = 'Google Cloud Firestore'
s.description = <<-DESC
Google Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development.
... | 38.928571 | 135 | 0.683384 |
7a0c1aa93c1be76aab5fe2f58688d21f1367189a | 306 | # card_href is the stored href for the Card
# order_href is the stored href for the Order
card = Balanced::Card.fetch(card_href)
card.debit(
:amount => 5000,
:appears_on_statement_as => 'Statement text',
:description => 'Some descriptive text for the debit in the dashboard',
:order => order_href
) | 34 | 73 | 0.735294 |
3941bc6bf5c929636fed54fef50c0e7d53440a25 | 415 | RSpec.describe "Relaton Extract" do
describe "relaton extract" do
it "sends extract message to the extractor" do
allow(Relaton::Cli::RelatonFile).to receive(:extract)
command = %w(extract spec/fixtures ./tmp -x rxml)
Relaton::Cli.start(command)
expect(Relaton::Cli::RelatonFile).to have_r... | 29.642857 | 67 | 0.672289 |
911d56139d18fc7babad78688834f6e5a17fdca7 | 862 | module SessionsHelper
def log_in(user)
session[:user_id] = user.id
end
def current_user
if (user_id = session[:user_id])
@current_user ||= User.find_by(id: user_id)
elsif (user_id = cookies.encrypted[:user_id])
user = User.find_by(id: user_id)
if user && user.authenticated?(cookies... | 20.52381 | 62 | 0.669374 |
b91afd94ec93e7b5fdf734fd29f9149180d8b221 | 3,874 | include InstructorInterfaceHelperSpec
def create_assignment_questionnaire survey_name
visit '/questionnaires/new?model=Assignment+SurveyQuestionnaire&private=0'
fill_in 'questionnaire_name', with: survey_name
find('input[name="commit"]').click
end
def deploy_survey(start_date, end_date, survey_name)
login_as(... | 40.778947 | 122 | 0.744966 |
1c3225b21ee85c3e1c98bf1c21f4ccc1852c0ea7 | 284 | class CreateDanvanthiriCoreQuotations < ActiveRecord::Migration
def change
create_table :danvanthiri_core_quotations do |t|
t.integer :owner_id
t.string :owner_type
t.integer :pharmacy_id
t.string :photo
t.timestamps null: false
end
end
end
| 21.846154 | 63 | 0.707746 |
e86e5e924625cbcb1f8acd460c96b196d9dd7a02 | 159 | #!/usr/bin/ruby
=begin
Cette version se contente de recuperer le nom de l'utilisateur et de l'afficher directement
=end
user_name = gets.chomp
puts user_name | 22.714286 | 92 | 0.786164 |
6a264e733b4de8ac95b010f04e3842e164b6edb8 | 3,419 | require 'test_helper'
class UserTest < ActiveSupport::TestCase
def setup
@user = User.new(name: "Example User", email: "user@example.com", password: "foobar", password_confirmation: "foobar")
end
# 有効性に対するテスト
test "should be valid" do
assert @user.valid?
end
# 存在性の検証に対するテスト
test "name should b... | 28.491667 | 124 | 0.697865 |
1c842fc30764dba6058b01c6df0f7b587e00c9f7 | 28,069 | require "#{File.dirname(__FILE__)}/../abstract_unit"
silence_warnings do
Post = Struct.new(:title, :author_name, :body, :secret, :written_on, :cost)
Post.class_eval do
alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast)
alias_method :body_before_type_cast, :body unless ... | 39.038943 | 261 | 0.644091 |
f89395fccaf8fab6bea80801eb14cd0d4274ab43 | 44,119 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Git LFS API and storage' do
include LfsHttpHelpers
include ProjectForksHelper
include WorkhorseHelpers
let_it_be(:project, reload: true) { create(:project, :empty_repo) }
let_it_be(:user) { create(:user) }
context 'with projects' do
... | 36.341845 | 184 | 0.553775 |
038234e494136ad656254c99f28969ec87b19794 | 11,318 | require File.dirname(__FILE__) + '/../spec_helper'
require 'active_support/time'
Time.zone = 'Eastern Time (US & Canada)'
describe IceCube::Schedule, 'to_yaml' do
[:yearly, :monthly, :weekly, :daily, :hourly, :minutely, :secondly].each do |type|
it "should make a #{type} round trip with to_yaml - github issue ... | 39.852113 | 201 | 0.710108 |
bf3d8fc6d7fd931debd08b63f42ebdc3bf736aab | 5,461 | require 'cfndsl'
require 'digest/md5'
require 'cfnguardian/cloudwatch'
module CfnGuardian
module Stacks
class Resources
include CfnDsl::CloudFormation
attr_reader :template
def initialize(parameters,stack_id)
@stack_id = stack_id
@template = CloudFormation("Guardi... | 36.651007 | 142 | 0.598425 |
61c91694a3670570b8a1d91397365ffbf32561d7 | 2,708 | require 'renegade/branch_name'
require 'net/https'
require 'uri'
require 'nokogiri'
module Xambassador
# Update manifest after merge complete
class UpdateTitle
def initialize(connection, pull_request, action)
@connection = connection
@pull_request = pull_request
# only update newly opened req... | 26.811881 | 78 | 0.627031 |
28c249253f90bab5e25325a614dca3f3b998b13d | 2,500 | require 'spec_helper'
describe Automata::DFA do
context "Initializing from a valid file" do
before do
@dfa = Automata::DFA.new(file: 'examples/dfa_sample.yml')
end
it "should be valid" do
@dfa.should be_valid
end
it "should accept '00'" do
@dfa.accepts?('00').should... | 21.008403 | 63 | 0.4948 |
623478d094c1b24ef45f3af16723174c78018d0a | 355 | class Supplier < ActiveRecord::Base
default_scope { order('supplier_name') }
has_many :products, :dependent => :nullify
store :address, accessors: [ :name , :street , :city , :country , :phone ] #, coder: JSON
validates :supplier_name, :presence => true
def whole_address
[ name , street , city , coun... | 22.1875 | 91 | 0.659155 |
79284cf18443f75a3ebf31a8c88070739bac49f4 | 947 | # OK, that’s it for this lesson!
#
# ## Quick Review
#
# * We parsed an Avro schema, prepped some hashes to be compatible with that
# schema, serialized those hashes with that schema, and then produced those
# serialized hashes to a Kafka topic. Pretty rad!
#
# ## Links and Further Reading
#
# * How I Learned to St... | 36.423077 | 98 | 0.724393 |
1c0bd7c8fd52b50519c1160bf1530fe95248587e | 60 | class Mascot < ActiveRecord::Base
belongs_to :company
end
| 15 | 33 | 0.783333 |
1a1ff63d215b631b7046a3f092cee0a2dcf20968 | 3,247 | require 'tempfile'
require 'shellwords'
module Reviewit
class Action
def initialize(app, api)
@api = api
@linter = app.linter
inject_default_params(app) if app.action_name != 'config'
@options = self.class.parse_options
end
protected
NO_COLOR = "\033[0m"
RED = "\033[0;3... | 26.614754 | 121 | 0.635664 |
794e64d752e76940000e60c48e550a4f9780397e | 632 | name 'hadoop'
maintainer 'Cask Data, Inc.'
maintainer_email 'ops@cask.co'
license 'Apache 2.0'
description 'Installs/Configures Hadoop (HDFS/YARN/MRv2), HBase, Hive, Flume, Oozie, Pig, and ZooKeeper'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version ... | 30.095238 | 130 | 0.707278 |
0833a59b7992428ee523a0671e3648d608a64e8a | 217 | class DropViewsTable < ActiveRecord::Migration[5.1]
def up
drop_table :views
end
def down
create_table :views do |t|
t.references :article, foreign_key: true
t.timestamps
end
end
end
| 15.5 | 51 | 0.668203 |
33b03cb6afa126a15709b9670acd356d2c3f33b7 | 10,574 | #
# a language data file for Ruby/CLDR
#
# Generated by: CLDR::Generator
#
# CLDR version: 1.3
#
# Original file name: common/main/ar_DZ.xml
# Original file revision: 1.28 $
#
# Copyright (C) 2006 Masao Mutoh
#
# This file is distributed under the same license as the Ruby/CLDR.
#
private
def init_data
@hourfor... | 46.787611 | 217 | 0.693021 |
bb59d1042665ad3593e73b312c89d40f1f79ce0f | 2,299 | require File.dirname(__FILE__) + '/spec_helper'
describe "generating a random base32 secret" do
it "should be 16 characters by default" do
ROTP::Base32.random_base32.length.should == 16
ROTP::Base32.random_base32.should match /[a-z2-7].+/
end
it "should be allow a specific length" do
ROTP::Base32.ran... | 32.842857 | 117 | 0.69552 |
918bc45df9b52d5828bc5c6d39e255cbfe4c2cda | 993 | class Qd < Formula
desc "C++/Fortran-90 double-double and quad-double package"
homepage "https://crd.lbl.gov/~dhbailey/mpdist/"
url "https://crd.lbl.gov/~dhbailey/mpdist/qd-2.3.17.tar.gz"
sha256 "c58e276f6fcf5f2f442c525f3de42ea00004734572b29c74028bbda0ad81096d"
bottle do
cellar :any
sha256 "02f2e11ca... | 34.241379 | 92 | 0.736153 |
d5c96fb8ca17396eb10199303a0e0d46faebff14 | 115 | class HomeController < ApplicationController
before_action :authenticate_user!
def index
render
end
end
| 14.375 | 44 | 0.782609 |
f8c29ab1c017586510dfb1459f33a3c9bb1195a5 | 770 | require "rails_helper"
describe SendVaccinationCenterConfirmationEmailJob do
let!(:partner) { create(:partner) }
let!(:vaccination_center) { create(:vaccination_center, lat: 42, lon: 2, partner: partner) }
subject { SendVaccinationCenterConfirmationEmailJob.new.perform(vaccination_center.id) }
context "vacci... | 33.478261 | 126 | 0.754545 |
b9c8d61ac31441c7d05b552460b7b6a538392a03 | 254 | module ApplicationHelper
def full_title(page_title = '')
base_title = "Ruby on Rails Tutorial Sample App"
if page_title.empty?
base_title
else
page_title + " | " + base_title
end
end
end
| 21.166667 | 56 | 0.566929 |
e96b850747c202bea8bf5f7ef5cb4a9c189954ee | 1,478 | # frozen_string_literal: true
module RatingChgkV2
module Request
include RatingChgkV2::Connection
include RatingChgkV2::JsonHandler
def get(path, client, params = {})
respond_with(
connection(client).get(prepare(path), params),
client
)
end
def post(path, client, par... | 25.050847 | 91 | 0.632612 |
1ca5d9f950aa0671388dd62ddcf8952b1d6c2417 | 849 | module TD::Types
# Contains information about the total amount of data that was used to send and receive files.
#
# @attr file_type [TD::Types::FileType, nil] Type of the file the data is part of; pass null if the data isn't
# related to files.
# @attr network_type [TD::Types::NetworkType] Type of the netwo... | 49.941176 | 112 | 0.745583 |
9109eb72b99afd67b1951373e2ceff4fd19857ec | 158 | require 'bundler/setup'
require 'goroutine'
chan = Channel.new
go do
loop do
chan << :hello!
sleep 1
end
end
while chan.ready
p chan.pop
end
| 9.875 | 23 | 0.664557 |
1c97a5e914fdd4b5feaedca53f5f6d55548e8810 | 451 | Rails.application.routes.draw do
root'static_pages#home'
get '/help', to: 'static_pages#help'
get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact'
get '/signup', to: 'users#new'
post '/signup', to: 'users#create'
get '/login', to: 'sessions#new'
post '/login', to: 'sessi... | 32.214286 | 51 | 0.667406 |
1a0732c14b7a65db979717e8b463ad17873ba595 | 59,506 | # frozen_string_literal: true
require "cases/helper"
require "models/author"
require "models/bird"
require "models/post"
require "models/comment"
require "models/company"
require "models/contract"
require "models/customer"
require "models/developer"
require "models/computer"
require "models/invoice"
require "models/li... | 32.165405 | 126 | 0.739236 |
1d895d4229e367fbd020301fdb3d2a03bc65d145 | 3,105 | # -*- encoding: utf-8 -*-
require 'test_helper'
require 'hexapdf/configuration'
describe HexaPDF::Configuration do
before do
@config = HexaPDF::Configuration.new
@config['test'] = :test
end
it "can create a config based on the default one with certain values overwritten" do
config = HexaPDF::Config... | 33.031915 | 96 | 0.656039 |
08f63295665ab01345460f25e4fdc9695267f619 | 502 | class Number < ActiveRecord::Base
has_many :comments, dependent: :destroy
validates :digits, presence: true
validates_length_of :digits, is: 10, message: "must be 10 digits"
validates_uniqueness_of :digits
class << self
def clean_digits(digits)
digits.gsub(/\D/, '')
end
end
def scam_count... | 18.592593 | 67 | 0.64741 |
b98678e7c3c96079fa30a9b7cc3a59360997277e | 127 | # frozen_string_literal: true
RSpec.describe Fixably::User do
include_examples("a resource", "user", "users", %i[show])
end
| 21.166667 | 59 | 0.732283 |
033861012a3ee001b831a8f274e7e038b061e4c5 | 493 | module OData
class CollectionType < Type
attr_reader :member_type
def initialize(options = {})
super
@member_type = options[:member_type]
end
def valid_value?(value)
member_type.valid_value?(value)
end
def primitive_type?
OData::PrimitiveType === member_type
end
... | 15.903226 | 42 | 0.634888 |
797412853497f0d621ec6172356d8371820960d6 | 1,232 | class Rclone < Formula
desc "Rsync for cloud storage"
homepage "https://rclone.org/"
url "https://github.com/rclone/rclone/archive/v1.53.2.tar.gz"
sha256 "63c499cef3b216aa657b70ac8217b69f6b1925781d4d8881054194664462d4f1"
license "MIT"
head "https://github.com/rclone/rclone.git"
deprecate! because: "requi... | 35.2 | 93 | 0.732143 |
ab498a697b76d9ed3e79a69a258cfb775631c2a0 | 588 | cask 'universal-media-server' do
version '7.0.1'
sha256 'd1007d93c711d3c1788946add48792b83664bc41c6eea975604204c4a89c489d'
# sourceforge.net/unimediaserver was verified as official when first introduced to the cask
url "https://downloads.sourceforge.net/unimediaserver/Official%20Releases/OS%20X/UMS-#{version}.... | 39.2 | 102 | 0.789116 |
62e02d00b51ff35783b4c99888c03366e22b2ce9 | 4,451 | class SamplesController < ApplicationController
respond_to :html
include Seek::PreviewHandling
include Seek::AssetsCommon
include Seek::IndexPager
before_filter :samples_enabled?
before_filter :find_index_assets, only: :index
before_filter :find_and_authorize_requested_item, except: [:index, :new, :creat... | 31.34507 | 180 | 0.685464 |
21a028e351cc5c2cc17648942c0d349b379720e4 | 6,445 | class Environment < ActiveRecord::Base
# Used to generate random suffixes for the slug
LETTERS = 'a'..'z'
NUMBERS = '0'..'9'
SUFFIX_CHARS = LETTERS.to_a + NUMBERS.to_a
belongs_to :project, required: true, validate: true
has_many :deployments, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent... | 26.966527 | 89 | 0.69294 |
f8b9712c36a1b9f9c8e0537418974e58bbf9f164 | 1,932 | require "spec_helper"
module Pumi
RSpec.describe District do
describe ".all" do
it "returns all districts" do
results = District.all
expect(results.size).to eq(204)
expect(results.first).to be_a(District)
end
end
describe ".where" do
it "filters by id" do
... | 30.1875 | 69 | 0.624224 |
f8a61bc042a447a5a080f35ba06104c14ca33cd2 | 1,561 | #
# Be sure to run `pod lib lint FIDynamicViewController.podspec' to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# Any lines starting with a # are optional, but encouraged
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s... | 44.6 | 134 | 0.670724 |
ab217078abd3811141bc5235caf4e2454aff8f86 | 945 | class Exploitdb < Formula
desc "The official Exploit Database"
homepage "https://www.exploit-db.com/"
url "https://github.com/offensive-security/exploitdb.git",
:tag => "2019-07-18",
:revision => "40febc17ca38a0394c89786c2913546ab50f1f14"
version "2019-07-18"
head "https://github.com/offensiv... | 28.636364 | 77 | 0.65291 |
4a8eb9129621940948391e4e75e2ba59e54bcf3a | 299 | require "bcrypt"
class Login
def initialize(user_model)
@user_model = user_model || User
end
def user(email, password)
user = user_model.first(email: email)
user && BCrypt::Password.new(user.password_hash) == password ? user : nil
end
private
attr_reader :user_model
end
| 17.588235 | 77 | 0.698997 |
ed63ec0f00b85153c6bdb5e5d5956e52dbcc1fee | 130 | json.extract! group, :id, :name, :description, :icon, :user_id, :created_at, :updated_at
json.url group_url(group, format: :json)
| 43.333333 | 88 | 0.730769 |
1adf101744e1eabe871ae45283ed8decae964026 | 7,658 | require 'spec_helper'
describe Sidekiq::Status do
let!(:redis) { Sidekiq.redis { |conn| conn } }
let!(:job_id) { SecureRandom.hex(12) }
let!(:job_id_1) { SecureRandom.hex(12) }
let!(:unused_id) { SecureRandom.hex(12) }
let!(:plain_sidekiq_job_id) { SecureRandom.hex(12) }
let!(:retried_job_id) { SecureRand... | 38.873096 | 120 | 0.681118 |
33c6653cb46fa227f086087ffa4aac256165ec6d | 236 |
# Check that the installation was successfull
describe file('/usr/bin/blastn') do
it { should be_file }
it { should be_executable }
end
describe command('/usr/bin/blastn -version') do
its(:stdout) { should match(/2.4.0+/) }
end
| 21.454545 | 47 | 0.699153 |
ff721a598ea868ec967c4730e125c40af23d812b | 48 | require 'dependencies'
require 'uri_translator'
| 16 | 24 | 0.833333 |
26d9844c5df8c8658fd8f88cbcf9390b40e6281d | 289 | class CreatePaidTimeOffs < ActiveRecord::Migration
def change
create_table :paid_time_offs do |t|
t.integer :user_id
t.integer :sick_days_taken
t.integer :sick_days_earned
t.integer :pto_taken
t.integer :pto_earned
t.timestamps
end
end
end
| 20.642857 | 50 | 0.688581 |
9117f4ecf60f37977db80bb226dd9777e4cdb389 | 169 | class Appointment < ActiveRecord::Base
validates :appointment_time, :user, presence: true
belongs_to :user
end
#<%=appointment.date.strftime('%a, %b %d %Y')%> | 28.166667 | 54 | 0.692308 |
7a65eec942d7ff3c65335184c77e53f7dfd050f9 | 302 | service 'tomcat' do
service_name node['opsworks_java']['tomcat']['service_name']
case node[:platform_family]
when 'debian'
supports :restart => true, :reload => false, :status => true
when 'rhel'
supports :restart => true, :reload => true, :status => true
end
action :nothing
end
| 23.230769 | 64 | 0.665563 |
3826cd14f31045e961c11b44165d3b5df224b2e8 | 381 | class UnknownMedia < Media
attr_accessor :media_type
def initialize(media_type:)
@media_type = media_type
end
def valid?
false
end
def errors
{
error: [
{
name: "media_type",
description: "Unknown media type '#{media_type}'"
}
]
}
end
d... | 12.290323 | 59 | 0.559055 |
d5fc8336f03c28f29f208d37067cce216e94b543 | 999 | require 'spec_helper'
describe IssueTrackers::GitlabTracker do
it "should create an issue on Gitlab with problem params" do
notice = Fabricate :notice
tracker = Fabricate :gitlab_tracker, :app => notice.app
problem = notice.problem
number = 5
@issue_link = "#{tracker.account}/#{tracker.project_i... | 32.225806 | 109 | 0.693694 |
08cc79a1e6e1aa23658124c21aaddef6a452a929 | 1,496 | # frozen_string_literal: true
module SolargraphTestCoverage
# Some helper functions for the diagnostics
module ReporterHelpers
# @return [Hash]
def run_test(test_file)
ForkProcess.call do
Coverage.start(lines: true, branches: true)
runner = TestRunner.with(test_file).run!
extr... | 28.769231 | 88 | 0.620321 |
4acfa47d30bd339e026903e15b55960621a61426 | 2,021 | require "spec_helper"
describe Tabulo::Column do
subject do
Tabulo::Column.new(
align_body: :left,
align_header: :left,
extractor: extractor,
formatter: -> (n) { "%.2f" % n },
header: "X10",
header_styler: nil,
left_padding: 1,
index: 3,
padding_character: " ... | 29.720588 | 117 | 0.653142 |
6132d7a21edd99e84b39e69ae3a9aee6f3f9c666 | 1,878 | =begin
Copyright 2012-2013 inBloom, Inc. and its affiliates.
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... | 29.34375 | 109 | 0.761448 |
1a30d35dbeef699d84fcf694a0986c7bedde5a2a | 4,132 | Rabel::Application.routes.draw do
devise_for :users, :controllers => {:sessions => "sessions", :registrations => "registrations"}
get 'settings' => 'users#edit'
get 'member/:nickname' => 'users#show', :as => :member
get 'member/:nickname/topics' => 'users#topics', :as => :member_topics
post 'member/:nickname/... | 29.726619 | 97 | 0.63819 |
03c3ff25a195a8b2c3c20267760e2149ca40bb9c | 401 | module TelephoneNumber
class TimeZoneDataImporter
def self.load_data!
master_data = {}
File.open('data/timezones/map_data.txt', 'rb').each do |row|
number_prefix, timezone = row.split('|').map(&:strip)
master_data[number_prefix] = timezone
end
File.open('data/timezones/map... | 28.642857 | 97 | 0.650873 |
87f67cd17d5b7037b0a1b07af8c6778780e9098b | 7,758 | =begin
#NSX-T Manager API
#VMware NSX-T Manager REST API
OpenAPI spec version: 2.5.1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.19
=end
require 'date'
module NSXT
class SIPacketsDroppedBySecurity
# The packets dropped by \"Spoof Guard\"; supported packe... | 32.596639 | 157 | 0.651843 |
87950c396d79ba67920e7f54060733cb056ceaa6 | 1,751 | # Copyright (C) 2013-2015 Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This ... | 26.134328 | 80 | 0.697887 |
39027260fe898ca2eac0db6a6a2f798cad4ecfd5 | 9,065 | require 'spec_helper'
module Spree
describe Order do
let(:user) { create(:user) }
let!(:store_credit) { create(:store_credit, user: user, amount: 45.00, remaining_amount: 45.00)}
let(:line_item) { mock_model(LineItem, :variant => double('variant'), :quantity => 5, :price => 10) }
let(:order) { create... | 35.83004 | 155 | 0.655157 |
4abaf1aec7d814e7f577877ec2e91c3dc10d0076 | 341 | class CreateServerProfileUserAccesses < ActiveRecord::Migration
def self.up
create_table :server_profile_user_accesses do |t|
t.integer :server_profile_id
t.integer :user_id
t.string :role, :default => 'reader'
t.timestamps
end
end
def self.down
drop_table :server_profile_use... | 21.3125 | 63 | 0.718475 |
3863bbeb41d844896bdde6492484786daf91b476 | 501 | class Users::SessionsController < Devise::SessionsController
# before_action :configure_sign_in_params, only: [:create]
# GET /resource/sign_in
# def new
# super
# end
# POST /resource/sign_in
# def create
# super
# end
# DELETE /resource/sign_out
# def destroy
# super
# end
# prot... | 19.269231 | 69 | 0.694611 |
b9c8d54ec45e7635f1b1a92880a713158c475e00 | 593 | # Ruby Sample program from www.sapphiresteel.com
module MagicThing
def m_power
return @power
end
def m_power=(aPower)
@m_power=aPower
end
end
module Treasure
attr_accessor :value
attr_accessor :insurance_cost
end
class Weapon
attr_accessor :deadliness
attr_accessor :power
end
c... | 14.825 | 50 | 0.703204 |
f8c363ad44c2fde025d87d3dcd60050625facc1f | 9,733 | # typed: false
# frozen_string_literal: true
require "test/support/fixtures/testball"
require "cleanup"
require "cask/cache"
require "fileutils"
using Homebrew::Cleanup::CleanupRefinement
describe Homebrew::Cleanup::CleanupRefinement do
describe "::prune?" do
alias_matcher :be_pruned, :be_prune
subject(:p... | 26.44837 | 96 | 0.660536 |
bf5dba2e57b21a6b1c21c269be852e933a32454c | 1,578 | require 'spec_helper_acceptance'
describe 'Identity - Group' do
let(:acl_manifest) do
<<-MANIFEST
file { '#{target_parent}':
ensure => directory
}
file { '#{target_parent}/#{target_file}':
ensure => file,
content => '#{file_content}',
require => File['#{target_... | 32.204082 | 318 | 0.667934 |
911daab0949f2882d4961569260cea33793c97fd | 7,127 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Geo::ContainerRepositorySync, :geo do
let_it_be(:group) { create(:group, name: 'group') }
let_it_be(:project) { create(:project, path: 'test', group: group) }
let_it_be(:container_repository) { create(:container_repository, name: 'my_image', pro... | 43.723926 | 194 | 0.68458 |
7a2474dc20e509b4cb9264c03d6af60368eec894 | 4,041 | require 'test_helper'
module ActsAsAuthenticTest
class LoginTest < ActiveSupport::TestCase
def test_login_field_config
assert_equal :login, User.login_field
assert_nil Employee.login_field
User.login_field = :nope
assert_equal :nope, User.login_field
User.login_field :login
a... | 36.080357 | 174 | 0.715912 |
79a407c6d2ed134f647c66589fb5ffe3b45391f8 | 123 | require 'test_helper'
class CceReportTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 15.375 | 45 | 0.707317 |
610fa65d62dcfc45057085f5e283d3fc25d4270a | 826 | class Game_BattlerBase
def rec; check_for_zombie ? sparam(2) * -1 : sparam(2); end
def check_for_zombie; @states.any? {|st| $data_states[st].zombie}; end
end
class RPG::State < RPG::BaseItem
ZOMB = /\[zombie\]/i
attr_reader :zombie
def set_zombie
return if @zombie_check; @zombie_check = true
@zom... | 19.666667 | 72 | 0.639225 |
1c738bce777179dbd94efc38433a9f3ca78e5fc0 | 4,588 | require 'pathname'
Puppet::Type.newtype(:dsc_xdatabaselogin) do
require Pathname.new(__FILE__).dirname + '../../' + 'puppet/type/base_dsc'
require Pathname.new(__FILE__).dirname + '../../puppet_x/puppetlabs/dsc_type_helpers'
@doc = %q{
The DSC xDatabaseLogin resource type.
Automatically generated from
... | 29.792208 | 124 | 0.661072 |
6210ab624716c67e26fdac219655b8e44d867185 | 173 | class AddUserVoterId < ActiveRecord::Migration
def self.up
add_column :users, :voter_id, :integer
end
def self.down
remove_column :users, :voter_id
end
end
| 17.3 | 46 | 0.722543 |
8723b8981fd4e7cd441414e4462b671bca0d1b76 | 1,899 | module Fastlane
module Actions
module SharedValues
FIV_BUILD_IONIC_ANDROID_CUSTOM_VALUE =
:FIV_BUILD_IONIC_ANDROID_CUSTOM_VALUE
end
class FivBuildIonicAndroidAction < Action
def self.run(params)
isProd = params[:isProd]
if (isProd)
sh 'ionic cordova build and... | 26.013699 | 90 | 0.551869 |
61bab1c68a00c2913ede8c3d9a12ba6ad10ba7ec | 3,375 | # -*- encoding: utf-8 -*-
# stub: loofah 2.2.0 ruby lib
Gem::Specification.new do |s|
s.name = "loofah".freeze
s.version = "2.2.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Mike Dalessio".free... | 47.535211 | 115 | 0.622222 |
6afa6c1264c4cec5381668ed0a0ff114550e0c95 | 980 | module DockerCloud
class Stack < DockerCloud::Type
def name
info[:name]
end
def state
info[:state]
end
def synchronized
info[:synchronized]
end
# def services; info[:services]; end
def services
if @services.nil?
@services = []
info[:services].... | 14.202899 | 59 | 0.570408 |
01434c78e127676fd5d93c740e9d78569086eb82 | 2,957 | # frozen_string_literal: true
describe Facter::FactManager do
describe '#resolve_facts' do
it 'resolved all facts' do
ubuntu_os_name = double(Facts::Debian::Os::Name)
user_query = []
loaded_fact_os_name = double(Facter::LoadedFact, name: 'os.name', klass: ubuntu_os_name, type: :core)
loa... | 39.959459 | 111 | 0.666554 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.