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 |
|---|---|---|---|---|---|
6a841823648aa971f6b24db0fd5a249392ddd733 | 1,006 | # 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... | 40.24 | 86 | 0.754473 |
1d59525f2895014acd9ff97b60cdd5b9adc7307d | 2,652 | require 'administrate/base_dashboard'
class UserDashboard < Administrate::BaseDashboard
# ATTRIBUTE_TYPES
# a hash that describes the type of each of the model's fields.
#
# Each different type represents an Administrate::Field object,
# which determines how the attribute is displayed
# on pages throughout... | 27.061224 | 79 | 0.697964 |
21aac7319112e2d8b9deb89b328994e3b5e3f9ed | 1,980 | maximum_cost = nil
minimum_cost = nil
@annual_cost_before_and_after.each do |year, before_after|
yearly_maximum = before_after[:before] > before_after[:after] ? before_after[:before] : before_after[:after]
yearly_minimum = before_after[:before] < before_after[:after] ? before_after[:before] : before_after[:after]
... | 48.292683 | 442 | 0.685354 |
ac81eb3bbc5bee16bf37da609ec80530d455b66a | 1,295 | module Coupler::API
class ComparatorController < Controller
def initialize(index, create, update, show, delete, create_params, update_params, show_params)
@index = index
@create = create
@update = update
@show = show
@delete = delete
@create_params = create_params
@update... | 25.9 | 98 | 0.617761 |
edf2d91b222cf96b7849d5fa0e4be53b265263dc | 240 | class DemoRequestSystemMailer < Struct.new(:demo_request_id)
def perform()
demo_request = DemoRequest.find(demo_request_id)
# send email to support
SupportMailer.demo_request(demo_request).deliver
end
end
| 18.461538 | 60 | 0.716667 |
39a01cbb814dd5c31f3b1e1c1fdf8defd51cef8a | 2,183 | module ProfileHelper
def countries
Country.pluck(:name, :id)
end
def dial_codes
Country.dial_codes
end
def user_org_admin?
return false if @context.guest?
current_user.id == current_user.org.admin_id
end
# Checks if current user has created organization leave (or leave on dissolve) requ... | 25.091954 | 89 | 0.721942 |
ed22123c7c6089a6cf4e4f576373dbd6aff9bf25 | 1,107 | require "spec_helper"
describe GW2::Recipe do
describe ".all" do
before :each do
@recipes = [1275, 1276, 1277, 1278, 1279]
end
it "exists" do
expect(GW2::Recipe.respond_to?(:all)).to eq(true)
end
it "returns all recipes", :vcr do
expect(GW2::Recipe.all).to include(*@recipes)
... | 23.553191 | 62 | 0.530262 |
08e94882b972ecdc3066d548815f24059c2d9a25 | 84 | class UserDetail < ApplicationRecord
belongs_to :user, foreign_key: "user_id"
end
| 21 | 42 | 0.797619 |
87a9b603d1b6b7679d509618beba04f0b5eb8c09 | 73,581 | # -*- coding: utf-8 -*-
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++
require 'rubygems/version'
require 'rubygems/requirement'
require 'rubygems/platform'
require 'rubygems/deprecate'
require 'rubygems/basic_specification'
requ... | 26.344791 | 131 | 0.636061 |
ede3382868ac0e5c64e84096a312ff8fadf7f04c | 156 | class UserChannel < ApplicationCable::Channel
def subscribed
stream_for current_user.id
# or
# stream_from "room_#{params[:room]}"
end
end
| 17.333333 | 45 | 0.705128 |
ff506699cc64ae88ca7fad54313dedbd26af193f | 34,589 | # frozen_string_literal: true
require 'packetfu'
require 'packetfu/protos/arp'
require 'packetfu/protos/eth'
require 'packetfu/protos/hsrp'
require 'packetfu/protos/icmp'
require 'packetfu/protos/ip'
require 'packetfu/protos/ipv6'
require 'packetfu/protos/lldp'
require 'packetfu/protos/tcp'
require 'packetfu/protos/ud... | 27.19261 | 170 | 0.539969 |
9142a0875c21eccb6932c0875da90860b3b893c3 | 402 | class FeatureFlagsController < ApiJsonController
skip_authorization_check only: :index
# GET /feature_flags
def index
render json: FeatureFlagService.all
end
# PUT /feature_flags/:flag
def update_flag
authorize! :update, :feature_flags
state = params.require(:feature_flag).require(:state)
... | 18.272727 | 60 | 0.743781 |
1ce3f44f4d2b0079fcd6d515343d9f407436730e | 4,968 | require 'matrix'
require_relative 'size_one'
require_relative 'size_zero'
module Geometry
=begin
An object representing the size of something.
Supports all of the familiar {Vector} methods as well as a few convenience
methods (width, height and depth).
== Usage
=== Constructor
size = Geometry::Size[x,y,z]
=... | 28.067797 | 109 | 0.597222 |
38db19630f8f22c6a047f3ec401adf76ff5cd209 | 152 | json.array!(@categoria) do |categorium|
json.extract! categorium, :id, :codigo, :descripcion
json.url categorium_url(categorium, format: :json)
end
| 30.4 | 54 | 0.75 |
62788821f6e75069b302a8af2eae23bf2930294c | 18,521 | # Something about this spec can cause havoc on specs following.
# somehow in the following specs AR objects are getting created in two different classes
# so when you compare for example User.first.todos.first == Todos.first they are NOT equal huh!
# I suspect that its to with the fact that we remove and reload the cl... | 39.322718 | 127 | 0.665623 |
262f687fd453220ec8e13f29a930dfe76a753cce | 3,494 | # frozen_string_literal: true
module Solargraph
module CoreFills
Override = Pin::Reference::Override
KEYWORDS = [
'__ENCODING__', '__LINE__', '__FILE__', 'BEGIN', 'END', 'alias', 'and',
'begin', 'break', 'case', 'class', 'def', 'defined?', 'do', 'else',
'elsif', 'end', 'ensure', 'false', '... | 30.649123 | 79 | 0.634516 |
33ee20ee54cb7f91a6d63d1911d6cdcb64aad0a9 | 1,533 | class Helmfile < Formula
desc "Deploy Kubernetes Helm Charts"
homepage "https://github.com/roboll/helmfile"
url "https://github.com/roboll/helmfile/archive/v0.81.0.tar.gz"
sha256 "6aba51fed66930fe7445570116daa9cdd7fb3a0fa73b4758f490efc6561e8e07"
bottle do
cellar :any_skip_relocation
sha256 "c07835bf5... | 34.840909 | 93 | 0.717547 |
e8a46db9c44fde487484895071cc9f013d994b0f | 148 | object @user => nil
node(:user) { partial 'users/show', object: @user } if @user
node(:token) { partial 'tokens/show', object: @token } if @token
| 29.6 | 64 | 0.655405 |
918c1f80f1cfec1067aa9a6e14a6629cd3babee0 | 202 | class CreateTickets < ActiveRecord::Migration
def change
create_table :tickets do |t|
t.belongs_to :event
t.integer :total
t.decimal :price
t.timestamps
end
end
end
| 16.833333 | 45 | 0.653465 |
1d3fb2c222f336413bfe2ea2c219876f713156ee | 30 | package 'the_silver_searcher'
| 15 | 29 | 0.866667 |
395fc8c0e99697fa4a1b71821266372fcaeed218 | 4,003 | module RewardsDoc
extend Apipie::DSL::Concern
extend BeachApiCore::Concerns::V1::ApipieResponseConcern
api :POST, '/rewards', 'Create new reward'
header 'Authorization', 'Bearer access_token', required: true
param :reward, Hash, required: true do
param :achievement_id, Integer, required: true
par... | 26.865772 | 114 | 0.566575 |
aca7c8c4a89f21b20d3f6fd71e56db1f052cee85 | 383 | # Neil created this, designed around http://stackoverflow.com/questions/10088619/how-to-clear-rails-sessions-table
# hint: config/initializers/devise.rb sets "remember_for"
namespace :sessions do
desc 'Clear expired sessions from the database'
task cleanup: :environment do
ActiveRecord::SessionStore::Session.de... | 47.875 | 114 | 0.78329 |
3366b6996b431f9ed9ac01395c85fff7351b9c18 | 3,070 | module Salesfly
class MailAPI
SCHEMA = {
"type" => "object",
"properties" => {
"date" => {
"type" => "string",
"format" => "date-time"
},
"from" => {
"type" => "string",
"maxLength" => 50
},
"from_name" => {
"ty... | 23.79845 | 76 | 0.382736 |
edd9b5ae7d029bcd3820429f5037df29a7a9d0dc | 18,747 | require 'spec_helper'
describe Bosh::AwsCloud::Cloud do
before { @tmp_dir = Dir.mktmpdir }
after { FileUtils.rm_rf(@tmp_dir) }
describe 'EBS-volume based flow' do
let(:creator) { double(Bosh::AwsCloud::StemcellCreator) }
let(:volume_manager) { instance_double(Bosh::AwsCloud::VolumeManager) }
let(:az... | 40.577922 | 111 | 0.579879 |
33289f79e0069312caec44d636909806ca0d952b | 837 | module Intrigue
module Ident
module Check
class DanneoCMS < Intrigue::Ident::Check::Base
def generate_checks(url)
[
{
:type => "fingerprint",
:category => "application",
:tags => ["CMS"],
:vendor => "Danneo",
:product => "Danneo",
:references => ["http://dann... | 25.363636 | 97 | 0.535245 |
614d430648dd1da317474245db31c72c361c3f55 | 406 | require 'java'
module RedStorm
module Loggable
def self.included(clazz)
clazz.send(:extend, ClassMethods)
clazz.send(:include, InstanceMethods)
end
module ClassMethods
def log
@log ||= Java::OrgSlf4j::LoggerFactory.get_logger(self.name.gsub(/::/, '.'))
end
end
mo... | 17.652174 | 84 | 0.618227 |
b97577a5b24fa9d1171ff782a53aac1ebe229ff0 | 644 | # Copyright (c) 2021 Target Brands, Inc. All rights reserved.
#
# Use of this source code is governed by the LICENSE file in this repository.
require 'formula'
class VelaAT03 < Formula
# repository information
head "https://github.com/go-vela/cli.git"
homepage 'https://github.com/go-vela/cli'
# utility infor... | 23.851852 | 77 | 0.729814 |
267828645b9539d6f480837f10d45e1af80f5ba2 | 4,469 | # == Schema Information
#
# Table name: dogs
#
# id :integer not null, primary key
# name :string(255)
# created_at :datetime
# updated_at :datetime
# tracking_id :integer
# primary_breed_id :integer
# secondary_breed_i... | 34.114504 | 97 | 0.597225 |
e938da7742c7e8ccbc76dc08169fa1e46be14162 | 12,303 | # The first thing you need to configure is which modules you need in your app.
# The default is nothing which will include only core features (password encryption, login/logout).
# Available submodules are: :user_activation, :http_basic_auth, :remember_me,
# :reset_password, :session_timeout, :brute_force_protection, :... | 28.025057 | 168 | 0.682842 |
39370559f952a62624b94cf87bb1b54b4cf69627 | 985 | 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(:default, Rails.env)
module NightOwl
class Application < Rails::Application
# Settings in config/environments/* tak... | 41.041667 | 99 | 0.722843 |
79c8d79be35d663df9242900b5c3c37e80a28935 | 186 | project 'pe-bolt-server-runtime-2019.0.x' do |proj|
proj.setting(:pe_version, '2019.0')
instance_eval File.read(File.join(File.dirname(__FILE__), '_shared-pe-bolt-server.rb'))
end
| 26.571429 | 89 | 0.731183 |
87e2c1c8f5c42eb217e9740f70f75378ea08356d | 25,012 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::SQL::Mgmt::V2018_06_01_preview
#
# The Azure SQL Database management API provides a RESTful set of web APIs
# that interact with Azure S... | 45.066667 | 203 | 0.7083 |
d53fd106b974d868e579d624f96c8656134b4846 | 598 | Pod::Spec.new do |spec|
spec.name = 'SimplogBase'
spec.version = '0.1.0'
spec.license = { :type => 'MIT' }
spec.homepage = 'https://github.com/nholloh/Simplog'
spec.authors = { 'Niklas Holloh' => 'github@niklasholloh.de' }
spec.summary = 'A simplistic, yet extensi... | 46 | 94 | 0.571906 |
e2950c462dc7e99038802f99482a4b5fa4e8540a | 60 | module EasyMailPreview
module ApplicationHelper
end
end
| 12 | 26 | 0.833333 |
ac58b6eb7541ae7dd0644d183276a8f36dbe7aff | 1,176 | class TeamsController < ApplicationController
before_action :authenticate_user!
before_action :authorize!, except: [:new, :create]
def show
if project = @team.projects.first
redirect_to team_project_path(@team, project)
end
end
def new
@team = current_user.teams.build if user_signed_in?
... | 21 | 77 | 0.687925 |
38566108f3b9216615ce46d2c301f1d4202e9d0e | 1,080 | class Canu < Formula
desc "Single molecule sequence assembler"
homepage "http://canu.readthedocs.org/en/latest/"
url "https://github.com/marbl/canu/archive/v1.3.tar.gz"
sha256 "7a85e4999baf75553f738b9fb263c17772d7630368d3b7321b8d90f3dc584457"
head "https://github.com/marbl/canu.git"
# doi "10.1038/nbt.3238"... | 32.727273 | 94 | 0.743519 |
339ad5e8bc3ba4f6b92910700c564fe5bd570e88 | 775 | class Geoserver < Formula
desc "Java server to share and edit geospatial data"
homepage "http://geoserver.org/"
url "https://downloads.sourceforge.net/project/geoserver/GeoServer/2.13.0/geoserver-2.13.0-bin.zip"
sha256 "0248645869d042f835da0c69b0554ae9379623ecaf7970cab2782cbfa03f6b76"
bottle :unneeded
def... | 25 | 101 | 0.664516 |
ffafa94612d02a4adb441439e869304aafb206ff | 1,083 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = 'CodePush'
s.version = package['version'].gsub(/v|-beta/, '')
s.summary = package['description']
s.author = package['author']
s.license = package['license']... | 38.678571 | 114 | 0.638042 |
4ad4dd6990d41dfbc441a25c03a2fd25a1d9b96f | 2,294 | # The MIT License (MIT)
# Copyright (c) 2018 Mike DeAngelo Looker Data Sciences, 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 r... | 43.283019 | 104 | 0.694856 |
0178ab9d006e96088673e90b170bb76951fbdc99 | 746 | $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require 'active_record'
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
#ActiveRecord::Base.logger = Logger.new(STDOUT)
load File.dirname(__FILE__) + '/schema.rb'
require 'dynamic_record'
require 'database_cleaner'
require 'r... | 24.064516 | 80 | 0.719839 |
e24166297180c5099289149c254b64191f3f1531 | 211 | class CreateTestResources < ActiveRecord::Migration[5.1]
def change
create_table :test_resources do |t|
t.string :name
t.integer :age
t.string :kind
t.timestamps
end
end
end
| 17.583333 | 56 | 0.654028 |
382962f92d1ab3f1d9de31a2522de11afdd2b23d | 551 | # frozen_string_literal: true
module Ez
module Status
class ApplicationCell < Cell::ViewModel
self.view_paths = ["#{Ez::Status::Engine.root}/app/cells"]
CSS_SCOPE = 'ez-status'
def div_for(item, &block)
content_tag :div, class: css_for(item), &block
end
def css_for(item)
... | 21.192308 | 69 | 0.622505 |
1a440e3ebd080af0f19fc98644d54004b2ae2bad | 735 | Pod::Spec.new do |s|
s.name = "PagerTabStripView"
s.version = "3.1.1"
s.summary = "PagerTabStripView allows navigating through pages using a custom navigation bar in SwiftUI."
s.homepage = "https://github.com/xmartlabs/PagerTabStripView"
s.license = { type: 'MIT'... | 45.9375 | 116 | 0.629932 |
f7375bc59824eb33d71b49d85a2d0c9ba1d7bd18 | 150 | class AddTokenTypeToUserTokens < ActiveRecord::Migration[5.0]
def change
add_column :user_tokens, :token_type, :string, default: :web
end
end
| 25 | 64 | 0.76 |
e89963cab18439986f1517d0746ffa0174a26a32 | 99 | class Library < ApplicationRecord
belongs_to :user
has_one :podcast
has_one :music
end
| 16.5 | 33 | 0.727273 |
268aae80767eaad555cbe4cb2c150222af7516f5 | 1,455 | class Libplctag < Formula
desc "Portable and simple API for accessing AB PLC data over Ethernet"
homepage "https://github.com/libplctag/libplctag"
url "https://github.com/libplctag/libplctag/archive/v2.2.1.tar.gz"
sha256 "7fa17a9bc82548daea5bc14e6d0e2aac45e684d96f866aa83bdfa7e0285174f6"
license any_of: ["LGPL... | 33.837209 | 140 | 0.701031 |
1144c4f1a201a29475c73b893cd073b5a6fe5f04 | 213 | class SongsWorker
include Sidekiq::Worker
require 'csv'
def perform(songs_file)
CSV.foreach(song_file, headers: true) do |song|
Song.create(title: song[0], artist_name: song[1])
end
end
end | 19.363636 | 55 | 0.690141 |
260ba5d01399fe321d98541a4862735be194f2c1 | 704 | # frozen_string_literal: true
module Esse
class IndexMapping
FILENAMES = %w[mapping mappings].freeze
def initialize(body: {}, paths: [], filenames: FILENAMES)
@paths = Array(paths)
@filenames = Array(filenames)
@mappings = body
end
# This method will be overwrited when passing a b... | 18.051282 | 68 | 0.633523 |
263aa4fcf6d6b969de191bd1d3b2c4d939e7b3a1 | 2,383 | #-- encoding: UTF-8
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2021 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProj... | 30.164557 | 108 | 0.681914 |
1a0db8eaa593087278f01f31c0265e7714ff730f | 17,216 | # HTTPClient - HTTP client library.
# Copyright (C) 2000-2015 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
#
# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
# redistribute it and/or modify it under the same terms of Ruby's license;
# either the dual license version in 2003, or any later version.... | 28.934454 | 151 | 0.619308 |
3960f5744e76e70c27d0a2267f77fc1422ef87f5 | 30,040 | # Copyright 2020 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, ... | 39.526316 | 323 | 0.668609 |
015484385942bca916fc9e9e1a43a08e956d7b45 | 365 | after "development:sites" do
site1 = Site.find_by!(name: "site1")
site1.participants.create!(
name: "name11",
summary: "summary11",
description: <<~EOS
# Hello
description11
EOS
)
site1.participants.create!(
name: "name12",
summary: "summary12",
description: <<~EOS
... | 17.380952 | 38 | 0.6 |
21b9dbb059024562d35ddb6b855922d9880e24b7 | 559 | class BrewCask < Formula
homepage "https://github.com/caskroom/homebrew-cask/"
url "https://github.com/caskroom/homebrew-cask.git", tag: "v0.60.1"
depends_on ruby: "2.0"
UNINSTALL_MSG = <<-EOS.undent
You must uninstall this formula. It is no longer needed to stay up to date,
as Homebrew now takes care... | 22.36 | 79 | 0.690519 |
6adc9182fa8ebe37c62addb044524a702251fd99 | 524 | require 'spec_helper'
describe UserUploader do
include CarrierWave::Test::Matchers
let(:user){ FactoryGirl.create(:user) }
before do
UserUploader.enable_processing = true
@uploader = UserUploader.new(user, :uploaded_image)
@uploader.store!(File.open("#{Rails.root}/spec/fixtures/image.png"))
end
... | 21.833333 | 72 | 0.715649 |
ed15a8083c851636ef7460289ccb739093871d5c | 1,424 | require 'rails_helper'
RSpec.feature 'Public Recipes #Index', type: :feature do
background do
visit new_user_session_path
@first_user = User.create(name: 'Mark', email: 'mark@gmail.com', password: '0123456', confirmed_at: Time.now)
@second_user = User.create(name: 'Griifin', email: 'punk@gmail.com', pass... | 35.6 | 117 | 0.654494 |
38b3057db9b57ed826f7f82722ced978bffaf8a7 | 219 | class CreateAttachments < ActiveRecord::Migration[4.2]
def change
create_table :attachments do |t|
t.references :advent_calendar_item, index: true
t.string :image
t.timestamps
end
end
end
| 19.909091 | 54 | 0.694064 |
1ac4f1ba01bd6d47ec90123b234e0fe3282b0ba5 | 383 | module LearningSystem
module UserSamples
def good_users
[
User.new("tom", "b4dp4ss"),
User.new('Tomm', 'NotS3cure'),
]
end
def bad_users
[
User.new('Pete', ''),
User.new('', ''),
User.new('', 'b43'),
User.new('Timothy', '... | 19.15 | 65 | 0.480418 |
b95cc2f694eb0a163086f7d40e8c0f2b8dd3f2bd | 189 | class UpdateCustomerItem < ActiveRecord::Migration[5.2]
def change
add_column :customer_items, :room_number, :string
add_column :customer_items, :quantity_bed, :decimal
end
end
| 27 | 55 | 0.767196 |
621cd772b042840a56c4baf6d3971418cd3634bb | 24,091 | # This tests the Hyrax::WorksControllerBehavior module
# which is included into .internal_test_app/app/controllers/hyrax/generic_works_controller.rb
RSpec.describe Hyrax::GenericWorksController do
routes { Rails.application.routes }
let(:main_app) { Rails.application.routes.url_helpers }
let(:hyrax) { Hyrax::Engi... | 38.669342 | 134 | 0.631481 |
184f89200ab89a6beae34f232304b2cd19c096a1 | 2,459 | # frozen_string_literal: true
module API
class ProjectExport < ::API::Base
helpers Helpers::RateLimiter
before do
not_found! unless Gitlab::CurrentSettings.project_export_enabled?
authorize_admin_project
end
params do
requires :id, type: String, desc: 'The ID of a project'
end... | 33.22973 | 113 | 0.632778 |
26856748273ec5c7047ebf5086e9da106fe0b74b | 2,103 | require_relative "spec_helper"
require 'pry'
describe "User" do
describe 'User basics' do
it "cannot be saved without password" do
@user = User.new
@user.username = "Bob"
expect(@user.save).to eq(false)
end
it "has many tools" do
@user = User.create(username: "John", password: "abc123")
@drill = Tool.... | 24.453488 | 95 | 0.675226 |
397615e4f7e01ac9c9e577d7700294b083d66258 | 1,526 | class UserController < ApplicationController
before_filter :require_user, :only => [:edit, :update, :destroy]
def index
end
def dashboard
@user = User.find(current_user)
end
def favorites
@user = User.find(current_user)
end
def friends
@user = User.find(current_user)
end
def managegroups
@user ... | 19.075 | 82 | 0.679554 |
6a81485b8dee3cb5c9d0ff070fad2a7ebb91d887 | 2,431 | class GitFtp < Formula
desc "Git-powered FTP client"
homepage "https://git-ftp.github.io/"
url "https://github.com/git-ftp/git-ftp/archive/1.6.0.tar.gz"
sha256 "088b58d66c420e5eddc51327caec8dcbe8bddae557c308aa739231ed0490db01"
license "GPL-3.0"
head "https://github.com/git-ftp/git-ftp.git", branch: "develop... | 41.913793 | 122 | 0.599753 |
b9bcb9999080a08debec776480dab760b07a76f9 | 1,899 | class Questdb < Formula
desc "Time Series Database"
homepage "https://www.questdb.org"
url "https://www.questdb.org/download/questdb-1.0.4-bin.tar.gz"
sha256 "a8d907d88c5bf67aeb465540c7e16ad45eccd13d152b34cdcf4e5056ad908739"
bottle :unneeded
depends_on :java => "1.7+"
def install
rm_rf "questdb.exe... | 26.375 | 106 | 0.577146 |
081ecf1684ca49d6211ac1b0cdbe1c4bee1a870b | 356 | User.create(
email: "example@example.com",
password: 'password',
password_confirmation: 'password',
first_name: 'Developer',
last_name: "Admin",
organization: "My Organization",
city: "My City",
state: "My State",
zip: "12345",
role: :admin
)
puts "Default admin user created with email 'example@exa... | 23.733333 | 91 | 0.69382 |
ab9bc69bb1bda38a79709e85720ab239a98b58c3 | 1,443 | class Document < ApplicationRecord
include Seek::Rdf::RdfGeneration
include Seek::BioSchema::Support
acts_as_asset
validates :projects, presence: true, projects: { self: true }
acts_as_doi_parent(child_accessor: :versions)
#don't add a dependent=>:destroy, as the content_blob needs to remain to detect ... | 26.722222 | 144 | 0.712405 |
339dd04d8f3a37e717d0c219b92374b5f1094ce0 | 26 | module StalkeesHelper
end
| 8.666667 | 21 | 0.884615 |
629ccecc7ca20473fd88206bd57aee21f43aefae | 2,280 | module Roar
module JSON
module JSONAPI
# Instance method API for JSON API Documents representing a single Resource
#
# @api private
module SingleResource
# @see Document#to_hash
def to_hash(options = {})
document = super(Options::Include.(options, mappings))
... | 32.571429 | 98 | 0.594298 |
01a95c410b04cf10e039d28ae9eca29e8a72aefb | 2,982 | # frozen_string_literal: true
RSpec.describe RuboCop::Cop::Style::SingleLineBlockParams, :config do
let(:cop_config) do
{ 'Methods' =>
[{ 'reduce' => %w[a e] },
{ 'test' => %w[x y] }] }
end
it 'finds wrong argument names in calls with different syntax' do
expect_offense(<<~RUBY)
def m... | 28.132075 | 88 | 0.463447 |
e8e0c40273fea405faec3ae8bf16418487498258 | 1,087 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'local-subdomain/version'
Gem::Specification.new do |spec|
spec.name = 'local-subdomain'
spec.version = LocalSubdomain::VERSION
spec.authors = ['Manuel van Rijn']
spec... | 43.48 | 190 | 0.672493 |
1a4057bbccb0977d6d412e270dc6c11ec8a1a854 | 2,121 | require File.expand_path('../../../spec_helper', __FILE__)
module Pod
describe Command::Package do
after do
Dir.glob("Pods").each { |dir| Pathname.new(dir).rmtree }
end
it "uses additional spec repos passed on the command line" do
Pod::Config.instance.sources_manager.stubs(:search).returns(n... | 35.949153 | 105 | 0.690712 |
edfc50660dc90a37e1213b6fcb29dfa719daa712 | 417 | root = "/home/deploy/apps/octomaps/current"
working_directory root
pid"#{root}/tmp/pids/unicorn.pid"
stderr_path"#{root}/log/unicorn.log"
stdout_path"#{root}/log/unicorn.log"
listen"/tmp/unicorn.octomaps.sock"
worker_processes 2
timeout 75
# Force the bundler gemfile environment variable to
# reference the capistrano... | 26.0625 | 52 | 0.767386 |
4aec6a86df19f5c77e43a874b46a00971c5df732 | 3,622 | require "grit"
require 'cgi'
require "securerandom"
module Flowdock
class Git
class Commit
def initialize(external_thread_id, thread, tags, commit)
@commit = commit
@external_thread_id = external_thread_id
@thread = thread
@tags = tags
end
def to_hash
ha... | 23.986755 | 111 | 0.507454 |
2842a459a40150b622f0ae04b14d4d1d3264ec86 | 1,152 | module SessionsHelper
def log_in(user)
session[:user_id] = user.id
cookies.permanent.signed[:user_id] = user.id
end
def current_user
if (user_id = session[:user_id])
@current_user ||= User.find_by(id: user_id)
elsif (user_id = cookies.signed[:user_id])
user = User.find_by(id: user_id)... | 21.333333 | 67 | 0.682292 |
edc8fb7df54e1df6e8c52a037a095bf4458fe422 | 69 | # frozen_string_literal: true
module Falcon
VERSION = '1.0.0'
end
| 11.5 | 29 | 0.724638 |
213c2605ba762f461b50d0364c33e3bd1a0e9b17 | 1,265 | # 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... | 34.189189 | 86 | 0.742292 |
f7a7aa7b82029475b60213af4d43525c79019ae9 | 1,659 | class Cabocha < Formula
desc "Yet Another Japanese Dependency Structure Analyzer"
homepage "https://taku910.github.io/cabocha/"
# Files are listed in https://drive.google.com/drive/folders/0B4y35FiV1wh7cGRCUUJHVTNJRnM
url "https://dl.bintray.com/homebrew/mirror/cabocha-0.69.tar.bz2"
mirror "https://mirrorserv... | 36.065217 | 116 | 0.75648 |
d5266af89b51fd2437a6bdd23fcdfa05b04fe91f | 3,758 | describe GraylogAPI::System::Inputs, vcr: true do
include_context 'graylogapi'
context 'create input' do
subject(:response) do
options = { title: 'Test_create_input',
type: 'org.graylog.plugins.beats.BeatsInput',
global: true,
configuration: { bind_ad... | 27.632353 | 66 | 0.562001 |
b9b5a04755aff2700710149c050044e03a71d41a | 808 | class Prime::Eth2Staking::BaseController < Prime::ApplicationController
before_action :set_metadata
before_action :require_eth_staking
private
def set_metadata
@page_title = 'Ethereum Staking Management'
end
def anjin_client
Prime::Anjin::Client.current
end
def require_eth_staking
# Prim... | 27.862069 | 102 | 0.758663 |
e99ef1984288b11703a390d89bc2f91ead43b089 | 2,893 | require 'action_view/helpers/javascript_helper'
ActionView::Helpers::JavaScriptHelper.module_eval do
include ActionView::Helpers::PrototypeHelper
# Returns a button with the given +name+ text that'll trigger a JavaScript +function+ using the
# onclick handler.
#
# The first argument +name+ is used as the bu... | 43.833333 | 149 | 0.660214 |
e99e67c8c02ec7ab7f3bbc5ed03a13f92a805020 | 287 | # frozen_string_literal: true
require 'rails_helper'
require 'spree/testing_support/factories/store_factory'
RSpec.describe 'store factory' do
let(:factory_class) { Spree::Store }
describe 'store' do
let(:factory) { :store }
it_behaves_like 'a working factory'
end
end
| 19.133333 | 55 | 0.738676 |
28d1a88ffcf6438bfaa70f71ad7a16ecb06576e8 | 4,819 | require "cheffish"
require "chef/version"
require "chef_zero/server"
require "chef/chef_fs/chef_fs_data_store"
require "chef/chef_fs/config"
require "cheffish/chef_run_data"
require "cheffish/chef_run_listener"
require "chef/client"
require "chef/config"
require "chef_zero/version"
require "cheffish/merged_config"
req... | 33.699301 | 136 | 0.687695 |
26aefa8864474dd8728bc4c03b6bb0604d9570ec | 37 | node.default['nginx']['port'] = 8080
| 18.5 | 36 | 0.648649 |
26353e32fabcd6594255a8f74f59e9e8236d3cf8 | 3,294 | # frozen_string_literal: true
require "cases/helper"
require "active_support/core_ext/numeric/time"
require "models/topic"
require "models/person"
class ExclusionValidationTest < ActiveModel::TestCase
def teardown
Topic.clear_validators!
end
def test_validates_exclusion_of
Topic.validates_exclusion_of... | 27.22314 | 137 | 0.697936 |
080656aff8c1dc3787e964e26bd023353dffff74 | 588 | require 'facets/matchdata/matchset'
require 'test/unit'
class Test_MatchData_Matchset < Test::Unit::TestCase
def test_matchtree_01
md = /(bb)(cc(dd))(ee)/.match "XXaabbccddeeffXX"
assert_equal( [["bb"], ["cc", ["dd"]], ["ee"]] , md.matchtree )
end
def test_matchtree_02
md = /(bb)c(c(dd))(ee)/.match... | 26.727273 | 84 | 0.595238 |
0874cd902ffd96a3b4344987c6e28d8a9e9e0691 | 1,584 | # Copyright (c) 2018 Corey Bonnell
#
# 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, merge, publish, dist... | 42.810811 | 94 | 0.702652 |
ac2869f23ab7c48ced98971343dcb699f94bd4a9 | 52 | class Offdays < ActiveRecord::Base
unloadable
end
| 13 | 34 | 0.788462 |
e2e462d75f701c232ad15c06e6c80e95f0587b24 | 102 | require 'rspec/rails'
RSpec.configure do |config|
config.before do
Rails.cache.clear
end
end
| 12.75 | 27 | 0.72549 |
1ddee55015d39f96a3ef2cdef4f94fdacf504d61 | 863 | # frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.1'
# Activeadmin assets
Rails.application.config.assets.precompile += %w(active_admin/active_admin_global... | 37.521739 | 103 | 0.791425 |
3907dd7d607399fccafb11cea52679c3c99c085f | 363 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Types::Dast::SiteProfileAuthInputType do
specify { expect(described_class.graphql_name).to eq('DastSiteProfileAuthInput') }
it 'has the correct arguments' do
expect(described_class.arguments.keys).to match_array(%w[enabled url usernameField p... | 30.25 | 120 | 0.801653 |
1af8d7458d935dc4aaad85b75604d6dae4fea29d | 2,411 | ##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'msf/core'
require 'rex/proto/ipmi'
class Metasploit3 < Msf::Auxiliary
... | 28.702381 | 121 | 0.624222 |
79bfbce5aaa73b6243af54c9eb77770e8cd32284 | 4,931 | require 'spec_helper'
RSpec.describe MeasurePresenter do
describe '#geo_class' do
context 'when geographical area is a country group' do
subject { MeasurePresenter.new(measure) }
let(:children_ga) { [attributes_for(:geographical_area).stringify_keys, attributes_for(:geographical_area).stringif... | 48.821782 | 176 | 0.743054 |
91278f9a2ab02a1add67d296ad9fd045683b386c | 685 | # == Schema Information
#
# Table name: services
#
# id :integer not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# type :string not null
# uuid :string not null
# name :string not null
# health ... | 20.147059 | 53 | 0.578102 |
917dc2e20a33c23200ab1562402e782bbcf08009 | 868 | require 'equalizer'
require 'adamantium'
require_relative 'iban/extended_data'
require_relative 'iban/country_codes'
require_relative 'iban/validator'
class Ibanizator
class Iban
attr_reader :iban_string
alias_method :to_s, :iban_string
include Equalizer.new(:iban_string)
include Adamantium
de... | 18.869565 | 55 | 0.68318 |
79f329a0d368a0174a3e736cf953d9981195c0b7 | 412 | # frozen_string_literal: true
require "rails_helper"
RSpec.describe "clients/new", type: :view do
before(:each) do
assign(:client, build(:client))
end
it "renders new client form" do
render
assert_select "form[action=?][method=?]", clients_path, "post" do
assert_select "input[name=?]", "clie... | 20.6 | 69 | 0.669903 |
ff5c5145fde076dedcc7899fb8313e952e6c7cfe | 166 | class AddColumnsToItems < ActiveRecord::Migration[5.1]
def change
add_column :items, :image_url, :string
add_column :items, :staff_message, :text
end
end
| 23.714286 | 54 | 0.73494 |
bbeda3d6cc413f4380eb3ec8b350d1a583b9fa4f | 2,127 | require "myfinance/request"
require "myfinance/response"
module Myfinance
class Client
attr_reader :http
def initialize(token, account_id = nil)
@http = Http.new(token, account_id)
end
def authenticated?
http.get("/accounts") { |response| response.code == 200 }
rescue RequestError =... | 20.451923 | 63 | 0.67842 |
bb2fecf25d18f989d135ed9334f40292c8dbca35 | 3,594 | module Helpers
TEST_DIR = Pathname.new(__FILE__).parent + '..'
TYPES = {
:ec2 => :ec2
}
def self.included(obj)
obj.instance_eval { attr_accessor :valid_params }
end
# self is available at the describe level
def restricted_params(key, params, opts={}, invalid='invalid')
params.each do ... | 31.80531 | 84 | 0.686978 |
1aba3086b424f76f3a7271010ffd8471cc30ed14 | 4,407 | require 'spec_helper'
# Tests use of the Generator when used like so:
#
# @gen = IniParse::Generator.new
# @gen.comment('My very own comment')
# @gen.section('my_section')
# @gen.option('my_option', 'my value')
# ...
#
# Or
#
# IniParse::Generator.gen do |doc|
# doc.comment('My very own comment')
# ... | 32.167883 | 85 | 0.535058 |
e27adb9e37c793e5b7234547eb0a83ff46ac0e82 | 285 | # frozen_string_literal: true
module LanguageConcepts
class ConceptSerializer < ::ApplicationSerializer
type 'concepts'
attributes(
:name,
:type
)
#has_one :representation do
# data do
# @object.representation
# end
#end
end
end
| 15 | 51 | 0.635088 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.