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 |
|---|---|---|---|---|---|
01b72d84cd6a87fb2ff5f74e947412a8cc2df9f7 | 293 | class ApiController < ApplicationController
def totals
total = Donation.sum('amount', :conditions => ["return_code = ?", '0']).to_s
donation = Donation.where("return_code = '0'").count
data = {'total' => total, 'donations' => donation}
render :json => data.to_json
end
end
| 32.555556 | 80 | 0.65529 |
21dbd10a11fe0ddafc1bc3319b9700078d86217a | 479 | class Address
attr_accessor :street, :city, :state, :zip
def initialize (street, city, state, zip)
@street = street
@city = city
@state = state
@zip = zip
end
def to_h
{'street' => @street, 'city' => @city, 'state' => @state, 'zip' => @zip}
end
def is_match?(query)
query.strip!
... | 21.772727 | 129 | 0.613779 |
38d86640b7dec4e8c6a2876640c2bcda3b3314a7 | 4,265 | # frozen_string_literal: true
require 'test/unit'
require_relative '../lib/plus_codes/open_location_code'
class PlusCodesTest < Test::Unit::TestCase
def setup
@test_data_folder_path = File.join(
File.dirname(__FILE__), '..', '..', 'test_data'
)
@olc = PlusCodes::OpenLocationCode.new
end
def t... | 30.683453 | 80 | 0.629543 |
e8595042654fbd6b053c3ed966dc10343c3fb62d | 840 | class Product < ActiveRecord::Base
include ObjectModel::Model
validates :price, numericality: { greater_than_or_equal_to: 0.01 }
validates :title, uniqueness: true
validates :description, presence: true, uniqueness: true
belongs_to :user
has_many :line_items
before_destroy :ensure_not_referenced_by_any_l... | 25.454545 | 71 | 0.757143 |
08c3084e666ac0ee154217d0ee6bb4832feaab6b | 1,938 | class Cfengine < Formula
desc "Help manage and understand IT infrastructure"
homepage "https://cfengine.com/"
url "https://cfengine-package-repos.s3.amazonaws.com/tarballs/cfengine-3.18.0.tar.gz"
sha256 "d601a3af30f3fba7d51a37476c9e1a00b750682149bf96f4a0002e804bc87783"
license all_of: ["BSD-3-Clause", "GPL-2.... | 33.413793 | 101 | 0.718266 |
6a1940370565e17a6537d54f452699eeea1fda30 | 2,316 | class Automake < Formula
desc "Tool for generating GNU Standards-compliant Makefiles"
homepage "https://www.gnu.org/software/automake/"
url "https://ftp.gnu.org/gnu/automake/automake-1.16.3.tar.xz"
mirror "https://ftpmirror.gnu.org/automake/automake-1.16.3.tar.xz"
sha256 "ff2bf7656c4d1c6fdda3b8bebb21f09153a73... | 33.565217 | 122 | 0.717185 |
01f1753df885ae8008a0891dc608af81d09e964f | 2,504 | class String
def escape_heredoc
this = dup
lines = this.split(/\r\n|\r|\n/).select { |line| line.size > 0 }
levels = lines.map do |line|
match = line.match(/^( +)[^ ]+/)
match ? match[1].size : 0
end
level = levels.min
this.gsub!(/^#{' ' * level}/, '') if level > 0
this
end
e... | 24.792079 | 83 | 0.563898 |
d5e762f4f29335ad82cfb28b1a9ae252669e09e9 | 5,305 | #
# Be sure to run `pod spec lint AXPickerView.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://githu... | 36.840278 | 99 | 0.633365 |
ff49f61e9eecece5f1ebf01cc029d02e58329944 | 3,849 | require 'csv'
require 'rest-client'
namespace :populate do
desc 'Export metadata'
task export_metadata: :environment do
metas = Metadata.all
CSV.open("#{Rails.root}/lib/metadata_export.csv", 'wb') do |csv|
csv << [name, display_name, description, units, datatype, user_defined]
metas.each do |me... | 31.292683 | 121 | 0.627436 |
796eaed268ed15ae470d88f7462de778b37a205c | 149 | class AddDroppedOutToStartups < ActiveRecord::Migration[6.0]
def change
add_column :startups, :dropped_out, :boolean, default: false
end
end
| 24.833333 | 64 | 0.765101 |
e92d42d2484982d5f8b8619926b8da41c1fe6b34 | 2,120 | require File.expand_path("../spec_helper", __FILE__)
describe MerchantSidekick::ShoppingCart::LineItem do
def setup
@product = products(:widget)
end
it "should initialize and create" do
transaction do
item = MerchantSidekick::ShoppingCart::LineItem.new(valid_cart_line_item_attributes(:product => ... | 35.932203 | 112 | 0.689151 |
e96dc6f16ea4ce69afb0199e8121a31ef8277dfe | 5,680 | # 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... | 34.846626 | 245 | 0.673768 |
79da155c7d42b3fb8a16f4afe9da5d458c5feee3 | 162 | # frozen_string_literal: true
module User
# LegalEntityUser - 2019
class LegalEntityUser < BasicUser
def commission_amount
0.44
end
end
end
| 14.727273 | 35 | 0.709877 |
e93e14bdd8218e1ea815c083be458703c79e715a | 268 | require 'pi_piper'
class Mcp3008
attr_reader :channel
def initialize(channel)
@channel = channel
end
def read
PiPiper::Spi.begin do |spi|
adc = spi.write [0x1, (0x8 + @channel) << 4, 0x0]
((adc[1] & 0x3) << 8) + adc[2]
end
end
end
| 15.764706 | 55 | 0.589552 |
ff6e4b8d451596f34b191c161cffc95d1d71d45d | 201 | class AddTeamLeadIdToBatchApplication < ActiveRecord::Migration[6.0]
def change
add_column :batch_applications, :team_lead_id, :integer
add_index :batch_applications, :team_lead_id
end
end
| 28.714286 | 68 | 0.79602 |
011d3ed8e8e549607871f3b9d07ababada9a5e82 | 1,366 | require 'spec_helper'
require 'puppet/type'
require 'puppet/type/package'
describe 'package_provider', :type => :fact do
before(:each) { Facter.clear }
after(:each) { Facter.clear }
['4.2.2', '3.7.1 (Puppet Enterprise 3.2.1)'].each do |puppetversion|
describe "on puppet ''#{puppetversion}''" do
before... | 31.045455 | 94 | 0.632504 |
e896b7d08558e73b82343913102df033bf90d5a0 | 920 | class Clojure < Formula
desc "Dynamic, general-purpose programming language"
homepage "https://clojure.org"
url "https://download.clojure.org/install/clojure-tools-1.10.2.790.tar.gz"
sha256 "62966b4494812982842038f8d67b2d2a406277b020476aa70d287a1d6fed901a"
license "EPL-1.0"
version_scheme 1
livecheck do
... | 27.058824 | 92 | 0.683696 |
f71476cfbcaa306becc1a4f4eda40463a9bdb73f | 13,670 | # frozen_string_literal: true
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render inv... | 48.821429 | 154 | 0.751573 |
1d9d701ec421ddfabc10b59aea74d729119a2c0e | 7,297 | # frozen_string_literal: true
module Para
module Cloneable
# This object acts as a service to compile a nested cloneable options hash to be
# provided to the `deep_clone` method from the `deep_cloneable` gem. It iterates over
# every reflections that must be included for a given model when it's cloned, a... | 37.040609 | 93 | 0.619844 |
03db3adb98e2215c887c05cc95662350d69930a8 | 270 | class CurseClient < Cask
url 'http://addons.cursecdn.com/files/595/169/Curse_Client-4.0.0.425.dmg'
homepage 'http://www.curse.com/client'
version '4.0.0.425'
sha256 'f76eda5d21b85ee4db080c794a3e852ecadaa71fe2d32308d698d95286f36a1f'
link 'Curse Client.app'
end
| 33.75 | 75 | 0.774074 |
61ef77fed89bf73c4f410b81f971fa822d236685 | 1,067 | # coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "simple_discussion/version"
Gem::Specification.new do |spec|
spec.name = "simple_discussion"
spec.version = SimpleDiscussion::VERSION
spec.authors = ["Chris Oliver"]
s... | 35.566667 | 74 | 0.651359 |
f7ac4546e6f3745a27f79db79e0f1de0320b863b | 632 | # frozen_string_literal: true
require 'sassc'
module Rake
module Builder
class Sass < Compiler
def dest(asset)
yield Paths.static "css/#{asset.src.basename.sub_ext('.css')}"
end
def dependencies(asset)
Rake::FileList["#{asset.src.dirname}/**/*"]
end
def build(asse... | 22.571429 | 71 | 0.571203 |
f7ea38c19a4e5358e2de2d2ad2e515875c1148c0 | 219 | #! /usr/bin/env ruby
# copycat: a very boring game for testing.
$stdin.sync = $stdout.sync = true
while (move = $stdin.getc.chr) do
if move == "q"
$stdout.write "bye!"
exit 0
end
$stdout.write(move)
end | 16.846154 | 42 | 0.630137 |
e2640210ca47856eea605532ef90d8cceea0d4e3 | 210 | class CreateUsers < ActiveRecord::Migration[6.0]
def change
create_table :users do |t|
t.string :first_name
t.string :last_name
t.string :email
t.timestamps
end
end
end
| 13.125 | 48 | 0.633333 |
6a22f7da141a776b95838bdb4618bee762908698 | 914 | require 'minitest_helper'
class TestObjectRemovalSanityCheck < Minitest::Test
def test_that_it_works
scene = Mittsu::Scene.new
camera = Mittsu::PerspectiveCamera.new(75.0, 1.0, 0.1, 1000.0)
renderer = Mittsu::OpenGLRenderer.new width: 100, height: 100, title: 'TestObjectRemovalSanityCheck'
geometry... | 26.114286 | 104 | 0.690372 |
390fcb5a908938f956d98cca525ae379a21aa9e0 | 3,466 |
require 'uri'
require 'net/http'
require 'net/https'
require 'openssl'
require 'openssl/x509'
module ChefVPCToolkit
module CloudServersVPC
class Connection
MULTI_PART_BOUNDARY="jtZ!pZ1973um"
@@http=nil
@@auth_user=nil
@@auth_password=nil
def self.init_connection
configs=Util.load_configs
base_url = con... | 23.578231 | 106 | 0.695326 |
87322a3cb8c2a8cc46bb816354e67c1a58e98305 | 936 | # Shared config mixin used by all Thor namespaced tasks.
#
module Mofa
module Config
@@config = {}
def self.config
@@config
end
def self.load
unless Dir.exist?("#{ENV['HOME']}/.mofa")
#warn "Mofa config folder not present! You may use 'mofa setup' to get rid of this message."
... | 34.666667 | 133 | 0.625 |
7a611b5f57fbc680dc26c0ae7e4395c0f3f45f49 | 252 | require 'gearbox/responses/base'
module Gearbox
module Response
module Model
class DockerImageMetaData < Response::Base
attr_reader :kind
def initialize(obj)
super(obj)
end
end
end
end
end
| 13.263158 | 48 | 0.615079 |
61154c122bba7bfde2cca1fc14eef7be843fbf2f | 3,318 | require 'spec_helper'
describe "#zinterstore(destination, keys, [:weights => [w,w,], [:aggregate => :sum|:min|:max])" do
before do
@odds = 'mock-redis-test:zinterstore:odds'
@primes = 'mock-redis-test:zinterstore:primes'
@dest = 'mock-redis-test:zinterstore:dest'
@redises.zadd(@odds, 1, 'one')
... | 34.206186 | 98 | 0.603677 |
e83839051b760c4357099aa1aa9ed382f03180b1 | 1,558 | # frozen_string_literal: true
module RuboCop
module Cop
module Layout
# This cop checks the indentation of the first line of the
# right-hand-side of a multi-line assignment.
#
# @example
# # bad
# value =
# if foo
# 'bar'
# end
#
# ... | 26.40678 | 85 | 0.590501 |
bb8f2d74ed70c8756c2bdc0f63424389380d52b1 | 489 | class CoursesController < ApplicationController
before_action :set_course
def rsvp
invitation = CourseInvitation.find_or_create_by(course: @course, member: current_user)
redirect_to course_invitation_path(invitation)
end
def show
@host_address = AddressPresenter.new(@course.sponsor&.address)
@... | 23.285714 | 90 | 0.742331 |
26e3cb6d19af4ba52258b5569893f421495d68eb | 1,457 | require 'test_helper'
module AuditorGeneral
class ModelTest < ActiveSupport::TestCase
setup do
@admin = User.first
end
test 'Deletions are logged when flag is not set' do
assert_difference('AuditorGeneralLog.count') do
@admin.destroy
end
end
test 'Creations are not log... | 26.490909 | 64 | 0.673988 |
790fc3f1e87d69cf779e741c308e9e2bf95ba516 | 182 | class CreateProtocols < ActiveRecord::Migration
def change
create_table :protocols do |t|
t.string :title
t.text :description
t.timestamps
end
end
end
| 16.545455 | 47 | 0.67033 |
7a119e4d2cf7165e62d57c51d9f22674f4fe188f | 4,045 | # 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... | 35.482456 | 126 | 0.711248 |
624f7f547588adc51c9c0839c8a3e84e7adb764a | 3,208 | class Tbb < Formula
desc "Rich and complete approach to parallelism in C++"
homepage "https://github.com/oneapi-src/oneTBB"
url "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.4.0.tar.gz"
sha256 "021796c7845e155e616f5ecda16daa606ebb4c6f90b996e5c08aebab7a8d3de3"
license "Apache-2.0"
bottle do
... | 34.12766 | 122 | 0.650561 |
6aac3fedb76ba940bdb344cb1500ecaaa1cb3d3f | 333 | begin
require 'json'
rescue LoadError
$stderr.puts "Missing json gem. Please run 'bundle install'"
exit 1
end
begin
require 'amqp'
rescue LoadError
$stderr.puts "Missing amqp gem. Please uncomment the amqp section in the Gemfile and run 'bundle install' if you wish to use the AMQP participant/listener pair i... | 25.615385 | 171 | 0.762763 |
8722db9c161a5cd8408ff725eb7c9d7f9064a38b | 280 | require 'dogapi'
api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'
slo_id = '<YOUR_SLO_ID>'
dog = Dogapi::Client.new(api_key, app_key)
to_ts = 1_571_320_613
from_ts = to_ts - 60 * 60 * 24 * 30
dog.get_service_level_objective_history(slo_id, from_ts, to_ts)
| 21.538462 | 63 | 0.742857 |
1dfd42ac26e7631755bdf2cb55bfe7d1f15dbde1 | 1,316 | class Etl < Formula
desc "Extensible Template Library"
homepage "https://synfig.org"
url "https://downloads.sourceforge.net/project/synfig/releases/1.0.2/source/ETL-0.04.19.tar.gz"
sha256 "ba944c1a07fd321488f9d034467931b8ba9e48454abef502a633ff4835380c1c"
bottle do
cellar :any_skip_relocation
sha256 "... | 32.9 | 97 | 0.683131 |
797a64837866f9ba51dce730040f734247a2a36d | 1,374 | require 'rspec/expectations'
module DelayedJobHelper
RSpec::Matchers.define :delay_method do |expected|
def supports_block_expectations?
true
end
match do |proc|
Delayed::Worker.new.work_off
proc.call
job = Delayed::Job.last
@actual = job.payload_object.method_name.to_sym
... | 26.423077 | 109 | 0.665939 |
9181ec6d8ad4244dbc5e83eaf14102d8a6bd32e8 | 868 | module Xray
def self.config
@@config ||= Config.new
end
class Config
attr_accessor :editor
CONFIG_FILE = "#{Dir.home}/.xrayconfig"
DEFAULT_EDITOR = '/usr/local/bin/subl'
def editor
load_config[:editor]
end
def editor=(new_editor)
if new_editor && new_editor != editor
... | 16.377358 | 65 | 0.612903 |
79bb56c6c71467c36f61f4897c470d1389dec171 | 3,452 | #!/usr/bin/env rspec
require 'spec_helper'
require 'facter/util/uptime'
describe Facter::Util::Uptime do
describe ".get_uptime_seconds_unix", :unless => Facter.value(:operatingsystem) == 'windows' do
describe "when /proc/uptime is available" do
before do
uptime_file = my_fixture("ubuntu_proc_upti... | 40.139535 | 104 | 0.639919 |
18609503d1b3869618f46ae57885736655227e47 | 1,554 | begin
require 'rails/railtie'
rescue LoadError
else
require 'global_id'
require 'active_support'
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/integer/time'
class GlobalID
# = GlobalID Railtie
# Set up the signed GlobalID verifier and include Active Record support.
class R... | 31.08 | 95 | 0.725869 |
62b6f292c9d4f5e24637ffea86073b6ebccd956e | 1,419 | class DeviseCreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
## Database authenticatable
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""
## Recoverable
t.string :reset_password_token
... | 33 | 104 | 0.649753 |
6171c16c00f171b441be351084ec4db813e4ce15 | 6,440 | module MARC
class IIIReader
class ParserError < RuntimeError; end
class NonExistentRecordError < RuntimeError; end
include HTTParty
attr_accessor :base_uri, :record_uri, :marc_uri
attr_reader :coder
def initialize(opac_uri, scope='')
@entities = HTMLEntities.new
... | 30.813397 | 110 | 0.579193 |
21ea8af9e7d8e06b1a6f54309e54d7c4f0867e69 | 327 | module Matest
class SkipMe
attr_reader :source_location
def initialize(the_caller=nil)
if the_caller
@the_caller = the_caller
file, lineno = the_caller.first.split(":")
@source_location = [file, lineno.to_i]
end
end
def to_proc
proc { SkipMe.new }
end
e... | 19.235294 | 50 | 0.623853 |
21adfb0beb812ad04b5ecfac2fcedb885bc45738 | 4,507 | # -*- encoding: utf-8 -*-
#
# Author:: SAWANOBORI Yukihiko (<sawanoboriyu@higanworks.com>)
#
# Copyright (C) 2015, HiganWorks 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
#
# http:/... | 27.993789 | 93 | 0.642556 |
ff754684b6889a47075b417a014908314eb73f91 | 458 | require "rubygems"
require "rspec"
$LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
require "rrd"
$VERBOSE = nil
RRD_FILE = File.expand_path(File.dirname(__FILE__) + "/vm.rrd")
IMG_FILE = File.expand_path(File.dirname(__FILE__) + "/vm.png")
XML_FILE = File.expand_path(File.dirname(__FILE__) + "/vm.xml")
$VERBOSE ... | 26.941176 | 63 | 0.703057 |
fffe58d154ed257ef5ae3fa31caa3fcb34b9f65e | 770 | Pod::Spec.new do |s|
s.name = "ObjcGitlabApi"
s.version = "1.0.2"
s.summary = "An Objective-C library for interacting with the GitLab API."
s.homepage = "https://github.com/Indatus/objc-gitlab-api"
s.license = 'MIT'
s.authors = { "Jeff Trespalacios" => "jtrespalacios@inda... | 55 | 123 | 0.601299 |
333af49aeea0c8609d98d1b7c341eed23bbd8363 | 129 | class ChangePostsVotesDefault < ActiveRecord::Migration[5.1]
def change
change_column_default(:posts, :votes, 0)
end
end
| 21.5 | 60 | 0.75969 |
2670c106954bac50697ffef33eb9172fb1f0a49d | 218 | # load oxd components
require 'oxd/config'
require 'oxd/oxd_connector'
require 'oxd/client_oxd_commands'
require 'oxd/uma_commands'
# @author Inderpal Singh
# Oxd Module namespace
# oxd_version 3.1.1
module Oxd
end | 18.166667 | 33 | 0.779817 |
bf9e806889d707dea27fb8e54add46d73c9a543b | 3,072 | module Druid
class PostAggregation
def method_missing(name, *args)
if args.empty?
PostAggregationField.new(name)
end
end
def js(*args)
if args.empty?
PostAggregationField.new(:js)
else
PostAggregationJavascript.new(args.first)
end
end
end
mod... | 19.566879 | 103 | 0.613932 |
d5b4f446162b9179b09f5e07a5f57b366bee1298 | 818 | # encoding: utf-8
class ChannelsController < ApplicationController
def show
@channel = Channel.find(params[:id])
@title = "#{@channel.name} - #{Siteconf.site_name}"
if params[:p].present?
@page_num = params[:p].to_i
@title += " (第 #{@page_num} 页)"
else
@page_num = 1
end
@to... | 32.72 | 107 | 0.639364 |
7a4fda5a4c0bfc9ddea85322a7417e5ec333f059 | 256 | require File.dirname(__FILE__) + '/../../spec_helper'
ruby_version_is ""..."1.9" do
require File.dirname(__FILE__) + '/../../shared/enumerator/enum_for'
require 'enumerator'
describe "#to_enum" do
it_behaves_like :enum_for, :enum_for
end
end
| 23.272727 | 70 | 0.691406 |
910ac4547d9b87d2ccf206eb44633e549f2e2b73 | 2,784 | # frozen_string_literal: true
module Tianguis
module Parser
class FruitsWeekly < ResultTable
TableRow = Struct.new(:product, :prices, :avg_price)
def initialize(**args)
super
@year = args[:year]
@month = args[:month]
@week = args[:week]
end
def price_tabl... | 23.794872 | 87 | 0.489583 |
ed6e7edb82e6d8abe2ee12c433710552d481f1ad | 6,968 | require 'spec_helper'
require 'ddtrace/contrib/analytics_examples'
require 'rack/test'
require 'rack'
require 'ddtrace'
require 'ddtrace/contrib/rack/middlewares'
RSpec.describe 'Rack integration configuration' do
include Rack::Test::Methods
let(:tracer) { get_test_tracer }
let(:configuration_options) { { trac... | 34.325123 | 110 | 0.642365 |
abb8948f13a62ca84dc00f3d39cb0fdf7dc125fe | 22,755 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe API::Lint do
describe 'POST /ci/lint' do
context 'when signup settings are disabled' do
before do
Gitlab::CurrentSettings.signup_enabled = false
end
context 'when unauthenticated' do
it 'returns authentication ... | 30.421123 | 160 | 0.605933 |
28f96351175c160d7f4e0a98aaa515f0d5c8c527 | 723 | # frozen_string_literal: true
module Ci
class DeleteUnitTestsService
include EachBatch
BATCH_SIZE = 100
def execute
purge_data!(Ci::UnitTestFailure)
purge_data!(Ci::UnitTest)
end
private
def purge_data!(klass)
loop do
break unless delete_batch!(klass)
end
... | 19.026316 | 89 | 0.648686 |
9136fe10e749dcc682da2eb15b38e7ff1d16317a | 3,684 | module CalendarHelper
def calendar_for(objects, *args)
raise ArgumentError, "Missing block" unless block_given?
options = args.last.is_a?(Hash) ? args.pop : {}
html_options = options[:html]
builder = options[:builder] || CalendarBuilder
calendar = options[:calendar] || Calendar
concat(tag(:ta... | 26.314286 | 111 | 0.56949 |
21fd4e5fb26b423fde8540b9f88504e3e8169ff6 | 1,055 | cask "azure-data-studio" do
version "1.31.0"
sha256 "c16810cccc86992c5a13cfebaf0a2dc1552752658d8ee6a03ee7cec6db6f620e"
url "https://azuredatastudio-update.azurewebsites.net/#{version}/darwin/stable",
verified: "azuredatastudio-update.azurewebsites.net/"
name "Azure Data Studio"
desc "Data management to... | 36.37931 | 101 | 0.740284 |
1a830f54eb81a848a71cdb586bc1372982d4f43b | 66 | require "minitest_helper"
describe "Product" do
it "works"
end
| 11 | 25 | 0.742424 |
115658fcd396abc347e1d83c9b69c79329286fb2 | 1,588 | #-- 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 ChiliProject, which is a fork ... | 30.538462 | 91 | 0.742443 |
e24e5c85714c52b0f651052578e0aabc0bfacc6c | 369 | FactoryGirl.define do
factory :user do
name { Faker::Name.name }
email { Faker::Internet.email }
password 'password'
confirmed_at Time.now.utc
after(:create) do |user|
if user.confirmed?
user.subscription_tracker.update(subscribed_to_email_notifications: true, email_digest_delivery_... | 24.6 | 124 | 0.699187 |
03ac6dc9d10852d5a64cd368eb41078bf164108c | 3,079 | ##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Scanner
def initialize(info={})
super(update_info(i... | 30.79 | 145 | 0.603118 |
628f70efad6c0729536e39b3fe47797e5ae8b0f8 | 6,851 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Issues::SetCrmContactsService do
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) }
let_it_be(:contacts) { create_list(:contact, 4, group: group) }
let(:issue) { cr... | 31.865116 | 159 | 0.628083 |
010ab23f118db0bce0475c61874cdfda7522c8ee | 502 | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... | 62.75 | 177 | 0.834661 |
11652c23d64377a77f1e6507adaf913824c0a6f7 | 197 | module RailsEmoji
class Engine < ::Rails::Engine
initializer 'rails_emoji.assets.precompile' do |app|
app.config.assets.precompile << %r(emojis\/.*\.(?:png|svg|gif)$)
end
end
end
| 24.625 | 70 | 0.664975 |
f81834d28b5421a52ec2c349766cbcd7b550e75d | 601 | describe KnapsackPro::RepositoryAdapterInitiator do
describe '.call' do
subject { described_class.call }
before do
expect(KnapsackPro::Config::Env).to receive(:repository_adapter).and_return(repository_adapter)
end
context 'when repository adapter is git' do
let(:repository_adapter) { 'g... | 27.318182 | 101 | 0.720466 |
ffd9b2fb4dcb22387c7811f86530bb5af48babe2 | 2,160 | require 'rails_helper'
RSpec.describe FeedbackSubmissionJob, type: :job do
describe '#perform' do
let(:feedback_submission_job) { FeedbackSubmissionJob.new }
let(:emails_sent) { ::Et1::Test::EmailsSent.new }
it 'sends an HTML email to service now' do
feedback_submission_job.perform comments: 'lél'... | 45 | 182 | 0.744444 |
03d411861c4aa666acdf66ee9ee97b95572cf9f6 | 1,610 | # == Schema Information
#
# Table name: items
#
# id :integer not null, primary key
# name :string
# category :string
# created_at :datetime
# updated_at :datetime
# barcode_count :integer
# organization_id :integer
#
class Item < ApplicationRecord
belongs_t... | 29.272727 | 96 | 0.717391 |
7a9e122b44a4da7e4c1a36df010a1aeadce64311 | 3,499 | require File.join(File.dirname(__FILE__), "..", "test_helper")
require 'mocha/auto_verify'
require 'method_definer'
class AutoVerifyTest < Test::Unit::TestCase
attr_reader :test_case
def setup
@test_case = Object.new
class << test_case
def self.add_teardown_method(symbol); end
include Moc... | 27.769841 | 86 | 0.728208 |
f889e747ca3814634a6fc6a616ca878afd08d0b4 | 669 | # Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 41.8125 | 92 | 0.759342 |
f7553d2e1d4168e02c088f46627370248c6f68d7 | 333 | arr = [
"Add Bootstrap to app",
"Seed better data to app",
"Make slides",
"Check git hooks",
"Discuss presentation order",
"Demo talk for coworkers",
"Practice lectures",
"Add MOAR CAT PICS",
"Test integrations",
"Incorporate team feedback"
]
10.times do |i|
Todo.create name: arr[i], order: i, do... | 20.8125 | 49 | 0.663664 |
ed7eff96b14cf2b0e39d835bab99fe17dba556bc | 396 | module Featurable
extend ActiveSupport::Concern
included do
has_many :feature_lists, as: :featurable, dependent: :destroy
end
def feature_list_for_locale(locale)
feature_lists.find_by_locale(locale) || feature_lists.build(locale: locale)
end
def load_or_create_feature_list(locale)
feature_lis... | 24.75 | 80 | 0.777778 |
18bc77ac57ac3941f3473db98d248c85506563bf | 1,400 | module Delayed
class PerformableMethod < Struct.new(:object, :method, :args)
CLASS_STRING_FORMAT = /^CLASS\:([A-Z][\w\:]+)$/
AR_STRING_FORMAT = /^AR\:([A-Z][\w\:]+)\:(\d+)$/
def initialize(object, method, args)
raise NoMethodError, "undefined method `#{method}' for #{self.inspect}" unless object... | 25.454545 | 111 | 0.598571 |
38025bdb772444f16d0172862f1b9075545a18de | 1,116 | AuthDemo::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web ... | 37.2 | 85 | 0.772401 |
eda15bad596c60ff49433eb787944aa61e496473 | 587 | class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
has_many :memberships
has_many :groups, through: :mem... | 45.153846 | 133 | 0.729131 |
87d177e9bbff1e19920c1c5b359d9ca88a4536d2 | 459 | #
# Cookbook Name:: fb_iproute
# Recipe:: packages
#
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS ... | 27 | 77 | 0.740741 |
e237d493569c908e6d5999411c5e5ad7195f7b23 | 585 | module VagrantPlugins
module ProviderVMwareFree
module Action
class MatchMACAddress
def initialize(app, env)
@app = app
end
def call(env)
raise Vagrant::Errors::VMBaseMacNotSpecified if !env[:machine].config.vm.base_mac
# Create the proc which we want ... | 26.590909 | 91 | 0.635897 |
1d036ca3c676bcb529c1da0e710e5d3e3d450219 | 5,754 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ApiManagement::Mgmt::V2019_12_01
module Models
#
# Api Operation details.
#
class OperationContract < Resource
include MsRestAzure
... | 31.102703 | 78 | 0.452729 |
ff7b06ec4822c605b0a7c6b111071ef73c26dc02 | 2,764 | require "spec_helper"
require "trikeapps"
describe Trikeapps::StringDemystifier do
before(:all) do
str = "!SSWSWSKCOR !OTNAAAWAA!"
@string_small = Trikeapps::StringDemystifier.new str
str = "!YTIRCO!IQIIQIDEMGMMIM FO YMJMMSM!RA !EGEEJEHT ROEOOSOF PAEJEEBEL TN!AIKIITIG ENVNNMNO ,GQGGCGN!ILEKIZIISIRT A RJRRDRO... | 34.55 | 196 | 0.738423 |
e803f9469225cc167ba8fe63436240d433b7a803 | 1,762 | RSpec.describe FirstExisting do
it "has a version number" do
expect(FirstExisting::VERSION).not_to be nil
end
describe ".first_existing" do
context "when given only existing arguments" do
it "returns the first one" do
expect(first_existing("string", true, 0, 15)).to eq "string"
end
... | 26.69697 | 79 | 0.609535 |
ffbba3d7839e125c4b2956f63a868f0a351e00a6 | 453 | require 'rails_helper'
feature 'User can see service apps index' do
before :each do
@member = create :member
@service_app = create :service_app
end
scenario 'and see all service apps' do
login_as @member
visit service_apps_path
expect(page).to have_content('Service Apps')
expect(page).t... | 23.842105 | 49 | 0.706402 |
28d692c3279132f5dd3cb39359ec725617aa7496 | 2,497 | require 'rails_helper'
RSpec.describe Product, type: :model do
let(:product) { create(:product, title: 'Leather Bag') }
describe '#create' do
describe 'regular' do
let(:product) { create(:product, product_type: :regular) }
it 'adds product with default variant' do
expect(product.variants.... | 29.376471 | 76 | 0.650781 |
bb7e3ee801ec5736032265271eba0ebbf9194cce | 100 | require 'setsumei'
Dir[File.join(File.dirname(__FILE__),"support/**/*.rb")].each { |f| require f }
| 25 | 79 | 0.67 |
1c3a4ef0b556f8ecd4cd74b93d790f6995bcda82 | 446 | RSpec.describe "Attachments", type: :request, skip_seed: true do
before do
sign_in(@user)
end
describe "DELETE #destroy" do
let(:partner) { create(:partner, documents: [Rack::Test::UploadedFile.new(Rails.root.join("spec/fixtures/files/dbase.pdf"), "application/pdf")]) }
it "redirects to referrer" do... | 29.733333 | 150 | 0.70852 |
87a3868700b1b2030de02e9dfa625cae5ac3cb65 | 450 | class Cms::Extensions::AdditionalInfo < Array
def mongoize
self.to_a
end
class << self
def demongoize(object)
if object.present?
object.map { |h| h.symbolize_keys }
else
[]
end
end
def mongoize(object)
case object
when self.class then object.mongoize... | 17.307692 | 52 | 0.577778 |
614429304987459915db213a5912e28f8ecf7ce3 | 58 | module ProtectedAttributes
VERSION = "1.8.1".freeze
end
| 14.5 | 26 | 0.758621 |
0311e34a0b74aacecd40febec783a25729d34976 | 2,580 | # Encoding: utf-8
# Cloud Foundry Java Buildpack
# Copyright (c) 2013 the original author or 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
#
# http://www.apache.org/licenses/L... | 33.947368 | 140 | 0.685271 |
39095d67dda5b78a87b8715ddd9e69d21167676b | 104 | class PieceSerializer
include FastJsonapi::ObjectSerializer
attributes :id, :board_location
end
| 20.8 | 40 | 0.798077 |
e81b73752a82406114633f99f92b9add5601e63e | 232 | class Message < ActiveRecord::Base
has_many :replies
belongs_to :user
delegate :name, :email, :to => :user, :allow_nil => true
validates_presence_of :body, :user_id
validates_length_of :body, :maximum => 140
end
| 21.090909 | 58 | 0.693966 |
216766b9ccc5af8bbf21c1c0b2b017874c26672a | 1,093 | class Navi < Formula
desc "Interactive cheatsheet tool for the command-line"
homepage "https://github.com/denisidoro/navi"
url "https://github.com/denisidoro/navi/archive/v2.12.0.tar.gz"
sha256 "2331a82f91dee35bd3a1c3cfc14b23a69f9d2ff65a8b7b840ead4e76e8e1f146"
license "Apache-2.0"
bottle do
sha256 cell... | 40.481481 | 120 | 0.762123 |
ff3ce9071d058e67062d7f5017aa8f8203b966fa | 81 | require 'flat-ui-sass/version'
module FlatUISass
# Your code goes here...
end
| 13.5 | 30 | 0.728395 |
e8cf8741227260dd514450e976adae9172a3ef9d | 1,457 | # encoding: utf-8
module Rubocop
module Cop
module Style
# The purpose of the this cop is advise the use of
# alias_method over the alias keyword whenever possible.
class Alias < Cop
MSG = 'Use alias_method instead of alias.'
def on_block(node)
method, _args, body = *... | 29.734694 | 75 | 0.582018 |
5dffa3263db6b326981bd6d7097d1687d7537d52 | 863 | # Version definitions
$AMPLIFY_VERSION = '1.0.3'
$AMPLIFY_RELEASE_TAG = "v#{$AMPLIFY_VERSION}"
Pod::Spec.new do |s|
s.name = 'CoreMLPredictionsPlugin'
s.version = $AMPLIFY_VERSION
s.summary = 'Amazon Web Services Amplify for iOS.'
s.description = 'AWS Amplify for iOS provides a declarative... | 33.192308 | 120 | 0.680185 |
aca9ef9a22740761641a5ff8e98f3d10ce65cebe | 216 | require 'spec_helper'
describe WLMachineLearning do
it 'has a version number' do
expect(WLMachineLearning::VERSION).not_to be nil
end
it 'does something useful' do
expect(false).to eq(true)
end
end
| 18 | 52 | 0.731481 |
bb992f0116bcd5037b40bda434e9a121b76bf7b0 | 2,572 | # frozen_string_literal: true
module Spree
module Stock
class Estimator
class ShipmentRequired < StandardError; end
class OrderRequired < StandardError; end
# Estimate the shipping rates for a package.
#
# @param package [Spree::Stock::Package] the package to be shipped
# @pa... | 35.722222 | 109 | 0.65591 |
b9c3bcdb783de4dc5d090f31596dffd0efa930fd | 246 | class CreateGroupsRoles < ActiveRecord::Migration[5.1]
def change
create_table(:groups_roles, :id => false) do |t|
t.references :group
t.references :role
end
add_index(:groups_roles, [ :group_id, :role_id ])
end
end
| 20.5 | 54 | 0.666667 |
7adafcdb9484bcdc179698d90f9a7f60c9dc7752 | 1,772 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop checks for potential uses of `Enumerable#minmax`.
#
# @example
#
# # bad
# bar = [foo.min, foo.max]
# return foo.min, foo.max
#
# # good
# bar = foo.minmax
#... | 25.681159 | 88 | 0.549661 |
1cd05b829c6ce9627744b37684c6cf190d2183bd | 603 | name 'prometheus_exporters'
maintainer 'Evil Martians'
maintainer_email 'surrender@evilmartians.com'
license 'Apache-2.0'
description 'Installs / configures Prometheus exporters'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.12.1'
chef_ver... | 31.736842 | 77 | 0.704809 |
e2db30dc05a16e5de33a520616a7231d68205bff | 3,626 | module MiqAeEngine
class MiqAeDomainSearch
def initialize
@fqns_id_cache = {}
@fqns_id_class_cache = {}
@partial_ns = []
end
def ae_user=(obj)
@sorted_domains ||= obj.current_tenant.enabled_domains.collect(&:name)
end
def get_alternate_domain(scheme, uri, n... | 35.203883 | 98 | 0.667954 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.