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 |
|---|---|---|---|---|---|
b94a08548a5a6ad6bfd07a7ee4f74fece6c86c91 | 1,180 | class AppeditrequestsController < ApplicationController
before_action :auth_user?
def index
respond_to do |format|
format.json { render :json => AppEditRequest.featured }
format.html
end
end
def show
@edit_request = AppEditRequest.find(params[:id])
@app = App.find(@edit_request.app... | 28.095238 | 83 | 0.70678 |
ed084c8f55113c41d1b373470a6ddb88a2b35b3e | 821 | class AnnotationText < ApplicationRecord
belongs_to :user, foreign_key: :creator_id
# An AnnotationText has many Annotations that are destroyed when an
# AnnotationText is destroyed.
has_many :annotations, dependent: :destroy
belongs_to :annotation_category, optional: true, counter_cache: true
validates_... | 25.65625 | 73 | 0.729598 |
bf75c463006a8c931edd756b111de07b661cf763 | 737 | require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
unless ENV['BEAKER_provision'] == 'no'
hosts.each do |host|
# Install Puppet
if host.is_pe?
install_pe
else
install_puppet
end
end
end
RSpec.configure do |c|
# Project root
proj_root = File.expand_path(Fil... | 23.774194 | 100 | 0.68521 |
1d9212ae328bf9817655558dea338ac18851fc12 | 90 | puts "WARNING: ruby19 has been removed require 'cap_recipes/tasks/ruby/install' instead."
| 45 | 89 | 0.8 |
e9a5877f4f1b6005c6a421c36fe474b84ed2c17f | 913 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'alipass/version'
Gem::Specification.new do |spec|
spec.name = "alipass"
spec.version = Alipass::VERSION
spec.authors = ["HungYuHei"]
spec.email = ["kongruxi@g... | 33.814815 | 74 | 0.644031 |
628dd241cdf41f07424b2e6a9c3c1b404f30a348 | 6,661 | =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.7
=end
require 'date'
module NSXT
class MirrorDestination
# Resource types of mirror destination
attr_accessor :resource_... | 29.736607 | 150 | 0.632037 |
ffbeface46b8d5ecb7a7eff894ebcd67fab33e73 | 1,333 | # 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... | 32.512195 | 111 | 0.67817 |
2837e9a8b2dbf924985da75c764afef88d58b486 | 1,142 | # frozen_string_literal: true
class V1::Ui::Tests::WebhooksController < V1::Ui::Tests::ApplicationController
attr_reader :webhook
WEBHOOKS = %w[
product_created
product_updated
shadow_product_updated
].freeze
rescue_from V1::Webhook::Error do |e|
logger.error "Translating #{e.class} -> HttpEr... | 27.190476 | 80 | 0.71979 |
b97738f495f0033bf1ae3fcf3ebfc4dad8cd4a7f | 11,119 | module TransamFormatHelper
# Include the fiscal year mixin
include FiscalYear
include ActionView::Helpers::NumberHelper
# Formats text as as HTML using simple_format
def format_as_text(val, sanitize=false)
simple_format(val, {}, :sanitize => sanitize)
end
# Formats a user name and provides message ... | 30.463014 | 182 | 0.642684 |
bf3f8eb6ee8f2762fa26e9257c82bc0a6cba5ad1 | 2,615 | # frozen_string_literal: true
require_relative 'helper'
# ruby -w -Itest test/cluster_client_internals_test.rb
class TestClusterClientInternals < Minitest::Test
include Helper::Cluster
def test_handle_multiple_servers
100.times { |i| redis.set(i.to_s, "hogehoge#{i}") }
100.times { |i| assert_equal "hogeh... | 26.958763 | 120 | 0.648566 |
61e329981fff71c900c961e9f998156a267d53ac | 673 | # frozen_string_literal: true
require "cmd/shared_examples/args_parse"
describe "Homebrew.outdated_args" do
it_behaves_like "parseable arguments"
end
describe "brew outdated", :integration_test do
it "outputs JSON" do
setup_test_formula "testball"
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
expect... | 23.206897 | 49 | 0.616642 |
fff16dd0b97ca61845ea1ce619f6790eee65c99d | 408 | class CreateFormgenForms < ActiveRecord::Migration
def change
create_table :formgen_forms do |t|
t.string :title
t.string :path
t.string :email
t.timestamps
end
create_table :formgen_questions do |t|
t.references :form
t.string :value
t.string :language
t.... | 18.545455 | 50 | 0.642157 |
1db9f7057cec5b846e3179c506ec97bf9a96cb78 | 3,293 | # frozen_string_literal: true
require ::File.expand_path("../../test_helper", __FILE__)
module Telnyx
class MessagingProfileTest < Test::Unit::TestCase
should "be listable" do
messaging_profiles = Telnyx::MessagingProfile.list
assert_requested :get, "#{Telnyx.api_base}/v2/messaging_profiles"
a... | 44.5 | 99 | 0.728515 |
79ee6c126f60e702c987df47126525ae3386097f | 6,589 | require 'spec_helper'
describe API::Variables do
let(:user) { create(:user) }
let(:user2) { create(:user) }
let!(:project) { create(:project, creator_id: user.id) }
let!(:master) { create(:project_member, :master, user: user, project: project) }
let!(:developer) { create(:project_member, :developer, user: us... | 33.617347 | 120 | 0.668235 |
216dea19ff20bfb0d826eb79cd04f52677d5bc03 | 213 | # frozen_string_literal: true
class DeployBuild < ActiveRecord::Base
belongs_to :deploy, inverse_of: :deploy_builds
belongs_to :build, inverse_of: :deploy_builds
end
Samson::Hooks.load_decorators(DeployBuild)
| 30.428571 | 48 | 0.816901 |
edf961ec9a61e45ef0ead55aa85047981522b745 | 1,175 | # encoding: utf-8
require 'test_helper'
module Adapi
class ConfigTest < Test::Unit::TestCase
context "Loading adapi.yml" do
should "load the configuration" do
Adapi::Config.dir = 'test/fixtures'
Adapi::Config.filename = 'adapi.yml'
@settings ... | 34.558824 | 94 | 0.628936 |
e80d6eed590d9234a6f98c90d6458743984068ed | 471 | if defined?(Motion::Project::Config)
lib_dir_path = File.dirname(File.expand_path(__FILE__))
Motion::Project::App.setup do |app|
app.files.unshift(Dir.glob(File.join(lib_dir_path, 'linkify-it-rb/**/*.rb')))
app.files_dependencies File.join(lib_dir_path, 'linkify-it-rb/index.rb') => File.join(lib_dir_path,... | 26.166667 | 126 | 0.70913 |
8715c5ad20852e8aec481efabf5cc6ffc443775f | 2,266 | require 'test_helper'
class PasswordResetsTest < ActionDispatch::IntegrationTest
def setup
ActionMailer::Base.deliveries.clear
@user = users(:michael)
end
test "password resets" do
get new_password_reset_path
assert_template 'password_resets/new'
#メールアドレスが無効
post password_resets_pat... | 34.861538 | 72 | 0.664166 |
b9ac4375cc802cbdf706e1da545d68acf06ec3ce | 4,684 | class UpdateTimesToUtc < ActiveRecord::Migration
# The current times in the database are saved in local time.
# We currently perform no translation for display purposes.
# However, we will begin translating for display, so we need
# to fix the times in the database.
def up
update_times :+
end
def do... | 41.087719 | 117 | 0.582195 |
d5ebd077247768b153d624e4922d83f6eb1ab1b8 | 1,898 | class User < ActiveRecord::Base
include Twittable
has_many :feeds, :order => :title, :dependent => :destroy
has_many :entries, :through => :feeds, :order => 'entries.published DESC'
has_and_belongs_to_many :projects, :order => 'projects.name'
validates_presence_of :name
validates_format_of :email,... | 35.148148 | 121 | 0.717597 |
1cd6ac16e1c0382345ec0cd597e48345fefcb3b9 | 1,134 | cask 'clamxav' do
if MacOS.release <= :tiger
version '2.2.1'
sha256 'e075b21fe5154f31dcbde86e492531c87c67ab44ad75294d3063f32ae1e58278'
elsif MacOS.release <= :leopard
version '2.5.1'
sha256 '02a7529c74d11724e2d0e8226ac83a0d3cfb599afb354d02f6609632d69d9eb1'
else
version '2.8.9'
sha256 'd0a7... | 29.076923 | 90 | 0.698413 |
f79fffb9c01a39c5cea629f7f0d9542758356a82 | 869 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rubygems/backup/version'
Gem::Specification.new do |spec|
spec.name = 'rubygems-backup'
spec.version = Rubygems::Backup::VERSION
spec.authors = ['Eric Henderson']
spe... | 36.208333 | 74 | 0.647871 |
ab03468091a0a72c7b526ed510aa4dfc23574465 | 5,337 | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
require 'kaitai/struct/struct'
unless Gem::Version.new(Kaitai::Struct::VERSION) >= Gem::Version.new('0.9')
raise "Incompatible Kaitai Struct Ruby API: 0.9 or later is required, but you have #{Kaitai::Struct::VERSION}"... | 24.149321 | 112 | 0.6187 |
38af260a834903945cb901273f8ad1fc0a017b1a | 2,406 | require 'test_helper'
describe User do
let(:auth_hash) {
{
provider: 'google',
uid: '12345',
info: {
name: 'Stub User',
email: 'stub.user@example.org',
image: 'http://example.org/image.jpg',
}
}
}
it 'can be created from an auth hash' do
user = User.f... | 27.655172 | 79 | 0.673317 |
6a019ace5a306da6d63b05497db7d1630d8b40c6 | 42 | module Searchkick
VERSION = "4.1.0"
end
| 10.5 | 19 | 0.690476 |
1d95f165ec1adaec373ebc333f65ee1eeda75120 | 497 | module ACH
module Records
class Record
@fields = []
class << self
def fields
@fields
end
end
extend(FieldIdentifiers)
attr_accessor :case_sensitive
def to_ach
to_ach = self.class.fields.collect { |f| send("#{f}_to_ach") }.join('')
c... | 17.75 | 79 | 0.565392 |
4a91cdb1415408763b7dcbf4f71b07da7f5922ed | 4,111 | # This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require it in any
# file... | 46.715909 | 92 | 0.740696 |
5deb10c8c12e9ddbf7f7f734290966e5f52e1162 | 759 | # frozen_string_literal: true
# Copyright 2022 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 applicabl... | 28.111111 | 74 | 0.745718 |
33d805f034fb7c68f90f17338559bc54882bf32d | 603 | require 'cfn-nag/violation'
require_relative 'base'
class SnsTopicPolicyWildcardPrincipalRule < BaseRule
def rule_text
'SNS topic policy should not allow * principal'
end
def rule_type
Violation::FAILING_VIOLATION
end
def rule_id
'F18'
end
def audit_impl(cfn_model)
logical_resource_ids... | 20.793103 | 79 | 0.746269 |
e2d9b9d19152b237d86ba51877c249871ee0e3d1 | 5,503 | require 'rails_helper'
describe Profile do
let(:user) { create(:user, :signed_up, password: 'a really long sekrit') }
let(:another_user) { create(:user, :signed_up) }
let(:profile) { create(:profile, user: user) }
let(:dob) { '1920-01-01' }
let(:ssn) { '666-66-1234' }
let(:pii) do
Pii::Attributes.new_... | 28.661458 | 95 | 0.676177 |
e2fe7f7a5741ce2454536ae1554297154bc3eee6 | 1,929 | # -*- encoding: us-ascii -*-
require File.expand_path('../../../../spec_helper', __FILE__)
describe "Enumerator::Lazy#initialize" do
before :each do
@receiver = receiver = Object.new
def receiver.each
yield 0
yield 1
yield 2
end
@uninitialized = enumerator_class::Lazy.allocate
... | 30.140625 | 104 | 0.688958 |
4a4dd2cb4afe76e220b1746affb04929be3f8e9e | 11,520 | require 'Menu'
require 'Menu_domitory'
require 'net/http'
class JBNUFoodParser
def requestHTML_Mobile(pageID,day)
uri = URI(URI.encode("http://appdev.jbnu.ac.kr/include/subPage.php?pageID=" + pageID + "&yoil=" + day))
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.... | 27.105882 | 117 | 0.451476 |
4ae47e3334aec8b9b8533201ede0eb08e2bd4d78 | 263 | class CreateServices < ActiveRecord::Migration[5.0]
def change
create_table :services do |t|
t.string :name, null: false
t.integer :organization_id, null: false
t.timestamps
end
add_foreign_key :services, :organizations
end
end
| 21.916667 | 51 | 0.692015 |
bff9ecd35b481a458a73e5654c095098a7fa0cb6 | 9,611 | require 'spec_helper'
describe Travis::Yml::Web::App, 'POST /configs' do
include Rack::Test::Methods
let(:app) { described_class }
let(:status) { last_response.status }
let(:headers) { last_response.headers }
let(:body) { Oj.load(last_response.body, symbol_keys: true) }
let(:data) { { repo: rep... | 30.034375 | 162 | 0.522214 |
2169978f45535c06ecce0e6e6ef7f333b698c30f | 2,626 | class PatroniHelper < BaseHelper
include ShellOutHelper
DCS_ATTRIBUTES ||= %w(loop_wait ttl retry_timeout maximum_lag_on_failover max_timelines_history master_start_timeout).freeze
DCS_POSTGRESQL_ATTRIBUTES ||= %w(use_pg_rewind use_slots).freeze
attr_reader :node
def ctl_command
"#{node['package']['ins... | 24.773585 | 126 | 0.633283 |
0350564a63336531ae1a62f428be4246f94cc5c6 | 396 | require 'net/http'
param_operation = "square"
param_value = 100 # Square size in pixels.
image_url = "http://images.rethumb.com/image_coimbra_600x300.jpg"
image_filename = "resized-image.jpg"
Net::HTTP.start("api.rethumb.com") do |http|
resp = http.get("/v1/#{param_operation}/#{param_value}/#{image_url}")
op... | 28.285714 | 73 | 0.699495 |
bf19cb268bad7b02668b7d9ff49f1e385040359e | 226 | describe 'Semaphore addon - template' do
it 'creates the Dockerfile.web' do
expect(file('Dockerfile.web')).to exist
end
it 'creates the Dockerfile.worker' do
expect(file('Dockerfile.worker')).to exist
end
end
| 22.6 | 46 | 0.712389 |
014cec4bba413d92b6d211fd6168bb17be4f635f | 801 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = 'ReactNativeToast'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.homepage = ... | 33.375 | 118 | 0.55181 |
033576bd3f99e0520d72ece4e1cfc63a641379c3 | 734 | class SignInTokenForm
include ActiveModel::Model
attr_accessor :email_address, :token, :identifier
validates :email_address,
presence: { message: 'Enter an email address in the correct format, like name@example.com' },
length: { minimum: 2, maximum: 1024, message: 'Email address must be ... | 34.952381 | 135 | 0.720708 |
1d8934989263ae1336f7a2c12918128a39377328 | 360 | cask 'ibackup-viewer' do
version '4.1100'
sha256 '27880d2871dd42d056d5f26cbf5bcb9342c30dde100daaa6adf61e97c5e24bbb'
url 'https://www.imactools.com/download/iBackupViewer.dmg'
appcast 'https://www.imactools.com/update/ibackupviewer.xml'
name 'iBackup Viewer'
homepage 'https://www.imactools.com/iphonebackupv... | 30 | 75 | 0.783333 |
214a2769114ad77d86b158d2b118a8903b6f256b | 320 | # encoding utf-8
# Copyright (c) Universidade Federal Fluminense (UFF).
# This file is part of SAPOS. Please, consult the license terms in the LICENSE file.
class RenameReportConfigurationShowSapos < ActiveRecord::Migration
def change
rename_column :report_configurations, :show_sapos, :signature_footer
end
end
| 32 | 84 | 0.79375 |
397bc49b8df57620e0b0399b21f49edeacf7d710 | 1,326 | class Sassc < Formula
desc "Wrapper around libsass that helps to create command-line apps"
homepage "https://github.com/sass/sassc"
url "https://github.com/sass/sassc.git",
tag: "3.6.1",
revision: "46748216ba0b60545e814c07846ca10c9fefc5b6"
head "https://github.com/sass/sassc.git"
bottle do
... | 30.837209 | 93 | 0.684012 |
623cfa9afa27eba7a9a5936a4eb7fa2378fa0dc4 | 3,223 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Before type cast' do
describe '#attributes_before_type_cast', config: { timestamps: false } do
let(:klass) do
new_class do
field :admin, :boolean
end
end
it 'returns original attributes value' do
obj = klass.n... | 24.233083 | 75 | 0.627986 |
287e5eef217ab52e8315d6af20c0ce7ae13ff8bb | 5,776 | require 'rails_helper'
RSpec.describe Computacenter::OutgoingAPI::CapUpdateRequest do
let(:response_body) { 'response body' }
let(:trust) { create(:trust, :manages_centrally) }
let(:school_1) { create(:school, responsible_body: trust, computacenter_reference: '01234567') }
let(:school_2) { create(:school, resp... | 44.775194 | 466 | 0.687846 |
bfd9a72c9487e41794c54bc7799dcd3cd365f0be | 673 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# 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 a... | 35.421053 | 74 | 0.756315 |
212d9851856a5961ad1a93372e01c5e066629e16 | 893 | class Gleam < Formula
desc "✨ A statically typed language for the Erlang VM"
homepage "https://gleam.run"
url "https://github.com/lpil/gleam/archive/v0.7.1.tar.gz"
sha256 "cab8daf5f7f6ffbf1d43b3d188690f9b01bf8faf7ad4fee4811648502a1a1301"
bottle do
cellar :any_skip_relocation
sha256 "13b302bb841848da6... | 30.793103 | 93 | 0.737962 |
e25d2a35a6183e79fb3bf989c95b28598b831fa4 | 2,997 | # frozen_string_literal: true
module QC
module Setup
Root = File.expand_path("../..", File.dirname(__FILE__))
SqlFunctions = File.join(Root, "/sql/ddl.sql")
CreateTable = File.join(Root, "/sql/create_table.sql")
DropSqlFunctions = File.join(Root, "/sql/drop_ddl.sql")
UpgradeTo_3_0_0 = File.join(R... | 39.434211 | 74 | 0.711044 |
6aa6bf03195cc29cde0b0f8405f87c1f2365487c | 599 | # frozen_string_literal: true
require 'httparty'
require 'koine/url'
require 'koine/rest_client/error'
require 'koine/rest_client/version'
require 'koine/rest_client/client'
require 'koine/rest_client/async_builder'
require 'koine/rest_client/async_queue'
require 'koine/rest_client/response_parser'
require 'koine/rest... | 27.227273 | 55 | 0.833055 |
184e3db72ece434f01ca794a90eaa145d46e7714 | 943 | # frozen_string_literal: true
# Groups::RepositoryStorageMove store details of repository storage moves for a
# group. For example, moving a group to another gitaly node to help
# balance storage capacity.
module Groups
class RepositoryStorageMove < ApplicationRecord
extend ::Gitlab::Utils::Override
include ... | 26.942857 | 109 | 0.745493 |
1c7aeb9f163140ed037c229d88cbe134a4cb79e5 | 957 | lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "sidtool/version"
Gem::Specification.new do |spec|
spec.name = 'sidtool'
spec.version = Sidtool::VERSION
spec.authors = ['Ole Friis Østergaard']
spec.email = ['olefriis@gmail.... | 33 | 67 | 0.647858 |
ff37bb6ccce298891abde85c3dc26f03ad01bfd6 | 538 | # frozen_string_literal: true
module PlanningCenter
module Endpoints
module Donations
def donation(id, params = {})
get(
"giving/v2/donations/#{id}",
params
)
end
def donations(params = {})
# We need to order the donations by a value (created_at bein... | 22.416667 | 83 | 0.576208 |
6a86054ba1b2fb168cfc06051dcf1b5edf727dc3 | 8,110 | require_relative '../lib/enumerable_methods'
describe Enumerable do
let(:array) { %w[apple Orange Watermelon Banana] }
let(:hash) { { fruit: 'banana', phone: 'apple' } }
let(:number_array) { [1, 2, 3, 4] }
let(:arr) { [] }
let(:false_arr) { [false] }
let(:true_arr) { [1, 3, 5] }
let(:varied_array) { [nil... | 32.44 | 111 | 0.64291 |
08c2d56a30ad35797246eb3bce12dcfdc4c047f0 | 2,855 | RSpec.describe Metasploit::Model::Engine do
context 'config' do
subject(:config) do
described_class.config
end
context 'generators' do
subject(:generators) do
config.generators
end
context 'options' do
subject(:options) do
generators.options
end
... | 23.595041 | 117 | 0.542207 |
3900868634afb62c4fcf24a65082db41def55a76 | 1,260 | require 'aws-sdk-sesv2'
namespace :notify do
task create_templates: :environment do
templates = Rails.root.join("spec", "fixtures", "notify", "*")
client = Aws::SESV2::Client.new
Dir[templates].each do |file|
Notifications::Template.create!(YAML.load_file(file))
sleep(0.5) # Otherwise we'll... | 27.391304 | 83 | 0.690476 |
ac0f7b830736271d8e206e7db4d4d879c7fc981e | 189 | require "gds_api/link_checker_api"
Whitehall.link_checker_api_client = GdsApi::LinkCheckerApi.new(
Plek.find("link-checker-api"),
bearer_token: ENV["LINK_CHECKER_API_BEARER_TOKEN"],
)
| 27 | 63 | 0.798942 |
1abec15b0f1316a8a61389f8c025037fe5eae8a6 | 591 | require('rspec')
require('ping_pong')
describe("ping_pong") do
it("creates an array of [1,2] when 2 is entered") do
expect((2).ping_pong).to(eq([1,2]))
end
it("returns 'ping' if the number is divisible by 3") do
expect((3).ping_pong).to(eq([1, 2, 'ping']))
end
it("returns 'pong' if the number is d... | 26.863636 | 109 | 0.620981 |
03f730e2af348113e88321ab745581033d5f3c32 | 6,419 | # frozen_string_literal: true
# Copyright 2020 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 applicabl... | 41.147436 | 101 | 0.61614 |
289e3353026434b0fb6bce7065ff1df0c73ec02a | 5,534 | #!/usr/bin/env rake
require 'rake'
require 'rake/tasklib'
require 'fileutils'
require 'bundler/setup'
module DaFunk
class RakeTask < ::Rake::TaskLib
include ::Rake::DSL if defined?(::Rake::DSL)
attr_accessor :name, :libs, :tests, :tests_unit, :tests_integration, :root_path, :main_out,
:test_out, :res... | 33.137725 | 162 | 0.574449 |
acb4fb7d7679f90b75ae73b2aa1dbe1340871891 | 10,635 | # ----------------------------------------------------------------------------
# <copyright company="Aspose" file="PostalAddress.rb">
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of... | 35.45 | 147 | 0.610437 |
792c2ae875d5a09bb38ff8d322cac12eb61ccd60 | 353 | # rspec spec/seb_elink_spec.rb
RSpec.describe SebElink do
it "has a version number" do
expect(SebElink::VERSION).not_to be nil
end
describe ".root" do
it "returns a Pathname to root of gem" do
# this spec may fail if you cloned the gem to a custom dir
expect(SebElink.root.to_s).to match(%r".*... | 25.214286 | 64 | 0.685552 |
ed9165be8d57dfad8223c3b544ce1a1e6f5ba024 | 2,065 | require 'formula'
class Libvpx < Formula
homepage 'http://www.webmproject.org/code/'
url 'http://webm.googlecode.com/files/libvpx-v1.1.0.tar.bz2'
sha1 '356af5f770c50cd021c60863203d8f30164f6021'
depends_on 'yasm' => :build
option 'gcov', 'Enable code coverage'
option 'mem-tracker', 'Enable tracking memory... | 35 | 104 | 0.646489 |
39889ab39e7b8b5588bd7ad757893e80f7a32e4b | 711 | # coding: utf-8
Gem::Specification.new do |spec|
spec.name = "phantom_jekyll_theme"
spec.version = "0.1.1"
spec.authors = ["Andrew Banchich"]
spec.email = ["andrewbanchich@gmail.com"]
spec.summary = %q{A Jekyll version of the "Phantom" theme by HTML5 UP.}
spec.homepage ... | 37.421053 | 132 | 0.644163 |
181e0ac3adef936b82f998569692f429baed5966 | 5,001 | # frozen_string_literal: true
require 'dotenv/load'
require 'webmock/rspec'
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which wil... | 50.01 | 96 | 0.718656 |
3996f87958675c4ce75e0d61f8230346b7eff186 | 2,262 | require File.dirname(__FILE__) + '/../spec_helper.rb'
describe "ActiveCouch::Base #count method with just simple attributes" do
before(:each) do
# Define the model
class Person < ActiveCouch::Base
site 'http://localhost:5984'
has :name
end
# Define the migration
class ByName < ActiveC... | 29.763158 | 104 | 0.665782 |
eda04d55c31781eef68dac8c9ea7f12c81a70ed6 | 10,955 | ##
# 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 = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::FileDropper
include Msf::... | 31.84593 | 271 | 0.608672 |
f81f75c81aaea23446eecd5729838ecf09b3c916 | 922 | # frozen_string_literal: true
class MembershipPolicy < ApplicationPolicy
def update?
@user.global_administrator? || @user.is_admin_of?(@record.org)
end
def destroy?
update? && @record.user.role_level_in(@record.org) != @user.role_level_in(@record.org)
end
def update_global_role?
@user.global_ad... | 24.263158 | 92 | 0.761388 |
bf09eee62b31b7bb121c719aa29855e497037ae7 | 124 | class AddForeignKeyToLocations < ActiveRecord::Migration[5.0]
def change
add_foreign_key :locations, :users
end
end
| 20.666667 | 61 | 0.774194 |
e847d499cb9489f93a03c9513f60836b1039b47e | 3,448 | require 'base_api/configurable'
require 'httparty'
require 'base_api/error'
require 'base_api/client/authorizations'
require 'base_api/client/users'
require 'base_api/client/items'
require 'base_api/client/categories'
require 'base_api/client/item_categories'
require 'base_api/client/orders'
module BaseApi
# TODO: 責... | 26.728682 | 92 | 0.656903 |
1c897931c35780af2c1a25b8c02a2170e85c5920 | 924 | module Intrigue
module Ident
module Check
class SalesForce < Intrigue::Ident::Check::Base
def generate_checks(url)
[
{
type: "fingerprint",
category: "application",
tags: ["Cloud", "CRM", "SaaS", "PaaS"],
vendor: "Salesforce",
product: "Salesf... | 28 | 130 | 0.528139 |
f86371068bf773e41f5785261b7d531d29162fcf | 843 | require 'formula'
class Henplus < Formula
homepage 'https://github.com/neurolabs/henplus'
url 'https://github.com/downloads/neurolabs/henplus/henplus-0.9.8.tar.gz'
sha1 'ab1fc3a2ec5a6c8f434d2965d9bbe2121030ffd1'
depends_on :ant => :build
depends_on 'libreadline-java'
def install
ENV['JAVA_HOME'] = `/... | 24.794118 | 75 | 0.672598 |
ff0ba104841f78ddb2a59ca14c951d297f5ba0b4 | 1,824 | class PlacesController < ApplicationController
before_action :set_place, only: [:show, :edit, :update, :destroy]
load_and_authorize_resource
# GET /places
# GET /places.json
def index
@places = Place.all
end
# GET /places/1
# GET /places/1.json
def show
end
# GET /places/new
def new
@... | 24 | 89 | 0.647478 |
21100734ee3445e488627c84cd5c824b7a5ece96 | 7,102 | ##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
##
# This module is based on, inspired by, or is a port of a pl... | 37.97861 | 179 | 0.689383 |
611f798d51822042254ae0927b1b2a606370d71b | 600 | require "economic/proxies/entity_proxy"
module Economic
class CashBookProxy < EntityProxy
def find_by_name(name)
response = request("FindByName", "name" => name)
cash_book = build
cash_book.partial = true
cash_book.persisted = true
cash_book.number = response[:number]
cash_bo... | 22.222222 | 57 | 0.588333 |
189195ed0602686d81c64efe7bab697de75110aa | 763 | module Fog
module Brightbox
class Compute
class Real
# Get full details of the API client.
#
# @param [String] identifier Unique reference to identify the resource
# @param [Hash] options
# @option options [Boolean] :nested passed through with the API request. When tr... | 33.173913 | 121 | 0.613368 |
18c3c2b3ddf0e9429b1eb402865e3e4a4f6c328d | 3,392 | # frozen_string_literal: true
require 'spec_helper'
describe BankCredentials::Factory do
describe '.from_hash' do
subject { described_class.from_hash(credentials) }
context 'given a valid hbci credential hash' do
let(:credentials) { valid_hbci_credentials_with_type }
it { is_expected.to be_a(Ba... | 30.017699 | 95 | 0.686321 |
5d92e902027ebe13aab1a770bb534712027ff714 | 243 | class Knox < Cask
version '2.2.0'
sha256 'c19c56a35d299a2cd85c612e1e99009bff9d7536ddd24f9d565910702be9742a'
url 'https://d13itkw33a7sus.cloudfront.net/dist/K/Knox-2.2.0.zip'
homepage 'https://agilebits.com/knox'
app 'Knox.app'
end
| 24.3 | 75 | 0.761317 |
399bd49623807f1ea335d0b259f86091176e11b9 | 4,710 | require_relative '../../spec_helper'
require_relative '../enumerable/shared/enumeratorized'
describe "Range#bsearch" do
it "returns an Enumerator when not passed a block" do
(0..1).bsearch.should be_an_instance_of(Enumerator)
end
it_behaves_like :enumeratorized_with_unknown_size, :bsearch, (1..3)
it "rai... | 34.130435 | 85 | 0.591932 |
e80a55898c9795e51fa251888fb144cc6baa702f | 6,676 | require 'test_helper'
class TestSpecification < Test::Unit::TestCase
def setup
@project = create_construct
end
def teardown
@project.destroy!
end
def build_jeweler_gemspec(&block)
gemspec = if block
Gem::Specification.new(&block)
else
Gem::Specifica... | 27.933054 | 149 | 0.646195 |
33223427889128e6c7278b4c8cd56b79b1b4a067 | 142 | require 'test_helper'
class SccRubyTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::SccRuby::VERSION
end
end
| 17.75 | 39 | 0.788732 |
7a4dcc77d42fd2b70e4b5fb9548290b6684d1182 | 220 | class Alvarion < Oxidized::Model
# Used in Alvarion wisp equipment
# Run this command as an instance of Model so we can access node
pre do
cmd "#{node.auth[:password]}.cfg"
end
cfg :tftp do
end
end
| 13.75 | 66 | 0.672727 |
e22be6880bbf3ece2ddf6788c915b260a9510bd2 | 1,631 | # frozen_string_literal: true
class MergeRequestNoteableEntity < Grape::Entity
include RequestAwareEntity
# Currently this attr is exposed to be used in app/assets/javascripts/notes/stores/getters.js
# in order to determine whether a noteable is an issue or an MR
expose :merge_params
expose :state
expose... | 30.203704 | 142 | 0.780503 |
28abfbdfef63609aba68bcb97356eb20bfe35d18 | 243 | require 'spec_helper'
RSpec.describe "/admin" do
pending "add some examples to #{__FILE__}" do
before do
get "/admin"
end
it "returns hello world" do
expect(last_response.body).to eq "Hello World"
end
end
end
| 17.357143 | 52 | 0.650206 |
08a85e2bfa19728af75036f4ca24bd2248acfec6 | 278 | # Don't forget! This file needs to be 'required' in its spec file
# See README.md for instructions on how to do this
def fizzbuzz(int)
if int % 3 == 0 and int % 5 == 0
"FizzBuzz"
elsif
int % 3 == 0
"Fizz"
elsif int % 5 == 0
"Buzz"
else
nil
end
end
| 18.533333 | 65 | 0.593525 |
1aa348a735cf9936500325786c0867447687ee2e | 167 | require 'test_helper'
module Support
class CandidateAdditionalScoreTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
end
| 16.7 | 62 | 0.706587 |
f8979e9d3b8c54a192e5d17d568705b0241e6e7b | 3,465 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 41.25 | 100 | 0.756999 |
1147ea5e64012ece7db395f19067258fd5d7018b | 2,095 | # Multipass implementation used for single-sign-on for resellers
require "openssl"
require "base64"
require "time"
require "json"
module BitBalloon
class Multipass
def initialize(multipass_secret)
### Use the Multipass secret to derive two cryptographic keys,
### one for encryption, one for signing
... | 29.507042 | 83 | 0.680668 |
082c447c4479c3672b615fdc53651c24283f9686 | 2,289 | # encoding: utf-8
module PDoc
module Generators
module Html
class Page
include Helpers::BaseHelper
include Helpers::LinkHelper
def initialize(template, layout, variables = {})
@template = template
@layout = layout
assign_variables(variables)
... | 30.932432 | 135 | 0.553517 |
e83f4dc20a39e8fe9f4dae16227017d30d34d2c7 | 604 | cask "tableau-reader" do
version "2020.2.2"
sha256 "74b4f8bc12b462b11c94a5400f25010474f410e24ef8d943318049e05e76bf0c"
url "https://downloads.tableau.com/tssoftware/TableauReader-#{version.dots_to_hyphens}.dmg"
appcast "https://macupdater.net/cgi-bin/check_urls/check_url_redirect.cgi?url=https://www.tableau.com... | 33.555556 | 126 | 0.759934 |
91adc1c8e430be4d45e9da903aeee2c390ad3b0f | 886 | module Feedjira
module Parser
# Parser for dealing with Atom feed entries.
class AtomEntry
include SAXMachine
include FeedEntryUtilities
element :title
element :link, :as => :url, :value => :href, :with => {:type => "text/html", :rel => "alternate"}
element :name, :as => :autho... | 25.314286 | 103 | 0.579007 |
03b67dbb2530c10fc26749d28d30247989ae8e55 | 798 | # Generated via
# `rails generate hyrax:work MastersPaper`
module Hyrax
class MastersPapersController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior
include Hyrax::BreadcrumbsForWorks
self.curation_concern_type = ::MastersPaper
# Use thi... | 27.517241 | 79 | 0.720551 |
392af873c2058549b9404a5ea644eea9819f30a3 | 390 | # frozen_string_literal: true
require 'bundler/setup'
require 'xid'
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = '.rspec_status'
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!... | 22.941176 | 66 | 0.753846 |
bb31a9b2f321d9d3900d398caf9c6fda61682353 | 157 | require 'helpers/unique_names_helper'
include UniqueNamesHelper
FactoryGirl.define do
factory :feature_flags_user do
id { unique_integer }
end
end
| 15.7 | 37 | 0.796178 |
2614e133007b22ce46147bea1dfea872105cd56f | 640 | require 'helper'
class TestEppContactDeleteResponse < Test::Unit::TestCase
context 'EPP::Contact::DeleteResponse' do
setup do
@response = EPP::Response.new(load_xml('contact/delete'))
@delete_response = EPP::Contact::DeleteResponse.new(@response)
end
should 'proxy methods to @response' do
... | 26.666667 | 77 | 0.7125 |
ac53918a0b446d679af10968afa7d47c3ddcf91b | 929 | class User < OceanDynamo::Table
include ActiveModel::Validations
validates :email, presence: true, email: true
dynamo_schema(:id, create: !Rails.env.production?) do
attribute :email, :string
attribute :oauth_token, :string, default: nil
attribute :oauth_secret, :string, default: nil
... | 29.967742 | 93 | 0.715823 |
21fb9276e298074119a970e2804b2f6d1a44138e | 501 | module Skype
def self.exec(command, opts={:response_filter => true})
script = %Q{tell application "Skype"
send command "#{Utils.escape command}" script name "#{self.config[:app_name]}"
end tell}
res = `unset LD_LIBRARY_PATH; unset DYLD_LIBRARY_PATH; /usr/bin/osascript -e '#{script}'`.strip
res = filter_... | 27.833333 | 99 | 0.620758 |
abdb4f01f4f535824a7668c908bd8320df3007d1 | 561 | ## coding: utf-8
#require 'rails_helper'
#feature "Channels Moderation", %q{
#In order to curate my channel and comunicate my decisions to the project owners
#as a channel trustee
#I want to approve or reject a project draft
#} do
#background do
#@channel = FactoryGirl.create(:channel)
#end
#scena... | 20.035714 | 82 | 0.691622 |
28124b67908e85c8977b98553b36959eb9679158 | 641 | require 'json'
require File.dirname(__FILE__) + '/exceptions'
module HelpDeskAPI
module Utilities
# Makes sure all keys exist in hash
def self.validateHash(hash, keys)
keys.each do |key|
unless hash.has_key? key
fail HelpDeskAPI::Exceptions.MissingKey, "Missing key #{key} in hash:\n#... | 26.708333 | 91 | 0.670827 |
f73839a0a3797390dfabd3be4cd107f5f2a63827 | 514 | module TimeHelpers
def self.prepare_time_value(value)
case value
when 'end'
Time.zone.now.end_of_day
when 'beginning'
Time.zone.now.beginning_of_day
else
begin
Time.zone.strptime(value, '%H:%M %d.%m')
rescue => _e
nil
end
end
end
def self.time_zon... | 21.416667 | 48 | 0.622568 |
1de2911aec4ac4d40873cca957b026abc157e159 | 2,179 | #!/usr/bin/env ruby
# - implement new printers here, and send the class to the factory using `PrinterFactory.printers = [class]`
class GitHubScraper
include Scraper
def initialize
super
@host = 'github.com'
@base_url = 'https://github.com'
@name = 'GitHub'
@supported[%r{pull/\d+/?$}] = MergeR... | 34.587302 | 108 | 0.688389 |
18452d02075db56a5fe63032ecd1dbbd2a620f6c | 1,086 | # frozen_string_literal: true
module Doorkeeper
module OAuth
module Helpers
# Default Doorkeeper token generator. Follows OAuth RFC and
# could be customized using `default_generator_method` in
# configuration.
module UniqueToken
def self.generate(options = {})
# Access ... | 35.032258 | 126 | 0.626151 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.