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
ab6ed36649ff299df6fbf2892450db95472ec558
237
require 'serverspec' require 'ansible_spec' set :backend, :exec # # Set ansible variables to serverspec property # group_idx = ENV['TARGET_GROUP_INDEX'].to_i vars = AnsibleSpec.get_variables('localhost', group_idx) set_property vars
16.928571
56
0.780591
edd0de99836e66f92526459b62d0ced6f32bd741
5,339
# 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...
31.779762
123
0.589811
283bcaea97b97b930c0cf3d8badd86d0a5be2b92
232
# # # Cookbook Name:: qs-stp # Recipe:: xfce4 # # Copyright 2014, cybuhh # [ "xfce4", "xfce4-session", "xfce4-settings", "xfwm4" ].each do |packageName| package packageName do action :install end end
12.888889
26
0.594828
bb7d664ac46fb67b1fb049615646ca178a4ae5df
380
require 'puppet_x/puppetlabs/meep/config' # Return a list of all mco broker hosts. # # The data is obtained from the MEEP pe.conf configuration. Puppet::Functions.create_function(:pe_list_mco_broker_nodes) do # @return [Array<String>] def pe_list_mco_broker_nodes config = PuppetX::Puppetlabs::Meep::Config.new(...
29.230769
65
0.771053
01b63f3572f6b4162634cbf01387feeac6f66ad7
1,104
require_relative "lib/rich_text_field/version" Gem::Specification.new do |spec| spec.name = "rich_text_field" spec.version = RichTextField::VERSION spec.authors = ["Benny Heller"] spec.email = ["benny@10fdesign.io"] spec.homepage = "https://10fdesign.io" spec.summary = "Add Rich...
40.888889
96
0.692029
ab9ed9caf4f57d04dda252a80cc7a5670b4df59a
118
class NullAcademic def id -1 end def admin_role? false end def approver_role? false end end
8.428571
20
0.627119
e24c2588abb5282828a4878b4e43bc05cabd51f7
419
class ApplicationController < ActionController::Base rescue_from ApiExceptions::BaseException, with: :render_error_response protect_from_forgery with: :null_session include DeviseTokenAuth::Concerns::SetUserByToken before_action :set_format def render_error_response(error) render json: error, serializer:...
27.933333
72
0.799523
7964e79ea6afce5b30b6f9b1e89a87aa4ae7cb3d
363
class String def to_state to_s == 'open' ? :open : :closed end def to_status to_s == 'open' ? :open : :completed end end class Things::Todo def number name.scan(/\[\#([0-9]+)\]/).first end end class APICache class << self def store # :nodoc: @store ||= begin APICache::Memo...
14.52
39
0.567493
39b1cbdfdac1a13323d63d9e1372f8d36a73544c
203
module MailOptOut class List < ApplicationRecord validates :name, presence: true validates_uniqueness_of :name, case_sensitive: false scope :active, -> { where(published: true) } end end
25.375
56
0.729064
87b84f9442335ac59a7fa7df8869308a98b7ec83
5,762
module SugarCRM # Associations are middlemen between the object that holds the association, known as the @owner, # and the actual associated object, known as the @target. Methods are added to the @owner that # allow access to the association collection, and are held in @proxy_methods. The cardinality # ...
37.415584
115
0.654807
e8775e681f7ad7e5267b8af90cf61992a5a9ab91
5,448
## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class Metasploit3 < Msf::Auxiliary # Exploit mixins should be called first include Msf::Exploit::Remote::SMB::Client include Msf::Exploit::Remote::SMB::C...
26.318841
132
0.576542
bb7262850371f4a78969291d02f03aaf0cf08fd7
1,362
# -*- encoding: utf-8 -*- # stub: em-websocket 0.5.2 ruby lib Gem::Specification.new do |s| s.name = "em-websocket".freeze s.version = "0.5.2" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Ilya Gr...
37.833333
112
0.674743
bfae5d84c02cd462ce32c86f9539f10de9eba102
2,176
# 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{inflectious} s.version = "0.2.4" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_ru...
31.536232
143
0.638327
039aff850420093212acc8ee323d0976939244b3
4,615
module Pantry # The Pantry Server. class Server include Celluloid finalizer :shutdown attr_accessor :identity attr_reader :client_registry def initialize(network_stack_class = Communication::Server) @commands = CommandHandler.new(self, Pantry.server_commands) @identity = current_...
34.699248
116
0.709209
7afe176fca2aa120cadf1d9f5e3e9e46cea1ea0d
4,446
# encoding: utf-8 module I18n module Tests module Localization module Time def setup super setup_time_translations @time = ::Time.utc(2008, 3, 1, 6, 0) @other_time = ::Time.utc(2008, 3, 1, 18, 0) end test "localize Time: given the short forma...
42.75
142
0.582321
e99873066eb66a01bf432d8a05bc307107a5250b
956
describe :hash_iteration_no_block, :shared => true do before(:each) do @hsh = new_hash(1 => 2, 3 => 4, 5 => 6) @empty = new_hash ruby_version_is "" ... "1.8.7", -> it "raises a LocalJumpError when called on a non-empty hash without a block", -> lambda { @hsh.send(@method) }.should raise_error(Loc...
39.833333
89
0.680962
3381c815dea90aa1c01d680e5c4b655d2da571e5
227
require 'auto_build/builder' require 'auto_build/has_one_hook' require 'auto_build/has_many_hook' require 'auto_build/association' require 'auto_build/version' module AutoBuild class AutoBuildError < StandardError; end end
20.636364
43
0.828194
38a11617050c4480bf4764517198c6d9269ffbad
524
# frozen_string_literal: true module Hyrax module Ability module CollectionTypeAbility def collection_type_abilities if admin? can :manage, CollectionType can :create_collection_type, CollectionType else can :create_collection_of_type, CollectionType do |collect...
29.111111
139
0.700382
01cea935a23926705b55d26af6b30ea3337e6bfd
138
# -*- coding: binary -*- # Post-exploitation clients require 'rex/post/meterpreter' module Rex::Post end include Rex::Post::Permission
13.8
30
0.724638
284935cfec87e3650eb00bb02670ac0f8d30ab6f
3,827
class Metricbeat < Formula desc "Collect metrics from your systems and services" homepage "https://www.elastic.co/products/beats/metricbeat" url "https://github.com/elastic/beats.git", :tag => "v6.8.1", :revision => "6e16f47450373f04d6a60db1d23c5b13b37f7431" head "https://github.com/elastic/bea...
32.159664
141
0.658479
62f4b92b55b8ea434d4a4bcee2fca6cb2788685e
6,483
class Pipenv < Formula include Language::Python::Virtualenv desc "Python dependency management tool" homepage "https://docs.pipenv.org/" url "https://files.pythonhosted.org/packages/b5/3f/80a09ea5f279e90122600d24cfa25d698008dc7e5b261cb582de8966bbe2/pipenv-8.3.2.tar.gz" sha256 "20be245ad2a7908a04b302e9568ee26...
47.321168
164
0.799784
ff0116b5dbc0956c9f9f926de176caf35716f089
3,613
class Icecream < Formula desc "Distributed compiler with a central scheduler to share build load" homepage "https://en.opensuse.org/Icecream" url "https://github.com/icecc/icecream/archive/1.3.1.tar.gz" sha256 "9f45510fb2251d818baebcff19051c1cf059e48c6b830fb064a8379480159b9d" license "GPL-2.0" bottle do ...
27.580153
108
0.597564
f789359d74fb6e47b53dc460bd8f8be619888cb5
689
cask 'font-sarasa-gothic' do version '0.10.0' sha256 '5f101908073e5f19ef95d5216f4dfd71e7adbb8e206260dbc4b5a4a041adc12c' url "https://github.com/be5invis/Sarasa-Gothic/releases/download/v#{version}/sarasa-gothic-ttc-#{version}.7z" appcast 'https://github.com/be5invis/Sarasa-Gothic/releases.atom' name 'Sarasa ...
32.809524
111
0.759071
4a5802303707dabbaf228fe389381997273b0bce
1,139
# 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 Gem::Specification.new do |spec| spec.name = 'aws-sdk-codebuild' spec.version = File.read(Fi...
37.966667
110
0.661106
61fe81ee544b4d2a7059807682cfd3cde1c6c39f
146
# frozen_string_literal: true class AddPeopleNumberOfLegs < ActiveRecord::Migration::Current add_column :people, :number_of_legs, :integer end
24.333333
62
0.815068
91defe6d64295c65b4847c9fa4f95d62e02137c3
658
# # Copyright 2017 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...
32.9
74
0.761398
28068700ba2cfa56e4b70547cb784de1b4f908bc
1,282
{ matrix_id: '1748', name: 'p05', group: 'Meszaros', description: 'linear programming problem, C. Meszaros test set', author: '', editor: 'C. Meszaros', date: '2004', kind: 'linear programming problem', problem_2D_or_3D: '0', num_rows: '5090', num_cols: '9590', nonzeros: ...
29.136364
81
0.642746
3830443d4c5e00e9af22b3d58e5f2033a1183b0c
4,817
# # Copyright (c) 2015, Arista Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # Redistributions of source code must retain the above copyright notice, # this list of conditio...
28.335294
83
0.647706
1cb3066700ff388007aad601cb8f430f343859a8
968
module Mutations class SignInUser < BaseMutation null true argument :email, Types::AuthProviderEmailInput, required: false field :token, String, null: true field :user, Types::UserType, null: true def resolve(email: nil) # basic validation return unless email user = User.find...
30.25
115
0.68595
1cc75bc08db50b45cf8a3838fe74b517ab47b7e0
1,118
class Libstxxl < Formula desc "C++ implementation of STL for extra large data sets" homepage "https://stxxl.sourceforge.io/" url "https://downloads.sourceforge.net/project/stxxl/stxxl/1.4.1/stxxl-1.4.1.tar.gz" sha256 "92789d60cd6eca5c37536235eefae06ad3714781ab5e7eec7794b1c10ace67ac" bottle do rebuild 1 ...
44.72
139
0.783542
91c7a7301d19911022770b0b4a7c9adf6aa331c0
2,002
module Codesake module Dawn module Kb class CVE_2013_1655_a include DependencyCheck def initialize message = "CVE-2013-1655: puppet versions 2.7.21 and 3.1.1 are vulnerable" super({ :name=>"CVE-2013-1655_a", :kind=>Codesake::Dawn::KnowledgeBase::DEPEN...
29.441176
123
0.545954
acf6b2d45155ef1acae0020e8c9931a56eed8847
1,121
class RenderTarget attr_accessor :x, :y, :w, :h, :r, :g, :b, :a, :source_x, :source_y, :source_w, :source_h def initialize(name, size: nil, **values) @name = name @size = size @clear = true @queued_primitives = [] values.each do |attr, value| send("#{attr}=", value) end self.w ||=...
22.877551
102
0.615522
9110121004228a74fc6760cedd2be21467812f5a
1,004
require_relative 'adapters/sequel' require_relative 'adapters/files' # require_relative 'adapters/puresql' # require_relative 'adapters/datamapper' module SeoApp # Storage interface class Storage class << self; attr_accessor :database end ## ## @brief Returns all report's name, date and key's to...
20.08
77
0.598606
61e95c5d3c5d5ed12c5bf1943f29c9c99357551b
941
require 'dm-core' require 'dm-transactions' require 'dm-validations' require 'friendly_id/datamapper_adapter/configuration' require 'friendly_id/datamapper_adapter/slug' require 'friendly_id/datamapper_adapter/simple_model' require 'friendly_id/datamapper_adapter/slugged_model' # require 'friendly_id/datamapper_adapter...
26.885714
68
0.777896
7a1a09ae24b386373c52531dc2f0678bb12bae21
8,471
# # Author:: Lamont Granquist (<lamont@chef.io>) # Copyright:: Copyright 2014-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 ...
35.894068
131
0.641837
0871cafd5afc0b090877eb548cb54c7f7181adc7
322
json.array!(@wardrobes) do |wardrobe| json.extract! wardrobe, :id, :chosen, :recommended json.clothing do json.name wardrobe.clothe.name json.id wardrobe.clothe.id json.attrs do json.array!(wardrobe.clothe.attrs) do |attr| json.extract! attr, :name, :func, :value end end end en...
24.769231
52
0.661491
39def5cff9c236ad17a094b73e4bf845987f43ca
2,179
require 'jquery-rails' require 'jquery-ui-rails' require 'kaminari' require 'nested_form' require 'rack-pjax' require 'rails' require 'rails_admin' require 'remotipart' module RailsAdmin class Engine < Rails::Engine isolate_namespace RailsAdmin config.action_dispatch.rescue_responses['RailsAdmin::ActionNotA...
31.57971
179
0.679211
e9fd7fc6ac4ceffb2dac8994f649c78b5a8cec45
326
$value_generators << ScriptedColumnValueGenerator.new("Family Count") do |nuix_case,query| modified_query = "(#{query}) AND has-exclusion:0" items = nuix_case.search(modified_query) family_items = $utilities.getItemUtility.findFamilies(items) family_items = family_items.reject{|i|i.isExcluded} next family_items.si...
46.571429
90
0.797546
1de7fbea82d1c9c7bacdd96c30c8930d6bedf5f3
273
TagTextType = GraphqlCrudOperations.define_default_type do name 'TagText' description 'Tag text type' interfaces [NodeIdentification.interface] field :dbid, types.Int field :text, types.String field :tags_count, types.Int field :teamwide, types.Boolean end
22.75
58
0.772894
ffa65fdc90eafee6940e7f80e590e10be8aa0398
36,742
require 'test_helper' class AuthorizeNetTest < Test::Unit::TestCase include CommStub def setup @gateway = AuthorizeNetGateway.new( login: 'X', password: 'Y' ) @amount = 100 @credit_card = credit_card @check = check @options = { order_id: '1', billing_address: addr...
34.629595
182
0.656469
18664c32a749655417452daa432f72ec8532f86f
419,594
# frozen_string_literal: true # 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...
41.98039
229
0.647061
e288b3500459129420e2c2b24e95b9bf8e8dca31
2,036
require 'json' require 'morpheus/api' class MorpheusRole < Inspec.resource(1) name 'morpheus_role' desc 'Verifies settings for a morpheus role' example " describe morpheus_role(name: 'System Admin') do it { should exist } end " def initialize(opts) @opts = opts @display_name = @opts[...
19.960784
126
0.600196
91c79a1ddac30879a232969b274afd09398bc527
59
require 'spec_helper' describe FeaturesController do end
9.833333
30
0.830508
ac41d1d770bb09ed0eb8fd6cc491b6e871016a08
261
namespace :vasco do desc "Examines current routes and models and emits updated data for Explorer" task :explore => :environment do Vasco.write_json_data end task :preview => :environment do puts Vasco.create_vasco_json_data end end
20.076923
79
0.720307
f8ca70385e1ed3a3ee33ba23d5ba1d54095c0720
39,108
# frozen_string_literal: true # -*- ruby -*- #-- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. # All rights reserved. # See LICENSE.txt for permissions. #++ require 'rbconfig' module Gem VERSION = "3.1.6".freeze end # Must be first since it unloads the prelude from 1.9.2 require 'rubygems/c...
27.008287
132
0.679145
624e7bc2712331c3b596319e571d4dca130bdbf8
664
require_relative '../../app/models/list' require_relative '../../app/models/item' module Todoable RSpec.describe 'List SQL associations', :db do let(:goals) { List.create(name: 'Life Goals', user_id: 1) } let(:yosemite) { Item.new(name: 'Yosemite') } let(:grand_canyon) { Item.new(name: 'Grand Canyon') } ...
31.619048
63
0.658133
bbc235bb859a951590d50f0fefe4601f9accb990
3,119
module Trizetto module Api module Eligibility module WebService # A Patient is either a Subscriber or Depedent. This is the common # attributes between the two class Patient < Node prepend Rejectable # @see PatientName attr_accessor :name #...
31.505051
111
0.556909
7ad0e61bcf87805d99e48b441c93e9dcb51a18d3
870
require 'pathname' class Symlink def self.all Dir['**/*.symlink'].map { |path| new(path) } end attr_reader :source_pathname def initialize(source_path) @source_pathname = Pathname.new(source_path).realpath end def create print "#{source_pathname} -> #{destination_pathname} " if destinat...
18.913043
58
0.677011
1a9f891dded80b0673dbca249dfb9c1bb04a3c03
12,759
require 'singleton' require 'pathname' class SpecConfig include Singleton # NB: constructor should not do I/O as SpecConfig may be used by tests # only loading the lite spec helper. Do I/O eagerly in accessor methods. def initialize @uri_options = {} if ENV['MONGODB_URI'] @mongodb_uri = Mongo::U...
25.017647
119
0.656713
e997ad8204a7fa55772e279b44b54e8a52eab48a
1,130
class ReportsController < ApplicationController before_action :set_report, only: [:show, :update, :destroy] # GET /reports def index player = Player.find(params['player_id']) @reports = player.reports render json: @reports end # GET /reports/1 def show render json: @report end # POST...
20.545455
73
0.669912
33f5a203af1e32ddb1ae5c4cdfcfc8261149e321
15,335
# Code Review plugin for Redmine # Copyright (C) 2009-2013 Haruyuki Iida # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later versio...
38.433584
213
0.663384
6ab9400464c79f592db76d472b8ab769afcc970a
1,968
module VCAP::CloudController class SyslogDrainUrlsController < RestController::BaseController # Endpoint does its own basic auth allow_unauthenticated_access authenticate_basic_auth('/v2/syslog_drain_urls') do [VCAP::CloudController::Config.config[:bulk_api][:auth_user], VCAP::CloudControlle...
32.8
108
0.597561
08e40e64e3edd68c9ee18b0fda013433debd4147
3,173
#!/usr/bin/env ruby require 'gitlab' def client @client ||= Gitlab.client end def devops_group unless @devops_group begin @devops_group = client.create_group('devops', 'devops') rescue Gitlab::Error::BadRequest => e if e.response_status == 400 @devops_group = client.group('devops') ...
26.663866
90
0.655846
91336e083ecb7cae8a79f968e4a5e9f460e0bc4f
581
require 'dropbox_api' require File.expand_path('../dropbox_scaffold_builder', __FILE__) namespace :test do # Example: `rake test:build_scaffold[get_metadata]` desc "Regenerates the scaffolding required to test the given endpoint" task :build_scaffold, [:endpoint] => [:show_account_warning] do |t, args| puts ...
32.277778
75
0.738382
334e1e442f5d83ff4288a7d22621f5f71051a5e2
2,055
class Cumulus < Oxidized::Model prompt /^((\w*)@(.*)):/ comment '# ' # add a comment in the final conf def add_comment comment "\n###### #{comment} ######\n" end cmd :all do |cfg| cfg.each_line.to_a[1..-2].join end # show the persistent configuration pre do cfg = add_comment 'THE HOSTNA...
23.089888
70
0.602433
abcd607f4a74032a79315008cae2ed91d68591ca
1,899
# frozen_string_literal: true module DmphubMocks BASE_API_URL = 'https://api.test.dmphub.org/' ERROR_RESPONSE = File.read( Rails.root.join('spec', 'support', 'mocks', 'dmphub', 'error.json') ).freeze SUCCESS_RESPONSE = File.read( Rails.root.join('spec', 'support', 'mocks', 'dmphub', 'success.json') ...
30.629032
80
0.704055
335ced9a4be85ecbeba62250afe08df0b2b218bc
1,078
# frozen_string_literal: true module Hyrax module Test ## # A simple Hyrax::Resource with some metadata. # # Use this for testing valkyrie models generically, with Hyrax assumptions # but no PCDM modelling behavior. class BookResource < Hyrax::Resource attribute :author, Valkyrie::Type...
38.5
83
0.669759
61eaef953b11403e81ec7d134c1e71f9b1fc2266
1,664
# 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...
34.666667
100
0.680889
d59b60540e35137d8394ecde2f0f45f6f2a37e27
11,499
# frozen_string_literal: true require 'spec_helper' describe Gitlab::Client do it { is_expected.to respond_to :repo_commits } it { is_expected.to respond_to :repo_commit } it { is_expected.to respond_to :repo_commit_diff } it { is_expected.to respond_to :repo_commit_comments } it { is_expected.to respond_to...
38.717172
155
0.705801
6a9b476f31d7bdfc359cec3b8894b846cecbf08b
1,715
class Xmrig < Formula desc "Monero (XMR) CPU miner" homepage "https://github.com/xmrig/xmrig" url "https://github.com/xmrig/xmrig/archive/v6.5.2.tar.gz" sha256 "6cb24c2f38d33d63b0526cee53debffb0d7969af305c89949bc2505cc10b2416" license "GPL-3.0-or-later" head "https://github.com/xmrig/xmrig.git" livecheck...
31.181818
93
0.669388
f797ae4f30e628f3e05eb848422a71a4d6533dfd
7,808
# frozen_string_literal: true require "spec_helper" module PracticeTerraforming module Resource describe S3 do let(:buckets) do [ { creation_date: Time.parse("2014-01-01T12:12:12.000Z"), name: "hoge" }, { creation_date: Time.parse("...
43.865169
335
0.303407
4adaa3afa2937d6083975472e7b1281e5eed5877
1,136
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'magician/version' Gem::Specification.new do |spec| spec.name = "magician" spec.version = Magician::VERSION spec.authors = ["Nicolas McCurdy"] spec.email = ["t...
39.172414
80
0.672535
261e10e300c262440815d13cc2b41df9995fcd57
2,036
module GapIntelligence # @see https://api.gapintelligence.com/api/doc/v1/promo_matrix.html module PromoMatrix # Requests and returns a list of products # # @param params [Hash] parameters of the http request # @param options [Hash] the options to make the request with # @yield [req] The Faraday ...
49.658537
100
0.727898
38ae1a6f00654ad55c8daab9689de28c3b093197
229
require 'spec_helper' describe 'security_baseline::rules::sec_squashfs' do on_supported_os.each do |os, os_facts| context "on #{os}" do let(:facts) { os_facts } it { is_expected.to compile } end end end
19.083333
52
0.668122
1c09bbd5989ed4901774989f35a14e6c88520399
65
namespace :admin do |admin| admin.resources :jskit_ratings end
16.25
32
0.784615
ab0da36435aaddd1f3fbc7fc5ac3d5922d157129
820
module ID3Tag module Frames module V2 class GenreFrame < TextFrame class MissingGenreParser < StandardError; end def genres @genres ||= get_genres end alias text_frame_content content private :text_frame_content def content genres.join(...
20.5
106
0.57439
111dfb239410fc26ed4e18427d446389a22ef402
3,906
# Copyright 2017 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
37.557692
91
0.716078
bff66e0cef7e63dae32ce6e005233b08f0950d73
1,398
# frozen_string_literal: true require "rom/relation" RSpec.describe ROM::Relation, "#map_with" do subject(:relation) do ROM::Relation.new( dataset, name: ROM::Relation::Name[:users], schema: schema, mappers: mapper_registry ) end let(:mapper_registry) { ROM::MapperRegistry.build...
24.526316
92
0.622318
2124c8e914e84d0f38b6c63ad571501ee4dece16
201
class AddAdditionalAttributesToDatasetExtra < ActiveRecord::Migration def change add_column :dataset_extras, :searchable_attributes, :text add_column :dataset_extras, :orbit, :text end end
28.714286
69
0.79602
4a98a0915132510faa9d788c41c188fcf955277a
283
module NumberHelper def to_currency(i) options = {} options[:unit] = ENV['FRAB_CURRENCY_UNIT'] unless ENV['FRAB_CURRENCY_UNIT'].nil? options[:format] = ENV['FRAB_CURRENCY_FORMAT'] unless ENV['FRAB_CURRENCY_FORMAT'].nil? number_to_currency i, options end end
28.3
90
0.713781
01245329d369d536e631037df704d1c0b6bb17f2
75
json.partial! "api/v1/ppg_measures/ppg_measure", ppg_measure: @ppg_measure
37.5
74
0.813333
793190fbe1fb229a982c13f2f582687a2939b777
4,552
# frozen_string_literal: true require_relative '../base' require_relative '../share_buying' require_relative '../../action/buy_company.rb' require_relative '../../action/buy_shares' require_relative '../../action/par' module Engine module Step module G1860 class BuySellParShares < BuySellParShares ...
28.993631
111
0.592487
2838809ab6cfbc4a6a3527e1469492aa8c3ae0d4
303
module Travis::API::V3 class Renderer::Cron < ModelRenderer representation(:minimal, :id) representation(:standard, :id, :repository, :branch, :interval, :dont_run_if_recent_build_exists, :last_run, :next_run, :created_at) def repository model.branch.repository end end end
25.25
136
0.719472
034320900461ddc0fbae17d2abcd581b9597e4bf
78
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'myGemObi'
26
58
0.730769
bf69046fac11609b0e7809f9bbc037459eb72545
1,750
# -*- encoding: utf-8 -*- # stub: sass-rails 5.1.0 ruby lib Gem::Specification.new do |s| s.name = "sass-rails".freeze s.version = "5.1.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["wycats".fre...
41.666667
112
0.656571
876dbd259eb923fe418518d7b5001e104e041f6a
359
module Skale class Node < Common::Resource field :id field :name, type: :string field :public_ip field :start_block, type: :integer field :last_reward_date, type: :timestamp field :next_reward_date, type: :timestamp field :validator_id, type: :integer field :status, type: :string f...
25.642857
45
0.685237
ab5b7b642276f935ec9d9ef7abd266b2bfcc0132
1,752
# frozen_string_literal: true # The MIT License (MIT) # # Copyright <YEAR> <COPYRIGHT HOLDER> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitat...
41.714286
79
0.781963
79bf7339c5bb1a04f7b747a6c6081b9abc7a5b07
13,003
module ViewModel module SapSchema112 class CommonSchema < ViewModel::DomesticEpcViewModel def assessment_id xpath(%w[RRN]) end def address_line1 xpath(%w[Property Address Address-Line-1]) end def address_line2 xpath(%w[Property Address Address-Line-2]).to_s ...
25.546169
141
0.61978
791485b4fcfdacd5af2e703022157780ee3f78b5
189
class Product::ClassifiedAdvertisement::Candidature < ::Candidature protected def validate_resource_id? resource_type == 'User' || vacancy.resource_type == 'User' end end
27
68
0.719577
8719815dc5db820fdb40e11239a19af94bdfce2f
922
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Cocina --> MODS mappings for note' do describe 'Abstract' do it_behaves_like 'cocina MODS mapping' do let(:cocina) do { note: [ { type: 'abstract', value: 'My paper is about dolph...
20.043478
83
0.505423
384b765f1559f43de006b8ae09a5aab469447d47
569
# 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: 'Lord of the Rings' }]) # Ch...
37.933333
111
0.72935
5df2f0ba73dfd3a021bf4863599c7fbd567d3dd7
7,392
#encoding:utf-8 require 'rails_helper' RSpec.shared_examples "redirect to edit_user_path" do let(:action) { nil } let(:anchor) { nil } context "when user is logged" do let(:current_user) { create(:user) } before do allow(controller).to receive(:current_user).and_return(current_user) get act...
29.450199
213
0.656791
263c2762fa37d796f4a9c2daf523b7ceb9ce507a
312
cask 'todour' do version '2.14' sha256 '7f86aebc70f8ad8135bfe27be2d78b702e3bcf791f6aa1602c169e6b749c0fee' url "http://nerdur.com/Todour-#{version}.dmg" appcast 'https://github.com/SverrirValgeirsson/Todour/releases.atom' name 'Todour' homepage 'http://nerdur.com/todour-pl/' app 'Todour.app' end
26
75
0.753205
e9f3ad82654f7b36ce8c43e6e32404664a56ece4
1,054
# frozen_string_literal: true ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require 'mocha/test_unit' module ActiveSupport class TestCase # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. fixtures :all ...
34
84
0.648956
5df247abcdbd373c3901ce25b232a527699f02ff
4,957
require 'set' module Audited # Audit saves the changes to ActiveRecord models. It has the following attributes: # # * <tt>auditable</tt>: the ActiveRecord model that was changed # * <tt>user</tt>: the user that performed the change; a string or an ActiveRecord model # * <tt>action</tt>: one of create, updat...
33.952055
128
0.669356
08d44c3b5a709d3930d818b1b3d9239713cc323e
201
class CreateLists < ActiveRecord::Migration[6.0] def change create_table :lists do |t| t.string :name t.string :content t.integer :user_id t.timestamps end end end
18.272727
48
0.636816
08b1bead647dc0ae6c7c1e4bfe730a317412648c
5,664
module Steep module Drivers class Watch class Options attr_accessor :fallback_any_is_error attr_accessor :allow_missing_definitions def initialize self.fallback_any_is_error = false self.allow_missing_definitions = true end end attr_reader :s...
29.968254
118
0.538489
332793a1f7b0f6e42c9f76eb18e18dc7789970fe
2,039
class UsersController < ApplicationController # Only when :edit, :update, Execute :logged_in_user, which require user to be logged in. before_action :logged_in_user, only: [:index, :edit, :update, :destroy, :following, :followers] before_action :correct_user, only: [:edit, :update] before_action :admin_user, on...
24.27381
98
0.660618
3990a04c7c12319deca70a57286605af943eea1d
833
require "spec_helper" describe JsonSpec::Matchers::HaveJsonPath do it "matches hash keys" do %({"one":{"two":{"three":4}}}).should have_json_path("one/two/three") end it "doesn't match values" do %({"one":{"two":{"three":4}}}).should_not have_json_path("one/two/three/4") end it "matches array index...
27.766667
79
0.641056
338ea21d3e0cf721f3a234df351a408bb717a2f0
4,517
module Gendered describe Name do let :value do "Sean" end subject do described_class.new value end it "initializes with a value" do expect(subject.value).to eq value end describe "#to_s" do it "converts with its value" do expect(subject.to_s).to eq subje...
26.570588
84
0.601948
21304b30dd7a5a4cee5009a9cac28d5188f79294
1,183
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'serverspec/version' Gem::Specification.new do |spec| spec.name = "serverspec" spec.version = Serverspec::VERSION spec.authors = ["Gosuke Miyashita"] spec.email ...
40.793103
99
0.687236
e9acebd7e9415b4ed10149c703b4bcf743e2c49a
799
# -*- coding: binary -*- require 'msf/core' module Msf::Payload::Python # # Encode the given python command in base64 and wrap it with a stub # that will decode and execute it on the fly. The code will be condensed to # one line and compatible with all Python versions supported by the Python # Meterpreter s...
30.730769
133
0.709637
1a2fd04d307c21d507ba84a3f9f5204aed9760fc
107
module WelcomeEmailComponent module Controls ID = Identifier::UUID::Controls::Incrementing end end
17.833333
49
0.775701
e903ad57b2bce0c4bc010fd16d24053dfa246af9
3,023
# frozen_string_literal: true require "support/vacols_database_cleaner" describe "BVA Decision Progress report", :all_dbs do include SQLHelpers context "one row for each category" do let(:expected_report) do [ { "decision_status" => "1. Not distributed", "num" => 1 }, { "decision_status...
35.151163
111
0.625538
089534e2247e46f21025ccb0f417b7100b79f2aa
1,365
class Convox < Formula desc "Command-line interface for the Rack PaaS on AWS" homepage "https://convox.com/" url "https://github.com/convox/rack/archive/20190808190811.tar.gz" sha256 "f2c6f4dadea44dd79714e4e8d34993a7010607c4cd3284f5ae23d10014ffaead" bottle do cellar :any_skip_relocation sha256 "e6f8e...
33.292683
94
0.738462
265cd5d628b5f203eb0130b2055b6ee151efad52
287
cask 'kubernetes-cli-1.12.1' do version '1.12.1' sha256 '406949fbf4c319a7b723ac98d3785266ee50a94b368dc386abad947052e58232' url "https://dl.k8s.io/v#{version}/kubernetes-client-darwin-amd64.tar.gz" name 'Kubernetes Client' homepage 'https://kubernetes.io/' end
31.888889
77
0.721254
0162eeba1d70c5f80715225b67cc2a57d91fe477
579
module DevisePermittedParams extend ActiveSupport::Concern included do before_action :configure_devise_permitted_parameters, if: :devise_controller? end def configure_devise_permitted_parameters edit_user_params = [:first_name, :last_name, :description, :city_id, :photo, :identity_card, :specialties, ...
36.1875
133
0.753022
f8f189adf2e8d82486b512d4bd88fd56d29131f2
717
Given /^the fixture file "(.*?)"$/ do |filename| @input = fixture_file(filename) @filename = filename end Given /^I put them through the kernel$/ do @output = "output_#{rand(1000)}_#{@filename}" kernel(@input, tmp_file(@output)).classify end Then /^the output should match the fixture "(.*?)"$/ do |filename| ...
27.576923
72
0.698745
b90333fd981b26b9ac0bb03fa05ac589b10eb592
516
class OrganizationMemberPaymentsController < ApplicationController before_filter :load_organization_member authorize_resource :organization_member def edit end def update end def load_organization_member logger.debug("ABC") @organization_member = OrganizationMember.where(:payment_code ...
24.571429
119
0.75969
5da06fe1c25a89843cab8360942c2ad31942e009
237
# frozen_string_literal: true module HykuAddons class QualificationNameService < HykuAddons::QaSelectService def initialize(model: nil, locale: nil) super("qualification_name", model: model, locale: locale) end end end
26.333333
63
0.755274