text stringlengths 10 2.61M |
|---|
class OrderPolicy < ApplicationPolicy
class Scope < Scope # Scope represents the class Oder
def resolve
scope.where(user: user)
end
end
def index?
true
end
def show?
record.user == user # record represents the specific object
end
def create?
index?
end
def update?
rec... |
require 'rails_helper'
RSpec.describe "books/index", type: :view do
before(:each) do
set_password = Faker::Internet.password
@user = User.create!(name: Faker::Name.name, email: Faker::Internet.email ,password: set_password, password_confirmation: set_password, admin: true, status: true)
assign(:books, [... |
class OrdersController < ApplicationController
before_action :authorize
def create
# binding.pry
order = current_user.orders.build order_params.merge(meal_id: params[:meal_id])
if order.save
flash[:success] = "Get psyched, awesome food is gonna be made!"
redirect_to meal_path(params[:meal_... |
class PhoneNumbersController < ApplicationController
before_action :set_phone_number, only: [:show, :edit, :update, :destroy]
def index
@phone_numbers = PhoneNumber.all
end
def show
end
def edit
end
def new
@phone_number = PhoneNumber.new
end
def update
if @phone_number.update(phone... |
FactoryGirl.define do
factory :user do
sequence(:username) { |n| "jown#{n}" }
email { "#{username}@forkem.io" }
password "password123"
end
factory :mealbook do
owner { create :user }
mealbook_name "My Mealbook"
end
factory :meal do
meal_title "Chicken Something-or-nother"
mealbo... |
require 'rails'
require 'rails/generators/active_record'
module Coalla
module Cms
module Lookups
class InstallGenerator < ActiveRecord::Generators::Base
argument :name, type: :string, default: ''
source_root File.expand_path('../../../../../../', __FILE__)
class_option :copy, type:... |
# The TEM's ABI (Abstract Binary Interface) definition.
#
# This code is the official specification, because Victor likes executable
# specifications.
#
# Author:: Victor Costan
# Copyright:: Copyright (C) 2007 Massachusetts Institute of Technology
# License:: MIT
require 'openssl'
require 'digest/sha1'
... |
class LinkedinEvaluator
attr_accessor :client
attr_reader :user
BASIC_PROFILE_FIELDS = ['headline', 'positions', 'first_name', 'last_name', 'industry']
def initialize(user)
@user = user
credential = user.credentials.find_by_provider('linkedin')
tokens = credential.token.split(' ')
@client = Li... |
class Pile
attr_reader :top_card, :bottom_card
def initialize(top_card=nil)
@top_card = top_card
@bottom_card = top_card
end
def current_value
@top_card.value
end
def current_color
@top_card.color
end
def valid_play?(card)
if card.color != current_color && card.value == VALUE_ST... |
class Post < ActiveRecord::Base
belongs_to :blog
belongs_to :user
validates :title, :content, :presence => true
validates :title, :length => { :minimum => 7 }
has_many :messages, :dependent => :destroy
end
|
# encoding: UTF-8
module FreeImage
# Used to specify a color for a :rgbf
# {image type}[rdoc-ref:FreeImage.images_types].
class RGBF < FFI::Struct
layout :red, :float,
:green, :float,
:blue, :float
end
end |
require "grocery"
require "pg"
describe "Viewing items" do
describe '.all' do
it 'returns the list of items' do
groceries = Grocery.all
expect(groceries.first).to be_a Grocery
end
end
end
describe "Adding to cart" do
describe '.cart' do
it 'saves item to cart' do
... |
# encoding: utf-8
Puppet::Type.newtype(:snmp_contact) do
@doc = 'Set the SNMP contact name'
ensurable
newparam(:name, namevar: true) do
desc 'The name of the SNMP contact'
validate do |value|
if value.is_a? String then super(value)
else fail "value #{value.inspect} is invalid, must be a St... |
# include ApplicationHelper
# do login for admin panel and also verify if the site was created
# if site is not created, then create a new site
def init_site
before do
CamaleonCms::Site.delete_all
@site = create(:site).decorate
@post = @site.the_post('sample-post').decorate
end
after do
@site = ... |
#==============================================================================
# Instance Items Base [VXA]
# Version: 1.0.0
# Author: modern algebra (rmrk.net)
# Date: 26 December 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This script changes... |
module Charts
class QueryPerformerList
prepend SimpleCommand
def initialize(current_user, args = {})
@user = current_user
@args = args
end
def call
if @args[:order_type].nil? or @args[:order_type] == 'yield'
order = -1
if @args[:order].present? && @args[:order] == ... |
module OneDoc
class AdapterRegistry
attr_reader :registered_handlers
def initialize
@registered_handlers = []
end
def register(handler_class, &block)
@registered_handlers << [block, handler_class]
end
# TODO: refactor
def handlers_for(target)
handler = @registered_han... |
module EventDispatcher
def register_callback(event_name, object, options=nil)
@registration ||= {}
options ||= {}
options[:method_name] ||= "on_#{event_name}" unless options[:method_name]
@registration[event_name] = [] unless @registration[event_name]
@registration[event_name] << {:object => ob... |
class CreateDrivers < ActiveRecord::Migration[5.1]
def change
create_table :drivers do |t|
t.integer :usual_distance_per_day
t.integer :destination_type
t.references :user, foreign_key: true
t.text :description
t.string :bank_account
t.string :proof_of_address
t.string :p... |
# methods.rb
# Chapter 6 More About Methods - starts on page 30
# List 10 methods
# puts
# gets
# chomp
# to_i
# to_f
# to_s
# +
# -
# *
# /
# Methods are things that do stuff
# Just like every verb needs a noun, every method needs an object.
# for example
puts ('hello ' .+ 'world')
puts ((10 .* 9) .+ 9)
# Remember... |
require "application_system_test_case"
class OrdenesTest < ApplicationSystemTestCase
setup do
@ordene = ordenes(:one)
end
test "visiting the index" do
visit ordenes_url
assert_selector "h1", text: "Ordenes"
end
test "creating a Ordene" do
visit ordenes_url
click_on "New Ordene"
fil... |
# ================================================================================
# Part:
# Desc:
# Invoice
# ├── InvoiceItems
# │ ├── Contest
# │ │ ├── description
# │ │ ├── quantity
# │ │ ├── discount
# │ │ ├── tax
# │ │ └── amount
# │ ├── Task
# │ ├── Design
# │ └── etc.
# ├── sub_total
... |
class CommentSerializer < ActiveModel::Serializer
attributes :id, :comment, :photo_id, :username
def username
object.user.username
end
end
|
json.session do
json.partial! 'api/v1/sessions/show', session: @session
end
|
#!/usr/bin/env ruby
# A few helpful tips about the Rules file:
#
# * The order of rules is important: for each item, only the first matching
# rule is applied.
#
# * Item identifiers start and end with a slash (e.g. “/about/” for the file
# “content/about.html”). To select all children, grandchildren, … of an
# ... |
FactoryBot.define do
factory :item do
id {'1'}
name {"testitem"}
description {"hello world it is test"}
category
size
brand
condition
delivery_fee
shipping_method
ship_from_area
shipping_day
price {"5000"}
user
... |
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... |
module ROM
module Adapter
module Lint
# This is a simple lint-test for adapter's repository class to ensure the
# basic interfaces are in place
#
# @example
#
# class MyAdapterTest < Minitest::Test
# include ROM::Adapter::Lint::TestRepository
#
# def... |
require 'support/vcr'
VCRHelper.add_placeholder('<XERO_CONSUMER_KEY>')
VCRHelper.add_placeholder('<XERO_CONSUMER_SECRET>')
module XeroHelper
def with_xero_cassette(&block)
VCRHelper.placeholders['<XERO_CONSUMER_KEY>'] = xero_config[:consumer_key]
VCRHelper.placeholders['<XERO_CONSUMER_SECRET>'] = xero_conf... |
class AddPaymentProfileIdToSubscriptions < ActiveRecord::Migration
def up
add_column :subscriptions, :payment_profile_id, :integer
add_index :subscriptions, :payment_profile_id
Subscription.reset_column_information
# set all the subscription for staging
Subscription.find_each do |subscription|
... |
class CreateHistoryComments < ActiveRecord::Migration
def up
drop_table :list_of_comment if self.table_exists?("list_of_comment")
create_table :history_comments do |t|
t.references :social_network
t.integer :comment_id
t.date :start_date
t.date :end_date
t.text :content
t.... |
require 'spec_helper'
RSpec.describe Commands::ClearImage do
let(:size) { 2 }
let(:image) { instance_double("Image", row_size: size, column_size: size) }
let(:handler) { instance_double("ImageHandler", image: image) }
subject(:command) { described_class.new(handler) }
describe "#required_args" do
it "h... |
class WelcomeController < ApplicationController
def index
@name = "Makenzie"
end
end
|
# frozen_string_literal: true
require 'bcrypt'
class PersistentApiToken < ApiToken
MINIMUM_TOKEN_LENGTH = 64
scope :current, -> { where(expires_at: nil) }
def current?
expires_at.nil?
end
private
def set_expiration
self.expires_at = nil unless persisted?
end
def validate_expiration
true... |
class CarbsController < ApplicationController
before_action :set_carb, only: [:show, :edit, :update, :destroy]
before_filter :authenticate_user!
respond_to :html
def index
@carbs = Carb.where(:user_id => current_user.id).page(params[:page]).per(30)
#@carbs = Carb.all
respond_with(@carbs)
end
... |
module CDI
module V1
module ServiceConcerns
module EducationalInstitutionsParams
extend ActiveSupport::Concern
WHITELIST_ATTRIBUTES = [
:name,
:email,
:about,
:site,
:telephone,
:address
]
included do
de... |
module Ayi
class AbstractStrategy
def self.inherited(strategy)
StrategyManager.register(strategy)
end
def match_file_name?(filename)
false
end
def match_file?(filename)
match_file_name?(filename) || match_content_of_file?(filename)
end
def match_content_of_file?(filena... |
class Order < ApplicationRecord
# Relationships
belongs_to :user
has_and_belongs_to_many :products
end
|
require 'thread'
require 'sleepy_penguin'
require 'kaede/notifier'
require 'kaede/scheduler_service'
module Kaede
module Scheduler
extend self
def setup(db)
@db = db
prepare_events
$stdout.sync = true
$stderr.sync = true
@recorder_queue = Queue.new
@recorder_waiter = star... |
module TroleGroups::Api
module Core
# Access to the Troles operations API
# @return [Troles::Operations] the operations API object
def rolegroups
@rolegroups ||= TroleGroups::Operations.new(self)
end
# Sets the roles of the subject
# (see #set_roles)
def rolegroups= *new_rol... |
# coding: utf-8
require "uri"
require "net/https"
module Acacia
class HTTP
def initialize(options = {})
@options = options
end
def fetch_feed(url)
get_response(url)
end
private
def get_response(url)
uri = url.is_a?(URI) ? url : URI(url)
retries = 0
... |
class Api::FollowingsController < ApplicationController
before_action :authenticate_user!
def index
if current_user.type === 'Artist'
render :json => {
message: 'Artists cannot follow users --- yet!'
}
else
artists = current_user.followed_artists
artists = artists.map d... |
module SequelSpec
module Matchers
class Base
def initialize(attribute)
raise ArgumentError, "Attribute not specified" unless attribute
@attribute = attribute
@description = []
@options = {}
self
end
def matches?(subject)
@suffix = []
... |
class SitesController < ApplicationController
before_action :authenticate_user!
before_action :admin_only, except:[:show, :index]
def index
@site = Site.all.order('created_at asc')
end
def show
@site = Site.find(params[:id])
end
def edit
@site = Site.find(params[:id])
... |
class AddSlugIndexToWritings < ActiveRecord::Migration
add_index :writings, :slug
end
|
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... |
class User < ApplicationRecord
belongs_to :city
has_many :gossips
has_many :tags, through: :gossips
has_many :private_messages
has_many :join_pm_recipients
has_many :likes
has_many :gossips, through: :like
has_secure_password
validates :password, presence: true
validates :email, presence: true, uniqueness: ... |
#Santa class
class Santa
#getter code for age and ethnicity (allows for reading outside of the class)
attr_reader :ethnicity
#setter code for genger (allows for reading and writing outside of the class)
attr_accessor :gender, :age
# intialize Santa class
def initialize(gender, ethnicity)
puts "Initializing Sant... |
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe "Adminモデルに関するテスト", type: :model do
describe 'Admin情報を保存' do
it "有効な管理者情報が全て入力されている場合保存できるか" do
expect(FactoryBot.create(:admin)).to be_valid
end
end
context "バリデーションチェック" do
it "メールアドレスがなければ保存できない" do
expect(FactoryBot.bui... |
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'directors_database'
require "pry"
# Thought process: Goal- return Hash with name and gross movies value total.
#
# 1) Access loop for director names and reference inside of hash:
# director_totals = {director_name => container}
# at the end of the method.
#
# 2) S... |
class AddTranslatorToApplicationKeys < ActiveRecord::Migration
def change
add_column :tr8n_application_translation_keys, :translator_id, :integer
end
end
|
class User < ActiveRecord::Base
has_one :photo
has_secure_password
validates :name, presence: true
end
|
#--
# Copyright (c) 2013 Michael Berkovich, tr8nhub.com
#
# 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, mo... |
# frozen_string_literal: true
module BlogsHelper
def blog_exists?(blog)
return true unless blog.nil?
flash[:warning] = "Sorry! That blog doesn't exist"
redirect_to blogs_path
false
end
end
|
require "rails_helper"
RSpec.describe GovukDesignSystem::RadiosHelper, type: :helper do
describe "#govukRadios" do
it "returns the correct HTML when there is a hint" do
html = helper.govukRadios({
classes: "govuk-radios--inline",
idPrefix: "changed-name",
name: "changed-name",
... |
class Navbar
attr_accessor :style_map
attr_reader :options
def initialize(style_map, options)
@style_map = style_map
@options = options
end
def view
'Строка навигации'
end
def style
style_map.add(:reverse, options[:lines] - 1, [0, options[:columns] - 1])
style_map
end
def lines... |
# frozen_string_literal: true
module Api::V1::Subscriptions
class EstimateController < ::Api::V1::ApplicationController
def create
api_action do |m|
m.success do |result|
render json: result
end
end
end
end
end
|
require 'spec_helper'
describe Lolita::Configuration::Column do
let(:dbi){Lolita::DBI::Base.create(Post)}
let(:column){Lolita::Configuration::Column.new(dbi,:col1)}
let(:column_class){Lolita::Configuration::Column}
it "should create new column with Hash attributes" do
column=Lolita::Configuration::Co... |
require 'synchronisable/model/methods'
require 'synchronisable/model/scopes'
require 'synchronisable/synchronizers/synchronizer_default'
module Synchronisable
module Model
extend ActiveSupport::Concern
module ClassMethods
SYNCHRONIZER_SUFFIX = 'Synchronizer'
# Declare this on your model class t... |
class ChangeFieldsInOrder < ActiveRecord::Migration[5.1]
def change
rename_column :orders, :stripeid, :stripe_customer_id
add_column :orders, :stripe_charge_id, :int
end
end |
require File.dirname(__FILE__) + '/../test_helper'
class PrimeraManosControllerTest < ActionController::TestCase
def test_should_get_index
get :index
assert_response :success
assert_not_nil assigns(:primera_manos)
end
def test_should_get_new
get :new
assert_response :success
end
def tes... |
class Person < ActiveRecord::Base
include Auditable
attr_accessible :firstname, :lastname, :position, :birth_date, :nationality, :birth_city, :birth_nation, :name, :fields, :height_feet, :height_inches, :height_meters, :height, :avatar, :avatar_delete
attr_accessor :height_feet, :height_inches, :height_meters
... |
class Schedule < ApplicationRecord
include HTTParty
has_many :schedule_labs
has_many :schedule_activities
has_many :activities, through: :schedule_activities
has_many :labs, through: :schedule_labs
has_many :objectives, dependent: :destroy
has_many :calendar_events
has_many :blog_assignments
belongs_t... |
class V1::Users < V1::BaseAPI
format :json
resource :users, desc: 'ユーザリソース' do
desc '一覧取得', {
headers: AUTH_HEADER_DESCRIPTION,
detail: <<-NOTE
詳細では **MarkDown形式** での記述が可能。
## 見出し
* 箇条書き
* その1-1
* 説明その2
* 説明その3
```ruby
['aa', 'bb'].each do |v|
puts "this is a test code \#{v}"
end
```
N... |
Rails.application.routes.draw do
get '/activation/:token', to: 'users#account_activation', as: 'account_activation'
get '/password_reset/:token', to: 'password_resets#new', as: 'reset_password'
get '/merchant', to: 'merchant/coupons#new'
post "/subscribe" => "subscriptions#create"
resource :password_reset, ... |
class ChangeTypeColumnTransactions < ActiveRecord::Migration
def change
remove_column :transactions, :type_t, :boolean
add_column :transactions, :type_t, :integer
end
end
|
class AddWantToPayToUsers < ActiveRecord::Migration
def change
add_column :users, :space_needed, 'int unsigned', :after => :aws_vault_id
add_column :users, :will_pay, 'int unsigned', :after => :aws_vault_id
end
end
|
require_relative '../feature_helper'
feature 'User can sign out', %q(
In order to protect my privacy
As a user
I want be able to sign out
) do
given(:user) { create :user }
scenario 'Logged in user signs out' do
sign_in(user)
click_on 'Sign out'
expect(page).to have_content 'Signed out succes... |
require 'rails_helper'
describe 'Following', type: :feature do
it 'can follow a user by visiting their profile' do
user = User.create(first_name: "Nando", last_name: "Hasselhoff", email: "nando@example.com", password: "walrus123")
register_a_user("jshmoe@example.com", "Joe", "Shmoe")
visit profile_path(... |
#define cheese_and_crackers function, allow two arguments to be passed in
def cheese_and_crackers(cheese_count, boxes_of_crackers)
#print text with one argument passed in
puts "You have #{cheese_count} cheeses!"
#print text with one argument passed in
puts "You have #{boxes_of_crackers} boxes of crackers!"
#p... |
module RabbitJobs
# Scheduler daemon.
class Scheduler
include MainLoop
attr_reader :schedule, :process_name
attr_writer :process_name
def schedule=(value)
@schedule = HashWithIndifferentAccess.new(value)
end
# Pulls the schedule from Resque.schedule and loads it into the
# rufus... |
module ActiverecordConsistencyOfConstraints
module Constraints
module Validators
class BaseValidator
attr_reader :validator
def new(validator)
@validator = validator
end
def generate_indexes
raise NotImplementedError, 'Should be overided in children'
... |
module JobGet
class Stat < Sequel::Model
set_schema do
primary_key :id
time :created_at
varchar :ip
varchar :referrer
foreign_key :search_stat_id
foreign_key :job_view_stat_id
end
before_create do
self.created_at = Time.now
end
create_table unless tabl... |
class EventsController < ApplicationController
before_action :set_event, only: [:show, :edit, :update, :destroy]
before_action :set_filters, only: [:index, :search]
# GET /events
# GET /events.json
def index
@events = Event.all
@cities = City.all
@themes = Theme.all
end
# GET /events/1
# G... |
class UsersController < ApplicationController
def index
@title = "The Cast"
@users = User.all
end
end
|
class PostSerializer < ActiveModel::Serializer
attributes :id, :image_url, :caption, :most_recent_likes, :like_count, :created_at, :liked_by_current_user, :author
def author
{
id: object.user.id,
username: object.user.username,
followed_by_current_user: object.user.followed_by?(scope[:current... |
class CreateApplicantPreviousDatas < ActiveRecord::Migration
def self.up
create_table :applicant_previous_datas do |t|
t.integer :school_id
t.references :applicant
t.string :last_attended_school
t.string :qualifying_exam
t.string :qualifying_exam_year
t.string :qualifying_exam_... |
module SQLiterate
module Node
module PositionalParam
def value
[:p, digits.value]
end
end
module NumericLiteral
def value
decimal_literal.value * (10 ** exponent_literal.value)
end
end
module DecimalLiteral
def value
text_value.to_f
end... |
# -*- mode: ruby -*-
# vi: set ft=ruby :
############################ PROJECT CONFIGURATION ############################
VAGRANT_HOSTNAME = ENV["VAGRANT_HOSTNAME"] || "project"
VAGRANT_RAM_MB = ENV["VAGRANT_RAM_MB"] || "1024"
########################## END PROJECT CONFIGURATION ##########################
# Vagrantf... |
require 'fileutils'
require 'bdb'
class Noid
attr_reader :noid_id
def initialize( options )
@noid_id = options[:noid_id]
@noid_dir = options[:noid_dir]
@noid_cmd = options[:noid_cmd]
begin
FileUtils::chdir @noid_dir
rescue Exception => err_msg
# XXX do something appropriate here
... |
class Tag < ApplicationRecord
has_many :book_tags, foreign_key: 'tag_id', dependent: :destroy
has_many :books, through: :book_tags
end
|
name 'salt'
maintainer 'Daryl Robbins'
maintainer_email 'daryl@robbins.name'
license 'Apache 2.0'
description 'Installs and configures Salt'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.2.1'
recipe 'salt::master', 'Installs and conf... |
require_relative 'map_formulae_to_c'
class CompileToC
attr_accessor :settable
attr_accessor :gettable
attr_accessor :worksheet
attr_accessor :variable_set_counter
def self.rewrite(*args)
self.new.rewrite(*args)
end
def rewrite(input,sheet_names_file,output)
self.settable ||= lambda { |re... |
=begin
(Problem):
Write a program that will ask a user for an input of a word or multiple words and give back the number of characters.
Spaces should not be counted as a character.
(Understand the Problem):
• (Inputs): String from user (word or words)
• (Outputs): String (counting how many characters are included i... |
class ProgramToActionRenaming < ActiveRecord::Migration
def change
drop_table :program_parameters
rename_table :programs, :actions
end
end
|
# Write a method that takes an integer, and converts it to a string representation.
# You may not use any of the standard conversion methods available in Ruby, such as
# Integer#to_s, String(), Kernel#format, etc. You may, however, use integer_to_string from
# the previous exercise.
DIGITS = %w(0 1 2 3 4 5 6 7 8 ... |
class AddRoomLocationToSections < ActiveRecord::Migration
def change
add_column :sections, :location, :string
add_column :sections, :room, :string
end
end
|
class CreateSales < ActiveRecord::Migration[6.0]
def change
create_table :sales do |t|
t.numeric :quantity, null: false
t.references :merchant, null: false, foreign_key: true
t.references :product, null: false, foreign_key: true
t.references :customer, null: false, foreign_key: true
... |
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe TwitterDownloader do
describe "tweet processing" do
before(:all) do
@status = TwitterDownloader.parse(OpenStruct.new({:text=>"@kuwest ate three tacos", :from_user=>"ignu"}))
end
it "should ignore the username" do
... |
class AddResultDistanceToSearch < ActiveRecord::Migration[5.0]
def change
add_column :searches, :result_distance, :float
end
end
|
# reload!; Statistics::Context.new(context_id: Context.first.id, start: DateTime.now.beginning_of_day, finish: DateTime.now.end_of_day).save_statistics
module Statistics
class EntryStatistics < RecursiveOpenStruct
def initialize(entry)
@entry = entry
super
end
end
class EntryCollectionStatis... |
class IndustriesController < ApplicationController
before_action :only_admin
before_action :set_industry, only: [:delete_industry]
before_action :set_slug, only: [:edit, :update]
layout "account"
def new
@industry = Industry.new
@industries = Industry.all.order("created_at desc")
end
def crea... |
Rails.application.routes.draw do
resources :projects
resources :messages, only: [:new,:create,:index]
devise_for :users, path: '', path_names: { sign_in: 'login', sign_out: 'logout'}
get 'about', to: "static_pages#about"
get 'contact', to:"static_pages#contact"
get "/login" => "devise/sessions#new"
root t... |
Gem::Specification.new do |s|
s.name = 'cyclid-bundler-plugin'
s.version = '0.1.0'
s.licenses = ['Apache-2.0']
s.summary = 'Cyclid bundler plugin'
s.description = 'Run commands in Cyclid under "bundle exec"'
s.authors = ['Kristian Van Der Vliet']
s.homepage = 'https://cyclid.io'
... |
module Egauge
class Client
def initialize
fail 'Egauge.configuration.url not specified' if Egauge.configuration.url.nil?
@conn = Faraday.new(url: Egauge.configuration.url) do |faraday|
faraday.response :xml, headers: true
faraday.adapter Faraday.default_adapter
faraday.option... |
# frozen_string_literal: true
require 'json'
require 'bolt/util'
module Bolt
module PuppetDB
class Config
if !ENV['HOME'].nil?
DEFAULT_TOKEN = File.expand_path('~/.puppetlabs/token')
DEFAULT_CONFIG = { user: File.expand_path('~/.puppetlabs/client-tools/puppetdb.conf'),
... |
# reopen String class to add #unindent for heredocs
# see http://stackoverflow.com/a/3772911/2388971
class String
def unindent
gsub(/^#{scan(/^\s*/).min_by{|l|l.length}}/, "")
end
end
# helper methods
module Helpers
def write_config(dir, content)
File.write "#{dir}/Vagrantfile", content
end
def v... |
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel... |
unit_tests do
test "should respond to get_pull_request_by_id" do
default_vcr_state do
assert PRW.respond_to?(:get_pull_request_by_id)
end
end
test "should respond to get_reviews_by_pr_id" do
default_vcr_state do
assert PRW.respond_to?(:get_reviews_by_pr_id)
end
end
test "should... |
require "workling/remote/runners/not_remote_runner"
require "workling/remote/runners/spawn_runner"
require "workling/remote/runners/starling_runner"
require "workling/remote/runners/backgroundjob_runner"
require 'digest/md5'
#
# Scoping Module for Runners.
#
module Workling
module Remote
# set the desire... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.