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
e2973a8ccc6cda1c8089f855e10bb0357531b03c
2,468
module Cinch module Plugin module ClassMethods def enable_acl(lvl= :nobody, secure_chan=false) hook(:pre, :for => [:match], :method => lambda { |m| check?(m,lvl,secure_chan) }) end end Spam = Struct.new(:nick, :time) def check?(m, lvl, secure_chan) # Make sure we are actua...
25.978947
89
0.549838
33c9094c5a9b32d3cb56064fc8df39b02ff49334
696
require 'rspec/expectations' RSpec::Matchers.define :be_a_json_attribute do match do |attribute| expect(attribute).to have_key 'type' expect(attribute['type']).to eq @type if @type.present? expect(attribute['example']).to eq @example if @example.present? true end chain :with_type do |type| ...
24.857143
99
0.672414
e97fc36c4391d5ae939136ebb08826532819ff3f
593
# frozen_string_literal: true class Peatio::Transaction alias_attribute :id, :hash alias_attribute :txid, :hash attr_accessor :contract_address, :fee, :fee_currency_id, :blockchain_id, :to, :from, :topic # %w[success pending failed rejected].freeze def status=(s) raise "Unknown status #{s}" unless STAT...
23.72
93
0.721754
bb4c309ffe13a590c3c235ea50cde90a118346c0
9,434
=begin #Xero Assets API #This is the Xero Assets API The version of the OpenAPI document: 2.1.3 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.0 =end require 'time' require 'date' module XeroRuby::Assets class AssetType # Xero generated unique identifier for...
33.81362
205
0.661013
ff438aca7b1bd7a2c70b6996310af9eff2b996bf
1,463
# frozen_string_literal: true lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) begin require "pry-byebug" rescue LoadError end class MSpecScript # Language features specs set :language, %w[spec/language] # Core library specs set :core, %w[spec/core] # I...
26.6
116
0.717703
acd416d1527c901f496cab74ba28c1128ff114ff
1,002
# # Copyright 2016 Chef Software, 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...
27.833333
74
0.749501
e90a41926dbb7a022dc38b5ee4b15581b2081001
1,402
class Composer < Formula desc "Dependency Manager for PHP" homepage "https://getcomposer.org/" url "https://getcomposer.org/download/2.0.3/composer.phar" sha256 "5d377e9b504dc9f6c9228d81c321ba85290512cdb396a12d3708b0cd30d2e20c" license "MIT" livecheck do url "https://github.com/composer/composer.git" ...
21.242424
75
0.566334
0112346867da30fbd5c77a75558fcb3b97dbd7e4
23,413
# 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,...
60.187661
212
0.678854
38ce8e861dce22d9f2566f47297a1e094a22ed81
91
module RecordersHelper def vendor_exists(vendor) return vendor ? vendor.id : "" end end
18.2
32
0.758242
1109eaa9a5654e8ed53b60887e5a6f6dd268fc38
43
module OsslCryptor VERSION = "0.5.0" end
10.75
19
0.697674
bb38b1a6a9ade8893ef8b852a37563dad661abc1
3,023
# frozen_string_literal: true require "rails_helper" describe PreferencesController, type: :controller do let (:user) { FactoryBot.create :admin } let! (:preference) { Preference.create!(key: "key", value: "value", user: user) } before(:each) do login_user user end describe "#index" do before { g...
32.159574
92
0.588488
e277f8fbfdb174aef71f1bbcc65d7d4b233116f6
2,667
# == Schema Information # # Table name: users # # id :integer not null, primary key # login :string # identity_url :string # name :string # admin :boolean default(FALSE) # bio :text # signature ...
32.52439
114
0.540682
62104dbf32e86da2f8d4f27d0aa27588856cce57
2,061
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.name = "" assert_not...
26.423077
120
0.729743
795cd76068ebad639fa1d5d89f2c69ebfef4a221
49
json.partial! "pantries/pantry", pantry: @pantry
24.5
48
0.755102
3826f696c0434cb055249748207d6a59c78746be
308
# Don't forget! This file needs to be 'required' in its spec file # See README.md for instructions on how to do this def fizzbuzz(num) result = "" if num % 3 == 0 result = "Fizz" end if num % 5 == 0 result += "Buzz" end if result.length < 4 return nil end result end
15.4
65
0.594156
3811a02a7fd3fde2a4d48fc1f19d3979595c1ee2
1,999
# frozen_string_literal: true require 'spec_helper' RSpec.describe BulkImports::Pipeline do describe 'pipeline attributes' do before do stub_const('BulkImports::Extractor', Class.new) stub_const('BulkImports::Transformer', Class.new) stub_const('BulkImports::Loader', Class.new) klass = ...
34.465517
132
0.665333
ff04bffddcd69f5dc6831fe44efe57329414f8e1
2,725
# Copyright (C) 2013 VMware, Inc. require 'pathname' # WORK_AROUND #14073 and #7788 module_lib = Pathname.new(__FILE__).parent.parent.parent vmware_module = Puppet::Module.find('vmware_lib', Puppet[:environment].to_s) require File.join vmware_module.path, 'lib/puppet_x/vmware/util' require File.join module_lib, 'puppe...
28.989362
98
0.644037
e89cf6105d1cab08cbe9df83657ca1749914900e
836
Pod::Spec.new do |s| s.name = "QIMCommonCategories" s.version = "3.0.2" s.summary = "Qunar chat App 6.0+ version QIMCommonCategories" s.description = <<-DESC Qunar QIMCommonCategories解决方案 DESC s.homepage = "https://im.qunar.com" s.license ...
29.857143
115
0.601675
87abbeafb1d0663cad0d4251488a1029c709e25f
1,346
# frozen_string_literal: true class ReactionService def self.remove_reactions(message:, emoji: nil) unless emoji message.delete_all_reactions return end name = emoji_name(emoji) message.reactions.each_value do |reaction| next unless reaction.name == name reaction_string = r...
18.957746
51
0.615156
215126e7ed17a45acb365cf59d13b4341163985d
707
require 'spec_helper' describe 'should_see_text', type: :feature do before(:all) do TestApp.body = <<-BODY <h1 class="title">Hello World</h1> <div class="container"> <div>Content</div> </div> BODY end Drivers::ALL.each do |driver| context driver, driver: driver do i...
19.638889
57
0.605375
ab537a6105867c758727e28d99f64b6f60456893
31,958
# frozen_string_literal: true require 'spec_helper' RSpec.describe API::NugetPackages do include WorkhorseHelpers include PackagesManagerApiSpecHelpers include HttpBasicAuthHelpers let_it_be(:user) { create(:user) } let_it_be(:project, reload: true) { create(:project, :public) } let_it_be(:personal_access...
61.222222
143
0.617686
b9fb5f415b7491b5145d51168accd4d1d2c9680d
4,658
require "spec_helper" MetricFu.formatter_require { "html" } describe MetricFu::Formatter::HTML do before do setup_fs # TODO: Use mock metrics? # Right now, have to select from metrics # based on platform, resulting in slow specs # for some platforms. config = MetricFu.configuration if co...
33.035461
99
0.661228
b9fca34105d3f9b4ef39a88b9c05e5937a513323
12,450
# frozen_string_literal: true # Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render inv...
48.44358
152
0.749639
9190a18c5f9445848df38ecfdc02842ab735cde6
2,727
require_relative '../../gp/inflections' require_relative '../../gp/rails_autoloading' module RuboCop module Cop module Gp # This cop checks for a constant assigned in a file that does not match its owning scope. # The Rails autoloader can't find such a constant, but sometimes # people "get luck...
36.36
97
0.622662
5d6a7c7e2f74a90a7bc74646250d5ad2bb2b3edc
1,420
# Please only update to versions that are published on PyPi as there are too # many releases for us to update to every single one: # https://pypi.python.org/pypi/youtube_dl class YoutubeDl < Formula desc "Download YouTube videos from the command-line" homepage "https://rg3.github.io/youtube-dl/" url "https://yt-d...
34.634146
92
0.747183
33d188735e8351ad444399871b0ba8c8554f1bf0
3,169
# # Copyright 2011-2013, Dell # Copyright 2013-2014, SUSE LINUX Products GmbH # # 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 requi...
21.126667
74
0.637109
ed9658ed4e2bff72a4ecf34d68ae563fce3f9762
10,050
# frozen-string-literal: true module Sequel module Plugins # The dirty plugin makes Sequel save the initial value of # a column when setting a new value for the column. This # makes it easier to see what changes were made to the object: # # artist.name # => 'Foo' # arti...
36.151079
101
0.588358
1dc41d41b8c9c46b5b4ef741398a76e21f143733
63,256
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Cosmosdb::Mgmt::V2020_04_01 # # Azure Cosmos DB Database Service Resource Provider REST API # class TableResources include MsRestA...
54.957428
223
0.714873
62771eed42a60295383b895508090029a7997dd5
80
class MusicUser < ActiveRecord::Base belongs_to :user belongs_to :music end
16
36
0.775
ff99988cb50f9a4a1334b095234871cfeace5f5a
4,859
# frozen_string_literal: true require "cases/helper" require "tempfile" module ActiveRecord class FixtureSet class FileTest < ActiveRecord::TestCase def test_open fh = File.open(::File.join(FIXTURES_ROOT, "accounts.yml")) assert_equal 6, fh.to_a.length end def test_open_with_b...
30.559748
78
0.560403
018fc9123954ebf9e40ba72559a6298b5c3199f8
1,707
#!/usr/bin/env ruby # # Copyright:: Copyright 2016, Google Inc. All Rights Reserved. # # License:: 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.ap...
30.482143
79
0.694786
017b790caaa5b0be95bd11ae040215173d9aa3a3
2,478
## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class MetasploitModule < Msf::Exploit::Remote Rank = GoodRanking include Msf::Exploit::Remote::Tcp def initialize(info = {}) super(update_info(info, ...
32.605263
94
0.556901
182f4917dde4821c591e1855deaf71b3c780d579
260
class Organizer::Base < ApplicationController private def current_organization if session[:organization_id] @current_organization ||= Organization.find_by(id: session[:organization_id]) end end helper_method :current_organization end
26
57
0.761538
f7184d1b7cb04c8fe970a446eb2a10c4d60261d9
288
class CreateStateUnits < ActiveRecord::Migration[5.1] def change create_table :state_units do |t| t.integer :budget_id t.integer :user_id t.integer :f_year t.float :rate t.string :position t.string :division t.timestamps end end end
19.2
53
0.642361
ff69a7976b3c9abfe07d9bca5586763f919be5d1
2,925
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...
36.5625
97
0.732308
1d214248aa40ad02e5cc0d092a8aecc3cf9c07fe
331
require 'equalizer' require 'twitter/base' module Twitter class Suggestion < Twitter::Base include Equalizer.new(:slug) attr_reader :name, :size, :slug # @return [Array<Twitter::User>] def users Array(@attrs[:users]).collect do |user| User.new(user) end end memoize :users...
18.388889
45
0.640483
bbada40418774a608ae4c46dfdd925f155a82fad
8,406
require 'spec_helper' RSpec.describe 'AwesomePrint' do describe 'Misc' do it 'handle weird objects that return nil on inspect' do weird = Class.new do def inspect nil end end expect(weird.new.ai(plain: true)).to eq('') end it 'handle frozen object.inspect' do...
34.032389
128
0.585415
39cd8728161b3f0e8517e29ac66af8fc9d4e60ef
1,925
raise "COINMUX_ENV not set" if ENV['COINMUX_ENV'].nil? require File.expand_path("../../lib/coinmux", __FILE__) module Cli end require 'optparse' require 'ostruct' options = OpenStruct.new OptionParser.new do |o| o.banner = "#{Coinmux::BANNER}\n\nUsage: coinmux [options]\n" o.separator "" o.on('-v', '--versio...
35.648148
139
0.675325
4a8d313806beba480beba4485218fa86a050d86c
252
#Refernces and method argumets def change_string(str) str.replace("string has been changed") end s=change_string("Original string") puts s #duping andd freezing objects s="string objec with dup" change_string(s.dup) puts s s.freeze change_string(s)
16.8
39
0.785714
8732f6a5586da0e480632554f4df76d67ae09675
740
require 'chefspec' describe 'bff_package::upgrade' do let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'aix', version: '7.1').converge(described_recipe) } it 'upgrades a bff_package with an explicit action' do expect(chef_run).to upgrade_bff_package('explicit_action') expect(chef_run).to_not upgrade_bf...
37
105
0.762162
d5969ca06bf68c0ea5eb3fc2a823db63faf68812
1,434
class Ucommon < Formula desc "GNU C++ runtime library for threads, sockets, and parsing" homepage "https://www.gnu.org/software/commoncpp/" url "https://ftp.gnu.org/gnu/commonc++/ucommon-7.0.0.tar.gz" sha256 "6ac9f76c2af010f97e916e4bae1cece341dc64ca28e3881ff4ddc3bc334060d7" bottle do sha256 "34ef3423a4f8...
40.971429
105
0.74198
6a876ce79a27846addf2bbdb4678f2efcbda4bab
2,413
# frozen_string_literal: true module Interactors class ChangeEventCourse include Interactors::Errors def self.perform!(args) new(args).perform! end def initialize(args) ArgsValidator.validate(params: args, required: [:event, :new_course], exclusive: [:event, :new_course], class: self.cl...
33.054795
156
0.699544
6a7783091c0977d5d5d07485d86b6c0de1404d0d
1,609
# frozen_string_literal: true module Git::Copilot::Configuration User = Struct.new(:username, :name, :email) class User def to_committer format "%{name} <%{email}>", name: name, email: email end def to_h { "name" => name, "email" => email, } end end protected...
21.453333
96
0.650715
e92c14ca5899ee78bd6b388231965afa9f4a8665
936
class SpeakerInvitation < ActiveRecord::Base belongs_to :event belongs_to :user before_create :generate_token after_create :send_notification validates :email, format: { with: URI::MailTo::EMAIL_REGEXP } validates_associated :event def generate_token source=("A".."Z").to_a + (0..9).to_a token_...
26
101
0.698718
268beb2e75a0dfccc874c7cdef94ac88977519fe
1,921
Pod::Spec.new do |spec| spec.name = 'shared' spec.version = '1.0' spec.homepage = 'https://ybonnetain.dev/blog-kotlin-multiplatform' spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" } spec...
42.688889
133
0.526809
034059a1046d6cd8d5ba589cd61c137894868806
1,235
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'mastermind/version' Gem::Specification.new do |spec| spec.name = "mastermind" spec.version = Mastermind::VERSION spec.authors = ["Lucas Medeiros Leite"] spec.email ...
36.323529
87
0.671255
e203f00872f636208245db8480bd52c546e0716a
653
require 'rspec' require 'k_items/day14' describe 'k items' do it 'has to filter one item from single item array' do expect(k_items([1], 1)).to eq([1]) end it 'has to filter one item from two items array larger is first' do expect(k_items([2, 1], 1)).to eq([2]) end it 'has to filter one item from tw...
26.12
72
0.652374
7aa5ef86aa264979ff700fae9ac8493711448947
295
# frozen_string_literal: true module API module V2 module Public class Mount < Grape::API before { set_ets_context! } mount Public::Currencies mount Public::Markets mount Public::MemberLevels mount Public::Tools end end end end
16.388889
35
0.620339
798d0b48e3cef509bec38c0890dc7ecb4ce881c6
47
module Twitch class Emote < Object end end
9.4
22
0.723404
1ccba8d09a4b0f7e3366b12a1bff8510312f72aa
1,233
# Represents an inbound request to a bot. Contains all relevant request information: # # * `user` - The user making the request. # * `message` - The original message object from the bot's platform. # * `action` - The name of the action requested. # * `intent` - The name of the intent requested. # * `parameters` - Any p...
34.25
84
0.688564
f7fb7f37c3d1ee88092fb1e7c32ccdcd914ad2c7
277
# frozen_string_literal: true describe 'etc/dropbear files', :etc, :'etc/dropbear' do describe file('/etc/dropbear/host.key') do it { should be_file } it { should be_owned_by 'root' } it { should be_grouped_into 'root' } it { should be_mode 400 } end end
23.083333
55
0.67148
39c97c2fa43017183c53f8b969360e21876dacb1
628
class CreatePandaIdentities < ActiveRecord::Migration[6.1] def change create_table :panda_identities do |t| t.references :user, null: false, foreign_key: {to_table: :panda_users} t.string :uid, comment: '用户UID' t.string :provider t.string :status t.string :token t.string :refre...
28.545455
76
0.694268
aca1a409e7e77d54570b7e0cb4064e1ff4b65107
3,355
# frozen_string_literal: true require 'aws-sdk' module CSI module AWS # This module provides a client for making API requests to AWS CodeCommit. module CodeCommit @@logger = CSI::Plugins::CSILogger.create # Supported Method Parameters:: # CSI::AWS::CodeCommit.connect( # region: 'r...
36.075269
190
0.630999
e8c3ee810aabc1f3b3fc88d2c1d25c00e09bfe72
1,133
lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'wipe_free_space/version' Gem::Specification.new do |spec| spec.name = "wipe_free_space" spec.version = WipeFreeSpace::VERSION spec.authors = ["Ruafozy"] spec.summary = %q{Wipe ...
31.472222
74
0.646955
4a0806f767e3b5ec10b7083cfd603ccddcc398e5
2,720
class FixityCheckJob < Hyrax::ApplicationJob # A Job class that runs a fixity check (using ActiveFedora::FixityService, # which contacts fedora and requests a fixity check), and stores the results # in an ActiveRecord ChecksumAuditLog row. It also prunes old ChecksumAuditLog # rows after creating a new one, to ...
42.5
161
0.706985
b982cc861acc70ba6b0ae1ed24d1ca1cff8510d2
13,420
# Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render invalid all existing # confirmat...
48.8
150
0.749553
1a32235cba8eec94dea9bfeb9bf00c37a91ab25f
6,487
=begin #OpenAPI Extension generating aliases to maps and arrays as models #This specification shows how to generate aliases to maps and arrays as models. The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.1-SNAPSHOT =end require 'date' require 'ti...
30.172093
198
0.631879
18e26fd563200d0b8105513b7fde2a2f19750e12
802
require 'commander/import' require 'Confetti' module Confetti module Commands class MkProd def MkProj.command(c) c.syntax = 'tt mkprod [options]' c.summary = 'Create a new product' c.description = '' c.example 'description', 'command example' c.option '--some-switch', 'Some switch that does something' ...
19.095238
65
0.69202
87c9ac9540a4989f3efab2e755f10f978a6065c9
97
require 'uri' describe "URI::FTP.new2" do it "needs to be reviewed for spec completeness" end
16.166667
49
0.731959
1a4fde60da1a71251ec28b95e0f2296e389487de
26,013
# # Author:: John Keiser <jkeiser@chef.io> # Copyright:: Copyright 2015-2016, John Keiser. # 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 # #...
37.321377
360
0.624611
e2fa642c610ec6b572c946435728300dfc190d08
2,811
# encoding: utf-8 require_relative '../../../importer/lib/importer/unp' module CartoDB module Datasources class BaseOAuth < Base # At least for CartoDB SaaS, this will be parsed by oauth endpoint to rewrite the url, so must be filled with # e.g. CALLBACK_STATE_DATA_PLACEHOLDER.sub('user', @user.use...
30.225806
115
0.673426
bbf2aa99b65733da47cbe69372508011da6666a1
1,225
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'alexa/todoist_filter/version' Gem::Specification.new do |spec| spec.name = "alexa-todoist_filter" spec.version = Alexa::TodoistFilter::VERSION spec.authors = ["Clark Bu...
39.516129
111
0.668571
1a3772d5f8b0b835be9a1464b4821e0ec5c84a32
407
Sequel.migration do change do alter_table(:parts) do add_column :source_material, String, :null => false add_column :have_material, Integer, :null => false add_column :quantity, String, :null => false add_column :cut_length, String, :null => false add_column :priority, Integer, :null...
31.307692
58
0.673219
1c76c5f3429e390ffb8da9bb95b2634ea3e4768f
356
class CreateBudgets < ActiveRecord::Migration[5.1] def change create_table :budgets do |t| t.float :amount t.boolean :is_monthly t.boolean :is_specific_date t.timestamp :start_date t.timestamp :end_date t.belongs_to :category, index: true t.timestamps end add_foreign_...
20.941176
50
0.685393
6292c11b87631cd16e115faa8cb5384198d74672
1,067
# # Cookbook:: transit.tips # Spec:: default # # Copyright:: 2017, The Authors, All Rights Reserved. require 'spec_helper' describe 'transit.tips::nodejs' do context 'When all attributes are default, on Ubuntu 16.04' do let(:chef_run) do # for a complete list of available platforms and versions see: ...
29.638889
82
0.697282
bf886d7fec9b84664fdc331db904fbcbed465bc7
7,449
# -*- coding: utf-8 -*- class CardRanker < DiceBot def initialize super @sendMode = 2 @sortType = 1 @d66Type = 2 end def gameName 'カードランカー' end def gameType "CardRanker" end def getHelpMessage return <<INFO_MESSAGE_TEXT ランダムでモンスターカードを選ぶ (RM) 特定のモンスターカードを選ぶ (CMxy x:色、y:番号)  ...
29.097656
131
0.718083
bf83f8b150ef104920802678be3f4945516f02e1
1,231
module Authlogic module ActsAsAuthentic # Magic columns are like ActiveRecord's created_at and updated_at columns. They are # "magically" maintained for you. Authlogic has the same thing, but these are # maintained on the session side. Please see Authlogic::Session::MagicColumns for more # details. Th...
34.194444
90
0.619009
616609ce9dc84af098a09a43e1918088dccc9173
4,821
#-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2018 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 ...
30.13125
91
0.681186
bf41496b08ca98af0a16861f4a597d855f64ad56
2,948
# frozen_string_literal: true require 'rails_helper' RSpec.describe DiscourseTranslator::Google do let(:mock_response) { Struct.new(:status, :body) } describe '.access_token' do describe 'when set' do api_key = '12345' before { SiteSetting.translator_google_api_key = api_key } it 'should re...
35.518072
220
0.662822
088e4a3a68a61a08dcefffd40792d4a115a07be7
3,186
require File.expand_path('../boot', __FILE__) require 'rails/all' if defined?(Bundler) # If you precompile assets before deploying to production, use this line Bundler.require(*Rails.groups(:assets => %w(development test))) # If you want your assets lazily compiled in production, use this line # Bundler.requi...
41.376623
100
0.726616
5de96a3ca7ff9193be1c7ed827d7a9171ffcf5ae
846
module TransactionsHelper def nameMonth(month, ending) arrayNameMonth = ['', 'январь','февраль','март','апрель','май', 'июнь','июль','август','сентябрь','октябрь','ноябрь','декабрь']; arrayNameMonth2 = ['', 'января','февраля','марта','апреля','мая', 'июня','июля','августа','сентября','октября','н...
25.636364
71
0.617021
6a4beaf7d0b79220996578af1bfc596b473157d0
764
# frozen_string_literal: true module Builder class BaseController < ApplicationController layout 'page' include GuestUserAuthConcern before_action :redirect_logged_user before_action :enable_guest_user def redirect_logged_user redirect_to dashboard_path if user_signed_in? end def ...
23.875
85
0.739529
189323f4a3c8aef7af8f715b954eac89a93aba66
8,726
# Encoding: utf-8 # # Copyright:: Copyright 2011, Google Inc. All Rights Reserved. # # License:: 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.apach...
47.68306
80
0.636947
288f34ed2c2253374db953f00d421695db43ed9b
477
require "rails_helper" include Warden::Test::Helpers Warden.test_mode! describe "Lieutenant sign in" do let(:lieutenant) { create(:lieutenant) } it "allows lieutenant to sign in" do visit lieutenant_root_path fill_in "lieutenant_email", with: lieutenant.email fill_in "lieutenant_password", with: "my9...
25.105263
99
0.750524
b93107a7e8d5c6a3ea595c6c565de8b5174606d1
2,514
# This is a bot designed to work with GreenBot https://github.com/green-bot/greenbot-core # Simply npm install this bot in the greenbot directory to install. # # rubocop:disable Metrics/LineLength require 'awesome_print' require 'rest-client' require 'json' # Extract parameters from the Bash environment # Greenbot wi...
31.037037
104
0.681384
5d1126828cfdfa7d7772a608ccb2ff6ac62d87d4
185
class CreatePosts < ActiveRecord::Migration[5.2] def change create_table :posts do |t| t.integer :user_id t.integer :game_id t.string :content end end end
18.5
48
0.654054
264c943058a8270748c448567a9e7a067e89f4fc
933
class ReportsController < ApplicationController def daily_sale @total_daily = Sale.find_by_sql("SELECT s.created_at::DATE, SUM(s.value) AS value, SUM(s.discount) AS discount FROM sales s WHERE exchange = FALSE AND account_id = #{current_tenan...
46.65
118
0.516613
b9c2916711c99c48f1e22877b2633cf24836fe50
1,116
require 'rails_helper.rb' RSpec.describe Post, type: :model do describe "validations for the posts model" do it { is_expected.to validate_presence_of(:content) } end context "Testing associations for the posts model" do describe "The post should belong to the user model" do it { should be...
28.615385
76
0.644265
1d2f14b9550092ac96d05b235a84d9bf76042563
118
class User < ActiveRecord::Base has_secure_password has_many :comments has_many :articles has_many :votes end
16.857143
31
0.779661
bbf91bd9a18fdb18f550ee176e47218f01906518
2,171
require 'json' require 'open-uri' require 'active_record' require 'dotenv' require_relative '../user_db.rb' require 'slack-ruby-client' Dotenv.load './config/.env' module RandomProblem class Answerer attr_accessor :max_score, :submission, :solved_problem def initialize @contest_info = 'resources/conte...
26.156627
70
0.605712
e2a21f456aa17843f6a5d2591c91c8d976ad09af
288
require 'spec_helper' describe Spree::AppConfiguration, type: :model do let (:prefs) { Rails.application.config.spree.preferences } it 'uses base searcher class by default' do prefs.searcher_class = nil expect(prefs.searcher_class).to eq Spree::Core::Search::Base end end
26.181818
64
0.743056
62df1a47813280970df20b84840f555daffce441
486
cask :v1 => 'synology-cloud-station' do version '3317' sha256 'd3305b5f2b4d47cf84e18cdbdb86a58578bff396fbe4664c4c778745098a362d' url "https://global.download.synology.com/download/Tools/CloudStation/#{version}/Mac/synology-cloud-station-#{version}.dmg" homepage 'http://www.synology.com/' license :unknown ...
34.714286
125
0.744856
e862a388d8a787f63d26a9785659f997f1cc95ae
1,213
require 'msf/core' lib = File.join(Msf::Config.install_root, "test", "lib") $:.push(lib) unless $:.include?(lib) require 'module_test' #load 'test/lib/module_test.rb' #load 'lib/rex/text.rb' #load 'lib/msf/core/post/linux/system.rb' #load 'lib/msf/core/post/unix/enum_user_dirs.rb' class Metasploit4 < Msf::Post in...
22.886792
78
0.573784
f8ad493a6b71e9773d748606913a9dd5721a304d
787
# 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...
27.137931
74
0.733164
1a5c54cc4c485137375ef42fb10d532efdff97e9
324
Deface::Override.new(:virtual_path => "spree/admin/shared/_routes", :name => "tags_routes", :insert_after => "script", :text => "<script>Spree.routes.tags_search = '<%= spree.api_tags_url %>'; Spree.routes.posts_search = '<%= spree.api_posts_url %>'</script...
64.8
162
0.558642
110d0fe8b0fc4e4ab77a5d9866ff98d01d86edfc
534
# Draw a triangle # @param left [Vector2] # @param right [Vector2] # @param top [Vector2] # @param colour [Colour] # @return [nil] def draw_triangle(left, right, top, colour) # mrb_draw_triangle # src/mruby_integration/shapes/triangle.cpp nil end # Draw the outline of a triangle # @param left [Vector2] # @param ...
22.25
49
0.722846
e8f3264aa7c22a6433feb1539bfef09c330509f8
129
# frozen_string_literal: true $LOAD_PATH.unshift File.expand_path('../lib', __dir__) require 'taxa' require 'minitest/autorun'
18.428571
54
0.767442
ab85f084e973f65a4860746e131347f1c50994b2
1,358
# Copyright (C) 2009-2014 MongoDB 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 w...
28.893617
83
0.695876
79a0012325e6bf9b46453b5184c7c9b75958639e
2,819
# frozen_string_literal: true # Provide some generic helper to test classes/defines for bareos require 'spec_helper' # This simplifies the generic build of the bareos template config checks class BareosResourceHelper attr_reader :config, :resource def initialize(resource) @resource = resource @config = {...
23.889831
134
0.571125
b9b2caee6b6f304f0d5bafe899497a6b93c9221c
3,661
# frozen-string-literal: true module Sequel module Plugins # The def_dataset_method plugin adds Model.def_dataset_method # for defining dataset methods: # # Album.def_dataset_method(:by_name) do |name| # where(:name=>name) # end # # Additionally, this adds support for Model.su...
40.230769
137
0.634799
e9d7b7b2b421ad9a3e55258e5b0ed28c67eebe72
1,452
## # This file is part of WhatWeb and may be subject to # redistribution and commercial restrictions. Please see the WhatWeb # web site for more information on licensing and terms of use. # http://www.morningstarsecurity.com/research/whatweb ## # Version 0.2 # 2011-02-25 # # Updated version detection ## Plugin.define "...
25.928571
120
0.701102
ac3fcb343de386ed871add5eb5cf4740515e5cef
1,443
# frozen_string_literal: true # ## Schema Information # # Table name: `journey_steps` # # ### Columns # # Name | Type | Attributes # ----------------------- | ------------------ | --------------------------- # **`id`** | `bigint` | `not null, primary key` # **`...
30.702128
76
0.481635
bbb15db05f8f08f3712c09fcfb122ca5bc814ed1
1,168
# 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...
44.923077
86
0.731164
bbdb963d99bd0e4a664a42efb1c0f11d16dc98c7
840
class Eigen2 < Formula desc "C++ template library for linear algebra" homepage "http://eigen.tuxfamily.org/" url "https://bitbucket.org/eigen/eigen/get/2.0.17.tar.bz2" sha256 "7255e856ed367ce6e6e2d4153b0e4e753c8b8d36918bf440dd34ad56aff09960" bottle do cellar :any sha256 "59cbfaafbcba0535357bb63ac0e48...
31.111111
95
0.732143
7914397acace096664e9d8ef19816a8a306a4b8f
6,047
### # PostgreSQL ### default['postgresql']['enable'] = false default['postgresql']['ha'] = false default['postgresql']['dir'] = "/var/opt/gitlab/postgresql" default['postgresql']['unix_socket_directory'] = nil default['postgresql']['username'] = "gitlab-psql" default['postgresql']['group'] = "gitlab-psql" default['post...
50.391667
129
0.732429
1cf73dff421493d694dc4b40de4db41bd9d58de3
7,542
require_relative 'spec_helper' describe 'openstack-integration-test::setup' do describe 'ubuntu' do let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } let(:node) { runner.node } cached(:chef_run) do runner.converge(described_recipe) end include_context 'tempest-stubs' connection_p...
31.425
228
0.63869
288fb6e580b5d0220d80c0999eace8de98497544
2,366
# -*- encoding: utf-8 -*- # stub: rake 12.2.1 ruby lib Gem::Specification.new do |s| s.name = "rake" s.version = "12.2.1" s.required_rubygems_version = Gem::Requirement.new(">= 1.3.2") if s.respond_to? :required_rubygems_version= s.require_paths = ["lib"] s.authors = ["Hiroshi SHIBATA", "Eric Hodel", "Jim W...
47.32
606
0.658495
d53d8132150ff19ac64ad7e787d5835faa80a4b0
1,246
# frozen_string_literal: true require 'aws-sdk' module Pipeline # Class for handling ConfigService tests class ConfigService def initialize(params = {}) @params = params @params[:region] = ENV['AWS_REGION'] @params[:region] ||= 'us-east-1' @configservice = Aws::ConfigService::Client.ne...
34.611111
114
0.698234
d59f762faa4fce4d21e0bd6ca6a99cd2f9061db9
96
class HostAggregateHost < ApplicationRecord belongs_to :host belongs_to :host_aggregate end
19.2
43
0.833333
ac7a7b478fb566f378e966d13f8275a0052e7775
890
# frozen_string_literal: true require 'rails_helper' require File.expand_path('../../helpers/work_forms_context', __dir__) RSpec.describe Hyrax::DenverDatasetForm do include_context 'work forms context' do describe "#required_fields" do subject { form.required_fields } it { is_expected.to eq %i[tit...
32.962963
100
0.680899