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 |
|---|---|---|---|---|---|
87323304150f348a53e85fe225efe9bd55a1a8d1 | 12,044 | require 'spec_helper'
shared_examples 'check total store credit from payments' do
context 'with valid payments' do
subject { order }
let(:order) { payment.order }
let!(:payment) { create(:store_credit_payment) }
let!(:second_payment) { create(:store_credit_payment, order: order) }
it 'returns t... | 30.568528 | 123 | 0.685487 |
5d27ad069ce06e21098e5c0b611fd7e6f3786001 | 2,152 | module ApiAuthentication
class SessionDocs
require 'swagger/blocks'
require 'apidocs/unprocessable_entity'
include Swagger::Blocks
swagger_path '/session' do
operation :post do
key :description, 'session'
key :summary, 'create session'
key :tags, ['session']
key... | 25.927711 | 62 | 0.558086 |
3820cf5cb9d501f3716cc99595526be72fe7476e | 4,131 | require 'spec_helper'
describe EmailsHelper do
describe 'password_reset_token_valid_time' do
def validate_time_string(time_limit, expected_string)
Devise.reset_password_within = time_limit
expect(password_reset_token_valid_time).to eq(expected_string)
end
context 'when time limit is less tha... | 31.295455 | 121 | 0.627935 |
1a685b7a5649c1019aeb93287353a261ea934206 | 2,036 | #
# Author:: Tyler Cloke (tyler@chef.io)
# Copyright:: Copyright 2015-2016, 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
#
# ... | 25.135802 | 97 | 0.647348 |
bb3c18c3cf2057add8943852430eb23530ff0986 | 489 | case node.platform
when "centos","redhat","amazon"
include_recipe "hyclops::add_zeromq_repo"
%w{gcc gcc-c++ zeromq zeromq-devel ipmitool python-devel python-setuptools}.each do |pkg|
if node.platform == "amazon" && pkg == "ipmitool"
next
end
package pkg do
action :install
end
end
when ... | 25.736842 | 91 | 0.646217 |
bfccee9b06e3590c9dac0a724d14585b85b8e8bf | 5,023 | # frozen_string_literal: true
require "dependabot/update_checkers"
require "dependabot/update_checkers/base"
require "dependabot/errors"
require "dependabot/github_actions/version"
require "dependabot/github_actions/requirement"
module Dependabot
module GithubActions
class UpdateChecker < Dependabot::UpdateChec... | 34.881944 | 80 | 0.691021 |
ff08cfb86522e15a8edd83854a20f737fdb8e70e | 346 | # frozen_string_literal: true
module ActionPack
# Returns the version of the currently loaded Action Pack as a <tt>Gem::Version</tt>
def self.gem_version
Gem::Version.new VERSION::STRING
end
module VERSION
MAJOR = 5
MINOR = 2
TINY = 4
PRE = "1"
STRING = [MAJOR, MINOR, TINY, PRE].co... | 19.222222 | 86 | 0.653179 |
1daed31a7bb5e206162ea30a0eabc9b2053f7b13 | 888 | # frozen_string_literal: true
#
# Description: Quota Exceeded rejected method.
#
module ManageIQ
module Automate
module System
module CommonMethods
module QuotaStateMachine
class Rejected
def initialize(handle = $evm)
@handle = handle
end
... | 24 | 131 | 0.572072 |
797d6cf1193df2aca69721c64521280e56c77e23 | 2,435 | require "optic/version"
require 'net/http'
module Optic
class DocumentingMiddleware
def initialize(app, options = {})
@app = app
@app.freeze
@host = ENV['OPTIC_SERVER_HOST'] || 'localhost'
end
def call(env)
req = Rack::Request.new(env)
res = @app.call(env)
# Log reque... | 28.313953 | 120 | 0.633676 |
1813a693191d460aa94398a4965c0290e2fdbd29 | 1,436 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Post
include Msf::Post::File
include Msf::Post::Linux::BusyBox
def initialize
super(
'Name' => 'BusyBox Enumerate Host Names',... | 28.72 | 110 | 0.640669 |
87e38171b70252ced5c5a703031cdd7fb39ea496 | 705 | require 'pileup_variant.rb'
class Pileup
attr_accessor :pileup
def initialize(hasPileup=false, *args)
@pileup = Hash.new()
if hasPileup
output = File.open(args[0],'r')
output.each_line do |out|
pileupObj = PileupLine.new(out)
@pileup[pileupObj.pos]=pileupObj
end
else
#puts "samtools pileup... | 25.178571 | 99 | 0.635461 |
1aa71ccf8cbb98674e7642ede1414f5c6b80e52a | 6,370 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Compute::Mgmt::V2015_06_15
module Models
#
# Describes a Virtual Machine Extension.
#
class VirtualMachineExtension < Resour... | 32.5 | 77 | 0.490267 |
21e10380345e346f4d8202993671c0ef514d3dff | 261 | class Api::V1::PackagesController < Api::V1::BaseController
def index
@packages = NpmInfoService.call(params[:query])
authorize policy_scope(Tool)
end
def show
@package = NpmInfoService.call(params[:query]).first
authorize Tool
end
end
| 21.75 | 59 | 0.716475 |
33e52e3772b69c616928b54196f3c2eb9e29e996 | 143 | module SpiffyStoresAPI
class Variant < Base
include Metafields
include DisablePrefixCheck
conditional_prefix :product
end
end
| 15.888889 | 31 | 0.769231 |
399dffa64d0ba6391356c549a9133c0106debcf6 | 754 | cask 'maintenance' do
version :latest
sha256 :no_check
macos_release = MacOS.version.to_s.delete('.')
url "https://www.titanium-software.fr/download/#{macos_release}/Maintenance.dmg"
name 'Maintenance'
homepage 'https://www.titanium-software.fr/en/maintenance.html'
# Unusual case: The software will sto... | 29 | 100 | 0.522546 |
4aa7779e7662838cb0e49636eb0ec94a9070381a | 1,367 | #
# Copyright 2013-2014 Chef Software, Inc.
#
# 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 ... | 28.479167 | 95 | 0.764448 |
e9abf91951d6abdfa6c935cee2d0735754586149 | 3,039 | class S6 < Formula
desc "Small & secure supervision software suite"
homepage "https://skarnet.org/software/s6/"
url "https://skarnet.org/software/s6/s6-2.11.0.1.tar.gz"
sha256 "ad7f204587634eeb20ef8f7a7beb6dd63ba3080a46a3a650448ca7cc0826f90a"
license "ISC"
livecheck do
url :homepage
regex(/href=.*?... | 34.931034 | 102 | 0.677855 |
b9a33da603366b6397754ba13896943748a7db00 | 1,103 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# dat... | 40.851852 | 86 | 0.766999 |
1dcbb1f716fd2789e0e930eaf41a90937e36f623 | 70 | require 'rails_helper'
RSpec.describe "Acts", type: :request do
end
| 11.666667 | 40 | 0.742857 |
1c0cfa6a5bb6d51fa564f55acb48f55f1fda8746 | 3,156 | =begin
Copyright 2010-2014 Tasos Laskos <tasos.laskos@gmail.com>
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 requi... | 29.495327 | 84 | 0.650824 |
79951651d9138aaa4c94169fb5ebc74c06682783 | 4,574 | module CalCentralPages
class MyDashboardUpNextCard < MyDashboardPage
include PageObject
include CalCentralPages
include ClassLogger
span(:day, :xpath => '//span[@data-ng-bind="lastModifiedDate | date:\'EEEE\'"]')
span(:date, :xpath => '//span[@data-ng-bind="lastModifiedDate | date:\'MMM d\'"]')... | 43.980769 | 195 | 0.698732 |
ab0726e5e1ef7d143be6169c51eb675a330a3518 | 1,293 | # 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.ag/status_available.expected
#
# and regenerate the tests with the following rake task
#
# $ rake genspec:parsers
#
require 'spec_helper'
require 'who... | 21.196721 | 74 | 0.655839 |
f73322dbbc40db2003acdd99f1841c009919525c | 1,692 | module ActsAsCommentable
# including this module into your Comment model will give you finders and named scopes
# useful for working with Comments.
# The named scopes are:
# in_order: Returns comments in the order they were created (created_at ASC).
# recent: Returns comments by how recently they were cre... | 40.285714 | 139 | 0.700946 |
abab2fab6118c455a804e2aeea53c56aaaca7d17 | 487 | module JSON
class SchemaGenerator
class StatementGroup
def initialize key = nil
@key = key
@statements = []
end
def add statement
@statements << statement
end
def to_s
buffer = StringIO.new
if @key.nil?
buffer.puts "{"
else ... | 18.730769 | 41 | 0.501027 |
7928dc82d733b4549434a397a523830b0d241138 | 511 | # frozen_string_literal: true
require 'spec_helper'
describe Panoptes::Client::Comments, :vcr do
describe '#create_comment' do
let(:client) { user_client }
it 'creates a comment' do
Timecop.freeze(Time.at(1_470_146_174)) do
comment = client.create_comment(
discussion_id: 165,
... | 24.333333 | 64 | 0.643836 |
0123b4539111ba6655e1a65d7b215f6e4986b7b0 | 1,658 | class Restic < Formula
desc "Fast, efficient and secure backup program"
homepage "https://restic.github.io/"
url "https://github.com/restic/restic/archive/v0.9.5.tar.gz"
sha256 "e22208e946ede07f56ef60c1c89de817b453967663ce4867628dff77761bd429"
revision 1
head "https://github.com/restic/restic.git"
bottle... | 32.509804 | 93 | 0.700241 |
5d0b53e79509612e65fc7fb1240f36081d1e289b | 27,433 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 60.42511 | 282 | 0.671819 |
4a93599ebf3af447b9b59c352a6bb3ce61a5e014 | 1,744 | # -*- encoding: utf-8 -*-
# stub: devise 3.2.4 ruby lib
Gem::Specification.new do |s|
s.name = "devise"
s.version = "3.2.4"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Jos\u{e9} Valim", "Carlos Ant\u{f4}nio"]... | 37.913043 | 105 | 0.626147 |
919866ad1dc63570513a0284a3414f264fa40ac8 | 107 | require_relative 'validation/always_invalid_validator'
require_relative 'validation/always_valid_validator' | 53.5 | 54 | 0.915888 |
21e75d21cd1ee1022d40871180ea32d6661d08e7 | 66 | require "blog/engine"
module Blog
# Your code goes here...
end
| 11 | 26 | 0.69697 |
b901f71e84e91cc507e6d24ca977343329d6f302 | 8,444 | RSpec.describe EmsEventHelper do
context "fb12322 - MiqAeEvent.build_evm_event blows up expecting inputs[:policy] to be an instance of MiqPolicy, but it is a hash of { :vmdb_class => 'MiqPolicy', :vmdb_id => 42}" do
before do
[Zone, ExtManagementSystem, Host, Vm, Storage, EmsEvent, MiqEventDefinition, MiqPo... | 60.748201 | 184 | 0.326978 |
6a0bceca18f087e65409ff1482eefaf561b2518a | 154 | require 'decathlon/sports/version'
require 'decathlon/sports/sport'
require 'decathlon/sports/recommendation'
module Decathlon
module Sports
end
end
| 17.111111 | 41 | 0.811688 |
620aee21d4d58a35a18067b7118f8ecd90e4cba1 | 13,805 | # frozen_string_literal: true
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
config.omniauth :google_oauth2, Rails.application.secrets.google_client_id, Rails.application.secrets.google_client... | 48.953901 | 154 | 0.752191 |
d593f5f6a8c49f439a31af9b8426828ff4f85d16 | 275 | class Chef < ApplicationRecord
validates :chefname, presence: true, length: { maximum: 30 }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true, length: { maximum: 255 },
format: { with: VALID_EMAIL_REGEX }
end
| 39.285714 | 62 | 0.610909 |
1dc1ea7683bfbeed3de1d316d78174a6f586248d | 833 | class PostsController < ApplicationController
def index
@posts = Post.order(created_at: 'desc')
end
def new
@post = Post.new
end
def create
user = User.find_by_id(current_user.id)
post = Post.new(post_params)
user.posts << post
redirect_to root_path
end
def show
@post = Po... | 16.333333 | 46 | 0.64946 |
1ac03e4fe394e89e416973452302dfc2ca723b36 | 3,022 | require 'rails_helper'
describe Listing do
let(:new_york_city) { City.create(name: 'NYC') }
let(:financial_district) { Neighborhood.create(name: 'Fi Di', city: new_york_city) }
let(:amanda) { User.create(name: 'Amanda') }
let(:logan) { User.create(name: 'Logan') }
let!(:listing) do
Listing.create(
... | 26.743363 | 111 | 0.643614 |
6a878662690a6d3aeccdf831cd159a868d765e15 | 224 | # -*- encoding : utf-8 -*-
module ActionView::Helpers::TextHelper
def pluralize_without_number(count, singular, plural = nil)
(count == 1 || count =~ /^1(\.0+)?$/) ? singular : (plural || singular.pluralize)
end
end
| 32 | 85 | 0.642857 |
33314557db162ea704c1e1c37fa22db4a773c3c3 | 340 | # frozen_string_literal: true
Dir.glob(File.join(File.dirname(__FILE__), 'github_bot', '**/*.rb'), &method(:require))
# Public: The github bot is utilized for assistance with webhook interactions provided by
# the incoming github events
module GithubBot
mattr_accessor :draw_routes_in_host_app
self.draw_routes_in_... | 30.909091 | 89 | 0.785294 |
8739ada54ea2c6d99425b5e0ec205d074b446c24 | 735 | # frozen_string_literal: true
require "helper"
class TestLiquidRenderer < JekyllUnitTest
context "profiler" do
setup do
@site = Site.new(site_configuration)
@renderer = @site.liquid_renderer
end
should "return a table with profiling results" do
@site.process
output = @renderer.... | 23.709677 | 103 | 0.594558 |
1af2e5064f92b4f653acd52b50db6d943ca1ec03 | 59 | def hello_world
puts "Kumusta sa mundo"
end
hello_world
| 9.833333 | 25 | 0.779661 |
6ac74f84aab95ee35463e9f553bbfc0e31db69ba | 227 | # frozen_string_literal: true
class TezosClient
module Tools
class HashToMicheline < ActiveInteraction::Base
class Int < Base
def encode
{ int: data.to_s }
end
end
end
end
end
| 16.214286 | 51 | 0.61674 |
01820ccc9f269f6e149b0d695294c6e4acf38c63 | 105 | class Todo < ApplicationRecord
belongs_to :project, :foreign_key => :project_id
belongs_to :user
end
| 21 | 50 | 0.771429 |
1aa2255c6cb7c81746809a66460400409faabe8e | 7,574 | module OrderService
def self.create_with_artwork!(buyer_id:, buyer_type:, mode:, quantity:, artwork_id:, user_agent:, user_ip:, impulse_conversation_id: nil, edition_set_id: nil, find_active_or_create: false)
order_creator = OrderCreator.new(
buyer_id: buyer_id,
buyer_type: buyer_type,
mode: mod... | 40.074074 | 190 | 0.774756 |
91c5ca261b9cfc34bc1ef1f21cdd3587087d8484 | 250 | require 'spec_helper'
describe 'groups/_home_panel' do
let(:group) { create(:group) }
before do
assign(:group, group)
end
it 'renders the group ID' do
render
expect(rendered).to have_content("Group ID: #{group.id}")
end
end
| 15.625 | 61 | 0.664 |
21b9c917b3351eb0c1d596fa8ac1ece708bedabd | 324 | class Reservation < ApplicationRecord
validates :start_date, presence: true
validates :end_date, presence: true
validate :reservation_dates_must_make_sense
private
def reservation_dates_must_make_sense
if end_date <= start_date
errors.add(:start_date, 'has to be before the end date')
end
end
... | 24.923077 | 62 | 0.765432 |
f7faf3b5f6ccd47fb1affbefbfc5facd1697871b | 939 | Pod::Spec.new do |s|
s.name = "mParticle-UrbanAirship"
s.version = "7.10.4"
s.summary = "Urban Airship integration for mParticle"
s.description = <<-DESC
This is the Urban Airship integration for mParticle.
DESC
s.hom... | 44.714286 | 149 | 0.576145 |
38ccce93ccf352bb8b7b27f69c9c7b06582de7ff | 1,481 | require_relative 'lib/profitwell/version'
Gem::Specification.new do |spec|
spec.name = "profitwell"
spec.version = Profitwell::VERSION
spec.authors = ["eebasadre20"]
spec.email = ["eebasadre20@gmail.com"]
spec.summary = "Profitwell Ruby API Wrapper"
spec.description = ... | 41.138889 | 91 | 0.678596 |
f71aad0a820ab8c39f8cfb4ba73dba196c1eec78 | 4,479 | class Gws::Notice::Post
include SS::Document
include Gws::Referenceable
include Gws::Reference::User
include Gws::Reference::Site
include Gws::Reference::Notice::Folder
include Gws::Addon::Contributor
include SS::Addon::Markdown
include Gws::Addon::File
include Gws::Addon::Link
include Gws::Addon::N... | 28.896774 | 102 | 0.705961 |
6278434de0bd4330a5bd1adbf3be82d49fd37055 | 3,693 | # Copyright (c) 2012 Ryan J. Geyer
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# dis... | 44.493976 | 184 | 0.68508 |
e83dee672408fb62d18ad36289bb205807790e52 | 438 | require 'radmin/fields/base'
module Radmin
module Fields
module Types
class Text < Radmin::Fields::Base
Radmin::Fields::Types.register(self)
register_property :partial do
:form_text
end
# register_property :html_attributes do
# {
# required:... | 18.25 | 47 | 0.515982 |
f7ffa1fe66494a662379386e6a2daf06382627b4 | 3,764 | module Schedulable
module Model
class Schedule < ActiveRecord::Base
serialize :day
serialize :day_of_week, Hash
belongs_to :schedulable, polymorphic: true
after_initialize :update_schedule
before_save :update_schedule
validates_presence_of :rule
validates_presence_of... | 28.089552 | 188 | 0.548353 |
ff86924e22c8a88018903cbba57c2d200a2143f9 | 8,949 | #
# Author:: John Keiser (<jkeiser@opscode.com>)
# Copyright:: Copyright (c) 2013 Opscode, 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
#
# ... | 30.542662 | 188 | 0.631802 |
4af4629fd4392b24ce5f81331c71892704abb8b9 | 116 | class AddReferalsToUser < ActiveRecord::Migration[5.1]
def change
add_column :users, :ref, :string
end
end
| 16.571429 | 54 | 0.724138 |
6afd442d9abdf2f099f88f0591eb5306237b1d96 | 1,046 | # frozen_string_literal: true
class Ability
include CanCan::Ability
def initialize(user)
# Define abilities for the user here. For example:
#
# return unless user.present?
# can :read, :all
# return unless user.admin?
# can :manage, :all
#
# The first argument to `can` is t... | 31.69697 | 80 | 0.669216 |
79ea9fc8f25cd6dc2d3087514c43e86803a8a9cf | 1,537 | require 'spec_helper'
describe ReverseMarkdown do
let(:input) { File.read('spec/assets/anchors.html') }
let(:document) { Nokogiri::HTML(input) }
subject { ReverseMarkdown.convert(input) }
it { is_expected.to include '[Foobar](http://foobar.com)' }
it { is_expected.to include '[Fubar](http://foobar.com "... | 54.892857 | 140 | 0.693559 |
8717092abb4819545c76f184e5b98ed729398d4e | 2,270 | class Cdargs < Formula
desc "Bookmarks for the shell"
homepage "https://www.skamphausen.de/cgi-bin/ska/CDargs"
url "https://www.skamphausen.de/downloads/cdargs/cdargs-1.35.tar.gz"
sha256 "ee35a8887c2379c9664b277eaed9b353887d89480d5749c9ad957adf9c57ed2c"
bottle do
cellar :any_skip_relocation
sha256 "5... | 35.46875 | 92 | 0.681057 |
0365f4629ccfcf98d98f35f666036c69e111edd1 | 1,404 | #
# Copyright 2012-2014 Chef Software, Inc.
#
# 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 ... | 30.521739 | 102 | 0.75 |
33469e7ca4baa254f9a58ff24b22ef1b2baedbee | 1,096 | class Blueutil < Formula
desc "Get/set bluetooth power and discoverable state"
homepage "https://github.com/toy/blueutil"
url "https://github.com/toy/blueutil/archive/v1.0.0.tar.gz"
sha256 "a433a96c0b85637b43d504efb3fd4411ba352149a17899c8536e01c738c8cb04"
head "https://github.com/toy/blueutil.git"
bottle ... | 35.354839 | 95 | 0.781022 |
e9228a33249db330fe4536b49f6e73244d7bb70a | 2,055 | class UserCredentialsController < ApplicationController
include SortableTable
def index
set_table_sort sorts: %w[credential_name credential_value], default: { credential_name: :asc }
@user_credentials = current_user.user_credentials.reorder(table_sort).page(params[:page])
respond_to do |format|
... | 30.220588 | 110 | 0.705596 |
e8e47a90c39146cba67307f9d108f2d7736bd126 | 68 | json.partial! 'attributes', observation_matrix: @observation_matrix
| 34 | 67 | 0.838235 |
61965fab81c8d1967c8da3a373271173ccb3d990 | 814 | # frozen_string_literal: true
require "helper"
module Nokogiri
module XML
class TestDocumentEncoding < Nokogiri::TestCase
def setup
super
@xml = Nokogiri::XML(File.read(SHIFT_JIS_XML), SHIFT_JIS_XML)
end
def test_url
assert_equal("UTF-8", @xml.url.encoding.name)
... | 23.941176 | 79 | 0.664619 |
abbea6c45f379564e2e9511caa31522742852a61 | 146 | require "test_helper"
class CustomGoalNameControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
| 18.25 | 68 | 0.753425 |
0368cad08fd043a11992439d8c7ac796b104872f | 1,638 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject,... | 35.608696 | 91 | 0.765568 |
185a01d00447ab2a9b5fd92613ff791615c1118f | 2,944 | require File.expand_path(File.join(File.dirname(__FILE__), '..', 'rabbitmq_cli'))
Puppet::Type.type(:rabbitmq_user_permissions).provide(:rabbitmqctl, parent: Puppet::Provider::RabbitmqCli) do
confine feature: :posix
# cache users permissions
def self.users(name, vhost)
@users = {} unless @users
unless @u... | 27.514019 | 157 | 0.680027 |
4a08c7a16853b562593f7d34f3cca0e844f6679b | 901 | Rails.application.routes.draw do
root to: 'home#show', as: :homepage
get 'languages', to: 'languages#index', as: :choose_language
get '/help-requests', to: 'help_requests#new', as: :new_help_request
post '/help-requests', to: 'help_requests#create'
get '/help-requests/:uuid', to: 'help_requests... | 50.055556 | 140 | 0.711432 |
39fcd7b1952649856fe61f6fc479834dfe4ca08c | 605 | module Types
module Input
class RackFieldInput < GraphQL::Schema::InputObject
argument :id, ID, required: false
argument :name, String, required: true
argument :display_name, String, required: true
argument :description, String, required: false
argument :field_type, Types::Enum::Fiel... | 37.8125 | 77 | 0.710744 |
bbe66d266a7074ece84f3faa4958343cfe5a6606 | 3,972 | require 'json'
require_relative 'client'
module Blockchain
class StatisticsExplorer
attr_reader :client
def initialize(base_url = nil, api_code = nil)
@client = Client.new(base_url, api_code)
end
def proxy(method_name, *args)
warn "[DEPRECATED] avoid use ... | 32.826446 | 113 | 0.628651 |
1d854811588fed2e76a011a02c75b6915021db6a | 974 | class Rpg < Formula
desc "Ruby package management for UNIX"
homepage "https://github.com/rtomayko/rpg"
url "https://github.com/downloads/rtomayko/rpg/rpg-0.3.0.tar.gz"
sha256 "c350f64744fb602956a91a57c8920e69058ea42e4e36b0e74368e96954d9d0c7"
license "MIT"
head "https://github.com/rtomayko/rpg.git"
bottle... | 32.466667 | 95 | 0.759754 |
38aaf603ca0814a12a31051a87cf0ff4464e4b86 | 4,685 | # frozen_string_literal: true
require 'ecmangle'
module ECMangle
class PublicPapersOfThePresidents < ECMangle::DefaultMangler
@presidents = []
def initialize
@title = 'Public Papers of the Presidents'
@ocns = [1_198_154, 47_858_835]
super
# tokens
y = '(Y(ear|R\.)?[:\s])?(?<yea... | 23.661616 | 83 | 0.416435 |
112a05affea7325cf268ef5accf02feca57411e3 | 1,600 | # coding: utf-8
lib = File.expand_path('../lib/', __FILE__)
$LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
require 'spree_wishlist/version'
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_wishlist'
s.version = SpreeWishlist.version
s.summary = 'Add wish... | 34.042553 | 67 | 0.729375 |
219c3cf7d952c0a445bb5133ca2cb3972222ec29 | 1,092 | class Kredis::Types::CallbacksProxy
attr_reader :type
delegate :to_s, to: :type
AFTER_CHANGE_OPERATIONS = {
Kredis::Types::Counter => %i[ increment decrement reset ],
Kredis::Types::Cycle => %i[ next ],
Kredis::Types::Enum => %i[ value= reset ],
Kredis::Types::Flag => %i[ mark remove ],
Kredi... | 33.090909 | 82 | 0.661172 |
e8983d63bf5d5bbd969c63ac66aab5856f2018ce | 595 | require 'pry'
require 'bundler/setup'
require 'coverage_setup'
require 'minitest/autorun'
require 'activemodel-parameters'
# require 'fixtures/poro'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
module TestHelper
Routes = ActionDispatch::R... | 22.037037 | 73 | 0.752941 |
61d6927762e767d27368c91092e12fdc46cfcb2d | 155 | class Product < ApplicationRecord
has_many :carts
has_many :wish_lists
has_many :users, through: :carts
has_many :users, through: :wish_lists
end
| 19.375 | 39 | 0.76129 |
388330ecd7c12f58f5d401505486018619b98750 | 240 | require 'rubygems'
require 'dogapi'
api_key = '9775a026f1ca7d1c6c5af9d94d9595a4'
app_key = '87ce4a24b5553d2e482ea8a8500e71b8ad4554ff'
dog = Dogapi::Client.new(api_key, app_key)
dog.create_user(id: 'test@datadoghq.com', name: 'test user') | 26.666667 | 60 | 0.791667 |
879b172fe87d0859b5b39692a295a5b5bce8bffa | 630 | require 'fzeet'
include Fzeet
Application.run { |window|
(browser = WebBrowser.new(window)).
on(:NavigateComplete) {
browser.document.on(:ready) {
all = browser.document.all
all.get('html').get(0).
css(overflow: 'auto')
all.get('body').get(0).
css(overflow: 'auto', margin: ... | 23.333333 | 77 | 0.560317 |
ff00be643353d6a59f0f5e5928edb72fe91c8410 | 10,722 | require 'spec_helper'
module Bosh::Director
module DeploymentPlan
describe Planner do
subject(:planner) { described_class.new(planner_attributes, minimal_manifest, cloud_config, runtime_config, deployment_model) }
let(:event_log) { instance_double('Bosh::Director::EventLog::Log') }
let(:cloud_... | 38.430108 | 143 | 0.570976 |
39b8d1187060bc53ba1faafb18b4355dbce2486c | 356 | class ClubHopper::Event
attr_accessor :name, :date, :url
@@all = []
def self.all
@@all
end
def content
@content ||= ClubHopper::Scraper.new(url).scrape_details
end
def f_event
@f_event
end
def self.open_in_browser
system("open '#{url}'")
end
def save
@@all << self
end
e... | 6.137931 | 60 | 0.55618 |
39d3340994b7712506f62d06d0295ada59a6abd6 | 7,822 | #
# Be sure to run `pod spec lint YJCocoa.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://github.com... | 46.284024 | 102 | 0.613909 |
39566e68264c926607e953112e387b5182bd123a | 220 | FactoryGirl.define do
factory :user do
card_num '213111512'
student_id '10211102'
true_name '郭耿瑞'
college '物理系'
introduce 'tairy is a good boy!'
phone '15850692128'
status 'Nomal'
end
end
| 18.333333 | 36 | 0.663636 |
e8dd429aff7e665cffeda32e1b49a950b8f78df0 | 1,032 | # encoding: UTF-8
# frozen_string_literal: true
FactoryBot.define do
factory :payment_address do
address { Faker::Blockchain::Bitcoin.address }
member { create(:member, :level_3) }
wallet { Wallet.active_deposit_wallet('usd') }
trait :btc_address do
wallet { Wallet.active_deposit_wallet('btc')... | 28.666667 | 78 | 0.677326 |
bbda16f7441ea3c5dad89a5ceb1215915ec0b5d7 | 82 | require "hbc/artifact/moved"
class Hbc::Artifact::App < Hbc::Artifact::Moved
end
| 16.4 | 47 | 0.743902 |
d55130cd541672d18e203b7aef7697535b01f377 | 4,738 | require 'spec_helper'
describe PeopleController, type: :controller do
before(:each) do
@request.env["devise.mapping"] = Devise.mappings[:person]
end
describe "#check_email_availability" do
before(:each) do
@request.host = "#{FactoryGirl.create(:community).ident}.lvh.me"
end
it "should re... | 38.520325 | 175 | 0.623259 |
ede8ed4ff7f8b3e869167f1ed8849e78f6332dee | 328 | class User < ApplicationRecord
has_many :twitter_accounts
has_many :tweets
has_secure_password
validates :email, presence: true, format: {
with: URI::MailTo::EMAIL_REGEXP,
message: 'must be a valid email address'
}
validates :password, presence: true
validates :password_confirmation, presence: t... | 23.428571 | 50 | 0.746951 |
1cfe630df1c826b7c5b5ed4342f981b1b8c1ad92 | 671 | class CommentsController < ApplicationController
# 启用简单HTTP 身份验证系统 用户名和密码正确才可访问 仅有登录后才可访问destroy
http_basic_authenticate_with name:"summit",password:'123qwe',only: :destroy
def create
@article=Article.find(params[:article_id])
@comment=@article.comments.create(comment_params)
redirec... | 30.5 | 79 | 0.687034 |
61eac937f65f4c2aa00d61ea06c7171ba5259817 | 693 | #!/usr/bin/env ruby
# encoding: UTF-8
require_relative 'helper'
class TestExprOr < TestImpl
def test_or_native
x = WAB::Impl::Or.new(WAB::Impl::Has.new('num'), WAB::Impl::Eq.new('num', 7))
assert_equal(['OR', ['HAS', 'num'], ['EQ', 'num', 7]], x.native, 'OR native mismatch')
end
def test_or
d = ma... | 27.72 | 90 | 0.623377 |
e89fd89de16d712215dce5c6f6dada779ee7f5bf | 622 | require 'rake'
require 'rspec/core/rake_task'
desc "Bring up Vagrant VM"
task :up do
if ENV['ANSIBLE_ETCKEEPER_VAGRANT_PROVIDER']
sh 'vagrant', 'up', '--no-provision', '--provider', ENV['ANSIBLE_ETCKEEPER_VAGRANT_PROVIDER']
else
sh %{vagrant up --no-provision}
end
end
desc "Provision Vagrant VM"
task ... | 18.294118 | 97 | 0.696141 |
4a2fe88ed1fca1c7484631fdcb24aebf2a4fb1ee | 7,520 | require 'deprecation'
module ActiveFedora
module AttachedFiles
extend ActiveSupport::Concern
extend Deprecation
self.deprecation_horizon = "active-fedora 10.0"
def ds_specs
self.class.child_resource_reflections
end
deprecation_deprecate :ds_specs
def serialize_attached_files
... | 34.814815 | 176 | 0.662633 |
1dec6a96dd36ee67ea6e4adcdd47e810c425179c | 879 | # rubocop:disable LineLength
module Moonshot
module Commands
module ParameterArguments
def parser
parser = super
parser.on('--[no-]interactive', TrueClass, 'Use interactive prompts for gathering missing configuration.') do |v|
Moonshot.config.interactive = v
end
p... | 31.392857 | 121 | 0.61661 |
030116d7ed764ede55f85195d4fd0954979ed4f0 | 3,854 | require "spec_helper"
RSpec.describe Graphiti::Delegates::Pagination do
include_context "pagination_context"
let(:instance) { described_class.new(proxy) }
describe "#links" do
subject { instance.links }
before do
allow(instance).to receive(:item_count).and_return(current_per_page * total_pages)
... | 32.386555 | 122 | 0.659315 |
7a7d89a294ae6a2edea466d1c43a249c45082049 | 775 | require 'yaml'
require 'erb'
require 'ostruct'
module MoyasarFixtures
# Return the path to the JSON fixtures directory
def fixtures_dir
File.join File.dirname(__FILE__), "fixtures"
end
# Return a filename for a JSON fixture
def fixture_file(filename)
File.join fixtures_dir, "#{filename}.yml"
end
... | 25 | 65 | 0.716129 |
79900d1aedd9dbed041c4dde8bd27132d4437058 | 68 | json.extract! cash_log, :id, :title, :tag_str, :amount, :created_at
| 34 | 67 | 0.720588 |
189f47bbf0b797dc1bf9d0179ad998a4c3a61307 | 1,616 | require 'jekyll'
require 'test/testbase'
require 'src/_plugins/poplink'
class TestPoplink < Testbase
def setup
@site_mock = MiniTest::Mock.new()
@content_path = "to/content"
@poplink_conf = {
"content_dir" => @content_path,
"poplinks" => {
"the-id" => {
"title" => "Defaul... | 27.862069 | 198 | 0.600866 |
79e5a124c2659685b65425884ae1f04e032f6dd5 | 1,609 | #
# Be sure to run `pod lib lint ${POD_NAME}.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = '${POD_N... | 37.418605 | 108 | 0.61964 |
33cb2c2140c263a1032c53c9c4a482a6b55bcde6 | 57 | # Assorted utilities and helper methods.
module Lib; end
| 19 | 40 | 0.789474 |
391f1470de6842ec5f3cbc1a71ba0c45c37cc2fa | 2,912 | control 'V-73731' do
title "The Access this computer from the network user right must only be
assigned to the Administrators, Authenticated Users, and
Enterprise Domain Controllers groups on domain controllers."
desc "Inappropriate granting of user rights can provide system,
administrative, and other high-lev... | 38.826667 | 139 | 0.731113 |
1adb63e7cbc467cdd8b248cb934abec8baa176fc | 700 | cask "telavox-flow" do
version "1.119.1"
sha256 "12eb4ab234578e8df8b540d8bf118111489542583b1f8efc6974b688d3023498"
url "https://s3.eu-west-2.amazonaws.com/flow-desktop/Telavox-#{version}.dmg",
verified: "s3.eu-west-2.amazonaws.com/flow-desktop/"
name "Telavox Flow"
desc "Communication and collaboration... | 26.923077 | 79 | 0.725714 |
115d448d1f1674fd48b50c3ee9e137fdb33e7571 | 185 | require 'spec_helper'
describe WelcomeController do
describe "GET 'index'" do
it "returns http success" do
get 'index'
response.should be_success
end
end
end
| 14.230769 | 32 | 0.681081 |
fff1795ce0cb174b6924639381dac9cbb13bb3c7 | 993 | class Multirust < Formula
desc "Manage multiple Rust installations"
homepage "https://github.com/brson/multirust"
# Use the tag instead of the tarball to get submodules
url "https://github.com/brson/multirust.git",
:tag => "0.8.0",
:revision => "8654d1c07729e961c172425088c451509557ef32"
revision 1... | 31.03125 | 94 | 0.734139 |
f8b6a43f5978d765f0fd971beec0f714683be8b5 | 188 | class CreateRarbacRoles < ActiveRecord::Migration
def change
create_table :rarbac_roles do |t|
t.string :name
t.string :description
t.timestamps
end
end
end
| 17.090909 | 49 | 0.680851 |
1cb1abcf3c8ef9868eaeb61b8ead4db9730c502a | 1,494 | # coding: utf-8
Gem::Specification.new do |spec|
spec.name = "alembic-jekyll-theme"
spec.version = "3.0.8"
spec.authors = ["David Darnes"]
spec.email = ["me@daviddarnes.com"]
spec.summary = %q{A Jekyll boilerplate theme designed to be a starting point for any Jekyll websit... | 46.6875 | 208 | 0.691432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.