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 |
|---|---|---|---|---|---|
794cab618ca4a39aa565f3a6428580e79196f4d9 | 485 | cask 'pgweb' do
version '0.9.5'
sha256 '677af53daac6c44f1bdc304bc6285245fef5a75b2a0f7a76d03213afb7268e3a'
url "https://github.com/sosedoff/pgweb/releases/download/v#{version}/pgweb_darwin_amd64.zip"
appcast 'https://github.com/sosedoff/pgweb/releases.atom',
checkpoint: '9aee4e4f2d0ff344e9e255b8d82b8a... | 34.642857 | 94 | 0.779381 |
b915c2c900ae1a385038ed4208d5c584b699ec47 | 259 | require 'simplecov'
require 'simplecov-console'
SimpleCov.formatter = SimpleCov::Formatter::Console
SimpleCov.start
require 'rspec'
require 'process_exists'
def running_specs_as_root?
# The superuser normally has a UID of zero (0)
Process.uid == 0
end
| 18.5 | 51 | 0.776062 |
e8b09212bae989c0648693de2ffe36c2ce2d9702 | 4,551 | # Copyright (C) 2014-2015 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 ... | 27.920245 | 74 | 0.518348 |
ab3e2a9d6eac8a153a47bd8b62a8a05689621763 | 2,822 | class ApiMaker::ValidationErrorsGeneratorService < ApiMaker::ApplicationService
attr_reader :model, :params, :result
def initialize(model:, params:)
@model = model
@params = params
@result = []
end
def execute
path = [model.model_name.singular]
inspect_model(model, path)
inspect_param... | 29.395833 | 124 | 0.7073 |
acf89295510030f9ad8a12814b03edd96107ecea | 3,788 | 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.173913 | 102 | 0.757128 |
bf22ec08738e91a7bc6ff33e81b9a1fb19008558 | 545 | # -----------------------------------------------------------------------------
# Generates necessary xml for a Column chart
#
# Author: Fernand
# -----------------------------------------------------------------------------
module Ziya::Charts
class Column < Base
# Creates a column chart
# <tt>:license</tt>:... | 34.0625 | 79 | 0.447706 |
62efb67436f53665eed22a4cd69f0dcf7ebd9727 | 568 | #---
# Excerpted from "Agile Web Development with Rails, 4rd Ed.",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any pur... | 33.411765 | 83 | 0.742958 |
1adaf23d92a5b05042b950520783ef603dc7ee5f | 1,356 | # In Ruby, your information can come in different types. There are three data types in Ruby that we're interested in right now: numbers, booleans (which can be true or false), and strings (words or phrases like "I'm learning Ruby!").
# 1. Strings are words or phrases wrapped in parentheses.
# Write something to be you... | 46.758621 | 362 | 0.748525 |
2696d144db48ed6b2bff70b319d61fe70b68ff37 | 42,455 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Environment, :use_clean_rails_memory_store_caching do
include ReactiveCachingHelpers
using RSpec::Parameterized::TableSyntax
include RepoHelpers
include StubENV
include CreateEnvironmentsHelpers
let(:project) { create(:project, :repositor... | 30.876364 | 139 | 0.659993 |
f82fd54d80764a42d5f78c4da864b8227551b22c | 1,230 | #
#The MIT License (MIT)
#
#Copyright (c) 2016, Groupon, Inc.
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify... | 39.677419 | 78 | 0.77561 |
4ab060b2b726c259680d3d0fcc97e8a3ad3f4aeb | 5,175 | # frozen_string_literal: true
# == Schema Information
#
# Table name: activity_logs
#
# id :bigint not null, primary key
# controller_name :string
# action_name :string
# http_format :string
# http_method :string
# path :string
# http_status :integer
# user_id ... | 35.445205 | 112 | 0.629758 |
4a8e58ee203579041e07a7443a2cd9b07118c581 | 12,808 | # -*- encoding : utf-8 -*-
require 'test_helper'
class SiteControllerTest < ActionController::TestCase
basic_test :carcel, :smileys, :rss, :contactar, :privacidad, :album, :fusiones, :webs_de_clanes, :logo, :responsabilidades, :portales, :novedades
test "should_create_pageview" do
dbr = User.db_query("SELECT ... | 31.239024 | 147 | 0.698782 |
1d921dc273c92638b55fa2f62330e686b1ca1aae | 307 | class RsFormatValidator < ValidatesRussian::Validator
# see format here: http://ru.wikipedia.org/wiki/Расчётный_счёт
validates_using do |rs|
next false unless rs.size == 20 || rs.size == 25
next false unless ValidatesRussian::OKV.include?(rs[5..7])
next false unless rs =~ /^\d+$/
end
end
| 34.111111 | 64 | 0.700326 |
d5d0247539fae19d6f7d77976284faf9ed7fee0c | 3,159 | #--
# Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
# Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
#++
require_relative 'base'
module Whois
class Parsers
#
# = whois.nic.ch parser
#
# Parser for the whois.nic.ch server.
#
# NOTE: This parser is just a st... | 27.232759 | 105 | 0.571067 |
bfcfca24cf6d577288153f8ab7ee9363a1c1a7fe | 532 | # You'll get a string and a boolean.
# When the boolean is true, return a new string containing all the odd characters.
# When the boolean is false, return a new string containing all the even characters.
#
# If you have no idea where to begin, remember to check out the cheatsheets for string and logic/control
#
def o... | 35.466667 | 104 | 0.731203 |
61c9495e2def25918eca8b75357523c7392a9275 | 6,069 | class Dnsviz < Formula
include Language::Python::Virtualenv
desc "Tools for analyzing and visualizing DNS and DNSSEC behavior"
homepage "https://github.com/dnsviz/dnsviz/"
url "https://files.pythonhosted.org/packages/a5/7c/b38750c866e7e29bc76450c75f61ede6c2560e75cfe36df81e9517612434/dnsviz-0.9.4.tar.gz"
sha2... | 43.661871 | 139 | 0.703081 |
e26fd0df749e865264d671a4e9efbe0c506b70cf | 783 | require 'ruby-prof'
require 'rack/mock'
require 'allocation_stats'
require 'scorched'
require 'sinatra/base'
scorched = Class.new(Scorched::Controller) do
get '/' do
'Hello world'
end
end
sinatra = Class.new(Sinatra::Base) do
get '/' do
'Hello world'
end
end
scorched_stats = AllocationStats.new(bur... | 23.029412 | 77 | 0.735632 |
f84d6b17aa7aefa36cec63cb71e55d50eb718264 | 17,221 | RSpec.describe Hanami::Router do
before do
@router = Hanami::Router.new
@app = Rack::MockRequest.new(@router)
end
after do
@router.reset!
end
describe '#namespace' do
it 'recognizes get path' do
@router.namespace 'trees' do
get '/plane-tree', to: ->(_env) { [200, {}, ['Trees... | 40.048837 | 216 | 0.610998 |
18145513095fc0e6c85e215c1f07a91066af0996 | 984 |
Pod::Spec.new do |spec|
spec.name = "GENTransition"
spec.version = "0.0.1"
spec.summary = "A Lib For transition."
spec.description = <<-DESC
GENTransition是转场的封装
DESC
spec.homepage = "https://github.com/StoneStoneStoneWang/GENKit.git"
spec.license = { :type => "MIT", :f... | 28.941176 | 106 | 0.648374 |
08657376bc59b6e1a48b0f897fa1d6e1ed73b11e | 600 | module RailsAdmin
module Models
module Setup
module CategoryAdmin
extend ActiveSupport::Concern
included do
rails_admin do
weight 850
navigation_label 'Administration'
visible { User.current_super_admin? }
edit do
fiel... | 20.689655 | 60 | 0.516667 |
aba1551fc7cf449312fd627a5a468e13553548e5 | 40 | require 'omniauth/strategies/jwt_email'
| 20 | 39 | 0.85 |
79077079819362fd67fb6a2ce045842ca5ca5de6 | 3,301 | 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... | 40.753086 | 100 | 0.757952 |
185a216f51a88c382dea48d2f003caeb0e02b1d6 | 1,933 | #
# Be sure to run `pod lib lint XNNetWorkManager.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'XN... | 40.270833 | 200 | 0.673047 |
e2203a85c11cf4651b1ee26d0f5b29fc1e74a7ba | 2,038 | class SystemSettings < ActiveRecord::Base
self.table_name = 'system_settings'
attr_accessor :public_role, :default_markup_style
attr_accessor :site_default_page, :not_found_page, :permission_denied_page,
:session_expired_page
attr_accessible :id,:site_name, :site_subtitle, :footer_message, :pub... | 34.542373 | 115 | 0.645731 |
21bd95c318f5101ecb875681628955a0ded5bd11 | 694 | # Finds an existing file from a module and returns its path.
# (Documented in 3.x stub)
#
# @since 4.8.0
#
Puppet::Functions.create_function(:find_file, Puppet::Functions::InternalFunction) do
dispatch :find_file do
scope_param
repeated_param 'String', :paths
end
dispatch :find_file_array do
scope_pa... | 22.387097 | 85 | 0.693084 |
1da79b187057f022558bf3ab8ce2a0f80c769dcf | 1,387 | # encoding: utf-8
module Mongoid #:nodoc:
module Fields #:nodoc:
module Internal #:nodoc:
# Defines the behaviour for date fields.
class Date
include Serializable
include Timekeeping
# Deserialize this field from the type stored in MongoDB to the type
# defined on the... | 26.673077 | 76 | 0.542177 |
87f8fab3d5fe99773bfecb109ff552bf13766aa7 | 1,199 | class Friendship < ApplicationRecord
belongs_to :user
belongs_to :friend, class_name: 'User', foreign_key: 'friend_id'
validates_presence_of :user_id, :friend_id
# return true if the users are (possibly pending) friends
def self.exists?(user, friend)
!find_by_user_id_and_friend_id(user, friend).nil?
e... | 27.25 | 68 | 0.721435 |
612dc8068aee7bb8e4e0171b1ee0b3337332faea | 783 | # 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 | 74 | 0.731801 |
6a1dea3de1db56a82387edbdcf998c02b556028f | 295 | # frozen_string_literal: true
# This file is used by Rack-based servers to start the application.
require_relative 'config/environment'
require_relative 'lib/rack/x_robots_tag'
use Rack::XRobotsTag
use Rack::CanonicalHost, ENV['CANONICAL_HOST'] if ENV['CANONICAL_HOST']
run Rails.application
| 26.818182 | 71 | 0.80678 |
b9b099b925130a5d63da100ba75e12a97d9c4bf0 | 924 | require_relative '../test_helper'
require 'rubygems/user_interaction'
require 'rubygems/mock_gem_ui'
require 'rubygems/commands/compare_command'
class TestGemCommandsCompareCommand < Minitest::Test
include Gem::DefaultUserInteraction
def setup
super
@command = Gem::Commands::CompareCommand.new
@ui = ... | 23.1 | 108 | 0.695887 |
263617a3d0640c5919f06a7fb53a68c5168817e7 | 12,478 | ##########################################################################
# Copyright 2015 ThoughtWorks, 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/li... | 43.93662 | 225 | 0.687851 |
bf740ace1e8835d882911303f06c49db647657fa | 270 | module ConventionalChangelog
class CLI
def self.execute(params)
Generator.new.generate! parse(params)
end
def self.parse(params)
Hash[*params.map { |param| param.split("=") }.map { |key, value| [key.to_sym, value] }.flatten]
end
end
end
| 22.5 | 101 | 0.651852 |
21d4da95017646dcd4b580d6c6e26fc4b2fca101 | 917 | # frozen_string_literal: true
module TxOcr
class Image < Base
def initialize(file_path, ocr_type = 'GeneralBasicOCR')
@file_path = file_path
@ocr_type = ocr_type
extname = File.extname(@file_path)
basename = File.basename(@file_path, extname)
random_filename = Time.now.to_i.to_s
... | 26.970588 | 151 | 0.673937 |
1a85dbcaf1d8b262cceef1e50f636d5dfff49bb5 | 524 | require 'test/unit'
require 'mocha/setup'
require 'rspec-puppet'
require 'puppetlabs_spec_helper/module_spec_helper'
fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
# include common helpers
support_path = File.expand_path(File.join(File.dirname(__FILE__), '..',
... | 29.111111 | 71 | 0.685115 |
62dfe32ed0a3218260549bd8a35ee4442c46b78b | 1,297 | # frozen_string_literal: true
class LeaveTimeSummaryService
def initialize(year, month, users = User.filter_by_role(%w[employee parttime]))
@range = (
Time.zone.local(year, month).beginning_of_month..
Time.zone.local(year, month).end_of_month
)
@types = Settings.leave_times.quota_types.keys
... | 24.942308 | 106 | 0.67155 |
1d54c1fa188941e95ba83beb1fceac2585e33e48 | 285 | class CreatePackagePaymentRules < ActiveRecord::Migration[5.0]
def change
create_table :package_payment_rules do |t|
t.references :package, foreign_key: true, null: false
t.references :payment_rule, foreign_key: true, null: false
t.timestamps
end
end
end
| 28.5 | 64 | 0.726316 |
794cd3fc7fc756124124ba5a34f734f5464babe7 | 1,125 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module AppEngineRubySpike
class Application < Rails::Application
# Settings in config/environments/*... | 41.666667 | 99 | 0.736 |
e9eb2f8ef6a8a1ab6792665c10570e0b317129cd | 2,949 | # Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: AGPL-3.0
require 'test_helper'
class ResourceListTest < ActiveSupport::TestCase
reset_api_fixtures :after_each_test, false
test 'links_for on a resource list that does not return links' do
use_token :active
results = ... | 27.560748 | 101 | 0.687352 |
e866697c18a25bd96f53e5e17d97c6d8c2686f2e | 820 | # frozen_string_literal: true
require_relative '../../test_helper'
require 'open3'
require 'shellwords'
def cmd_to_sys(command)
Open3.popen3(command) do |_stdin, stdout, stderr|
[stdout.read, stderr.read]
end
end
describe DocParser do
it 'should run the example without problems' do
curwd = Dir.getwd
... | 26.451613 | 74 | 0.678049 |
f7a88f50bdb78523ce32571d2a5305b6a5518689 | 692 | class Activity < ApplicationRecord
has_many :records, dependent: :destroy
validates :name, presence: true
validates :hours_per_cycle, presence: true
def self.lowest_cycle
all.map(&:current_cycle).min.to_i
end
def total_hours_spent
records.map(&:hours_spent).inject(0) { |n, m| n + m }
end
def... | 21.625 | 57 | 0.735549 |
21420bb85100ec570403592fcfd76e0414d28299 | 1,047 | require "imgix/rails/url_helper"
require "action_view"
class Imgix::Rails::Tag
include Imgix::Rails::UrlHelper
include ActionView::Helpers
def initialize(path, source: nil, tag_options: {}, url_params: {}, srcset_options: {})
@path = path
@source = source
@tag_options = tag_options
@url_params =... | 33.774194 | 161 | 0.747851 |
f847459db1870992e10dce5d746b223417be17cb | 6,062 | ENV["RAILS_ENV"] = "test"
# In CI envoronment I don't want to send coverage report for system tests that
# obviously don't cover everything 100%
unless ENV["SKIP_COV"]
require "simplecov"
require "coveralls"
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
SimpleCov.start do
add_filter "lib/generators... | 30.009901 | 99 | 0.69416 |
036e297412eacd67cdea5ecd9b8681b3f2e81dd2 | 6,836 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'rex/proto/tftp'
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
# NOTE: This cannot be an HttpClient module since the response from the server
... | 27.23506 | 114 | 0.600497 |
bbe91e146ea2012b2f02d48214a83152fec8da0c | 1,183 | class LuthierInvitationsController < ApplicationController
before_action :setup
def index
end
def new
@invi = LuthierInvitation.new
end
def create
@invi = LuthierInvitation.create(msg: params[:luthier_invitation][:msg], luthier_id: current_user.luthier.id)
@invi.save
redirect_to new_luthi... | 22.320755 | 113 | 0.705833 |
085cb1921dd5f92ee4a8dcedfdcfe475573f1c2f | 2,215 | require 'spec_helper'
describe "Checkout" do
context "visitor makes checkout as guest without registration" do
before do
@product = create(:product, :name => "RoR Mug")
create(:zone)
create(:shipping_method)
create(:payment_method)
end
let!(:promotion) { create(:promotion, :code ... | 33.560606 | 96 | 0.643341 |
5d857159cd9e689ff1bf848bfd35955858a8ac06 | 772 | #frozen_string_literal: true
module Appwrite
module Models
class MembershipList
attr_reader :sum
attr_reader :memberships
def initialize(
sum:,
memberships:
)
@sum = sum
@memberships = membershi... | 24.125 | 89 | 0.411917 |
1dc7dff65d38171109b721a9df0c6507ea8c6c02 | 706 | cask "obsidian" do
version "0.10.8"
sha256 "a2a56594338439de4285fd68cb2cd24e70d8bf7a800a99287e31caaa60db4a97"
url "https://github.com/obsidianmd/obsidian-releases/releases/download/v#{version}/Obsidian-#{version}.dmg",
verified: "github.com/obsidianmd/"
appcast "https://github.com/obsidianmd/obsidian-rel... | 32.090909 | 110 | 0.743626 |
088c1c0693d548c33354042fee4b866b0a983d5f | 1,734 | class Coins
def initialize(amount)
@money = amount.to_i
end
def calculate()
untilCount = 0
# variable untilCount counts the number of times iterating through until loop
forCount = 0
# variable forCount counts how many times iterating through if loop
denominations = [25, 10, 5, 1]
# de... | 35.387755 | 177 | 0.644175 |
bf5a6e7a97dfec8fabd2b2a69f314bc7a3da36b1 | 1,510 | require_relative 'lib/fortnite_experience/version'
Gem::Specification.new do |spec|
spec.name = 'fortnite_experience'
spec.version = FortniteExperience::VERSION
spec.authors = ['prudi']
spec.summary = 'Gem that groups by POIs the amount of experience from weekly challenges.'
spec.... | 44.411765 | 99 | 0.690066 |
0375e50863cfd668ee2e5997f03831d23de105f4 | 189 | # frozen_string_literal: true
require 'logger'
require 'konfigyu'
require 'sycl'
require 'bole/version'
require 'bole/manager'
# Define the module namespace for this gem
module Bole
end
| 14.538462 | 42 | 0.777778 |
5d6a22776a69795b0ab572320312068ed817952d | 1,300 | # frozen_string_literal: true
require "rails/generators/abstract_generator"
module Rails
module Generators
class ComponentGenerator < Rails::Generators::NamedBase
include ViewComponent::AbstractGenerator
source_root File.expand_path("templates", __dir__)
argument :attributes, type: :array, d... | 26 | 99 | 0.669231 |
1a3131acab1a88b362dcb2d12a97dadf9fafff53 | 1,161 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'msf/core/handler/reverse_tcp'
require 'msf/base/sessions/meterpreter_options'
require 'msf/base/sessions/mettle_config'
require 'msf/base/sessions/meterpr... | 27.642857 | 90 | 0.645134 |
917abc94d56127ea9e7279df8954178035e0454e | 8,605 | =begin
#Ory APIs
#Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
The version of the OpenAPI document: v0.0.1-alpha.30
Contact: support@ory.sh
Generated by: https://openapi-generator.tech
O... | 37.907489 | 177 | 0.670889 |
e22664f39af08e91d2bd8e158db11d872a42be85 | 607 | # frozen_string_literal: true
module Bootstrap4RailsComponents
module Bootstrap
module Utilities
# Passes in necessary attributes to allow a component to have an active state
module Activatable
def active
options.fetch(:active, default_active)
end
private
... | 18.393939 | 83 | 0.571664 |
039d90ef926e7c80dfe299f6bfdcc68b43dc5c8c | 1,440 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'aws-sdk-core'
require 'aws-sigv4'
require_relative 'aws-sdk-resourc... | 26.666667 | 87 | 0.754861 |
ffc3d20c59c7ba1d8c3d95b49cf19d885d70ea91 | 150 | require 'test_helper'
class Api::V1::FavoritesControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
| 18.75 | 72 | 0.733333 |
39ee4248eb100c555f36055b27552474a92132ab | 2,015 | module RailsControllerAssets
# ActionView helper methods module
module ControllerAssetsHelper
def controller_stylesheets
styles = []
styles << controller_stylesheet if controller_stylesheet?
styles << controller_and_action_stylesheet if controller_and_action_stylesheet?
styles
end
... | 24.277108 | 120 | 0.709181 |
bbda1a77d841916a9728d2611ad4de24774736ca | 3,204 |
require 'spec_helper'
require 'json'
# Unit tests for AsposeCellsCloud::CellsSaveAsApi
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
# Please update as you see appropriate
describe 'CellsSaveAsApi' do
before do
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client... | 42.72 | 235 | 0.717541 |
ffff7c3dc35e1797ff321a125ccce53d0d2ef8e4 | 207 | module MoonropeClient
module Responses
class AccessDenied < Response
def message
data['message']
end
def exception_message
self.message
end
end
end
end
| 12.9375 | 33 | 0.613527 |
03770565710cc145cfb28ab0ad061ef3859df630 | 2,720 | class HomeController < ApplicationController
# The feed of everything going on with all students the educator has access
# to view.
def feed_json
view_as_educator = current_educator_or_doppleganger(params[:educator_id])
time_now = time_now_or_param(params[:time_now])
limit = params[:limit].to_i
a... | 36.266667 | 125 | 0.768015 |
38783980eba0cb436f3a3d5fd40fb6700209e03e | 213 | # frozen_string_literal: true
require_dependency "renalware/events"
module Renalware
module Events
class EventPresenter < DumbDelegator
include ::Renalware::AccountablePresentation
end
end
end
| 17.75 | 50 | 0.774648 |
38b3f80f582ddbd93aeb7f7bd14361b21bac769a | 1,840 | class Argo < Formula
desc "Get stuff done with container-native workflows for Kubernetes"
homepage "https://argoproj.io"
url "https://github.com/argoproj/argo-workflows.git",
tag: "v3.1.11",
revision: "665c08d2906f1bb15fdd8c2f21e6877923e0394b"
license "Apache-2.0"
bottle do
sha256 cellar... | 41.818182 | 122 | 0.736957 |
e230a15f3cf2ea2a7cd3cea1d71a0d7d2bdc0f50 | 463 | module InfluxDB
module Query
module Cluster # :nodoc:
def create_cluster_admin(username, password)
execute("CREATE USER #{username} WITH PASSWORD '#{password}' WITH ALL PRIVILEGES")
end
def list_cluster_admins
list_users.select { |u| u['admin'] }.map { |u| u['username'] }
... | 25.722222 | 90 | 0.647948 |
260066e5c419aae734bf28988fa1fa1ab4c7c5bd | 2,540 |
#Pod::Spec.new do |spec|
Pod::Spec.new do |s|
s.name = "XBSwiftCoreModule"
s.version = "0.1.1"
s.summary = "develop components for swift, you can configure a listview or circleView with this components"
s.homepage = "https://github.com/ZB0106/XBSwiftCoreModule"
s.author = {... | 45.357143 | 329 | 0.735827 |
7a4f0f1397abbd09edad8c399c0ad4fbe258afcb | 1,233 | require 'spec_helper'
describe Deployment do
let(:payload) { fixture_data('deployment') }
let!(:data) { JSON.parse(payload)['payload'] }
let!(:create_data) {
{
:custom_payload => JSON.dump(data),
:environment => "production",
:guid => SecureRandom.uuid,
:name ... | 28.674419 | 78 | 0.635036 |
1ae17b660112e56d37bd2bd5b8db25e596086a41 | 965 | # frozen_string_literal: true
require 'rails_helper'
describe 'application and dependency monitoring' do
it '/status checks if Rails app is running' do
visit '/status'
expect(page.status_code).to eq 200
expect(page).to have_text('Application is running')
end
it '/status/all checks if required depend... | 37.115385 | 100 | 0.739896 |
6193b63ce3eba81455193490b9af6e14e6f73bd8 | 389 | require 'action_controller'
require 'explicit_parameters'
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.disable_monk... | 25.933333 | 76 | 0.796915 |
ac9d8a5c91f8da9f934af7ebb6a50c008c59bdc1 | 1,393 | # frozen_string_literal: true
module Api
class UsersController < ApplicationController
before_action :authenticate_user! unless ENV['NO_AUTH'] == 'yes'
before_action :set_user, only: %i[update histories statistics]
before_action :update_params, only: [:update]
def index
@users = User.all
e... | 26.788462 | 106 | 0.646805 |
0888e3ec074e8a3ab0be212ede7b45c868b69593 | 54,593 | # SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
#
# Licensed to Elasticsearch B.V. under ... | 30.012644 | 161 | 0.593867 |
611c52688d35827ac35c88175d4ae53a7dba8069 | 2,231 | # 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... | 42.903846 | 119 | 0.683102 |
1896886351e2946cb75209cf9582d2040db5c83c | 264 | class TagsController < ApplicationController
caches_page :show
def show
@tag = Tag.find_by_name params[:id]
@tags = [@tag]
@taggings = @tag.taggings.paginate :page => params[:page],
:per_page => this_webapp.pictures_pagination
end
end
| 20.307692 | 62 | 0.681818 |
38fbec769d0f1419dd91485d766948dd50533d4f | 1,726 | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | 35.958333 | 124 | 0.691773 |
d5d38c80ee094b993b7dc167fb933a639d5a76ca | 378 | require 'mkmf'
find_executable('cc')
find_executable('ar')
libdir = File.expand_path(File.join(File.dirname(__FILE__), "../lib/url_parser_re2c/src"))
Dir.chdir(libdir) do
system 'cc -fPIC -c -o url_parser.o url_parser.c'
system 'ar rcs liburlparser.a url_parser.o'
end
$libs += " -lurlparser"
$INCFLAGS << " -I#{... | 21 | 90 | 0.716931 |
b997c80e3d7561a93a08bbfa1a9efba3005c3b4c | 2,299 | require 'erb'
require_relative 'template_processor'
module Compiler
class EJSProcessor < TemplateProcessor
def self.partial_for(key)
"<%- partial('partials/_#{key}') %>"
end
@@yield_hash = {
after_header: partial_for(:after_header),
body_classes: "<%= bodyClasses %>",
... | 42.574074 | 139 | 0.585472 |
038ecdfdf72dfc61312d5d5beb5197cd718fd38a | 751 | namespace :editables do
desc 'Create editable objects from config file'
task create_from_config: :environment do
editable_config_path = Rails.root.join('config', 'editable', 'config.yml')
editables = YAML::load(File.open(editable_config_path.to_s))
editables["pages"].each do |page_name, page_config|
... | 31.291667 | 78 | 0.643142 |
0101fc79c95dc3dfca6dc2efa0ac8f655f2531be | 4,692 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::MediaServices::Mgmt::V2018_06_01_preview
module Models
#
# An Asset.
#
class Asset < ProxyResource
include MsRestAzure
# @return... | 29.88535 | 79 | 0.469309 |
f73ce6bf50cf2d5209e381b7bad52b4bc4782b4c | 1,387 | # -*- ruby -*-
# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
require 'newrelic_rpm'
DependencyDetection.defer do
@name = :sequel
depends_on do
defined?(::Sequel)
end
depends_on do
!NewReli... | 25.218182 | 92 | 0.689978 |
7a772bcf6e9c2221facd849c4e607c041800b1e9 | 71 | arr = [["test", "hello", "world"], ["example", "mem"]]
arr.last.first
| 17.75 | 54 | 0.549296 |
8777d75c0ea37a83cc32137b0ab619a992d0795e | 3,398 | # ----------------------------------------------------------------------------
# <copyright company="Aspose" file="delete_image_search_request.rb">
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining ... | 41.950617 | 129 | 0.645085 |
bf3d4855122bcb49c4b24e0466be1f77f43a41b5 | 6,741 | module MergeRequests
class RefreshService < MergeRequests::BaseService
def execute(oldrev, newrev, ref)
return true unless Gitlab::Git.branch_ref?(ref)
@oldrev, @newrev = oldrev, newrev
@branch_name = Gitlab::Git.ref_name(ref)
find_new_commits
# Be sure to close outstanding MRs bef... | 34.045455 | 129 | 0.695742 |
1cbcce2ae682e0615a563f67b343b911e0a0d4c2 | 416 | class Qiitactl < Formula
desc "Command line interface to manage the posts in Qitta."
homepage "https://github.com/minodisk/qiitactl"
url "https://github.com/minodisk/qiitactl/releases/download/v0.1.3/qiitactl_0.1.3_darwin_amd64.zip"
version "v0.1.3"
sha256 "ad419750ec89b4dcd1bccfb2aba8a19a71b731783e5fbf1a7e68... | 29.714286 | 101 | 0.769231 |
87cf91b97b0b05fcfcac3e9f166434573097239e | 582 | When /^I fill in new user details$/ do
within(".body") do
fill_in 'User Name', with: 'pbjorklund'
fill_in 'Email', with: 'p.bjorklund@gmail.com'
fill_in 'Password', :with => 'password'
fill_in 'Password confirmation', :with => 'password'
end
click_button "Sign up"
end
When /^I fill in my user det... | 29.1 | 56 | 0.658076 |
91d0d10d85ad9430cf4e5c2e615c012f2ae0e804 | 1,419 | module FlickRaw
class Request
def initialize(flickr = nil) # :nodoc:
@flickr = flickr
self.class.flickr_objects.each {|name|
klass = self.class.const_get name.capitalize
instance_variable_set "@#{name}", klass.new(@flickr)
}
end
def self.build_request(req) # :nodoc:
method_nesting = ... | 27.823529 | 101 | 0.640592 |
03a54d52e992406ac33c1edf14037cee8185d40d | 9,367 |
require_dependency 'carto/uuidhelper'
module Carto
module Api
class LayersController < ::Api::ApplicationController
include Carto::ControllerHelper
ssl_required :show, :layers_by_map, :custom_layers_by_user, :map_index, :user_index, :map_show, :user_show,
:map_create, :user_creat... | 32.982394 | 119 | 0.635743 |
611e37d30415318662ef756b04581fa6fa6c3653 | 1,465 | cask 'auristor-client' do
version '0.149'
if MacOS.version == :mavericks
sha256 'e79579c9ac2cd609bedd2e01104c113a3417e082e6b5a9f8d333d74e8a6d5030'
url "https://www.auristor.com/downloads/auristor/osx/macos-10.9/AuriStor-client-#{version}-Mavericks.dmg"
elsif MacOS.version == :yosemite
sha256 '966c115... | 41.857143 | 110 | 0.698294 |
334fffff201ddd8a240f2b3777cf100406fd09f1 | 5,188 | require "demiurge"
require "demiurge/createjs"
require "demiurge/createjs/engine_sync"
require "demiurge/createjs/json_accounts"
require "demiurge/createjs/login_unique"
CANVAS_WIDTH = 640
CANVAS_HEIGHT = 480
TICK_MILLISECONDS = 300
TICKS_PER_SAVE = (60 * 1000 / TICK_MILLISECONDS) # Every 1 minute
class GoodShip
... | 37.594203 | 168 | 0.702005 |
f8cacc84c0db22456a0031ef3f442ddc2916df1e | 176 | require 'test_helper'
class MealsControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get meals_index_url
assert_response :success
end
end
| 17.6 | 59 | 0.778409 |
e81a38f295cbbcf6624e34439fbf356b4bcdc961 | 439 | class AddCauses < ActiveRecord::Migration[5.1]
def change
create_table :causes do |t|
t.string :name
t.text :description
t.integer :parent_id, limit: 8
t.timestamps null: false
t.index :parent_id
end
create_table :causes_charities, id: false do |t|
t.integer :cause_i... | 19.954545 | 52 | 0.633257 |
03f5bfeae40c65809e6b555189cd7962a3af808b | 769 | # ## Slice::CommandBuilder
# Creates a new command object from the given ARGV.
#
# ```ruby
# builder = Slice::CommandBuilder.new(ARGV)
# builder.call
# ```
#
module Slice
class CommandBuilder
### Slice::CommandBuilder.new(argv)
# Creates a new instance of Slice::CommandBuilder from the given command line argu... | 21.361111 | 92 | 0.650195 |
bb16dcbd7febe76a02637562a8f2216d91848983 | 898 | # -*- encoding: utf-8 -*-
require File.expand_path('../lib/video_dimensions/version', __FILE__)
Gem::Specification.new do |gem|
gem.name = "video_dimensions"
gem.version = VideoDimensions::VERSION
gem.summary = %q{Quick and easy video attributes}
gem.description = %q{Quick and easy vide... | 37.416667 | 112 | 0.674833 |
39c2fcc997feb21632453cef5add141b016cc2fc | 3,832 | # frozen_string_literal: true
require 'zenaton/services/graph_ql/create_workflow_schedule_mutation'
require 'zenaton/services/graph_ql/create_task_schedule_mutation'
require 'zenaton/services/graph_ql/dispatch_task_mutation'
require 'zenaton/services/graph_ql/dispatch_workflow_mutation'
require 'zenaton/services/graph... | 34.522523 | 80 | 0.664666 |
629f43d3636d57fb0359f5e3bb108a1fcb8db565 | 457 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Git::Patches::Patch do
let(:patches_folder) { Rails.root.join('spec/fixtures/patchfiles') }
let(:patch_content) do
File.read(File.join(patches_folder, "0001-This-does-not-apply-to-the-feature-branch.patch"))
end
let(:patch) { descri... | 26.882353 | 96 | 0.715536 |
1110e7902f8036e6fad8fe82f6aeba63a5dffc1a | 1,565 | class Admin::ScoreCategoriesController < Admin::ApplicationController
# Overwrite any of the RESTful controller actions to implement custom behavior
# For example, you may want to send an email after a foo is updated.
#
# def update
# super
# send_foo_updated_email(requested_resource)
# end
# Overr... | 29.528302 | 83 | 0.716294 |
38457c69bc8ae1efbb7f07406f8ea99d69dba50c | 284 | Puppet::Type.type(:pg_user).provide(:default) do
desc "A default pg_user provider which just fails."
def create
return false
end
def destroy
return false
end
def exists?
fail('This is just the default provider for pg_user, all it does is fail')
end
end
| 15.777778 | 78 | 0.693662 |
1cacb66f500790adaa6b1be7834d6d3b1188f8eb | 2,571 | class Portal::Course < ApplicationRecord
self.table_name = :portal_courses
acts_as_replicatable
belongs_to :school, :class_name => "Portal::School", :foreign_key => "school_id"
has_many :clazzes, :dependent => :destroy, :class_name => "Portal::Clazz", :foreign_key => "course_id" #, :source => :clazz # REMOV... | 30.975904 | 172 | 0.677946 |
618d3509d4793299232fe5d034169ff9f32b00f3 | 152 | module Apexcharts
class ThemeOptions < ::SmartKv
optional *%i[
monochrome
palette
]
end
end
| 16.888889 | 32 | 0.473684 |
112b862b7673b2377d82986fd1ac098ed8068c2a | 242 | # frozen_string_literal: true
require_dependency "#{Rails.root}/lib/importers/user_importer"
class UpdateUsersWorker
include Sidekiq::Worker
sidekiq_options unique: :until_executed
def perform
UserImporter.update_users
end
end
| 18.615385 | 62 | 0.801653 |
1cfc78392fb06cda83d39aac7e8869554d32f961 | 3,561 | #! /usr/bin/env ruby
$:.unshift File.join(File.dirname(__FILE__), '../..', 'lib')
require 'clasp'
require 'test/unit'
class Test_DefaultValue < Test::Unit::TestCase
def test_long_form_without_default
specifications = [
CLASP.Option('--verbosity', values: [ 'silent', 'terse', 'normal', 'chatty', 'verbose' ]... | 23.427632 | 130 | 0.692502 |
1c6b021a7be0e3e5b654f0ada548d85c1dcefef5 | 78 | require File.expand_path('config/environment', __dir__)
run Spaceholder::App
| 19.5 | 55 | 0.807692 |
0347eaacf910727520079ba865a31862d27b678a | 1,724 | # frozen_string_literal: true
require 'active_record'
if defined?(::Rails)
require_relative 'active_record/railtie'
end
require_relative 'active_record/middleware'
require_relative 'active_record/handler'
module RailsFailover
module ActiveRecord
def self.logger=(logger)
@logger = logger
end
d... | 26.121212 | 119 | 0.707657 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.