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 |
|---|---|---|---|---|---|
11116af7dbbb0885984166e0f28144f291cb2f07 | 235 | # frozen_string_literal: true
FactoryBot.define do
factory :sent_notification do
project
recipient { project.creator }
noteable { create(:issue, project: project) }
reply_key { SentNotification.reply_key }
end
end
| 21.363636 | 49 | 0.731915 |
b9c4af3d6276618383a76fc9a5adae50e59a0028 | 2,907 | # encoding: utf-8
module Github
# Repository Starring is a feature that lets users bookmark repositories.
# Stars are shown next to repositories to show an approximate level of interest. # Stars have no effect on notifications or the activity feed.
class Repos::Starring < API
# List stargazers
#
# ... | 29.663265 | 145 | 0.639147 |
ff7a0e0e6a23c9687947a854676ab636aa614b77 | 2,342 | # -------------------------------------------------------------------------- #
# Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# no... | 45.038462 | 78 | 0.464133 |
b9412d389564cb5ab619777be68acefb9572020d | 6,197 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: google/devtools/artifactregistry/v1beta2/service.proto for package 'Google.Cloud.ArtifactRegistry.V1beta2'
# Original file comments:
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... | 60.165049 | 172 | 0.685493 |
ff49cae3cb1755bc48094acd935f66fd7559d6d1 | 904 | require "spec_helper"
describe Bunny::Channel, "#prefetch" do
let(:connection) do
c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
c.start
c
end
after :each do
connection.close
end
context "with a positive integer < 65535" do
it "sets that pr... | 23.179487 | 97 | 0.655973 |
62d660a6b3f7d4ed94fbe86ce90be611eceee6e5 | 260 | module Tasuku::Concerns
require 'tasuku/concerns/controllers'
require 'tasuku/concerns/models'
require 'tasuku/concerns/verifiable'
require 'tasuku/concerns/illustratable'
require 'tasuku/concerns/redirectable'
require 'tasuku/concerns/author'
end
| 28.888889 | 41 | 0.796154 |
912e99d5735e3ee96474061e79577b7eb3d1a4d9 | 144 | class Post < ApplicationRecord
belongs_to :user
validates :title,:content,:image, presence: true
mount_uploader :image, ImageUploader
end
| 24 | 50 | 0.784722 |
385b738bf7774b6b003870bbffc9235752ecf25f | 596 | require_relative '../../../spec_helper'
describe Web::Controllers::Players::Show do
let(:action) { Web::Controllers::Players::Show.new }
let(:params) { Hash[id: 1] }
let(:repository) { PlayerRepository.new }
before do
@player = repository.create(id: 1, first_name: 'George', last_name: 'Abitbol', email:'ge... | 22.923077 | 112 | 0.682886 |
d532759e1b48f24e1a7179c29a1aa2c32fd20592 | 1,418 |
require 'spec_helper'
describe 'core_extensions/string' do
describe "to_crlf" do
it "should change a single LF to CRLF" do
"\n".to_crlf.should eq "\r\n"
end
it "should change multiple LF to CRLF" do
"\n\n".to_crlf.should eq "\r\n\r\n"
end
it "should change a single CR to CRLF" do... | 20.257143 | 51 | 0.582511 |
1db6bbb63f07b398432bb523b8c15fa9428ed7b8 | 823 | module TreeNode
class MiqServer < Node
set_attribute(:image, '100/miq_server.png')
set_attribute(:expand, true)
set_attributes(:title, :tooltip) do
if @options[:is_current]
tooltip = _("%{server}: %{server_name} [%{server_id}] (current)") %
{:server => ui_lookup(:model =... | 39.190476 | 127 | 0.601458 |
1c8e63a8e512bafbb73c98fdecf97d6a4211354a | 887 | require 'spaceship/base'
require 'spaceship/client'
require 'spaceship/launcher'
# Dev Portal
require 'spaceship/portal/portal'
require 'spaceship/portal/spaceship'
# iTunes Connect
require 'spaceship/tunes/tunes'
require 'spaceship/tunes/spaceship'
# To support legacy code
module Spaceship
ROOT = Pathname.new(Fil... | 27.71875 | 87 | 0.770011 |
b92f635386bc416de47e42a46b98966bdea1f2ba | 1,148 | module Fog
module Compute
class Brightbox
class Real
# Add a number of servers to the server group.
#
# @param [String] identifier Unique reference to identify the resource
# @param [Hash] options
# @option options [Array<Hash>] :servers Array of Hashes containing
... | 33.764706 | 97 | 0.561847 |
b939b56f5a3c815d55b4dd1c772b2d98e85e4294 | 202 | # -*- encoding : utf-8 -*-
require 'test_helper'
class Admin::ExpensesControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
| 20.2 | 64 | 0.712871 |
aba7bd4230a7ab7a5160438e9e58e862a28363f5 | 4,492 | class CinsCodeigniter < CMS
def self.articles params
url = get_url '/api/articles'
language = params['language']
if(language.blank?)
# Should be extracted
language = "rs"
end
version = params["v"]
@response = Rails.cache.fetch("cins_codeigniter_articles/#{language}/#{vers... | 25.816092 | 122 | 0.615761 |
91129237f7fc2b0fb66561daf31089785906669e | 264 | require 'json'
require 'test/unit/assertions'
include Test::Unit::Assertions
config_json_path = __FILE__
begin
output = JSON.parse IO.read config_json_path
rescue Exception => e
puts "an exception occurred: #{e}"
end
assert_nil output, "output expected nil" | 20.307692 | 46 | 0.768939 |
bb762e4f7d0d7c3ac7264ef2176a5dd66fd75188 | 938 | # $HeadURL$
# $Id$
#
# Copyright (c) 2009-2012 by Public Library of Science, a non-profit corporation
# http://www.plos.org/
#
# 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... | 36.076923 | 80 | 0.761194 |
ab9b601e75664f70c431b22acaf56a9a3bbb40f6 | 175 | class AddAssignerToAssignment < ActiveRecord::Migration[4.2]
def change
add_column :assignments, :assigner_id, :integer
add_index :assignments, :assigner_id
end
end
| 25 | 60 | 0.777143 |
bf08bcd4c9703ce11268226096f2fa946625a033 | 2,013 | class AddDeviseToUsers < ActiveRecord::Migration
def self.up
#encrypting passwords and authentication related fields
rename_column :users, "crypted_password", "encrypted_password"
change_column :users, "encrypted_password", :string, :limit => 128, :default => "", :null => false
rename_column :users, ... | 35.946429 | 102 | 0.720815 |
010a938f055fa97fc902473e0df6d388474f625f | 1,175 | class Decree < ActiveRecord::Base
include OpenCourts::Model
include Purgeable
belongs_to :source
# TODO consider this required in future
belongs_to :proceeding, optional: true
belongs_to :court, optional: true
has_many :judgements
has_many :exact_judgements, -> { exact }, class_name: :Judgement, sour... | 36.71875 | 96 | 0.770213 |
e934ada1cabdffdeb6b3b0f89d24b341cd38fa9c | 9,149 | require 'benchmark'
require 'capistrano/errors'
require 'capistrano/processable'
module Capistrano
# This class encapsulates a single command to be executed on a set of remote
# machines, in parallel.
class Command
include Processable
class Tree
attr_reader :configuration
attr_reader :branc... | 30.095395 | 103 | 0.548038 |
7aa3762116013c7c21877c58e7320bbfda0c00ef | 371 | # frozen_string_literal: true
require "loggeryk"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_w... | 23.1875 | 66 | 0.754717 |
0145b8c9d90542c4a915663b7272b65679677917 | 2,718 | # Copyright 2017 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 applicable law or agreed to in writing, ... | 31.604651 | 80 | 0.582781 |
ac6429e7695513a0447cf105703fc7c99aff1c04 | 2,007 | Rails.application.routes.draw do
root 'wonolo#index', as: 'root'
get 'data/completed' => 'wonolo#completed', as: 'completed'
get 'data/in_progress' => 'wonolo#in_progress', as: 'in_progress'
get 'data/no_show' => 'wonolo#no_show', as: 'no_show'
get 'data/cancelled' => 'wonolo#cancelled', as: 'cancelled'... | 29.514706 | 84 | 0.646238 |
01e461de4ff3a0ec7d68d5c565af9a97d1e3e963 | 3,605 | class Qca < Formula
desc "Qt Cryptographic Architecture (QCA)"
homepage "http://delta.affinix.com/qca/"
revision 2
head "https://anongit.kde.org/qca.git"
stable do
url "https://github.com/KDE/qca/archive/v2.1.3.tar.gz"
sha256 "a5135ffb0250a40e9c361eb10cd3fe28293f0cf4e5c69d3761481eafd7968067"
# u... | 37.947368 | 104 | 0.696533 |
d5a23cd530f1c2826fd6c0b971759f6926f67def | 1,869 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rai... | 46.725 | 96 | 0.743713 |
e9e25c0a5e1a6d34bfe52c9656147bde02e06989 | 25,612 | require "helper"
describe Thor do
describe "#method_option" do
it "sets options to the next method to be invoked" do
args = %w(foo bar --force)
_, options = MyScript.start(args)
expect(options).to eq("force" => true)
end
describe ":lazy_default" do
it "is absent when option is no... | 35.572222 | 141 | 0.636928 |
b95b9f93306743c3e726fa7c77f237ae10f9a511 | 3,261 | # encoding: utf-8
require 'yaml'
Gem::Specification.new do |gemspec|
root = File.dirname(__FILE__)
lib_dir = File.join(root,'lib')
files = `git ls-files`.split($/)
filter_files = lambda { |paths|
files & case paths
when Array
paths
when String
Dir[... | 30.764151 | 83 | 0.642748 |
61d1155f2cc08b110deeb453705c52d4cc0ba350 | 1,149 | $LOAD_PATH.unshift File.expand_path '../lib', __FILE__
require 'active_ingredients/version'
Gem::Specification.new do |s|
s.name = 'active-ingredients'
s.summary = 'Simple Value Objects For Active Model'
s.description = 'Compose big Active Model classes with smaller ingredients that map directly to v... | 39.62069 | 121 | 0.731941 |
1d1c921f603d7f8e3239f3c20fb5b19aef477517 | 2,665 | require 'test_helper'
class PasswordResetsTest < ActionDispatch::IntegrationTest
def setup
ActionMailer::Base.deliveries.clear
@user = users(:michael)
end
test "password resets" do
get new_password_reset_path
assert_template 'password_resets/new'
post password_resets_path, params: { pass... | 32.901235 | 72 | 0.657036 |
21ede51406af4e127815a61d3fbc01ba2880201e | 1,101 | require "application_system_test_case"
class CommentsTest < ApplicationSystemTestCase
setup do
@comment = comments(:one)
end
test "visiting the index" do
visit comments_url
assert_selector "h1", text: "Comments"
end
test "should create comment" do
visit comments_url
click_on "New commen... | 23.934783 | 52 | 0.708447 |
62ab8c8b9015d596ddb00e321be525e749481365 | 712 | require 'test_helper'
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
def setup
@base_title = "Ruby on Rails Tutorial Sample App"
end
test "should get home" do
get root_path
assert_response :success
assert_select "title", "#{@base_title}"
end
test "should get help" do... | 20.941176 | 65 | 0.686798 |
e9bc2c39d8b195c4b62af7c41d701dd3dec6dfd8 | 945 | class Exploitdb < Formula
desc "The official Exploit Database"
homepage "https://www.exploit-db.com/"
url "https://github.com/offensive-security/exploitdb.git",
:tag => "2020-01-11",
:revision => "d3ca8599713572b6fe9d2736aafddd9b6741b065"
version "2020-01-11"
head "https://github.com/offensiv... | 28.636364 | 77 | 0.65291 |
621119a6381f40477392a43069e809ecbb8a019d | 3,782 | 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.108696 | 102 | 0.757271 |
d5d7a006ec74db734679a519f6d45a023ab9b173 | 679 |
Pod::Spec.new do |s|
s.name = "RNReactNativeChartboost"
s.version = "1.0.0"
s.summary = "RNReactNativeChartboost"
s.description = <<-DESC
RNReactNativeChartboost
DESC
s.homepage = ""
s.license = "MIT"
# s.license = { :type => "MIT", :f... | 28.291667 | 104 | 0.55081 |
6106b654d9f03de7e8c6e62e9be7983ab78521d7 | 459 | require 'action_controller'
require 'action_view'
class TestView
include ActionView::Helpers::PrototypeHelper
include ActionView::Helpers::ScriptaculousHelper
include ActionView::Helpers::JavaScriptHelper
include ActionView::Helpers::TagHelper
def url_for(params)
return "http://somemockurl.com"
end
... | 21.857143 | 50 | 0.79085 |
9150084380704af062c3668a073a4048d9c916ef | 4,098 | # frozen_string_literal: true
require 'capybara/selector/filter'
module Capybara
class Selector
class FilterSet
attr_reader :node_filters, :expression_filters
def initialize(name, &block)
@name = name
@node_filters = {}
@expression_filters = {}
@descriptions = Hash.n... | 32.784 | 118 | 0.638604 |
e807161d79f0503306ca5ee6dd14f72b506449b8 | 986 | 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 NJBusNowRestAPI
class Application < Rails::Application
# Settings in config/environments/* ta... | 41.083333 | 99 | 0.725152 |
e93d97e7bdd63c8805d95ceaac936a9f6172c9eb | 1,107 | cask 'unity-appletv-support-for-editor@2018.1.0b2' do
version '2018.1.0b2,79c3bdce0980'
sha256 :no_check
url "http://beta.unity3d.com/download/79c3bdce0980/MacEditorTargetInstaller/UnitySetup-AppleTV-Support-for-Editor-2018.1.0b2.pkg"
name 'tvOS Build Support'
homepage 'https://unity3d.com/unity/'
pkg 'Un... | 30.75 | 131 | 0.71364 |
084fa4047a40476bbf457df131e1954a78a3821b | 1,110 | # frozen_string_literal: true
module Gitlab
module Ci
class Config
module Entry
##
# Entry that represents a configuration of Docker service.
#
class Service < Image
include ::Gitlab::Config::Entry::Validatable
ALLOWED_KEYS = %i[name entrypoint command a... | 28.461538 | 102 | 0.595495 |
e2ddca8b1d444f594d331616f45e1d48fb7fe035 | 1,100 | RSpec.feature 'Updating currencies settings' do
stub_authorization!
background do
reset_spree_preferences do |config|
config.supported_currencies = 'USD'
config.allow_currency_change = false
config.show_currency_selector = false
end
end
scenario 'allows to update supported currencies... | 33.333333 | 82 | 0.739091 |
614dcf1eab6088daedba050a82f8ea05978557c3 | 5,696 | # encoding: utf-8
require "logstash/environment"
module LogStash::Util
UNAME = case RbConfig::CONFIG["host_os"]
when /^linux/; "linux"
else; RbConfig::CONFIG["host_os"]
end
PR_SET_NAME = 15
def self.set_thread_name(name)
previous_name = Java::java.lang.Thread.currentThread.getName() if block_given... | 27.516908 | 95 | 0.610077 |
6ab9aa46c63d502cda72865402f7f394b0491e28 | 5,683 | =begin
example usage:
fail "this script requires the cli_builder util from the repo" unless Script.exists?("cli_builder")
load $script_dir + "cli_builder.rb"
CLI.of "map" do
# a general help description
describe(self, "a utility for working with rooms")
# describes a given command
... | 25.257778 | 110 | 0.598627 |
6a6cd8d8c38f865497d9d8760cb932d2a8d02173 | 1,811 | # frozen_string_literal: true
# this file is managed by dry-rb/devtools project
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'dry/types/version'
Gem::Specification.new do |spec|
spec.name = 'dry-types'
spec.authors = ["Piotr Solnica"]
spec... | 42.116279 | 136 | 0.686913 |
08ec0cebd90005fd2f12ab0407bf9be1fa8e81ea | 94 | class HardWorker
include Sidekiq::Worker
def perform(*args)
# Do something
end
end
| 11.75 | 25 | 0.702128 |
08cb406b691fa98978b869c6bbd441c895eef8d9 | 259 | class CreateListsMovies < ActiveRecord::Migration[6.1]
def change
create_table :lists_movies do |t|
t.belongs_to :movie, null: false, foreign_key: true
t.belongs_to :list, null: false, foreign_key: true
t.timestamps
end
end
end
| 23.545455 | 57 | 0.694981 |
ff0d1d3cf8aad3f3e54bf0bd3e4891783adc0c1d | 855 | # frozen_string_literal: true
namespace :analytics do
root to: 'analytics#index'
constraints(-> (req) { Gitlab::Analytics.cycle_analytics_enabled? }) do
resource :cycle_analytics, only: :show, path: 'value_stream_analytics'
scope module: :cycle_analytics, as: 'cycle_analytics', path: 'value_stream_analyti... | 30.535714 | 92 | 0.673684 |
bfe4106e88fadf2343a3d08124bbb171113076bb | 642 | PassbookRailsExample::Application.routes.draw do
PASS_TYPE_IDENTIFIER_REGEXP = /([\w\d]\.?)+/
namespace :passbook, path: "passbook/v1" do
constraints(pass_type_identifier: /([\w\d]\.?)+/) do
get '/passes/:pass_type_identifier/:serial_number' => 'passes#show'
get '/devices/:device_library_identifie... | 45.857143 | 125 | 0.746106 |
87e3ef45845bfe4a448f074156bc88914b762445 | 1,666 | module Fog
module Network
class OpenStack
class Real
def update_vpn_service(vpn_service_id, options = {})
data = {'vpnservice' => {}}
vanilla_options = [:name, :description, :admin_state_up]
vanilla_options.select { |o| options.key?(o) }.each do |key|
data[... | 35.446809 | 119 | 0.538415 |
acb6d18aa26f25e021bb0e3ec3a8e83f0eef53ae | 361 | class Picoc < Formula
desc "C interpreter for scripting"
homepage "https://code.google.com/p/picoc/"
url "https://picoc.googlecode.com/files/picoc-2.1.tar.bz2"
sha256 "bfed355fab810b337ccfa9e3215679d0b9886c00d9cb5e691f7e7363fd388b7e"
def install
system "make", "CC=#{ENV.cc}", "CFLAGS=#{ENV.cflags} -DUNIX... | 30.083333 | 75 | 0.731302 |
1af2d8ddb47c0ef44477c55a1776255143eebe12 | 398 | # frozen_string_literal: true
require 'spec_helper'
support :test_adaptor_helpers
RSpec.describe LedgerSync::Adaptors::Test::Customer::Operations::Update do
include TestAdaptorHelpers
let(:customer) { LedgerSync::Customer.new(ledger_id: '123', name: 'Test') }
it do
instance = described_class.new(resource... | 23.411765 | 77 | 0.761307 |
f8b7d6b4859e2977216c28a43a4908a36cc64536 | 507 | RSpec.shared_examples_for 'Msf::DBManager::Adapter' do
if ENV['REMOTE_DB']
before {skip("Not used for remote data service")}
end
context 'CONSTANTS' do
context 'ADAPTER' do
subject(:adapter) {
described_class::ADAPTER
}
it { is_expected.to eq('postgresql') }
end
end
i... | 24.142857 | 54 | 0.676529 |
f845693a59d087f170873d606ddeea601718ffb2 | 158 | # Used by third party farmwares (eg: weed-detection) to mark points on a map.
class GenericPointer < Point
def name_used_when_syncing
"Point"
end
end
| 22.571429 | 77 | 0.746835 |
288463e266b5241821a28c3f618c65dfd4d77b65 | 699 | require_relative '../../npi_download'
RSpec.describe "Creating an NPI Registry Query" do
it "is a type of NpiDownload" do
npi_request = NpiDownload.new
expect(npi_request).to be_kind_of(NpiDownload)
end
it "includes the NPI Registry URL in the uri host string" do
npi_request = NpiDownload.new
... | 18.891892 | 62 | 0.718169 |
115e31db5132da6e0af6619b733c8a5735a7f43f | 281 | #Environment
require 'httparty'
require 'pry'
require_relative './superhero/version'
require_relative './superhero/hero'
require_relative './superhero/cli'
require_relative "./superhero/api"
#API Call
BASE_URL = "https://superheroapi.com/api.php/"
ACCESS_TOKEN = "814865975490" | 23.416667 | 46 | 0.775801 |
1d95c65d0d596d16255fa490081e147857728706 | 1,904 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suit... | 38.857143 | 85 | 0.768908 |
5dd871b12b3f1d3c5bdddac611e0521bb337edde | 5,911 | # frozen_string_literal: true
RSpec.describe DHeap, "comparisons" do
describe "with optimized types" do
it "sorts 'small' integers (T_FIXNUM)" do
heap = DHeap.new
heap << 2**4
heap << 2**62 - 1 # max FIXNUM
heap << 2**16
heap << 2**8
heap << 2**2
heap << 2**1
hea... | 30.158163 | 79 | 0.564879 |
288644869bb436088dd459a8b9dc2622eb5bf4b3 | 19,171 | # A nomenclator name, composed of existing {Protonym}s. Each record reflects the subsequent use of two or more protonyms.
# Only the first use of a combination is stored here, subsequence uses of this combination are referenced in Citations.
#
# A {Combination} has no name, it exists to group related Protonyms into an ... | 40.70276 | 270 | 0.718533 |
abc5ca4909aa3174e8d8600c3f6723730b346275 | 4,991 | class Wal2json < Formula
desc "Convert PostgreSQL changesets to JSON format"
homepage "https://github.com/eulerto/wal2json"
url "https://github.com/eulerto/wal2json/archive/wal2json_2_2.tar.gz"
sha256 "e2cb764ee1fccb86ba38dbc8a5e2acd2d272e96172203db67fd9c102be0ae3b5"
license "BSD-3-Clause"
bottle do
ce... | 36.698529 | 117 | 0.545582 |
7ab4c4b7462db928172f0faddbe2589eda4167fc | 4,721 | require_relative "../test_helper"
# current headless chrome does not support setting the Accepted-Language header, therefore only default(en) can be tested
class Test::AdminUi::TestLocales < Minitest::Capybara::Test
include Capybara::Screenshot::MiniTestPlugin
include ApiUmbrellaTestHelpers::AdminAuth
include Api... | 33.246479 | 121 | 0.67401 |
61511be80a7a2d303edfe58b0837f150131e6cf4 | 378 | module Quickbooks
module Model
class PaymentLineDetail < BaseModel
xml_accessor :item_ref, :from => 'ItemRef', :as => Integer
xml_accessor :class_ref, :from => 'ClassRef', :as => Integer
xml_accessor :balance, :from => 'Balance', :as => Float
xml_accessor :discount, :from => 'Discount', :a... | 37.8 | 93 | 0.664021 |
2889527db824180cbeaa66aebb6c379d565fc686 | 1,602 | require "rbexy/version"
require "active_support/inflector"
require "active_support/concern"
require "active_support/core_ext/enumerable"
require "action_view/helpers/output_safety_helper"
require "action_view/helpers/capture_helper"
require "action_view/helpers/tag_helper"
require "action_view/context"
module Rbexy
... | 29.666667 | 76 | 0.750936 |
bfc97d5650e7368b7a8562fcc28174131aa89979 | 1,617 | #
# Be sure to run `pod lib lint PTSuperImages.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 = 'PTSup... | 37.604651 | 106 | 0.642548 |
6aa177e6df23a5c7679dd10181b5614b4817c27d | 535 | require 'spec_helper_acceptance'
# Ensure message of the day (MOTD) is properly configured - Section 1.7.1.1,
# Ensure permisisons on /etc/motd are configured - Section 1.7.1.4
describe file('/etc/motd') do
it { should be_file }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
it {... | 38.214286 | 76 | 0.71028 |
1cb3bcfcff0b5a27a5646ee154f3ebac7cccdc9c | 2,823 | module Spree
class LineItem < ActiveRecord::Base
before_validation :adjust_quantity
belongs_to :order, class_name: "Spree::Order", :inverse_of => :line_items
belongs_to :variant, class_name: "Spree::Variant"
belongs_to :tax_category, class_name: "Spree::TaxCategory"
has_one :product, through: :va... | 23.330579 | 77 | 0.678356 |
08f1ad8997ee5252c369453b141dab2075268241 | 137 | FactoryBot.define do
factory :farmware_env do
device
key { Faker::Pokemon.move }
value { Faker::Pokemon.move }
end
end
| 17.125 | 33 | 0.664234 |
f7394db0239de843e54193e61ec3d42d17269817 | 425 | require_dependency "cadmin/application_controller"
module Cadmin
class CartsController < ApplicationController
skip_before_action :authenticate_cadmin_user!, :only => [:index]
before_action :set_cart
def index
@total_cart_amount = @cart.total_cart_amount
@main_service = MainService.first
... | 25 | 68 | 0.708235 |
ac3b28d59b1b94b6760aeeaab9febce40827c7d8 | 1,096 | require 'spec_helper'
require 'mailclerk'
describe Zenzai::MailClerk do
before do
@first_user = Factory.create_user
@second_user = Factory.create_user({:email => "ghi@123.com",
:gets_daily_dharma => true})
@first_jewel = Factory.create_jewel
@second_jewel = Fac... | 28.842105 | 78 | 0.622263 |
ac76a2ac19e400b95317937c9a05e5cc2e774dcd | 2,938 | require 'rack-flash'
class MessagesController < ApplicationController
use Rack::Flash, :sweep => true
get '/messages' do
if logged_in?
@messages = Message.all
erb :'messages/index'
else
flash[:notice] = "You must be logged in to do that!"
red... | 28.524272 | 110 | 0.507488 |
79592ae7ae2c3273eff4648d26540c0707057c19 | 326 | cask 'red' do
version '0.6.1'
sha256 'afefaa392e5dbc1ec6d8805376ecffe86a1f6d1ce46d426800556f3c4f698693'
url "http://static.red-lang.org/dl/mac/red-#{version.no_dots}"
name 'Red Programming Language'
homepage 'http://www.red-lang.org/'
container type: :naked
binary "red-#{version.no_dots}", target: 'red... | 25.076923 | 75 | 0.730061 |
d5272de5e58462e567758a695a7cbb26577a83e3 | 1,185 | control "VCRP-67-000006" do
title "rhttpproxy must have logging enabled."
desc "After a security incident has occurred, investigators will often
review log files to determine what happened. rhttpproxy must create logs upon
service start up in order to capture information relevant to investigations."
impact 0.5
... | 30.384615 | 79 | 0.739241 |
7a6aa58a743ab88fd710410a172240283e3f4ba5 | 451 | Spec::Matchers.define :smart_match do |expected|
def regexp?
/^\/.*\/?$/
end
def quoted?
/^".*"$/
end
match do |actual|
case expected
when regexp?
actual =~ eval(expected)
when quoted?
actual.index(eval(expected))
else # multi-line string
actual.index(expected)
... | 14.09375 | 48 | 0.580931 |
1dbf5fd95ab79e95ea1e9b21e626c793ae46308e | 604 | module RailsAdmin
module Config
module Actions
class RestApi2 < RailsAdmin::Config::Actions::Base
register_instance_option :member do
true
end
register_instance_option :i18n_key do
:rest_api
end
register_instance_option :http_methods do
... | 18.875 | 59 | 0.581126 |
b9492d986d5bb64a75e030ef1118c57638bd8e71 | 2,298 | require 'spec_helper'
require 'puppet/module_tool/installed_modules'
require 'puppet_spec/modules'
describe Puppet::ModuleTool::InstalledModules do
include PuppetSpec::Files
around do |example|
dir = tmpdir("deep_path")
FileUtils.mkdir_p(@modpath = File.join(dir, "modpath"))
@env = Puppet::Node::Env... | 45.96 | 104 | 0.697998 |
3860642bdd89afc6cf2a21865c1162d9e623a9ef | 571 | Pod::Spec.new do |s|
s.name = 'PKCCrop'
s.version = '0.2.4'
s.summary = 'Images crop'
s.description = 'There are many options that can be used to easily put images into crops.'
s.homepage = 'https://github.com/pikachu987/PKCCrop'
s.license = { :type => 'MIT', :file =>... | 43.923077 | 100 | 0.590193 |
08fa1e575087148131da1c38aba09930a5cc3a45 | 1,114 | require 'spec_helper'
module BarkingDog
describe PoolProxy do
before do
class BaseConcurrentService
include BarkingDog::BasicService
self.concurrency = 2
on "cool", :handle_cool
class_attribute :cool_handler
self.cool_handler = Queue.new
def handle_cool(... | 21.843137 | 70 | 0.670557 |
ff282d897b2d8c5e1120448ceb11738cd74f247b | 556 | class CreateGoogleMerchantCategories < ActiveRecord::Migration
def self.up
create_table :google_merchant_categories do |t|
t.string :name
t.integer :parent_id
t.integer :left
t.integer :right
t.integer :google_category_id
t.string :google_path, limit: 300
t.timestamps
... | 25.272727 | 62 | 0.726619 |
6236478d3485ead0d5fb2ce4d725d381f34604da | 2,073 | # frozen_string_literal: true
FactoryBot.define do
factory :internship_application do
student { create(:student) }
motivation { 'Suis hyper motivé' }
trait :drafted do
aasm_state { :drafted }
end
trait :submitted do
aasm_state { :submitted }
submitted_at { 3.days.ago }
end... | 28.39726 | 89 | 0.614568 |
6aedd082e9caf12e534ec8dba5b2b3c8d4006c9f | 482 | describe User do
before { @user = FactoryBot.build(:passenger) }
subject { @user }
it { should validate_presence_of(:email) }
it { should validate_presence_of(:full_name) }
it { should validate_presence_of(:phone_number) }
it { should validate_uniqueness_of(:email).case_insensitive }
it { should validate_un... | 32.133333 | 69 | 0.763485 |
1a2f8fecd602dc826de50674b270f77138a73fb3 | 1,879 | require 'test_helper'
class FollowingTest < ActionDispatch::IntegrationTest
def setup
@user = users(:Andrew)
@other_user= users(:Archer)
log_in_as(@user,password: "pepeb312", remember_me: "1")
end
test "following page" do
get following_user_path(@user)
assert_not @user.following.empty?... | 29.825397 | 82 | 0.700373 |
91eb4094338cb06b804287cdb291b48cd50aff49 | 744 | class NodeBuild < Formula
desc "Install NodeJS versions"
homepage "https://github.com/nodenv/node-build"
url "https://github.com/nodenv/node-build/archive/v4.9.39.tar.gz"
sha256 "0f94c52fba5a59bd4b45242a80d5accbf870a847f25b3b1cd2f65eaee910ecf7"
license "MIT"
head "https://github.com/nodenv/node-build.git"
... | 24 | 112 | 0.711022 |
6abbd1efb0db4a96da007e119dc7a8f40ddc49ab | 4,522 | # December 2015 Michael G. Wiebe
#
# Copyright (c) 2015-2016 Cisco and/or its affiliates.
#
# 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
#
... | 29.174194 | 79 | 0.676249 |
bb37fec7c49c7a80970bef0914d99e412b82b74a | 1,792 | module RbSDL2
class Palette
require_relative 'ref_count_pointer'
class PalettePointer < RefCountPointer
class << self
def release(ptr) = ::SDL.FreePalette(ptr)
def entity_class = ::SDL::Palette
end
end
class << self
def [](*color)
plt = new(color.length)
... | 23.893333 | 69 | 0.592076 |
18883fb8d6922666ea28cab368b6b067c9d815ed | 416 | # frozen_string_literal: true
class Api::V0::Madmp::MadmpSchemasController < Api::V0::BaseController
before_action :authenticate
def show
@schema = MadmpSchema.find(params[:id])
# check if the user has permissions to use the templates API
unless Api::V0::Madmp::MadmpSchemaPolicy.new(@user, @fragment).... | 26 | 72 | 0.730769 |
f8a390380880fd3a7c31d6d4a3de464769c3b887 | 56 | describe command('dotnet') do
it { should exist }
end
| 14 | 29 | 0.696429 |
f841d47eac153d229e20bbf0011eea7afd8f7fd5 | 587 | cask "alacritty" do
version "0.7.0"
sha256 "b4337889193332c33d00d5f1e8c744ee9d17cd178f84eae7df86067eac7ddf9a"
url "https://github.com/alacritty/alacritty/releases/download/v#{version}/Alacritty-v#{version}.dmg"
appcast "https://github.com/alacritty/alacritty/releases.atom"
name "Alacritty"
desc "Cross-plat... | 32.611111 | 102 | 0.761499 |
01e13586e51ed25bff5cec10b9ccf8c4a00378c4 | 343 | require "spec_helper"
RSpec.describe Cronis::Lecture3::ReverseArray do
describe '#sum' do
context 'when random array is passed' do
before do
@service = Cronis::Lecture3::MaxValue.new
end
it 'should return reverted array' do
expect(@service.call([1, 4, 22, -1])).to eq 22
... | 21.4375 | 54 | 0.629738 |
91f1ba81e6a23958a3f6fe9610a6752f9a2d185b | 290 | class RemoveColumnsFromPeople < ActiveRecord::Migration
def change
remove_column :people, :header_pic
remove_column :people, :profile_pic
remove_column :people, :skill_one_icon
remove_column :people, :skill_two_icon
remove_column :people, :skill_three_icon
end
end
| 26.363636 | 55 | 0.772414 |
9110a93827b2e59dea458cd3c71df1cfe99437a2 | 50,423 | require 'enumerator'
require 'miq-hash_struct'
class MiqRequestWorkflow
include Vmdb::Logging
include_concern "DialogFieldValidation"
# We rely on MiqRequestWorkflow's descendants to be comprehensive
singleton_class.send(:prepend, DescendantLoader::ArDescendantsWithLoader)
attr_accessor :dialogs, :requeste... | 34.702684 | 163 | 0.664974 |
e29d61acdb6febd95603898f746eddba96b689b5 | 29,415 | # 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/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plugins... | 43.96861 | 148 | 0.657794 |
18f4ae78938225fbc9d9a92948d32e92fe65da2f | 1,101 | Pod::Spec.new do |s|
s.name = 'Apollo'
s.version = `scripts/get-version.sh`
s.author = 'Meteor Development Group'
s.homepage = 'https://github.com/apollographql/apollo-ios'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = "A GraphQL client for iOS, written in ... | 33.363636 | 99 | 0.659401 |
bf3fd3d3b1580005593a42e05e9c2b35b5508d00 | 7,487 | =begin
#Xero Payroll AU
#This is the Xero Payroll API for orgs in Australia region.
The version of the OpenAPI document: 2.6.0
Contact: api@xero.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
=end
require 'time'
require 'date'
module XeroRuby::PayrollAu
require 'bigdecimal'
... | 30.311741 | 206 | 0.627221 |
bf6d774f9e8923d901f99b6d63b4118008db1093 | 459 | name 'patroni'
maintainer 'GitLab.com'
maintainer_email 'support@gitlab.com'
license 'Apache 2.0'
description 'Installs/Configures Patroni for GitLab'
long_description 'Installs/Configures Patroni for GitLab'
version '0.1.0'
chef_version '>= 12.1' if respond_to?(:chef_version)
issues_url 'https://gitlab.com/gitlab-org... | 28.6875 | 64 | 0.79085 |
383de5697c448bb02140384474aff2612bde3ee7 | 3,204 | module Beaker::DSL::InstallUtils
# This helper class encapsulates querying feature flag settings from
# options[:answers] which can be used to drive Beaker's install behavior
# around new or experimental features, typically in the PE Modules.
#
# Also handles initializing feature flag settings from environmen... | 27.86087 | 84 | 0.657303 |
62d693e0111cafb7373130a576d0a58de0b36195 | 1,521 | class UseDeletedOnInContainersTables < ActiveRecord::Migration[5.0]
class ContainerDefinition < ActiveRecord::Base
end
class ContainerGroup < ActiveRecord::Base
self.inheritance_column = :_type_disabled
end
class ContainerImage < ActiveRecord::Base
end
class ContainerProject < ActiveRecord::Base
... | 26.224138 | 96 | 0.717949 |
874ffce782cff80d7067eb4e33556f3cc14ffe35 | 3,829 | test_name 'ttls configured with custom group containing core and custom facts' do
tag 'risk:high'
skip_test "Known issue. Scenario does not work."
require 'facter/acceptance/user_fact_utils'
extend Facter::Acceptance::UserFactUtils
custom_fact_file = 'custom_facts.rb'
custom_fact_name = 'random_custom_f... | 43.511364 | 143 | 0.692609 |
115cafe31bd271c229e282157f3a22a1ed8f78e7 | 7,036 | =begin
#Datadog API V1 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://openapi-generator.tech
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product... | 29.813559 | 208 | 0.627771 |
ff8ec3133ca863d57875869346d88ef0d5964395 | 1,422 | Before do
set_env('MSF_DATBASE_CONFIG', Rails.configuration.paths['config/database'].existent.first)
set_env('RAILS_ENV', 'test')
@aruba_timeout_seconds = 8.minutes
end
# don't setup child processes to load simplecov_setup.rb if simplecov isn't installed
unless Bundler.settings.without.include?(:coverage)
Befo... | 47.4 | 118 | 0.688467 |
2627b0f3dc81daf63ea341e8d796c7b268d8a50c | 11,931 | require 'minitest/autorun'
require 'sprockets/path_utils'
class TestPathUtils < MiniTest::Test
include Sprockets::PathUtils
DOSISH = File::ALT_SEPARATOR != nil
DOSISH_DRIVE_LETTER = File.dirname("A:") == "A:."
DOSISH_UNC = File.dirname("//") == "//"
def test_stat
assert_kind_of File::Stat, stat(File.ex... | 39.506623 | 112 | 0.677479 |
e23d6a989c00b914dbbb2a994a714dd1761ef146 | 162 | json.extract! transaction, :id, :transaction_time, :transaction_type, :description, :created_at, :updated_at
json.url transaction_url(transaction, format: :json)
| 54 | 108 | 0.802469 |
39f4568a4144bf54a7e7f74a784423c8f6f83191 | 197 | class CoactiveItemFinder < IIFinder::Base
model Item
coact Coactors::NameFinder, Coactors::AgeFinder
context :results, default: []
before_call do
@context.results << 'Main'
end
end
| 17.909091 | 49 | 0.720812 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.