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 |
|---|---|---|---|---|---|
398c7f36e2d8c6354e239b03c21a8af2e1b983c3 | 329 | # frozen_string_literal: true
require_relative "sentiment/version"
require_relative 'sentiment/tfidf'
require_relative "sentiment/text_preprocessor"
require_relative 'sentiment/Base_model'
require_relative 'sentiment/simple_model/simple_model'
module Sentiment
class Error < StandardError; end
# Your code goes her... | 25.307692 | 54 | 0.829787 |
bb753507f78b471fbb72fc1d20bd4e50d465fa81 | 292 | class CreateCreatePeriodicTweetRequests < ActiveRecord::Migration[5.2]
def change
create_table :create_periodic_tweet_requests do |t|
t.integer :user_id, null: false
t.timestamps null: false
t.index :user_id, unique: true
t.index :created_at
end
end
end
| 22.461538 | 70 | 0.708904 |
ed31ae58f1ae8ed55b68d06325e591b92e9cbfea | 4,663 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 42.779817 | 102 | 0.742655 |
1a0f976e217fd68083793a51f55fb8984a8589eb | 78 | Archetype.create_from_archetypes_json!
Archetype.update_from_archetypes_json!
| 26 | 38 | 0.923077 |
e23aa0cf43f0d3f33fe7176687aa1acdd2a785fb | 603 | cask 'jamovi' do
version '1.1.3.0'
sha256 '9ba637199eb2b034c4628b9a9d1a7727bb289d0f00275b35c5bd748a08a648a3'
url "https://www.jamovi.org/downloads/jamovi-#{version}-macos.dmg"
appcast 'https://www.jamovi.org/download.html'
name 'jamovi'
homepage 'https://www.jamovi.org/'
auto_updates true
app 'jamovi... | 28.714286 | 81 | 0.650083 |
5d8ac12ee6ae3a50410ff20262532a9789d8fd92 | 268 | class Mdm::WebForm < ActiveRecord::Base
#
# Relations
#
belongs_to :web_site, :class_name => 'Mdm::WebSite'
#
# Serializations
#
serialize :params, MetasploitDataModels::Base64Serializer.new
ActiveSupport.run_load_hooks(:mdm_web_form, self)
end
| 15.764706 | 63 | 0.716418 |
18685587bf617beb91819fb5a1236eed34f5bc33 | 584 | Gem::Specification.new do |s|
s.name = "yarjuf"
s.version = "1.0.5"
s.platform = Gem::Platform::RUBY
s.authors = ["Nat Ritmeyer"]
s.email = ["nat@natontesting.com"]
s.homepage = "http://github.com/natritmeyer/yarjuf"
s.summary = "Yet Another RSpec JUnit Formatter (for Hudson... | 36.5 | 79 | 0.630137 |
e9cdb36ea44c5e9847731ca9b13bcbed40d032ae | 4,246 | require 'spec_helper_acceptance'
osfamily = fact('osfamily')
operatingsystem = fact('operatingsystem')
ruby_package_provider = 'undef'
case osfamily
when 'RedHat'
java_package = 'mysql-connector-java'
perl_package = 'perl-DBD-MySQL'
php_package = 'php-mysql'
python_package = 'MySQL-python'
ruby_packa... | 30.328571 | 103 | 0.630476 |
b9077aac23c711fd42791e29ee1e53d367f12b67 | 1,273 | Gem::Specification.new do |spec|
spec.name = 'rubocop-hint'
spec.version = "0.4.0"
spec.required_ruby_version = '>= 2.3.0'
spec.authors = ['Hint']
spec.email = ['tech@hint.io']
spec.summary = "Hint's shared Rubocop style guide"
sp... | 38.575758 | 96 | 0.636292 |
79890cbdb18361c460376b9d5f95c726bfe1c5e2 | 196 | default[:web][:base_directory] = "/srv/www.openstreetmap.org"
default[:web][:pid_directory] = "/var/run/web"
default[:web][:log_directory] = "/var/log/web"
default[:web][:primary_cluster] = false
| 39.2 | 61 | 0.714286 |
5d966ba3aa81c94744427448cc9bc7ea94019909 | 3,060 | # frozen_string_literal: true
require "action_view/helpers/tag_helper"
module ActionView
module Helpers #:nodoc:
module JavaScriptHelper
JS_ESCAPE_MAP = {
'\\' => '\\\\',
"</" => '<\/',
"\r\n" => '\n',
"\n" => '\n',
"\r" => '\n',
'"' => '\\"... | 31.546392 | 128 | 0.539216 |
4ae12fa655e83a7fc6dd38c81041b5c71d21296e | 501 | class CreateArticles < ActiveRecord::Migration[6.1]
def change
create_table :articles do |t|
t.integer :AuthorId, null: false
t.integer :CategoryId, null: false
t.string :Title, null: false, unique: true
t.text :Text, null: false
t.string :Image, null: false
t.date :CreatedAt, ... | 27.833333 | 51 | 0.664671 |
1126f706393ce07da86a3763095c952c023342b5 | 5,168 | module NotesActions
include RendersNotes
extend ActiveSupport::Concern
included do
before_action :set_polling_interval_header, only: [:index]
before_action :authorize_admin_note!, only: [:update, :destroy]
before_action :note_project, only: [:create]
end
def index
current_fetched_at = Time.n... | 23.071429 | 88 | 0.657895 |
392f0d6ea4dd99006037fd43575d37da29229454 | 760 | require 'test_helper'
class InstallGeneratorTest < Rails::Generators::TestCase
tests BaseBranch::InstallGenerator
destination File.expand_path('../../tmp', __FILE__)
setup :prepare_destination
def setup
@path = File.expand_path('../../tmp', __FILE__)
FileUtils.touch(File.join(@path, '.gitignore'))
... | 26.206897 | 72 | 0.677632 |
3353ed2964cffbd0901379af319854be9b3732d3 | 795 | # frozen_string_literal: true
module JustimmoClient::V1
class RealtyRoomCount < JustimmoBase
# @!group Attributes
# @!macro [attach] attribute
# @return [$2]
attribute :store, Integer
attribute :bathroom, Integer
attribute :balcony_terrace, Integer
attribute :balcony, ... | 22.083333 | 39 | 0.594969 |
acf53082833e1e6f33b8e7614b4eb3d8a65e0549 | 104 | require 'test_helper'
class <%= class_name %>ValueTest < Minitest::Test
def test_something
end
end | 14.857143 | 49 | 0.740385 |
bfe008cbeaf16cfb72d56cdae2ed03ffde0320f5 | 3,182 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
# XXX This module needs an overhaul
def initialize(info = {})... | 28.666667 | 214 | 0.554054 |
383bfc46aabcf3829a7a102e5617114e8714ed89 | 439 | class CreateOauthServices < ActiveRecord::Migration[6.0]
def change
create_table :oauth_services do |t|
t.string :uid, null: false
t.text :description
t.string :provider, null: false
t.references :user, foreign_key: true
t.string :token
t.string :refresh_token
t.timestamp... | 27.4375 | 62 | 0.67426 |
878b5447e3df81f6b60f999d4d4062401543cafd | 287 | class AddAuthTokenToVendorsAndLandowners < ActiveRecord::Migration[5.1]
def change
add_column :vendors, :auth_token, :string
add_column :vendors, :refresh_token, :string
add_column :landowners, :auth_token, :string
add_column :landowners, :refresh_token, :string
end
end
| 31.888889 | 71 | 0.770035 |
262b352c6a1f55e53aa7ae217cafcacc54f0c79e | 5,765 | module Crimson
class Interpreter
def initialize(environment)
@global_env = environment
@_append, @_cons, @_let = "append cons let".split.map { |s| s.to_sym }
@macro_table = {:let => method(:let)} ## More macros can go here
# load_built_in()
end
# loads built-in language definitio... | 36.955128 | 88 | 0.510668 |
bf2bdd2d1c8f15eace29eabef776d11318741a9b | 4,726 | # 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::Network::Mgmt::V2019_12_01
module Models
#
# Container network interface child resource.
#
class ContainerNetworkInterface <... | 32.593103 | 93 | 0.513754 |
1a8f0358c6cb4e62351c43bc0cc1007bc4b9353b | 443 | # frozen_string_literal: true
module Betsy
class ShopListingOffering
include Betsy::Model
attribute :offering_id
attribute :quantity
attribute :is_enabled
attribute :is_deleted
attribute :price
def self.get_listing_offering(listing_id, product_id, product_offering_id)
make_request... | 24.611111 | 122 | 0.751693 |
33f25aa9fc8443915eb8b4211d9b65a16903bed1 | 108 | module Streamy
class JsonEvent < Event
def payload
payload_attributes.to_json
end
end
end
| 13.5 | 32 | 0.703704 |
61cfb98a8f3d867c973436922096be2851c142c1 | 134 | require 'sinatra/base'
module SlackCAHBot
class Web < Sinatra::Base
get '/' do
'Math is good for you.'
end
end
end
| 13.4 | 29 | 0.626866 |
871e797ca21f65ddcdac92da9be97dc86f93f670 | 553 | class Machine
@@users = {}
def initialize(username, password)
@username = username
@password = password
@@users[username] = password
@files = {}
end
def create(filename)
time = Time.now
@files[filename] = time
puts "#{filename} was created by #{@username} at #{time}."
end
... | 19.068966 | 62 | 0.652803 |
acc9e1eecec148f802becc91b54932921b151101 | 1,328 | # 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.
#
# This file is the source Rails uses to define your schema when running `rails
#... | 41.5 | 86 | 0.748494 |
1c019a7724ba4cec905a04672477441f8e209ec3 | 498 | Pod::Spec.new do |s|
s.name = 'PEAR-AutoLayout-iOS'
s.version = '0.0.3'
s.platform = :'ios', '7.0'
s.license = 'MIT'
s.summary = 'auto layout library for ios'
s.homepage = 'https://github.com/HirokiUmatani/PEAR-AutoLayout-iOS'
s.author = { "HirokiUmatani" => "info@pear.chat" }
s.source ... | 38.307692 | 110 | 0.624498 |
1d67728e76c5deb8cedb0ba1c1fc2fe0243f01b4 | 2,947 | # Exploit Title: eMerge E3 Access Controller 4.6.07 - Remote Code Execution (Metasploit)
# Google Dork: NA
# Date: 2018-11-11
# Exploit Author: LiquidWorm
# Vendor Homepage: http://linear-solutions.com/nsc_family/e3-series/
# Software Link: http://linear-solutions.com/nsc_family/e3-series/
# Version: 4.6.07
# Tested on... | 31.021053 | 88 | 0.577536 |
b99a112fcfc1299ec4fef5b198e7c49a924741d8 | 1,405 | class HaikuReactionsController < ApplicationController
before_action :logged_in_user, only: %i[edit destroy]
before_action :correct_post, only: :edit
before_action :correct_user, only: :destroy
def edit
if current_user.likedComment?(@haiku.id)
redirect_to request.referrer
else
@reaction =... | 30.543478 | 129 | 0.654093 |
61c835b6e2ba7bfbd4083bec8af8091fb5e5e0e2 | 53 | module ScssLintCustom
VERSION = '0.1.0'.freeze
end
| 13.25 | 26 | 0.735849 |
26989dab5ca6a98e79d7d37e40414d1264cc418c | 365 | require 'formula'
class Daq < Formula
homepage 'http://www.snort.org/'
url 'http://www.snort.org/dl/snort-current/daq-2.0.2.tar.gz'
sha1 'def1a5b28fd16758aeb85a02f3813250014d4d75'
fails_with :clang
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{... | 22.8125 | 62 | 0.654795 |
18316f0eef80a8443be6a7b1e23c0ff76638821e | 2,823 | # encoding: UTF-8
#
# Author: Stefano Harding <riddopic@gmail.com>
# License: Apache License, Version 2.0
# Copyright: (C) 2014-2015 Stefano Harding
#
# 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 ... | 28.515152 | 75 | 0.613886 |
6a6cf8c9442a820761a21540b87733bfe1b63cb1 | 1,232 | class UsersController < ApplicationController
get '/users/:slug' do
@user = User.find_by_slug(params[:slug])
erb :'users/show'
end
get '/signup' do
if !logged_in?
erb :'users/new'
else
redirect to '/tweets'
end
end
post '/signup' do
... | 23.692308 | 106 | 0.512175 |
180401b93d1c27d29629253e6cbd90cc954f4de2 | 2,373 | require 'r10k/module'
require 'r10k/util/setopts'
require 'r10k/tarball'
# This class defines a tarball source module implementation
class R10K::Module::Tarball < R10K::Module::Base
R10K::Module.register(self)
def self.implement?(name, args)
args.is_a?(Hash) && args[:type].to_s == 'tarball'
rescue
fals... | 23.264706 | 77 | 0.642646 |
f7210e4628d2bccd5ea87a33a53ab8ad19fc20a1 | 905 | # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 56.5625 | 245 | 0.792265 |
08b4c7a337ad166d191994bfea9ca34c3cf10c9b | 2,556 | #!/usr/bin/env ruby
# Small world puzzle
# Kanwei Li, 2009
# http://kanwei.com/code/2009/02/18/facebook-smallworld.html
# Make sure input file exists and read from it
filename = ARGV[0]
unless filename && File.exist?(filename)
puts "error: must specify a valid input file"
exit
end
input = File.open(file... | 26.905263 | 85 | 0.617762 |
f802548c83d2633a3eeecafd47e1a5312966e698 | 1,390 | class DemoFailGenerator
POSSIBLE_TYPES = [
NoMethodError, ActionController::RoutingError,
TypeError, NameError, StandardError
]
MESSAGES = [
"Could not find FooBar with ID = baz",
"No route for /shatner",
"can't convert Hash into String",
"Invalid JSON string"
]
LOCATIONS = [
... | 24.821429 | 84 | 0.580576 |
4a01df78cc5f97daebe23499cac01979d76d69c6 | 3,126 | # encoding: UTF-8
require './lib/rfc2047'
require 'test/unit'
=begin
From RFC 2047:
8. Examples
The following are examples of message headers containing 'encoded-
word's:
=?US-ASCII?Q?Keith_Moore?= <moore / cs.utk.edu>
=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld / dkuug.dk>
=?ISO-8859-1?Q?Andr=E9... | 32.226804 | 169 | 0.59469 |
ac5a638cb40f20b0392e5f63b249fa1cf474619b | 3,291 | # frozen_string_literal: true
module Valkyrie::Storage
# Implements the DataMapper Pattern to store binary data in fedora
class Fedora
attr_reader :connection, :base_path, :fedora_version
PROTOCOL = 'fedora://'
# @param [Ldp::Client] connection
def initialize(connection:, base_path: "/", fedora_ver... | 33.581633 | 110 | 0.648131 |
b9d738019ac05dce47fd18785486949f848c0f83 | 665 | module SeedData
def load_seed_data
Customer.delete_all
customer = Customer.create(
:name => 'Scott Noel-Hemming',
:company_name => 'Frogstarr78 Software',
:address => '312 NW 7th',
:phone => '509.730.5401',
:zip => '97862'
)
Project.delete_a... | 19.558824 | 46 | 0.451128 |
6a5afbf692d68f50498172a8ef5d7c2ce7f896e3 | 8,278 | class PeriodicTable::CLI
def start
@location = "start" #stores current method location
@menu = PeriodicTable::Menu # all menu + their options
@header = PeriodicTable::Header # all possible headers
@history = [] #stores previous search history
@main = ["menu", "exit", "clear"] #user can use these p... | 30.773234 | 221 | 0.637835 |
397d3c87a6aec07badbd46eedc7d629448a95769 | 1,990 | class BelarusianCultureGameModification < CK2GameModification
def belarusian_culture
# Based on severian
PropertyList[
"graphical_cultures", ["easternslavicgfx"],
"color", [0.5, 0.8, 0.3],
"male_names", ["Briachislav_Bretislaus", "Demid", "Dobrynia", "Fedot_Theodat", "Gleb", "Igor", "Iliya",... | 60.30303 | 570 | 0.671859 |
1d3dcedd9de76dd2378543a85a8936da8a59dda0 | 440 | module Dothoop
class Configuration
attr_accessor :api_url
attr_accessor :path_url
def initialize
@api_url = 'https://api-gateway.dotloop.com'
@path_url = 'public/v2'
end
end
class << self
def configuration
@configuration ||= Configuration.new
end
def self.config... | 15.172414 | 51 | 0.643182 |
bb69979a059f6fa243e3dbdf8d3cd1fb5e430d93 | 782 | module DeviseHelper
def devise_error_messages!
return '' if resource.errors.empty?
messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join
sentence = I18n.t('errors.messages.not_saved', count: resource.errors.count, resource: resource.class.model_name.human.downcase)
... | 35.545455 | 134 | 0.574169 |
1ac8ebfac8fa900caf81d37c724eb836b5b7b96f | 843 | Pod::Spec.new do |s|
s.name = 'AWSMobileClient'
s.version = '2.6.31'
s.summary = 'Amazon Web Services SDK for iOS.'
s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
s.homepage ... | 44.368421 | 158 | 0.634638 |
39115d423f57eeec527d22708729077cc70ab4de | 2,218 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop checks for uses of the case equality operator(===).
#
# @example
# # bad
# Array === something
# (1..100) === 7
# /something/ === some_string
#
# # good
# someth... | 27.382716 | 86 | 0.509468 |
216051dbfd9442132512a8a16dda6068147e93e2 | 9,856 | require "spec_helper"
module BetterErrors
describe Middleware do
let(:app) { Middleware.new(->env { ":)" }) }
let(:exception) { RuntimeError.new("oh no :(") }
it "passes non-error responses through" do
expect(app.call({})).to eq(":)")
end
it "calls the internal methods" do
expect(ap... | 32.635762 | 107 | 0.581879 |
330c99161533f6027d20fb53cca963be31e7bb2d | 933 | # Copyright (C) 2003 Gimite 市川 <gimite@mx12.freecom.ne.jp>
# Modified by Glass_saga <glass.saga@gmail.com>
require_relative 'wordset'
require_relative 'message_log'
require_relative 'word_searcher'
module Gimite
# 「単語→発言番号」リストを管理するもの。
class WordToMessageListManager
def initialize(wordSet, log, wordS... | 23.325 | 67 | 0.624866 |
f84966d0baad6f6907bc64681956134ffae696aa | 335 | describe :array_length, shared: true do
it "returns the number of elements" do
[].send(@method).should == 0
[1, 2, 3].send(@method).should == 3
end
it "properly handles recursive arrays" do
ArraySpecs.empty_recursive_array.send(@method).should == 1
ArraySpecs.recursive_array.send(@method).should ... | 27.916667 | 62 | 0.692537 |
ed50b7e20349b31c943dc1a6317fa66affdd7430 | 16,714 | require 'spec_helper'
describe Order, "instance methods" do
before(:each) do
@user = Factory(:user)
@user.stubs(:name).returns('Freddy Boy')
@order = Factory(:order, :user => @user)
end
context ".name" do
it 'should return the users name' do
@order.name.should == 'Freddy Boy'
end
end... | 32.966469 | 94 | 0.656157 |
bf3eecef60dfba82c653c9bc3b9beecb61024b0e | 281 | require_relative "chunky_movies_manch/version"
require_relative "chunky_movies_manch/cli"
require_relative "chunky_movies_manch/scraper"
require_relative "chunky_movies_manch/film"
require_relative "chunky_movies_manch/location"
require "nokogiri"
require "open-uri"
require "pry" | 31.222222 | 47 | 0.864769 |
e285a3e59deab0d1905dafb0f702576e42ae861e | 1,650 | # frozen_string_literal: true
require_relative "lib/inspirational_stress_reliever/version"
Gem::Specification.new do |spec|
spec.name = "inspirational_stress_reliever"
spec.version = InspirationalStressReliever::VERSION
spec.authors = ["nathan hains"]
spec.email = ["nathanhains14@... | 43.421053 | 88 | 0.692727 |
4ab781165a43dfb685e2b6870a8dbc60c1ff5b9a | 1,405 | # coding: utf-8
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'spree_paypal_express/version'
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_paypal_express'
s.version = SpreePayPalExpress::VERSION
s.summary = 'Adds P... | 35.125 | 77 | 0.692527 |
87531d76755b179b729af4b1a745f05b2bd1ba4e | 3,586 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 41.218391 | 102 | 0.759063 |
e8deecaff98d93ce73208d966a6d2baa7fdc2918 | 44 | module NdraViewHelp
VERSION = "0.2.0"
end
| 11 | 19 | 0.704545 |
4aab1ca047b900b52644c7b20cb21da1ee32602e | 720 | require "thread"
module Flipper
module Cloud
class Registry
def self.default
@default ||= new
end
def initialize
@mutex = Mutex.new
@data = {}
end
def fetch(key, &block)
@mutex.synchronize do
if data = @data[key]
data
... | 15.319149 | 36 | 0.458333 |
7aaee8bf92d7a543682a67a71e1c1d578cbf191d | 610 | class CreateBalanceTransactions < ActiveRecord::Migration[4.2]
def change
create_table :balance_transactions do |t|
t.integer :project_id
t.integer :contribution_id
t.text :event_name, null: false
t.integer :user_id, null: false
t.timestamps
end
add_column :balance_transact... | 33.888889 | 125 | 0.727869 |
6a4a8ff3a7a5d2a75f5cc79fbb02a282c8704a41 | 43 | module Zoomus
module Interface
end
end
| 8.6 | 18 | 0.767442 |
bf9b668a8c30bbfe743c5e16adb13cb10d229075 | 5,341 | require 'test_helper'
class InvitationTest < ActiveSupport::TestCase
disable_transactional_fixtures!
should belong_to :account
def setup
@provider = FactoryBot.create(:simple_provider)
end
test 'requires an email' do
invitation = Invitation.new(:account => @provider)
refute invitation.valid?
... | 34.019108 | 159 | 0.719528 |
f7672a7bcb0c0448f9df9431d6d33d18bf403831 | 427 | require 'open-uri'
module OpenURI
class << self
alias :_open_http :open_http
end
def self.open_http(buf, target, proxy, options)
proxy_wrap = proxy
if proxy_wrap && proxy.first.class == URI::HTTP
proxy_uri, proxy_user, proxy_pass = proxy
proxy_wrap = [proxy_uri, proxy_user || proxy_uri.u... | 23.722222 | 94 | 0.69555 |
26d94a547325c1d7672cb9a73ba401c91ddd5300 | 539 | class CreateDevices < ActiveRecord::Migration[4.2]
def change
create_table :devices do |t|
t.string :token
t.integer :parent_id
t.string :parent_type
t.string :platform
t.boolean :active, default: true
t.datetime :valid_at
t.datetime :invalidated_at
t.datetime :dele... | 24.5 | 50 | 0.664193 |
792abc9fb1ce7f07e8a373dbb1e0446520858e23 | 49 | module RailsLogUserAgent
VERSION = "0.1.0"
end
| 12.25 | 24 | 0.734694 |
abcf315af6a99447bd0c08eaf70314ca486c0e04 | 125 | class PageMeaTargetRel < ActiveRecord::Base
belongs_to :page, class_name: "Comfy::Cms::Page"
belongs_to :mea_target
end
| 20.833333 | 50 | 0.768 |
01d84910ffb0239e35cfe22d71d28ba2d635def5 | 1,030 | module ActiveJob
module QueuePriority
extend ActiveSupport::Concern
# Includes the ability to override the default queue priority.
module ClassMethods
mattr_accessor(:default_priority)
# Specifies the priority of the queue to create the job with.
#
# class PublishToFeedJob < Ac... | 22.888889 | 67 | 0.615534 |
030ed9c001b857aaa4a8892dd3a66e5a0161300b | 1,219 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe DependencyProxy::PullManifestService do
include DependencyProxyHelpers
let(:image) { 'alpine' }
let(:tag) { '3.9' }
let(:token) { Digest::SHA256.hexdigest('123') }
let(:manifest) { { foo: 'bar' }.to_json }
subject { described_class.new(im... | 27.088889 | 72 | 0.671862 |
117a799ebf2fd44e559f4569cc259d2867e07cb4 | 362 | require "bundler/setup"
require "ortega"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with :rspe... | 24.133333 | 66 | 0.751381 |
ff91661cef78c465e735562ec9e5f53aa11c2cca | 587 | # typed: false
# exhaustive-apply-code-action: true
class A
private def foo; end
end
class B
private_class_method def self.foo; end
end
class C
private_class_method def foo; end
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: Use `private` to define private instance methods
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apply... | 25.521739 | 93 | 0.603066 |
b9d15fc7d814e5f7d25af3b84753882541f46541 | 1,023 | class GenresController < ApplicationController
before_action :check_logged
before_action :set_genre, only: [:edit, :update, :destroy, :show]
def index
@genres = Genre.paginate(page: params[:page] ,per_page: 10)
end
def new
@genre = Genre.new
end
def create
@genre = Genre.new(genre_params)
... | 18.944444 | 68 | 0.656891 |
38930aef233d2753f82e012e9f274bed19271704 | 5,278 | require 'spec_helper'
require 'puppet_spec/compiler'
describe 'ToStringifiedConverter' do
include PuppetSpec::Compiler
after(:all) { Puppet::Pops::Loaders.clear }
let(:env) { Puppet::Node::Environment.create(:testing, []) }
let(:loaders) { Puppet::Pops::Loaders.new(env) }
let(:node) { Puppet::Node.new(env,... | 34.272727 | 119 | 0.674119 |
62196237ada990de6211ef7daaba99522fdcc900 | 1,342 | Pod::Spec.new do |s|
s.name = "MaterialComponentsExamples"
s.version = "107.2.0"
s.authors = "The Material Components authors."
s.summary = "This spec is an aggregate of all the Material Components examples."
s.description = "This spec is made for use in the MDC Catalog. Used in conjun... | 70.631579 | 264 | 0.693741 |
1aeaa8c621d9a9e52e0f0562f6751da89334b9fc | 1,440 | # encoding: utf-8
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/whois.nic.li/li/status_available.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec_helper'
require 'wh... | 23.606557 | 80 | 0.688194 |
b96b3f362ff669a09bf64eddfbc29b5176d5e2af | 2,847 | class Oauth2Proxy < Formula
desc "Reverse proxy for authenticating users via OAuth 2 providers"
homepage "https://oauth2-proxy.github.io/oauth2-proxy/"
url "https://github.com/oauth2-proxy/oauth2_proxy/archive/v7.1.0.tar.gz"
sha256 "49cc8d121dfaa401c4b06d7fe09dc59d9900506a0c7d58e1bcd281094a9eebb2"
license "MI... | 31.988764 | 122 | 0.627327 |
ffe631171271616e8ad642e40a421ceb371251c4 | 893 | class MapsController < ApplicationController
before_filter :authenticate_user!
# POST /maps
# POST /maps.json
def create
@map = Map.new(params[:map])
@map.user = current_user
respond_to do |format|
if @map.save
format.html { redirect_to request.env["HTTP_REFERER"] || @map.mapable, n... | 25.514286 | 101 | 0.640538 |
0375afeb4f51d2136720e879f4bc77fd83eb0c07 | 17,008 | require 'spec_helper'
require 'messages/role_create_message'
require 'models/helpers/role_types'
module VCAP::CloudController
RSpec.describe RoleCreateMessage do
subject { RoleCreateMessage }
let(:user_guid) { 'user-guid' }
let(:username) { 'user-name' }
let(:user_origin) { 'user-origin' }
let(:... | 29.476603 | 148 | 0.571849 |
260795c12f8969333044f3c8917f6fe8cd2432e8 | 33,194 | # Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: AGPL-3.0
require 'test_helper'
class UserTest < ActiveSupport::TestCase
include CurrentApiClient
# The fixture services/api/test/fixtures/users.yml serves as the input for this test case
setup do
# Make sure system_user ... | 38.687646 | 154 | 0.686329 |
6ab993d6064e0a7ca84cd3573cd51c9e3a2c5944 | 1,885 | class SimpleAmqpClient < Formula
desc "C++ interface to rabbitmq-c"
homepage "https://github.com/alanxz/SimpleAmqpClient"
url "https://github.com/alanxz/SimpleAmqpClient/archive/v2.5.1.tar.gz"
sha256 "057c56b29390ec7659de1527f9ccbadb602e3e73048de79594521b3141ab586d"
license "MIT"
revision 1
head "https://... | 39.270833 | 123 | 0.69443 |
26a682c3af13197eb74f0ab41b78d6af8c4c307d | 1,661 | # frozen_string_literal: true
describe Spree::Shipment do
context 'Scopes' do
let!(:supplier) { create(:supplier) }
let(:stock_location_1) { supplier.stock_locations.first }
let(:stock_location_2) { create(:stock_location, supplier: supplier) }
let(:shipment_1) { create(:shipment) }
let(:shipment... | 35.340426 | 88 | 0.703191 |
e9a493cba51411cf7dbd5caad065f4e394def09d | 860 | # frozen_string_literal: true
require 'spec_helper'
require File.expand_path('../factorial', __dir__)
describe Factorial do
let(:f) { Factorial.new }
it 'finds the factorial of 0' do
expect(f.factorial_of(0)).to eq(1)
end
it 'finds the factorial of 1' do
expect(f.factorial_of(1)).to eq(1)
end
it ... | 25.294118 | 66 | 0.702326 |
219c69893ad3514d710faf64661d1b1812e268be | 3,839 | # Gitaly note: JV: no RPC's here.
module Gitlab
module Git
class DiffCollection
include Enumerable
DEFAULT_LIMITS = { max_files: 100, max_lines: 5000 }.freeze
attr_reader :limits
delegate :max_files, :max_lines, :max_bytes, :safe_max_files, :safe_max_lines, :safe_max_bytes, to: :limits... | 24.767742 | 113 | 0.565512 |
e2967809aa96dc2735ca6337f07ed8fdd900b71e | 10,921 | require "helper"
describe Thor::Actions do
def runner(options = {})
@runner ||= MyCounter.new([1], options, :destination_root => destination_root)
end
def action(*args, &block)
capture(:stdout) { runner.send(*args, &block) }
end
def file
File.join(destination_root, "foo")
end
describe "on ... | 32.894578 | 126 | 0.636755 |
1c997a3105fd234fafe2f9dbfb5f73a0fa8910c5 | 184 | # frozen_string_literal: true
module Blog
class ArticleListComponent < ApplicationComponent
def initialize(articles:)
super()
@articles = articles
end
end
end
| 16.727273 | 51 | 0.711957 |
e8490dd0381513e20e795b44c3611a1697e610ab | 699 | Pod::Spec.new do |s|
s.name = 'Ometria'
s.version = '1.1.3'
s.module_name = 'Ometria'
s.license = 'MIT'
s.summary = 'Ometria SDK for iOS (Swift)'
s.homepage = 'http://ometria.com/'
s.author = { 'Al James' => 'platform+cocoa... | 41.117647 | 112 | 0.515021 |
e2b0e90d54f4f0be965ee5366f160903dd6e0f0f | 97 | class PostSerializer < ActiveModel::Serializer
attributes :id, :title, :body, :created_at
end | 32.333333 | 46 | 0.762887 |
ff56669f8e18998af38e6872e25d3357ffa20cc1 | 49 | module StellarCoreBackup
VERSION = "0.0.1"
end
| 12.25 | 24 | 0.734694 |
7aafe8cec60543957c473f6757d773f2ebbfc7a9 | 578 | require 'spec_helper'
describe UnifiApi::Helpers do
describe 'mac_valid?' do
it 'returns true when a mac is valid' do
expect(UnifiApi::Helpers.mac_valid?('01:01:01:01:01:01')).to equal true
end
it 'returns false when a mac is invalid' do
expect(UnifiApi::Helpers.mac_valid?('01:01:01:01:01:01... | 36.125 | 81 | 0.688581 |
61a0c522c2776c46f89fbd711ae25c6880a733df | 6,797 | =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 Pagination
attr_accessor :page
attr_accesso... | 29.424242 | 206 | 0.618508 |
791e9c845a6ff267534b442a22c88a8a19c53237 | 262 | class RenameCiCommitsToCiPipelines < ActiveRecord::Migration[4.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'Rename table ci_commits to ci_pipelines'
def change
rename_table 'ci_commits', 'ci_pipelines'
end
end
| 23.818182 | 65 | 0.778626 |
87d98b9c744b68f97bce78f3fbcbcde73b93f791 | 1,853 | require 'zlib'
# Responsbile for storing the blockchain on disk
# Blocks are compressed using zlib and decompressed on the fly
class DB
attr_accessor :db_path, :data_path, :time_index, :obj_type
include MissingBlocks
include Validation
include Navigation
def initialize(db_path = nil, obj_type = 'data')
... | 23.1625 | 107 | 0.684835 |
3304adbec4b90db11652db49bb296c2a3ae11ded | 1,007 | module Types
class CourseType < Types::BaseObject
field :id, ID, null: false
field :name, String, null: false
field :description, String, null: false
field :ends_at, GraphQL::Types::ISO8601DateTime, null: true
field :enable_leaderboard, Boolean, null: false
field :about, String, null: true
... | 25.175 | 92 | 0.656405 |
1c9fb0df227432f211669675000a3397381966ea | 1,255 | # frozen_string_literal: true
module ActiveRecord
module OpenTracing
module SqlSanitizer
module Regexes
MULTIPLE_SPACES = /\s+/.freeze
MULTIPLE_QUESTIONS = /\?(,\?)+/.freeze
PSQL_VAR_INTERPOLATION = /\[\[.*\]\]\s*$/.freeze
PSQL_REMOVE_STRINGS = /'(?:[^']|'')*'/.freeze
... | 36.911765 | 71 | 0.549801 |
627b45a5f0b291da42bca2c7f6c1147a79324b01 | 29,720 | # 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::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10
#
# ReplicationPolicies
#
class ReplicationPolicies
include MsRestAzure
#
... | 39.364238 | 188 | 0.688358 |
7a29f5aa45e3a1ae8b8890abd0bdbaad87de6e29 | 11,381 | # frozen_string_literal: true
class RepositoriesController < ApplicationController
include ActionController::MimeResponds
include Countable
before_action :set_repository, only: %i[show update destroy]
before_action :authenticate_user!
before_action :set_include
load_and_authorize_resource :client,
... | 29.408269 | 82 | 0.561286 |
d5b52175ea37b9f5364ee25b14d89af5e2b87138 | 2,041 | =begin
#SendinBlue API
#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/or... | 42.520833 | 839 | 0.703577 |
1d8da3ed62d9dac0c810d2d1166d5c30eb327a4e | 15,125 | # frozen_string_literal: true
#
#--
# Copyright (C) 2009-2021 Thomas Leitner <t_leitner@gmx.at>
#
# This file is part of kramdown which is licensed under the MIT.
#++
#
require 'kramdown/converter'
require 'kramdown/utils'
module Kramdown
module Converter
# Converts an element tree to the kramdown format.
c... | 33.685969 | 123 | 0.471471 |
bfbc135c2eae937c187fbde1d6d44e27c8476caa | 1,874 | require 'rubygems'
require 'write_xlsx'
def write_to_sheet(worksheet, api_data, format)
col = row = 0
for row in 0...api_data.size
contents = api_data[row]
for col in 0..contents.size
worksheet.write(row, col, contents[col], format)
end
end
end
def is_numeric(str)
Float(str) != nil rescue false
end
# C... | 22.853659 | 68 | 0.727321 |
bf4ba8d7329c732078dfcf87b691152078b25684 | 1,658 | # -*- encoding: utf-8 -*-
# stub: jekyll-twitter-plugin 2.1.0 ruby lib
Gem::Specification.new do |s|
s.name = "jekyll-twitter-plugin".freeze
s.version = "2.1.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.a... | 40.439024 | 126 | 0.677925 |
7af1284c67269593739a3f67b40d240e18dce724 | 585 | class CreateYTests < ActiveRecord::Migration[5.2]
def change
create_table :y_tests do |t|
t.decimal :right_PA
t.decimal :right_PM
t.decimal :right_PL
t.decimal :right_CM
t.decimal :right_result
t.decimal :left_PA
t.decimal :left_PM
t.dec... | 22.5 | 49 | 0.591453 |
0154ecd19854f7220beddd85fc38fd6ad39cedae | 1,637 | # frozen_string_literal: true
require "rails_helper"
module WasteCarriersEngine
RSpec.describe ConvictionSearchResult, type: :model do
describe "new_from_entity_matching_service" do
context "when given data from the entity matching service" do
let(:time) { Time.current }
let(:data) do
... | 32.098039 | 99 | 0.642028 |
79b283ea2aea9ed82bd1cc937440349ecb3bf496 | 232 | module Tinker::Network
class Message
attr_reader :socket, :body
def initialize(params)
[:socket, :body].each do |param|
instance_variable_set("@#{param}", params[param])
end
end
end
end | 21.090909 | 58 | 0.607759 |
1a30b21d24eac65b49f296acdccd2933b5b08e7b | 361 | class CreateAnimations < ActiveRecord::Migration
def change
create_table :animations do |t|
t.string :creator
t.string :digitalid
t.integer :width
t.integer :height
t.integer :x1
t.integer :y1
t.integer :x2
t.integer :y2
t.integer :delay
t.string :filena... | 19 | 48 | 0.612188 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.