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
e2e62a706fdcb28eabc556fc598f207bc767458b
1,280
# frozen_string_literal: true Types::PostType = GraphQL::ObjectType.define do name 'Post' field :title, types.String field :body, types.String field :link, types.String field :post_creation_date, Types::DateTimeType field :site, Types::SiteType field :user_link, types.String field :username, types.Stri...
32.820513
58
0.761719
112fb5836be8f0b3e72c9184982f7df1c7d8f2f7
2,690
require "spec_helper" describe EA::AreaLookup do describe "Finders" do let(:coords) { EA::AreaLookup::Coordinates.new(easting: 654_321, northing: 123_456) } let(:api_url) { "http://environment.data.gov.uk/ds/wfs" } it "has a version number" do expect(EA::AreaLookup::VERSION).not_to be nil end ...
38.428571
99
0.588104
01d7d6855338ebde4798574b52b693a6c54dd343
5,232
require 'spec_helper' describe Beaker::VagrantVirtualbox do let( :options ) { make_opts.merge({ :hosts_file => 'sample.cfg', 'logger' => double().as_null_object }) } let( :vagrant ) { Beaker::VagrantVirtualbox.new( @hosts, options ) } let(:vagrantfile_path) do path = vagrant.instance_variable_get( :@vagrant_...
51.80198
205
0.655199
d5faed418138732924933954a7c0cb519ab50cc8
366
require "dropbox_product_updates/version" module DropboxProductUpdates require "dropbox_product_updates/product" require "dropbox_product_updates/product_data" def self.update_all_products(path=nil, token=nil) payload = '' ImportProductData.update_all_products(path,token) payload = 'Successful Impor...
24.4
53
0.775956
4ae5ee7f2b1d8f5514264be83570d98cc0682286
703
Rails.application.routes.draw do get "password_resets/new" get "password_resets/edit" root "static_pages#home" get "/readme", to: "static_pages#readme" get "/contact", to: "static_pages#contact" get "/signup", to: "users#new" resources :users do member do get :following, :followers end en...
28.12
67
0.682788
7a27c9ad517c83e30a877acd76cf72e069cefb38
7,894
require 'google/protobuf/well_known_types' require 'gruf' require 'opencensus/proto/agent/common/v1/common_pb' require 'opencensus/proto/agent/trace/v1/trace_service_pb' require 'opencensus/proto/agent/trace/v1/trace_service_services_pb' require 'opencensus/trace/exporters/ocagent/export_request_enumerator' module Ope...
39.079208
173
0.602736
e89abf3e0dad3d23187f82a09177e649479eac93
8,573
require 'json' require 'time' require 'concurrent' require 'sprockets/manifest_utils' require 'sprockets/utils/gzip' module Sprockets # The Manifest logs the contents of assets compiled to a single directory. It # records basic attributes about the asset for fast lookup without having to # compile. A pointer f...
29.767361
84
0.623819
4a59e6c081f934bb20d27500acb4c9e4f3bb8519
7,010
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/gkehub/v1/service.proto require 'google/protobuf' require 'google/api/annotations_pb' require 'google/api/client_pb' require 'google/api/field_behavior_pb' require 'google/api/resource_pb' require 'google/cloud/gkehub/v1/feature_pb' req...
51.167883
165
0.736805
bb409fdba74e23dd7f2c03b7dcc45307b5a773df
3,260
# frozen_string_literal: true if RUBY_ENGINE == 'opal' require_tree '../step' else require 'require_all' require_rel '../step' end module Engine module Round class Base attr_reader :entities, :entity_index, :round_num, :steps DEFAULT_STEPS = [ Step::EndGame, Step::Message, ...
21.589404
104
0.572086
6a4b11eaf2fadc760b9fb86476d38adfb955e4f2
2,066
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...
35.016949
85
0.759439
1aca2bd1839a19ff52479d6acc99762c1d5d1e7a
36
class Paper < ApplicationRecord end
12
31
0.833333
b92ed48b86890657187c887364f20865fded0bbd
69
module Autoloaded module Module1 class A end end end
11.5
18
0.637681
e20df49c3500c5d4de40f00838176f11fbbf8cb2
2,015
require "spec_helper" describe "routing for people", type: :routing do before(:each) do @community = FactoryGirl.create(:community) @protocol_and_host = "http://#{@community.ident}.test.host" @person = FactoryGirl.create(:person) end it "routes /:username to people controller" do expect(get "/#...
23.430233
63
0.466005
1dee09318660904923d82a64d33ec64b913c8058
138
class FixTypeOnItem < ActiveRecord::Migration[5.1] def change rename_column :items, :rejection_resason, :rejection_reason end end
23
63
0.775362
5dd6208599444eb006e8a9cf00b122002e98a642
1,729
# Generated by jeweler # DO NOT EDIT THIS FILE DIRECTLY # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{ruby-encoding-wrapper} s.version = "0.1.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :r...
29.810345
105
0.625217
1884dcba2461b084f567f916d1229cd13e14b926
20,162
# Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
40.163347
80
0.63947
bbb100de21ed35b547e9a1d183acae43d6eb84b1
1,299
# -*- encoding: utf-8 -*- # stub: equalizer 0.0.11 ruby lib Gem::Specification.new do |s| s.name = "equalizer" s.version = "0.0.11" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.require_paths = ["lib"] s.authors = ["Dan Kubb", "Markus Schirp"] s....
36.083333
105
0.656659
e2f142f3090a6357c00ef72eaeb4fe590ef9ae2e
3,201
## # 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::HttpClient include Msf::Exploit::CmdStager HttpFingerprint = { :pattern...
31.693069
97
0.601687
1a7c6775f0920ca032b53de417f88565d82d667e
790
# # This class was auto-generated from the API references found at # https://epayments-api.developer-ingenico.com/s2sapi/v1/ # require 'ingenico/connect/sdk/data_object' module Ingenico::Connect::SDK module Domain module Payment # @attr [String] merchant_reference class OrderReferencesApprovePayment...
23.939394
89
0.64557
f87bec928b4ecb290681613257f152eca83f10d4
662
class Api::V1::CollectionsController < ApplicationController def index collections = Collection.all render json: CollectionSerializer.new(collections) end def create collection = Collection.new(collection_params) if collection.save render json: CollectionSerializer.new(collection), stat...
24.518519
91
0.732628
082561fd400c96449d2f11da7811969cdde16faa
5,607
class Puppet::Parser::AST # The base class for all of the leaves of the parse trees. These # basically just have types and values. Both of these parameters # are simple values, not AST objects. class Leaf < AST attr_accessor :value, :type # Return our value. def evaluate(scope) @value e...
25.256757
154
0.623328
398477a680ebc77e882352ae01e9fa21b5e93a0e
1,341
require 'spec_helper' RSpec.describe 'Coinexmarket integration specs' do let(:client) { Cryptoexchange::Client.new } let(:btc_ltc_pair) { Cryptoexchange::Models::MarketPair.new(base: 'btc', target: 'ltc', market: 'coinexmarket') } it 'fetch pairs' do pairs = client.pairs('coinexmarket') expect(pairs).no...
31.186047
115
0.716629
ede75b81cf0efb33cdfbaf146b5adc9233ff6c89
974
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads/v3/errors/id_error.proto require 'google/protobuf' require 'google/api/annotations_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/ads/googleads/v3/errors/id_error.proto", :syntax => :proto3) do ...
31.419355
154
0.725873
d51e11c98e6a9be21f839c31cdce29c0444964f6
233
class Group < ActiveRecord::Base validates_presence_of :name has_many :item_groups has_many :items, through: :item_groups has_many :users, through: :items extend Slugify::ClassMethods include Slugify::InstanceMethods end
25.888889
40
0.785408
b9ff123dbccbb116475c32da1da1523723720e29
135
class AddCategoryIdToProposals < ActiveRecord::Migration[5.0] def change add_column :proposals, :category_id, :integer end end
22.5
61
0.77037
e82bf111b19c3f1ce2e2832e2a67f8a9eb599412
158
require File.expand_path('../../../spec_helper', __FILE__) require 'actor' describe "Actor.receive" do it "needs to be reviewed for spec completeness" end
22.571429
58
0.734177
bfe7bcbee4c10cb77d12dc8ac834064ca0103379
828
# frozen_string_literal: true class CreateSubmissions < ActiveRecord::Migration[5.0] def change create_table :submissions do |t| t.string :user_id, index: true t.boolean :qualified t.string :artist_id t.string :title t.string :medium t.string :year t.string :category ...
23.657143
54
0.650966
5d780a24f856f2e58a74258c07d6601482986978
1,745
class GitAbsorb < Formula desc "Automatic git commit --fixup" homepage "https://github.com/tummychow/git-absorb" url "https://github.com/tummychow/git-absorb/archive/0.6.6.tar.gz" sha256 "955069cc70a34816e6f4b6a6bd1892cfc0ae3d83d053232293366eb65599af2f" license "BSD-3-Clause" bottle do rebuild 1 sh...
37.934783
122
0.715186
91284003eff7cbb48b1f83711fda27028ae8403e
1,246
require 'spec_helper' describe Tinder::Connection do describe "authentication" do it "should raise an exception with bad credentials" do FakeWeb.register_uri(:get, "http://foo:X@test.campfirenow.com/rooms.json", :status => ["401", "Unauthorized"]) connection = Tinder::Connection.new('test', :...
42.965517
95
0.674157
ab52f5fd6fad1a62bf8b72fa5caa268dc906e7f3
871
module RubyJmeter class DSL def transaction_controller(params={}, &block) node = RubyJmeter::TransactionController.new(params) attach_node(node, &block) end end class TransactionController attr_accessor :doc include Helper def initialize(params={}) testname = params.kind_of...
32.259259
131
0.729047
28bf5ab71cafb17af9116593cff208cf70064925
74,136
# Autogenerated from a Treetop grammar. Edits may be lost. require "treetop" require "logstash/config/config_ast" module LogStashConfig include Treetop::Runtime def root @root ||= :config end module Config0 def _ elements[0] end def plugin_section elements[1] end end m...
21.157534
94
0.477056
7a60d9b50e3f483b7a7dbdeb8692641027e7d86a
1,370
# 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...
33.414634
105
0.726277
d50daa39369e18dc39efca899a9e2c0e8fd023c4
1,159
describe ServiceHelper::TextualSummary do describe ".textual_orchestration_stack" do let(:os_cloud) { FactoryGirl.create(:orchestration_stack_cloud, :name => "cloudstack1") } let(:os_infra) { FactoryGirl.create(:orchestration_stack_openstack_infra, :name => "infrastack1") } before do login_as Facto...
37.387097
103
0.725626
ed1b82599c179cd6c199ece0a8d4be404cef1a1e
258
class GzippedAsset < TestCask version '1.2.3' sha256 '832506ade94b3e41ecdf2162654eb75891a0749803229e82b2e0420fd1b9e8d2' url TestHelper.local_binary_url('gzipped_asset.gz') homepage 'http://example.com/gzipped-asset' app 'gzipped-asset-1.2.3' end
25.8
75
0.790698
3378d6db0fbd4dad9924cc12510a294485f4fe13
11,214
# frozen_string_literal: true require "action_view" require "action_controller/log_subscriber" require "action_controller/metal/params_wrapper" module ActionController # Action Controllers are the core of a web request in \Rails. They are made up of one or more actions that are executed # on request and then eith...
41.227941
141
0.699929
1850fa9747df54d5a5bf79959c57fb5b89454db5
3,766
# frozen_string_literal: true module Users # Service for refreshing the authorized projects of a user. # # This particular service class can not be used to update data for the same # user concurrently. Doing so could lead to an incorrect state. To ensure this # doesn't happen a caller must synchronize access...
38.824742
119
0.669145
7a67976b8378124568ca935f24fbb128677651e5
2,184
require "name_change_o_chart/version" module NameChangeOChart def convert(name) parts = name.to_s.downcase.split start = parts.first.to_s ending = parts.last.to_s first = start[0] second = ending[0] third = ending[-1] %{#{first_of_first(first)} #{first_of_last(second)}#{last_of_...
20.603774
78
0.419414
39781c7037b681a4cc44599d95d63d85f2dd495b
245
FactoryBot.define do factory :user, class: User do name { Faker::Name.first_name } last_name { Faker::Name.last_name } sex { [Commons::Concerns::Attributes::Sex::FEMALE, Commons::Concerns::Attributes::Sex::MALE].sample } end end
30.625
105
0.697959
87449c651f0b3625b51e5e4bbfc75c3b10f8b4cb
181
class UserMenu::SignedInComponent < ApplicationComponent attr_reader :user def initialize(user) @user = user end def business? user.business&.persisted? end end
15.083333
56
0.723757
e90f0ba730e84fb4da9754b9e7339eb021d4bcb2
500
module ActiveRecord module ConnectionAdapters module Sqlserver module Showplan class PrinterXml def initialize(result) @result = result end def pp xml = @result.rows.first.first if defined?(Nokogiri) ...
19.230769
74
0.464
ed9a9c74747540a684a0b14115bfbc5de16e316b
291
require 'rails_helper' RSpec.describe "inflows/edit", type: :view do before(:each) do @inflow = assign(:inflow, Inflow.create!()) end it "renders the edit inflow form" do render assert_select "form[action=?][method=?]", inflow_path(@inflow), "post" do end end end
19.4
77
0.66323
79a2466c1d8aa9fc49f746735e919585b8a45248
315
unless defined?(Devise) require 'devise' end module DeviseBearerToken end Devise.add_module :bearer_token_authenticatable, model: true, strategy: true Devise.setup do |config| config.bearer_token_fields = [ :access_token, :token_type, :client, :expiry, :uid ] config.bearer_token_strategy = :headers end
22.5
85
0.774603
b9c01f44d7d6419767575b987368e9e56e281daf
1,459
module PiiSafeSchema class PiiColumn extend PiiSafeSchema::Annotations attr_reader :table, :column, :suggestion def initialize(table:, column:, suggestion:) @table = table.to_sym @column = column @suggestion = suggestion end class << self def all find_and_create ...
26.053571
96
0.627142
269c4f303f0d6d7eca0677bc7129f04436c05d24
3,840
module EffectiveCartsHelper # TODO: Consider unique def current_cart(for_user = nil) @cart ||= ( user = for_user || (current_user rescue nil) # rescue protects me against Devise not being installed if user.present? user_cart = Effective::Cart.where(user: user).first_or_create # Mer...
28.656716
141
0.623438
1abce1777fbdc057ac9bddfb9b11e06c4d9528fb
669
# frozen_string_literal: true require "guard/options" module Guard module UI class Logger class Config < Guard::Options DEFAULTS = { progname: "Guard", level: :info, template: ":time - :severity - :message", time_format: "%H:%M:%S", flush_seconds: ...
20.272727
52
0.523169
e2ec663a909af088e61fe462d5ccc596cf333037
5,074
# frozen_string_literal: true require "simplecov" SimpleCov.start do minimum_coverage 100 end require "with_model" # This file was generated by the `rails generate rspec:install` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file...
47.867925
96
0.719354
87c309d747a980eb84f867421c27326b4cb13add
2,046
# -*- encoding: utf-8 -*- # stub: decent_exposure 3.0.4 ruby lib Gem::Specification.new do |s| s.name = "decent_exposure".freeze s.version = "3.0.4" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["P...
51.15
481
0.711144
111bcb9e7675c9c76942ee594886fb96c563c897
751
cask "dynobase" do arch = Hardware::CPU.intel? ? "" : "-arm64" version "1.8.1" if Hardware::CPU.intel? sha256 "6140f786e798668d7f63c12db5bafbad47d1be18d76b64a01ae0c857db3459b6" else sha256 "78c62b7eac57282d4afc2e7afe6a28213595a6dcb542b96d0f393a4d2a2c60eb" end url "https://github.com/Dynobase/dyno...
25.033333
105
0.721704
4a8f413ad2312dcdba56892b1a249ba0f72cb5be
3,589
module Virginity class BaseField < ContentLine def params_to_xml!(params, builder) builder.params(:type => "array") do params.each do |p| builder.tag!(p.key, p.value, :type => "string") end end end def extra_fields_to_xml(fields, builder) fields.each_pair { |...
23.611842
80
0.575648
18ed8e42f9c137dd3b039dab1d363abf520f8606
9,437
# 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...
45.589372
174
0.653915
39b63242890d1e54578c9aa07f37eac20bf2268a
621
require_relative '../automated_init' context "Put" do context "Returns stream position" do stream_name = Controls::StreamName.example write_event_1 = Controls::EventData::Write.example write_event_2 = Controls::EventData::Write.example position_1 = EventSource::EventStore::HTTP::Put.(write_event_1,...
28.227273
80
0.727858
e87f6b6ccf5076b32a93577c94453ae2932139da
516
# frozen_string_literal: false FactoryBot.define do factory :debt_account, class: 'Account' do user balance { 3000 } account_type { 'debt' } balance_currency { 'CLP' } quota { 0 } end factory :credit_account, class: 'Account' do user balance { -500 } account_type { 'credit' } ...
18.428571
46
0.612403
bb65e2242e732140eb434d726f7cb49691b0ca55
234
class Schedule < ApplicationRecord has_many :user_schedules has_many :users, through: :user_schedules has_many :workout_schedules has_many :workouts,through: :workout_schedules accepts_nested_attributes_for :workouts end
21.272727
48
0.816239
7ab152a9eac68d19803c095822118e4e242fb616
1,499
# frozen_string_literal: true module EE module Mutations module Boards module Lists module Create extend ActiveSupport::Concern extend ::Gitlab::Utils::Override prepended do argument :milestone_id, ::Types::GlobalIDType[::Milestone], r...
33.311111
122
0.587725
3893bd3a325324e37287bb093667f1b1a67d0629
3,470
require 'spec_helper' describe "regression tests" do describe "python" do let(:filename) { 'test.py' } specify "brackets inside parentheses" do # See https://github.com/AndrewRadev/sideways.vim/issues/4 set_file_contents <<-EOF foo([ 'bar', 'baz', 'quux' ]) EOF vim.search('b...
20.532544
88
0.538905
87b339f57388be51d515b3aa0c08bb3acc03cb70
85
json.array! @confirmations, partial: 'confirmations/confirmation', as: :confirmation
42.5
84
0.8
6233eefe5d6e48574bcff8d628d17763b1573377
790
require('pry') class Scene < ActiveRecord::Base belongs_to(:quest) has_many(:observations) define_method(:options) do options = [] Scene.all.each do |scene| if scene.previous_scene == self.id options.push(scene) end end options end define_method(:required_observations?) d...
21.351351
123
0.588608
f81f7a91e53a47da2638c0e5fb5e9377cc48bd79
387
cask 'sleepyhead' do version '1.0.0-beta-2.2,20160421' sha256 '182b818143815b4da5e02260e35832afc9787610a9fb5aba07b309923f01b54b' url "https://sleepyhead.jedimark.net/releases/SleepyHead-#{version.before_comma}-Snapshot-MacOSX-#{version.after_comma}.dmg" name 'SleepyHead OpenSource CPAP Review Software' homep...
35.181818
126
0.790698
7908a586cc2a798014123b667d2ec4ee1cf2a28a
827
# Require any additional compass plugins here. # Set this to the root of your project when deployed: css_dir = "css" sass_dir = "css/scss" images_dir = "img" javascripts_dir = "js" # You can select your preferred output style here (can be overridden via the command line): # output_style = :expanded or :nested or :com...
34.458333
96
0.753325
d5821f5ae1a999b68e6d946cf834faa552190e89
2,160
# -*- encoding: utf-8 -*- # stub: commonmarker 0.17.13 ruby libext # stub: ext/commonmarker/extconf.rb Gem::Specification.new do |s| s.name = "commonmarker".freeze s.version = "0.17.13" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_pa...
45
116
0.683333
7a51915a7ae9d30416a1c0c27101813f4a33566c
2,864
# Generated by the protocol buffer compiler. DO NOT EDIT! # Source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto for package 'Google.Cloud.RecaptchaEnterprise.V1' # Original file comments: # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use...
48.542373
170
0.719623
1c99c96970d91f983a79934f25da26760c39959c
833
#!/usr/bin/env ruby require_relative './../spec/spec_helper' class Base include ROXML xml_convention :dasherize xml_namespace 'aws' end class WeatherObservation < Base xml_name 'ob' xml_reader :temperature, :as => Float, :from => 'aws:temp' xml_reader :feels_like, :as => Integer xml_reader :current_cond...
30.851852
85
0.751501
038dd149460d8a56d6154ab9fc9055bb4fbab547
1,622
class Dopewars < Formula desc 'Free rewrite of a game originally based on "Drug Wars"' homepage "https://dopewars.sourceforge.io" url "https://downloads.sourceforge.net/project/dopewars/dopewars/1.6.1/dopewars-1.6.1.tar.gz" sha256 "83127903a61d81cda251a022f9df150d11e27bdd040e858c09c57927cc0edea6" license "GPL...
40.55
95
0.662762
39ea2a43348c244d90bd88f5d60b8785cb77c0cc
1,956
# frozen_string_literal: true RSpec.describe Operations::And do subject(:operation) { Operations::And.new(left, right) } include_context 'predicates' let(:left) { Rule::Predicate.build(int?) } let(:right) { Rule::Predicate.build(gt?).curry(18) } describe '#call' do it 'calls left and right' do e...
27.549296
138
0.562372
11028d95cb8f973d903f31da300597b7fa1e7ccc
1,576
module RsvpTemplatesHelper def col_widths [75, 150, 150, 150, 75] end def span_wrap_header(text, col) width = col_widths[col] "<span style='display: inline-block; width: #{width}px; font-size: 10px; font-weight: bold;'>#{text}</span>" end def span_wrap_row(text, col) width = col_widths[col]...
32.163265
112
0.658629
b93abeaaa388e639562bb451ee178d804b65524a
47,432
require "spec_helper" describe Identification, "creation" do describe "without callbacks" do it "should store the previous observation taxon" do o = make_research_grade_observation previous_observation_taxon = o.taxon i = Identification.make!( observation: o ) expect( i.previous_observa...
40.854436
144
0.689598
ab3fa666195f373826ad49989cd491c0558517b1
369
module Languages class Zpl2 class Speed def initialize(amount) set(amount) end def render "^PR#{@amount},D,A" end private def set(amount) @amount = case(amount) when :slow '1' when :normal 'A' when :fast ...
14.76
30
0.449864
91c36db7e04678d3498b6cca598445c0fb189b52
43,965
# 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.012127
153
0.725645
919fbbcfe8e319ed5ed010d6e8a4c195a1ca003b
522
class Item < ApplicationRecord belongs_to :category has_many :line_items has_many :carts, through: :line_items has_many :comments validates :name, presence: true validates :name, uniqueness: true validates :price, presence: true validates :price, numericality: {message: "must be a number"} validat...
26.1
67
0.720307
01f56af733c960281f673d61844775d64061ba22
39
# typed: true def foo = 42 rescue nil
9.75
23
0.666667
03103ffc21ca7c1173a183ffc5c265942b403168
441
class SorceryBruteForceProtection < ActiveRecord::Migration def self.up add_column :<%= model_class_name.tableize %>, :failed_logins_count, :integer, :default => 0 add_column :<%= model_class_name.tableize %>, :lock_expires_at, :datetime, :default => nil end def self.down remove_column :<%= model_cla...
40.090909
95
0.736961
184445c3f7b8644971f2cd6c94af63aff1f81dfd
3,725
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Post include Msf::Post::File include Msf::Post::Linux::System def initialize(info = {}) super(update_info(info, 'Name' => 'Lin...
31.302521
118
0.638121
ff45310ed084a656fa34d71a538b01831229ad76
779
require 'test_helper' class StaticPagesControllerTest < ActionDispatch::IntegrationTest def setup @base_title = "Ruby on Rails Tutorial Sample App" end test "should get root" do get root_path assert_response :success end test "should get home" do get home_path assert_response :success ...
21.054054
65
0.699615
08c7964c90bbe3273c6fa3ac9e28c034b51e5d8c
880
Pod::Spec.new do |s| s.name = "UpstraUIKit" s.version = "1.0.0" s.summary = "A brief description of UpstraUIKit project." s.description = "An extended description of UpstraUIKit project." s.homepage = "https://github.com/EkoCommunications/EkoMessagingSDKUIKit" s.license =...
44
120
0.581818
bb4e50467086f2871d6bc40c3818aca2336062fe
2,029
require 'nokogiri' module Stratify module Garmin class RssItemAdapter attr_reader :item def initialize(item) @item = item end def activity_type description_content_in_table_row(4) end def created_at item.pubDate end def description ...
24.154762
96
0.65451
f82ba8d3297b037397bdaed37ff0b41380771e9e
168
require 'jsonmodel' require 'client_enum_source' JSONModel::init(:client_mode => false, :strict_mode => false, :enum_source => ClientEnumSource.new) include JSONModel
28
99
0.785714
abf12f3d4b1fa90c7e4fc50012cb906b436d5e82
741
class SessionsController < ApplicationController def new end def create @user = User.find_by(email: params[:session][:email].downcase) if @user && @user.authenticate(params[:session][:password]) if @user.activated? log_in @user params[:session][:remember_me] == '1' ? remember(@user)...
24.7
79
0.635628
bb531ac531ac21f4fdef636467eff87b6037b52b
2,524
# 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...
37.671642
103
0.656498
1c528df60a502115485137b46f002375fa60c71e
846
require 'test_helper' describe Aliyun::Oss::Struct::Directory do let(:bucket_name) { 'bucket-name' } let(:bucket_location) { 'oss-cn-beijing' } let(:host) { "#{bucket_location}.aliyuncs.com" } let(:endpoint) { "http://#{bucket_name}.#{host}/" } let(:access_key) { 'AASSJJKKW94324JJJJ' } let(:secret_key) { '...
30.214286
79
0.658392
8766638403cecca1cb936648bb4133fd30f2a7cf
56
module CacheTranslatedAttribute VERSION = "0.0.2" end
14
31
0.767857
39581c133b305b421dff0f2732f2bf628eb6e638
129,699
require 'spec_helper' describe Project do include ProjectForksHelper describe 'associations' do it { is_expected.to belong_to(:group) } it { is_expected.to belong_to(:namespace) } it { is_expected.to belong_to(:creator).class_name('User') } it { is_expected.to have_many(:users) } it { is_expec...
31.140216
156
0.671038
5da339bacbecf527d40a10ab6a19586d98351433
773
# encoding: utf-8 $:.push File.expand_path("../lib", __FILE__) require 'hammerspace/version' Gem::Specification.new do |s| s.name = "hammerspace" s.version = Hammerspace::VERSION s.platform = Gem::Platform::RUBY s.authors = `git log --format=%an -- lib`.split($/).uniq s.email = ...
35.136364
84
0.628719
616e7d1eb731c66f9605df01c4618de78401b628
1,307
# coding: utf-8 lib = File.expand_path('../lib/', __FILE__) $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib) require 'solidus_wishlist/version' Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = 'solidus_wishlist' s.version = SolidusWishlist.version s.summary = 'A...
31.878049
62
0.717674
28bf0d9566ace1afce8167facbaca936c8c4827b
1,428
=begin #Accounting API #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 2.0.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.0.3 =end require 'spec_helper' require 'json' ...
26.444444
107
0.737395
b93c7de26b1ac2eb394f387b47ff74391c42779c
162
class PeerReaper def self.reap_older_than(time = Peer::UPDATE_PERIOD_MINUTES.minutes.ago) Peer.where('`peers`.`updated_at` < ?', time).destroy_all end end
32.4
74
0.746914
ff7e548d832a7c01bcd6fbc18328f95dea6764ca
299
#Author: Piotr Wojcieszonek #e-mail: piotr@wojcieszonek.pl # Copyright 23.03.2016 by Piotr Wojcieszonek require_relative 'option' require_relative 'type/raw' module Lib module DHCP class Option202 < Option #TODO Option202 include Lib::DHCP::Option::Type::Raw end end end
16.611111
44
0.722408
bfa6f1fb1b18dfc53ef94126ae0b5975752a0b6d
820
# Utilities for: # # https://github.com/HakubJozak/sour # module Threescale module Api module Sour module Operation def paginated param 'page', description: 'Current page of the list', dataType: 'int', paramType: "path", default: 1 param '...
22.162162
76
0.558537
288423faa5f3e5727dfa7b28d14eee5e6c3ae8f5
1,053
require 'test_helper' class UsersControllerTest < ActionDispatch::IntegrationTest def setup @user = users(:michael) @other_user = users(:archer) end test "should redirect index when not logged in" do get users_path assert_redirected_to login_url end test "should get new" do get ...
22.404255
66
0.710351
877c07d9f865a866f9c90f91048a6c1143c33d51
766
class JournalsController < ApplicationController before_action :authenticate_user! def index @journals = current_user.journals.page(params[:page]) end def destroy @journal = Journal.find(params[:id]) current_user.journals.delete(@journal) redirect_to journals_path end def new if param...
21.277778
64
0.711488
b944e5d823dd180573726c23c7cd45fa48d87454
248
module RiotGamesApi module LOL module Model module Summoner class RuneSlot include Virtus.model attribute :rune_id, Integer attribute :rune_slot_id, Integer end end end end end
16.533333
42
0.600806
5d9da7d84796ed640df33056a38a5eb23474089b
3,892
#-- copyright # OpenProject is an open source project management software. # Copyright (C) 2012-2021 the OpenProject GmbH # # 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 ...
26.47619
91
0.656989
d5f195cb89d219d10d5bd1a861586efc07e4ca1b
448
require 'opal' require 'volt/models' class Test def self.test1 a = ReactiveValue.new(1) listener = a.on('changed') { puts "CHANGED" } a.cur = 5 listener.remove ObjectTracker.process_queue end def self.test a = ReactiveValue.new(Model.new) a._cool = [1,2,3] listener = a._cool.on...
16.592593
51
0.631696
79613a37b2368c2abc6d6bdd85aa11f0c412843c
1,307
require File.expand_path("../../spec/dummy/config/environment.rb", __FILE__) ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../spec/dummy/db/migrate", __FILE__)] ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__) require "rails/test_help" require "rspec/rails" # ...
40.84375
120
0.772762
edeb9268635256b2b14be24189ed9ef06ccf7722
38
module Basket VERSION = "0.0.1" end
9.5
19
0.657895
bfba319093432c924e6ab0c64c79c6dce0f210ec
577
module EasyTable module Components module Spans def span(*args, &block) opts = options_from_hash(args) title, label = *args child = node << Tree::TreeNode.new(title || generate_node_name) span = Span.new(child, title, label, opts, @template, block) child.content = spa...
20.607143
71
0.571924
e8f09c78014aa752b674209dea385e4c99e4102c
3,944
require 'meta_events/definition/version' describe ::MetaEvents::Definition::Version do let(:definition_set) do out = double("definition_set") allow(out).to receive(:kind_of?).with(::MetaEvents::Definition::DefinitionSet).and_return(true) allow(out).to receive(:global_events_prefix).with().and_return("gep...
39.44
130
0.692191
f8f4bd76f9842dcaa244ab8b52639b17073263af
889
class PhotoList attr_reader :photos def initialize(photos) @photos = photos.sort_by { |photo| photo.added_at }.reverse end def with_tag(tag) PhotoList.new(@photos.find_all { |photo| photo.tags.include?(tag) }) end def with_collection(collection) PhotoList.new(@photos.find_all { |photo| photo....
19.326087
86
0.670416
1cd80586ef06ac0a4e3c13cacd320c4e5f8d41f9
712
module GoogleApps class EventsList < Events def events_list(optional_params={}) optional_params.reverse_merge!(:calendarId => 'primary', :maxResults => 1000) # Events API is quick but, 2000+ events within a day might be a little absurd. request :api => "calendar", :resource => "events", :method...
32.363636
103
0.657303
d5705587bcd0dd56168017c0899a75a4a3d3c2f3
665
# frozen_string_literal: true class MysqlQuery < ActiveInteraction::Base object :data_source, class: DataSource string :db_query validates :db_query, :data_source, presence: true def execute ActiveRecord::Base.transaction do username = data_source.settings.delete("user") if data_source.settin...
28.913043
109
0.705263
e8759791d74a5bd542db36e85d241225baeafc69
1,398
class PasswordResetsController < ApplicationController before_action :get_user, only: [:edit, :update] before_action :valid_user, only: [:edit, :update] before_action :check_expiration, only: [:edit, :update] def new end def create @user = User.find_by(email: params[:password_reset][:email].downcase) ...
22.918033
83
0.67382