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 |
|---|---|---|---|---|---|
6221eeeb24bfcfbc02026b322dac50cc17a7ef39 | 1,642 | # frozen_string_literal: true
class CreateAlertManagementAlerts < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
unless table_exists?(:alert_management_alerts)
create_table :alert_management_alerts do |t|
t.timestamp... | 36.488889 | 140 | 0.709501 |
4a1353d2f5b71d962eefc849b6cc9103873ee89a | 796 | # encoding: utf-8
$:.unshift File.expand_path('../lib', __FILE__)
require 'pub_sub/version'
Gem::Specification.new do |s|
s.name = 'pubsub_on_rails'
s.version = PubSub::VERSION
s.authors = ['Stevo']
s.email = ['b.kosmowski@selleo.com']
s.homepage = 'https://github.com/Selle... | 33.166667 | 78 | 0.638191 |
1cc478c6c45d926490fe6eddba13f02bb87a8bd0 | 2,310 | class EventsController < ApplicationController
skip_before_filter :verify_authenticity_token,
:if => Proc.new { |c| c.request.format == 'application/json' }
before_filter :authenticate_user!
def index
invited_events = current_user.invited_events
if invited_events.count > 0
... | 26.551724 | 88 | 0.630303 |
28bcb159cd64bf06d1308b942cdb5172e965d464 | 337 | def upgrade(ta, td, a, d)
["tcp_listen_options", "collect_statistics_interval"].each do |option|
a[option] = ta[option] unless a[option]
end
return a, d
end
def downgrade(ta, td, a, d)
["tcp_listen_options", "collect_statistics_interval"].each do |option|
a.delete(option) unless ta.key?(option)
end
... | 24.071429 | 72 | 0.694362 |
615ec2fe25d2477b5d42e6a131f179404358eb44 | 1,006 | class TermsController < ApplicationController
before_action :set_term, only: [:destroy, :edit, :update]
before_action :authenticate_user!
# GET /terms
def index
@terms = Term.all
end
# DELETE /terms/1
def destroy
@term.destroy
redirect_to terms_path
end
# GET /terms/new
def new
... | 18.981132 | 99 | 0.658052 |
6a2f3f015d516e6bac266fecb5532aacb3d526b6 | 224 | module Levelup
module Errors
# An error generated by the LevelUp client when the user attempts to
# perform an authorized action without an access token.
class Unauthenticated < StandardError
end
end
end
| 24.888889 | 72 | 0.745536 |
08d1973a258b966850dd2ce4c161f82421c32677 | 955 | Pod::Spec.new do |s|
s.name = 'MPopUpAlertManager'
s.version = '1.0.0'
s.summary = 'MPopUpAlertManager.'
s.description = <<-DESC
TODO: Add long description of the pod here.
DESC
s.homepage = 'https://github.com/mafeng-Bryant/MPopUpAlertManager'... | 43.409091 | 116 | 0.593717 |
21e15a1ebe0f233de32b119f8f2555631c6a3f49 | 1,743 | # coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "chatmeter/version"
Gem::Specification.new do |spec|
spec.name = "chatmeter"
spec.version = Chatmeter::VERSION
spec.authors = ["Levi Brown", "Kyle Rose", "Pablo Rodrigue... | 39.613636 | 96 | 0.663224 |
01e88def759b6597a96f9b675c346105b981cb17 | 734 | require 'test_helper'
class UsersSignupTest < ActionDispatch::IntegrationTest
test "invalid signup information" do
get signup_path
assert_no_difference 'User.count' do
post users_path, params: { user: { name: "",
email: "user@invalid",
password: "foo",
password_confirmation: "bar"} }... | 25.310345 | 62 | 0.667575 |
6a6634fde0d54ac4e438ac88aceca8986d1e4e38 | 544 | require 'new_relic/metric_parser/java_parser'
module NewRelic
module MetricParser
class Java < NewRelic::MetricParser::MetricParser
JavaParser
def initialize(name)
super
if segments.length > 2
self.extend NewRelic::MetricParser::JavaParser
end
end
def pie... | 17 | 56 | 0.617647 |
b9b685b0339aa956fd62f93a01e224c6450867ac | 1,545 | class UsersController < ApplicationController
before_action :logged_in_user, only: [:index, :edit, :update, :destroy]
before_action :correct_user, only: [:edit, :update]
before_action :admin_user, only: :destroy
def index
@users = User.paginate(page: params[:page])
end
def show
@user = Us... | 20.064935 | 73 | 0.645955 |
010861b31d2498a6e848c07c7c5751a847910545 | 3,346 | module HBW
module Common
class Adapter
include HBW::Inject[:api, :config]
def entity_code_key(entity_class)
config[:entities].fetch(entity_class)[:entity_code_key]
end
# TODO: cache it until new user is added
def users
HBW::BPMUser.fetch_all
end
def use... | 26.555556 | 85 | 0.608189 |
1c31c9ef0b170ee4ef2b0e7cd34ab63ad760303b | 4,327 | # frozen_string_literal: true
class LeaveTime < ApplicationRecord
delegate :seniority, :name, to: :user
enum leave_type: Settings.leave_times.quota_types
belongs_to :user
has_many :leave_applications, through: :leave_time_usages
has_many :leave_time_usages
before_validation :set_default_values
afte... | 27.916129 | 178 | 0.72868 |
87622bc9ef867620856d4dd31b0e36adfc39962a | 5,004 | # This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require it in any
# file... | 48.115385 | 101 | 0.739808 |
fff93aee7e1293fded4c897104ec602f8da1960f | 194 | class RolesUserScreen < WulinMaster::Screen
title 'User roles'
path '/roles_users'
grid RolesUserGrid, width: '500px', height: '250px'
def authorized?(user)
user.admin?
end
end
| 16.166667 | 53 | 0.701031 |
384d1dd2e504da5ad90f7a7ef18547217631838c | 789 | # frozen_string_literal: true
module Notes
class UpdateService < BaseService
def execute(note)
return note unless note.editable?
old_mentioned_users = note.mentioned_users.to_a
note.update(params.merge(updated_by: current_user))
note.create_new_cross_references!(current_user)
if ... | 24.65625 | 76 | 0.685678 |
08e9259bc80b5823328a7ec85bf2567871a76b24 | 677 | class Gws::Link
include SS::Document
include Gws::Referenceable
include Gws::Reference::User
include Gws::Reference::Site
include Gws::Addon::Link
include SS::Addon::Release
include Gws::Addon::ReadableSetting
include Gws::Addon::GroupPermission
include Gws::Addon::History
seqid :id
field :name, ... | 22.566667 | 94 | 0.694239 |
39723c0ff9fae547370bd4d47a0635ff6e953166 | 14,546 | # 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... | 38.178478 | 191 | 0.719648 |
6a069611590a4de2bf73612fb19d5583e7ca4b72 | 1,569 | # -*- encoding: utf-8 -*-
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'engineyard'
Gem::Specification.new do |s|
s.name = "engineyard"
s.version = EY::VERSION
s.platform = Gem::Platform::RUBY
s.author = "EY Cloud Team"
s.email = "cloud@engineyard.com"
s.homepa... | 37.357143 | 129 | 0.695985 |
d5b0ee5d7234731390bd41550795b03e08819413 | 19,638 | #--
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: AJ Christensen (<aj@chef.io>)
# Copyright:: Copyright 2008-2016, 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 ... | 32.193443 | 200 | 0.614828 |
ffbbc795c10f9dbc37aad76438483070ee3d01d9 | 594 | require 'helper'
module Syck
class TestString < Test::Unit::TestCase
def test_usec_long
bug4571 = '[ruby-core:35713]'
assert_equal(34, Syck.load("2011-03-22t23:32:11.0000342222+01:00").usec, bug4571)
end
def test_usec_very_long
t = "2011-03-22t23:32:11.0000342"+"0"*1000+"1+01:00"
... | 24.75 | 87 | 0.6633 |
39c6ccafa6b056dc1a6524b638e0b21894c692cb | 2,856 | class Wolfssl < Formula
desc "Embedded SSL Library written in C"
homepage "https://www.wolfssl.com"
url "https://github.com/wolfSSL/wolfssl.git",
tag: "v4.7.0-stable",
revision: "830de9a9fb99e30f9ac9caa0a7f7bba29c3b4863"
license "GPL-2.0-or-later"
head "https://github.com/wolfSSL/wolfssl.git"... | 28.848485 | 122 | 0.626401 |
1d0400849ca0c62f3f4b4be67c04e7bdc7b2db0f | 353 | # frozen_string_literal: true
class AddFieldsToRemoteThemes < ActiveRecord::Migration[5.2]
def change
add_column :remote_themes, :authors, :string
add_column :remote_themes, :theme_version, :string
add_column :remote_themes, :minimum_discourse_version, :string
add_column :remote_themes, :maximum_disc... | 32.090909 | 66 | 0.784703 |
62c5a2d9ccba1b562597f9e0b5cf2be33896dc13 | 12,910 | # 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... | 49.653846 | 154 | 0.752905 |
ff6ccb3347d636be648c8cd2d1d76ee8dcedcda6 | 3,075 | require 'app-common-ruby'
require 'singleton'
class ClowderConfig
include Singleton
def self.instance
@instance ||= {}.tap do |options|
if ENV["CLOWDER_ENABLED"]
config = LoadedConfig
options["webPorts"] = config.webPort
options["metricsPort"] = config.metricsPort
options... | 43.928571 | 106 | 0.666016 |
1a94407ebcca9120e38ef33d13a860fda47590b7 | 475 | # Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def show_locale_files
output = ''
@locale_files.sort.each do |locale_file|
output << "\n#{locale_file.sub(RAILS_ROOT + "/", "")}:\n\n"
counter, lineWidth = 1, 80
lines = *open(local... | 29.6875 | 85 | 0.621053 |
bfd8ff098ba8b73df5979ba7f3a3c7aff4bed18c | 687 | shared_context "setup for builder interface" do
let(:builder_initialization_args) { [] }
let(:builder) { instance_double(described_class.to_s) }
let(:build_result) { double("a result of build") }
def expect_builder_initialization
expect_to_receive_exactly_ordered_and_return(
1, described_class, :new,... | 29.869565 | 82 | 0.783115 |
5dbd55bc479da141a08b375470fdc193cb07a22b | 129 | class Animal < ApplicationRecord
belongs_to :user
has_one :adoption
validates :name, :categorie, :user, presence: true
end
| 21.5 | 52 | 0.75969 |
ab8c46627c9715d9443954ff8052885a890873d0 | 15,235 | # frozen_string_literal: true
# Assuming you have not yet modified this file, each configuration option below
# is set to its default value. Note that some are commented out while others
# are not: uncommented lines are intended to protect your configuration from
# breaking changes in upgrades (i.e., in the event that... | 48.519108 | 154 | 0.752609 |
ac0c2d84918648b6fd7fba9a710e5ed93f7e2709 | 434 | cask 'qlab' do
version '4.0'
sha256 'ea36f0df90934ebf6cd6f9f34286304d27a7b727f7e26aa8365fc807afe78466'
url "https://figure53.com/qlab/downloads/QLab-#{version}.zip"
appcast "https://figure53.com/qlab/downloads/appcast-v#{version.major}/",
checkpoint: '10cc503ea8aaf0c37b367ca299f6a3bd84553656ba4d69cc3... | 28.933333 | 88 | 0.760369 |
288855b44760608a2025dda31effba3aa0685748 | 660 | require "rails_helper"
RSpec.describe "Documents" do
let(:vacancy) { create(:vacancy, organisation_vacancies_attributes: [{ organisation: build(:school) }]) }
let(:document) { vacancy.documents.first }
describe "GET #show" do
it "redirects to the document link" do
get document_path(document)
ex... | 31.428571 | 107 | 0.721212 |
abaf3aa1d65b529c9ac5db72378c6c483798a8cf | 3,317 | #!/usr/bin/env ruby
require 'minitest/autorun'
require 'termkit'
class TestController < MiniTest::Test
include TheFox::TermKit
def test_controller
controller1 = Controller.new
assert_instance_of(Controller, controller1)
end
def test_active
controller1 = Controller.new
controller2 = Controller.new
... | 28.594828 | 74 | 0.801326 |
628b82ad66c3da0f2f1d3038c2fb82598fe94a4f | 4,764 | # Object representing a case manager.
# Fields are all devise settings; most of the methods relate to call list mgmt.
class User
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Userstamp::User
include Mongoid::History::Trackable
extend Enumerize
include UserSearchable
include CallL... | 30.343949 | 79 | 0.680101 |
ac55e896e11f7b9a3d6cb7a8f24ccb45c7fe65ef | 779 | module Granz::DiscordCommands
module Neko
extend Discordrb::Commands::CommandContainer
command :neko do |event|
next event.channel.send_embed do |embed|; embed.title = "I'm sorry. I can't do that because this is a SFW channel."; embed.color = 0xffff00; embed.image = Discordrb::Webhooks::EmbedImage.new(u... | 38.95 | 267 | 0.655969 |
01bb9e955e01c4201e4fe75b2524cda398076f9b | 9,508 | require 'spec_helper'
describe API::Helpers, api: true do
include API::Helpers
include ApiHelpers
include SentryHelper
let(:user) { create(:user) }
let(:admin) { create(:admin) }
let(:key) { create(:key, user: user) }
let(:params) { {} }
let(:env) { { 'REQUEST_METHOD' => 'GET' } }
let(:request) { R... | 32.340136 | 89 | 0.667753 |
0899737a02d2f4c9659953da85cceba26b82ba84 | 162 | class AddSlugToRambles < ActiveRecord::Migration
def change
add_column :rambles, :slug, :string
add_reference :rambles, :rambles, index: true
end
end
| 23.142857 | 49 | 0.740741 |
accd6bd675f1491de81eada1183d74c9a5f23dae | 2,203 | # 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... | 42.365385 | 116 | 0.705856 |
1a13c8df302016be422c03ac6503b56f5b0cb915 | 13,664 | require 'puppet'
require 'puppet/util/filetype'
require 'puppet/util/fileparsing'
# This provider can be used as the parent class for a provider that
# parses and generates files. Its content must be loaded via the
# 'prefetch' method, and the file will be written when 'flush' is called
# on the provider instance. A... | 30.774775 | 138 | 0.683182 |
9119279e770e3c9f6e9e2928e1f2e6eba0e609df | 519 | # frozen_string_literal: true
module States
STATES = %w[
AL
AK
AS
AZ
AR
CA
CO
CT
DE
DC
FM
FL
GA
GU
HI
ID
IL
IN
IA
KS
KY
LA
ME
MH
MD
MA
MI
MN
MS
MO
MT
NE
NV
NH
NJ
NM
NY
... | 7.414286 | 29 | 0.364162 |
26d9b4b223f31866d76cb32cb414c345dc653ae7 | 2,362 | # frozen_string_literal: true
module Projects
module Import
class JiraController < Projects::ApplicationController
before_action :authenticate_user!
before_action :check_issues_available!
before_action :authorize_read_project!
before_action :jira_import_enabled?
before_action :jira_... | 35.253731 | 151 | 0.680356 |
e213ef46898872447296d651bc91337f61c7b9c2 | 262 | class CreateOrders < ActiveRecord::Migration[5.2]
def change
create_table :orders do |t|
t.string :name
t.string :phone
t.string :email
t.text :address
t.integer :zip
t.text :orders
t.timestamps
end
end
end
| 17.466667 | 49 | 0.60687 |
4ad6e5d88069e23bce47a0bc13540ce70bd14069 | 2,074 | require 'csv'
# RAILS_ENV=production bundle exec rake reports:monthly_reports_sep date="Month,Year"
namespace :reports do
desc "Monthly sep enrollments report"
task :monthly_reports_sep => :environment do
def date
begin
ENV["date"].strip
rescue
puts 'Provide report month.'
end
end
def ... | 29.211268 | 115 | 0.608004 |
bb8594e026a25738461bbc4db52468d0ae048247 | 1,028 | class Mill < Formula
desc "Scala build tool"
homepage "https://com-lihaoyi.github.io/mill/mill/Intro_to_Mill.html"
url "https://github.com/com-lihaoyi/mill/releases/download/0.10.3/0.10.3-assembly"
sha256 "a5342282df2c1bee00cc373715abff427dbb08d1f49481ee43740c039b8c76a2"
license "MIT"
livecheck do
url ... | 27.783784 | 112 | 0.698444 |
b9d477b50cf22fcadf283d6d64af9e3c67e9b9c3 | 328 | def mysqld_bin
return '/opt/mysql51/bin/mysqld' if os[:family] =~ /solaris/
return '/opt/local/bin/mysqld' if os[:family] =~ /smartos/
'/usr/sbin/mysqld'
end
def mysqld_cmd
"#{mysqld_bin} --version"
end
describe command(mysqld_cmd) do
its(:exit_status) { should eq 0 }
its(:stdout) { should match(/Ver 5.6/... | 21.866667 | 62 | 0.676829 |
e26f79d0046f32e4259c10d496a459297857c41d | 573 | require_relative '../../../spec_helper'
require 'stringio'
require 'zlib'
describe "Zlib::GzipFile#close" do
it "finishes the stream and closes the io" do
io = StringIO.new "".b
Zlib::GzipWriter.wrap io do |gzio|
gzio.close
gzio.closed?.should == true
lambda { gzio.orig_name }.should \
... | 24.913043 | 65 | 0.631763 |
1dbf6769ebe4c3c44d55838df53d6017146234a7 | 999 | require 'test_helper'
class UsersSignupTest < ActionDispatch::IntegrationTest
test "Invalid sign up information" do
get signup_path
assert_select 'form[action="/signup"]'
assert_no_difference 'User.count' do
post users_path, params: { user: { name: "", email: "user@invalid",
password:... | 32.225806 | 78 | 0.605606 |
330cde41f9f27104de6b513d1c956e3a558b41fd | 1,251 | #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork ... | 41.7 | 91 | 0.763389 |
6ab0a3e12c4a772ace949edb62655f8addb7b3a1 | 627 | Pod::Spec.new do |s|
s.name = 'SGControllerTransition'
s.summary = 'It is no longer difficult to animate the controller.'
s.version = '1.0.0'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.authors = { 'sylphghost' => 'sylphghost@outlook.com' }
s.homepage = 'https://gith... | 41.8 | 113 | 0.620415 |
01a0b740bcec81993a45c4dc5a58cb357af2583e | 1,205 | # frozen_string_literal: true
require 'spec_helper'
describe "Taxonomies and taxons", type: :feature do
stub_authorization!
it "admin should be able to edit taxon" do
visit spree.new_admin_taxonomy_path
fill_in "Name", with: "Hello"
click_button "Create"
@taxonomy = Spree::Taxonomy.last
vi... | 27.386364 | 82 | 0.707884 |
ff94fa793abb76f1e0e3709c01f34c02146cc620 | 80 | $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "picoyplaca"
| 26.666667 | 58 | 0.7375 |
bff79b52c77ab3eb39f56b2cfccb5f0f08aa4033 | 162 | require 'test_helper'
class DummyControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end
end
| 16.2 | 54 | 0.753086 |
1c920cbc7bc62c02a2285375515b61817f57c564 | 765 | Rails.application.routes.draw do
root "static#home"
devise_for :users, controllers: { registrations: 'registrations', omniauth_callbacks: 'users/omniauth_callbacks' }
resources :book_clubs, only: [:show] do
resources :comments, only: [:index, :edit, :update, :destroy]
end
resources :authors, only: [... | 23.90625 | 116 | 0.712418 |
f8be69b912f41c566813073c8b5939379f329438 | 181 | class AddSafetyStockToProducts < ActiveRecord::Migration[5.2]
def change
add_column :products, :safety_stock, :integer, null: false, default: 0, after: :dimension_w
end
end
| 30.166667 | 95 | 0.756906 |
e2c32fd8a8548b81a38076f6289f4e2545eadb0d | 1,579 | # -*- ruby -*-
# encoding: utf-8
require File.expand_path("lib/google/cloud/firestore/admin/v1/version", __dir__)
Gem::Specification.new do |gem|
gem.name = "google-cloud-firestore-admin-v1"
gem.version = Google::Cloud::Firestore::Admin::V1::VERSION
gem.authors = ["Google LLC"]
gem.email... | 41.552632 | 152 | 0.658011 |
28f5b48833c48c84464c36b9431fdc5fb2c7900e | 3,057 | require 'spec_helper'
describe 'spike spec' do
class Phone
include Virtus::ValueObject
attribute :number, String
attribute :type, String
Mapper = ::Mapper::Document.build(self) do
map :number
map :type
end
end
class Address
include Virtus::ValueObject
attribute :lin... | 24.261905 | 108 | 0.577691 |
d5b24a72ec9328b9eb36e517290a67a02df3033e | 1,786 | require 'fileutils'
require 'json'
dir = "/Users/gabe/Pictures/Streamline - PNG/PNG Outline"
#style = "black"
icons_dirname = "Streamline-Outline"
includes = ["lock-4", "arrow-67", "arrow-65", "key-2", "bitcoins", "computer", "folder-add",
"bin-2", "add-1", "clip-1", "antenna-3", "upload-2"]
script_path = File.expa... | 26.656716 | 95 | 0.567749 |
bfdfe913d3ccfa6d1ba6ac9c863cc58ffe745c45 | 902 | ######################################################################
# tc_sid_available.rb
#
# Test case for the Process::GID.sid_available module method.
######################################################################
require 'test/unit'
require 'test/helper'
class TC_ProcessGID_SidAvailable_ModuleMethod < T... | 30.066667 | 71 | 0.615299 |
3810dc8fca4c6a1c77682fd1ce25c7dfd8c4056d | 384 | def partition(head, pivot)
larger = larger_tail = ListNode.new(-1)
smaller = smaller_tail = ListNode.new(-1)
while head
if head.val < pivot
smaller_tail.next = head
smaller_tail = head
else
larger_tail.next = head
larger_tail = head
end
head = head.next
end
larger_tail.... | 21.333333 | 43 | 0.661458 |
91e961bf83ffb5d0af5920f4015101acde7bc0c9 | 1,617 | describe APIv2::Auth::Middleware, type: :request do
class TestApp < Grape::API
helpers APIv2::Helpers
use APIv2::Auth::Middleware
get '/' do
authenticate!
current_user.email
end
end
let(:app) { TestApp.new }
context 'when using JWT authentication' do
let(:member) { create(:mem... | 30.509434 | 92 | 0.632653 |
e9f882699e3a1dcc7803e2c954955c4fab32e67a | 7,802 | # Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License 00:00:00Z");
# 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 applicable law or agreed to in... | 48.160494 | 177 | 0.694437 |
ac81b5b86a11217b42d299fffac642828c6d1e63 | 590 | Pod::Spec.new do |s|
s.name = "AFTumblrAPIClient"
s.version = "0.0.1"
s.summary = "AFOAuth1Client for Tumblr."
s.homepage = "https://github.com/pj4533/AFTumblrAPIClient"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "PJ Gray" => "pj4533@gmail.com" }
s.so... | 36.875 | 97 | 0.588136 |
ab1aa70a7ed2c2ea1491ec9000fc29d48283f43a | 2,532 | # 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... | 38.363636 | 95 | 0.68128 |
f7fda00de4e6a619d2d17b25b44ee53dc0685b16 | 2,286 | # encoding: UTF-8
# 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 sou... | 37.47541 | 121 | 0.713911 |
d55e91a85ee81df7cfa8a55f84df1a71fa08cec5 | 556 | module Recipes
class SimpleForm < Base
is_auto_runnable
def gems
@template.gem 'simple_form'
end
def cook
add_sample_i18n
end
private
def add_sample_i18n
@template.run 'rm config/locales/simple_form.en.yml'
@template.append_to_file 'config/locales/en.yml', simp... | 19.172414 | 84 | 0.669065 |
21b8eb6ce0d40e7ffb9fd83ea5cfd0eec4e0a993 | 1,086 | #
# Cookbook Name:: lvm
# Library:: matchers
#
# Copyright 2014, 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
#
# Unl... | 32.909091 | 89 | 0.770718 |
218f69cadfb45e696a4c566af8715e1fd250ff8c | 1,543 | #-- encoding: UTF-8
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2021 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProj... | 33.543478 | 91 | 0.733636 |
289f078867f25d70710986acbe58332dbbbf01fa | 11,605 | # frozen_string_literal: true
require 'rubygems/test_case'
require 'rubygems/platform'
require 'rbconfig'
class TestGemPlatform < Gem::TestCase
def test_self_local
util_set_arch 'i686-darwin8.10.1'
assert_equal Gem::Platform.new(%w[x86 darwin 8]), Gem::Platform.local
end
def test_self_match
assert... | 37.435484 | 80 | 0.594054 |
4a6fa28b89c99e6279072712598d0ee30148cf10 | 1,533 | module Moped
module BSON
# @private
module Types
class CodeWithScope
def self.__bson_load__(io)
io.read 4 # swallow the length
code = io.read(*io.read(4).unpack(INT32_PACK)).from_utf8_binary.chop!
scope = BSON::Document.deserialize(io)
Code.new code, sc... | 22.544118 | 79 | 0.545336 |
017fff9f05fa65cfb404b68396b2e311e692e7b9 | 735 | # frozen_string_literal: true
module EE
module IdeHelper
extend ::Gitlab::Utils::Override
override :ide_data
def ide_data
super.merge({
"ee-web-terminal-svg-path" => image_path('illustrations/web-ide_promotion.svg'),
"ee-web-terminal-help-path" => help_page_path('user/project/web_i... | 36.75 | 154 | 0.69932 |
d56910a60a35e05d0f0e35c2f501738af730cd01 | 1,653 | require "spec_helper"
RSpec.describe Scruber::Core::Extensions::CsvOutput do
describe "register" do
it "should extend Scruber::CsvOutput with csv_file and csv_out method" do
described_class.register
expect(Scruber::Core::Crawler.method_defined?(:csv_file)).to be_truthy
expect(Scruber::Core::C... | 36.733333 | 113 | 0.695705 |
28654f6b8e8afc8db2845e0eb56529c6b9400cac | 456 | class CreateSongs < ActiveRecord::Migration[5.0]
def change
create_table :songs do |t|
t.string :external_id, null: false, index: true
t.string :title
t.integer :disc_number, default: 1
t.integer :track_number
t.boolean :explicit
t.integer :duration
t.references :album
... | 24 | 62 | 0.662281 |
5d7ec9c8866e69d86fe340fb4ad82adb8baec427 | 725 | # frozen_string_literal: true
module Kozo
class Parser
attr_reader :directory
def initialize(directory)
@directory = directory
end
def call
configuration = Configuration.new(directory)
dsl = DSL.new(configuration)
Dir[File.join(directory, "main.kz"), File.join(directory, "*... | 20.138889 | 78 | 0.584828 |
33da536899c6e7ddd11b492234aca8b5c818d97e | 302 | class abstractObject < ::Object
def init
super
end
include ::Comparable
def <=> (obj)
if is_a?(obj.type)
return compareTo(obj)
elsif obj.is_a?(type)
return -obj.compareTo(self)
else
return type.name <=> obj.type.name
end
end
abstractMethod :compareTo
protected :compareTo
end
| 16.777778 | 37 | 0.698675 |
61f282f5576b222a26cf6ab5780ecb4eea9bbb2a | 984 | # frozen_string_literal: true
require_relative '../game/base_game/game'
class GameDTO
class GameDTOError < StandardError; end
# Error received when trying to initialize a GameDTO with an invalid game (game should be a Game)
class InvalidGameGameDTOError < GameDTOError
# @return [String]
def message
... | 20.5 | 99 | 0.669715 |
f707738796b864cee9ff3021a7e5bebad1ac535b | 2,187 | #!/usr/bin/env ruby -rubygems
# -*- encoding: utf-8 -*-
Gem::Specification.new do |gem|
gem.version = File.read('VERSION').chomp
gem.date = File.mtime('VERSION').strftime('%Y-%m-%d')
gem.name = 'rdf'
gem.homepage = 'https://github.com/ruby-rdf/rdf'
gem.licens... | 46.531915 | 120 | 0.61454 |
ed0779de12da09925baa987d25619f6f1e99bc4e | 1,495 | # 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.co.ca/co.ca/status_registered.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec_helper'
describ... | 36.463415 | 78 | 0.727759 |
625a729d55ca54085edaa9796a98b4a6e2b9cbae | 1,031 | Rails.application.routes.draw do
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
root(controller: "tickets", action: "index")
get("/callback", controller: "sessio... | 30.323529 | 84 | 0.665373 |
2176629782708bc62ebb4040c439cd54a588a5f0 | 1,789 |
# This file is automatically generated by puppet-swagger-generator and
# any manual changes are likely to be clobbered when the files
# are regenerated.
require_relative '../../../puppet_x/puppetlabs/kubernetes/provider'
Puppet::Type.type(:kubernetes_pod).provide(:swagger, :parent => PuppetX::Puppetlabs::Kube... | 21.047059 | 110 | 0.593628 |
18bc9b2d51b1fd7a5fb4484d4090f638354a1b42 | 1,512 | module Tkellem
module EasyLogger
require 'logger'
def self.logger=(new_logger)
@logger = new_logger
if @logger.is_a?(Logger)
@logger.formatter = proc do |severity, time, progname, msg|
obj, msg = msg if msg.is_a?(Array)
"#{time.strftime('%y-%m-%dT%H:%M:%S')} #{severity... | 24.786885 | 140 | 0.582011 |
03a5dcd3a041928890778892afec95ce663be516 | 842 | # frozen_string_literal: true
module ActionCable
module Channel
module Naming
extend ActiveSupport::Concern
class_methods do
# Returns the name of the channel, underscored, without the <tt>Channel</tt> ending.
# If the channel is in a namespace, then the namespaces are represented by... | 32.384615 | 92 | 0.644893 |
4a8cdef09fe2ed4e9cecb5e5b35d7d7dca4f6d7c | 45 | module SmartyStreets
VERSION = '0.0.4'
end
| 11.25 | 20 | 0.711111 |
91fa8a0396b5082c4ae6c39c8fd98642079127a3 | 8,736 | require "spec_helper"
describe RegistrantPolicy do
subject { described_class }
let(:my_user) { FactoryBot.create(:user) }
let(:my_registrant) { FactoryBot.create(:registrant, user: my_user) }
let(:other_registrant) { FactoryBot.create(:registrant) }
let(:ara_readonly) { FactoryBot.create(:additional_regist... | 32.966038 | 158 | 0.671932 |
18004bc76cde9a2dbc6f403bfbb6805a223ede2c | 913 | require 'test_helper'
class SiteLayoutTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
end
test "layout links" do
get root_path
assert_template 'static_pages/home'
assert_select "a[href=?]", root_path, count: 2
assert_select "a[href=?]", help_path
assert_select "... | 27.666667 | 54 | 0.685652 |
032cd8d0115bdef553679c1eb23933eaad87e936 | 925 | class SetActiveFlagToConnectedPaypalAccounts < ActiveRecord::Migration[4.2]
def up
execute("UPDATE paypal_accounts
LEFT JOIN billing_agreements ON (paypal_accounts.id = billing_agreements.paypal_account_id)
LEFT JOIN order_permissions ON (paypal_accounts.id = order_permissions.paypal_acc... | 34.259259 | 104 | 0.585946 |
d57896198dc02ee28b71ba6ee43fa737ef179773 | 1,567 | module Interactor
describe "Rails using Test::Unit" do
def last_command_started
# Account for older versions of Aruba as required by Rails 3.0
Aruba::Api.method_defined?(:last_command_started) ? super : last_command
end
before do
run_command_and_stop <<-CMD
bundle exec rails new... | 25.688525 | 86 | 0.596682 |
e933b0ed2cbc735c51b91d7e1c7317443b8698d5 | 122 | class AddLastnameToUsers < ActiveRecord::Migration[5.1]
def change
add_column :users, :last_name, :string
end
end
| 20.333333 | 55 | 0.745902 |
38675d0add003bd3ec0a9d6caae30e61f2c88df7 | 487 |
require "opencv-rice"
require "minitest/autorun"
require_relative '../common'
class TestScalar < Minitest::Test
include CVRice
EPSILON = 1e-6
def test_null_constructor
s = Scalar.new
4.times.each { |i| assert_in_delta 0, s[i], EPSILON }
end
def test_constructor
s = Scalar.new( 2.0, 4.0 )
... | 17.392857 | 58 | 0.671458 |
ab3097c3eec7ef6fffb77aaeb4233196a69c15d2 | 138 | require "test_helper"
class VisitsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
| 17.25 | 60 | 0.73913 |
395b56f81d23d9abba251dd6e73b01a49ac40bac | 791 | module Maintenance
module User
class DmailFiltersController < ApplicationController
before_action :ensure_ownership
respond_to :html, :json, :xml
def edit
@dmail_filter = CurrentUser.dmail_filter || DmailFilter.new
end
def update
@dmail_filter = CurrentUser.dmail_fi... | 23.264706 | 67 | 0.646018 |
bb4542b1683522c8511686337a4d070d7b78f553 | 8,124 | shared_examples 'discussion comments' do |resource_name|
let(:form_selector) { '.js-main-target-form' }
let(:dropdown_selector) { "#{form_selector} .comment-type-dropdown" }
let(:toggle_selector) { "#{dropdown_selector} .dropdown-toggle" }
let(:menu_selector) { "#{dropdown_selector} .dropdown-menu" }
let(:sub... | 36.927273 | 152 | 0.656204 |
621958937907aa40e99d92acfbe71ba57afc97ef | 2,030 | class CreateProductDownloads < ActiveRecord::Migration
def self.up
create_table :product_downloads do |t|
t.string :title
t.string :description
t.string :attachment_file_name
t.string :attachment_content_type
t.integer :attachment_file_size
t.boolean :enabled, :default => true
... | 36.25 | 101 | 0.614778 |
18833ab7b60465a7992f8c60e7b182e29c20020b | 1,068 | module Arithmetic
class OperandNode
attr_accessor :operand
def initialize(operand)
@operand = operand
end
def to_s(visitor, na=nil)
visitor.call(@operand)
end
def eval
if has_dangling_decimal_point?
BigDecimal(@operand + "0")
else
BigDecimal(@operand)... | 20.150943 | 78 | 0.596442 |
219b7b2bd64ef4fce5e00dcd0a3db75fad0689aa | 4,767 | # Copyright 2019 The inspec-gcp-cis-benchmark Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 61.909091 | 907 | 0.772603 |
bfa476ade2af9daf173c6a4ab1c7c5309019ab9d | 672 | require 'yt/collections/base'
require 'yt/models/status'
module Yt
module Collections
class Statuses < Base
private
def attributes_for_new_item(data)
{data: data['status']}
end
# @return [Hash] the parameters to submit to YouTube to get the status
# of a resource, for ins... | 25.846154 | 76 | 0.626488 |
2881ea026cc4e55c971a59283eb1d03fff2408f1 | 1,112 | # frozen_string_literal: true
Gem::Specification.new do |spec|
spec.name = 'jekyll-theme-8bit'
spec.version = '0.6.0'
spec.authors = ['Juliano Fernandes']
spec.email = ['julianofernandes@gmail.com']
spec.summary = 'A Jekyll theme inspired by classic 8bit games.'
spec.homepage = 'https://github.co... | 39.714286 | 66 | 0.691547 |
017b805a1508b48f443117cd32243dcfceddadf9 | 5,857 | # Copyright (c) 2016, 2022, 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... | 36.154321 | 245 | 0.679529 |
1d804c0f0b00297f0e9a5da49e8d0571b7fc6d46 | 410 | require 'spec_helper'
describe OpenConferenceWare::Snippet do
it "should find the content for the slug" do
snippet = create(:snippet, slug: 'fireplace',
description: 'the metal box',
content: 'things on fire')
Snippet.content_for('fireplace')... | 29.285714 | 63 | 0.6 |
1a0e704c352eea0e390bca1126528042bd875995 | 897 | require 'sprockets/base'
require 'sprockets/cached_environment'
module Sprockets
class Environment < Base
# `Environment` should initialized with your application's root
# directory. This should be the same as your Rails or Rack root.
#
# env = Environment.new(Rails.root)
#
def initialize... | 27.181818 | 68 | 0.684504 |
285d795f1c1212c5b885e7e5ba4eb6e2b66a079a | 11,348 | #
# Cookbook:: nominatim
# Recipe:: base
#
# Copyright:: 2015, OpenStreetMap Foundation
#
# 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
#
#... | 24.247863 | 113 | 0.698097 |
394b8219c7d859cdd18a18ff90950aba70065758 | 981 | cask "eloston-chromium" do
if Hardware::CPU.intel?
version "90.0.4430.212-1.1_x86-64"
sha256 "fb1c992747f1667283f0820d92315a195d7a91c4135226e7cd424e93de2675c4"
else
version "90.0.4430.93-1.1_arm64"
sha256 "efecba9e8c1ffdfb457448cc3b139c9c5d86135b4a73af373a0a4f6bb27fa17b"
end
url "https://github... | 32.7 | 129 | 0.744139 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.