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 |
|---|---|---|---|---|---|
911907cf2f779be724874e148c07040db09b4695 | 639 | describe port(9696) do
it { should be_listening }
its('processes') { should include 'python' }
end
describe service('neutron-dhcp-agent') do
it { should be_installed }
it { should be_enabled }
it { should be_running }
end
describe service('neutron-l3-agent') do
it { should be_installed }
it { should be_... | 22.034483 | 55 | 0.71205 |
d5053df7afc588aace523ae6ff0fb60736ea71e5 | 320 | require 'rails_helper'
describe Doorkeeper::AuthorizedApplicationsController, type: :controller do
let(:access_token) { create :access_token }
describe '#index' do
it 'does not run the extended #authenticate_resource_owner!' do
expect do
get :index
end.not_to raise_error
end
end
end
| 22.857143 | 75 | 0.71875 |
f896d7e26fd7da3f33d679772edd0c59bac5a139 | 104 | module Podcasts
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
end
| 17.333333 | 46 | 0.769231 |
26284df65bb37147a437c0f234b7aef2d2de0e20 | 1,002 | #this class will scape using nakgeri
class PokemonGame::Scraper
def self.nokogiri
Nokogiri::HTML(open("https://en.wikipedia.org/wiki/List_of_generation_I_Pok%C3%A9mon"))
end
def self.scrape(location,get_id)
output = []
doc = nokogiri
if get_id == true
#this gets each pokemon
doc.css(location).e... | 21.319149 | 107 | 0.732535 |
39db6182db01f842ebe1897fd5f56cae9d693f85 | 1,792 | # Copyright © 2011 MUSC Foundation for Research Development
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of c... | 54.30303 | 145 | 0.792411 |
ff47fa9745aaa815b4ecbe1e367eccc78c355cac | 2,630 | require 'spec_helper'
module Family
def self.const_missing(_name)
raise NameError, 'original message'
end
end
describe Fabrication::Support do
describe '.class_for' do
context 'with a class that exists' do
it 'returns the class for a class' do
expect(described_class.class_for(Object)).to e... | 30.581395 | 86 | 0.703802 |
1d333ee6e5a6f2e49a21da1e19bdf99d97f40817 | 878 | require 'spec_helper'
require 'rollbar/truncation'
describe Rollbar::Truncation do
describe '.truncate' do
let(:payload) { {} }
context 'if truncation is not needed' do
it 'only calls RawStrategy is truncation is not needed' do
allow(described_class).to receive(:truncate?).and_return(false)
... | 31.357143 | 83 | 0.694761 |
1d919808fe3c249a34533b7a8154ea06ede979c1 | 539 | require File.join(File.dirname(__FILE__), 'abstract-php-extension')
class Php53Yar < AbstractPhp53Extension
init
homepage 'http://pecl.php.net/package/yar'
url 'http://pecl.php.net/get/yar-1.2.2.tgz'
sha1 '882937c7892a4252ec03714f783317c4a1df66f3'
def install
Dir.chdir "yar-#{version}"
ENV.universa... | 25.666667 | 67 | 0.717996 |
bb9159fe21407f5d1ea43da8c4253e2d57327352 | 3,447 | # -*- coding:binary -*-
require 'spec_helper'
require 'rex/exploitation/powershell'
describe Rex::Exploitation::Powershell::Function do
let(:function_name) do
Rex::Text.rand_text_alpha(15)
end
let(:example_function_without_params) do
"""
{
ls HKLM:\SAM\SAM\Domains\Account\Users |
where {$_... | 40.081395 | 159 | 0.67682 |
62199dbcd6da9064e5c36c2c42b26aa00428957c | 290 | class LeaderboardController < ApplicationController
include DateRange
before_action :set_leaderboard, only: [:index]
def index
render json: @users
end
private
def set_leaderboard
@users = User.all.with_total_flights(date_range).order('total_flights DESC')
end
end
| 18.125 | 80 | 0.755172 |
1166c4738ec8a4774879c69ec338a04e975c1faa | 149 | require File.expand_path('../../../../spec_helper', __FILE__)
describe "Resolv::IPv4#eql?" do
it "needs to be reviewed for spec completeness"
end
| 24.833333 | 61 | 0.704698 |
01b070f0a58d6003fa40d45a74409bc69bbc7d89 | 693 | # == Schema Information
#
# Table name: tracks
#
# id :integer not null, primary key
# title :string(255) not null
# artist_id :integer
# album_id :integer
# npr_attributes :hstore
# external_ids :string(255)
# spotify_id :string(255)
# created_at :datetim... | 25.666667 | 92 | 0.621934 |
e219e8b7b96ebbe2a2b14a0227936f31c9a9d61b | 4,911 | require 'spec_helper'
require 'goliath/runner'
describe Goliath::Runner do
before(:each) do
@r = Goliath::Runner.new([], nil)
allow(@r).to receive(:store_pid)
@log_mock = double('logger').as_null_object
allow(@r).to receive(:setup_logger).and_return(@log_mock)
end
describe 'server execution' do... | 27.589888 | 72 | 0.593973 |
873f440164ecc4bb5cc6b3ebef007997424f3781 | 186 | cask :v1 => 'renamer' do
version :latest
sha256 :no_check
url 'http://creativebe.com/download/renamer'
homepage 'http://renamer.com'
license :unknown
app 'Renamer.app'
end
| 16.909091 | 46 | 0.693548 |
212ee2cb23fb346f56930c66712a7da326209b60 | 353 | class SetServiceDisplayAndRetiredToFalse < ActiveRecord::Migration[5.0]
class Service < ActiveRecord::Base
self.inheritance_column = :_type_disabled # disable STI
end
def up
Service.where(:retired => nil).update_all(:retired => false)
Service.where(:display => nil).update_all(:display => false)
end... | 23.533333 | 71 | 0.711048 |
03d7146eb65eaf51aa7888e786943addc94ab1a1 | 72 | class ExperimentEvent < ActiveRecord::Base
belongs_to :experiment
end
| 18 | 42 | 0.819444 |
1a028913e934820fc8b365d91affc970335ec3a6 | 2,720 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Security::SecurityOrchestrationPolicies::ProcessScanResultPolicyService do
describe '#execute' do
let_it_be(:policy_configuration) { create(:security_orchestration_policy_configuration) }
let(:approver) { create(:user) }
let(:policy) { ... | 39.42029 | 118 | 0.722794 |
b962a2ef552214462757fbabd640a0c24b13d414 | 135 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :inst_chapter_module do
end
end
| 19.285714 | 68 | 0.8 |
033916fa7b399ebb89d784b8bffc852a9b2a5317 | 436 | require 'tempfile'
require 'fileutils'
module Helpers
def wordlist_tempfile(existing_file=nil)
path = Tempfile.new('wordlist').path
::FileUtils.cp(existing_file,path) if existing_file
return path
end
def should_contain_words(path,expected)
words = []
::File.open(path) do |file|
file.... | 18.166667 | 55 | 0.672018 |
acf1acc207898b68b9185f464ab792f8e2da28ea | 3,918 | class DecksController < ApplicationController
get '/decks' do
if logged_in?
10.times {u = current_user}
erb :'/decks/decks'
else
flash[:error] = "You must log in to view your decks."
redirect '/login'
end
end
get '/decks/new' do
if logged_in?
erb :'/decks/new_deck'
... | 25.441558 | 138 | 0.572996 |
18f215eca44af0a5fd9df2ef63687dcf36c7b24a | 4,153 | module Fog
module AWS
class AutoScaling
class Real
require 'fog/aws/parsers/auto_scaling/describe_auto_scaling_instances'
# Returns a description of each Auto Scaling instance in the
# instance_ids list. If a list is not provided, the service returns the
# full details of al... | 46.144444 | 113 | 0.576692 |
f7a289c5fd0ff18a565659156927c458c5704755 | 585 | class BackfillScripts2 < ActiveRecord::Migration
def up
puts "Comments Valorations.."
cvts = CommentsValorationsType.find_positive
User.find_each(
:conditions => "id IN (
SELECT DISTINCT(user_id)
FROM comments
WHERE id IN (
SELECT distinct(comment_... | 26.590909 | 75 | 0.618803 |
6a819976d68556f20a5c573ee74e32db88e5af17 | 135 | class QuestionPolicy < ApplicationPolicy
def new?
record.survey.creator == user && record.survey.published? == false
end
end
| 16.875 | 70 | 0.718519 |
281a23d7c0c25a2ae7689652d74eabd3ecc3d31b | 93 | class Tag < ApplicationRecord
has_and_belongs_to_many :poems, join_table: 'poems_tags'
end
| 23.25 | 58 | 0.817204 |
087050efacdb62541bdfb0bcc49de8e08012bef9 | 3,539 | require "rails/generators/named_base"
module Administrate
module Generators
class DashboardGenerator < Rails::Generators::NamedBase
ATTRIBUTE_TYPE_MAPPING = {
boolean: "Field::Boolean",
date: "Field::DateTime",
datetime: "Field::DateTime",
enum: "Field::String",
floa... | 26.810606 | 77 | 0.614298 |
bf8db223ffdc564036e1926515c63c2eb66b0477 | 536 | require 'spec_helper'
describe Spree::State, :type => :model do
it "can find a state by name or abbr" do
state = create(:state, :name => "California", :abbr => "CA")
expect(Spree::State.find_all_by_name_or_abbr("California")).to include(state)
expect(Spree::State.find_all_by_name_or_abbr("CA")).to includ... | 35.733333 | 112 | 0.697761 |
79725be4cc09693deba8cf3c6b90bca50005d217 | 407 | class CreateFriendlyUrls < ActiveRecord::Migration
def change
create_table :friendly_urls do |t|
t.string :path
t.string :slug
t.string :controller
t.string :action
t.string :defaults
t.references :article, index: true
t.timestamps null: false
end
add_foreign_key... | 23.941176 | 50 | 0.678133 |
013c4485d75ff6c347b5f46f64227f4f5bfc8197 | 608 | require File.dirname(__FILE__) + '/spec_helper'
describe "Chord addition" do
describe "adding C and G" do
before(:each) do
@c = Chord.new(:c, [0,4,7])
@g = Chord.new(:g, [0,4,7])
end
it "yields CM9" do
@cM9 = Chord.new(:c, [0,4,7,11,14])
result = @c + @g
result.should =... | 19.612903 | 47 | 0.503289 |
e9c21fbe3962ffd39c4abf53568aef25a32ceb65 | 130 | # frozen_string_literal: true
json.partial! "hyrax/active_encode/encode_records/encode_record", encode_record: @encode_presenter
| 32.5 | 98 | 0.846154 |
e2468877fce57f6fe600488f770d58e3c095b427 | 798 | #
# Cookbook:: Jk_Book1
# Spec:: default
#
# Copyright:: 2020, The Authors, All Rights Reserved.
require 'spec_helper'
describe 'Jk_Book1::default' do
context 'When all attributes are default, on Ubuntu 18.04' do
# for a complete list of available platforms and versions see:
# https://github.com/chefspec/fa... | 26.6 | 66 | 0.705514 |
4a1dfe1c4a591d111275998e2dd21dc6fa9fc054 | 122 | require "mini_admin/version"
module MiniAdmin
class Error < StandardError; end
def self.greet
"Hello"
end
end
| 12.2 | 34 | 0.721311 |
61ed71767e737ce1eed0f169221794c10f794b34 | 407 | module NetcashApi
class ClientWrapper
class << self
def method_missing(end_point, params, &block)
response = NetcashApi::Client.send(self.to_s.demodulize.underscore.downcase).call(end_point, {
message: XmlKeyAdapter.convert_keys(params)
})
if block_given?
yield r... | 22.611111 | 102 | 0.624079 |
e81037f8aded8b53c530ebdff75d79504c7ab59c | 251 | # frozen_string_literal: true
# https://github.com/rack/rack/issues/1075
class RackMultipartBuffer
def initialize(app)
@app = app
end
def call(env)
env[Rack::RACK_MULTIPART_BUFFER_SIZE] = 100 * 1024 * 1024
@app.call(env)
end
end
| 17.928571 | 61 | 0.701195 |
384a6a81a6cd17e59578ef4e9960ca24045e8484 | 778 | Pod::Spec.new do |spec|
spec.name = 'RxComposableArchitectureTests'
spec.version = '2.1.1'
spec.license = 'MIT'
spec.summary = 'A Rx version of ComposableArchitecture.'
spec.homepage = 'https://github.com/jrBordet/RxComposableArchitecture.git'
spec.author = 'Jean Raphaël Bor... | 43.222222 | 119 | 0.679949 |
ff7aa0e543a03b5125e28921eaefd6a7c8266a5e | 2,100 | require_relative 'tests_for_content_sets.rb'
gem 'minitest'
require 'minitest/autorun'
require 'minitest/pride'
require 'minitest/mock'
require 'mocha/setup'
require 'commendo'
module Commendo
class RedisContentSetTest < Minitest::Test
def setup
Commendo.config do |config|
config.backend = :redis... | 36.842105 | 645 | 0.709524 |
1d17559efa6b0e01a4612ba0c092f5ec6898ca7d | 1,349 | module OnTheSpot
module Generators
class InstallGenerator < ::Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
desc "This generator installs jEditable and some glue javascript (if rails < 3.1) and installs the locale"
#def download_jeditable
# # Downloading ... | 43.516129 | 139 | 0.66642 |
037cde278db2319c82d0480b1a551de57e3c140b | 3,598 | # 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::Network::Mgmt::V2019_04_01
module Models
#
# Parameters that define the operation to create a connection monitor.
#
class Co... | 30.752137 | 77 | 0.503335 |
ab1104f0ce094d4e804bf5038f3725942d734f08 | 2,251 | class Sys::Setting < Sys::Model::Base::Setting
include Sys::Model::Base
set_config :common_ssl, :name => "共有SSL", :default => 'disabled',
options: [['使用する', 'enabled'], ['使用しない', 'disabled']],
form_type: :radio_buttons
set_config :pass_reminder_mail_sender, :name => "パスワード変更メール送信元アドレス", :default => 'nore... | 35.171875 | 99 | 0.705464 |
b90674bc267a1b96861fcb84be095b9691b16349 | 441 | # frozen_string_literal: true
module Mutations
class UpdateS3Bucket < ::Mutations::BaseMutation
argument :id, ID, required: true
argument :name, String, required: true
argument :access_key_id, String, required: true
argument :secret_access_key, String, required: true
type Types::S3BucketType
... | 25.941176 | 76 | 0.734694 |
ed5a0f24ed0679a80bbfb40f69912486bc77a984 | 1,024 | # frozen_string_literal: true
class IssuablePolicy < BasePolicy
delegate { @subject.project }
condition(:locked, scope: :subject, score: 0) { @subject.discussion_locked? }
condition(:is_project_member) { @user && @subject.project && @subject.project.team.member?(@user) }
desc "User is the assignee or author"... | 25.6 | 101 | 0.72168 |
26179ddef29db5e222942d86b8e5f85d52e983f9 | 2,661 | # frozen_string_literal: true
require 'test_helper'
class ObservationStatusTest < ActiveSupport::TestCase
setup do
@observation = observations(:observation)
end
test 'starts with a registered status' do
assert_nil @observation.value
assert_nil @observation.lab_test_value_id
assert_equal 'regist... | 25.342857 | 76 | 0.730177 |
bbd93b99d0a8a4d8a710016fee94fc275494e97b | 1,119 | module Admin
class UsersController < AdminController
def index
redirect_to admin_path(anchor: 'user_management')
end
def edit
add_breadcrumb 'Edit Users', :edit_users_path
@user = User.find(params[:id])
end
def show
@user = User.find(params[:id])
end
def update
... | 19.982143 | 55 | 0.622878 |
18dc6c28b6e05512d5cfa579f7bb81b1a26bba43 | 3,923 | require 'spec_helper'
module Codebreaker
describe Game do
context "Start game" do
let(:game) { Game.new('Dima') }
before do
game.start
end
it "saves secret code" do
expect(game.instance_variable_get(:@secret_code)).not_to be_empty
end
it "saves 4 numbers... | 26.687075 | 108 | 0.585011 |
036acb9a0c5922a78fa8b7436b7bc1690290cff8 | 1,666 | # -*- coding: utf-8 -*-
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
require 'rubygems'; require 'require_relative'
require_relative '../command'
class Trepan::Command::SaveCommand < Trepan::Command
unless defined?(HELP)
NAME = File.basename(__FILE__, '.rb')
HELP = <<-HELP
#{NAME} [--[no... | 28.237288 | 73 | 0.627851 |
f7f9663f7e262576397eaee7ddee637f1836cee2 | 2,755 | # frozen_string_literal: true
module RuboCop
# This module holds the RuboCop version information.
module Version
STRING = '1.22.3'
MSG = '%<version>s (using Parser %<parser_version>s, '\
'rubocop-ast %<rubocop_ast_version>s, ' \
'running on %<ruby_engine>s %<ruby_version>s %<ruby_platf... | 32.034884 | 94 | 0.629038 |
1aee1dc3916d3cea66a98c281195c7e0ecc1a913 | 1,312 | class Cocoapods < Formula
desc "Dependency manager for Cocoa projects"
homepage "https://cocoapods.org/"
url "https://github.com/CocoaPods/CocoaPods/archive/1.10.0.tar.gz"
sha256 "d44c70047020ea114ca950df6d4499b1f86e5e7bbd3536a46f6fa3e32f1df21e"
license "MIT"
bottle do
sha256 "5fec9be27505bf6858fdbd409... | 35.459459 | 93 | 0.74314 |
1d6e990e93feaca486c01a0747b613ff110006bb | 225 | # frozen_string_literal: true
class CreateLocations < ActiveRecord::Migration[5.0]
def change
create_table :locations do |t|
t.string :title
t.string :room
t.timestamps null: false
end
end
end
| 17.307692 | 52 | 0.68 |
91dda0da8af0d11f87c2a551665605a17e9fe2ae | 702 | # frozen_string_literal: true
require 'common/client/configuration/soap'
require 'emis/configuration'
module EMIS
# Configuration for {EMIS::MilitaryInformationService}
# includes API URL and breakers service name.
#
class MilitaryInformationConfiguration < Configuration
# Military Information Service URL... | 26 | 82 | 0.74359 |
ff0523a038f38636aa10cc9f847fdd6eae022bba | 1,796 | # typed: true
# frozen_string_literal: true
require "pathname"
module Packwerk
class PackageSet
include Enumerable
PACKAGE_CONFIG_FILENAME = "package.yml"
class << self
def load_all_from(root_path, package_pathspec: nil)
package_paths = package_paths(root_path, package_pathspec || "**")
... | 27.212121 | 103 | 0.667595 |
bbeb0054ed15a155d500eb00ebeec97dae445ef1 | 3,399 | require 'rails_helper'
RSpec.describe Queries::CCLOW::TargetQuery do
before_all do
@geography1 = create(:geography, region: 'East Asia & Pacific')
@geography2 = create(:geography, region: 'Europe & Central Asia')
@geography3 = create(:geography, region: 'Europe & Central Asia')
@target1 = create(
... | 31.183486 | 113 | 0.638423 |
112367fea2e5b115db3abba5b8e29a16b1f4a21c | 1,231 | # -*- encoding: utf-8 -*-
# stub: rouge 3.17.0 ruby lib
Gem::Specification.new do |s|
s.name = "rouge".freeze
s.version = "3.17.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.metadata = { "bug_tracker_uri" => "https://github.com/rouge-ruby/r... | 49.24 | 316 | 0.697807 |
ffd1fdf6d34ea8c8d0a38063ac8cd84216974cce | 298 | # The metric where the mongrel queue time is stored
class NewRelic::MetricParser::WebFrontend < NewRelic::MetricParser
def short_name
if segments.last == 'Average Queue Time'
'Mongrel Average Queue Time'
else
super
end
end
def legend_name
'Mongrel Wait'
end
end | 21.285714 | 66 | 0.701342 |
e20f4a7d4404c83c636b76345bb131b13a67a7a7 | 4,166 | require "spec_helper"
describe Paperclip::Storage::Webdav do
let(:original_path) { "/files/original/image.png" }
let(:thumb_path) { "/files/thumb/image.png" }
[:attachment, :attachment_with_public_url].each do |attachment|
let(attachment) do
model = double()
model.stub(:id).and_return(1)
mo... | 33.063492 | 101 | 0.637782 |
ac820bc0e1d86c70fbde3f36ff18b82dd203c239 | 137 | require "test_helper"
describe CountriesController do
it "should get index" do
get :index
assert_response :success
end
end
| 13.7 | 31 | 0.737226 |
e9746825cc4e352080a7793083e6d7064d4c7b17 | 415 | require 'spec_helper'
describe Kojo::Commands::SingleCmd do
subject { described_class }
context "without arguments" do
it "shows short usage" do
expect { subject.execute %w[single]}.to output_approval('cli/single/usage')
end
end
context "with --help" do
it "shows long usage" do
expect... | 23.055556 | 88 | 0.684337 |
03f99096b71714a3c9c043f22f0d2dcf4f12ef26 | 34,967 | require 'spec_helper_min'
require 'support/helpers'
require 'helpers/feature_flag_helper'
require 'helpers/database_connection_helper'
describe Carto::Api::Public::DataObservatoryController do
include_context 'users helper'
include HelperMethods
include FeatureFlagHelper
include DatabaseConnectionHelper
bef... | 34.484221 | 131 | 0.621386 |
7a4489677e2fe89085c617c12b20730dca949c81 | 154 | require File.expand_path('../../../../spec_helper', __FILE__)
describe "Socket::Ifaddr#inspect" do
it "needs to be reviewed for spec completeness"
end
| 25.666667 | 61 | 0.720779 |
e8e3ec499a89d498d0b0e52e76b7d05200ff09e2 | 258 | class AddTunnelblickBundleAndIosBundleAndLinuxBundleToServer < ActiveRecord::Migration
def change
add_column :servers, :tunnelblick_bundle, :string
add_column :servers, :ios_bundle, :string
add_column :servers, :linux_bundle, :string
end
end
| 32.25 | 86 | 0.790698 |
d56e71f063666cace872849859f2afccd7ae4498 | 649 | require_relative 'serp_api_search'
# Ebay Search Result for Ruby powered by SerpApi
#
# Search API Usage
#
# ```ruby
# parameter = {
# _nkw: "query",
# api_key: "Your SERP API Key"
# }
#
# search = EbaySearch.new(parameter)
# search.params[:ebay_domain] = "ebay.com"
#
# html_results = search.get_html
# hash_result... | 18.542857 | 55 | 0.691834 |
38f352915c3db3ff350f93c7342a67e22459933f | 174 | class RemoveNameFromRepos < ActiveRecord::Migration[4.2]
def self.up
remove_column :repos, :name
end
def self.down
add_column :repos, :name, :string
end
end
| 17.4 | 56 | 0.706897 |
bb7b52205b8079d37ec3ad46d1a59a0c0ae06875 | 1,747 | require './lib/board.rb'
RSpec.describe 'testing the board' do
it 'should show us an empty board' do
expect(Board.new.show_board).to eq("+------------------------+\n| 1 - ❔ 2 - ❔ 3 - ❔ | \n| 4 - ❔ 5 - ❔ 6 - ❔ | \n| 7 - ❔ 8 - ❔ 9 - ❔ | \n+------------------------+")
end
it 'should show us an empty boar... | 51.382353 | 190 | 0.397825 |
d5fcd91b05d2066a30f5d00972e7a733f0b6fbd3 | 1,423 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'twilreapi/worker/version'
Gem::Specification.new do |spec|
spec.name = "twilreapi-worker"
spec.version = Twilreapi::Worker::VERSION
spec.authors = ["David Wilkie"]
sp... | 39.527778 | 104 | 0.67955 |
6ae77ab960cfeb1010134846beeda33829dd272e | 2,126 | class ProjectsController < ApplicationController
include Shared::RespondsController
before_filter :authenticate_admin!, except: [:show]
expose_decorated(:project, attributes: :project_params)
def create
if project.save
SendMailWithUserJob.perform_async(ProjectMailer, :created, project, current_user... | 26.246914 | 91 | 0.704139 |
1aa58a8d62d976148b4614134bd6a87ad6e1b816 | 1,927 | # frozen_string_literal: true
if Rails.env.development?
require 'annotate'
task set_annotation_options: :environment do # rubocop:disable Metrics/BlockLength
# You can override any of these by setting an environment variable of the
# same name.
Annotate.set_defaults(
'active_admin' => 'false',
... | 32.661017 | 84 | 0.586404 |
abfb234eb906afb41cc3acfd2579ac001fcc7fe7 | 1,575 | cask "microsoft-word" do
version "16.49.21050901"
sha256 "3b948f9031d337276ef87e9b372a7386ee846efe929cd16714bae596c9336f0c"
url "https://officecdn-microsoft-com.akamaized.net/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/Microsoft_Word_#{version}_Installer.pkg",
verified: "officecdn-microsoft-com.a... | 35.795455 | 148 | 0.720635 |
bb75bee36b546a3d0a716a56b18c0849caebc8b0 | 2,651 | require 'spec_helper'
describe 'Admin::AuditLogs', :js do
include Select2Helper
let(:user) { create(:user) }
before do
sign_in(create(:admin))
end
context 'unlicensed' do
before do
stub_licensed_features(admin_audit_log: false)
end
it 'returns 404' do
reqs = inspect_requests d... | 22.277311 | 81 | 0.639759 |
e9190c8b4da4ef25fe9c1851eed348f025c56312 | 19,694 | # Copyright 2011, Dell
# Copyright 2012, SUSE Linux Products GmbH
#
# 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 applica... | 29.482036 | 105 | 0.63791 |
bbe48a7302622059b8a756f32618883f8c654a06 | 1,622 | class Cig < Formula
desc "CLI app for checking the state of your git repositories"
homepage "https://github.com/stevenjack/cig"
url "https://github.com/stevenjack/cig/archive/v0.1.5.tar.gz"
sha256 "545a4a8894e73c4152e0dcf5515239709537e0192629dc56257fe7cfc995da24"
license "MIT"
head "https://github.com/steve... | 39.560976 | 122 | 0.759556 |
1da74d961b3b402d8b34167ef2d895bd4bd35baf | 300 | module UsersHelper
def gravatar_for(user, options = { size: 80 })
gravatar_id = Digest::MD5::hexdigest(user.email.downcase)
size = options[:size]
gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}"
image_tag(gravatar_url, alt: user.name, class: "gravatar")
end
end
| 33.333333 | 70 | 0.706667 |
21c65573a16cbfdf41a1129f22df531894f0e212 | 1,700 | class Api::V1::UsersController < ApplicationController
def index
@users = User.all
render json: @users
end
def show
@user = User.find(params[:id])
render json: @user
end
def create
@newuser = User.new(first_name: signup_params[:first_name],last_name: signup_params[:last_name],email: sig... | 30.357143 | 325 | 0.687647 |
ed32c90f0f02d29b27689623fcee9e6893d884e8 | 1,333 | =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.622222 | 107 | 0.724681 |
910c555b9883cf03965b11f799a6223751ef31ac | 3,288 | class UsersController < ApplicationController
before_action :authenticate_user!
load_and_authorize_resource
skip_authorize_resource :only => [:show, :edit, :index, :update]
before_action :authorize_admin, only: [:create, :destroy]
before_action :set_user, only: [:show, :edit, :update, :destroy]
# GET /user... | 30.728972 | 149 | 0.655109 |
1c3d4ef0ef17973bbc693b2f9899ad80f861fe10 | 2,991 | class Turtle
include Math # turtles understand math methods
DEG = Math::PI / 180.0
attr_accessor :track
alias run instance_eval
def initialize
clear
end
attr_reader :xy, :heading
# Place the turtle at [x, y]. The turtle does not draw when it changes
# position.
def xy=(coords)
... | 23.367188 | 93 | 0.638582 |
8708e2b02c6c434f1fe305e4c78434c8b8e5d58a | 1,152 | # 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
Gem::Specification.new do |spec|
spec.name = 'aws-sdk-sns'
spec.version = File.read(File.exp... | 38.4 | 141 | 0.659722 |
01de161a8cb0ac7e6bbd6a8743b798dd98d8198f | 3,766 | class Postgresql < Formula
desc "Object-relational database system"
homepage "https://www.postgresql.org/"
url "https://ftp.postgresql.org/pub/source/v11.1/postgresql-11.1.tar.bz2"
sha256 "90815e812874831e9a4bf6e1136bf73bc2c5a0464ef142e2dfea40cda206db08"
revision 1
head "https://github.com/postgres/postgres... | 32.465517 | 106 | 0.648168 |
bb5af56638d75ca5c45f7c610d925581775e455d | 777 | # coding: utf-8
require 'spec_helper'
require_relative '../../lib/berth/form'
require_relative '../../lib/berth/monkey_string'
class String
include MonkeyString
end
describe Form do
class DummyClass
attr_accessor :wording, :name, :subject, :content
include Form
def create_pdf(subject, content)
... | 22.2 | 135 | 0.71686 |
bf2fd828cd214c5e9b6bb7d076624741aab459b0 | 563 | class OpenCompletion < Formula
desc "Bash completion for open"
homepage "https://github.com/moshen/open-bash-completion"
url "https://github.com/moshen/open-bash-completion/archive/v1.0.4.tar.gz"
sha256 "23a8a30f9f65f5b3eb60aa6f2d1c60d7d0a858ea753a58f31ddb51d40e16b668"
license "MIT"
head "https://github.com... | 28.15 | 82 | 0.740675 |
1a4f6adf66944b5946b71bb5b5d6e711a6152e4f | 2,982 | # Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 35.5 | 78 | 0.701207 |
798d7862582d4c2130948afd8434d739cbfdd9d2 | 616 | Pod::Spec.new do |spec|
spec.name = 'FFViewControlPlaceHoldView'
spec.license = { :type => 'MIT' }
spec.platform = :ios, '6.0'
spec.homepage = 'https://github.com/wujiangwei/FFViewControlPlaceHoldView'
spec.authors = 'Kevin.Wu'
spec.summary = 'FFViewControlPlaceHoldView'
spec.source ... | 41.066667 | 96 | 0.722403 |
ac70928e61fb6e9c3cd71f04309a14bea33b3482 | 2,854 | #-*- coding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'new_relic/version'
require 'new_relic/latest_changes'
Gem::Specification.new do |s|
s.name = "newrelic_rpm"
s.version = NewRelic::VERSION::STRING
s.required_rubygems_version = Gem::... | 42.597015 | 108 | 0.722495 |
871c0dd928bd890efc796ec455eb40318d979526 | 7,214 | # frozen_string_literal: true
require 'spec_helper'
describe Bosh::AzureCloud::TableManager do
let(:azure_config) { mock_azure_config }
let(:storage_account_manager) { instance_double(Bosh::AzureCloud::StorageAccountManager) }
let(:azure_client) { instance_double(Bosh::AzureCloud::AzureClient) }
let(:table_ma... | 29.325203 | 113 | 0.665512 |
6271d5778ad45483ff3cfc4fa839c530b6214b70 | 1,598 | class TestLab
# Labfile Error Class
class LabfileError < TestLabError; end
# Labfile Class
#
# @author Zachary Patten <zachary AT jovelabs DOT com>
class Labfile < ZTK::DSL::Base
has_many :dependencies, :class_name => 'TestLab::Dependency'
has_many :sources, :class_name => 'TestLab::Sou... | 28.035088 | 107 | 0.624531 |
bb7ebe0d8efdf3f3311b7cca46dc3275fb9b6ced | 4,661 | require 'rails_helper'
require 'faker'
I18n.reload!
describe CampsController do
let(:email) { Faker::Internet.email }
let(:user) { User.create! email: email, password: Faker::Internet.password, ticket_id: '6687' }
let(:camp_leader) { Faker::Name.name }
let(:camp_attributes){
{
name: 'Burn somethin... | 30.070968 | 106 | 0.641064 |
1a4417d88e0df377866fede4c368609f870ebe81 | 3,794 | class Erlang < Formula
desc "Programming language for highly scalable real-time systems"
homepage "https://www.erlang.org/"
# Download tarball from GitHub; it is served faster than the official tarball.
url "https://github.com/erlang/otp/releases/download/OTP-24.0.3/otp_src_24.0.3.tar.gz"
sha256 "64a70fb19da9... | 32.706897 | 139 | 0.640221 |
9185dfa69ef09ae463afe8ec20e39d44d98c0c81 | 1,994 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 32.688525 | 99 | 0.666499 |
2603ee33de2cecb07f1b4f1dfd652d49acaa94eb | 4,426 | # encoding: utf-8
require "mongoid/matchable/default"
require "mongoid/matchable/all"
require "mongoid/matchable/and"
require "mongoid/matchable/exists"
require "mongoid/matchable/gt"
require "mongoid/matchable/gte"
require "mongoid/matchable/in"
require "mongoid/matchable/lt"
require "mongoid/matchable/lte"
require "m... | 28.012658 | 87 | 0.567555 |
ab7f7d47e21f453c4b3b1d177071940337b4ce3f | 361 | module Gym
class Xcode
class << self
def xcode_path
Helper.xcode_path
end
def xcode_version
Helper.xcode_version
end
# Below Xcode 7 (which offers a new nice API to sign the app)
def pre_7?
v = xcode_version
is_pre = v.split('.')[0].to_i < 7
... | 17.190476 | 67 | 0.556787 |
abc96e1c3f4da20c4816c2a49aadd3f816dee5ab | 404 | require './config/environment'
class ApplicationController < Sinatra::Base
configure do
set :public_folder, 'public'
set :views, 'app/views'
enable :sessions unless test?
set :session_secret, "secret"
end
get '/' do
erb :index
end
helpers do
def logged_in?
!!session[:user_id]... | 15.538462 | 43 | 0.643564 |
5dbcd599289a8312e08aee5566c1b00fff3a6ab5 | 1,943 | # frozen_string_literal: true
class PasswordResetsController < ApplicationController
skip_before_action :authenticated
def reset_password
user = Marshal.load(Base64.decode64(params[:user])) unless params[:user].nil?
if user && params[:password] && params[:confirm_password] && params[:password] == params[:... | 30.359375 | 129 | 0.67473 |
ff261adf45e8cb5f0923a28970fc7539a8a6d3ab | 5,189 | require 'spec_helper'
module PayuPayments
describe Client do
it "should be able to create a client" do
client = Client.new(:fullName => "John Doe", :email => "johndoe@gmail.com")
client.should_receive(:http_call).with("post", "/payments-api/rest/v4.3/customers", {:fullName => "John Doe", :ema... | 47.605505 | 217 | 0.413953 |
623fa16861ad1b7b82765d8216921fac1d0dfce5 | 687 | # Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems' # This line not needed for ruby > 1.8
require 'twilio-ruby'
# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client... | 49.071429 | 177 | 0.804949 |
b9ad9ef3373677ee1c96f29e2fd26899255f9846 | 3,283 | # encoding: UTF-8
require 'stringex/localization/conversion_expressions'
module Stringex
module Localization
class Converter
include ConversionExpressions
attr_reader :ending_whitespace, :options, :starting_whitespace, :string
def initialize(string, options = {})
@string = string.dup... | 25.253846 | 92 | 0.609199 |
624ed2b581def3d1d95f132b4076ade3e2ccdefa | 456 | require "rails/generators"
module Ahoy
module Stores
module Generators
class ActiveRecordGenerator < Rails::Generators::Base
class_option :database, type: :string, aliases: "-d"
class_option :migration_path, type: :string, aliases: "-m"
def boom
invoke "ahoy:stores:active... | 25.333333 | 66 | 0.660088 |
1deced1f03924478c1863e7415dfd28030aadebe | 6,302 | require_relative '../spec_helper'
describe 'bit_field/reference' do
include_context 'configuration common'
include_context 'register_map common'
before(:all) do
RgGen.enable(:register_block, :name )
RgGen.enable(:register , :name )
RgGen.enable(:bit_field , :name ... | 33.168421 | 86 | 0.516503 |
4ac1944c9745e91f268621b4753bcc3f1b26fa5c | 4,169 | =begin
##########################################################################
#
# INFIVERVE TECHNOLOGIES PTE LIMITED CONFIDENTIAL
# __________________
#
# (C) INFIVERVE TECHNOLOGIES PTE LIMITED, SINGAPORE
# All Rights Reserved.
# Product / Project: Flint IT Automation Platform
# NOTICE: All information cont... | 41.69 | 125 | 0.636604 |
5dda71fe37c809973a3dc71da31fbeb6b21d72e9 | 5,498 | require 'spec_helper.rb'
describe MarketingCloudSDK::Client do
context 'initialized' do
it 'with client parameters' do
client = MarketingCloudSDK::Client.new 'client' => { 'id' => '1234', 'secret' => 'ssssh', 'signature' => 'hancock' }
expect(client.secret).to eq 'ssssh'
expect(client.id).to eq... | 28.635417 | 122 | 0.6255 |
18d36336a4317ca80da117dc4e3fb8eca4863bab | 2,112 | # 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... | 40.615385 | 116 | 0.736269 |
7934dae654093d7fb2d1a76870e50adeff064539 | 1,696 | namespace :pentabarf do
namespace :import do
task default: :all
task setup: :environment do
require 'pentabarf_import_helper'
@import_helper = PentabarfImportHelper.new
end
desc 'Import conferences'
task conferences: :setup do
@import_helper.import_conferences
end
desc... | 22.918919 | 171 | 0.68809 |
91cd6de48efffff9841bfe406d009b5cedc3a9f9 | 512 | require 'yandex_delivery'
YandexDelivery.setup do |config|
if File.exist?('config/yandex_delivery.yml')
template = ERB.new(File.new('config/yandex_delivery.yml').read)
processed = YAML.safe_load(template.result(binding))
processed['YANDEX_DELIVERY_API_KEY'].each do |k, v|
config::create_method k.u... | 30.117647 | 67 | 0.710938 |
627aaba3a7bc9a99cb8bd3062a72f0284b088d7d | 121,399 | # frozen_string_literal: true
require "isolation/abstract_unit"
require "rack/test"
require "env_helpers"
require "set"
class ::MyMailInterceptor
def self.delivering_email(email); email; end
end
class ::MyOtherMailInterceptor < ::MyMailInterceptor; end
class ::MyPreviewMailInterceptor
def self.previewing_email(... | 32.278383 | 170 | 0.695558 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.