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 |
|---|---|---|---|---|---|
ed7b929f1af94529ff53ca6471e508cc66d605cc | 140 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_cirqueue_session'
| 35 | 78 | 0.807143 |
33a9cfce68d1062e3f7c1932510006f50f0de1a8 | 3,057 | class JobsController < ApplicationController
before_action :set_job, only: [:show, :edit, :update, :destroy, :upvote, :renew]
before_action :authenticate_user!, only: [:new, :create, :edit, :update, :destroy]
before_action :check_owner_logged_in, only: [:edit, :update, :destroy, :renew]
# GET /jobs
# GET /jo... | 24.261905 | 108 | 0.641806 |
f8308c03f6557295dc4316c82c6bcced526844cd | 484 | class UserRole < ActiveRecord::Base
belongs_to :user
validates :user_id, :presence => true
validate :valid_role
attr_accessible :user_id, :role
audited associated_with: :user
default_scope order(:role)
self.per_page = 100
def role_sym
role.to_sym
end
def role_obj
Role[role_sym]
end
... | 14.666667 | 54 | 0.677686 |
4a02190f535e530513f95cdf87e68ae9ee907254 | 138 | # This will guess the User class
FactoryBot.define do
factory :story do
name 'bob'
last_used Time.now
current true
end
end | 17.25 | 32 | 0.702899 |
21f3979edee7bc6d69db7a02fc15f8abbbd05ec1 | 6,781 | # 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... | 40.60479 | 245 | 0.694735 |
e2709d3f7be4973a8aea151d64bd1744bfb34a54 | 4,294 | module PagSeguro
class TransactionRequest
include Extensions::MassAssignment
include Extensions::EnsureType
include Extensions::Credentiable
# Set the payment currency.
# Defaults to BRL.
attr_accessor :currency
# Get the payment sender.
attr_reader :sender
# Set and get primary... | 25.86747 | 94 | 0.674662 |
bf7b1e3b3ce0ed67e393fdc16fd3bd552d400051 | 11,133 | #!/usr/bin/env ruby
# Generated by the protocol buffer compiler. DO NOT EDIT!
# make sure 'gem install ruby-protocol-buffers' at first.
# https://rubygems.org/gems/ruby-protocol-buffers
require 'protocol_buffers'
module GtReq
# forward declarations
class GtAuth < ::ProtocolBuffers::Message; end
class GtAuthResul... | 27.8325 | 78 | 0.690919 |
d595be4a26a3bb2f60624f0873c6170437a8ac61 | 302 | # Just a placeholder at the moment to give us the constant name
module Realm
module EventStore
class UnknownAggregateRootError < RuntimeError
def initialize(uuid)
@uuid = uuid
end
def message
"Unknown AggregateRoot: #{@uuid.inspect}"
end
end
end
end | 21.571429 | 63 | 0.662252 |
2620438dad96c994b815f7b093f2a8bef2b4c931 | 291 | module Sidekiq
module CustomQueue
class ClientMiddleware
def call(worker_class, msg, queue, _redis_pool)
worker = worker_class.constantize
msg['queue'] = worker.custom_queue(msg).to_s if worker.respond_to?(:custom_queue)
yield
end
end
end
end
| 24.25 | 89 | 0.680412 |
030e87acbf5497eec96ec6b7ee6e7841506de1e3 | 1,491 | require "inventory_refresh/save_collection/recursive"
require "inventory_refresh/save_collection/topological_sort"
module InventoryRefresh
class SaveInventory
class << self
include Logging
# Saves the passed InventoryCollection objects
#
# @param ems [ExtManagementSystem] manager owning ... | 36.365854 | 120 | 0.702213 |
33f1850cd1c627ab4806f0a064926378faf0abce | 96 | json.user do
json.id @user.id
json.username @user.username
json.email @user.email
end | 19.2 | 30 | 0.697917 |
bff48e8b52aeff93245394c7c42ab53ca0c52ed9 | 1,074 | # frozen_string_literal: true
require 'spec_helper'
describe Gitlab::ImportExport::DesignRepoSaver do
describe 'bundle a design Git repo' do
let_it_be(:user) { create(:user) }
let_it_be(:design) { create(:design, :with_file, versions_count: 1) }
let!(:project) { create(:project, :design_repo) }
let(... | 28.263158 | 82 | 0.684358 |
1ad3600abf8750d7e0dff014980f699ecf01a620 | 816 |
module Ebay # :nodoc:
module Requests # :nodoc:
# == Attributes
# text_node :category_site_id, 'CategorySiteID', :optional => true
# text_node :category_parent, 'CategoryParent', :optional => true
# numeric_node :level_limit, 'LevelLimit', :optional => true
# boolean_node :view_all_nodes, 'Vi... | 37.090909 | 87 | 0.6875 |
6160696fd0deb881389f64c9af3056c7aeed7b0f | 522 | name 'golang'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
license 'Apache-2.0'
description 'Installs go programming language'
source_url 'https://github.com/sous-chefs/golang'
issues_url 'https://github.com/sous-chefs/golang/issues'
chef_version '>= 14.... | 24.857143 | 62 | 0.676245 |
e2ab7a0928efcbf24503f73c3055071a5d3f4145 | 5,492 | require 'stb/solvers/djikstra_solver'
require 'stb/solvers/guitar_notes_solver'
require 'stb/music/sheet'
require 'stb/util/graph'
class SheetSolver
def initialize(sheet, guitar)
@sheet = sheet.dup
@guitar = guitar.dup
@gns = GuitarNotesSolver.new(@guitar)
solve()
end
def proposed_solution()
... | 27.188119 | 118 | 0.62236 |
62620f9f84b0418cbcafd413f37c7c33902d150c | 26,161 | # frozen_string_literal: true
require "test_helper"
require "database/setup"
class ActiveStorage::ManyAttachedTest < ActiveSupport::TestCase
include ActiveJob::TestHelper
setup do
@user = User.create!(name: "Josh")
end
teardown do
ActiveStorage::Blob.all.each(&:delete)
end
test "attaching exist... | 41.198425 | 127 | 0.725737 |
0837395b5f972c7b3881fb18599197b3d873d948 | 1,574 | require 'spec_helper'
require 'puppet/util/profiler'
describe Puppet::Util::Profiler::AroundProfiler do
let(:child) { TestAroundProfiler.new() }
let(:profiler) { Puppet::Util::Profiler::AroundProfiler.new }
before :each do
profiler.add_profiler(child)
end
it "returns the value of the profiled segment" ... | 25.387097 | 93 | 0.681703 |
d504b1cbb64237d38808ec6175ab4f66c60c73af | 1,105 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe ConversionPolicy do
subject { described_class.new user, record }
let(:record) { build :conversion }
context 'for a guest' do
let(:user) { nil }
it { is_expected.to forbid_action :index }
it { is_expected.to forbid_action :create ... | 25.697674 | 50 | 0.693213 |
115515a2ad465317c2e8971f2bee3da16cb5b2f6 | 156 | class AddDefaultValueToLoanRequestForContributed < ActiveRecord::Migration
def change
change_column_default :loan_requests, :contributed, 0
end
end
| 26 | 74 | 0.826923 |
1890566946a6203e156e79e94ba23b51d487d935 | 4,106 | # frozen_string_literal: true
require 'spec_helper'
describe 'Option Types', type: :feature do
stub_authorization!
before do
visit spree.admin_path
click_nav 'Products'
end
context 'listing option types' do
it 'lists existing option types' do
create(:option_type, name: 'tshirt-color', pres... | 35.704348 | 92 | 0.69508 |
035b45ec99a1468c563db4c4d4c64781da84c36d | 617 | describe :array_clone, shared: true do
it "returns an Array or a subclass instance" do
[].send(@method).should be_an_instance_of(Array)
ArraySpecs::MyArray[1, 2].send(@method).should be_an_instance_of(ArraySpecs::MyArray)
end
it "produces a shallow copy where the references are directly copied" do
a ... | 29.380952 | 89 | 0.67423 |
2813af3c7615d5c5bd6ffa5a8d7d992ba4d32401 | 2,843 | #---
# Excerpted from "Rails 4 Test Prescriptions",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose.
# Visit ... | 37.906667 | 104 | 0.706296 |
ffbc0da9792d456ee4841265b8e8b360b5b3d3d1 | 77 | @members.each do |member|
json.set! member.id, member.profile.full_name
end | 25.666667 | 47 | 0.766234 |
4ab0def7d920041f82927a34a75969c0aa5dae37 | 2,248 | # Since lesson #8 is on methods, you will be writing the entire method.
# To gain more familiarity, look up the documentation for each hint.
# Remember to unskip the corresponding tests one at a time.
# method name: #ascii_translator
# parameter: number (an integer)
# return value: the number's ASCII character (https... | 29.973333 | 79 | 0.731762 |
bf353c66201903306849774f637bc8b2faa1a980 | 7,399 | module Fastlane
class ActionsList
def self.run(filter: nil, platform: nil)
require 'terminal-table'
if filter
show_details(filter: filter)
else
print_all(platform: platform)
end
end
def self.print_all(platform: nil)
rows = []
all_actions(platform) do |a... | 34.574766 | 142 | 0.611029 |
28e71742b31b2405157d6dbb30eb86d326103bb4 | 104 | default["buffer-overflow"]["deploy-path"] = "/opt/listener"
normal['apt']['compile_time_update'] = true | 34.666667 | 59 | 0.711538 |
384f308269ab55469f9d06ac0c7bbb08957e2ea4 | 1,564 | # frozen_string_literal: true
class NotificationSettingsController < ApplicationController
before_action :authenticate_user!
def create
return render_404 unless can_read?(resource)
@notification_setting = current_user.notification_settings_for(resource)
@saved = @notification_setting.update(notificat... | 27.438596 | 104 | 0.75 |
4aedbb8d6275b4e11f178dbd90e6b0ecec3a860c | 28,986 | #
# Author:: Hans Chris Jones <chris.jones@lambdastack.io>
# Cookbook:: ceph
#
# Copyright:: 2017-2021, Bloomberg Finance L.P.
#
# 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.a... | 36.277847 | 162 | 0.678879 |
87379470065f35ed63f2cd6610696689edae1c13 | 246 | class UserMailer < Mailer
def signup_notification(user)
setup_email(user)
@subject = "Your AMEE monthly calculator account"
@body[:url] = root_url(:host => current_host)
@body[:password] = user.password
end
end | 30.75 | 62 | 0.658537 |
1d552f296116580f2f5db6b700d3661047a36ed2 | 128 | require 'spec_helper'
include NSConnector
describe Customer do
it 'should not explode on creation' do
Customer.new
end
end
| 14.222222 | 39 | 0.789063 |
aba6c02198514739ed0e10b7e935bfbd93f849d3 | 1,379 | # These tasks can be used to quickly make nginx redirect all traffic to
# a maintenance page.
# Maintenance file locations
set :enabled_maintenance, -> { "#{full_current_path}/public/maintenance.html" }
set :disabled_maintenance, lambda {
"#{full_current_path}/public/maintenance_disabled.html"
}
# This task is the ... | 25.072727 | 79 | 0.662799 |
e980d358682d6d2d57e8d6275280cb05c5b9fed2 | 1,539 | require File.expand_path('../test_helper', File.dirname(__FILE__))
class ViewHooksTest < ActionDispatch::IntegrationTest
def test_hooks_rendering
CmsAdmin::SitesController.append_view_path(File.expand_path('../fixtures/views', File.dirname(__FILE__)))
ComfyPress::ViewHooks.add(:navigation, '/nav_hook')
... | 34.977273 | 109 | 0.757635 |
5ddbbf34096935a8ffa323cafaf17daea39b5696 | 483 | 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 SpkAhp
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specif... | 30.1875 | 82 | 0.761905 |
1ddb9452710922c15ae7a3fd7f9c4550dc1ef69c | 107 | Rails.application.routes.draw do
namespace :api do
resources :posts, except: [:new, :edit]
end
end
| 17.833333 | 43 | 0.700935 |
f7f792044ee17904b3b9525e92b25a6f0529bed0 | 750 | name 'teamcity'
maintainer 'Roblox'
maintainer_email 'info@roblox.com'
license 'Apache-2.0'
description 'Installs TeamCity server and agent'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '4.2.2'
source_url 'https://github.com/Roblox/chef-teamc... | 28.846154 | 73 | 0.7 |
036220e1a65ceb1e5ea9985ff4f3dddf6acd5855 | 181 | FactoryGirl.define do
factory :default_news_organisation_image_data do
file { File.open(File.join(Rails.root, 'test', 'fixtures', 'minister-of-funk.960x640.jpg')) }
end
end
| 30.166667 | 97 | 0.745856 |
ac1adb2c5184b9ae26ba44d5df2d578b19f972b2 | 4,036 | # encoding: utf-8
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/whois.nic.sn/status_registered.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec_helper'
require 'whoi... | 33.081967 | 96 | 0.695243 |
389465af45be55b3ab3fc86ddcc898a870882e45 | 741 | class Entry < ActiveRecord::Base
attr_accessor :slim_error
validates :slim,
slim: {
allow_blank: true
}
validates :slim_no_options,
slim: {
to: :html,
allow_blank: true
}
validates :slim_proc,
slim: {
options: {pretty: false},
to: ->(record, result) {
... | 16.466667 | 32 | 0.558704 |
21ff1311507db549fef96a8c558541a9a9437ded | 2,366 | class Ccache < Formula
desc "Object-file caching compiler wrapper"
homepage "https://ccache.dev/"
url "https://github.com/ccache/ccache/releases/download/v4.3/ccache-4.3.tar.xz"
sha256 "504a0f2184465c306826f035b4bc00bae7500308d6af4abbfb50e33a694989b4"
license "GPL-3.0-or-later"
head "https://github.com/ccac... | 36.4 | 122 | 0.64497 |
1cc5b6b1a5d64609480f684f7fb0941f7ebe250c | 149 | class Spree::Stockist < ActiveRecord::Base
enum region: [ "North America", "International" ]
default_scope { order('region, position') }
end
| 16.555556 | 51 | 0.697987 |
6acff4d3619dca069133225ddd75f134ac3032aa | 167 | class ReviewSerializer < ActiveModel::Serializer
attributes :id, :content, :taste, :smell, :look, :feel, :rating, :beer_id
belongs_to :user
belongs_to :beer
end
| 27.833333 | 75 | 0.736527 |
6a83eb96e07f6415b84c2c04b15b1bdcb2c5d925 | 177 | class CreateHolidays < ActiveRecord::Migration[5.0]
def change
create_table :holidays do |t|
t.string :name
t.date :date
t.timestamps
end
end
end
| 16.090909 | 51 | 0.644068 |
1d84195d3faf97865bce45189e8ed04450f4b7ca | 518 | module Spree
class LocaleController < Spree::StoreController
def set
session['user_return_to'] = request.referer if request.referer&.starts_with?('http://' + request.host)
if params[:locale] && I18n.available_locales.map(&:to_s).include?(params[:locale])
session[:locale] = I18n.locale = params... | 34.533333 | 108 | 0.675676 |
bf907d59145263a7aa437ac7b038601b1174b411 | 275 | # Enforce UTF-8 Encoding
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
require 'forwardable' unless defined? Forwardable
# Init global driver
$driver = nil
require_relative 'appium_lib/logger'
require_relative 'appium_lib/driver'
| 22.916667 | 49 | 0.814545 |
1808a54149893322f1a8da80da430c79e8e70329 | 239 | # frozen_string_literal: true
class AddReadAtToDependencyProxyBlobs < Gitlab::Database::Migration[1.0]
def change
add_column :dependency_proxy_blobs, :read_at, :datetime_with_timezone, null: false, default: -> { 'NOW()' }
end
end
| 29.875 | 111 | 0.757322 |
acdbd26c77c5136f013932751c0a3689882c1ed1 | 8,770 | module SpecInfra
module Command
class Windows
class NotSupportedError < Exception; end
REGISTRY_KEY_TYPES = {
:type_string => 'String',
:type_binary => 'Binary',
:type_dword => 'DWord',
:type_qword => 'QWord',
:type_multistring => 'Mul... | 34.392157 | 209 | 0.58301 |
7af3268f5c57afaf533ba82a5f6f027594297f15 | 1,040 | require File.expand_path('../lib/version', __FILE__)
Gem::Specification.new do |s|
s.name = 'update_xcode_plugins'
s.version = UpdateXcodePlugins::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ['Mahdi Bchetnia']
s.email = ['injekter@gmail.com'] # Real email is on my website ;)
... | 45.217391 | 141 | 0.628846 |
7a917a4f27d8b469bb28ba284f27b263d64bac62 | 30,361 | #
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
# 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
#
# ... | 30.030663 | 130 | 0.646125 |
d57e74c457b6b49065deeaac5e2c03e05da66d00 | 880 | # frozen_string_literal: true
require_relative 'config'
require_relative 'calendar'
require_relative 'database'
require_relative 'parser'
def main
config = Config.new(File.dirname(__FILE__) + '/config.toml')
cal_conf = config.calendar_conf
calendar = Calendar.new(create_gcal(cal_conf),
... | 29.333333 | 72 | 0.646591 |
62709a5a7d73bb86b94c31a5654661559afc4acd | 3,845 | # Copyright © 2011 Sattvik Software & Technology Resources, Ltd. Co.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
#... | 41.793478 | 89 | 0.780494 |
79b049e1b51fe8d49e6045808d86d652dae7b73d | 2,912 | class Prestodb < Formula
desc "Distributed SQL query engine for big data"
homepage "https://prestodb.io"
url "https://search.maven.org/remotecontent?filepath=com/facebook/presto/presto-server/0.229/presto-server-0.229.tar.gz"
sha256 "5b52c207bde5a0dc3c812fad4847001b8ce88de0e17f561d4f1734751c637164"
bottle :u... | 28.271845 | 126 | 0.655563 |
d5609600b108cf73a99882cf1b38ed2ef4edff1c | 564 | module Curator
class Railtie < Rails::Railtie
initializer "railtie.configure_rails_initialization" do |app|
Curator.configure(:riak) do |config|
config.bucket_prefix = app.class.name.split("::").first.underscore
config.environment = Rails.env
config.migrations_path = Rails.root.join(... | 31.333333 | 74 | 0.657801 |
6263d503d2cb24efd1c71a4bc36c66f02cc8b415 | 2,380 | set :stage, :staging
set :branch, :master
server "ort-staging.linode.unep-wcmc.org", user: "wcmc", roles: %w{app web db}
set :domain, "demo-ort.ort-staging.linode.unep-wcmc.org"
set :server_name, "#{fetch(:application)}.#{fetch(:domain)}"
set :sudo_user, "wcmc"
set :app_port, "80"
# server-based syntax
# =====... | 30.512821 | 88 | 0.670588 |
01f9fc17bc2862679bc5e2cadbf7e8973860629b | 417 | cask 'vuescan' do
version '9.5.84'
sha256 '7187b58a0c0bc86c73bb2bf3ecb01f4e0264ed2f8d9efced4e370e4bb3aeb1ae'
url "https://www.hamrick.com/files/vuex64#{version.major_minor.no_dots}.dmg"
appcast 'https://www.hamrick.com/old-versions.html',
checkpoint: '5cb317c34f55aac7d9b6d82913da74e621290053dbac6a77b... | 32.076923 | 88 | 0.769784 |
ff9c3df793a953b0f110e42dab2b192e86f39ab8 | 355 | # frozen_string_literal: true
class ProjectMemberPresenter < MemberPresenter
private
def admin_member_permission
:admin_project_member
end
def update_member_permission
:update_project_member
end
def destroy_member_permission
:destroy_project_member
end
end
ProjectMemberPresenter.prepend_i... | 17.75 | 66 | 0.814085 |
39fb98e19d2eb09993bc5634cd6713b8e3fffa46 | 654 | # Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require "rails/test_help"
require "rails_admin_data_quality"
Rails.backtrace_cleaner.remove_silencers!
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require... | 25.153846 | 88 | 0.770642 |
b9f9e3fd674337f15289e4413dd477d934b34066 | 66 | json.partial! 'api/v1/models/note.json.jbuilder', resource: @note
| 33 | 65 | 0.757576 |
61c5dde391c79d99a7c05dd433d2744ca9474ad6 | 92 | class AddImageToUsers < ActiveRecord::Migration[6.1]
add_column :users, :image, :text
end
| 23 | 52 | 0.76087 |
1c62b8745e25d9198a5b3ca96c648b8d690001e9 | 2,858 | require 'azure_generic_resources'
class AzureRoleDefinitions < AzureGenericResources
name 'azure_role_definitions'
desc 'Verifies settings for a collection of Azure Roles'
example <<-EXAMPLE
describe azure_role_definitions do
its('names') { should include('role') }
end
EXAMPLE
attr_reader :tab... | 34.02381 | 111 | 0.717985 |
e84f4b9bb24a8c41b146d736a92624f58101d8c0 | 1,118 | require 'test_helper'
class UsersIndexTest < ActionDispatch::IntegrationTest
def setup
@admin = users(:michael)
@non_admin = users(:archer)
end
# test "index including pagination" do
# log_in_as(@user)
# get users_path
# assert_template 'users/index'
# assert_select 'div.pagination'
... | 26 | 67 | 0.66458 |
e99aa3295ad5779fefa5fadabc73209c3c8baa4d | 57 | class Album < ApplicationRecord
belongs_to :artist
end
| 14.25 | 31 | 0.807018 |
7afbd96186c674dd56736159530e9d54f2dffa16 | 3,021 | # This formula tracks 1.0.2 branch of OpenSSL, not the 1.1.0 branch. Due to
# significant breaking API changes in 1.1.0 other formulae will be migrated
# across slowly, so core will ship `openssl` & `openssl@1.1` for foreseeable.
class Openssl < Formula
desc "SSL/TLS cryptography library"
homepage "https://openssl.... | 33.94382 | 93 | 0.710692 |
7986c919f11af4d54b1b47fb29c34aa69286ebb0 | 3,819 | require 'test_helper'
class RemoteCheckoutTest < Test::Unit::TestCase
def setup
@gateway = ActiveMerchant::Billing::CheckoutGateway.new(fixtures(:checkout))
@credit_card = credit_card(
'4543474002249996',
month: '06',
year: '2017',
verification_value: '956'
)
@declined_card = ... | 29.152672 | 107 | 0.726106 |
617179b5a56ec7f7bf9de11ecc363c28b556464f | 798 | require 'formula'
class Cdecl < Formula
desc "Turn English phrases to C or C++ declarations"
homepage 'http://cdecl.org/'
url 'http://cdecl.org/files/cdecl-blocks-2.5.tar.gz'
sha1 '3fb349970859dfd32a7fb502cecbd3c6d8656af1'
def install
# Fix namespace clash with Lion's getline
inreplace "cdecl.c", "g... | 25.741935 | 66 | 0.58396 |
1c6c45fcbb644621697fc3e4bbb4a252c022d9fa | 2,229 | require 'dwolla'
class DashboardController < ApplicationController
# Generally, it is best to handle errors in every function for every case,
# however, given that this is a toy application and we will only throw API errors,
# it is ok to do this.
rescue_from Dwolla::DwollaError, :with => :rescue_dwolla_errors
... | 30.121622 | 127 | 0.68865 |
edb1dd78f9796a7dc2fbfe90aee802d0501f756a | 678 | module Utils
module LocaleHelpers
def stringify_values(hash)
hash.each { |k, v| hash[k] = v.to_s(true) }
end
def title_for(action, hash={})
stringify_values(hash)
I18n.t("titles.#{action}", hash).capitalize
end
def caption_for(field, hash={})
stringify_values(hash)
... | 20.545455 | 50 | 0.625369 |
33da481cae76482727142fb5fc5fb133eaf00818 | 1,934 | require 'spec_helper'
describe SeriesStatementRelationshipType do
#pending "add some examples to (or delete) #{__FILE__}"
fixtures :all
describe 'validates' do
describe 'uniquness' do
context 'when display_name is unique' do
subject { FactoryGirl.build(:series_statement_relationship_type, :dis... | 42.043478 | 118 | 0.656153 |
f8dacccde4c45cdc8f060bdd533862ce2ec347f5 | 226 | # Spree::OptionType.create!([
# {
# :name => "tshirt-size",
# :presentation => "Size",
# :position => 1
# },
# {
# :name => "tshirt-color",
# :presentation => "Color",
# :position => 2
# }
# ])
| 17.384615 | 31 | 0.446903 |
6af1ec5d8120528898cadef2a17faef36aeb9be7 | 69 | class SurveyController < ApplicationController
def index
end
end
| 13.8 | 46 | 0.811594 |
18ec6cdf7cecf4ea4abcf0c07dd36e5b9a5c4984 | 413 | # print_annotation: print all annotations in the given file
require 'simple_bioc'
if ARGF.argv.size < 1
puts "usage: ruby print_annotation.rb {filepath}"
exit
end
collection = SimpleBioC::from_xml(ARGF.argv[0])
collection.documents.each do |d|
d.passages.each do |p|
p.sentences.each do |s|
s.annotati... | 22.944444 | 59 | 0.675545 |
acf928df980992fe40973b5ad5a62544ba1448da | 2,684 | Pod::Spec.new do |s|
s.name = 'BJLiveUI'
s.version = '1.5.0'
s.summary = 'BJLiveUI SDK.'
s.description = 'BJLiveUI SDK for iOS.'
s.homepage = 'http://www.baijiayun.com/'
s.license = 'MIT'
s.author = { 'MingLQ' => 'minglq.9@gmail.com' }
s.platfo... | 41.292308 | 123 | 0.592399 |
bb292d1f6363036b088df51f52c832eee44a0569 | 239 | class LogmeinClient < Cask
url 'https://secure.logmein.com/welcome/labs/LogMeInIgnition.dmg'
homepage 'https://secure.logmein.com/products/pro/learnmore/desktopapp.aspx'
version 'latest'
no_checksum
link 'LogMeIn Client.app'
end
| 29.875 | 78 | 0.774059 |
e9b4ed9555d10107d4660ce5e581451ec8a24e3c | 5,654 | # Class that defines the execution of each test in a generic manner
require 'yaml'
require 'nokogiri'
require_relative 'Testbase.rb'
class Runner
@@report=Hash.new
#Collect excution test cases
def get_execution_set(collect_hash,group)
if group
execution_cases=Hash.new
collect_hash.each do |res... | 29.14433 | 168 | 0.545278 |
ed5ba5b2161c6251a3a9f91e94cc5b30e8d0952d | 687 | require "cie/ruby-saml/validation_error"
module Cie
module Saml
module ErrorHandling
attr_accessor :errors
# Append the cause to the errors array, and based on the value of soft, return false or raise
# an exception. soft_override is provided as a means of overriding the object's notion of
... | 24.535714 | 99 | 0.653566 |
f8e7711959a2955d068b0fee492252d4ae23ac4d | 15,312 | # frozen_string_literal: true
module IssuablesHelper
include GitlabRoutingHelper
def sidebar_gutter_toggle_icon
content_tag(:span, class: 'js-sidebar-toggle-container', data: { is_expanded: !sidebar_gutter_collapsed? }) do
sprite_icon('chevron-double-lg-left', css_class: "js-sidebar-expand #{'hidden' un... | 30.746988 | 235 | 0.703174 |
4a6b22b5ff699a6c48fad148a259dff98ed0e9e0 | 18,036 | module ProjectsHelper
include Gitlab::CurrentSettings
def link_to_project(project)
link_to [project.namespace.becomes(Namespace), project], title: h(project.name) do
title = content_tag(:span, project.name, class: 'project-name')
if project.namespace
namespace = content_tag(:span, "#{proje... | 29.567213 | 183 | 0.690563 |
87316378ba346b3e665a099c9ea975f50c9ad0ae | 6,389 | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# This cop checks for duplicated instance (or singleton) method
# definitions.
#
# @example
#
# # bad
#
# def duplicated
# 1
# end
#
# def duplicated
# ... | 28.909502 | 79 | 0.539678 |
389d580cb2945c5ce5d5b9379fdf4d833c2aa368 | 2,567 | # encoding: utf-8
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
# This file is generated by the Ruby Holiday gem.
#
# Definitions loaded: definitions/rs_cyrl.yaml
class Rs_cyrlDefinitionTests < Test::Unit::TestCase # :nodoc:
def test_rs_cyrl
assert_equal "Нова Година", (Holidays.on(Date.... | 54.617021 | 109 | 0.634982 |
e969da74b903962c03930f3dfdc620dd401832a3 | 6,608 | # frozen_string_literal: true
# #Medical Network Professional Claims v3
#
# Reference for developers
#
# OpenAPI spec version: v3
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
# Swagger Codegen version: 2.4.19
#
require 'date'
module ChangeHealthcare
module ProfessionalClaims
module Swag... | 31.466667 | 92 | 0.557809 |
4a0b7f1f22c4632fec7e6b90d2d8dff8f4c02b82 | 40,757 | # 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::Polly
module Types
# @note When making an API call, you may... | 34.924593 | 526 | 0.634517 |
612653f5a53c13c815c3b2e90bfaf85d75e89ed3 | 2,209 | # encoding: utf-8
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/whois.nic.design/design/status_available.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec_helper'
req... | 22.313131 | 79 | 0.66727 |
1a5a640aa886e601ee87a9e061dc2762ceefd325 | 207 | class Micropost < ActiveRecord::Base
belongs_to :user
default_scope -> { order(created_at: :desc) }
validates :user_id, presence: true
validates :content, presence: true, length: { maximum: 140 }
end | 34.5 | 62 | 0.729469 |
1a7b4132a41d572b0fd4b1b2abde9e8a88390037 | 843 | cask "logitech-presentation" do
version "1.62.2"
sha256 "ca08be8c52cd40251c4a39bf2536b962aabb26ba7df26729cfc44c3abcacf9cd"
url "https://download01.logi.com/web/ftp/pub/techsupport/presentation/LogiPresentation_#{version.major_minor_patch}.dmg",
verified: "download01.logi.com/web/ftp/pub/techsupport/present... | 36.652174 | 123 | 0.733096 |
b9516a786274b2243cbecf1de99801d43ebd477e | 1,247 | # frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Define an application-wide content security policy
# For further information see the following documentation
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
Rails.application.config.content... | 40.225806 | 107 | 0.790698 |
619a08d485c5e5bd721e2e6556f46f69d4a95b22 | 111 | class Review < ApplicationRecord
belongs_to :user
belongs_to :book
validates :title, presence: true
end
| 18.5 | 35 | 0.765766 |
4a19e60ec8cf10c3df3c2800008900e829cbbda4 | 1,104 | require 'active_support/core_ext/module/delegation'
module Paperclip
class AbstractAdapter
OS_RESTRICTED_CHARACTERS = %r{[/:]}
attr_reader :content_type, :original_filename, :size
delegate :binmode, :binmode?, :close, :close!, :closed?, :eof?, :path, :rewind, :unlink, :to => :@tempfile
alias :length... | 21.230769 | 110 | 0.65942 |
f7e426379db1af42058d95f8b5c9e5b92a2ad500 | 342 | class CreateTransactions < ActiveRecord::Migration[6.0]
def change
create_table :transactions do |t|
t.references :user, null: false, foreign_key: true, column: :author_id
t.references :group, null: false, foreign_key: true, column: :group_id
t.string :name
t.float :amount
t.timesta... | 26.307692 | 76 | 0.681287 |
388dbe89a7044ec6c2f1404502297830eb610081 | 2,135 | require_relative '../helper'
module ACRONYM
end
class Project
def self.bo0k
Bo0k
end
end
class Book
class TableOfContents; end
def tableof_contents
TableofContents
end
class Page
def tableof_contents
TableofContents
end
def self.tableof_contents
TableofContents
end
... | 26.6875 | 80 | 0.76534 |
39b650734779eaf20dfd3971c4613710badff1fd | 1,889 | # frozen_string_literal: true
module RuboCop
module Cop
# Enforces the use of 'class_methods' instead of 'module ClassMethods' for activesupport concerns.
# For more information see: https://gitlab.com/gitlab-org/gitlab-foss/issues/50414
#
# @example
# # bad
# module Foo
# extend ... | 25.527027 | 118 | 0.624669 |
bb2b459a30903669ddbddccb756fb72eb0503e0b | 1,195 | class Intltool < Formula
desc "String tool"
homepage "https://wiki.freedesktop.org/www/Software/intltool"
url "https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz"
sha256 "67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd"
license "GPL-2.0"
bottle do
cellar :any_... | 41.206897 | 93 | 0.775732 |
b9584482508786de42688e99c6c76b2613a4b4e8 | 177 | # frozen_string_literal: true
# Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_dummy-railties_session'
| 29.5 | 84 | 0.80791 |
e213b518ac9d48c851434dcacf629d1aa21e3c87 | 984 | module Merb
module Rack
class StreamWrapper
# :api: private
def initialize(body)
@body = body
end
# :api: private
def each(&callback)
if Proc === @body
@writer = lambda { |x| callback.call(x) }
@body.call(self)
elsif @body.is_a?(St... | 19.294118 | 51 | 0.473577 |
01e5c5508ccda7a9d0b26bfb2f8dbc01d60ebfe4 | 6,613 | # 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_03_01
module Models
#
# Defines values for VirtualMachineSizeTypes
#
module VirtualMachineSizeTypes
BasicA0 = "Basi... | 36.738889 | 70 | 0.683956 |
61ae4581886926c27b13e98f874049697c01cd2e | 3,501 | module KatelloApi
module Resources
class AuthSourceLdap < KatelloApi::Base
def self.doc
@doc ||= KatelloApi.doc['resources']["auth_source_ldaps"]
end
# @param [Hash] params a hash of params to be passed to the service
# @option params [String] page paginate results
# @opti... | 40.709302 | 82 | 0.615824 |
01f026c7116f4f4e490f20e76fb8bcb611dd6020 | 3,985 | # frozen_string_literal: true
require 'rumale/base/splitter'
module Rumale
module ModelSelection
# StratifiedKFold is a class that generates the set of data indices for K-fold cross-validation.
# The proportion of the number of samples in each class will be almost equal for each fold.
#
# @example
... | 39.85 | 118 | 0.661481 |
e9b432b2cd47cd14bb1afcfa0337d5eca913c7ea | 27 | module FukaListsHelper
end
| 9 | 22 | 0.888889 |
f7a5446608e33c9cbb59256734bce9c1bf617b59 | 148 | require './spec/cases/helper'
results = Parallel.map(Array.new(20), :in_processes => 20) do
`lsof | grep pipe | wc -l`.to_i
end
puts results.max
| 21.142857 | 61 | 0.689189 |
26d7e0277cc9bddcdf9a449a67e8b95bba2bd77f | 7,284 | # Author:: Christopher Brown (<cb@chef.io>)
# Author:: Daniel DeLeo (<dan@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 obta... | 35.705882 | 142 | 0.65129 |
5d8576b2bb14c3d097bc5719fb53c2cb2b3905cc | 153 | # frozen_string_literal: true
FactoryGirl.define do
factory :bid do
auction
bidder factory: :user
price Random.rand(100..10_000)
end
end
| 17 | 34 | 0.718954 |
875ec5146529ec7dd5df4f4bdc0d4e46d53dbf5b | 3,791 | require "resource_support/aws/aws_singular_resource_mixin"
require "resource_support/aws/aws_backend_base"
require "aws-sdk-ec2"
class AwsEbsVolume < Inspec.resource(1)
name "aws_ebs_volume"
desc "Verifies settings for an EBS volume"
example <<~EXAMPLE
describe aws_ebs_volume('vol-123456') do
it { sho... | 29.617188 | 248 | 0.680032 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.