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
082686ffb524f33172cd43c9a61c01818edaef0d
696
$:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "socratic/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "socratic" s.version = Socratic::VERSION s.authors = ["Gk Parish-Philp", "Michael Ferguson"] s.email ...
30.26087
83
0.655172
ac8f141ca26d17ba73dc253803e9585542388e0d
1,898
require "test_helper" class Edition::AccessControlTest < ActiveSupport::TestCase [:imported, :draft, :submitted, :rejected].each do |state| test "should be editable if #{state}" do edition = build("#{state}_edition") assert edition.editable? end end [:published, :superseded, :deleted].each ...
27.911765
72
0.652792
b93de22e9da76a57e7c74444735da4c25bc732bc
2,664
#-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2017 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, which is a fork of ...
33.3
99
0.705706
ed835aa924741ecd5197e1412c23ae58f9a77849
1,324
require File.expand_path("../../Abstract/abstract-php-extension", __FILE__) class Php70Apcu < AbstractPhp70Extension init desc "APC User Cache" homepage "https://pecl.php.net/package/apcu" url "https://github.com/krakjoe/apcu/archive/v5.1.8.tar.gz" sha256 "09848619674a0871053cabba3907d2aade395772d54464d3aee4...
23.642857
75
0.614804
d5933dbc207cdf4c6a6adfc486a9920ba4060171
39,302
# -*- encoding : utf-8 -*- require 'test_helper' require 'models/data_types' require 'models/entry' require 'models/auto_id' require 'models/string_id' require 'models/thing' require 'models/custom_pk_name' require 'models/validates_uniqueness_of_string' require 'models/add_not_null_column_to_table' ActiveRecord::Sch...
31.266508
154
0.687828
26df16f4ad120e3c82d618f12f9a43cfe601d520
1,179
require 'test_helper' class ContentTest < ActionView::TestCase test "show_for#content accepts any object" do with_content_for @user, "Special content" assert_select "div.show_for", "Special content" end test "show_for#content accepts :if_blank as option" do with_content_for @user, "", :if_blank => ...
34.676471
107
0.71162
9107684537a58d4790048da6258b9402f6124e14
669
require_relative 'abstract_text_match_rule' module Precheck class CustomTextRule < AbstractTextMatchRule attr_accessor :data def self.key :custom_text end def self.env_name "RULE_CUSTOM_TEXT" end def self.friendly_name "No user-specified words are included" end d...
18.583333
87
0.67713
2129791bc45f7aeb266b24bc74f94adbd148d5e4
283
module Adminos class FormBuilder < SimpleForm::FormBuilder def input(attribute_name, options = {}, &block) locale = options.delete(:locale) attribute_name = [attribute_name, locale].compact.join('_') super(attribute_name, options, &block) end end end
23.583333
65
0.689046
62aa6796d52abc9ac234c4b7cdf2208d868362c5
580
cask 'mcedit' do version '1.5.4.1' sha256 '29bde806dc415435296e14613f9052a38891e87189f63a30bd69494e13708953' # github.com/Khroki/MCEdit-Unified was verified as official when first introduced to the cask url "https://github.com/Khroki/MCEdit-Unified/releases/download/#{version}/MCEdit.v#{version}.OSX.64bit.zip"...
41.428571
110
0.77931
e23fbfb67382f60bb5bba05ec7cd8c40834b80e1
5,134
module Sequel class Dataset # --------------------- # :section: 4 - Methods that describe what the dataset supports # These methods all return booleans, with most describing whether or not the # dataset supports a feature. # --------------------- # Whether this dataset quotes identifiers....
30.2
105
0.687768
f72211de48c506b0ae903d04a3928d06240c8081
6,170
require 'sinatra' require 'json' require 'github_api' require 'pp' require_relative 'jobs/apply_staging_label_job' require_relative 'jobs/assign_owner_job' require_relative 'jobs/update_labels_job' require_relative 'jobs/update_pending_checks_job' LABELS = ['+1', '+2'] THUMB_REGEX = /:\+1:|^\+1|\u{1F44D}/ STAGING_BRAN...
34.277778
151
0.696434
919c6655d5d1dd7fe7e99592662241d1b7970a8b
3,351
require 'test_helper' class User::RegistrationsControllerTest < ActionController::TestCase setup do @user = users(:one) @email = Faker::Internet.email @password = Faker::Internet.password(8) end test "sign up page should exist" do get :new assert_response :success end test "sign up pa...
21.075472
69
0.630558
ab0c2c383c5bda82da2926a5d0f6e71d1f8d14db
15,467
# frozen_string_literal: true require 'spec_helper' describe Banzai::Filter::MilestoneReferenceFilter do include FilterSpecHelper let(:parent_group) { create(:group, :public) } let(:group) { create(:group, :public, parent: parent_group) } let(:project) { create(:project, :public, group: group) } it 'requi...
33.623913
104
0.661537
ff62e639e78ffdfaa87b8c84c4d7e661a3ad8e4f
2,340
# frozen_string_literal: true require 'axr/runner' RSpec.describe AxR::Runner do describe 'invoke' do let!(:setup) do AxR.app.send(:reset) AxR.app.define do layer 'Api' layer 'Logic' layer 'Repo', isolated: true end end context 'scan files' do let(:file_...
27.529412
94
0.601282
62b4aca059aa06b035a2c50a551b9e9e4fbb8f26
2,452
class CardController < ApplicationController def show set = params[:set] number = params[:id] if $CardDatabase.sets[set] @card = $CardDatabase.sets[set].printings.find{|cp| cp.number == number} end if @card @title = @card.name else render_404 end end def gallery ...
25.810526
99
0.636215
f8ef1028dc473375201d920d4c00e50286f40f28
1,360
$:.push File.expand_path("lib", __dir__) # Maintain your gem's version: require_relative "lib/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |spec| spec.name = "nexmo_rack" spec.version = Nexmo::Rack::VERSION spec.authors = ["Nexmo"] spec.email = ["de...
41.212121
191
0.683088
d57a7732a7919dc6da9255cd3d3d94bbd5aaebe9
297
class CreateRememberTokens < ActiveRecord::Migration[5.1] def change create_table :remember_tokens do |t| t.string :token t.datetime :expires_at t.references :user, foreign_key: true t.timestamps end add_index :remember_tokens, [ :user_id, :token] end end
22.846154
57
0.686869
ff1dceb40f685bcf5d8ebcbb619756dce711a159
4,422
module Etsy # = User # # Represents a single Etsy user - has the following attributes: # # [id] The unique identifier for this user # [username] This user's username # [email] This user's email address (authenticated calls only) # class User include Etsy::Model attribute :id, :from => :user...
30.496552
116
0.627996
abd50eb6c8df9fa04551bd57cdd2b74fa5fa294b
138
#AtCoder Beginner 16 A input = STDIN.gets.chomp.split.map! {|s| s.to_i} if input[0] % input[1] == 0 then puts "YES" else puts "NO" end
15.333333
48
0.652174
8789cd2e69196d09431dafd89adce2973c6b177c
731
# # Cookbook Name:: apache2 # Recipe:: log_config # # Copyright 2008-2009, Opscode, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
31.782609
74
0.738714
79eb9d20b262e3fa7e655152e1ddd355e3d2a5f3
2,909
# frozen_string_literal: true require 'lib/settings' module View class Log < Snabberb::Component include Lib::Settings needs :log needs :negative_pad, default: false needs :follow_scroll, default: true, store: true def render scroll_to_bottom = lambda do |vnode| next unless @foll...
27.186916
77
0.532142
e2a6662eea15b6c16ec2527d3ef322544178142d
512
module Users::Defaults extend ActiveSupport::Concern included do after_initialize :set_defaults, if: :new_record? end private def set_defaults self.enable ||= false self.send_notification_email = true if send_notification_email.nil? self.password_changed = Time.zone.now self.l...
23.272727
73
0.691406
0361d830fe5c95f75ffd0e0cdeaa1c6402f49545
508
require 'rails_helper' describe V1::MailAliasesController do describe 'POST /mail_aliases', version: 1 do it_behaves_like 'a creatable and permissible model' do let(:record) { build(:mail_alias, group: create(:group), user: nil) } let(:record_url) { '/v1/mail_aliases' } let(:record_permission) ...
36.285714
96
0.65748
5d96c9a61902bedb09f60b5e0b89665a9da4180c
23,912
require "rails_helper" describe "Contextual navigation" do scenario "There is a coronavirus taxon" do given_theres_a_page_with_coronavirus_business_taxon and_i_visit_that_page then_i_see_the_step_by_step and_the_step_by_step_header and_i_see_the_coronavirus_contextual_breadcrumbs_for_business e...
34.70537
136
0.769948
bb06f2057e98da18dbabc6fda30d36a59e8ebc55
2,066
require 'test_helper' class UserTest < ActiveSupport::TestCase def setup @user = User.new(name: "Example User", email: "user@example.com", password: "foobar", password_confirmation: "foobar") end test "should be valid" do assert @user.valid? end test "name should be present" do @user.nam...
28.30137
122
0.686834
62c598370aab0131c1b938cfefabe410900189b7
133
class Notebook < ApplicationRecord belongs_to :user has_many :notes, dependent: :destroy validates :name, presence: true end
16.625
38
0.759398
911dc5c469708284af8e9bc44211b2dcb5c4487f
1,107
# 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...
41
86
0.760614
03dc9a733503129e5790aa641f3ba81f23e1626f
3,608
# encoding: utf-8 require 'tempfile' require 'uri' class Strike class Dumper def initialize(config = {}) @dumpfile_source = config[:dumpfile_source] end # Dumps the data from the given database to a tmp file. # # @param [#run] cli the cli program that responds to `#run`. # @param [Str...
29.096774
74
0.549612
bf602f298c0f72f1ffb85205512e7b3b0b6e44f5
796
Gem::Specification.new do |s| s.name = 'cloudenv-hq' s.version = '0.2.9' s.license = 'MIT' s.date = '2020-10-10' s.summary = 'Keep your ENV vars synced between your team members' s.email = 'support@cloudenv.com' s.homepage = 'https://github.com/cloudenvhq/cloudenv-ruby' s.description = 'Keep your ENV va...
41.894737
120
0.692211
79574d25e96c28da222516dc1fc07c9c825c4821
1,529
# frozen_string_literal: true module Doorkeeper module OAuth module ClientCredentials class Creator def call(client, scopes, attributes = {}) existing_token = nil if lookup_existing_token? existing_token = find_existing_token_for(client, scopes) return e...
26.824561
98
0.618705
e9101b1d15c841b73422c102dedb04d0df3b5697
156
require 'spec_helper' describe 'backuprunner' do context 'with defaults for all parameters' do it { should contain_class('backuprunner') } end end
19.5
47
0.74359
bf6b21c60582cad25b75f7e46f2b61b91711249d
1,958
# frozen_string_literal: true require 'spec_helper' # Requres: # * subject with a 'resolve' name # * Defined expected timeline event via `let(:expected_timeline_event) { instance_double(...) }` RSpec.shared_examples 'creating an incident timeline event' do it 'creates a timeline event' do expect { resolve }...
33.186441
98
0.750766
7a3397746f5ef84d3d69464e369f2801a6ee7917
519
# Make a program that filters a list of strings and returns a list with only your friends name in it. # If a name has exactly 4 letters in it, you can be sure that it has to be a friend of yours! Otherwise, you can be sure he's not... # Ex: Input = ["Ryan", "Kieran", "Jason", "Yous"], Output = ["Ryan", "Yous"] # i.e...
34.6
132
0.666667
215cc9ff469f16c2fc47c89ef9edbdbabd6b93f9
161
require 'test_helper' class MypageControllerTest < ActionController::TestCase test "should get main" do get :main assert_response :success end end
16.1
55
0.751553
bbecaf27d4bab7ecb3f2dedc567575e23ab269eb
2,269
require_relative 'core' module CloudTest class CrossBrowserTesting < Core SERVER = "hub.crossbrowsertesting.com/wd/hub" DASHBOARD_LINK = "https://app.crossbrowsertesting.com/selenium/results" REST_STATUS_SERVER = "https://crossbrowsertesting.com/api/v3/selenium/" def self.init(config=nil) @con...
30.253333
153
0.646981
399ddba92430f2c69383e6eebf7e23fabe072820
113
class Record < ActiveRecord::Base has_many :protocol_records has_many :users, through: :protocol_records end
22.6
45
0.79646
4afd91b8b1bb3d96d468f22026daa09403cc5650
3,064
require 'spec_helper' module Spree module Retail RSpec.describe BundlePermuter do include_context 'phase_2_bundle' describe '#all_option_values_per_part' do subject { described_class.all_option_values_per_part(phase_2_part_1) } it 'returns all the possible option values for the part...
32.252632
106
0.625
2839a11b391cd2edcd2afa185f40f9e9812f0f3e
114
class PostSerializer include FastJsonapi::ObjectSerializer attributes :text, :user, :likes, :repost_count end
22.8
48
0.798246
1a9d75151bbb2c87dfcffc8a21565d90486890e6
458
require 'spec_helper' describe GitLeft::KeyParser do describe '#action' do subject { described_class.new(input).action } context 'with h input' do let(:input) { 'h' } it { is_expected.to eq(:delete) } end context 'with l input' do let(:input) { 'l' } it { is_expected.to eq...
17.615385
49
0.580786
e9a534637940b3554d95fbf08ecc4e823d79c4b2
2,366
# # Author:: Jay Mundrawala(<jdm@chef.io>) # Copyright:: Copyright (c) 2017 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
34.794118
134
0.590871
1c97ce11a83c7b752b057adfe1bef652ff69cfba
5,792
require File.dirname(__FILE__) + "/../test_helper" module MenuTest class TopMenu < Menu::Group define :id => 'top', :class => 'top' do |g| breadcrumb :site, :content => '<a href="/path/to/site">Site</a>' g.menu :left, :class => 'left' do |m| m.item :sections, :url => '/path/to/sections' ...
33.479769
109
0.631043
181346f95267a63ea7365386d3ccb54065b5ef0e
277
module Wobtrack CONFIGURATION_CONTROLLER = [].freeze def self.devise_modules if Settings['devise_modules'].blank? [:database_authenticatable, :registerable, :recoverable, :rememberable, :trackable] else Settings['devise_modules'] end end end
19.785714
89
0.711191
5d78f6833ee852bd6fe937a627f25e053f17427c
1,713
require "bittn" require "parslet" # ----- Sample ---------- # # class ****Node # # def initialize(data) # # @data = data # # end # # def call() # # end # # end # # # # class ****Node # # d...
17.13
61
0.488033
1df7ca27aae743f1b92f5046827432454bbc6963
1,277
#! /usr/bin/env ruby # USAGE: # ruby ./next_youbi.rb tue #=> wed # ruby ./next_youbi.rb tue -d #=> mon class Youbi def initialize(day_s) @number, @lang = number_and_lang(day_s) end def to_s(lang_name = @lang) expressions[lang_name][@number] end def increment! @number += 1 if to_s.nil? ...
19.953125
76
0.633516
b9a28e6dca73911f36f34fadee9ab309e319a45b
132
class AddChallengeIdToFeedItem < ActiveRecord::Migration def change add_column :feed_items, :challenge_id, :integer end end
22
56
0.787879
281564128fbf91c5e80c06ae295b85e068120031
464
class CreateClimate < ActiveRecord::Migration def change create_table :climates do |t| t.string :name t.string :temperature t.string :precipitation t.timestamps null: false end add_column :atractivos, :climate_id, :int add_foreign_key :atractivos, :climates remove_column :...
27.294118
54
0.709052
616efb0334ab37e24f80d084d4d468d7f29a4a45
472
$:.push(File.join(File.dirname(__FILE__), "..", "..", "lib")) require "marilyn-rpc" require "rubygems" require "eventmachine" class EventsService < MarilynRPC::Service register :events after_connect :connected after_disconnect :disconnected def connected puts "client connected" end def notify(msg...
17.481481
61
0.701271
e93812225c24522ab88a730b8c0e4f4e5a1acde7
795
cask 'unity@2020.3.0f1' do version '2020.3.0f1,c7b5465681fb' sha256 :no_check url "https://download.unity3d.com/download_unity/c7b5465681fb/MacEditorInstaller/Unity.pkg" name 'Unity 2020.3.0f1' homepage 'https://unity3d.com/unity/' pkg 'Unity.pkg' preflight do if File.exist? "/Applications/Unity" ...
26.5
93
0.68805
f8264da17bc04667af165f408136ba2f5bcf9263
138
module Irkr class Channel attr_accessor :name, :topic, :users def initialize(name) self.name = name end end end
15.333333
39
0.630435
01a2e58aa62f210d59eaec261a2b3a798b1500a2
3,584
# Copyright © 2011-2019 MUSC Foundation for Research Development~ # All rights reserved.~ # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:~ # 1. Redistributions of source code must retain the above copyright notice, this l...
41.674419
169
0.780134
1d85cfb072c90965fce359c1f1f0e32a03001a86
2,231
class AwscliAT1 < Formula include Language::Python::Virtualenv desc "Official Amazon AWS command-line interface" homepage "https://aws.amazon.com/cli/" # awscli should only be updated every 10 releases on multiples of 10 url "https://github.com/aws/aws-cli/archive/1.19.110.tar.gz" sha256 "c2674f4323a239bd4...
34.859375
122
0.714478
4a70207cd924b951010c195d240a371465736b71
3,065
class Gobby < Formula desc "Multi-platform collaborative text editor" homepage "https://gobby.github.io/" url "http://releases.0x539.de/gobby/gobby-0.5.0.tar.gz" sha256 "8ceb3598d27cfccdf9c9889b781c4c5c8e1731ca6beb183f5d4555644c06bd98" revision 6 head "https://github.com/gobby/gobby" bottle do sha256...
29.757282
93
0.732137
1c51dbc01ea9f3da5c86b56db307b3fc3bd91f60
611
# frozen_string_literal: true module RuboCop module Cop module Lint # This cop checks for the presence of empty expressions. # # @example # # @bad # foo = () # if () # bar # end class EmptyExpression < Cop MSG = 'Avoid empty expressi...
18.515152
62
0.546645
d5c1c61c17ff5f777aca10bd34c5014167ab19f0
679
#------------------------------------------------------------------------------- # # Thomas Thomassen # thomas[at]thomthom[dot]net # #------------------------------------------------------------------------------- module TT::Plugins::ShadowTexture class UV < Geom::Point3d; end class UVMapping def initialize...
16.975
80
0.434462
625fd61d95999b1fb612e86ffd6c7a9e745d8a7d
95
class Docin::ImportPolicy < ApplicationPolicy include Cms::Base::Designer::ContentPolicy end
23.75
45
0.810526
875799a0ccc96be88ca504c0a595fb0881497c44
767
# frozen_string_literal: true require 'irb' require 'dotenv/load' require "active_record" require "yaml" # Load up classes which have early dependencies first require_relative './oracle/command_processors/base_command_processor' require_relative './oracle/models/base_command' require_relative './oracle/models/base_li...
31.958333
100
0.795306
79d70dcca9864ba8ef692833156ffe3a882a19db
2,525
class Asyncplusplus < Formula desc "Concurrency framework for C++11" homepage "https://github.com/Amanieu/asyncplusplus" url "https://github.com/Amanieu/asyncplusplus/archive/v1.1.tar.gz" sha256 "d160d3a433a1e08f51c785742843182c2b81a7bc872766f57bf5f3108377b858" license "MIT" bottle do sha256 cellar: :a...
35.56338
104
0.53505
1147684e8070fb935bb81805fc2c49aa44eea766
7,668
module Intrigue module Task class Whois < BaseTask include Intrigue::Task::Web def self.metadata { :name => "whois", :pretty_name => "Whois", :authors => ["jcran"], :description => "Perform a whois lookup for a given entity", :references => [], :type => "discovery", :p...
34.232143
110
0.579421
4ab1f6ba93ce9629fcd1aa2bee6e4f6b0329fa09
1,857
# # Be sure to run `pod lib lint HungryToolsOC.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 = 'Hungr...
35.037736
105
0.644588
26917b5e4803772eb6d0035c12b8d7ab05cd8e49
206
# frozen_string_literal: true module Examples module CustomTypes class Schema < ::JSON::SchemaTemplates::Base schema do datetime :created_at, required: true end end end end
17.166667
48
0.679612
28e9b268675d0bf6ce3a63ced351e9b682ae9a6a
1,003
require 'spec_helper_acceptance' describe 'nvm::node::install define' do describe 'running puppet code' do pp = <<-EOS class { 'nvm': user => 'bar', manage_user => true, } nvm::node::install { '5.6.0': user => 'bar', default => t...
25.075
95
0.557328
f7f59db015eb200ec557d48ce29fa84656964bd9
26,536
require 'spec_helper' describe 'logrotate::rule' do context 'with an alphanumeric title' do let(:title) { 'test' } context 'and ensure => absent' do let(:params) { {:ensure => 'absent'} } it do should contain_file('/etc/logrotate.d/test').with_ensure('absent') end end let...
25.964775
81
0.4567
79328f56d3c8d843eed633dd522d59dad7798483
254
class ProjectSchedulerWorker include Sidekiq::Worker sidekiq_options retry: true def perform project_id resource = Project.find project_id Rails.logger.info "[PROJECT ONLINE #{resource.id}] #{resource.name}" resource.approve end end
23.090909
72
0.751969
e86812737588f4cbfc5c555eeaf277389cc009a5
630
ActiveRecord::Schema.define :version => 0 do create_table :relatable_users, :force => true do |t| t.column :name, :string end create_table :relatable_forums, :force => true do |t| t.column :name, :string end create_table :relatable_photos, :force => true do |t| t.column :name, :string end ...
26.25
55
0.671429
1a537b14a1f84cbcfd38b468cef77343ac2e4893
463
node.reverse_merge!( bird: { id: nil, }, ) raise 'set node[:bird][:id]' unless node[:bird][:id] package 'bird' directory '/etc/bird.conf.d' do owner 'root' group 'root' mode '0755' end template '/etc/bird.conf' do owner 'root' group 'root' mode '0644' notifies :run, 'execute[birdc configure]'...
17.148148
85
0.660907
ac0662e430b17e2276fee9b4cbb4fc289ad10f37
1,156
# encoding: utf-8 require File.expand_path("../lib/version", __FILE__) # coding: utf-8 Gem::Specification.new do |spec| spec.name = "intrigue-ident" spec.version = Ident::VERSION spec.authors = ["jcran"] spec.email = ["jcran@intrigue.io"] spec.summary = %q{Intrigue Asset F...
35.030303
104
0.67128
7a205ec833d5a14cda3e18a03b6530f3cc549531
2,198
=begin #=============================================================================== Title: Shared EXP Author: Hime Date: May 17, 2013 -------------------------------------------------------------------------------- ** Change log May 17, 2013 - removed unnecessary type casting May 13, 2013 - Initial rele...
33.815385
83
0.438581
1c43c6623430553c5cc56175b368d17f88170e50
161
class AddSyncInfoToUser < ActiveRecord::Migration def change add_column :users, :in_sync, :boolean add_column :users, :synced_at, :timestamp end end
23
49
0.745342
01ec10e5cd55c5d8c8f8f0f90642fd318fed766d
162
# frozen_string_literal: true class Nationalisation < ApplicationRecord belongs_to :nationality belongs_to :trainee audited associated_with: :trainee end
18
41
0.814815
ab1ccc6cfa6547d94ad8261549d4e194b95fed34
174
json.array!(@movies) do |movie| json.extract! movie, :id, :title, :release_year, :price, :description, :imdb_id, :poster_url json.url movie_url(movie, format: :json) end
34.8
94
0.712644
01a3ecbdbc0a36bc3f6fb60019481df23ff7ca84
1,511
module Cryptoexchange::Exchanges module JexFutures module Services class ContractStat < Cryptoexchange::Services::Market class << self def supports_individual_ticker_query? true end end def fetch(market_pair) contract_infos = super(contract_...
36.853659
102
0.661152
f857d4133b21fde3f1392a2d9282c844b2c13a2a
2,462
module API module APIHelpers def current_user @current_user ||= User.find_by_authentication_token(params[:private_token] || env["HTTP_PRIVATE_TOKEN"]) end def user_project @project ||= find_project(params[:id]) @project || not_found! end def find_project(id) project = Pro...
23.447619
110
0.609261
d500831e02c02c53ff6710b12528a5125111a9b6
621
cask "cyberduck" do version "7.5.0.33280" sha256 "57871fbec28af57c43c7f019d460d87fd4b145543c5e2b1443916448996e0254" url "https://update.cyberduck.io/Cyberduck-#{version}.zip" appcast "https://version.cyberduck.io/changelog.rss" name "Cyberduck" homepage "https://cyberduck.io/" auto_updates true app "...
28.227273
75
0.731079
269428a21a7dc367d12350761fdce193db7b2d37
843
require "language/haskell" class HaskellStack < Formula include Language::Haskell::Cabal desc "The Haskell Tool Stack" homepage "http://haskellstack.org" url "https://github.com/commercialhaskell/stack/archive/v1.0.4.3.tar.gz" sha256 "30dbf61cb8660ab52602c37bf41c31522af30609408d5ae0c20f6edbdb021ce8" head...
28.1
92
0.773428
f8eeea05257c6fa9596511d414f0f2dddcef451e
264
class AddSlugsToAlbumsMusicVideos < ActiveRecord::Migration[5.2] def change add_column :albums, :artist_slug, :string add_column :music_videos, :artist_slug, :string add_index :albums, :artist_slug add_index :music_videos, :artist_slug end end
29.333333
64
0.757576
d55d98c3a8fcad1f068004ec91edfeb60b676442
19,354
# Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
33.776614
196
0.634701
019d0a41854955fa94565c6875d0c6cdb64f1e86
364
module BloomRemitClient class GetDepositTargetsResponse < BaseResponse attribute :deposit_targets, Array, lazy: true, default: :default_deposit_targets def default_deposit_targets JSON.parse(body).map do |deposit_target_hash| hash = deposit_target_hash.with_indifferent_access DepositTa...
24.266667
84
0.747253
e814a7aedf73eab18012d2dd85dcc34498bfaa38
3,974
module HealthSeven::V2_4 class PppPcb < ::HealthSeven::Message attribute :msh, Msh, position: "MSH", require: true attribute :pid, Pid, position: "PID", require: true class PatientVisit < ::HealthSeven::SegmentGroup attribute :pv1, Pv1, position: "PV1", require: true attribute :pv2, Pv2, position: "PV2" ...
54.438356
121
0.674383
1a2190ad7959c7ddc45ad652df4f09db010b55f0
318
cask :v1 => 'node' do version '0.12.4' sha256 'ca483deb4cf71bb308e2c140c4773d7521a42e27d0f17a07f183169bb416aea0' url "http://nodejs.org/dist/v#{version}/node-v#{version}.pkg" name 'Node.js' homepage 'http://nodejs.org' license :mit pkg "node-v#{version}.pkg" uninstall :pkgutil => 'org.nodejs' end
22.714286
75
0.701258
628077d571ed5a374c9488da668dbc4694193f3f
425
module Klam class Cons include Enumerable attr_reader :hd, :tl def initialize(hd, tl) @hd = hd @tl = tl end def ==(other) other.instance_of?(Cons) && other.hd == @hd && other.tl == @tl end def hash [@hd, @tl].hash end def each x = self until ...
15.178571
68
0.510588
39ab0a9a90ec513fb1fd9718127d0fd4b5492289
860
require 'ddtrace/contrib/configuration/settings' module Datadog module Contrib module Rails module Configuration # Custom settings for the Rails integration class Settings < Contrib::Configuration::Settings option :cache_service option :controller_service optio...
31.851852
74
0.640698
4affbf7ff30599cc460f1c025ec8e0951c977edf
281
# frozen_string_literal: true require "rails_helper" describe InteractiveResourceType do describe "fields" do subject { described_class } it { is_expected.to have_field(:id).of_type(!types.ID) } it { is_expected.to have_field(:type).of_type("String!") } end end
21.615385
62
0.725979
39a0e68b87d8399411502b7fc41f177d989f1148
2,585
class Enzyme < Formula desc "High-performance automatic differentiation of LLVM" homepage "https://enzyme.mit.edu" url "https://github.com/EnzymeAD/Enzyme/archive/v0.0.28.tar.gz", using: :homebrew_curl sha256 "59f63b757326cda23a0f879ccb7ca18d4b2c276ef3d2055f6ec8818657671475" license "Apache-2.0" => { with: "L...
39.166667
123
0.640232
e999f9008bf0d0cfee8637d72042d1e39c901d5c
1,474
################################################################################ # # Author: Zachary Patten <zachary@jovelabs.com> # Copyright: Copyright (c) 2011-2012 Atalanta Systems Ltd # License: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may...
33.5
80
0.490502
9116899e57211e4e168a10a7593366164a1bcc86
836
class PostAppealsController < ApplicationController before_action :member_only, :except => [:index, :show] respond_to :html, :xml, :json, :js def new @post_appeal = PostAppeal.new(post_appeal_params) respond_with(@post_appeal) end def index @post_appeals = PostAppeal.includes(:creator).paginated...
25.333333
123
0.715311
03e0d7a6460672071e901a65cb6d1f527a91eec5
706
require 'test_helper' class ProductTest < ActiveSupport::TestCase context "An intangible product" do subject { Product.new(:tangible => false) } should_validate_presence_of :title should_not_allow_values_for :size, "22" should_allow_values_for :size, "22kb" should_ensure_value_in_range :price, 0...
29.416667
52
0.74221
d59387609f60574e25527df757b90b69d08113a0
169
class AddShoeStores < ActiveRecord::Migration def change create_table :stores do |s| s.column :name, :string s.column :zipcode, :int end end end
18.777778
45
0.662722
7a853b8e5bd30db6f6a0976c2b6d65b0d175248c
274
class CreateDivisionsMigration < ActiveRecord::Migration def self.up create_table(:divisions) do |t| t.timestamps t.integer(:league_id) t.string(:name, :limit => 50, :null => false) end end def self.down drop_table(:divisions) end end
19.571429
56
0.656934
7ace43e237d5a9a8191e4edbd6f3db422ff8ae24
3,900
require_relative '../lib/pudl/context' describe Pudl::Context do subject { Pudl::Context.new } it "raises an error if key is not a symbol" do expect { subject.set "not a symbol", "value" }.to raise_error(ArgumentError) end it "has no values" do expect(subject.values).to eq({}) end des...
21.787709
84
0.576923
793c3e633d586fa8f13f4f1bf759040460a64a92
4,027
require "rails_helper" module OkComputer describe SolrCheck do let(:host) { "http://localhost:8982/solr" } subject { described_class.new(host) } it "is a subclass of Check" do expect(subject).to be_a Check end describe "#new(host, request_timeout)" do it "requires host" do ...
28.971223
107
0.51552
210289342da3da9b8155220ceb47b62842b0c856
3,061
require 'test/unit' require 'myspace' require 'myspace_test' class TC_Profile < Test::Unit::TestCase include MySpaceTest def test_userid user_id = nil assert_nothing_raised do user_id = @ms_offsite.get_userid end assert_instance_of(String, user_id) assert_equal(USER_ID, user_id) end ...
28.342593
118
0.666776
ff9c269ec30fface22e5d445109ddce758104ea5
1,576
# Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. require 'test_helper' class PeriodicTestClass include Rx::PeriodicScheduler end def await_array_length(array, expected, interval) sleep (expected * interval) * 0.9 deadline = Time...
24.246154
131
0.711294
bf2432b211fe8f1ac2582ee54aa856b46d35092a
1,044
Capybara.register_driver :selenium_chrome_headless do |app| options = Selenium::WebDriver::Chrome::Options.new [ "--headless", "--window-size=1280x1280", "--disable-gpu" # https://developers.google.com/web/updates/2017/04/headless-chrome ].each { |arg| options.add_argument(arg) } Capybara::Seleniu...
29.828571
87
0.753831
e2f658d62a5cc5b4a3f797acc0a3086cfff80d26
373
# 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 module Models # # Defines values for VpnGatewayTunnelingProtocol # module VpnGatewayTunnelingProtocol IkeV2 =...
23.3125
70
0.715818
21ab4dc1548b3e3fc2f61a597e0de89b4a197ed5
107
class AddLogoToCourses < ActiveRecord::Migration def change add_attachment :courses, :logo end end
17.833333
48
0.766355
b95594ac16aec05834b3db1ed8530be7e3b81659
5,627
class Mpd < Formula desc "Music Player Daemon" homepage "https://www.musicpd.org/" url "https://www.musicpd.org/download/mpd/0.20/mpd-0.20.20.tar.xz" sha256 "a9e458c6e07cdf62649de7722e1e5a7f13aa82eeb397bfbbebc07cf5cf273584" revision 1 bottle do sha256 "5fb0cd8ede6ae6e1eb7983d1065d7e573dc73b67441fc3ceca...
35.613924
115
0.655767
620b82bc9bd75fc3bbe40ca9a948603ef05544e7
526
require_relative "config" require_relative "manages_transactions" require_relative "initializer_hooks" module CypressRails class ResetsState def initialize @manages_transactions = ManagesTransactions.instance @initializer_hooks = InitializerHooks.instance end def call(transactional_server:) ...
25.047619
58
0.768061
bf2b2dd7a9997d41b25e04aad51aecb6c9b5296d
3,270
require 'chef/mixin/shell_out' include Chef::Mixin::ShellOut action :set do if new_resource.bin_cmds # I couldn't find a way to cleanly avoid repeating this variable declaration in both :set and :unset alternatives_cmd = node['platform_family'] == 'rhel' ? 'alternatives' : 'update-alternatives' new_resou...
44.189189
152
0.663303
e91b3443c5aed79911848194566b1fb3c804c955
91,539
require 'cgi' require 'action_view/helpers/date_helper' require 'action_view/helpers/tag_helper' require 'action_view/helpers/form_tag_helper' require 'action_view/helpers/active_model_helper' require 'action_view/model_naming' require 'action_view/record_identifier' require 'active_support/core_ext/module/attribute_ac...
45.999497
194
0.606102
b9032c971875ed24f995a23eeb1b2271e00ba5d8
1,478
=begin #Selling Partner API for Direct Fulfillment Payments #The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data. OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 3.0.33 =e...
25.482759
132
0.632612