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 |
|---|---|---|---|---|---|
38fedca5cbdd1738ced5e9a20eebd9429592c8d6 | 1,332 | require File.expand_path("../lib/decent_exposure/version", __FILE__)
Gem::Specification.new do |spec|
spec.name = "decent_exposure"
spec.version = DecentExposure::VERSION
spec.authors = ["Pavel Pravosud", "Stephen Caudill"]
spec.email = ["info@hashrocket.com"]
spec.summary = "A helper for creating declarativ... | 42.967742 | 79 | 0.749249 |
38adeb59daf05ff3a0c8453648b239a933e23c6e | 74 | class InspectionFinding < ActiveRecord::Base
belongs_to :inspection
end
| 18.5 | 44 | 0.824324 |
7a63a35c92fff9b98995bf88fd23b2fd0e3e3cda | 2,716 | require "yaml"
module Fog
require "fog/core/deprecation"
# Sets the global configuration up from a Hash rather than using background loading from a file
#
# @example
# Fog.credentials = {
# :default => {
# :example_url => "https://example.com/"
# :example_username => "bob",
# ... | 30.177778 | 97 | 0.673417 |
5d5c7a99ba589290672ace264d1b7641501e8730 | 55 | DummyView = ActionView::Base.with_empty_template_cache
| 27.5 | 54 | 0.872727 |
21f2cf6b7f9c2b8a282e4b52d6957edb30c3453f | 1,723 | =begin
#TextMagic API
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.8
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests... | 28.716667 | 102 | 0.752176 |
b91f33099a04779150fc0909e78cb48cc06143b5 | 825 | #
# Author:: Salim Alam (<salam@chef.io>)
# Copyright:: Copyright (c) 2016 Chef, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://ww... | 27.5 | 74 | 0.713939 |
1d1f5ba6d638dd495066c19f5782d579fa04ae47 | 2,602 | #!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
#
# License:: 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
#
# ... | 31.349398 | 80 | 0.686011 |
ab9eca1c58f871aabbff9097fe4d48fefd5fcf5e | 699 | class Chef
class Provider
class MariaChefGem < Chef::Provider::LWRPBase
use_inline_resources if defined?(use_inline_resources)
def whyrun_supported?
true
end
def action_install
converge_by 'install mysql chef_gem and dependencies' do
recipe_eval do
r... | 20.558824 | 65 | 0.589413 |
28d030710ab87094883a77f1413a90fd159ebfbf | 25,988 | Sketchup::require 'geores_src/geores_import/geores_rexml/namespace.rb'
Sketchup::require 'geores_src/geores_import/geores_rexml/xmltokens.rb'
Sketchup::require 'geores_src/geores_import/geores_rexml/attribute.rb'
Sketchup::require 'geores_src/geores_import/geores_rexml/syncenumerator.rb'
Sketchup::require 'geores_src/g... | 32.771753 | 106 | 0.542443 |
331f5a633840a71136ee2a1354f0f3d59ba8cffd | 2,985 | require "scale"
require_relative "./ffi_helper.rb"
def assert_storage_key_for_value(module_name, storage_name, expectation)
m = u8_array_to_pointer module_name.bytes
s = u8_array_to_pointer storage_name.bytes
e = u8_array_to_pointer expectation.hex_to_bytes
Rust.assert_storage_key_for_value(m, m.size, s, s.siz... | 45.923077 | 179 | 0.80268 |
7a1365a007c6e4cd6cd280a1ef49874eaf25ed4c | 4,155 | #
# Cookbook Name:: selinux
# Recipe:: default
#
# Copyright 2011, 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
#
# U... | 31.240602 | 108 | 0.672443 |
acd90d9b8ad17455cdfbb0682d5696b9975ddd55 | 390 | module Mutant
class Mutator
class Node
# Mutator for super without parentheses
class ZSuper < self
handle(:zsuper)
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
emit_singletons
... | 15 | 45 | 0.517949 |
21d30cdd86e3ee44922d16c8779045bf5e72dc3c | 347 | class ResultDetail < StudyRelationship
def attribs
{
:recruitment_details => xml.xpath('//clinical_results').xpath('participant_flow').xpath('recruitment_details').children.text,
:pre_assignment_details => xml.xpath('//clinical_results').xpath('participant_flow').xpath('pre_assignment_details').child... | 31.545455 | 137 | 0.737752 |
e866cdfbeec4c957bfe4fd540185bd3798af965f | 956 | # typed: true
module KubeDSL
class FieldRes
include StringHelpers
include RbiHelpers
attr_reader :name, :type, :required
alias_method :required?, :required
def initialize(name, type, required)
@name = name
@type = type
@required = required
end
def fields_to_ruby(_infl... | 21.244444 | 120 | 0.614017 |
1dab5f6c8a3ca2c2c91d7894c8eb77d55ddf5625 | 222 | require 'rails_helper'
RSpec.describe Friendship, type: :model do
describe 'Like' do
it { should belong_to(:sender) }
it { should belong_to(:receiver) }
it { should validate_presence_of(:status) }
end
end
| 22.2 | 47 | 0.698198 |
91b3e2fd23dae5da908c6d607ef4d76badfbc816 | 386 | class CreateUsers < ActiveRecord::Migration[5.2]
def change
create_table :users do |t|
t.string :username
t.string :phone_number
t.string :password_digest
t.string :openid
t.string :nickname
t.integer :sex
t.string :province
t.string :country
t.string :headimg... | 20.315789 | 48 | 0.629534 |
6163f6b01882e4c0e5db245366fc852f16fcd024 | 521 | require 'formula'
class Sslscan < Formula
homepage 'https://github.com/rbsec/sslscan'
url 'https://github.com/rbsec/sslscan/archive/1.11.0-rbsec.tar.gz'
sha1 'f5b3600b33181097f0afd49a3d1e894948da3d9c'
version '1.11.0'
depends_on "openssl"
# Fix compilation and statically link against OpenSSL 1.0.2 rather... | 19.296296 | 79 | 0.708253 |
0155954db3e2bbb9cd517af5bae44ba9a154cf4c | 1,783 | # -*- encoding: utf-8 -*-
# stub: net-ftp 0.1.1 ruby lib
Gem::Specification.new do |s|
s.name = "net-ftp".freeze
s.version = "0.1.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.metadata = { "homepage_uri" => "https://github.com/ruby/net-ftp"... | 50.942857 | 487 | 0.689288 |
79380fe289cc5e9e826d753a569ef1c523e60e1d | 1,252 | # 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... | 29.116279 | 111 | 0.64377 |
ff2e19b5b37af685d217f60a1231c0b6f3f28dc4 | 233 | class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
http_basic_authenticate_with name: "user", password: "user", except: [:index, :show]
def index
@articles = Article.all
end
end
| 23.3 | 86 | 0.746781 |
188bfbe73a305708acd9747f6d60f0f8be7bf4e8 | 3,567 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'msf/core/post/windows/reflective_dll_injection'
require 'msf/core/exploit/exe'
require 'rex'
class MetasploitModule < Msf::Exploit::Local
Rank = GreatR... | 35.316832 | 98 | 0.652369 |
ff662afe5e019df4f25c36ca76f7310bda62b8ce | 665 | require "rails_helper"
RSpec.feature "Bookmarking a post" do
let(:user) { create(:user) }
let(:post) { create(:post, user: user) }
scenario "signed-in user bookmarks a post successfully", js: true do
sign_in user
visit post_path(post)
within("#main-post") do
click_on "Bookmark"
expect(pa... | 24.62963 | 70 | 0.669173 |
ed70a045393d86f96151730d733f1746ea642fa9 | 1,658 | # Where our application lives. $RAILS_ROOT is defined in our Dockerfile.
app_path = ENV['RAILS_ROOT']
# Set the server's working directory
working_directory app_path
# Define where Unicorn should write its PID file
pid "/var/tmp/pids/unicorn.pid"
# Bind Unicorn to the container's default route, at port 3000
listen "... | 29.087719 | 76 | 0.739445 |
ffe1b1f82f05c560be867c536bd7805dca567e70 | 3,540 | 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... | 39.333333 | 100 | 0.748023 |
7a93d0a9620f6ded8202e4d05e8d738e985e5014 | 1,947 | class CenterIm < Formula
desc "Text-mode multi-protocol instant messaging client"
homepage "http://www.centerim.org/index.php/Main_Page"
url "http://www.centerim.org/download/releases/centerim-4.22.10.tar.gz"
sha256 "93ce15eb9c834a4939b5aa0846d5c6023ec2953214daf8dc26c85ceaa4413f6e"
revision 1
bottle do
... | 33 | 115 | 0.724191 |
ab41f7c600527d8ae82488ebf7b855399841a26e | 2,377 | =begin
#Scubawhere API Documentation
#This is the documentation for scubawhere's RMS API. This API is only to be used by authorized parties with valid auth tokens. [Learn about scubawhere](http://www.scubawhere.com) to become an authorized consumer of our API
OpenAPI spec version: 1.0.0
Contact: bryan@scubawhere.co... | 30.474359 | 224 | 0.737905 |
b93c266927c72ee863a2cd9ac856bcd303935977 | 678 | # frozen_string_literal: true
module Zoho
module People
class Attendance
attr_reader :check_in, :check_out, :email
def initialize(email:, check_in:, check_out:)
raise ArgumentError, 'check_in must be DateTime instance' unless check_in.is_a?(DateTime)
raise ArgumentError, 'check_out m... | 23.37931 | 99 | 0.644543 |
870ae8d69baf2adbf6858fa20481212e4f17b59c | 543 | # frozen_string_literal: true
# typed: strict
class Other::OtherClass
Foo::Bar::Exists.hello # This ref still works
Foo::Bar::Exists.helloXX
# ^^^^^^^ error: Method `helloXX` does not exist on `T.class_of(Foo::Bar::Exists)`
Foo::Bar::NotDefined
# ^^^^^^^^^^^^^^^^^^^^ error: Unable to resolve c... | 31.941176 | 99 | 0.618785 |
1ab6a01b20a5353dc0bd885db181951d1001307e | 1,209 | require "erb"
module YmTags::Tag
include ERB::Util
def self.included(base)
base.scope :contexts, lambda {|contexts| base.joins(:taggings).where(["taggings.context IN (?)", [*contexts]]).group('tags.id')}
base.scope :most_used, lambda { base.joins(:taggings).select("tags.*, COUNT(taggings.id) as tag_co... | 36.636364 | 240 | 0.674938 |
e288a8f084513e0e50f97007383b8b47e7c32c7e | 8,183 | require './test/helper'
class GeometryTest < Test::Unit::TestCase
context "Paperclip::Geometry" do
should "correctly report its given dimensions" do
assert @geo = Paperclip::Geometry.new(1024, 768)
assert_equal 1024, @geo.width
assert_equal 768, @geo.height
end
should "set height to 0 ... | 36.207965 | 179 | 0.6164 |
ff0a52c9f777dab3d09e74fa8f3e8ada2f37d3ee | 410 | # typed: true
class CreateReleasePublishers < ActiveRecord::Migration[5.2]
def change
create_table :release_publishers do |t|
t.references :release, null: false
t.references :company, null: false
t.timestamps
end
add_foreign_key :release_publishers, :releases,
on_delete: :cascade... | 24.117647 | 60 | 0.709756 |
e2deb307d6016aa189802665a1bd7694c0c1f228 | 697 | module Players
module Suppression
def suppress_guns?
@suppress_guns || zone.suppress_guns
end
def suppress_mining?
@suppress_mining || zone.suppress_mining
end
def suppress!(type, is_suppressed = true)
case type
when :flight
@suppress_flight = is_suppressed
... | 25.814815 | 79 | 0.684362 |
1c3c2f8d5975b666b7c41fe3401df0595114b42a | 294 | # frozen_string_literal: true
module Dor
class RegistrationResponse
attr_reader :params
delegate :to_json, to: :params
def initialize(p_hash)
@params = p_hash
end
def to_txt
@params[:pid]
end
def location
@params[:location]
end
end
end
| 14 | 34 | 0.639456 |
21399a9b9dd53b0111df9c3713e5975ddfd78783 | 237 | class RemoveCompletedAsDesignedAndReversedDirectionFromManeuvers < ActiveRecord::Migration
def change
remove_column :maneuvers, :completed_as_designed, :boolean
remove_column :maneuvers, :reversed_direction, :boolean
end
end
| 33.857143 | 90 | 0.827004 |
ab2176f8271728889437b6267586c80842480cdd | 949 | Pod::Spec.new do |s|
s.name = 'lightweight-stream-api@J2ObjC-2.5'
s.version = '1.2.23-SNAPSHOT'
s.license = { :type => 'PRIVATE', :text => 'PRIVATE' }
s.summary = 'Stream api port to Java 7.'
s.homepage = 'http://www.mirego.com'
s.authors = { 'Mirego, Inc.' => 'info@mirego.com' }
s.source = { :g... | 33.892857 | 125 | 0.653319 |
91252526a036fb8ee3d1fd3e862bd92356eb8df4 | 748 | require_relative './base_job'
module Resque
class UserMigrationJobs < BaseJob
module Export
@queue = :user_migrations
def self.perform(options = {})
Carto::UserMigrationExport.find(options['export_id']).run_export
rescue => e
CartoDB::Logger.error(exception: e, message: 'Error ... | 26.714286 | 114 | 0.65107 |
e8502784e0468fafaebe24c67859d150280b38bb | 204 | class PgqPlaces < Pgq::Consumer
# to insert event: PgqPlaces.my_event(1, 2, 3)
# async execute
def my_event(a, b, c)
logger.info "async call my_event with #{[a, b, c].inspect}"
end
end
| 18.545455 | 63 | 0.642157 |
e94ed7d9fd019c004981a840863221ed96bda094 | 7,638 | module Tmuxinator
class Cli < Thor
# By default, Thor returns exit(0) when an error occurs.
# Please see: https://github.com/tmuxinator/tmuxinator/issues/192
def self.exit_on_failure?
true
end
include Tmuxinator::Util
COMMANDS = {
commands: "Lists commands available in tmuxinator... | 28.184502 | 80 | 0.581173 |
f7331dfb0075b2a4400a631f3221ef96e12f4675 | 103 | json.extract! name, :id, :e_no, :name, :created_at, :updated_at
json.url name_url(name, format: :json)
| 34.333333 | 63 | 0.718447 |
bb8d3bd7c1e97e3574266d7a9cf70962978c2565 | 5,066 | require 'minitest/autorun'
require 'mocha/mini_test'
require_relative '../test_helper'
require_relative '../../../_tests/lib/run_test_options'
class TestRunTestOptions < MiniTest::Test
def setup
@test_dir = '_tests'
@run_tests_options = RunTestOptions.new(@test_dir)
clear_env_variables
end
def tea... | 42.932203 | 150 | 0.740229 |
916cb367da31c8bc31ae4f7ff6393bbdd5313642 | 140 | require 'rails_helper'
RSpec.describe ExaminationTypeSetting, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
| 23.333333 | 56 | 0.771429 |
87e6427db2a692a5868954c7911d3fb93d50ed51 | 4,298 | # frozen_string_literal: true
class Fisk
module Instructions
# Instruction PSLLD
forms = []
operands = []
encodings = []
# pslld: mm, imm8
operands << OPERAND_TYPES[54]
operands << OPERAND_TYPES[1]
encodings << Class.new(Fisk::Encoding) {
def encode buffer, operands
add_... | 27.031447 | 53 | 0.531177 |
ff7cd985263e617e185a9c59d162d640bd9fd6f5 | 3,193 | ##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'rex'
require 'rex/parser/ini'
require 'msf/core/auxiliary/report'
class Metasploit3 < Msf::Post
include Msf::Post::Windows::Registry
include Msf::Aux... | 28.508929 | 108 | 0.613843 |
bf8bdb358f447b84f36aa176c9e460902cedd0a2 | 14,593 | # encoding: utf-8
class Incedent < ActiveRecord::Base
include ApplicationHelper
include Workflow
workflow_column :state
workflow do
end
acts_as_nested_set
include TheSortableTree::Scopes
audit(:create) { |model, user, action| "Жалоба \"#{model.name}\" создана пользователем #{user.display_name}" }
... | 28.89703 | 301 | 0.687796 |
795a871fe49559c7a59fc6f9f7e8546e6782ba20 | 37 | class Tariff < ApplicationRecord
end
| 12.333333 | 32 | 0.837838 |
bf387daf546255ad2aa4aa40a8b24af8d9238e46 | 1,269 | require "rails_helper"
RSpec.describe CustomGalleryLayoutsController, type: :routing do
describe "routing" do
it "routes to #index" do
expect(:get => "/custom_gallery_layouts").to route_to("custom_gallery_layouts#index")
end
it "routes to #new" do
expect(:get => "/custom_gallery_layouts/new... | 31.725 | 110 | 0.670607 |
622670e8541caccb6a5ef2ba18a9540d95749d45 | 3,140 | ##########################GO-LICENSE-START################################
# Copyright 2014 ThoughtWorks, 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/li... | 64.081633 | 198 | 0.735669 |
5da2e202b40dc7b6af85e504fb5af24d5c4abe22 | 12,277 | require File.dirname(__FILE__) + '/../../spec_helper.rb'
module HaveSpecHelper
def create_collection_owner_with(n)
owner = Spec::Expectations::Helper::CollectionOwner.new
(1..n).each do |n|
owner.add_to_collection_with_length_method(n)
owner.add_to_collection_with_size_method(n)
end
owner... | 34.485955 | 124 | 0.752627 |
91f5ae5a8e161e07fbea458b86a409d80f3e6cd8 | 1,752 | class GnomeLatex < Formula
desc "LaTeX editor for the GNOME desktop"
homepage "https://wiki.gnome.org/Apps/GNOME-LaTeX"
url "https://download.gnome.org/sources/gnome-latex/3.38/gnome-latex-3.38.0.tar.xz"
sha256 "a82a9fc6f056929ea18d6dffd121e71b2c21768808c86ef1f34da0f86e220d77"
license "GPL-3.0-or-later"
li... | 34.352941 | 93 | 0.668379 |
33c50e7052c17d4c8d5226a17eb6e42546545f3f | 282 | module SampleEngine
class ApplicationController < ActionController::Base
include Applogic::ApplicationHelper
skip_before_action :verify_authenticity_token
# protect_from_forgery unless: -> { request.format.json? }
# protect_from_forgery with: :exception
end
end
| 31.333333 | 62 | 0.783688 |
ed5c4f38a2c9e05cdee0fa533cb3634bf1f2d390 | 560 | # typed: true
# frozen_string_literal: true
class Formula
undef shared_library
def shared_library(name, version = nil)
"#{name}.so#{"." unless version.nil?}#{version}"
end
class << self
undef ignore_missing_libraries
def ignore_missing_libraries(*libs)
libraries = libs.flatten
if lib... | 23.333333 | 104 | 0.689286 |
4ad2314f922a1825418d653622f6d1c0bf60e86e | 399 | # == Schema Information
#
# Table name: users
#
# id :bigint not null, primary key
# username :string not null
# password_digest :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
FactoryBot.define do
fact... | 23.470588 | 58 | 0.561404 |
62df4ebfec50a0300868379e303ea283d7e3a227 | 150 | class Tagging < ActiveRecord::Base
belongs_to :post, optional: true
belongs_to :tag, optional: true
delegate :name, to: :tag, prefix: true
end
| 21.428571 | 40 | 0.726667 |
87ed6b4ec16990cc1f3f52eb0c184e154cbfd8d9 | 3,198 | # encoding: utf-8
#
# Cookbook Name:: audit
# Spec:: fetcher
#
# Copyright 2016 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/LICE... | 31.663366 | 101 | 0.653533 |
21dfc51b14c9e114974c3e4e6cc75e38acc9ce67 | 2,219 | # 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::Network::Mgmt::V2020_06_01
module Models
#
# DNS Proxy Settings in Firewall Policy.
#
class DnsSettings
include MsRes... | 28.088608 | 74 | 0.497972 |
03cdf76c0db0dad90f38aa3d85ac0e939df897fd | 147 | class AddUniqueToLeageuser < ActiveRecord::Migration[5.1]
def change
add_index :league_users, [:user_id, :league_id], unique: true
end
end
| 24.5 | 65 | 0.748299 |
0183ab86da19df3ac9adc60e6a7406c2dda4b9c9 | 842 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
Pod::Spec.new do |s|
s.name = 'EXCamera'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s.auth... | 30.071429 | 73 | 0.634204 |
e821aa929c3c8caa51573a6036fe487676d3ca39 | 719 | require 'travis/addons/handlers/base'
require 'travis/addons/handlers/task'
module Travis
module Addons
module Handlers
class Slack < Base
include Handlers::Task
EVENTS = 'build:finished'
def handle?
enabled?(:slack) && targets.present? && config.send_on?(:slack, action)... | 20.542857 | 81 | 0.585535 |
11119ed222d878fb27810873d43465fa6b4c0b2d | 6,280 | # frozen_string_literal: true
require 'spec_helper'
describe "Sphinx Excepts", :live => true do
let(:client) { Riddle::Client.new "localhost", 9313 }
let(:controller) do
controller = Riddle::Controller.new nil, ''
controller.bin_path = Sphinx.new.bin_path
controller
end
it "should hi... | 37.159763 | 185 | 0.616561 |
b9443b9a8a5f006f01d8dd114588119dc820fcd1 | 1,292 | =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
<<<<<<< HEAD
OpenAPI Generator version: 5.0.0-... | 24.846154 | 157 | 0.715944 |
f7914ccf294ff942c074d184af0f8a1724af0ad4 | 47,346 | require "spec_helper"
describe Identification, "creation" do
describe "without callbacks" do
it "should store the previous observation taxon" do
o = make_research_grade_observation
previous_observation_taxon = o.taxon
i = Identification.make!( observation: o )
expect( i.previous_observa... | 40.850733 | 144 | 0.690069 |
1c405885e26d2f212ca1a7d201bd12ed80e4e270 | 859 | # The ASF licenses this file to You 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, softw... | 29.62069 | 74 | 0.725262 |
ab71fe767d2de37a7969fda3e22b55aa806446e0 | 705 | #!/usr/bin/ruby
# encoding: UTF-8
# require 'pyer/logger'
require './lib/pyer/logger.rb'
log = Logger.new(STRING, self.class)
log.debug 'StringIO'
log.close
print log.string
log = Logger.new(STDOUT, self.class)
log.debug 'debug'
log.info 'information'
log.info('what ?') { 'glop ' * 2 }
log.warn 'warning'
log.error ... | 18.552632 | 42 | 0.670922 |
bb80a26bb0f34b7d4695a2f5060888a6a587eb9f | 102 | # frozen_string_literal: true
module ChatPreview
class ChatPreview < ApplicationComponent; end
end
| 17 | 47 | 0.823529 |
f7b9702c894959c24ac92405d3d345ae9b22f6e9 | 262 | class ChangeMatchsetsAndPicksSpec < ActiveRecord::Migration[5.0]
def change
add_column :matchsets, :name, :string
add_column :matchsets, :difficulty, :string
add_column :matchsets, :level, :string
remove_column :matchsets, :song_name
end
end
| 29.111111 | 64 | 0.744275 |
7901953a3d0b28337ef74cd2417aa8b81b46fb45 | 124 | json.extract! github_news_item, :id, :created_at, :updated_at
json.url github_news_item_url(github_news_item, format: :json) | 62 | 62 | 0.822581 |
385dda428d8fed5a32f636e1871bec9c1215c476 | 131 | require 'vcr'
VCR.configure do |c|
c.cassette_library_dir = 'spec/vcr'
c.hook_into :webmock
c.configure_rspec_metadata!
end
| 16.375 | 37 | 0.748092 |
334e45c66ecff069a21e20e871d6c090bad24ac2 | 18,659 | ##
# 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
include Msf::Exploit::RopDb
def initialize(info={})
s... | 30.588525 | 115 | 0.567072 |
088d302304863883b30858d2c767ea1d06e26d2c | 244 | require 'test_helper'
class RoutesTest < ActionDispatch::IntegrationTest
# why does this not work?
# test "pages routes" do
# assert_recognizes({:controller => "static_pages/pages", :action => "show"}, {:path => "test"})
# end
end
| 22.181818 | 100 | 0.67623 |
0871e2e917dae76dd8a9c81606ea83544aa81b4e | 354 | class FontEuphoriaScript < Formula
head "https://github.com/google/fonts/raw/main/ofl/euphoriascript/EuphoriaScript-Regular.ttf", verified: "github.com/google/fonts/"
desc "Euphoria Script"
homepage "https://fonts.google.com/specimen/Euphoria+Script"
def install
(share/"fonts").install "EuphoriaScript-Regul... | 32.181818 | 133 | 0.757062 |
6108bda083d0c2d22c8282a962dcdd4fd6758d07 | 1,065 | class AddProducts < ActiveRecord::Migration[6.0]
def change
Product.create ({ :title => "Salons",
:description => "This is Hawaiian pizza",
:price => 350, :size => 30,
:is_spicy => false,
:is_veg => false,
:is_best_offe... | 38.035714 | 62 | 0.435681 |
5d79ae48342b467fd661121ee15c0c7c1d7c2679 | 680 | module Intrigue
module Ident
module Check
class Cerberus < Intrigue::Ident::Check::Base
def generate_checks(url)
[
{
:type => "fingerprint",
:category => "application",
:tags => ["Web Server"],
:vendor => "Cradlepoint",
:product =>"HTTP Service",
:match_detai... | 21.935484 | 73 | 0.526471 |
bb780ae254fed522923abc2e53d5a7e7a7fddcf9 | 3,400 | class Tinyxml < Formula
desc "XML parser"
homepage "http://www.grinninglizard.com/tinyxml/"
url "https://downloads.sourceforge.net/project/tinyxml/tinyxml/2.6.2/tinyxml_2_6_2.tar.gz"
sha256 "15bdfdcec58a7da30adc87ac2b078e4417dbe5392f3afb719f9ba6d062645593"
revision 1 unless OS.mac?
bottle do
sha256 cel... | 40.963855 | 145 | 0.743235 |
ed144935bf64a6235219772f2850f605c30ed22c | 196 | class AddAuthenticationTokenToUsers < ActiveRecord::Migration[5.0]
def change
add_column :users, :auth_token, :string, default: ''
add_index :users, :auth_token, unique: true
end
end
| 28 | 66 | 0.734694 |
4a9394563536f0df7a00952ec6472096e3934df6 | 1,557 | class Mednafen < Formula
desc "Multi-system emulator"
homepage "https://mednafen.github.io/"
url "https://mednafen.github.io/releases/files/mednafen-1.27.1.tar.xz"
sha256 "f3a89b2f32f40c3232593808d05e0c21cbdf443688ace04c9c27e4cf4d5955fb"
license "GPL-2.0-or-later"
livecheck do
url "https://mednafen.git... | 31.77551 | 92 | 0.734104 |
6ad19888d59bbc832bfd4c16e6592348080ac8de | 2,767 | require 'test_helper'
class TwoPoolToSemiGenerationTest < ActionDispatch::IntegrationTest
def setup
create_pool_tournament_single_weight(8)
end
test "Match generation works" do
assert @tournament.matches.count == 16
assert @tournament.matches.select{|m| m.bracket_position == "Semis"}.count == 2
... | 43.234375 | 146 | 0.707626 |
bf459bdadc15fd755fad9308763195297ebf7444 | 293 | # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :password, :otp_attempt, :photo
]
| 41.857143 | 106 | 0.737201 |
ffaeef5b1b838540f13e45b2a9e664b10210b797 | 366 | cask 'obinslab-starter' do
version '1.0.10'
sha256 '5aa810df804d18ae4ecdf3a049596164d2af76f518b83476d943f4e186c8b4e2'
url "http://releases.obins.net/occ/darwin/x64/ObinslabStarter_#{version}_x64.dmg"
appcast 'http://en.obins.net/obinslab-starter'
name 'Obinslab Starter'
homepage 'http://en.obins.net/obinsl... | 30.5 | 83 | 0.773224 |
38f2a9dc3380c2a906f9e957448f351bc753d8eb | 772 | cask "imgotv" do
version "6.4.6_1"
sha256 "af68f7ec41444eb274ce7bc4d8e2c6b39b36f2d20b8299d507b0a3cd41e1b967"
url "https://download.imgo.tv/app/mac/#{version}/mgtv-mango.dmg",
verified: "download.imgo.tv/"
name "芒果TV"
desc "Mango TV video app"
homepage "https://www.mgtv.com/app/"
livecheck do
u... | 27.571429 | 75 | 0.683938 |
26ef662cb53e1e5891a0ca28cc00febfe2b2da21 | 3,052 | # Encoding: utf-8
# Cloud Foundry Java Buildpack
# Copyright 2013-2017 the original author or authors.
#
# 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/... | 30.217822 | 114 | 0.662189 |
f71673f1c0676c3ae1df8939501d56d063c3bb16 | 136 | class FooController < ApplicationController
skip_before_filter :authenticate_user!
def index
render :nothing => true
end
end
| 17 | 43 | 0.772059 |
1c0bd8b4c599458d24a5f05a06a115d82f502653 | 274 | #!/usr/bin/env ruby
# -*- encoding: us-ascii -*-
# Determine file format (e.g. packed, unpacked, decoded) for any file
desc "type FILE", "Display the type of a file (e.g. frozen, huffman, etc.)"
def type(file)
check_for_unknown_options(file)
puts File.type(file)
end
| 24.909091 | 75 | 0.693431 |
f70e1c5af13e622ee513085b9ce3ab18981a1914 | 49 | # encoding: utf-8
require 'validation_reflection' | 24.5 | 31 | 0.816327 |
5d6c43b7d426c97b7577d987c7b65c6ae12a8dbe | 1,262 | class ProductsController < Spree::BaseController
resource_controller
helper :taxons
before_filter :load_data, :only => :show
actions :show, :index
index do
before do
@product_cols = 3
end
end
def change_image
@product = Product.available.find_by_param(params[:id])
img = Image.find(... | 28.044444 | 133 | 0.591918 |
4ab8ef24575a4d0cc822e88cab13761aee16fce3 | 407 | module MiddlewareDeploymentHelper::TextualSummary
#
# Groups
#
def textual_group_properties
%i(name nativeid)
end
def textual_group_relationships
# Order of items should be from parent to child
%i(ems middleware_server)
end
def textual_group_smart_management
%i(tags)
end
def text... | 15.074074 | 51 | 0.722359 |
87eaad54e5eeb4cbfd32000be26eb2ab258432fe | 1,628 | control "VCST-67-000017" do
title "The Security Token Service directory tree must have permissions in an
\"out-of-the-box\" state."
desc "As a rule, accounts on a web server are to be kept to a minimum. Only
administrators, web managers, developers, auditors, and web authors require
accounts on the machine hosting... | 37 | 136 | 0.688575 |
e9d55716c35dcd0b556bcbed6b2f2cf0d93be231 | 82 | module BusinessHelper
def format_id(string)
string.match(/\d/)
end
end | 11.714286 | 23 | 0.682927 |
21ffc9b0e48840c2b673014e5e093e96c1f6c973 | 1,408 | class ArticlesController < ApplicationController
before_action :find_article, only: [:show, :create_comment, :destroy]
before_action :set_cache_control_headers, only: [:index, :show]
before_action :set_private, only: [:create_comment, :create_article]
# Returns all Article objects, and sets a table_key of 'art... | 26.074074 | 88 | 0.732244 |
62243ce3ace43fa081548a083d5c2879155cfbbf | 4,187 | module GitalyServer
class RefService < Gitaly::RefService::Service
include Utils
TAGS_PER_MESSAGE = 100
def create_branch(request, call)
bridge_exceptions do
begin
start_point = request.start_point
start_point = 'HEAD' if start_point.empty?
branch_name = reque... | 31.481203 | 96 | 0.620731 |
ed217fe1a558b5a2ba583e19b43d2693731139eb | 284 | module Pipedrive
class SearchResults < Base
def search(params = {})
make_api_call(:get, params.merge(entity_hard_path: 'searchResults'))
end
def field(params = {})
make_api_call(:get, params.merge(entity_hard_path: 'searchResults/field'))
end
end
end
| 23.666667 | 80 | 0.68662 |
2692a243b9cef3685d1883688b3afd67bd958cbe | 240 | class WebNotificationsChannel < ApplicationCable::Channel
def subscribed
stream_from "web_notifications_channel"
# stream_from "some_channel"
end
def unsubscribed
# Any cleanup needed when channel is unsubscribed
end
end
| 21.818182 | 57 | 0.783333 |
1a92e96c552df2b8b9f0c768e030becd2401a047 | 199 | class AddAdditionalMilesAndGeneratorHoursToCarts < ActiveRecord::Migration
def change
add_column :carts, :additional_miles, :integer
add_column :carts, :generator_hours, :integer
end
end
| 28.428571 | 74 | 0.79397 |
1d8e41a01ff186f063f44b3e702a6d7d505c7449 | 606 | Pod::Spec.new do |s|
s.name = "Floc-Commands"
s.version = "0.3.0"
s.summary = "A collection of commands with fluent API for Objective-C."
s.homepage = "https://github.com/sschmid/Floc-Commands"
s.screenshots = "http://sschmid.com/Dev/iOS/Libs/Floc-Commands/Floc-Commands-128.png"
s.lic... | 43.285714 | 94 | 0.605611 |
391980d34000fa7982602c969afdb5190c3551bf | 4,258 | class CalendarDateSelect
FORMATS = {
:natural => {
:date => "%B %d, %Y",
:time => " %I:%M %p"
},
:hyphen_ampm => {
:date => "%Y-%m-%d",
:time => " %I:%M %p",
:javascript_include => "calendar_date_select_format_hyphen_ampm"
}
}
cattr_accessor :image
... | 35.190083 | 154 | 0.62635 |
e8a5946ab8856920aa92eb6a5638c3ae9985ef7c | 1,183 | require "#{File.dirname(__FILE__)}/spec_helper"
describe 'Unifying a bound value' do
[nil, true, false,
:sym, "str", /regex/,
3, 2.0,
Object.new, Class.new.new,
[], {}].each do |type|
describe "for #{type.class} instances" do
it 'passes unification for an object of equal value' do
local... | 28.853659 | 86 | 0.591716 |
4ac9017ec04a78bffd0d6e04b838c3ab5ab7c450 | 452 | # frozen_string_literal: true
module InterviewsHelper
ICON = { talk: { icon: 'fa-comments bg-yellow', title: I18n.t('activerecord.attributes.interview.type_ofs.talk') },
technical: { icon: 'fa-wrench bg-aqua', title: I18n.t('activerecord.attributes.interview.type_ofs.technical') } }.freeze
def intervie... | 41.090909 | 131 | 0.716814 |
1dcd41fd2d70618eea7ad2f7b6fa374dda4e113e | 1,785 | #
# Author:: Tim Smith (<tsmith@chef.io>)
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:/... | 34.326923 | 89 | 0.735014 |
38d6762b0398bde3aa301d5317f4d229cf59f1fc | 4,268 | # frozen_string_literal: true
require 'spec_helper'
describe 'memberships' do
let!(:client) { create_client }
let!(:user) { client.users.create!(email: mock_email, name: mock_uuid, verified: true) }
let(:organization) { client.organizations.create!(name: mock_uuid) }
include_examples 'zendesk#reso... | 41.038462 | 113 | 0.651359 |
ab841f9beed5dd6f5adb1ec95b13ace4f4eaaaa6 | 1,470 | require 'date'
require 'safe_yaml/load'
SafeYAML::OPTIONS[:suppress_warnings] = true
module Twine
class Plugin
attr_reader :debug, :config
def initialize
@debug = false
require_gems
end
###
# require gems from the yaml config.
#
# gems: [twine-plugin1, twine-2]
#
# ... | 22.96875 | 73 | 0.617007 |
1d554a9563939f413c526529a366627af19a3b81 | 1,052 | require "spec_helper"
describe "bundle update" do
describe "git sources" do
before :each do
build_repo2
@git = build_git "foo", :path => lib_path("foo") do |s|
s.executables = "foobar"
end
install_gemfile <<-G
source "file://#{gem_repo2}"
git "#{lib_path('foo')}"
... | 21.469388 | 69 | 0.563688 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.