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 |
|---|---|---|---|---|---|
62146c7b70dcaa147f1dfe5e3a1bc78f1ef6a5a6 | 2,180 | require "language/node"
class Serverless < Formula
desc "Build applications with serverless architectures"
homepage "https://www.serverless.com/"
url "https://github.com/serverless/serverless/archive/v2.70.0.tar.gz"
sha256 "ee056b667500f7b0e23e665bb7bff75e69204168db34c36a177d54d149922f4c"
license "MIT"
hea... | 44.489796 | 123 | 0.691284 |
01f7a05bd5579a9c7811348f5689fae6f482de9b | 717 | #
# Cookbook Name:: fb_init_sample
# Recipe:: site_settings
#
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://ww... | 32.590909 | 74 | 0.751743 |
4a2267074927be6b51904f0eb2fe389289e5d4cd | 1,727 | module Cms::ApiFilter::Contents
extend ActiveSupport::Concern
HTML_FIELDS = [
:name, :html, :question, :upper_html, :lower_html, :contact_charge, :contact_tel,
:contact_fax, :contact_email, :contact_link_url, :contact_link_name
].freeze
COLUMN_VALUES_FIELDS = [
:value, :text, :link_url, :link_labe... | 27.854839 | 107 | 0.570353 |
26ad2b0f8c89fbbc91586fff3361f31dec01e53a | 1,363 | class Flow < Formula
desc "Static type checker for JavaScript"
homepage "https://flowtype.org/"
url "https://github.com/facebook/flow/archive/v0.143.1.tar.gz"
sha256 "06b7d39ea7dfad74dc56bbcf99124c27383a507f803c73cb989058fbcd990817"
license "MIT"
head "https://github.com/facebook/flow.git"
bottle do
... | 33.243902 | 117 | 0.732942 |
7a4c8211ce5644024bcd337a819a737e7dc38d2d | 493 | cask 'qownnotes' do
version '18.06.4,b3644-105425'
sha256 'e2104ec571cb1e9c40299344475129c0558f75af1044effbd282d7b36f5abae8'
# github.com/pbek/QOwnNotes was verified as official when first introduced to the cask
url "https://github.com/pbek/QOwnNotes/releases/download/macosx-#{version.after_comma}/QOwnNotes-#{... | 37.923077 | 127 | 0.780933 |
4a9ec9fd1386caab48c8c4c861f321ad2f97e284 | 435 | require 'spec_helper'
describe Api::SearchController do
let (:user) {create :user }
render_views
describe "all" do
it "should render json successful and in the same way (approvals)" do
FactoryGirl.reload
user = create :user, username: "Baron"
create :fact_data, displaystring: "Baron"
... | 18.913043 | 73 | 0.65977 |
4afc7a92a800700b776c586dc3024d21bfe92fc1 | 15,055 | module Pione
module PNML
class Compiler
# Compile from the net to PIONE document.
#
# @param net [PNML::Net]
# source net
# @return [String]
# compiled PIONE document
def self.compile(net, option={})
new(net, option).compile
end
def initialize(net... | 34.138322 | 110 | 0.611292 |
6a7b4de703c63ee3087410d6a3b7d1f6abcaec36 | 997 | class PluginsController < ApplicationController
def index
redirect_to installed_plugins_path
end
def installed
@plugins = Plugin.installed
end
def recommended
@plugins = PluginDecorator.decorate_collection(Plugin.recommended)
end
def updated
@plugins = Plugin.installed.reject{|plugin| p... | 22.155556 | 87 | 0.726179 |
082cba34f3aa07e2e1582c45e878b56499dcda5d | 3,120 | # encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
require 'logger'
require 'gooddata/core/splunk_logger_decorator'
require 'gooddata/extensions/true'... | 40.519481 | 153 | 0.7125 |
01ae615414dd1ff1604498858c5122e69500fdd7 | 2,624 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'elasticsearch/api/version'
Gem::Specification.new do |s|
s.name = "elasticsearch-api"
s.version = Elasticsearch::API::VERSION
s.authors = ["Karel Minarik"]
s.email ... | 36.444444 | 103 | 0.714558 |
799ff44c4215acce686c4c2e1fccd022644fef29 | 4,571 | require 'formula'
class Mongodb < Formula
homepage 'http://www.mongodb.org/'
url 'http://downloads.mongodb.org/src/mongodb-src-r2.4.9.tar.gz'
sha1 '3aa495cf32769a09ee9532827391892d96337d6b'
bottle do
revision 1
sha1 "7ace0e0f8f6b2096a54e4e7dd976b3728227e95a" => :mavericks
sha1 "b917ff86005452c3031... | 29.301282 | 106 | 0.623058 |
1c69b3b6ae2ed7419f5f6887788925f0be54316e | 372 | class AddReferencePathsToSchemaVersions < ActiveRecord::Migration[6.1]
def change
change_table :schema_versions do |t|
t.text :collected_reference_paths, array: true, default: [], null: false
t.text :scalar_reference_paths, array: true, default: [], null: false
t.text :text_reference_paths, arra... | 37.2 | 78 | 0.715054 |
ac0af574bfa1af66b92fe8525063bd0ade33bcb8 | 519 | require File.dirname(__FILE__) + '/support/setup'
class DuplicateDocuments < CloudCrowd::Action
def process
Document.where( {:id => input} ).find_each do |doc|
begin
doc.duplicate!(account, options)
rescue => e
LifecycleMailer.exception_notification(e, options.merge({:docum... | 21.625 | 99 | 0.631985 |
61f5e55a87c72e73a52ab8eb7e3ae72966a06ad5 | 5,082 | require 'piedesaint'
require 'openssl'
require 'yaml'
require 'json'
# For automatic IP configuration (modes: *vmware-nat*)
require 'socket'
module Piedesaint
# The CLI class encapsulates the behavior of Piedesaint when it is invoked
# as a command-line utility. This allows other programs to embed Piedesaint
... | 32.369427 | 126 | 0.626722 |
03f5cbf763ad47b01de04567f12d52127c28b310 | 2,900 | class Chef
class Provider
class GitClient
class Source < Chef::Provider::GitClient
include Chef::DSL::IncludeRecipe
action :install do
return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe" if node['platform'] == 'windows'
include_r... | 43.939394 | 159 | 0.623793 |
1a7194977e53c90bdf841308b8606545b9a7216b | 1,020 | # -*- coding: utf-8 -*-
require 'rubygems'
require 'ramaze'
# require YAML based localization
require 'ramaze/helper/localize'
#
# Old Dispatcher::Action::FILTER style localization.
#
class MainController < Ramaze::Controller
helper :localize
def index
# Enclose the strings that have to be localized with {}
... | 20.816327 | 71 | 0.663725 |
38e5f350365fe16c3bec1b561ded63ee6353b8dc | 1,430 | module TExp
class Base
# Combine two temporal expressions so that the result will match
# the union of the dates matched by the individual temporal
# expressions.
#
# <b>Examples:</b>
#
# dow(:monday) + dow(:tuesday) # Match any date falling on Monday or Tuesday
#
def +(texp)
... | 26.481481 | 83 | 0.61049 |
18df1791f058778d8385ac0ad04041425945e54a | 1,691 | require 'counter'
def scenario(init_state, neighbours_state, expected_state)
expect(Counter::computeNextState(init_state.new, neighbours_state.map(&:new))).to eq(expected_state)
end
describe Counter do
describe :computeNextState do
describe 'Dead cell' do
it 'No alive neighbours should stay dead' do
... | 37.577778 | 103 | 0.644589 |
d5fa89015e4a56842aa37e73e0f0745155b0f19e | 354 | require 'spec_helper'
describe Ban::IrEvent do
let(:data) { [51, 0, 48, 0, 54, 0, 56, 0, 57, 0] }
subject { described_class.parse(data) }
its(:name) { should == 'ir-received' }
its(:valid?) { should == true }
its(:to_hash) do
should == { "code" => 30689, "hex" => "77e1" }
end
its(:to_s) do
sho... | 20.823529 | 52 | 0.567797 |
1a5ff33261d0b9c352e1f0af0558141470b16d6c | 2,937 | =begin
#Selling Partner API for Retail Procurement Orders
#The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 3.0.26
=end
require 'spec_helper'
re... | 29.079208 | 106 | 0.71842 |
0130cb038f41550f02b24d8a8bc80dc530c934e8 | 347 | require 'rails_helper'
RSpec.describe 'shared/_dissolution_message', vcr: true do
context 'content' do
before do
allow(Parliament::Utils::Helpers::FlagHelper).to receive(:dissolution?).and_return(true)
render
end
it 'will render the disolution message' do
expect(rendered).to match(/dis... | 23.133333 | 94 | 0.70317 |
accc2e29af64c820b264aad7a3face9810f34608 | 620 | #
# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
require 'test/unit'
class TC_Grep < Test::Unit::TestCase
def test_grep_eval
Dir['../../**/*.rb'].each do |path|
File.open( pat... | 25.833333 | 83 | 0.603226 |
39fd166baca69acd2e3ecd67c0e4790bdcb2b378 | 181 | # frozen_string_literal: true
require 'tencentcloud-sdk-common'
require_relative 'v20191118/client'
require_relative 'v20191118/models'
module TencentCloud
module Gs
end
end
| 15.083333 | 35 | 0.812155 |
ac002fb32db57d8be6ea3f4e9de36c46550e2c67 | 1,140 | Pod::Spec.new do |s|
s.name = "MTAnimation"
s.version = "0.1.3"
s.summary = "Animate with easing functions using block methods similar to UIKit."
s.description = <<-DESC
Allows you to animate views in your app in the way you're... | 67.058824 | 231 | 0.580702 |
1c8e8a8392991b7ead08466deb9245d657787c8f | 436 | cask 'flowdock' do
version '1.2.7'
sha256 '80cce5d7062ca5e24189d268bb6b0c08ce732c5039156bbe393c0bdecec5eadd'
# amazonaws.com is the official download host per the appcast feed
url "https://s3.amazonaws.com/flowdock-resources/mac/#{version}/Flowdock.zip"
appcast 'https://s3.amazonaws.com/flowdock-resources/ma... | 31.142857 | 79 | 0.763761 |
181f3d1d9f0d47d5d9e657452892f427ca485f7f | 4,921 | # 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... | 34.412587 | 86 | 0.70758 |
18998d9e4a6c2be7872a106d259898ffe3dac2fa | 3,923 | require 'digest/crc32'
module Digest
#
# Implements the CRC32 Mpeg algorithm.
#
class CRC32Mpeg < CRC32
XOR_MASK = 0x00000000
TABLE = [
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
... | 41.734043 | 78 | 0.718328 |
e841b7cbd8d1cca7bedc5ef7def73379e8969617 | 1,971 | # frozen_string_literal: true
#
# Copyright:: 2019, Chef Software, Inc.
# Author:: Tim Smith (<tsmith@chef.io>)
#
# 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... | 32.311475 | 117 | 0.624049 |
f7b67aa85bcef9839abbeb67c73c962ad4210bbb | 12,770 |
Calcentral::Application.routes.draw do
mount RailsAdmin::Engine => '/ccadmin', :as => 'rails_admin'
# The priority is based upon order of creation:
# first created -> highest priority.
root :to => 'bootstrap#index'
# User management/status endpoints.
get '/api/my/am_i_logged_in' => 'user_api#am_i_logge... | 91.214286 | 221 | 0.681441 |
d5e0bd4c6025c9be54da995fa6417fcbf047b940 | 788 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'pyper/version'
Gem::Specification.new do |spec|
spec.name = "pyper_rb"
spec.version = Pyper::VERSION
spec.authors = ["Arron Norwell"]
spec.email = ["anorwell@... | 34.26087 | 74 | 0.630711 |
6a31cad1d94efe8c7b04ef8eef56204cf3dfba4a | 1,245 | require_relative 'lib/see_chord/version'
Gem::Specification.new do |spec|
spec.name = "see_chord"
spec.version = SeeChord::VERSION
spec.authors = ["MichaelAbe"]
spec.email = ["michael.k.abe@gmail.com"]
spec.summary = %q{: Write a short summary, because RubyGems requires on... | 41.5 | 87 | 0.651406 |
6ad675a0785186afaee3c07c4deb484a16847f18 | 1,107 | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
layout 'gorg_engine/application'
include ConfigurableEngine::ConfigurablesController
after_action :prepare_unob... | 27.675 | 182 | 0.709124 |
2143e01f51dcb16b068fd637ee4a8d8c04ef232b | 3,063 | class BriefSummary
class ReproductionGroupMatcher
MATCHER = BriefSummary::ObjUriGroupMatcher.new({
type: :v,
uris: [
"http://purl.obolibrary.org/obo/GO_0019953",
"http://purl.obolibrary.org/obo/GO_0019954",
"http://eol.org/schema/terms/alternatingReproduction",
"http://... | 37.353659 | 89 | 0.616063 |
28b75eb25c0a677e682f3011eb35c41adfc4dc52 | 30,072 | require 'test_helper'
require 'models'
class DocumentTest < Test::Unit::TestCase
def setup
@document = Class.new do
include MongoMapper::Document
collection 'users'
key :first_name, String
key :last_name, String
key :age, Integer
end
@document.collection.clear
end
con... | 31.555089 | 117 | 0.588754 |
7a68491afabad2856286d0c3a293d4ee93d4e611 | 473 | # frozen_string_literal: true
describe SlackRubyBot::Config do
describe '#reset!' do
it 'sets all config attributes to nil' do
SlackRubyBot::Config::ATTRS.each do |attr|
SlackRubyBot::Config.send("#{attr}=", true)
expect(SlackRubyBot::Config.send(attr)).to be true
end
SlackRubyB... | 27.823529 | 58 | 0.661734 |
f83411fa99a2d3a36885ad1398d5cbd4315e4441 | 702 | #!/usr/bin/env ruby
def game_state_at_turn(initial, target_turn)
sequence = initial[0..-1]
prev = initial.last
turn = initial.count
last_spoken = Hash.new do |hash, key|
hash[key] = sequence.index(key) + 1 if sequence.include?(key)
end
while turn < target_turn
if last_spoken[prev].nil?
new_... | 20.057143 | 78 | 0.662393 |
03b4a969bfcf31ba02645ad7e35b843aa472fbf6 | 249 | module Revcal
MONTHS = [
"Vendémiaire",
"Brumaire",
"Frimaire",
"Nivôse",
"Pluviôse",
"Ventôse",
"Germinal",
"Floréal",
"Prairial",
"Messidor",
"Thermidor",
"Fructidor",
"Sansculottides"
]
end
| 13.833333 | 20 | 0.53012 |
ff171b7550b9e9e76d78ebbf2dd418f8add8bec2 | 2,691 | #---
# Excerpted from "Rails 4 Test Prescriptions",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose.
# Visit ... | 30.579545 | 84 | 0.722408 |
1c93f9f50d623901f860f9e9c80e107126525667 | 82 | require "heroku_sensu/version"
module HerokuSensu
# Your code goes here...
end
| 13.666667 | 30 | 0.756098 |
26bf42223c0cab72b2398e413ed908f78f7d3a10 | 178 | class StrainSerializer < ActiveModel::Serializer
attributes :id, :name, :description, :strain_type, :crosses, :breeder, :effects, :ailments, :flavors, :location, :terpenes
end
| 44.5 | 124 | 0.758427 |
62ed5bb1291c2116fb7f1492b805d9e636c01c78 | 3,163 | # frozen_string_literal: true
require 'iso_bib_item/contributor'
module IsoBibItem
# Person's full name
class FullName
# @return [Array<IsoBibItem::LocalizedString>]
attr_accessor :forenames
# @return [Array<IsoBibItem::LocalizedString>]
attr_accessor :initials
# @return [IsoBibItem::Localiz... | 27.99115 | 83 | 0.653177 |
622ff3312c2f8ac5264ec1e3b607c6f5f083a893 | 157 | class CreateExoplanets < ActiveRecord::Migration
def change
create_table :exoplanets do |t|
t.string :name
t.timestamps
end
end
end
| 15.7 | 48 | 0.681529 |
6abfcba7684bf8f0a55099657a9b593cd60236e5 | 3,933 | 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.4 | 102 | 0.757946 |
03a10c5a4d468d4c05de11710a7018382225c762 | 2,369 | # frozen_string_literal: true
require "cose"
require "openssl"
require "webauthn/attestation_statement/base"
require "webauthn/attestation_statement/fido_u2f/public_key"
module WebAuthn
module AttestationStatement
class FidoU2f < Base
VALID_ATTESTATION_CERTIFICATE_COUNT = 1
VALID_ATTESTATION_CERTIFI... | 32.902778 | 109 | 0.728577 |
28e9fc632b21a0a0dd4c127d9c97c8d81c9be1dc | 4,904 | class LeaguesController < ApplicationController
def index
if params["id"]
@leagues = League.find params["id"]
else
@leagues = League.all
end
render :json => @leagues
end
def new
@league = League.new
end
def create
matches_per_gameday = (params[:size].to_i / 2)
# Set ... | 31.844156 | 268 | 0.628263 |
5df76759739759f2e800ece3b61bde3426f40498 | 540 | # frozen_string_literal: true
class AddBoothsToEmailSettings < ActiveRecord::Migration
def change
add_column :email_settings, :send_on_booths_acceptance, :boolean, default: false
add_column :email_settings, :booths_acceptance_subject, :string
add_column :email_settings, :booths_acceptance_body, :text
... | 41.538462 | 84 | 0.801852 |
ff5de66e166b1ab5486b34a63764f4e0dc946478 | 367 | require "bundler/setup"
require "trace_graph"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with ... | 24.466667 | 66 | 0.754768 |
01d9dafbc5db9a896e0d8fb9f2ff9994c17d912c | 201 | class ApplicationController < ActionController::Base
include ApplicationHelper
before_action :current_user
def cart
@cart ||= session[:cart] || []
session[:cart] ||= @cart
end
end
| 16.75 | 52 | 0.686567 |
bbf3c10fde3239aa716e301f2c7388ecc3cdd701 | 4,908 | # frozen_string_literal: true
#
# Resolves any embedded placeholders
#
class ResolvePlaceholders < GrammarTransform
def pre_transform(pattern, options)
return pattern unless pattern.is_a? PatternBase
pattern_copy = pattern.__deep_clone__
pattern_copy.map!(true) do |each_pattern_like|
... | 40.561983 | 101 | 0.565607 |
618e3936fb5fe23588c490aec5de6fc56bd20099 | 543 | require 'stringio'
describe :net_httpresponse_body, shared: true do
before :each do
@res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
@socket = Net::BufferedIO.new(StringIO.new("test body"))
end
it "returns the read body" do
@res.reading_body(@socket, true) do
@res.send(@metho... | 25.857143 | 70 | 0.662983 |
bb3e63b3f3031a3adbe244cf5686e0e6208b184b | 3,898 | #!/usr/bin/env ruby
#
# Robert Schultheis (Knewton)
# This is a slightly modified BlankSlate, as taken from https://github.com/masover/blankslate
# Included is some stuff allowing us to send methods back to a parent
# Which makes our api script DSL very easy to use
#
# Original file comments:
#
#--
# Copyright 200... | 30.692913 | 94 | 0.659569 |
1c53aec3d530639e8d45264716f1cc619b89ee8e | 10,318 | # frozen_string_literal: true
module SidekiqUniqueJobs
# ThreadSafe config exists to be able to document the config class without errors
ThreadSafeConfig = Concurrent::MutableStruct.new("ThreadSafeConfig",
:lock_timeout,
... | 37.384058 | 121 | 0.613491 |
ede43d6ff15575db8515aff0859acdcef0e2c8a2 | 1,108 | # frozen_string_literal: true
require 'rails_helper'
describe Players::ProfileInfo do
let(:params) { { id: player.id } }
let(:service) { described_class.new(params) }
let(:player) { create(:player) }
before do
4.times do |n|
create(:score, player: player, score_point: n + 1, score_at: DateTime.now ... | 24.086957 | 88 | 0.643502 |
33a68384700edfe7e6ae218461922c9edcf5d147 | 1,647 | # -------------------------------------------------------------------------- #
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# no... | 37.431818 | 78 | 0.494839 |
bf3d0d0204aa7150b81cd143c23985e36531f371 | 9,567 | #
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class Hhvm4131 < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "h... | 35.565056 | 125 | 0.705864 |
f7c7ce5b4aac4875edd6170a46fe321cc3b6af58 | 1,515 | require_relative './items.rb'
class GildedRose
def initialize(items)
@items = items
end
def update_quality()
@items.each do |item|
if item.name != "Aged Brie" and item.name != "Backstage passes to a TAFKAL80ETC concert"
if item.quality > 0
if item.name != "Sulfuras, Hand of Ragn... | 26.578947 | 94 | 0.505611 |
f87b6d8d66721365747504f5061b09703083107a | 852 | # frozen_string_literal: true
# == Schema Information
#
# Table name: likes
#
# id :integer not null, primary key
# user_id :integer not null
# recipient_id :integer not null
# recipient_type :string(510) not null
# created_at :datetime
# updated_at :d... | 21.3 | 63 | 0.64554 |
1a4c233b9c66304c9cf19534c3414f8b1cfa27d3 | 43 | require 'rethinkdb'
require 'epiphy/model'
| 14.333333 | 22 | 0.790698 |
393b68dcf656d03da29db0b729be0fa7c3e9cc43 | 20 | package "leiningen"
| 10 | 19 | 0.8 |
e8e7f319ab354591df9b40aef865128584a8ad5a | 1,411 | class TicketPurchasesController < ApplicationController
def index
@ticket_purchases = TicketPurchase.all
end
def show
end
def new
@movie = Movie.find_by_id(params[:movie_id])
@movies = Movie.all
@viewings = Viewing.all
@ticket_purchase = TicketPurchase.new
@tickets = Ticket.all
en... | 28.795918 | 162 | 0.710135 |
62a97bb2a4427bbf8f7630c3d3f2e296da95136f | 3,265 | require 'unparser'
require 'optparse'
require 'diff/lcs'
require 'diff/lcs/hunk'
require 'unparser/cli/source'
require 'unparser/cli/differ'
require 'unparser/cli/color'
module Unparser
# Unparser CLI implementation
class CLI
EXIT_SUCCESS = 0
EXIT_FAILURE = 1
# Run CLI
#
# @param [Array<Stri... | 19.787879 | 61 | 0.553752 |
3969d8b19152a3e372ac2ff4ad8290590608fbc6 | 10,441 | # -------------------------------------------------------------------------- #
# Copyright 2002-2021, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# no... | 33.680645 | 84 | 0.442582 |
21cba97aa5a4fdd1933ea9e679648c299231bc7c | 1,500 | RSpec.describe Rack::Protection::StrictTransport do
it_behaves_like "any rack application"
it 'should set the Strict-Transport-Security header' do
expect(get('/', {}, 'wants' => 'text/html').headers["Strict-Transport-Security"]).to eq("max-age=31536000")
end
it 'should allow changing the max-age option' d... | 34.090909 | 139 | 0.678 |
6ae328d575af072f513fd52f5f4516f891c26340 | 823 | # frozen_string_literal: true
module BrickFTP
module Types
using BrickFTP::CoreExt::Struct
# membership object
#
# @see https://developers.files.com/#add-a-member membership object
#
# ATTRIBUTE | TYPE | DESCRIPTION
# --------- | ------- | -----------
# id | integer | Globa... | 27.433333 | 88 | 0.618469 |
875b68fb1f7f44f8f8898ff1134ab7384daec2d5 | 137 | class AddInactiveToFaculty < ActiveRecord::Migration
def change
add_column :faculty, :inactive, :boolean, default: false
end
end
| 22.833333 | 60 | 0.766423 |
5de2fa029fea8e623ea6c9acc55f507af14e6361 | 999 | describe Clowne::Resolvers::Finalize do
let(:declaration) { Clowne::Declarations::Finalize.new(&block) }
describe ".call" do
let(:source) { AR::User.new(email: "admin@example.com") }
let(:params) { {} }
let(:block) do
proc do |source, record|
record.email = source.email.gsub("example.com"... | 26.289474 | 71 | 0.605606 |
79b90cb19de6e0639388d1f8b1ecfb97db233f66 | 627 | cask 'mamp' do
if MacOS.version <= :mavericks
version '3.5.2'
sha256 'b935d118b6e14d43cf2570be2a05166a15b824c3edc0ede98cc30e6ab5af3697'
else
version '4.4.1'
sha256 '5eab5e3bcca0e7c9641d4cf21c7ee4a5698fa0c2ed7980cdb6a728de7857084b'
end
url "https://downloads.mamp.info/MAMP-PRO/releases/#{version... | 28.5 | 93 | 0.751196 |
f80b39eb53a9ad9750dda95d4145028918487dc4 | 1,315 | module EE
module NamespaceHelper
def namespace_shared_runner_limits_quota(namespace)
used = namespace.shared_runners_minutes.to_i
if namespace.shared_runners_minutes_limit_enabled?
limit = namespace.actual_shared_runners_minutes_limit
status = namespace.shared_runners_minutes_used? ? ... | 27.395833 | 97 | 0.663878 |
6221fc0eb81d577d81ea567b2f98124d74b155d1 | 7,339 | # -------------------------------------------------------------------------- #
# Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# no... | 44.75 | 97 | 0.563156 |
33f9e2c8a51ee3e28ed7ee9e28afb3fd2c4a61b9 | 1,738 | require 'test_helper'
class UsersLoginTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
end #vidi fixtures users.yml
test "login with invalid information" do
get login_path
assert_template 'sessions/new'
post login_path, params: { session: { email: "", password: ... | 30.491228 | 71 | 0.647296 |
f81446aa9e771fdd87637fb0a6e016fa876c5787 | 93 |
require 'rails_helper'
describe Product do
it { should validates_presence_of :name }
end
| 13.285714 | 43 | 0.774194 |
abeb95061ae9ed063b294aed51efbbd9c0777254 | 4,088 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = GreatRanking
#
# This module acts as an HTTP server
#
include Msf::Exploit::Remote::HttpServer::HTML
def initializ... | 28.193103 | 124 | 0.562378 |
6a21a2776f4a4951dd8cd8ec1164e206d2d33e94 | 71 | module Beardley
module Groovy
VERSION = '2.0.1'.freeze
end
end
| 11.833333 | 28 | 0.676056 |
e9c3d59b5ef108c83129cc280c65217031538882 | 500 | require File.dirname(__FILE__) + '/../../../spec_helper'
require 'set'
ruby_version_is "1.8.7" do
describe "SortedSet#hash" do
it "is static" do
SortedSet[].hash.should == SortedSet[].hash
SortedSet[1, 2, 3].hash.should == SortedSet[1, 2, 3].hash
SortedSet["a", "b", "c"].hash.should == SortedSe... | 31.25 | 75 | 0.6 |
79b132f3fce6d047c6bc484dddfc54104258bf6b | 2,146 | require 'coderay'
require 'htmlentities'
class PublifyApp
class Textfilter
class Code < TextFilterPlugin::MacroPre
plugin_display_name 'Code'
plugin_description 'Apply coderay highlighting to a code block'
DEFAULT_OPTIONS = { css: :class,
wrap: :span,
... | 30.225352 | 81 | 0.546132 |
bb99d66936bf78c3471dd089f62342bec512a825 | 154 | # Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Quickrep::Application.initialize!
| 25.666667 | 52 | 0.792208 |
ffc35f91beec74012de40b88ebd3e63f3f69c8fb | 714 | require 'test/unit'
class TestLoadingBuiltinLibraries < Test::Unit::TestCase
def test_late_bound_libraries
assert_nothing_raised {
require 'jruby.rb'
require 'jruby/ext.rb'
require 'iconv.so'
require 'nkf.so'
require 'stringio.so'
require 'strscan.so'
require 'zlib.so'
... | 24.62069 | 56 | 0.631653 |
08686772fb3b843e94245eab603648a5fe8b8bba | 82,110 | # 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::V2019_06_01
#
# PrivateLinkServices
#
class PrivateLinkServices
include MsRestAzure
#
# Creates and initializes a new instan... | 46.103313 | 197 | 0.711862 |
e2cb55617e4f3f699e9073154c2ff76ae4e01dc2 | 435 | require 'test_helper'
class Foorm::FormTest < ActiveSupport::TestCase
test 'get latest form and version gets correct form' do
form1 = create :foorm_form
form2 = create :foorm_form, name: form1.name, version: form1.version + 1
questions, version = Foorm::Form.get_questions_and_latest_version_for_name(for... | 33.461538 | 90 | 0.763218 |
f87f9c4ca0e334042b980610620b7f04d32e2ec0 | 1,214 | class Ttyd < Formula
desc "Command-line tool for sharing terminal over the web"
homepage "https://tsl0922.github.io/ttyd/"
url "https://github.com/tsl0922/ttyd/archive/1.6.1.tar.gz"
sha256 "d72dcca3dec00cda87b80a0a25ae4fee2f8b9098c1cdb558508dcb14fbb6fafc"
license "MIT"
revision 1
head "https://github.com/... | 31.947368 | 93 | 0.733114 |
e27145d5b410f090b688047a532eba5a33d137c3 | 2,631 | class Expat < Formula
desc "XML 1.0 parser"
homepage "https://libexpat.github.io/"
url "https://github.com/libexpat/libexpat/releases/download/R_2_2_10/expat-2.2.10.tar.xz"
sha256 "5dfe538f8b5b63f03e98edac520d7d9a6a4d22e482e5c96d4d06fcc5485c25f2"
license "MIT"
livecheck do
url "https://github.com/libex... | 31.321429 | 96 | 0.660585 |
0188513e197ed3853ae6f4e12635e74cbb04f571 | 2,132 | # Copyright (c) 2015, Groupon, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions and the f... | 38.071429 | 74 | 0.785647 |
33040013539e33cbc66d579223b5248a8b5c69fb | 2,047 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suit... | 40.137255 | 85 | 0.770396 |
5d6fcb79b27fb2eed0f80b0b0229d238f5bf30ff | 2,308 | require 'psych/helper'
require 'yaml/store'
require 'tmpdir'
module Psych
Psych::Store = YAML::Store unless defined?(Psych::Store)
class YAMLStoreTest < TestCase
def setup
@engine, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'psych'
@dir = Dir.mktmpdir("rubytest-file")
File.chown(-1, Process.... | 26.227273 | 77 | 0.655113 |
21c2e4311002fb6713e45bfa1d9bf5930a112776 | 828 | require 'rubygems'
require 'spec'
require 'active_support'
require 'active_record'
require 'xapit' # gem install xapit
# setup database adapter
ActiveRecord::Base.establish_connection({
:adapter => "sqlite3",
:dbfile => File.dirname(__FILE__) + "/test.sqlite3"
})
load File.dirname(__FILE__) + '/schema.rb' unless ... | 20.7 | 103 | 0.713768 |
08b333d91089797642ab78344b9b0cd4372ca5d2 | 701 | # == Schema Information
#
# Table name: combined_competitions
#
# id :integer not null, primary key
# name :string
# created_at :datetime
# updated_at :datetime
# use_age_group_places :boolean default(FALSE), not null
# tie_break_by_firsts :... | 25.962963 | 80 | 0.659058 |
d5d8dcf5d06c5d2719ac86254b84bbb99d137a62 | 536 | =begin
Copyright 2010-2014 Tasos Laskos <tasos.laskos@arachni-scanner.com>
This file is part of the Arachni Framework project and is subject to
redistribution and commercial restrictions. Please see the Arachni Framework
web site for more information on licensing and terms of use.
=end
module Arachni:... | 26.8 | 80 | 0.753731 |
91cf764d6d49584fd546f4244a94b57c5a3c1339 | 490 | class CreateChecklists < ActiveRecord::Migration[6.0]
def change
create_table :checklists do |t|
t.boolean :question_1
t.boolean :question_2
t.boolean :question_3
t.boolean :fever
t.boolean :cough
t.boolean :short_breath
t.boolean :chills_sweats
t.boolean :aches
... | 22.272727 | 53 | 0.646939 |
bb46bd657e841d1cecae2e745616710e83f833cc | 1,263 | # frozen_string_literal: true
module Gitlab
module ImportExport
extend self
# For every version update the version history in these docs must be kept up to date:
# - development/import_export.md
# - user/project/settings/import_export.md
VERSION = '0.2.4'.freeze
FILENAME_LIMIT = 50
def ... | 19.734375 | 95 | 0.653207 |
612928f65b3e94ac9184bad412bd4731589027a4 | 727 | ################################################################################
# Project SFRWatcher: A Salesforce Chatter Externalization Tool #
# Copyright © 2010 Raymond Gao / http://Appfactory.Are4.us #
# Demo app running on http://parl8-vo.us:3000/ ... | 26.925926 | 80 | 0.488308 |
18ed6a9707f93dc78d261dc6ce5feb9ac9ae4b3d | 65 | require_relative '../tests/monitoring/monitoring_server_spec.rb'
| 32.5 | 64 | 0.846154 |
91e8be20b5a2d3aba32425ad405e343290fa2372 | 396 | cask 'lockdown' do
version '1.0.0'
sha256 '047f377e2a9495361084268c86cc80719e123bd8958d69fe51cd2be0d7ffd764'
# bitbucket.org/objective-see was verified as official when first introduced to the cask
url "https://bitbucket.org/objective-see/deploy/downloads/Lockdown_#{version}.zip"
name 'Lockdown'
homepage '... | 33 | 90 | 0.782828 |
38a15de2ebde885899369860411643eafe7cb9e9 | 270 | class AddPositionToSectionTagJoin < ActiveRecord::Migration[6.0]
def change
add_column :section_tag_joins, :tag_position, :integer
SectionTagJoin.all.each do |st|
st.update_column :tag_position, st.section&.tags_order&.index(st.tag_id)
end
end
end
| 30 | 78 | 0.751852 |
ac7b5b029fb4e325dd78613270ee5a3cd4c1cee9 | 756 | # frozen_string_literal: true
module Faker
class Dota < Base
class << self
extend Gem::Deprecate
def hero
Faker::Games::Dota.hero
end
def item
Faker::Games::Dota.item
end
def team
Faker::Games::Dota.team
end
def player
Faker::Gam... | 21 | 62 | 0.583333 |
d5cb39bb5f94c5561f72053102281ccb15ef9102 | 2,096 | require 'rails_helper'
RSpec.describe User, type: :model do
let(:github_omniauth_hash) { OmniAuth.config.mock_auth[:github] }
let(:user) { create(:user) }
it { is_expected.to have_many(:repo_accesses).dependent(:destroy) }
it { is_expected.to have_and_belong_to_many(:organizations) }
descr... | 27.946667 | 90 | 0.687977 |
33de4665f3a4fa68cb59cf49f472221333836eb9 | 1,421 | class Mpg123 < Formula
desc "MP3 player for Linux and UNIX"
homepage "https://www.mpg123.de/"
url "https://www.mpg123.de/download/mpg123-1.28.2.tar.bz2"
mirror "https://downloads.sourceforge.net/project/mpg123/mpg123/1.28.2/mpg123-1.28.2.tar.bz2"
sha256 "7eefd4b68fdac7e138d04c37efe12155a8ebf25a5bccf0fb7e775af... | 30.891304 | 95 | 0.705841 |
21349f53216c451bfb680f6cd6a5fcea79bc9db8 | 1,652 | #
# Be sure to run `pod lib lint AudioPlayer.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 = 'AudioPl... | 36.711111 | 104 | 0.637409 |
01ca9893ede68c11c7562532e06e611b8c6ae381 | 7,705 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.585366 | 194 | 0.709669 |
b99bb85e0f80629b8cbdc5e3a96f9cf2c2028c7e | 815 | require_dependency "tent/application_controller"
module Tent
class Admin::SiteController < ApplicationController
before_filter :set_site
def dashboard
raise 'does not work dashboard'
end
def configure
# show site settings
end
def configure_update
if @site.update site_para... | 20.897436 | 109 | 0.667485 |
62c9297e529d08024e96576875c86bc4721f1034 | 575 | class Wtf < Formula
desc "Translate common Internet acronyms"
homepage "https://sourceforge.net/projects/bsdwtf/"
url "https://downloads.sourceforge.net/project/bsdwtf/wtf-20190623.tar.gz"
sha256 "60b2e78d3abe66fcd945881be282f5c2e3b94e3d5118253b9a9addff29207edf"
bottle :unneeded
def install
inreplace ... | 27.380952 | 76 | 0.714783 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.