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
61f94d9754ca709a1f9a4884732af8f20a05b2d9
1,486
module Dom module Editor class PublishEntryPanel < Domino selector 'div.publish_entry' attribute :exhausted_message, '.exhausted_message' def save_button node.find('button.save') end def publish activate_publish_forever save_button.click wait_for_sa...
23.21875
81
0.639973
4a96d254f8758eda881e09bd74b373b32a642d52
2,752
class Qemu < Formula desc "x86 and PowerPC Emulator" homepage "https://www.qemu.org/" url "https://download.qemu.org/qemu-3.1.0.tar.xz" sha256 "6a0508df079a0a33c2487ca936a56c12122f105b8a96a44374704bef6c69abfc" revision 1 head "https://git.qemu.org/git/qemu.git" bottle do rebuild 1 sha256 "dd7cb5e...
32
93
0.687863
b9e3cb181b49d077171b49cae02cfec4d0583532
2,854
# frozen_string_literal: true module Files class UsageSnapshot attr_reader :options, :attributes def initialize(attributes = {}, options = {}) @attributes = attributes || {} @options = options || {} end # int64 - Site usage ID def id @attributes[:id] end # date-time -...
28.828283
204
0.677996
f8b181ccdcc94ac2f0a40f62c80e9db78b229975
2,622
class CloneTradeTariffAdmin < ActiveRecord::Migration[5.2] class SupportedPermission < ApplicationRecord belongs_to :application, class_name: "Doorkeeper::Application" end def up ActiveRecord::Base.transaction do existing_trade_tariff_admin = ::Doorkeeper::Application.find_by(name: "Trade Tariff Ad...
49.471698
159
0.750953
035aee2aa66190e0dfc3e4925bb58e0e4fbd58f3
14,428
# frozen_string_literal: true require "thread" require "delegate" module ActionView # = Action View Template class Template extend ActiveSupport::Autoload def self.finalize_compiled_template_methods ActiveSupport::Deprecation.warn "ActionView::Template.finalize_compiled_template_methods is deprecat...
36.994872
128
0.656986
f7e21ff7d2aef494b7f2f265fc51b0f639806cd6
1,006
# -*- encoding: utf-8 -*- # stub: molinillo 0.8.0 ruby lib Gem::Specification.new do |s| s.name = "molinillo".freeze s.version = "0.8.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Samuel E. Gid...
32.451613
112
0.696819
bbc639d402ede2e03625214d22edb3ba28344749
3,153
require 'test_helper' class SearchProfileControllerTest < ActionDispatch::IntegrationTest test "should get search" do assert true end def test_general_infos_search perl_search=GeneralInfo.search :first_name =>general_infos(:perl_cb) perl_search1=GeneralInfo.search :first_name =>general_infos(:perl_c...
28.663636
74
0.7745
f7a82521cfb1d3718d29f294c52d6447e17e075a
5,396
module Agents class GoogleFlightsAgent < Agent include FormConfigurable cannot_receive_events! default_schedule "every_12h" description <<-MD The GoogleFlightsAgent will tell you the minimum airline prices between a pair of cities. The api limit is 50 requests/day. Follow their documen...
44.229508
636
0.661045
f8b734a5b541e0cd4bc0c3da2abbf25a453ce1bf
2,057
require "rexml/child" require "rexml/source" module REXML # Represents an XML Instruction; IE, <? ... ?> # TODO: Add parent arg (3rd arg) to constructor class Instruction < Child START = '<\?' STOP = '\?>' # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?> # content is every...
28.971831
75
0.625182
0835ce82e5e8cb0adccff4f89876d41a0e7def20
14,855
RSpec.describe CardanoWallet::Shelley do describe CardanoWallet::Shelley::Wallets do after(:each) do teardown end it "I can list wallets" do l = SHELLEY.wallets.list expect(l).to be_correct_and_respond 200 expect(l.size).to eq 0 create_shelley_wallet l = SHELLEY.wal...
34.546512
178
0.612858
5d3cf7b39afd8ef9cd26988a69d67c1b9d5db95b
1,781
module CatchNotes module CRUDMethods module ClassMethods private def build_from_hash(hash) send :new, hash end end def self.included(klass) #:nodoc: klass.extend ClassMethods end def initialize(attributes) @attr = self.class.send :stringify_keys...
21.719512
78
0.54183
f7e20492270fc7a0a2b8c38b95b61091948782ca
192
module AhaApi class Resource module Users def user(user_id, options={}) get("api/#{api_version}/users/#{CGI.escape(user_id)}", options) end end end end
16
71
0.59375
ed02666489d31c1fb4ae564dec246a03822d696f
283
class CreateLocations < ActiveRecord::Migration[5.1] def change create_table :locations do |t| t.integer :user_id t.string :category t.string :description t.string :name t.string :city t.string :country t.timestamps end end end
18.866667
52
0.636042
7949e46c028bfc7840b96f432fbee8bbef680b2b
24
require "paxful_engine"
12
23
0.833333
2669921aa388522525812138bf22d9145fb13b6e
368
lines = File.read('input.txt').split("\n").map {|x| x.split(' ')} horizontal = 0 depth = 0 aim = 0 lines.each do |command, argument| case command when 'forward' horizontal += argument.to_i depth += aim * argument.to_i when 'down' aim += argument.to_i when 'up' aim -= argument.to_i else puts 'wha...
18.4
65
0.641304
1dec81e3f341cd2f95f0be988b99f54f67b350ff
1,595
# # Be sure to run `pod lib lint AppBaseKit.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 = 'AppBaseK...
37.093023
106
0.640752
79ffd795a1ba9b339ee833e375e64830ede2bd42
5,726
class ForumPost < ApplicationRecord attr_readonly :topic_id belongs_to :creator, class_name: "User" belongs_to_updater belongs_to :topic, class_name: "ForumTopic", inverse_of: :forum_posts has_many :dtext_links, as: :model, dependent: :destroy has_many :moderation_reports, as: :model has_many :votes, clas...
31.811111
236
0.716032
87cd154190229d8b52309875248643ea43d84f37
1,959
### # Do not use this file to override the opsworks_nodejs cookbook's default # attributes. Instead, please use the customize.rb attributes file, # which will keep your adjustments separate from the AWS OpsWorks # codebase and make it easier to upgrade. # # However, you should not edit customize.rb directly. Instead, ...
51.552632
166
0.752935
08c59c60e71457bf1835a0c1234f4630cde3e165
3,637
# frozen_string_literal: true module ShopifyTransporter module Exporters module Magento class ProductOptions def initialize(database_table_exporter, database_cache) @database_table_exporter = database_table_exporter @database_cache = database_cache export_required_tab...
36.737374
112
0.667583
e9b2a4c5bfd0d407e58904dfa73956a434c64027
525
require 'rails_helper' describe "asset_events/_maintenance_update_event_form.html.haml", :type => :view do it 'fields' do assign(:asset, Asset.get_typed_asset(create(:buslike_asset))) assign(:asset_event, MaintenanceUpdateEvent.new) render expect(rendered).to have_field('asset_event_maintenance_t...
32.8125
83
0.771429
33f4aece1d47d6b8d1a66832a1e0a658634f62b7
126
require 'test_helper' class LeagueSeasonTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
15.75
48
0.714286
6abf0e719be43afc1d0c6e8621113c5504f635db
2,960
module DockerCookbook module DockerHelpers module Base require 'shellwords' ########## # coersion ########## def coerce_labels(v) case v when Hash, nil v else Array(v).each_with_object({}) do |label, h| parts = label.split(':'...
26.909091
83
0.499662
e8c775d8cd0acfadaa323a3179ac99539b9e29a7
1,226
require 'test_helper' class PeopleControllerTest < ActionDispatch::IntegrationTest setup do @person = people(:one) end test "should get index" do get people_url assert_response :success end test "should get new" do get new_person_url assert_response :success end test "should create...
25.020408
175
0.721044
11288c123016e4fe20075347337a02a0e02aeb0c
1,817
# -*- encoding : utf-8 -*- class StatisticsBackToStateMachine < ActiveRecord::Migration def up execute <<-SQL CREATE OR REPLACE VIEW statistics AS SELECT (SELECT count(*) FROM users WHERE primary_user_id IS NULL) AS total_users, total_backs, total_backers, tota...
37.081633
282
0.651624
accc430a1d9162ba6e7cf667ac99caf9013b230a
986
# # Cookbook Name:: dynect # Recipe:: a_record # # Copyright:: 2010, Opscode, Inc <legal@opscode.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
30.8125
74
0.719067
bbdf8555b1fa408c4fb052babfe2227d0033609a
1,817
# This migration comes from solidus_i18n (originally 20150609154031) class RemoveTranslationsFromSpreeTables < ActiveRecord::Migration def up # Don't migrate if we still use Globalize, i.e. through spree_globalize Gem return if defined?(Globalize) %w( OptionType OptionValue ProductPrope...
27.119403
113
0.666483
e270b25920362f727cad90f883a1030d462eb882
1,239
require 'aws-sdk-s3' module ContentCaching module Adapter class Aws T_1_DAY = 86400.freeze attr_reader :options def initialize options @options = options end def store document_path, content, type ::Retryable.retryable(tries: 3) do if type === :html ...
22.944444
90
0.592413
f8b845fee92869f667b214963ff33e98d24713c9
225
class NamespaceProductAssemblyForSpreeOne < ActiveRecord::Migration def up rename_table :assemblies_parts, :spree_assemblies_parts end def down rename_table :spree_assemblies_parts, :assemblies_parts end end
22.5
67
0.808889
61a94b7edcb9b0fd64ea5b234a2fb02a11467704
874
# frozen_string_literal: true class Message < ApplicationRecord validates :text, presence: true belongs_to :sender, class_name: 'User', inverse_of: :sent_messages belongs_to :recipient, class_name: 'User', inverse_of: :received_messages scope :received_by, ->(user) { where(recipient: user).where.not(recipien...
23.621622
90
0.724256
1a8a2bbf8eae5e6be618625828ba76a6f74bbe88
2,585
require 'rubygems' class Debunker module Rubygem class << self def installed?(name) if Gem::Specification.respond_to?(:find_all_by_name) Gem::Specification.find_all_by_name(name).any? else Gem.source_index.find_name(name).first end end # Get the gem...
30.411765
90
0.560542
4a1158c7a618026b12b25fa6f8bd613ff17d2aa8
2,007
# frozen_string_literal: true # Copyright 2021 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 applicabl...
37.166667
86
0.655207
ff35794a3fb9dd5ad884652908937d21e3aeffcb
5,099
require 'rails_helper' describe PublifyTime do describe 'delta' do it 'returns nil when nil year, nil month and nil day' do expect(PublifyTime.delta).to be_nil end it 'returns year when year given' do start_at = Time.zone.local(2009, 1, 1, 0, 0, 0) end_at = start_at.end_of_year ...
30.35119
82
0.622279
f761340d7c5faf943ebf1cda532ff5de0539893f
1,129
class Clojurescript < Formula desc "Clojure to JS compiler" homepage "https://github.com/clojure/clojurescript" url "https://github.com/clojure/clojurescript/releases/download/r1.10.896/cljs.jar" sha256 "72f1470c97eac06cf1fb5c3da966527643ffb440f2900441e79351cd46752443" license "EPL-1.0" head "https://github...
26.255814
112
0.689991
0300c3dd48f717d8ae71f0eda7a8c9f35bfa8e7a
92,444
# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE require 'seahorse/client/plugins/content_length.rb' require 'aws-sdk-core/plugins/credentials_configuration.rb' ...
45.946322
466
0.662325
b97c471625fb43956d24eccb409f0aa437ffabfd
168
class CreatePosts < ActiveRecord::Migration create_table :posts do |p| p.text :post_content p.belongs_to :group p.belongs_to :user p.timestamps end end
18.666667
43
0.72619
014f2c432ed228c0400a61beee9c5b75384be5e6
472
require_relative "../lib/enigma/decrypt_file" module Enigma describe "Decrypt file" do it "should Decrypt a file" do file_decrypt = Enigma::File_Decryptor.new encrypted_text = file_decrypt.decrypt_file("encrypt_test", "sample.txt", "93633", "090915") expect(File.exist?("sample.txt")).to be t...
27.764706
97
0.686441
335ce745efa544e46364830730e27fc40498dc32
401
class Dish < ApplicationRecord has_many :menu_dishes has_many :menus, through: :menu_dishes has_many :restaurants, through: :menus has_many :orders has_many :users, through: :orders has_many :favorites # name: {type: Sequelize.STRING, # allowNull: false}, # description: Sequelize.TEXT,...
28.642857
47
0.708229
18f9c412ffacab786fab51a6615e7104d5e4a495
6,503
require 'test_helper' require 'ostruct' class MockController < ApplicationController attr_accessor :env def request self end def path '' end def index end def host_with_port "test.host:3000" end def protocol "http" end def script_name "" end def symbolized_path_pa...
31.721951
97
0.727049
62d2b1acee555d721b81f61657bc7ac5f4b522d7
545
# Setup integration system for the integration suite Dir.chdir "#{File.dirname(__FILE__)}/integration/app/" do `ps awx`.split("\n").grep(/4304[1-3]/).map do |process| system("kill -9 #{process.to_i}") end LOG = "/tmp/memcached.log" system "memcached -vv -p 43042 >> #{LOG} 2>&1 &" system "memcached...
23.695652
58
0.620183
e9759d6abed714e5f7e515f519f31d8b332e28e8
136
class AddEntryCompanyDateToUser < ActiveRecord::Migration[6.1] def change add_column :users, :entry_company_date, :date end end
22.666667
62
0.772059
083456b40b3b67633209ff4a281333dc89130ad4
654
class User < ApplicationRecord has_many :created_products, foreign_key: "user_id", class_name: "Product" has_many :products has_many :buildings, through: :products has_secure_password #created from user table / column password_digest. Password_digest avoids passwords from being stolen by encrypting before stor...
36.333333
168
0.730887
398b7ae9de1823f66db294870e49088830b4b3d6
3,227
require 'optparse' require 'ostruct' require 'pp' require 'extension' require 'logger' require 'helper' include Helper def sec2hm(secs) time = secs.round time /= 60 mins = time % 60 time /= 60 hrs = time [ hrs, mins ] end def say_in_telegram(username, match, url, timeleft) hour, min = sec2hm(timeleft) ...
27.818966
119
0.639913
79d29fa50dfaa9d6d45b11d5364306d68ecded1c
132
module LambdaMoo class NullStatement # Does nothing def execute(runtime = nil) StatementResult.ok end end end
14.666667
30
0.681818
1dd25e4e83968bad94d05e37a554ff071f6ff0a0
207
class Ccc::SpPageElement < ActiveRecord::Base belongs_to :sp_pages, class_name: 'Ccc::SpPage', foreign_key: :page_id belongs_to :sp_elements, class_name: 'Ccc::SpElement', foreign_key: :element_id end
29.571429
81
0.768116
08ab30b74a7001d84ba869a0eab450b1d935fd63
245
PAIR_DELIMITER = ";" KEY_VALUE_DELIMITER = "|" def parse_sites sites_str = ENV.fetch('SITES') pairs = sites_str.split(PAIR_DELIMITER) pairs.map do |pair| from, to = pair.split KEY_VALUE_DELIMITER { from: from, to: to } end end
18.846154
45
0.685714
1d710cc3d81708ffe4b44b2af86a85da5e2b5bb3
120
class RemoveIdFromUnreadEntries < ActiveRecord::Migration def change remove_column :unread_entries, :id end end
20
57
0.791667
181736904ac52b8ed83468bcb70f2df9306ee840
1,589
# This class handels SQLite3-specific behaviour. class Baza::Driver::Sqlite3Java < Baza::JdbcDriver AutoAutoloader.autoload_sub_classes(self, __FILE__) attr_reader :mutex_statement_reader # Helper to enable automatic registering of database using Baza::Db.from_object def self.from_object(args) if args[:ob...
23.367647
168
0.648206
1a70bc930524c62fda39e98bd5a3028914ff9b74
2,003
###################################################################### # Copyright (c) 2008-2016, Alliance for Sustainable Energy. # All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the ...
29.028986
81
0.683974
accffe6756d94a1994e95a198db367b8811c0e6b
3,101
#!/usr/bin/env ruby #-- # Portions copyright 2004 by Jim Weirich (jim@weirichhouse.org). # Portions copyright 2005 by Sam Ruby (rubys@intertwingly.net). # All rights reserved. # Permission is granted for use, copying, modification, distribution, # and distribution of modified versions of this work as long as the # ab...
24.611111
98
0.622702
e8012dcd8fa2956e5954ed68115e0bffb9a043f3
1,658
# encoding: utf-8 require 'spec_helper' describe Equatable, '#==' do let(:name) { 'Value' } let(:value) { 11 } let(:super_klass) { ::Class.new do include Equatable attr_reader :value def initialize(value) @value = value end end } let(:klass) { Class.new(super_klas...
19.505882
62
0.618818
ac591cb2c35a6c8560f360065c70cfd603555e16
669
# frozen_string_literal: true require_dependency "renalware" module Renalware # Helper methods to mix in to a Presenter class when displaying objects which include # the Accountable module - ie they have updated_by/at properties. module AccountablePresentation extend ActiveSupport::Concern def effectiv...
19.676471
87
0.730942
ab403502b7726010e488f8e9acfd5bceacf730c9
272
root = "#{Dir.getwd}" bind "unix://#{root}/tmp/puma/socket" pidfile "#{root}/tmp/puma/pid" state_path "#{root}/tmp/puma/state" rackup "#{root}/config/config.ru" threads 4, 8 #stdout_redirect "#{root}/log/stdout.log", "#{root}/log/stderr.log", true activate_control_app
22.666667
73
0.691176
7974e424d5edd3c7795955469449a30541ef38c3
148
require 'spec_helper' describe 'filebeat' do context 'with defaults for all parameters' do it { should contain_class('filebeat') } end end
18.5
47
0.72973
ffc27dfb8826b31f3b1a7aef9a9f7aa743bc730a
877
# frozen_string_literal: true module DevOops module Commands class EditScriptSh < Thor::Group include Thor::Actions def self.source_root "#{File.dirname(__FILE__)}/../../../" end argument :script_name class_option :global, desc: 'force the script to be gl...
24.361111
57
0.54732
1a838d6c7c3c20942e1ab489661ba57426737560
7,076
# -*- encoding: binary -*- require_relative '../../../spec_helper' require_relative '../fixtures/classes' require_relative 'shared/basic' require_relative 'shared/taint' describe "String#unpack with format 'B'" do it_behaves_like :string_unpack_basic, 'B' it_behaves_like :string_unpack_no_platform, 'B' it_behave...
36.474227
106
0.518089
1da82ef8418b354200b46e0ac794db4fc5216ed9
178
require 'test_helper' class VotesControllerTest < ActionDispatch::IntegrationTest test "should get create" do get votes_create_url assert_response :success end end
17.8
59
0.780899
3938da03daeba8ca7581ea8ac98fbdfaf7514ced
12,924
require_relative "helper" class TestConnectionPool < Minitest::Test class NetworkConnection SLEEP_TIME = 0.1 def initialize @x = 0 end def do_something(*_args, increment: 1) @x += increment sleep SLEEP_TIME @x end def do_something_with_positional_hash(options) ...
22.753521
111
0.655215
036943eda8249a8d2123123f67a10fcc36bac14e
40
module SmartSMS VERSION = '0.1.1' end
10
19
0.675
b9e0ebfe30d34428ca9c63b733bf7223cc11bc3f
1,343
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'piculet/version' Gem::Specification.new do |spec| spec.name = "piculet" spec.version = Piculet::VERSION spec.authors = ["winebarrel"] spec.email = ["sgwr_dts@...
41.96875
175
0.664929
626867d20e7ca95b05aa5c2251363dc7b8f0d637
437
# frozen_string_literal: true module JekyllAssetPipeline # Allows classes that extend this to return an array of their subclasses module SubclassTracking # Record subclasses of this class (this method is automatically called by # ruby) def inherited(base) subclasses << base end # Return ...
24.277778
77
0.71167
0352fefc6035e8309c58a3b9ab1365d979a0a2aa
342
cask "hostsx" do version "2.8.1" sha256 "acf2f6b909215ec2b822a2c88bc7a19b4f0f231b86d0184883f481de8b535bd6" url "https://github.com/ZzzM/HostsX/releases/download/#{version}/HostsX.dmg" name "HostsX" desc "Local hosts update tool" homepage "https://github.com/ZzzM/HostsX" depends_on macos: ">= :sierra" ...
24.428571
78
0.739766
f70b656aa697c70c3874bd55ca79d783a1ef26ce
1,251
# # Cookbook:: nexus_repository_manager # Copyright:: Copyright (c) 2017-present Sonatype, Inc. Apache License, Version 2.0. default['java']['jdk_version'] = '8' default['java']['install_flavor'] = 'openjdk' default['java']['accept_license_agreement'] = true # nexus configuration default['nexus_repository_manager'][...
52.125
164
0.768985
f71aacb819c5a72b701537d69984520d9ece5678
1,058
cask "netnewswire" do version "5.1.3" sha256 "5f08f9ee986621d146c57f3ab3e98297944af368ce7ff1382a8e3a6c31fab5ea" url "https://github.com/brentsimmons/NetNewsWire/releases/download/mac-#{version}/NetNewsWire#{version}.zip", verified: "github.com/brentsimmons/NetNewsWire/" name "NetNewsWire" desc "Free an...
39.185185
111
0.76087
b98ba386d2afe3affbb61a39b174a877f2eb0663
848
# -*- encoding: utf-8 -*- require File.expand_path('../lib/dm-migrations/version', __FILE__) Gem::Specification.new do |gem| gem.name = 'ardm-migrations' gem.version = DataMapper::Migrations::VERSION gem.authors = ["Martin Emde", "Paul Sadauskas"] gem.email = ['me@martinemde.com', 'psadauskas [a] gmail ...
30.285714
67
0.665094
e9c40c5eaf57665cfd3042a0685e9e3cd6baf758
14,946
# encoding: utf-8 include ActionView::Helpers::SanitizeHelper include ApplicationHelper RSpec.describe Note do before(:example) do ENV['versions'] = 'true' ENV['version_gap_distance'] = '10' ENV['version_gap_minutes'] = '60' end let(:note) { FactoryGirl.create(:note, external_updated_at: 200.minutes...
32.993377
207
0.651278
185b4731706cbcebb59c67a02c56feb62c5d410b
1,213
# # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may n...
29.585366
74
0.731245
7a8bfbbe7a06ef00f2d3c7f216e460e010f2d17b
151
# frozen_string_literal: true String.class_eval do def calc_sum return to_i unless include? ',' split(',').map(&:to_i).reduce :+ end end
15.1
36
0.668874
5dc4659efe30fd3459facfa07e914be0f065d41a
352
# == Schema Information # # Table name: student_course_registrations # # id :bigint(8) not null, primary key # course_id :bigint(8) not null # student_id :bigint(8) not null # team :text # FactoryBot.define do factory :student_course_registration do association :student ...
20.705882
53
0.653409
7a4f5694baa3c4b840f52c8e7efefa714ceb2cec
824
require 'chefspec' describe 'locking_resource::default' do let :chef_run do ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '14.04', cookbook_path: File.join(File.expand_path(Dir.pwd), 'berks-cookbooks')) end it 'should...
35.826087
80
0.65534
38ac83b3432c275a921eb33c09b6e8f66dcc1fda
876
# frozen_string_literal: true # 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:...
32.444444
111
0.699772
3931f74171e21e0df45312f88894109335936256
686
# frozen_string_literal: true require 'rails_helper' require_relative '../shared/json_serialization' RSpec.describe Curator::ControlledTerms::AuthoritySerializer, type: :serializers do let!(:authority_count) { 3 } let!(:record) { create(:curator_controlled_terms_authority) } let!(:record_collection) { create_li...
28.583333
96
0.699708
0140557a3da25bf4bdf9e1b1a6a20be2b1d66ca9
1,101
class OpenidConnectJavaSpringServer < Formula desc "OpenID Connect server implementation" homepage "https://github.com/mitreid-connect/" url "https://github.com/mitreid-connect/OpenID-Connect-Java-Spring-Server/archive/mitreid-connect-1.2.5.tar.gz" version "1.2.5" sha256 "ad8315921a563d838cfada3dab9848f0ff73d...
37.965517
113
0.711172
62b5b84cff0fead0be82384f0c973c058c59f6bf
1,382
class TweetsController < ApplicationController get '/tweets' do if logged_in? @user = current_user @tweets = Tweet.all erb :'/tweets/tweets' else redirect to "/login" end end get '/tweets/new' do if logged_in? erb :'/tweets/new' else redirect to "/login" end en...
19.464789
52
0.604197
acc6dc2f8ce6038d8e848a64e8b2434add3364a2
994
=begin #Tatum API ## Authentication <!-- ReDoc-Inject: <security-definitions> --> OpenAPI spec version: 3.9.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 3.0.31 =end require 'spec_helper' require 'json' require 'date' # Unit tests for Tatum::InlineResponse20076 # Auto...
24.243902
102
0.736419
6acca7f38cf021bbb778a030e8888ebbb7cad621
5,107
# # Be sure to run `pod spec lint SLHCategories.podspec' to ensure this is a # valid spec and to remove all comments including this before submitting the spec. # # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html # To see working Podspecs in the CocoaPods repo see https://gith...
37.551471
103
0.598786
abbffcd48f216897504b2407ccda48aa33ebf03c
75
# frozen_string_literal: true module Dependabot VERSION = "0.117.0" end
12.5
29
0.746667
e2527228d7d6b1c7ec15bd76681b3c2d0af35375
28
module GraveyardsHelper end
9.333333
23
0.892857
91b92adff45451e044c9d4d30e2869a8db8ef22d
2,449
if defined?(Rails) and Rails.version.match(/^2.+$/) APIRUNNER_ROOT = File.dirname(__FILE__).to_s + "/../../" TEST_EXAMPLES_PATH = APIRUNNER_ROOT + "examples/test/api_runner" CONFIG_EXAMPLE_PATH = APIRUNNER_ROOT + "examples/config" end begin config = YAML.load_file("#{Rails.root}/config/api_runner.yml") rescue ...
40.816667
123
0.672111
799ef671a254712f3f8f64f698f3d63ad078522b
5,919
require 'rails_helper' describe SimilarityMachine::QuestionsCalculator do before do @question = create(:question) @team = create(:team) end describe '#questions_similarity' do context "when questions aren't informed" do subject { described_class.new( user_1: create(:user), ...
29.893939
88
0.554655
ff46bcf8b09e37dec1481c5462bc75915eea99ca
386
cask 'font-noto-sans-cypriot' do version :latest sha256 :no_check # noto-website-2.storage.googleapis.com/ was verified as official when first introduced to the cask url 'https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCypriot-unhinted.zip' name 'Noto Sans Cypriot' homepage 'https://www.google.c...
32.166667
101
0.761658
edcbcdb39f7cb610c493cc78946fea68bc440510
638
require "metanorma" require "metanorma-generic" require "metanorma/iho/processor" module Metanorma module IHO class Configuration < Metanorma::Generic::Configuration def initialize(*args) super end end class << self extend Forwardable attr_accessor :configuration ...
19.333333
64
0.680251
0301ff7769e0296c40a42fa473f08e721dc67165
399
class CreateCollections < ActiveRecord::Migration[5.1] def change create_table :collections do |t| t.uuid :uuid, null: false, default: 'uuid_generate_v4()' t.string :name t.jsonb :metadata, null: false, default: '{}' t.index :metadata, using: :gin t.integer :import_type, default: 0, ...
28.5
62
0.651629
03d0512bbb529ffd77bb192f9c67f5a1636f9d95
342
# frozen_string_literal: true module Quails module Generators class HelperGenerator < NamedBase # :nodoc: check_class_collision suffix: "Helper" def create_helper_files template "helper.rb", File.join("app/helpers", class_path, "#{file_name}_helper.rb") end hook_for :test_framew...
21.375
92
0.695906
397d77fce6f1409df2207241b9581ebce01e7766
1,117
# Be sure to restart your server when you modify this file. # Define an application-wide content security policy # For further information see the following documentation # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy # Rails.application.config.content_security_policy do |po...
42.961538
108
0.752014
5dd088a4623f5236352e34d575fda911199a853e
2,158
require 'presenters/v3/base_presenter' require 'presenters/mixins/metadata_presentation_helpers' module VCAP::CloudController::Presenters::V3 class DeploymentPresenter < BasePresenter include VCAP::CloudController::Presenters::Mixins::MetadataPresentationHelpers def to_hash { guid: deployment....
26.317073
149
0.592215
bfdf315143197d3eb77db2767148d23378112bbd
526
require 'formula' class Sdf < Formula homepage 'http://strategoxt.org/Sdf/WebHome' url 'ftp://ftp.stratego-language.org/pub/stratego/StrategoXT/strategoxt-0.17/sdf2-bundle-2.4.tar.gz' sha1 'b9be75d56503e7f06fcc9cc543303bae123c0845' depends_on 'aterm' def install system "./configure", "--prefix=#{prefix...
26.3
102
0.718631
626140699ae58f01e8ebd9805284bd9086715ff5
388
cask "kube-forwarder" do version "1.5.1" sha256 "683bcd380885787d653bfb21b39fda05ed786b09abe311c856ae4032859f3d5f" url "https://github.com/pixel-point/kube-forwarder/releases/download/v#{version}/kube-forwarder.dmg", verified: "github.com/pixel-point/kube-forwarder/" name "Kube Forwarder" homepage "htt...
32.333333
103
0.762887
62fb7c382b18ef87493377a2d658e1539ab2b711
1,782
# frozen_string_literal: true require 'begin/output' require 'begin/path' require 'begin/template' require 'git' require 'uri' module Begin # Provides centralised access to the local repository of templates # on the machine class Repository def initialize(name = '.begin', parent_dir = '~') @parent_dir...
24.75
88
0.6633
3928a195f189cb3d1dec8fbf1700dbb33f59e6ab
1,011
require 'support/parser_helpers' describe "The if keyword" do it "should return an s(:if) with given truthy and falsy bodies" do parsed("if 1; 2; else; 3; end").should == [:if, [:int, 1], [:int, 2], [:int, 3]] end it "uses nil as fasly body if not given else-then" do parsed("if 1; 2; end").should == [:i...
37.444444
125
0.576657
1a2ade12b35574f128520d60ae6814e940e2ad52
464
require 'json' module JSONable module ClassMethods attr_accessor :attributes def attr_accessor(*attrs) self.attributes = Array attrs super end end def self.included(base) base.extend(ClassMethods) end def as_json serialized = Hash.new self.class.attributes.each do |attr...
16.571429
56
0.685345
e246e700e44aa470d27ae0a841af57d77483c466
84
copy_file "lib/tasks/auto_annotate_models.rake" copy_file "lib/tasks/coverage.rake"
28
47
0.833333
03f2ac2edbd1abb3b4d4ca02e0149331e4c3a843
671
class Subject < ActiveRecord::Base has_and_belongs_to_many :articles, :conditions => {:state => 'approved'}, :order => "approved_at DESC" has_and_belongs_to_many :feeds has_and_belongs_to_many :keywords, :uniq => true do # normalize on downcase and ensure uniqueness when setting def <<(kw) kw.downca...
27.958333
104
0.66617
1c7727993c79f0c222ac023b9ea0fbf9cf63b742
1,963
require_relative 'scraper' class Articlecli::Cli def initialize @sc = Scraper.new end def call @sc.create_articles @newspaper = @sc.newspaper @articles = @newspaper.articles start end def start puts 'Welcome!' input = '' while inpu...
21.811111
55
0.449822
f83b73431e364babdf3223753a830edc6a01fd95
1,497
#-- encoding: UTF-8 #-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2015 the OpenProject Foundation (OPF) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject,...
34.813953
91
0.748831
d55c59ec4fc536c9d1c09209b946d81c0643f5c5
244
class Github::FakeAdapter def initialize(_post); end def create_pr Rails.logger.debug("Create a PR") end def update_pr Rails.logger.debug("Update the PR") end def close_pr Rails.logger.debug("Close the PR") end end
15.25
39
0.688525
33589886ea2e1e3b903ebb4966a4862b8d115960
1,356
# encoding: UTF-8 Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = 'spree_address_auto_complete' s.version = '3.7.0' s.summary = 'This is to use google places api to complete addresses in spree.' s.description = 'Using this extension, we can integrate google places to ...
38.742857
130
0.705752
9170ecbea1aba4be976f59162ca0a1ab480cbc6e
632
# frozen_string_literal: true module RailsWorkflow module OperationTemplates module Assignments extend ActiveSupport::Concern included do belongs_to :assignment, polymorphic: true, required: false scope :for_user, ->(user) { keys = RailsWorkflow.config.assignment_by.select...
23.407407
85
0.594937
391273fcf884f7e8f585b950e537f6d75c967ab8
316
default["rwci"]["user"] = "rwci" default["rwci"]["group"] = "rwci" default["rwci"]["rvm_ruby"] = "ruby-1.9.3-p194" default["rwci"]["rvm_gemset"] = "rwci" default["rwci"]["git"]["url"] = "git://github.com/rashidkpc/Kibana.git" default["rwci"]["git"]["reference"] = "v0.1.0"
45.142857
77
0.531646
38faf0fe7eac45195bcb51ffde420a75521a0fad
915
Pod::Spec.new do |s| s.name = "Seafile" s.version = "2.6.2" s.summary = "iOS client for seafile." s.homepage = "https://github.com/haiwen/seafile-iOS" s.license = 'MIT' s.author = { "wei.wang" => "poetwang@gmail.com" } s.source = { :git =>...
41.590909
102
0.578142
03afb2cdedd78eed28d5256cf845703833effb83
10,705
# # Author:: Joshua Timberman <joshua@opscode.com> # Author:: Seth Chisamore <schisamo@opscode.com> # # Copyright:: Copyright (c) 2012, Opscode, Inc. <legal@opscode.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtai...
35.330033
123
0.73134