text stringlengths 10 2.61M |
|---|
actions :install
default_action :install
attribute :distribution, :kind_of => String, :required => true, :equal_to => ['mysql', 'mariadb']
attribute :version, :kind_of => String, :required => true, :regex => /^[0-9]+\.[0-9]+\.[0-9]+/
attribute :url, :kind_of => String, :required => true
attribute :checksum, :kind_of =>... |
# frozen_string_literal: true
require 'bolt/pal/yaml_plan'
module Bolt
class PAL
class YamlPlan
class Evaluator
def initialize(analytics = Bolt::Analytics::NoopClient.new)
@logger = Logging.logger[self]
@analytics = analytics
@evaluator = Puppet::Pops::Parser::Evaluat... |
class AddBannerToSubjects < ActiveRecord::Migration
def self.up
add_column :subjects, :banner, :string,:limit=>150
end
def self.down
remove_column :subjects, :banner
end
end
|
class AddPositionToAlbumTemplatePage < ActiveRecord::Migration
def self.up
add_column :album_template_pages, :position, :integer, :default=>1
end
def self.down
end
end
|
class CreateUnits < ActiveRecord::Migration
def self.up
create_table :units do |t|
t.string :name
t.references :department
t.string :address
t.string :telephone_number
t.string :fax_number
t.integer :order_by
t.boolean :is_active, :default => true
t.boolean :deleted... |
require 'test_helper'
# bundle exec ruby -Itest test/controllers/track_versions_controller_test.rb
class TrackVersionsControllerTest < ActionDispatch::IntegrationTest
describe "#show" do
describe "when no user is logged in" do
test "redirect to login page" do
get project_track_track_version_url(pro... |
class TasksController < ApplicationController
before_action :set_task, only: [:show, :edit, :update, :destroy]
# GET /tasks
# GET /tasks.json
def index
@tasks = Task.all
end
# GET /tasks/1
# GET /tasks/1.json
def show
end
# GET /tasks/new
def new
@task = Task.new
end
# GET /tasks/1... |
# coding: utf-8
$:.push File.expand_path('../lib', __FILE__)
require 'dynamodb-orm/version'
Gem::Specification.new do |spec|
spec.name = 'dynamodb-orm'
spec.version = DynamodbOrm::VERSION
spec.authors = ['Roman Lupiichuk', 'Bohdan Hryshchenko', 'Anton Priadko', 'Oleg Keene']
spec.email ... |
require_relative '../gen.rb'
require 'nokogiri'
$CONFIG_PATH = "./decks.json"
$INDEX_PATH = "./index.html"
$BOILERPLATE = File.read("boilerplate.html")
def parse_deck!(deck_path)
xml = File.read(deck_path)
doc = Nokogiri::XML xml
id = doc.css("deck").first["id"] || File.basename(deck_path, ".xml")
... |
module Control
class GenusController < ControlPanelController
# GET /genus
# GET /genus.json
def index
@genus = Genu.order("#{sort_column} #{sort_direction}")
if params[:category_id]
@genus = @genus.where(:plant_category_id => params[:category_id])
end
@genus = @genus.pag... |
require_relative '../controllers/add_remove_books_controller'
class AddRemoveBooksView
class << self
def ask_for_information
puts "Add the title of the book: "
AddRemoveBooksController.book_title = gets.chomp
puts "Add a little description of the book: "
AddRemoveBooksController.book_desc... |
class AddExpiryDaysToOffer < ActiveRecord::Migration
def change
add_column :offers, :expiry_days, :integer
end
end
|
require "spec_helper"
describe "GET /dir1/file1.html", :type => :rest_url do
describe "http_method" do
it "returns GET as http_method" do
expect(http_method).to be(:get)
end
end
describe "request_path" do
it "returns /dir1/file1.html as request_path" do
expect(request_path).to eq("/dir1/... |
module GogogibbonTools
module MailchimpSubscribersHelper
def to_mailchimp_subscriber user
MailchimpSubscriber.new({ :email => user.email, :first_name => user.first_name, :last_name => user.last_name })
end
end
end
|
class NewSubscriberMailer < ActionMailer::Base
layout 'mailer'
def new_sub(subscriber)
@token = subscriber.token
@sub = subscriber
mail to: subscriber.email, subject: t('subscribers.email.confirm_email_call')
end
end
|
require "rubygems"
require "sinatra/base"
require 'shellwords'
require 'pry'
class AndroidRemoteApi < Sinatra::Base
get "/" do
"online"
end
get "/volume" do
bash("awk -F\"[][]\" '/dB/ { print $2 > \"volume\" }' <(amixer sget Master)")
File.open("volume", "rb").read.chomp("%\n")
end
get "/volume... |
class AddSymbolToDirectChatRooms < ActiveRecord::Migration[6.1]
def change
add_column :direct_chat_rooms, :symbol, :string
end
end
|
module AppDelegate
module Keyboard
attr_accessor :keyboardVisible, :keyboardBounds, :keyboardAnimationDuration, :keyboardAnimationCurve
def setupKeyboard
Notification.subscribe UIKeyboardDidHideNotification, action:"keyboardHide", observer:self
Notification.subscribe UIKeyboardWillShowNotificati... |
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
describe Admin::TagsController do
fixtures :users
before(:each) do
login_as :quentin
stub!(:reset_session)
@blog = mock_model(Blog, :title => 'Blog Title')
@user = mock_model(User)
@tag = mock_model(Tag)
@tags = moc... |
class StockReport::Stock
attr_accessor :symbol, :quantity, :price
def initialize(symbol)
@symbol = symbol
end
end
|
class Article
attr_accessor :title, :author, :url, :content
@@all = []
# def initialize
def initialize(title, author, url, content)
@title = title
@author = author
@url = url
@content = content
@@all << self
end
def self.all
@@all
end
... |
# frozen_string_literal: true
require 'spec_helper'
describe SFRest::Connection do
before :each do
@conn = SFRest.new "http://#{@mock_endpoint}", @mock_user, @mock_pass
end
describe '#get' do
it 'returns json if the body is parsable.' do
stub_json_request
expect(@conn.get('/')).to be_a(Hash... |
class MenusController < ApplicationController
before_action :authenticate_user!
before_action :check_rights, :only => [:index]
def index
if params[:cid]
category = Category.find(params[:cid])
@menus = category.menus
else
@menus = Menu.all
end
@q = @menus.ransack(pa... |
class GetByNewsletterTypeId
attr_reader :id
def initialize(id)
@id = id
end
def to_xml
"<getByNewsletterTypeIdRequest><newsletterTypeId>#{@id}</newsletterTypeId> </getByNewsletterTypeIdRequest>"
end
def to_hash
{:getByNewsletterTypeIdRequest => {:newsletterTypeId => @id}}
end
end |
module Serverspec
module Type
class PageReturns < Base
def initialize(url = 'http://localhost:80/', host = 'localhost', ssl = false)
@url = url
@host = host
@ssl = ssl
end
def content
uri = URI.parse(@url)
http = Net::HTTP.new(uri.host, uri.port)
... |
require 'rails_helper'
describe BetExpirationOutcomeEmailer do
describe "#perform" do
let(:bet) { create(:bet, :confirmed, id: 1) }
context "when the bet has been confirmed by the invitee" do
it "sends an email to both invitee & inviter of the bet" do
mail = double(deliver: true)
expec... |
# frozen_string_literal: true
module Readthis
VERSION = '2.1.0'
end
|
require 'sumac'
# make sure it exists
describe Sumac::Messages::Shutdown do
# should be a subclass of Message
example do
expect(Sumac::Messages::Shutdown < Sumac::Messages::Message).to be(true)
end
# ::build, #properties, #to_json
example do
message = Sumac::Messages::Shutdown.build
expect(mes... |
#def age
# return 20 #return 可有可無 最後一行若為值會自己return
#end
#
#puts age
# def hello(name)
# puts "first"
# yield name # 控制權出讓 後可拋參數給後面的block
# puts "last"
# end
# hello("66666") do |name| #block
# puts "hello ,#{name}"
# end
# def count_to(n)
# x = 0
# # while x < n
# # x+=1
# # yield x... |
class Trackerific::Parsers::Purolator < Trackerific::Parsers::Base
protected
def response_error
@response_error ||= if response_information.try(:errors).try(:any?)
Trackerific::Error.new(informational_messages.map{|k,v| "Code: #{k}, Message: #{v}"}.join(';'))
else
false
end
end
def sum... |
Facter.add(:dojolayers) do
setcode do
vclweb = Facter.value(:vclweb)
if vclweb == nil then
Puppet.debug "vclweb not yet set. No dojolayers definition available in utils.php"
{}
else
utils = "#{vclweb}/.ht-inc/utils.php"
Puppet.debug "Looking up vcldojo configuration from #{util... |
# encoding: utf-8
module TinymceFilemanager
CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+]/
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
include Sprockets::Rails::Helper
storage :file
def store_dir
"uploads/#{model.class.to_s.undersco... |
require 'spec_helper'
require_relative '../cc_processing_client'
describe CCProcessingClient do
let(:client) { CCProcessingClient.new }
context "responds to command interpreter messages" do
it "responds to quit" do
expect(client).to respond_to(:quit)
end
it "responds to show_help" do
expect(client).to re... |
# frozen_string_literal: true
# == Schema Information
#
# Table name: problem_reports
#
# id :bigint(8) not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# computer_number :string not null
# description ... |
class Job < ActiveRecord::Base
has_many :application_forms, dependent: :delete_all
validates_presence_of :name, :description
end
|
module UsersHelper
def display_follow_btn(_user)
out = ''
return unless @user.id != current_user.id
out += if current_user.followees.include?(@user)
"<h5 class='btn'> #{button_to 'Unfollow', unfollow_path, method: 'POST'} </h5>"
else
"<h5 class='btn'>#{button_to 'Foll... |
class GoogleResultsPage
include PageMixIn
attr_accessor :results, :conversion_result
def initialize(browser)
@browser = browser
@results = @browser.div(:id => "resultStats")
@conversion_result = self.h2(:class => "r")
super
end
def number_search_results
result = /[\s\D]*([\d,]+) result... |
module DataMigrations
class Instruction
class Exec < Base
attr_reader :statement
def initialize(migration, statement)
super(migration)
@statement = statement
end
def statements
[statement]
end
end
end
end
|
class SessionsController < ApplicationController
def create
user = User.find_by(login: params["login"], password: params["password"])
if user != nil
session[:user_id] = user.id
redirect_to root_path
else
session[:user_id] = nil
redirect_to new_session_path, notice: "Неверная пара ло... |
require 'test_helper'
class MicropostTest < ActiveSupport::TestCase
def setup
@user = users(:one)
@micropost = @user.microposts.new(content: "testcontent")
end
test "micropost should be valid" do
assert @micropost.valid?
end
end
|
require 'rails_helper'
feature 'Delete Procedure', js: true do
context 'User deletes a core' do
scenario 'and does not see the core' do
given_i_am_viewing_a_core_with_n_procedures_such_that_n_is '1'
when_i_delete_the_first_procedure
then_i_should_not_see_the_core
end
end
context 'User... |
module Vagrant
module Butcher
class Env
attr_accessor :ui
def initialize
if Gem::Version.new(::Vagrant::VERSION) >= Gem::Version.new("1.2")
@ui = ::Vagrant::UI::Colored.new.scope('Butcher')
else
@ui = ::Vagrant::UI::Colored.new('Butcher')
end
end
... |
# require "git"
module Kaya
module Support
class Git
def self.branch_list
self.remote_branches.map do |branch|
branch.gsub("*","").gsub(" ","").gsub("origin/","")
end.select do |branch|
not (branch.include? "HEAD" or branch.include? "/")
... |
require 'test_helper'
class PhotosControllerTest < ActionController::TestCase
setup do
@photo = photos(:one)
@user = users(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:photos)
end
test "should get new" do
sign_in @user
get :ne... |
require_relative '../model/persistor'
require_relative '../model/evento_builder'
require_relative '../model/calendario_nombre_existente_error'
require_relative '../model/calendario_sin_nombre_error'
require_relative '../model/calendario_inexistente_error'
require_relative '../model/evento_calendario_no_existente_error'... |
require 'csv'
namespace :earthquakes do
desc "Parsing all eathquakes"
task parse_eq: [:environment] do
csv_eq = open('https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.csv')
csv = CSV.parse(csv_eq, :headers => true)
csv.each do |row|
Earthquake.create!(row.... |
# frozen_string_literal: true
class Queries::ScripturesQuery < Queries::BaseQuery
type Types::ScriptureType.connection_type, null: false
argument :resource_type, String, required: false
def resolve(resource_type: nil)
scope(resource_type).all
end
protected
def scope(resource_type)
return ::Scrip... |
class AddNumberToAccount < ActiveRecord::Migration[6.0]
def change
add_column :accounts, :number, :integer
add_index :accounts, :number, unique: true
add_column :accounts, :token, :string, null: false
add_index :accounts, :token, unique: true
end
end
|
class ChangeTypeToMoviesAndMovieLinks < ActiveRecord::Migration[5.0]
def change
change_column :movies, :introduce, :text
change_column :movie_links, :link, :text
end
end
|
class Admin::UsersController < ApplicationController
cache_sweeper :user_sweeper, :only => [:update, :destroy]
layout 'admin', :except => [ :register, :signup ]
before_filter :login_required, :except => [ :register, :signup ]
# GET /admin/users
# GET /admin/users.xml
# GET /admin/blogs/1/users
# GET ... |
class SessionsController < ApplicationController
skip_before_action :authenticate_user, only: [:new, :create]
before_action :redirect_logged_user
def new
@form = SessionForm.new
end
def create
@form = SessionForm.new(user_params)
if @form.save
session[:user_id]... |
class Grid2D
attr_reader :height, :width
def initialize(height, width, data = [])
@height = height
@width = width
if data.empty?
@data = Array.new(height) { Array.new(width) }
else
@data = data
end
end
def ==(other)
@data.eql? other.data
end
def eql?(other)
self ==... |
module MeetingHelper
def meeting_kinds
Meeting.kinds.keys.map { |c| [meeting_kind(c), c] }
end
def meeting_kind(k)
t("model.meeting.kinds.#{k}")
end
def meeting_document_kinds
MeetingDocument.kinds.keys.map { |c| [meeting_document_kind(c), c] }
end
def meeting_document_kind(k)
t("model.... |
class Article < ActiveRecord::Base
attr_accessible :title, :body, :tag_list, :image, :author_name
has_many :comments
has_many :taggings
has_many :tags, :through => :taggings
has_attached_file :image,
:url => "/assets/articles/:id/:style/:basename.:extension",
:path => ":rails_root/publi... |
class RegistrationsController < Devise::RegistrationsController
def new
redirect_to new_user_session_path, notice: "Contact the admin for registerations"
end
end
|
class AddFinishOnToChallenges < ActiveRecord::Migration[5.0]
def change
add_column :challenges, :finish_on, :date
end
end
|
class Package < ActiveRecord::Base
attr_accessible :name
has_many :class_packages
has_many :packages, :through => :class_packages
end
|
require 'rails_helper'
RSpec.describe Admin::SettingsController, type: :controller do
describe "#index" do
it "gets new pref if none exists" do
get :index
expect(assigns[:preference].persisted?).to eq true
end
it "gets existing pref if exists" do
pref = Preference.create(artist_sort_o... |
class Robot
FACINGS = %w[NORTH EAST SOUTH WEST]
attr_accessor :x, :y, :facing, :arena
def place(arena, abcissa, ordinate, facing)
return nil unless arena.valid_point?(abcissa,ordinate)
@arena = arena
@x = abcissa
@y = ordinate
@facing = facing
end
def report
"#{@x},#{@y},... |
class AuctionBidder < Luther::DCI::Context
class BiddingError < StandardError; end
role :bidding_params do
def create_bid
Bid.new self.merge(auction: context.biddable.player)
end
end
role :bidding do
def validate_and_save
greater_than_last_bidding
does_not_exceed_buying_price
... |
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# email :string
# name :string
# password_digest :text
# created_at :datetime not null
# updated_at :datetime not null
#
class User < ActiveRecord::Base
has_s... |
class Topic < ApplicationRecord
belongs_to :user
has_many :statements
has_many :photos
before_create :randomize_id
private
def randomize_id
begin
self.id = SecureRandom.random_number(1_000_000)
end while Topic.where(id: self.id).exists?
end
end
|
require 'spec_helper'
describe ApiController do
before do
@member = FactoryBot.create(:member, password: 'mala', password_confirmation: 'mala')
@feed = FactoryBot.create(:feed)
@item = FactoryBot.create(:item, feed: @feed)
@subscription = FactoryBot.create(:subscription, feed: @feed, member: @member)... |
class Api::Mobile::OrdersController < Api::Mobile::BaseController
def index
user = User.find_by(auth_token: params[:auth_token])
api_success(message: '订单列表', data: user.orders.map{|o| o.json_item_builder})
end
def create
user = User.find_by(auth_token: params[:auth_token])
destination = user.des... |
module DownloadHelper
def download_link(file_entity,real_file_name)
return if file_entity.blank?
raise "#{file_entity} 不是 file_entity 实例" if !file_entity.is_a?(FileEntity)
download_id = get_download_id_by_file_entity_id(current_user,file_entity,real_file_name)
"/download/#{download_id}"
end
... |
class UsersController < ApplicationController
before_action :user_signed_in?
before_action :set_user
def show
end
def destroy
@user.destroy
session[:user_id] = nil
redirect_to root_path, notice: "Your account has been deleted."
end
private
def set_user
@user = User.find(current_user... |
class ConnectionsController < ApplicationController
before_action :fetch_connection, only: %i[edit index book]
def index
@journey = Journey.find(params[:journey_id])
@connections = @journey.connection.all
end
def new
@journey = Journey.find(params[:journey_id])
@connection = Connection.new
... |
# frozen_string_literal: true
require 'backport'
require 'observer'
require 'set'
module Readapt
class Debugger
include Observable
include Finder
attr_reader :monitor
attr_reader :file
def initialize machine = Machine.new
@stack = []
@threads = {}
@frames = {}
@running... |
class SubscriptionsController < ApplicationController
# this default controller expects pages that are set to link to
# /subscribe
# /subscribe/thank_you
# /subscribe/activated
# /subscribe/not_activated
# these pages never get loaded by the page controller
# these pages do not use the thank-you urls wit... |
require 'spec_helper'
describe ApplicationHelper do
include ApplicationHelper
def current_provider
o = Object.new
o.instance_eval do
def type
"mock"
end
end
o
end
it "indicates whether that the current user is unauthenticated" do
authenticated?.should be_false
end
... |
class AddIndicesOnFinanceTransactionReceiptRecordsForFeeAccount < ActiveRecord::Migration
def self.up
add_index :finance_transaction_receipt_records, :fee_account_id, :name => "index_by_fee_account"
end
def self.down
remove_index :finance_transaction_receipt_records, :name => "index_by_fee_account"
end... |
class BooksController < ApiController
before_action :require_login, except: [:index]
def index
# aBook = Book.new
books = Book.searchManyFields(params[:keyword], params[:page], params[:booksPerPage])
total = Book.getTotalResults()
due_days = DueDay.all
res = {
"books": books,
"... |
require 'individual_encounter'
require 'date'
describe IndividualEncounter do
subject(:encounter) { IndividualEncounter.new(:measure_year => 2012, :measure_number => 1, :provider_id => 99) }
describe '#new' do
it 'has a measure_year' do
expect(encounter.measure_year).to eq 2012
end
it 'has a ... |
feature "User activates" do
background(:each) do
clear_emails
end
scenario "successfully activates and updates account" do
visit '/'
within('#sign-up') do
fill_in "Email", with: "sam.iam@example.com"
click_button "Submit"
end
open_email 'sam.iam@example.com'
expect(current_em... |
require 'sneaql'
require 'aws-sdk'
require 'json'
require 'zlib'
# AWS extensions for SneaQL
module SneaqlAWS
module Exceptions
# Exception used to to gracefully exit test
class AWSResourceCreationException < Sneaql::Exceptions::BaseError
def initialize(msg = 'Unable to create AWS resource')
su... |
class AnswersController < ApplicationController
def create
@booking = Booking.find(params[:booking_id])
@answer = Answer.new(answer_params)
@answer.booking = @booking
authorize @answer
@answer.save
redirect_to booking_path(@booking)
end
private
def answer_params
params.require(... |
module V1
class Root < Grape::API
version "v1"
format :json
content_type :json, "application/json"
helpers V1::Helpers::Base
# global exception handler
rescue_from ActiveRecord::RecordNotFound do |e|
Dispatch.logger.error e
error!(error_msg("11004", e.message), 404)
end
... |
after(:contexts) do
context = User.first.context 'music'
training = Training.where(name: 'Basics', context_id: context.id).first_or_create
entry_data_model = EntryDataModel::Technique.new.entry_data_model
session = Session.where(name: 'Sing', training_id: training.id, weekday: 0).first_or_create
challenge = ... |
# A basic abstraction layer for drawing text
# as images manipulation currently using RMagick.
#
# Author:: Andrew Montgomery (mailto:andy@soniciq.com)
# Copyright:: Copyright (c) 2006 SonicIQ Limited
# License:: Closed source, in-house use only
class IQ::Image::TextBlockGraphic < IQ::Image::TextGraphicBase
a... |
require 'legitable'
require 'faker'
require_relative 'client'
module Api
module Utils
def api
Api::Client.instance
end
def standard_table
Legitable::Table.new(delimiter: ' ')
end
def read_local(label)
File.read "./stackscripts/#{label}"
end
def random_password
... |
# frozen_string_literal: true
module FileReaderTest
module Readlines
def test_readlines_with_default_separator
file = file_containing("tahi_rua_toru_whā_")
lines = with_input_record_separator("_") {
file.readlines
}
assert_equal ["tahi_", "rua_", "toru_", "whā_"], lines
end
... |
class CreateTasks < ActiveRecord::Migration[5.0]
def change
create_table :tasks do |t|
t.jsonb :fields, null: false, default: '{}'
t.string :title, null: false, limit: 150
t.text :description
t.references :user, foreign_key: true
t.timestamps
end
add_index :tasks, :field... |
class Wiki < ActiveRecord::Base
extend FriendlyId
friendly_id :title, use: :slugged
belongs_to :user
validates :body, presence: true
validates :title, presence: true
validates :user, presence: true
has_many :collaborators, dependent: :destroy
has_many :users, through: :collaborators
default_scope ... |
module CamaleonCms
class FrontendController < CamaleonCms::CamaleonController
before_action :init_frontent
include CamaleonCms::FrontendConcern
include CamaleonCms::Frontend::ApplicationHelper
layout proc { |controller|
args = {
layout: (params[:cama_ajax_request].present? ... |
class Candidate < ApplicationRecord
belongs_to :location
has_and_belongs_to_many :technologies
validates :exp_min, presence: true, numericality: { greater_than: -1 }
validate :exp_max_greater
private
def exp_max_greater
unless exp_max.nil? || exp_min.nil?
errors.add :exp_max, "Field exp_max mus... |
require 'rails_helper'
RSpec.describe Review, type: :model do
let(:user) { FactoryGirl.create :user, email: FFaker::Internet.email }
subject { FactoryGirl.create :review, user_id: user.id }
it { expect(subject).to be_valid }
end
|
ActiveAdmin.register PowerOrder do
permit_params :group_id, :item, :power, :manufacturer, :model, :item_url
belongs_to :group, optional: true
index do
selectable_column
id_column
column "参加団体", :group
column :item
column :power
column :manufacturer
column :model
column :item_url
... |
require 'redmine'
require 'wiki_macros'
Redmine::Plugin.register :redmine_wiki_macros do
name 'Redmine Wiki Macros plugin'
author 'johnlinvc'
description 'A collection of useful wiki macros for Redmine'
version '0.0.1'
url 'http://example.com/path/to/plugin'
author_url 'http://example.com/about'
end
|
#! /usr/bin/ruby
#
# filtNonSpecific.rb
#
# Copyright (c) 2016 - Ryo Kanno
#
# This software is released under the MIT License.
# http://opensource.org/licenses/mit-license.php
#
require_relative "SAMReader.rb"
require "optparse"
Version="1.2.2"
banner = "Usage: filtNonSpecific.rb [option] <input SAM file>\n+Filter n... |
#
# Be sure to run `pod lib lint Swift_Extensions.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 http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'Swi... |
group node[:redshift_tracking_copy_from_s3][:group]
user node[:redshift_tracking_copy_from_s3][:user] do
comment "redshifttrackingcopyfroms3 user"
gid node[:redshift_tracking_copy_from_s3][:group]
home "/home/#{node[:redshift_tracking_copy_from_s3][:user]}"
shell "/bin/noshell"
supports :ma... |
=begin
feature "Checks if text is being displayed" do
scenario 'shows text' do
visit('/')
expect(page).to have_content 'Testing infrastructure working!'
end
end
=end
feature 'checks players have filled in their name' do
scenario 'names filled in' do
sign_in_and_play
expect(page).to have_content ... |
class CreateProjects < ActiveRecord::Migration
def change
create_table :projects do |t|
t.integer :professor_id, null: false
t.string :status, null: false, default: "pending"
# project statuses: "pending", "active", "complete" # we should add 'rejected' for projects the admin rejects
t.st... |
FactoryGirl.define do
factory :user do
email { Faker::Internet.email }
password 'test1234'
trait :admin do
role 'admin'
end
end
factory :video_type do
sequence(:name) { |n| "VideoType#{n}" }
end
factory :definition do
video_type
sequence(:name) { |n| "Defintion#{n}" }
... |
class Robot
@names = []
attr_reader :name
def self.add_name(name)
@names << name
end
def self.valid_name?(name)
!@names.include?(name)
end
def initialize
set_name
end
def reset
set_name
end
private
def set_name
@name = generate_name
end
def generate_name
loop ... |
require 'rails_helper'
require 'helper_methods'
describe Conversation do
before :each do
populate_users(10) # set to @user0, @user1, ..., @userN
end
it 'should create a new conversation between two users' do
c = Conversation.create_between([@user0, @user1])
expect(Conversation.find(c.id).users).to e... |
class UsersController < ApplicationController
skip_before_action :require_login, only: [:index, :new, :create, :show]
before_action :set_user, only: %i[edit update destroy]
def index
@user = User.find(params[:id])
end
def new
@user = User.new
end
def create
@user = User.new(user_param... |
# frozen_string_literal: true
# This file was generated by rails_favicon_generator, from
# https://realfavicongenerator.net/
# It makes files with .webmanifest extension first class files in the asset
# pipeline. This is to preserve this extension, as is it referenced in a call
# to asset_path in the _favicon.html.er... |
class Customers::OrdersController < ApplicationController
include ApplicationHelper
before_action :authenticate_customer!
def new
@order = Order.new
@my_postcode = current_customer.postcode
@my_address = current_customer.address
@deliveries = Delivery.where(customer_id: current_customer.id)
... |
class AddDevelompmentToResidenceType < ActiveRecord::Migration
def change
add_column :residence_types, :development_id, :integer
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.