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 |
|---|---|---|---|---|---|
e277effb95921a69ffb05d9365b97056cd64295d | 958 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'zklib/version'
Gem::Specification.new do |spec|
spec.name = 'zklib'
spec.version = Zklib::VERSION
spec.platform = Gem::Platform::RUBY
spec.license = 'MIT'
spec.summary = 'Att... | 34.214286 | 104 | 0.674322 |
037d12e4d38d490440b3889dad0d0a8684585d7d | 7,753 | =begin
#NSX-T Data Center Policy API
#VMware NSX-T Data Center Policy REST API
OpenAPI spec version: 3.1.0.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.19
=end
require 'date'
module NSXTPolicy
class ConsolidatedEffectiveIPAddressMemberListResult
# Link to... | 29.256604 | 107 | 0.611376 |
1c4a6b795367df49f10dcfb2913b4b9e628de977 | 16,611 | class PhpAT72 < Formula
desc "General-purpose scripting language"
homepage "https://www.php.net/"
# Should only be updated if the new version is announced on the homepage, https://www.php.net/
url "https://www.php.net/distributions/php-7.2.27.tar.xz"
sha256 "7bd0fb9e3b63cfe53176d1f3565cd686f90b3926217158de5ba... | 32.380117 | 113 | 0.622479 |
338599393909bbf7d3a364da68ad5eebbf8d617b | 624 | module LikeDislike
class VotesController < ActionController::Base
before_action :find_likeable
before_action :authenticate_user!
respond_to :js
def create
@likeable.liked_by current_user
render json: render_votes
end
def destroy
@likeable.disliked_by current_user
rend... | 21.517241 | 71 | 0.711538 |
0342cd01f4a33fe734c0346c797ccb2fde696d35 | 267 | module Bootstrap2Helpers
module Bootstrap
module Rails
require 'bootstrap_2_helpers/bootstrap/rails/engine' if defined?(Rails)
end
end
end
require 'bootstrap_2_helpers/version'
require 'bootstrap_2_helpers/bootstrap/rails/engine' if defined?(Rails)
| 26.7 | 77 | 0.790262 |
ff1127f40527bc3540cc887fd420752f66fa80ec | 1,331 | # 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
require 'aws-sdk-core'
require 'aws-sigv4'
require_relative 'aws-sdk-sms/typ... | 24.648148 | 96 | 0.732532 |
ff3b8f2ba9bed63fefbc73ec5623e131e2fb127d | 183 | class CreateContacts < ActiveRecord::Migration[5.2]
def change
create_table :contacts do |t|
t.timestamps
t.text :name
t.text :phone_number
end
end
end
| 16.636364 | 51 | 0.655738 |
1143549338174dcddbf503e6e8c2b48a00e8ed13 | 6,659 | =begin
#Selling Partner API for Direct Fulfillment Shipping
#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data.
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 3.0.33
=... | 31.861244 | 257 | 0.64319 |
e888405015226f071e0a0ceb1ab67fc5826ddad7 | 899 | unless ENV['RAILS_ENV'] == "production"
namespace :spec do
desc 'Run small specs (lib, model, controller)'
task :small => %w[spec:lib spec:models spec:controllers]
desc 'Run large specs (requests).'
task :large => %w[spec:requests]
desc 'Run all specs (including buster).'
task :all => %w[s... | 29 | 108 | 0.626251 |
790373de98c27512dc1d0b56d96238b5f61fe77d | 572 | Pod::Spec.new do |spec|
spec.name = "Every.swift"
spec.version = "1.0.0"
spec.summary = "An Swift wrapper for NSTimer"
spec.homepage = "https://github.com/samhann/Every.swift"
spec.license = { type: 'MIT', file: 'LICENSE' }
spec.authors = { "Samhan" => 'pickledbrains+pods@gmail.com' }
spec.social_media_ur... | 40.857143 | 112 | 0.666084 |
bb8c5f9616f9b568636ab2caadb643cd8acd99d0 | 585 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Web::Mgmt::V2020_09_01
module Models
#
# Defines values for SkuName
#
module SkuName
Free = "Free"
Shared = "Sha... | 23.4 | 70 | 0.644444 |
1a8d4ec553e92115762cb5719c225cb997a34d62 | 121 | class AddCollumToSearches < ActiveRecord::Migration
def change
add_column :searches, :image_url, :string
end
end
| 20.166667 | 51 | 0.768595 |
08d445871d8577008f01fa0752ff21351af86fdc | 47 | module Cronofy
VERSION = "0.37.7".freeze
end
| 11.75 | 27 | 0.702128 |
2656cafeeeb89631bba9b6fe7d051933c3fe7f82 | 359 | class CreatePrsAccounts < ActiveRecord::Migration[6.1]
def change
create_table :prs_accounts do |t|
t.belongs_to :user
t.string :account
t.string :status
t.string :public_key
t.string :encrypted_private_key
t.jsonb :keystore
t.timestamps
end
add_index :prs_acco... | 19.944444 | 54 | 0.668524 |
f7aae90d8ee136611b562b16704042fce5cfdfe8 | 677 | class Micropost < ApplicationRecord
belongs_to :user
has_many :likes, dependent: :destroy
default_scope -> {order(created_at: :desc)}
mount_uploader :picture, PictureUploader
validates :user_id, presence: true
validates :content,presence: true, length: {maximum: 140}
validate :picture_size
def self... | 21.15625 | 59 | 0.676514 |
331e8b779540b3fa8b7fdf79767efc1cae4e06e2 | 2,961 | require "spec_helper"
RSpec.describe IEXCloud::Response do
let(:raw_response) { double(status: 200, body: "OK") }
subject(:response) { described_class.new(raw_response) }
describe "#initialize" do
it "assigns the raw_response" do
expect(response.raw_response).to eq raw_response
end
end
descr... | 25.973684 | 108 | 0.638298 |
11642ea5e11df062045e8ad9b2f9a209cd8ac02f | 2,221 | # -*- coding: utf-8 -*-
# Copyright (C) 2010-2011, 2015 Rocky Bernstein <rockyb@rubyforge.net>
require_relative '../base/subcmd'
class Trepan::Subcommand::SetDifferent < Trepan::SetBoolSubcommand
unless defined?(HELP)
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
HELP = <<-EOH
**#{PREFIX.join(' ')}*... | 30.013514 | 73 | 0.684376 |
33a8372e384bde5fc0630b940a2dd059d1bd89a7 | 435 | Rails.application.routes.draw do
root to: 'welcome#index'
get '/oauth2-callback', to: 'o_auth#oauth_callback'
get '/logout', to: 'o_auth#logout'
get '/login', to: 'o_auth#login'
get '/register', to: 'o_auth#register'
post '/registration_webhook', to: 'registration_webhook#handle_registration'
get '/verif... | 33.461538 | 78 | 0.703448 |
87691b8d1d9bf6199ab943e6aad265b7ba08b775 | 1,603 | require 'test_helper'
class FollowingTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
@other = users(:archer)
log_in_as(@user)
end
test "following page do" do
get following_user_path(@user)
assert_not @user.following.empty?
assert_match @user.following.count.to_s,... | 28.122807 | 77 | 0.703681 |
7a2290f1f0323bfe9676e12d45b53ee2c348c60d | 606 | cask 'principle' do
version '0.0.81'
sha256 '640afca3255a5e1938bf53e4944f37a8116898a4de873a6fdad4e4322a6ddbd7'
# dropboxusercontent.com is the official download host per the vendor homepage
url "https://dl.dropboxusercontent.com/u/13897407/Principle_#{version.dots_to_underscores}.zip"
appcast 'https://dl.dro... | 40.4 | 109 | 0.79538 |
bb7ae74d1ac25550a969d3a3770f18698548dc38 | 6,007 | # -*- encoding: utf-8; frozen_string_literal: true -*-
#
#--
# This file is part of HexaPDF.
#
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
# Copyright (C) 2014-2019 Thomas Leitner
#
# HexaPDF is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero Genera... | 33.747191 | 100 | 0.589978 |
bb26930d7eba602534e4879805961898db6066a1 | 320 | # frozen_string_literal: true
require 'test/unit'
require_relative 'test-helper'
class TestHeartbeat < Test::Unit::TestCase
def test_heartbeat
res = $bien_conn.get '/heartbeat'
assert_instance_of(Faraday::Response, res)
assert_equal(200, res.status)
assert_instance_of(String, res.body)
end
end
| 18.823529 | 46 | 0.74375 |
eda73c3743677b9313e09187b66218b3fbc1b6f7 | 124 | module FeishuBot
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end
end
| 20.666667 | 54 | 0.806452 |
ab79ee0c0186e4e3c7159ea6599181f49a534cbe | 1,135 | cask 'unity-facebook-games-support-for-editor@2018.2.0b3' do
version '2018.2.0b3,0a6b93065060'
sha256 :no_check
url "http://beta.unity3d.com/download/0a6b93065060/MacEditorTargetInstaller/UnitySetup-Facebook-Games-Support-for-Editor-2018.2.0b3.pkg"
name 'Facebook Gameroom Build Support'
homepage 'https://uni... | 31.527778 | 138 | 0.717181 |
d525143c101d876294a487f2e9aad77ad4ded4bd | 143 | # typed: strict
# frozen_string_literal: true
module Calificador
module Context
class ConditionContext < BasicContext
end
end
end
| 14.3 | 41 | 0.755245 |
5df349a5a1fe94b2506a9bbf28f8322b3e783ba8 | 2,115 | require './test/test_helper'
# Essentialy the same as test_threading.rb but with an expanded pool for
# testing multiple connections.
class TestThreadingLargePool < Test::Unit::TestCase
include Mongo
@@db = standard_connection(:pool_size => 50, :timeout => 60).db(MONGO_TEST_DB)
@@coll = @@db.collection('thread... | 23.241758 | 98 | 0.564539 |
398cbd98a9ec51ba2f45b3370bc538197a212887 | 573 | class Api::UsersController < ApplicationController
def index
@users = User.all
render json: @users
end
def show
@user = User.includes(:submitted_responses, polls: [answers: :responses]).find(params[:id])
render :show
end
def create
@user = User.new(user_params)
if @user.save
s... | 19.758621 | 95 | 0.671902 |
79148e98be816e6f5d4bd4b39a6016f786e54f58 | 251 | class CreateYearStatistics < ActiveRecord::Migration
def change
create_table :year_statistics do |t|
t.integer :user_id
t.integer :year
t.json :data
t.timestamps
end
add_index :year_statistics, :user_id
end
end
| 20.916667 | 52 | 0.685259 |
ac8396e6e79dce6ab4a6a1a185f005e4e41b8a67 | 3,789 | 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.184783 | 102 | 0.75508 |
e2a9ad69cc8a9f8c7ef4f8e91a4191d459c82599 | 446 | require "rubygems"
require "sass"
require "compass"
DEFAULT_FRAMEWORKS = ["compass", "blueprint"]
ARGV.each do |arg|
next if arg == "compass"
next if arg == "blueprint"
require arg
end
Compass::Frameworks::ALL.each do |framework|
next if framework.name =~ /^_/
next if DEFAULT_FRAMEWORKS.inclu... | 24.777778 | 88 | 0.697309 |
b92b2da2f21d5610783e37e0709ced134c7db0c4 | 183 | class Post < ActiveRecord::Base
belongs_to :user
has_and_belongs_to_many :tags
has_many :comments
validates :title, :presence => true
validates :body, :presence => true
end
| 22.875 | 37 | 0.743169 |
6af22e7263d5abcbc846000369224112fef94e85 | 1,564 | ##
# This is the controller that allows managing the access groups used for authorizing access to resources.
#
class AccessGroupsController < ApplicationController
before_action :validate_user
before_action :set_access_group, only: [:show, :edit, :update, :destroy]
##
# GET /access_groups
def index
@acce... | 20.853333 | 105 | 0.711637 |
62cdbde2a5a0e308ae86876f94bcc2d632b3901a | 1,321 | # 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
require 'aws-sdk-core'
require 'aws-sigv4'
require_relative 'aws-sdk-backup/... | 24.462963 | 78 | 0.735049 |
5d0085ef0889fdc58dddd184f3d09d13862e85dd | 2,165 | # frozen_string_literal: true
#
# Cookbook:: asdf
# Resource:: script
#
# Copyright:: 2017, Fernando Aleman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... | 29.256757 | 74 | 0.728868 |
4a4168fbff6cdcc214d1d9fd20bba7f33a986f47 | 356 | Sequel.migration do
change do
create_table :reg_0305 do
column :id, Integer, primary_key: true
column :id_pai, Integer, index: true, null: false
column :cod_ccus, String, size: 60
column :func, String, size: 1000
column :vida_util, String, size: 3
column :cnpj_pai, String, size... | 27.384615 | 55 | 0.657303 |
1cb490bdafe9efc31edca5dde3775cf08a60bced | 2,029 | require 'clamp/errors'
require 'clamp/subcommand/definition'
module Clamp
module Subcommand
module Declaration
def recognised_subcommands
@recognised_subcommands ||= []
end
def subcommand(name, description, subcommand_class = self, &block)
unless has_subcommands?
@s... | 29.838235 | 120 | 0.648595 |
288d2ca78f1ee609d579862531c028076ea9d444 | 1,658 | # Copyright 2011 Marek Jelen
#
# 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, s... | 29.607143 | 137 | 0.697226 |
f734609ca3fb1b93ffb60941c4f16e3641439962 | 6,444 | # encoding: utf-8
require File.join(File.dirname(__FILE__), 'spec_helper')
describe FixedWidth::Section do
before(:each) do
@section = FixedWidth::Section.new(:body)
end
it "should have no columns after creation" do
@section.columns.should be_empty
end
describe "when adding columns" do
... | 34.095238 | 156 | 0.604904 |
0839752c91f002510d01746f6b0578c297e3d670 | 2,270 | require "nokogiri"
require "net/http"
require "uri"
module PsnTrophies
class NoUserProfileError < StandardError; end
class Client
def trophies(profile_id)
check_profile_id(profile_id)
body = get_body("http://us.playstation.com/playstation/psn/profile/#{profile_id}/get_ordered_trophies_data",
... | 32.898551 | 118 | 0.64978 |
26352e993516b275bd86362ec8ff392b3a431775 | 5,206 | #
# Cookbook :: ambari
# Attribute :: default
# Copyright 2018, 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.apache.org/licenses/LICENSE-2.0
#
# Unles... | 51.039216 | 195 | 0.733577 |
7ad7f89ba731f3197897a72d036233d103f6c9de | 482 | class OgcFilterProvider
@@ADDITIONAL_QUERYABLE_NAME = "Provider"
# ProviderId is not an ISO queryable, it is captured into AdditionalQueryables
@@CMR_PROVIDER_ID_PARAM = ADDITIONAL_QUERYABLES_TO_CMR_QUERYABLES[@@ADDITIONAL_QUERYABLE_NAME][1]
def process(ogc_filter)
# the provider_id CMR param supports a wi... | 40.166667 | 126 | 0.809129 |
f83dd146b973af423f3e1fee6f29965b02877d16 | 5,205 | # Copyright 2018 Operation Paws for Homes
#
# 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 applicabl... | 41.64 | 122 | 0.631508 |
edd909495c2344c4c8f74299e3c8fb37e25e4604 | 709 | # frozen_string_literal: true
# Detect sites using Cloudflare Polish and bypass it by adding a random
# cache-busting URL param.
#
# @see https://support.cloudflare.com/hc/en-us/articles/360000607372-Using-Cloudflare-Polish-to-compress-images
module Danbooru
class Http
class UnpolishCloudflare < HTTP::Feature
... | 28.36 | 111 | 0.715092 |
ac728ae2323af900faa384cc3a0fe9c96f9b7c85 | 607 | require 'spec_helper'
describe ApplicationHelper do
describe :markup_to_html do
it "should convert markdown into html" do
markdown = <<EOS
* Foo
* Bar
* Baz
EOS
content = helper.markup_to_html(markdown)
content.should have_selector("li", :count => 3)
end
end
describe :path_to_issue do
... | 25.291667 | 129 | 0.69028 |
391ab0d4371b295d56d8ffeb4f1927603d4dee63 | 247 | class AddDefaultsToProjectContent < ActiveRecord::Migration
def change
%i(title description introduction science_case result faq education_content).each do |column|
change_column_default :project_contents, column, ""
end
end
end
| 30.875 | 97 | 0.781377 |
5dd666bd8dae37d5e2fa207554c2a85972b479d6 | 41 | module Emailable
VERSION = '3.0.1'
end
| 10.25 | 19 | 0.682927 |
7a43e21699014d71c931214606627823948e5bf8 | 1,176 | require "spec_helper"
feature "rails application" do
before { Capybara.app = TestRailsApp::Application }
scenario 'block legal request issued by yundun' do
page.driver.header('User-Agent', ' Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;Alibaba.Security.Heimdall.950384.p')
visit '/posts'
expect(... | 31.783784 | 161 | 0.716837 |
5d6c16da71522d3487e172de38d0a8f077f67d55 | 5,338 | class Asset < ActiveRecord::Base
# used for extra mime types that dont follow the convention
@@image_content_types = ['image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg']
@@extra_content_types = { :audio => ['application/ogg'], :movie => ['application/x-shockwave-flash'], :pdf => ['a... | 36.813793 | 149 | 0.633945 |
bbaf8d74b6d01b7476babe5766b9ca752ecf241e | 105 | module Trade
Entity = Struct.new(:cost, :price) do
def volume
cost / price
end
end
end
| 13.125 | 39 | 0.609524 |
bb1a40409dbb0ffec461611ea0466b5512d15e39 | 147 | class AddCurrencyToPaymentTransactions < ActiveRecord::Migration
def change
add_column :payment_transactions, :currency, :integer
end
end
| 21 | 64 | 0.802721 |
ede8ff5603d0b1517598ed191f23de91e24d8da5 | 79 | class User < ActiveRecord::Base
has_secure_password
has_many :players
end
| 13.166667 | 31 | 0.78481 |
b91da6f3ead127e69643d9dae87c679e9e838f94 | 17,354 | # frozen_string_literal: true
# This should be included on any Replicator which implements verification.
#
# Expected let variables:
#
# - primary
# - secondary
# - model_record
# - replicator
#
RSpec.shared_examples 'a verifiable replicator' do
include EE::GeoHelpers
describe 'events' do
it 'has checksum_suc... | 30.552817 | 134 | 0.697188 |
61a70b830dd23c744bb8af3e07bfa4b2b7b2d486 | 457 | control 'verify the settings of all Azure Power BI Dataflows' do
impact 1.0
title 'Testing the singular resource of azure_power_bi_dataflow.'
desc 'Testing the singular resource of azure_power_bi_dataflow.'
describe azure_power_bi_dataflow(group_id: 'f089354e-8366-4e18-aea3-4cb4a3a50b48') do
it { should e... | 35.153846 | 87 | 0.750547 |
e8ec490baf491f8124ed7caaad148822fef43fa9 | 379 | require "vcr"
VCR.configure do |config|
config.allow_http_connections_when_no_cassette = true
config.cassette_library_dir = "spec/vcr"
config.hook_into :webmock
config.ignore_localhost = true
config.configure_rspec_metadata!
config.default_cassette_options = { match_requests_on: [:method, :host], record: :... | 31.583333 | 98 | 0.791557 |
bfa7890b2f302246f2252bf0479f02ddf5aeb8a7 | 3,045 | module Elasticsearch
module API
module Indices
module Actions
# Return the result of the analysis process (tokens)
#
# Allows to "test-drive" the Elasticsearch analysis process by performing the analysis on the
# same text with different analyzers. An ad-hoc analysis chain c... | 46.846154 | 157 | 0.600328 |
1c2c80bb87f54b24112d00ec1087fa837b5abbb0 | 353 | RSpec.describe Magick::Pixel, '#alpha' do
it 'works' do
pixel = described_class.from_color('brown')
expect { pixel.alpha = 123 }.not_to raise_error
expect(pixel.alpha).to eq(123)
expect { pixel.alpha = 255.25 }.not_to raise_error
expect(pixel.alpha).to eq(255)
expect { pixel.alpha = 'x' }.to ... | 29.416667 | 58 | 0.679887 |
911662c92336156a6afda537468c0727ae894a92 | 10,591 | # encoding: utf-8
require 'spec_helper'
describe RuboCop::Cop::Style::SpaceInsideBlockBraces do
SUPPORTED_STYLES = %w(space no_space)
subject(:cop) { described_class.new(config) }
let(:config) do
merged = RuboCop::ConfigLoader
.default_configuration['Style/SpaceInsideBlockBraces']
... | 33.305031 | 79 | 0.598055 |
26b5e5d1daa954da0538580d0f08fa0c8b84eb2e | 4,317 | require 'beaker-task_helper/inventory'
require 'bolt_spec/run'
require 'beaker-pe'
require 'beaker-puppet'
require 'beaker-rspec'
require 'beaker/puppet_install_helper'
require 'beaker/module_install_helper'
require 'beaker/testmode_switcher'
require 'beaker/testmode_switcher/dsl'
run_puppet_install_helper
configure_t... | 34.814516 | 145 | 0.699792 |
260b923a4adac556146d15ce53d81a49982f9d3a | 3,345 | require_relative '../../../test_helper'
require 'minitest/mock'
module Geminabox
module Proxy
class CopierTest < Minitest::Test
def setup
clean_data_dir
end
def test_remote_content_failure
raise_stub = proc { puts caller.join("\n") ; raise }
copier.stub :remote_content... | 24.23913 | 103 | 0.64006 |
f855de3282cc037dd8de3f460b5fdcf091e1e668 | 5,131 | # encoding: utf-8
require "spec_helper"
require "fileutils"
require "tempfile"
module Bunch
describe FileCache do
let(:input_1) { FileTree.from_hash("a" => "1", "b" => "2") }
let(:input_2) { FileTree.from_hash("a" => "1", "b" => "3") }
let(:result_1) { FileTree.from_hash("a" => "!", "b" => "@") }
le... | 33.756579 | 79 | 0.620737 |
f75f997df9c62653c53f8cfd33941513d30c21a9 | 2,145 | class Flex < Formula
desc "Fast Lexical Analyzer, generates Scanners (tokenizers)"
homepage "https://github.com/westes/flex"
url "https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz"
sha256 "e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995"
revision 1
bottle do
sha... | 29.383562 | 94 | 0.642424 |
ed29909b90008da63ac76fedd9d7a8abf0d65d2b | 3,243 | # frozen_string_literal: true
require 'json'
module Saharspec
module Matchers
# @private
class BeJson
include RSpec::Matchers::Composable
include RSpec::Matchers # to have #match
ANY = Object.new.freeze
attr_reader :actual, :expected
def initialize(expected, **parse_opts)
... | 30.59434 | 100 | 0.618871 |
6271afa3168b2048683bb76487507edac6319964 | 526 | Gem::Specification.new do |s|
s.name = "shibe"
s.version = "1.0.0"
s.summary = "very Cuba"
s.description = "Wow Shibe, Such Doge, very Cuba"
s.authors = ["elcuervo"]
s.licenses = ["MIT", "HUGWARE"]
s.email = ["yo@brunoaguirre.com"]
s.... | 35.066667 | 58 | 0.505703 |
218fbffaadbabb8f962374bfd9f77d84df0bceec | 1,303 |
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "bitrix_webhook/version"
Gem::Specification.new do |spec|
spec.name = "bitrix_webhook"
spec.version = BitrixWebhook::VERSION
spec.authors = ["Serhii Danovskyi"]
spec.email = ... | 36.194444 | 96 | 0.668457 |
38d1f1a4408d8652f4faa3f9a45de967d37923c7 | 431 | require 'datamappify/data/criteria/relational/concerns/find'
require 'datamappify/data/criteria/active_record/criteria_method'
module Datamappify
module Data
module Criteria
module ActiveRecord
class Find < CriteriaMethod
include Relational::Concerns::Find
private
de... | 20.52381 | 65 | 0.663573 |
b9089be7bb923552a695d6f6692dcd9ad12ff1f2 | 1,030 | namespace :db do
desc 'Erase all tables'
task :clear => :environment do
HostEnv.safe do
clear_database
end
end
desc 'Clear the database, run migrations and basic seeds (not users, teams, roles)'
task :reseed => :clear do
Rake::Task['db:structure_load'].invoke
Rake::Task['data:migrate']... | 21.914894 | 85 | 0.659223 |
5d99c027a08481366da202a9d4bf4c2806a57117 | 420 | class Plan < ActiveRecord::Base
has_many :teams
validates_presence_of :name
validates_presence_of :max
validates_presence_of :price
validates_uniqueness_of :name
validates_length_of :name, :maximum => 255
validates_numericality_of :max, :less_than_or_equal_to => 65535
validates_numericality_of :price
... | 26.25 | 66 | 0.761905 |
08472c9aecafe17629a0438db6d8c012d45e603d | 909 | # frozen_string_literal: true
class TakedownJob
include Sidekiq::Worker
sidekiq_options queue: 'high_prio', lock: :until_executing, lock_args_method: :lock_args
def self.lock_args(args)
[args[0]]
end
def perform(id, approver, del_reason)
@takedown = Takedown.find(id)
@approver = User.find(appro... | 25.971429 | 90 | 0.651265 |
391b121f385de9eb0a90dd9a70dd87eadb6feca4 | 1,696 | description 'YAML based user storage'
require 'yaml/store'
class YamlfileService < User::Service
def initialize(config)
FileUtils.mkpath(File.dirname(config[:store]))
@store = ::YAML::Store.new(config[:store])
end
# @override
def find(name)
@store.transaction(true) do |store|
user = store[na... | 25.313433 | 100 | 0.638561 |
3954906c00f4ee5aa4fd89f872c8bd19ea6cf837 | 904 | #
# Cookbook:: sbp_cloudmonkey
# Attribute:: default
#
# Copyright:: Schuberg Philis
#
# 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
#
# Unl... | 34.769231 | 74 | 0.742257 |
f82b2ec270d68c2dbbb7f157777f1f46860cf1e0 | 1,500 | class AuthorityDecorator < Draper::Decorator
delegate_all
def internal_position
I18n.t("authorities.positions.#{object.internal_position}")
end
def full_name
"#{object.person.surname}, #{object.person.name}"
end
def bloc_party
object.person.try :bloque
end
def edit_url
h.edit_authori... | 23.4375 | 74 | 0.682 |
6ae12db8f8e19330195491b6049c88078504ee11 | 495 | require "cronofy/version"
require "cronofy/errors"
require "cronofy/types"
require "cronofy/auth"
require "cronofy/client"
require "cronofy/response_parser"
require 'json'
module Cronofy
def self.api_url
@api_url ||= (ENV['CRONOFY_API_URL'] || "https://api.cronofy.com")
end
def self.api_url=(value)
@api... | 19.038462 | 70 | 0.690909 |
089128dfb1e249f9a84335c63564bcb55162d521 | 14,794 | # frozen_string_literal: true
require 'rails_helper'
describe AssignmentsController, type: :request do
let(:slug_params) { 'Wikipedia_Fellows/Basket-weaving_fellows_(summer_2018)' }
let!(:course) { create(:course, id: 1, submitted: true, slug: slug_params) }
let!(:user) { create(:user) }
before do
stub_w... | 37.836317 | 100 | 0.645532 |
bf072ac49693e8c1ad6624b6761fb6e3a0568fa7 | 77 | # frozen_string_literal: true
module ProblemDetails
VERSION = '0.2.2'
end
| 12.833333 | 29 | 0.753247 |
28acf9ff86bbc4ed6a026cae63aa613f78cc05bc | 332 | class NotifyingCountryForm
include ActiveModel::Model
include ActiveModel::Attributes
include ActiveModel::Serialization
attribute :country, :string
validates :country, inclusion: { in: Country.notifying_countries.map(&:last) }
def self.from(investigation)
new(country: investigation.notifying_country... | 23.714286 | 80 | 0.78012 |
08c0567b4ae3e1b1f0a8d019452c73b609e144c8 | 2,301 | require_relative '../model'
require_relative './review_submission_item'
module Spaceship
class ConnectAPI
class ReviewSubmission
include Spaceship::ConnectAPI::Model
attr_accessor :platform
attr_accessor :state
attr_accessor :submitted_date
attr_accessor :app_store_version_for_rev... | 31.094595 | 119 | 0.677532 |
1cea1cd2f096c6835597c00f41dce4ff1e7bf179 | 1,094 | require 'test_helper'
class TopicsControllerTest < ActionDispatch::IntegrationTest
setup do
@topic = topics(:one)
end
test "should get index" do
get topics_url
assert_response :success
end
test "should get new" do
get new_topic_url
assert_response :success
end
test "should create t... | 22.326531 | 117 | 0.698355 |
ffb504cc5732e618eeaa391b015f010ea642e923 | 404 | require 'spec_helper'
describe 'User visits the authentication log page' do
let(:user) { create(:user) }
before do
sign_in(user)
visit(audit_log_profile_path)
end
it 'shows correct menu item' do
expect(find('.sidebar-top-level-items > li.active')).to have_content('Authentication log')
expect... | 23.764706 | 94 | 0.707921 |
017121a1253087cada852517778b0ef2b98a4ba7 | 10,178 | =begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.0.0-SNAPSHOT
=en... | 37.557196 | 157 | 0.669876 |
38dd2474ca16a873ac97e1249a13052216f202f5 | 7,094 | =begin
#Selling Partner API for Orders
#The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based decision support tools.
OpenAPI spec version: v0
Gener... | 31.811659 | 247 | 0.639132 |
d587b59c651614f19ef5febd1c85606455633138 | 38 | module Rolify
VERSION = "3.4.0"
end
| 9.5 | 19 | 0.657895 |
084d70fc2043f3423a6acc4b29123fb28a71301e | 448 | Pod::Spec.new do |s|
s.name = 'Colours'
s.version = '0.0.1'
s.summary = '100s of beautiful, predefined UIColors and UIColor methods.'
s.author = {
'Ben Gordon' => 'brgordon@ua.edu'
}
s.source = {
:git => 'https://github.com/bennyguitar/Colours-for-iOS.git',
:commit => '916c095'... | 28 | 80 | 0.578125 |
bb8a91bfa8fc5a6544f34e4d6e60a55a69cef6ce | 2,817 | #
# Copyright 2014-2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "... | 25.378378 | 88 | 0.656372 |
39fe9968776a9e148bbdb9a0c020c120a4589ccb | 163 | class LessonWordSynonym < ActiveRecord::Base
belongs_to :lesson_word
belongs_to :synonym
validates_uniqueness_of :lesson_word_id, :scope => :synonym_id
end
| 23.285714 | 64 | 0.803681 |
1ca7185045053d30d164cf68661b04f00dd03d74 | 338 | class AddExifTagToCaptureDeviceMakerAndModel < ActiveRecord::Migration
def self.up
add_column :capture_device_makers, :exif_tag, :string
add_column :capture_device_models, :exif_tag, :string
end
def self.down
remove_column :capture_device_makers, :exif_tag
remove_column :capture_device_models, :e... | 28.166667 | 70 | 0.789941 |
870016258ffbb7257fca052a8353048098d2a5f0 | 580 | # frozen_string_literal: true
module RuboCop
module Cop
module SketchupDeprecations
# Method is deprecated. Use `SKETCHUP_CONSOLE.show` instead.
class ShowRubyPanel < SketchUp::Cop
MSG = 'Method is deprecated. Use `SKETCHUP_CONSOLE.show` '\
'instead.'.freeze
def_node_... | 22.307692 | 67 | 0.632759 |
bb702e325e3e49ef4939c7fa5d86ea4d5ed67709 | 498 | class GravatarUrlBuilder
attr_reader :user, :size
private :user, :size
def initialize(user, size)
@user, @size = user, size
end
def url
"http://www.gravatar.com/avatar/#{gravatar_hash}?s=#{size}&d=#{default_url}"
end
private
def gravatar_hash
Digest::MD5.hexdigest(sanitised_user_email)
... | 18.444444 | 80 | 0.708835 |
4a48b7a50c6d6cf759fa21b13309f8b5ebe88b8f | 6,232 | unless ENV['SKIP_SAMPLE_IMAGES']
Spree::Sample.load_sample('products')
Spree::Sample.load_sample('variants')
products = {}
products[:ror_baseball_jersey] = Spree::Product.find_by!(name: 'Ruby on Rails Baseball Jersey')
products[:ror_tote] = Spree::Product.find_by!(name: 'Ruby on Rails Tote')
products[:ror_b... | 30.851485 | 117 | 0.618421 |
f893fba3920db8c7d308d24229e170bde20ff07a | 2,905 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::HttpServer::HTML
def initialize(info = {})
super(update_info(info,
... | 26.171171 | 107 | 0.554217 |
08000590e230654f81efefece65f7e5ab5cb80ca | 4,541 | require File.dirname(__FILE__) + '/../test/test_helper'
class LiveValidationTest < ActiveRecord::TestCase
def setup
Resource.class_eval do # reset live validations
@live_validations = {}
end
end
def test_live_validations_accessor
assert_kind_of(Hash, Resource.live_validations)
end
de... | 37.528926 | 120 | 0.723849 |
ff202a6cd79802056fbe8e120dd58a9fc7055d72 | 486 | # frozen_string_literal: true
require 'sauce_bindings'
require 'rspec'
describe 'Create Session' do
it 'starts session' do
# 1. Create Session object with the defaults
session = SauceBindings::Session.new
# 2. Start Session to get the Driver
driver = session.start
# 3. Use the driver in your t... | 23.142857 | 64 | 0.705761 |
6a5b5d0e7ce572545fbb7e1c40d1fa7de7486a17 | 26,190 | # -*- coding: binary -*-
require 'msf/core'
require 'msf/core/exploit/mssql_commands'
module Msf
###
#
# This module exposes methods for querying a remote MSSQL service
#
###
module Exploit::Remote::MSSQL
include Exploit::Remote::MSSQL_COMMANDS
include Exploit::Remote::Udp
include Exploit::Remote::Tcp
includ... | 27.395397 | 319 | 0.571554 |
f7872f07ab690486deb54b3fb2abaa7101272883 | 2,530 | # frozen_string_literal: true
require 'common/client/configuration/rest'
require 'common/client/middleware/request/camelcase'
require 'common/client/middleware/response/json_parser'
require 'common/client/middleware/response/raise_error'
require 'common/client/middleware/response/mhv_errors'
require 'common/client/mid... | 33.289474 | 97 | 0.716601 |
f834b96bb919420a805f3662f6712e3fc5d3826a | 2,456 | require File.expand_path('../../fixtures/constants', __FILE__)
module ConstantSpecs
end
describe "Module#const_set" do
it "sets the constant specified by a String or Symbol to the given value" do
ConstantSpecs.const_set :CS_CONST401, :const401
ConstantSpecs::CS_CONST401.should == :const401
ConstantSpec... | 37.784615 | 84 | 0.721091 |
91d920fb62c01056379ea5529f7940dd8b3c35f6 | 163 | # frozen_string_literal: true
require 'test_helper'
class NavigationTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
| 16.3 | 54 | 0.742331 |
62aa0a1046562795966f3b314f1b5af52a368070 | 993 | require "http"
require "noticed/engine"
module Noticed
autoload :Base, "noticed/base"
autoload :Coder, "noticed/coder"
autoload :Translation, "noticed/translation"
module DeliveryMethods
autoload :Base, "noticed/delivery_methods/base"
autoload :ActionCable, "noticed/delivery_methods/action_cable"
... | 28.371429 | 66 | 0.752266 |
e2241dfd6b91466af500560a93d309efbaffcf08 | 955 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'mina/oblako/version'
Gem::Specification.new do |spec|
spec.name = 'mina-oblako'
spec.version = Mina::Oblako::VERSION
spec.authors = ['gydroperit']
spec.email ... | 36.730769 | 84 | 0.652356 |
6153928303a24270c2a82468c48be05c4e48e927 | 1,078 | # -*- coding: utf-8 -*-
require 'helper'
class TestBreaks02 < Test::Unit::TestCase
def setup
setup_dir_var
end
def teardown
File.delete(@xlsx) if File.exist?(@xlsx)
end
def test_page_breaks02
@xlsx = 'page_breaks02.xlsx'
workbook = WriteXLSX.new(@xlsx)
worksheet = workbook.add_workshee... | 29.135135 | 93 | 0.453618 |
ff0882dfcb4cc9ca5f7b27f34980f6f00d3cf362 | 21,531 | # frozen_string_literal: true
require 'spec_helper'
require 'selenium-webdriver'
RSpec.shared_examples 'Capybara::Session' do |session, mode|
let(:session) { session }
context 'with selenium driver' do
describe '#driver' do
it 'should be a selenium driver' do
expect(session.driver).to be_an_ins... | 43.062 | 235 | 0.642794 |
e9e191851e89d0fd9b34c1f859dda796aa3a57f7 | 5,444 | require "rails_helper"
RSpec.describe MiqExpression::Field do
describe ".parse" do
it "can parse the model name" do
field = "Vm-name"
expect(described_class.parse(field).model).to be(Vm)
end
it "can parse a namespaced model name" do
field = "ManageIQ::Providers::CloudManager::Vm-name"
... | 34.675159 | 99 | 0.673218 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.