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
ff9598bd218c4a0f0457d413821d85c288476ac8
1,901
require 'spec_helper' feature 'fae_pulldown' do scenario 'should open and select items', js: true do varietal = FactoryGirl.create(:varietal) admin_login visit new_admin_release_path page.find('#release_varietal_id_chosen').click page.find('#release_varietal_id_chosen .active-result', text: va...
28.373134
98
0.740137
d5f94bab5f30866138ae0ea1456fba332d935453
179
require 'furoshiki/configuration' require 'furoshiki/exceptions' require 'furoshiki/jar' require 'furoshiki/mac_app' require 'furoshiki/windows_app' require 'furoshiki/linux_app'
25.571429
33
0.832402
bf727285a9fe2a2e8b415ce16beb6e3f8237c6b7
1,049
require 'spec_helper' describe Gitlab::ImportExport::AfterExportStrategyBuilder do let!(:strategies_namespace) { 'Gitlab::ImportExport::AfterExportStrategies' } describe '.build!' do context 'when klass param is' do it 'null it returns the default strategy' do expect(described_class.build!(nil)....
34.966667
108
0.714967
ab2cb0c66a3981a1e84e6bbad7522e05971f7adc
375
module V1 class Surveys < Grape::API include V1::Defaults include Grape::Rails::Cache resources :surveys do desc "grab a survey" get '/:name' do survey = Survey.where(:slug => params[:name]).first cache(key: "s::#{survey.slug}", expires_in: 2.days) do SurveySerializ...
20.833333
62
0.589333
873a4afd1109d2efae06e5b991c7863f8be1e62d
1,950
require 'net/http' require 'openssl' require 'uri' module Rester module Client::Adapters class HttpAdapter::Connection DEFAULT_DATA_HEADERS = { "Content-Type".freeze => "application/x-www-form-urlencoded".freeze }.freeze attr_reader :url attr_reader :timeout def initialize...
25.324675
75
0.572308
21d890d9a02229b54acd5b7587a7af891e168595
30,476
# frozen_string_literal: true require "spec_helper" class InMemoryBackend class Subscriptions < GraphQL::Subscriptions attr_reader :deliveries, :pushes, :extra, :queries, :events def initialize(schema:, extra:, **rest) super @extra = extra @queries = {} # { topic => { fingerprint => ...
37.211233
181
0.589316
b909a41a005721e46aa41b392e5113117e5776f8
985
class Vecx < Formula desc "Vectrex emulator" homepage "https://github.com/jhawthorn/vecx" url "https://github.com/jhawthorn/vecx/archive/v1.1.tar.gz" sha256 "206ab30db547b9c711438455917b5f1ee96ff87bd025ed8a4bd660f109c8b3fb" head "https://github.com/jhawthorn/vecx.git" bottle do cellar :any sha256 "...
30.78125
92
0.745178
e8be6058a92f29ac78f25ff3c43be691ad96e36a
2,269
# -*- coding: utf-8 -*- # # TECS Generator # Generator for TOPPERS Embedded Component System # # Copyright (C) 2008-2014 by TOPPERS Project #-- # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ # ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 # 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. # (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 # ...
26.694118
105
0.693698
218bdbdd9a0fd44dc7a7e67d8bfa51953092191a
5,851
class CGI # URL-encode a string. # url_encoded_string = CGI::escape("'Stop!' said Fred") # # => "%27Stop%21%27+said+Fred" def CGI::escape(string) string.gsub(/([^ a-zA-Z0-9_.-]+)/) do '%' + $1.unpack('H2' * $1.bytesize).join('%').upcase end.tr(' ', '+') end # URL-decode a string with ...
32.148352
110
0.522133
28bc09714a0b0eb68f3495349e843dc524e97b6e
3,946
require 'yaml' require 'acmesmith/storages' require 'acmesmith/challenge_responders' require 'acmesmith/challenge_responder_filter' require 'acmesmith/domain_name_filter' require 'acmesmith/post_issuing_hooks' module Acmesmith class Config ChallengeResponderRule = Struct.new(:challenge_responder, :filter, keywor...
30.122137
299
0.635327
f885ca3c0a4fe176461e4818245aa50e833097d4
1,159
require 'spec_helper' describe RMceUploadr::App do before(:each) do RMceUploadr.stub!(:dbconf=).and_return(true) end describe "settings" do it "should set cdn_host" do RMceUploadr::App.should_receive(:set).with(:cdn_host, "http://cdn.host.com/") RMceUploadr::App.new do |conf| conf....
28.975
112
0.628128
b9758c2939abcba6b5ab911ae342a8f889ce2010
2,194
# Copyright 2011-2013 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://aws.amazon.com/apache2.0/ # # or in the "license" fil...
31.797101
85
0.66773
7a5112615553f3b5c3503315389f72f6e384bfee
775
cask 'packet-peeper' do version '2019-04-06' sha256 'd5268d36fdf6c97276eceadd3be3ef3b72618fce3996bab26cdacdfd9938dc63' # bitbucket.org/choll/packetpeeper was verified as official when first introduced to the cask url "https://bitbucket.org/choll/packetpeeper/downloads/PacketPeeper_#{version}.dmg" appcast 'ht...
40.789474
148
0.732903
e29b9f0ec37ceebf94bf84884611554407890bcc
1,190
module ApplicationHelper # http://qiita.com/ppworks/items/9bf917edf0d4927b15bd def link_to_if_with_block(condition, options = nil, html_options = nil, &block) if condition link_to(options, html_options, &block) else capture(&block) end end def display_age(user) return if user.try(:a...
34
116
0.561345
edafc19557a2f96ab3b9732ca0ecd169fa25f543
3,245
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::Tcp include Msf::Exploit::CmdStager def initialize(info = {}) super...
26.169355
101
0.565177
e9d61ab0b4de726e2f0350eaa772c776ead7bf40
307
# frozen_string_literal: true require_relative 'spreadsheet' module GoogleApiMock class SpreadsheetsRepo def by_version(version, opts = {}) @spreadsheets ||= Hash.new do |h, k| h[k] = Spreadsheet.new(k) end @spreadsheets[version].modify_sheet_order(opts) end end end
20.466667
53
0.680782
7954d9f670e7f4d01180c824cad5af63c37c59b4
2,828
class Burp < Formula desc "Network backup and restore" homepage "https://burp.grke.org/" license "AGPL-3.0" revision 1 stable do url "https://downloads.sourceforge.net/project/burp/burp-2.2.18/burp-2.2.18.tar.bz2" sha256 "9c0c5298d8c2995d30d4e1a63d2882662e7056ce2b0cee1f65d7d0a6775c0f81" resource...
26.185185
108
0.62447
33a3704a3fd41d4939a9a94978895e21b0553bd6
490
require "logger" module Emque module Producing class Logging def self.initialize_logger(log_target = STDOUT) @logger = Logger.new(log_target) @logger.level = Logger::INFO @logger end def self.logger defined?(@logger) ? @logger : initialize_logger end ...
18.846154
55
0.591837
ed726d2ba5066b1aff4a386d277e9e39c114fd2e
64,396
# frozen_string_literal: true require "active_support/core_ext/string/access" require "digest/sha2" module ActiveRecord module ConnectionAdapters # :nodoc: module SchemaStatements include ActiveRecord::Migration::JoinTable # Returns a hash of mappings from the abstract data types to the native ...
38.746089
155
0.618703
26381c2e6913f5c2b1d8fde27921445cee52a08b
1,426
# -*- encoding: utf-8 -*- require 'test_helper' require 'hexapdf/font_loader' require 'hexapdf/document' describe HexaPDF::FontLoader::FromConfiguration do before do @doc = HexaPDF::Document.new font_file = File.join(TEST_DATA_DIR, "fonts", "Ubuntu-Title.ttf") @font_obj = HexaPDF::Font::TrueType::Font.n...
32.409091
89
0.673913
1d6ad65363585e901e920b2c549f2466efa4ac63
113
require 'saneitized/version' require 'saneitized/converter' require 'saneitized/hash' require 'saneitized/array'
22.6
30
0.823009
1845e88e89245b6498d5f0345ed6afab0e9cd779
8,413
# coding: utf-8 require "json" folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1' Pod::Spec.new do |s| s.name = "QIMReactNativeLibrary" s.version = "4.0.19" s.summary = "Qunar chat App 6.0+ version QIMCommon" s.description = <<-DESC Qunar QI...
39.683962
350
0.619636
4a3c481232fe297206387c0acc25ac02a401f76a
671
Ирины Леоновой, общего права супруга популярного российского актера, Евгений Цыганов, родила седьмого ребенка. Девушка родилась в московской клинике. Новорожденная девочка и ее мама чувствуют себя хорошо. Подытожим, Цыганов и Леоновой недавно расстались. Евгений отказался от комментариев. Ирина обвиняет все на мужа и е...
61
142
0.81073
abc65500d8cb2edbf9ada9bb1128a73ec4ded718
119
class AddSchoolsToVenues < ActiveRecord::Migration def change add_column :venues, :school_id, :integer end end
19.833333
50
0.764706
39a662ff743fae8d2731dfe0ae9ea737057847cd
628
require 'spec_helper' describe ApiKey do let(:user) {User.create(:email => 'email@email.com', username: 'user', name: 'User')} it "creates api keys" do api_key = ApiKey.create(scope: 'session', user: user) api_key.should_not be_new_record api_key.expired_at.should be_a Time api_key.oauth_code.shoul...
33.052632
87
0.734076
1a119c3cf213ce3827def7346de3e2bbf84e7a19
9,556
# # This cinch plugin is part of EV0002 # # written by carstene1ns <dev @ f4ke . de> 2014-2017 # available under ISC license # require "json" class Cinch::GitHubWebhooks include Cinch::Plugin extend Cinch::HttpServer::Verbs post "/github_webhook" do request.body.rewind payload = request.body.read ...
30.925566
95
0.498535
d568c86fe4a9b2b603fcfb5f091c822c58662346
4,469
module Binance module Api class << self def all_coins_info!(recvWindow: nil, api_key: nil, api_secret_key: nil) timestamp = Configuration.timestamp params = { recvWindow: recvWindow, timestamp: timestamp } Request.send!(api_key_type: :read_info, security_type: :user_data, ...
45.602041
141
0.633923
8722090180523bd0e9c72b81e2f284da07ee79aa
536
#!/usr/bin/env ruby file_path = File.expand_path("../day-17-input.txt", __FILE__) input = File.read(file_path) x1, x2, y1, y2 = input.scan(/x=([-\d]*)..([-\d]*), y=([-\d]*)..([-\d]*)/) .flatten.map(&:to_i) max_v = nil (y1..500).each do |yv| vel = yv current = yv step = 1 while true if (y1..y2).co...
13.4
73
0.535448
28a11b01d8659403e243bdcb59d0c5092006b7c1
113
class MigrateTeamLogos < ActiveRecord::Migration[6.0] def change remove_column :teams, :logo_url end end
18.833333
53
0.752212
bb588daa64239518f38bb3cf0aa2b53d1c219b38
133
module Ckeditor class Asset < ActiveRecord::Base include Orm::ActiveRecord::AssetBase include Backend::Paperclip end end
19
40
0.75188
6162b05dc1a2df47de1bfdbcc1634966ce350357
5,335
require "active_support/core_ext/integer/time" 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 applica...
44.090909
114
0.765323
089be7b5b68ae1a2babd27160e4c8d15c1c36651
471
module Syncoku module CaptureBackup include Runnable include Git def capture puts "Capturing #{production_app_name} backup..." run_on_production("pg:backups:capture") run_on_production("pg:backups:url").strip end def run_on_production(command) run_command "heroku #{comman...
20.478261
66
0.694268
61af1ff7870b6c2ef523e347246a0438578a49f6
845
require_relative '../../../puppet_x/puppetlabs/aws.rb' Puppet::Type.type(:rds_db_option_group).provide(:v2, :parent => PuppetX::Puppetlabs::Aws) do confine feature: :aws mk_resource_methods def self.instances regions.collect do |region| instances = [] rds_client(region).describe_option_groups.e...
27.258065
92
0.68284
bf57869699d1fbd8154625ccc38e72c2ab0691bb
280
class Vote < Command def initialize(booth, rapper) @booth = booth @rapper = rapper end #executes the command def execute if @rapper.player_number == 1 @booth.vote1 += 1 end if @rapper.player_number == 2 @booth.vote2 += 1 end end end
16.470588
33
0.610714
b938c334e810e91960bf06096f3a264462617b81
6,482
=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.17 =end require 'date' module NSXTPolicy # Traffic statistics for IPSec VPN Ike session. Note - Not support...
28.555066
107
0.613854
28813d1d527d67dc71e258455236b0124e44a385
1,048
cask 'origin' do version '10.5.41.27263' sha256 '51877040b03abe9d7a8ed9af05be15b495576249d5088b2822665bf9da90717f' # origin-a.akamaihd.net was verified as official when first introduced to the cask url "https://origin-a.akamaihd.net/Origin-Client-Download/origin/mac/live/OriginUpdate_#{version.dots_to_undersco...
40.307692
124
0.692748
6a452ee42e08ccc08ea1aeee3da93bf8cdd55e1a
2,180
class StoreUserServiceArea < ActiveRecord::Base include ElasticsearchSearchable belongs_to :store_user belongs_to :service_area # elasticsearch settings settings index: { number_of_shards: 1 } do mappings dynamic: 'strict' do indexes :store_id indexes :store_user_id indexes :product_id...
26.26506
118
0.632569
e22ced8cd44f7bfe5f654afcf479aa8f52c31c5f
1,197
require 'rails_helper' describe Admin::PoliciesController, type: :controller do describe '#index' do let(:search_object) { double } let(:facets_object) { double } let(:policies) { double } let(:send_action) { get :index, search: { query: 'search term' } } before(:each) do allow(Request::S...
23.94
84
0.644946
d5e52e31dc19d997d17ca086b3359cb9f5a5b433
1,969
# NB, responses gathered on 2017-01-24 def mock_ping_response "Everything's Ok!" end def mock_ping_error_response {"error"=>"Invalid Mailigen API Key: invalid_api_key", "code"=>104} end def mock_listCreate_response(list_name="test_list") Digest::SHA256.hexdigest(list_name).first(8) end def mock_lists_response...
21.637363
69
0.568309
1d8f07ab5b7063b96fe5fb662b5abedb2dd494f0
95
def iter_hash(hash) hash.each do |arr| puts arr[0] puts arr[1] end end
13.571429
22
0.536842
6a6fedacf28351b7f969066d98fb9ca57218b589
625
cask 'cura' do version '2.6.2' sha256 'd288f5ea5f00ae5d2c6b0a586ad28a67a7487962d5443b38a2feee7ccfdf9ed5' url "https://software.ultimaker.com/current/Cura-#{version}-Darwin.dmg" name 'Cura' homepage 'https://ultimaker.com/en/products/cura-software' conflicts_with cask: 'lulzbot-cura' app 'Cura.app' u...
28.409091
81
0.6512
b9e4e668e9b1bcc08a2d970822e10b9be0244995
4,872
# Phusion Passenger - https://www.phusionpassenger.com/ # Copyright (c) 2013-2014 Phusion # # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal...
31.843137
90
0.703612
ac36723a449ea2e9c4388d4baed9251290b18bf0
59
module Ruby module Anmat VERSION = "0.1.3" end end
9.833333
21
0.627119
790828218e2c8e9cfce53f4db6e291e452ee6424
1,424
describe AnalyticalValue::Query do let(:date) { Time.current.end_of_week } let(:range) { 1.week } let(:prev_date) { date - range } let(:prev_prev_date) { prev_date - range } let(:options) { { date: date, range: range } } it { expect(subject.value).to eq 0 } it { is_expected.to be_zero } context "queryi...
34.731707
120
0.61236
6a40141a05078cb5531eade6c7f698028e56593c
903
# -*- encoding: utf-8 -*- lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'touchpunch-rails/version' Gem::Specification.new do |gem| gem.name = "touchpunch-rails" gem.version = Touchpunch::Rails::VERSION gem.authors = ["Geo"] gem.e...
41.045455
149
0.647841
03e62c6487f4b60ed56039025d79a9e54112e485
1,433
describe Travis::API::V3::Services::BuildPermissions::FindForOrganization, set_app: true do let(:organization) { FactoryBot.create(:org_v3) } let(:user) { FactoryBot.create(:user, login: 'pavel-d', vcs_type: 'GithubUser') } let(:token) { Travis::Api::App::AccessToken.create(user: user, app_id: 1) } let(:heade...
34.119048
95
0.575017
6256273f6b5a4b46e1a41a585f0087fcfe45aacf
266
# frozen_string_literal: true require_dependency "renalware/patients" module Renalware module Patients class PracticeMembership < ApplicationRecord acts_as_paranoid belongs_to :practice belongs_to :primary_care_physician end end end
17.733333
48
0.766917
3872f203427ccd075fbe65f1f8bd0727c5c81b44
1,169
# -*- encoding: utf-8 -*- # stub: thor 0.20.0 ruby lib Gem::Specification.new do |s| s.name = "thor" s.version = "0.20.0" s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version= s.require_paths = ["lib"] s.authors = ["Yehuda Katz", "Jos\u{e9} Valim"] s.d...
32.472222
109
0.658683
1c82c8ea618b153a9d8a347468f1574b20ef27f3
404
module Makoto class TestCaseFilter < Ginseng::TestCaseFilter include Package def self.create(name) return all.find {|v| v.name == name} end def self.all return enum_for(__method__) unless block_given? config.raw.dig('test', 'filters').each do |entry| yield "Makoto::#{entry[...
23.764706
86
0.660891
616b3716c468a40680b30ba0818808a5f7fff373
999
require 'json' package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) Pod::Spec.new do |s| s.name = "RNFBUtils" s.version = package["version"] s.description = package["description"] s.summary = <<-DESC A well tested feature...
43.434783
122
0.560561
79154f143b4f60fd3afa3dbeade36aad01ce35eb
6,207
require 'cucumber/formatter/console' require 'fileutils' module Cucumber module Formatter # The formatter used for <tt>--format pretty</tt> (the default formatter). # # This formatter prints features to plain text - exactly how they were parsed, # just prettier. That means with proper indentation and...
27.834081
109
0.582407
4a7ab32d9ab666bf12c1609a8b7eea350f7c5469
1,751
module Recaptcha # This class enables detailed configuration of the recaptcha services. # # By calling # # Recaptcha.configuration # => instance of Recaptcha::Configuration # # or # Recaptcha.configure do |config| # config # => instance of Recaptcha::Configuration # end # # you are abl...
30.189655
109
0.696174
abc292f27bbb31939ca95f3125ef39d5a7ec2aa4
137
class AwardedBadge < ApplicationRecord belongs_to :badge belongs_to :participant def approved? approval_status == 1 end end
15.222222
38
0.751825
b95b5eb9b5c61f2e1254b18ee1c97c6bfef41829
469
shared_examples "parseable arguments" do subject(:method_name) do |example| example.metadata[:example_group][:parent_example_group][:description] .gsub(/^Homebrew\./, "") end let(:command_name) do method_name.gsub(/_args$/, "").tr("_", "-") end it "can parse arguments" do require "dev...
26.055556
75
0.660981
ed8eba8fc2ddffea4a5552d88fe502032cb7a3bf
405
# frozen_string_literal: true module CacheDeleteMatchedBehavior def test_delete_matched @cache.write("foo", "bar") @cache.write("fu", "baz") @cache.write("foo/bar", "baz") @cache.write("fu/baz", "bar") @cache.delete_matched(/oo/) assert_not @cache.exist?("foo") assert @cache.exist?("fu") ...
25.3125
39
0.646914
913d33f72778fc77986d064e4eb8f16621e70dc0
875
Gem::Specification.new do |gem| gem.name = "actionpack-page_caching" gem.version = "1.2.4" gem.author = "David Heinemeier Hansson" gem.email = "david@loudthinking.com" gem.description = "Static page caching for Action Pack (removed from core in Rails 4.0)" gem.summary =...
39.772727
92
0.64
b9dbbaa5e96bfd6caf32c17f1c103b70ec1002f0
3,217
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this f...
30.932692
82
0.591545
ace5b38697c39a70a8b994146f1cc906ab6955e0
262
class CreateScopes < ActiveRecord::Migration def self.up create_table :connect_scopes do |t| t.string :name t.timestamps end add_index :connect_scopes, :name, unique: true end def self.down drop_table :connect_scopes end end
18.714286
50
0.694656
d57770ff7edb356c9bb395252830d70c8567eb13
491
require 'just_go/errors/error' module JustGo # = NoLibertiesError # # A not players turn error with a message class NoLibertiesError < Error # New not players turn errors can be instantiated with # # @option [String] message # the message to display. # # ==== Example: # # Inst...
21.347826
58
0.657841
26a3d6f2dac8184706499bb8d8ba768ab3e08f21
937
require 'securerandom' class SessionsController < ApplicationController def home @routes = TrainRoute.all_in_order end def new @error = nil @user = User.new end def create if request.env['omniauth.auth'] != nil @user = User.find_by(name: request.env['omniauth....
26.027778
183
0.576307
accad6908928ea56c90a615f598a09248289bed4
291
class AddRequestedFunds < ActiveRecord::Migration def up add_column :camps, :requested_funds, :integer add_column :camps, :requested_funds_fallback, :integer end def down remove_column :camps, :requested_funds_fallback remove_column :camps, :requested_funds end end
24.25
58
0.762887
390e992d97690927f802dc00ac2e1c430894f951
5,882
# frozen_string_literal: true class Pry class Command class Hist < Pry::ClassCommand match 'hist' group 'Editing' description 'Show and replay Readline history.' banner <<-'BANNER' Usage: hist [--head|--tail] hist --all hist --head N ...
31.794595
82
0.562224
26b6a89775c69f2f90a019c3050154dcbe301755
868
require 'reel' require 'octarine' module Reel # Define Reel endpoints using a sinatra-like dsl (provided by octarine) module App def self.included(base) base.class_eval do include Octarine::App attr_accessor :server end end def initialize(host, port) super() @s...
25.529412
128
0.653226
1abedc0f6baed6fad0c858af1c4b2ec8246f6e10
2,570
class Libmodplug < Formula desc "Library from the Modplug-XMMS project" homepage "https://modplug-xmms.sourceforge.io/" url "https://downloads.sourceforge.net/modplug-xmms/libmodplug/0.8.9.0/libmodplug-0.8.9.0.tar.gz" sha256 "457ca5a6c179656d66c01505c0d95fafaead4329b9dbaa0f997d00a3508ad9de" bottle do cel...
33.815789
99
0.638521
1d2d74943024006769d161c815e213725ec64e54
841
class UsersController < ApplicationController prepend_before_action :current_user, only: :exhibit before_action :authenticate_user!, except: [:accept, :exhibit] respond_to :html, :xml def index user_session[:cart] = "Cart" respond_with(current_user) end def edit_form user_session['last_request...
26.28125
121
0.702735
e8ade84453c16b2b1ffe96149b57e106c7aefc36
1,104
require 'rmagick' require 'gifworthy/gifmaker' require 'gifworthy/gifworthy_error' require 'pry' class GifWorthy VALID_ARGUMENTS = {'-d' => 'delay'} def initialize(arguments) directory, output, options = sanatize_options(arguments) input = check_directory(directory) until input output ||= Time.now.st...
24.533333
135
0.682971
28aa36a5cb1e46a40f0b06cd908b5e0d9b317d97
7,490
require 'abstract_unit' require 'controller/fake_models' class CompiledTemplatesTest < Test::Unit::TestCase def setup @compiled_templates = ActionView::Base::CompiledTemplates @compiled_templates.instance_methods.each do |m| @compiled_templates.send(:remove_method, m) if m =~ /^_run_/ end end ...
36.715686
142
0.700267
037ccfebc7413fd1472152d45134009426561b91
14,972
require 'rex/text' require 'rex/proto/smb/constants' module Rex module Proto module SMB class Utils CONST = Rex::Proto::SMB::Constants # Creates an access mask for use with the CLIENT.open() call based on a string def self.open_mode_to_access(str) access = CONST::OPEN_ACCESS_READ | CONST::OPEN_SHARE_DENY_NONE ...
26.59325
108
0.59491
1d3fd03a53561f98adf93f5d39f465090a78e902
36
require_relative "../lib/portusctl"
18
35
0.777778
ffb3a92254321b542d1b70550267aaecb486f8f1
51
module Changelogify VERSION = '0.1.0'.freeze end
12.75
26
0.72549
61560660a8517591eb0744b1fe9f287cc0e3ee14
378
def init @modules = object.children.select {|o| o.type == :module } @classes = object.children.select {|o| o.type == :class } sections :child, [:info], :classes, [T('class')], :header, [T('module')], :dependencies end def dependencies return unless options[:dependencies] erb(:dependencies) end def classes ...
27
89
0.661376
38af47b0c96de81b351a6094e25ba0163526b6bc
4,301
# # Author:: Chirag Jog (<chirag@clogeny.com>) # Copyright:: Copyright (c) 2013 Opscode, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # h...
36.449153
179
0.71495
6138f9fe8953bbd3da54fd942c99be3c87935b35
79
require "sportmonks/version" module Sportmonks # Your code goes here... end
13.166667
28
0.746835
bbd1e7d7fd6c59af51ac97729b2cdae77c5f3ec6
1,451
#!/usr/bin/env ruby # # Created by William Groppe on 2007-02-01. # # Simple file based Model. Basically just serves a directory of xml files to the # Provider. # class File def id File.basename(self.path) end def to_oai_dc self.read end end class FileModel < OAI::Provider::Model include OAI::...
23.031746
90
0.640248
91e2d58a13652a7f1fad3e9e0dfad4d95ba3db35
5,536
require 'actions/services/service_key_delete' require 'actions/services/route_binding_delete' require 'actions/services/locks/deleter_lock' require 'actions/service_instance_unshare' module VCAP::CloudController class ServiceInstanceDelete def initialize(accepts_incomplete: false, event_repository:) @accep...
32.757396
166
0.715679
1a34c897efe6b136a3d1536fa7f5cc3dc76e1538
2,019
require 'db_spec_helper' module Bosh::Director describe 'set_instances_with_nil_serial_to_false' do let(:db) { DBSpecHelper.db } let(:migration_file) { '20160329201256_set_instances_with_nil_serial_to_false.rb' } before { DBSpecHelper.migrate_all_before(migration_file) } it 'updates instances\'s up...
30.134328
94
0.546805
f7ecdb3570f9c9f0a08920edae741262f7d89fd1
160
class BlogController < ApplicationController def blog end def blog_article_view end def blog_articles end def blog_post end end
11.428571
45
0.6875
6ab4bbdd6b79cfa0dbfefdc20ca7941514a75b2c
494
cask :v1 => 'shotcut' do version '15.07.02' sha256 'a5176318299e88e325cbece37403e3d3f4057808f2861962137f4e6d0de11705' # github.com is the official download host per the vendor homepage url "https://github.com/mltframework/shotcut/releases/download/v#{version.sub(/\.\d+$/, '')}/shotcut-osx-x86_64-#{version.dele...
35.285714
141
0.732794
e8e73c92a5098127d05a7dd54e33f06c88758af6
455
namespace :database do desc "Upload rails database.yml configuration file to web server" task :config do on roles(:web) do config_file = File.expand_path("../templates/database.yml.erb", __dir__) config = ERB.new(File.read(config_file)).result(binding) upload! StringIO.new(config), "/tmp/datab...
32.5
80
0.685714
28f21564d38baf620424048ea9fd51c06a65878d
3,064
module Specjour require 'specjour/rspec' require 'specjour/cucumber' class Worker include Protocol include SocketHelper attr_accessor :printer_uri attr_reader :project_path, :number, :preload_spec, :preload_feature, :task def initialize(options = {}) ARGV.replace [] $stdout = Str...
24.910569
123
0.644909
216aeb73704e5d7f00458c1cf3de1962decfff41
1,769
# # Cookbook:: smokeping # Recipe:: master # # Copyright:: 2014-2016, Bao Nguyen # # 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 ...
28.532258
75
0.693612
62854312174635ba7e5e8f695044011bffdba7bc
848
module Fog module Compute class Google class Mock def list_region_operations(_region) Fog::Mock.not_implemented end end class Real # Retrieves a list of Operation resources contained within the specified region # @see https://developers.google.com/compu...
30.285714
96
0.584906
e84d193be7acd2b676a78fad0f59aaf1581b2d2e
3,298
# Author Anil # Task to remove unused images namespace :asset_sweeper do task :remove_unused_images => :environment do require "fileutils" img=Dir.glob("**/app/assets/images/**/*.jpg")+Dir.glob("**/app/assets/images/**/*.png")+Dir.glob("**/app/assets/images/**/*.gif") data=Dir.glob("**/*.htm*")+Dir.glob("...
38.348837
264
0.527289
5dc700479e56f68cb0fcd0d7b655bfce5f011bba
2,630
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web serv...
34.155844
85
0.747529
392457fe053682c5db6ec78e2ada154ac51c8f91
189
class EtherClient::Model::PoolNetwork< EtherClient::Model def initialize(data) attrs data end def self.all(datas) datas.map do |data| self.new(data) end end end
14.538462
57
0.666667
1dbf4808fd4b34a17c30c757717325403460f5d1
19,598
# frozen_string_literal: true require "active_support/core_ext/string/filters" module ActiveRecord module FinderMethods ONE_AS_ONE = "1 AS one" # Find by id - This can either be a specific id (1), a list of ids (1, 5, 6), or an array of ids ([5, 6, 10]). # If one or more records cannot be found for the...
35.503623
164
0.633738
1c1ebe59b36de90075986c266cfd624aa41fc415
2,821
class Manticoresearch < Formula desc "Open source text search engine" homepage "https://www.manticoresearch.com" url "https://repo.manticoresearch.com/repository/manticoresearch_source/release/manticore-3.6.0-210504-96d61d8-release-source.tar.gz" version "3.6.0" sha256 "320a19c837caf827a75e19e11755a9586487435...
30.333333
135
0.655087
6aae7e8684d25a15cf095bf6896cf98ea22836e2
948
module DropletKit class KubernetesClusterMapping include Kartograph::DSL kartograph do mapping KubernetesCluster root_key plural: 'kubernetes_clusters', singular: 'kubernetes_cluster', scopes: [:read] property :id, scopes: [:read] property :name, scopes: [:read, :update, :create] ...
37.92
93
0.656118
3970f26d254f13f1007d682acef645463c8186d9
4,789
# frozen_string_literal: true module API class AlertManagementAlerts < ::API::Base feature_category :incident_management params do requires :id, type: String, desc: 'The ID of a project' requires :alert_iid, type: Integer, desc: 'The IID of the Alert' end resource :projects, requirement...
35.474074
123
0.648361
bbf966e21e208f52ba7a921b7c76dfcc2cc821d5
894
require 'chefspec' describe 'file::create' do platform 'ubuntu' describe 'creates a file with the default action' do it { is_expected.to create_file('/tmp/default_action') } it { is_expected.to_not create_file('/tmp/not_default_action') } end describe 'creates a file with an explicit action' do i...
24.162162
69
0.649888
e93dbde0e7d45acdb7d74d3b052bb3ad596b0b93
1,007
## # This file is part of WhatWeb and may be subject to # redistribution and commercial restrictions. Please see the WhatWeb # web site for more information on licensing and terms of use. # http://www.morningstarsecurity.com/research/whatweb ## # Version 0.2 # 2016-04-19 # Andrew Horton # Moved patterns from passive fu...
29.617647
199
0.722939
1d1c596f55b75c2aecdc98954e68f46963ccc9cb
158
Tumugi.configure do |config| config.max_retry = 3 config.retry_interval = 1 config.section('example') do |section| section.key = 'value' end end
17.555556
40
0.696203
5d0b87621198f24e40563692e08a174269c07323
141
# frozen_string_literal: true RSpec.describe DevOops do it 'has a version number' do expect(DevOops::VERSION).not_to be nil end end
17.625
42
0.744681
f8ab6660eb901e8cf5bfcefe04094e87ce774cf8
3,008
## # $Id$ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' class Metasploit4 < Msf::Auxi...
24.655738
105
0.625
18c3559eb0a49c69fbc5ae0049fbb879e410b7bf
601
require 'test_helper' class UsersProfileTest < ActionDispatch::IntegrationTest include ApplicationHelper def setup @user = users(:michael) end test "profile display" do get user_path(@user) assert_template 'users/show' assert_select 'title', full_title(@user.name) assert_select 'h1', text...
25.041667
59
0.728785
2185238a80d5efd73509cd66a52b052da5e9b4e3
8,565
=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 # This action is used to rewrite header fields of HTTP response me...
33.457031
478
0.652306
bb3dda8ec4e47b13936def46fdaf924ca63bc69e
239
require 'elasticsearch/rails/instrumentation' config = Rails.application.config_for(:elasticsearch) Elasticsearch::Model.client = Elasticsearch::Client.new host: config['host'] Elasticsearch::Model.settings[:inheritance_enabled] = false
34.142857
76
0.8159
bb9a67bc31b31954fa6c8d7285185718641f60c6
1,290
lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "voom/message_bus/version" Gem::Specification.new do |spec| spec.name = "voom-message_bus" spec.version = Voom::MessageBus::VERSION spec.authors = ["Russell Edens"] spec.email ...
39.090909
91
0.675194
ed6e046dc36a28eda390e33c2d18f190bc47366c
4,139
module GdsApi module TestHelpers module AssetManager ASSET_MANAGER_ENDPOINT = Plek.current.find("asset-manager") def stub_any_asset_manager_call stub_request(:any, %r{\A#{ASSET_MANAGER_ENDPOINT}}).to_return(status: 200) end def stub_asset_manager_isnt_available stub_reque...
37.972477
123
0.655956
6a980ea05a54ed93a68e9b7045a618fa2e6092bc
88
class Provenance::GovernanceParamsDecorator < Cosmoslike::GovernanceParamsDecorator end
29.333333
83
0.886364