text
stringlengths
10
2.61M
class User < ApplicationRecord has_many :lessons_for_teacher,class_name:"Lesson",foreign_key:"user_id" has_many :questions has_many :registrations has_many :courses, through: :registrations has_many :metoos has_many :agoods has_many :cgoods has_many :lessons, through: :registrations, through: :courses ...
class Recipe < ApplicationRecord extend ActiveHash::Associations::ActiveRecordExtensions belongs_to :user belongs_to :category belongs_to :time_required has_many_attached :images validates :title, presence: true validates :text, presence: true validates :category_id, numericality: { other_than: 0 } v...
class HomeController < ApplicationController def welcome @recipe = Recipe.order("RAND()").first end end
# -*- encoding : utf-8 -*- require 'spec_helper' describe Banner do let(:block) { FactoryGirl.create(:block) } let(:banner) { FactoryGirl.create(:banner) } let(:banner_with_url) { FactoryGirl.create(:banner, :with_url, block: block) } let(:block_banners) { FactoryGirl.create_list(:banner, 3, block: block) } ...
class ChangeColumnAuthorizedToStatusInFriendship < ActiveRecord::Migration def self.up add_column :friendships, :status, :string, :default => "pending" remove_column :friendships, :authorized end def self.down add_column :friendships, :authorized, :boolean, :default => false remove_column :friend...
require 'xmlrpc/client' module RestoreAgent::XMLRPC class Client < ::XMLRPC::Client def do_rpc(request, async=false) header = { "User-Agent" => USER_AGENT, "Content-Type" => "text/xml; charset=utf-8", "Content-Length" => request.size.to_s, "Connection" => (asyn...
# @param {Integer[]} nums # @return {Integer} def maximum_gap(nums) if nums.length < 2 0 else a = nums.sort max_diff = (a[0] - a[1]).abs (1..(a.length - 1)).each do |i| d = (a[i] - a[i-1]).abs max_diff = d > max_diff ? d : max_diff end ...
require 'optparse' module RemoteProc class CLI def self.parse_options(argv=ARGV) opts = {} @parser = OptionParser.new do |o| o.on '-c', '--concurrency CONCURRENCY', 'processor threads to use' do |arg| opts[:concurrency] = Integer(arg) end o.on '-t', '--timeout TIME...
class DockerMachine < FPM::Cookery::Recipe description 'Machine management for a container-centric world' homepage 'https://docs.docker.com/machine/' name 'docker-machine' version '0.16.2' revision '1' source "https://github.com/docker/machine/releases/download/v#{version}/docker-machine-Linux-x86_64" ...
# -*- coding: utf-8 -*- FactoryBot.define do factory :project do sequence(:project_name) { |n| "pn#{n}_#{Time.now.to_i}" } # project_name Faker::TwinPeaks.unique.location project_title 'MyStringAloneIsNotLongEnough' project_description 'MyString' rfa_url 'http://www.northwestern.edu' associati...
Pod::Spec.new do |s| s.name = 'CiteprocRsKit' s.version = '0.0.1' s.summary = 'citeproc-rs bindings for Swift' s.description = <<-DESC citeproc-rs bindings for Swift DESC s.homepage = 'https://github.com/zotero/citeproc-rs' ...
require 'listen' require 'rspec_runner/configuration' module RspecRunner class Watcher class << self def start(&block) if @thread then raise RuntimeError, "already started" end @thread = Thread.new do config = RspecRunner.configuration @listener = List...
require "sartre/version" module Sartre protected def existential?(name) name =~ /\?\Z/ end def try?(name) !!send(name) end end class Object include Sartre def method_missing name, *arguments super unless existential? name method = name[0..-2] return false unless respond_to? met...
module PivotalToPdf module Formatters class Base attr_reader :stories private :stories def initialize(stories) @stories = stories p stories.size end end end end
# frozen_string_literal: true require 'sinatra/base' # http://www.omdbapi.com class FakeOMDB < Sinatra::Base get '/' do json_response 200, 'movie.json' end private def json_response(response_code, file_name) content_type :json status response_code File.open("#{File.dirname(__FILE__)}/api/omd...
class Block < ActiveRecord::Base attr_accessible :blocked_id, :blocker_id belongs_to :blocker, class_name: "User" belongs_to :blocked, class_name: "User" end
class TestScore < ActiveRecord::Base belongs_to :test belongs_to :user belongs_to :contact def self.grade_test user_id, test, answers, contact_id = nil if answers.uniq.count == test.questions.count and validate_answers(answers, test) if user_id user = User.find(user_id) if test....
# @author Marek Czuma <marek.czuma@gmail.com> class Statistics # SKILL # Give hash {Day: hour} for specific skill by rate # @param skill_id [Integer] # @param from [Date] # @param to [Date] # @return hash {Day: hour} def self.skill_single_hours (user, skill_id, from, to) skill = user.skills.find(sk...
class Api::V1::PartsController < ApplicationController before_action :find_part, only: [:update] before_action :authorized, only: [:create, :update] def index @parts = Part.all render json: @parts end def create @part = Part.create(part_params) render json: @part...
step "I go to the next page" do page.find('.pagination li.next a').click end
# == Schema Information # # Table name: frames # # id :integer not null, primary key # game_id :integer # score :integer default(0) # ball_position :integer default(1), not null # special_score :integer default("regular"), not null # created_at :date...
require 'rails_helper' feature 'Edit blog post', vcr: true, js: true, record: :new_episodes do let!(:post) { create(:post) } before do login_admin visit edit_post_path(post) end context '(when attributes are invalid)' do scenario 're-renders the edit post form' do fill_in 'post[title]', wit...
# -*- encoding : utf-8 -*- class CreateGroups < ActiveRecord::Migration def change create_table :groups do |t| t.string :uuid, limit: 36, null: false t.references :course, null: false t.string :name, limit: 191 t.integer :holes_count, default: 0, null: false t.timestamps null: false ...
class RelationshipsController < ApplicationController include ActionController::Live def create @user = User.find(params[:relationship][:followed_id]) current_user.follow!(@user) redirect_to @user end def destroy @user = Relationship.find(params[:id]).followed current_user.unfollow!(@user)...
require 'spec_helper' describe PaypalDetail do it "has a valid factory" do @user = FactoryGirl.create(:user) FactoryGirl.create(:paypal_detail, user_id: @user.id).should be_valid end it "is invalid without a email" do FactoryGirl.build(:paypal_detail, email: nil).should_not be_valid end it...
module Api module V1 class BaseApiController < ApplicationController before_filter :parse_request, :authenticate_user_from_token! rescue_from ActiveRecord::RecordNotFound, with: :record_not_found private def record_not_found format_json_output(nil, status: 'exception', message:...
# Copyright (C) 2011 Marco Mornati (<ilmorna@gmail.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be ...
class ChangeNewMembersSignOnsToNewMobilizerSignOns < ActiveRecord::Migration[6.0] def change rename_column :growth_activities, :new_members_sign_ons, :new_mobilizer_sign_ons end end
module Platforms module Yammer module Api # Open Graph Objects in Yammer # # This is read-only through the API. # # @author Benjamin Elias # @since 0.1.0 class OpenGraphObjects < Base # Get open graph obects # URL is actually a required parameter so requi...
#!/usr/bin/env ruby require 'webrick' require 'open3' $AUTH_TOKEN = ENV["NCLIP_AUTH_TOKEN"] || "my-token" $PORT = 2547 puts "NCLIP server starting at http://127.0.0.1:#{$PORT}" puts puts "Using '#{$AUTH_TOKEN}' as the authorization token." puts class OSXClipboard def self.paste() `pbpaste` end def self.co...
# frozen_string_literal: true class ApplicationController < ActionController::Base protect_from_forgery with: :exception before_action :set_locale def after_sign_in_path_for(resource) sign_in_url = new_user_session_url if request.referer == sign_in_url && resource.admin? admin_welcome_path els...
module Sentry module Rails module Tracing class AbstractSubscriber class << self def subscribe! raise NotImplementedError end def unsubscribe! self::EVENT_NAMES.each do |name| ActiveSupport::Notifications.unsubscribe(name) ...
class AddPasswordDigestToUsers < ActiveRecord::Migration def up remove_column "users", "password" add_column "users", "password_digest", :string end def down add_column "users", "password" remove_column "users", "password_digest" end end
require 'rails_helper' RSpec.describe 'AdminSessionsController', type: :request do before do Admin.create(email: 'a@email.com', password: '1234567', password_confirmation: '1234567') end describe 'GET /admin_sessions' do it 'sign in admin' do get admins_sign_in_path expect(response).to have_...
require "rails_helper" RSpec.describe UpdateContact do describe "#call" do it "updates a contact if the number is not provided" do contact = create(:contact) params = { first_name: "John", } result = described_class.new(contact: contact, params: params).call expect(result....
module AuthenticateHelper def authenticate_user email = JsonWebTokenService.decode(request.headers['HTTP_AUTH_TOKEN'])["email"] @current_user = User.find_by(email: email) render json: { error: 'Not Authorized' }, status: 401 unless @current_user end def user_sign_in? !!current_user end ...
class Admin::ReportTypesController < ApplicationController before_action :require_report_admin before_action :set_report_type, only: [:show, :edit, :update, :destroy] # GET /admin/report_types def index @report_types = ReportType.all end # GET /admin/report_types/1 def show end # GET /admin/rep...
class CompetitorSetsController < ApplicationController before_filter :authorize, only: [:new, :create] before_filter :find_competitor_set, only: [:show, :edit, :update] before_filter :check_owner, only: [:edit, :update] def new @cset = current_user.competitor_sets.new end def create @cset = curren...
require "rails_helper" RSpec.describe TokenAuthentication do it "returns the authenticated user with a valid token" do user = create(:user) token_body = token_string(user) auth = described_class.new(token_body) authenticated_user = auth.authenticate expect(authenticated_user).to eq(user) end ...
module ApplicationHelper def car_identity(request) (request.car.vin + " " + request.car.frame + " " + request.car.marka + " " + request.car.model + " " + request.car.god).strip end def days_decorator value html_escape("#{((value = value.to_i) > 0) ? value : '*'}") + "&nbsp;дн.".html_safe end de...
# frozen_string_literal: true # creates habits records table class CreateHabitRecords < ActiveRecord::Migration[5.0] def change create_table :habit_records do |t| t.string :tz t.datetime :completed_at t.timestamps t.references :habit, index: true end end end
class AddBreadsPerWeekAndPhoneToUsers < ActiveRecord::Migration[6.0] def change add_column :users, :breads_per_week, :decimal, null: false, default: 1 add_column :users, :phone, :string end end
require 'csv2hash/version' require 'csv2hash/definition' require 'csv2hash/validator' require 'csv2hash/validator/mapping' require 'csv2hash/validator/collection' require 'csv2hash/parser' require 'csv2hash/parser/mapping' require 'csv2hash/parser/collection' require 'csv2hash/csv_array' require 'csv2hash/data_wrapper'...
require 'rexml/document' require 'rexml/element' require 'dbi' require 'csv' require_relative 'frs_schema_utils' def makePKCol( name ) column = REXML::Element.new( "column" ) column.add_attribute( 'primaryKey', 'true' ); column.add_attribute( 'default', 0 ); column.add_attribute( 'type'...
##################################################################### # tc_library.rb # # Test case for the Windows::Library module. ##################################################################### base = File.basename(Dir.pwd) if base == 'test' || base =~ /windows-pr/ Dir.chdir '..' if base == 'test' ...
class Move < ApplicationRecord belongs_to :game belongs_to :user validates :move, presence: true, uniqueness: { alert: "to me, it seems to be taken..." } end
# Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do factory :page do sequence(:slug) { |n| "page_#{n}" } template "Article" metadata_id 1 end end
require 'test_helper' class RecipesControllerTest < ActionDispatch::IntegrationTest setup do @author = Author.create(name: "someone") @r1 = Recipe.create(name: 'Lasagne Végétarienne', ingredients: 'Champignon pate', author: @author) @r2 = Recipe.create(name: 'Lasagne', ingredients...
require 'rails_helper' RSpec.describe Rep, type: :model do # relations it { should belong_to(:exercise)} # validations it { should validate_presence_of(:dt) } it { should validate_presence_of(:qty) } it { should validate_numericality_of(:qty).is_greater_than(0) } it { should validate_numericality_of(:...
class Api::ThemesController < ApplicationController skip_before_action :verify_authenticity_token def index render( status: 200, json: {themes: Theme.all}.to_json ) end def show render( status: 200, json: {theme: Theme.find(params[:id])}.to_json ) end def create theme = Theme.new(theme_params...
require_relative 'base_email' class ResetPasswordEmail < BaseEmail subject 'Your :app_host password has been reset.' add_anchor 'Forgot your password? Oops.' add_anchor "No biggie - we're giving you a new one, so you can log in and get back to shopping." add_anchor "After all, it's not like you forgot Mother's...
# Piece is an abstruct class class Piece attr_reader :color, :board attr_accessor :pos def initialize(color, board, pos) @color, @board, @pos = color, board, pos end # def pos=(val) # board[pos] = val # end def to_s "#{symbol}" end def ...
class HomeController < ApplicationController expose(:images) { find_images } private def find_images relation = Image.includes(:gallery) if tag = params[:tag] relation.tagged_with([tag], any: true) elsif word = params[:search] relation.where('title ILIKE ?', "%#{word}%") else ...
require 'rails_helper' describe Cardset do let(:cardset) { create(:cardset) } subject { cardset } it { should respond_to(:topic) } it { should respond_to(:description) } it { should respond_to(:author_id) } it { should respond_to(:cards) } it { should be_valid } describe "without author_id" do ...
class CreateGoals < ActiveRecord::Migration def change create_table :goals do |t| t.timestamp :scored_at t.references :game, index: true t.references :team, index: true t.references :position, index: true t.references :player, index: true t.timestamps end end end
class CreateCustomerCards < ActiveRecord::Migration def up create_table :customer_cards do |t| t.column :number,:string t.column :firstname,:string t.column :middlename,:string t.column :lastname,:string t.column :contact,:string t.column :email,:string t.column :birthday...
class ComponentDashboard < ApplicationRecord belongs_to :dashboard belongs_to :component end
# frozen_string_literal: true namespace :load do desc "Load the moves from the IMDB top 1000 list" task imdb_top_1000: :environment do ImdbParser.load_list(url: ImdbParser::TOP_1000_LIST_URL) end end
require '/Users/sai/Documents/ada/cs_fun/stacks-queues/lib/Queue.rb' require '/Users/sai/Documents/ada/cs_fun/stacks-queues/lib/Stack.rb' class JobSimulation attr_reader :workers, :waiting, :roll def initialize jobs_available, job_seekers @waiting = Queue.new job_seekers.times do |seeker| @waiting.e...
# encoding: utf-8 require 'spec_helper' describe SimpleSpreadsheet do let(:xls_file) { File.expand_path '../fixtures/file.xlsx', __FILE__ } let(:file_path) { Pathname.new xls_file } it 'allows pathnames as filename argument without raising exception' do expect { SimpleSpreadsheet::Workbook.read(file_path) ...
class FplTeamListsController < ApplicationController before_action :authenticate_user! skip_before_action :verify_authenticity_token before_action :set_fpl_team_list, only: [:show, :update] before_action :set_fpl_team, only: [:index, :show, :update] respond_to :json # GET /fpl_teams/1/fpl_team_lists # GE...
require_relative 'worker_thread' class Channel MAX_REQUEST = 100 attr_reader :workers def initialize(number_of_workers) @queue = Array.new(MAX_REQUEST) @head = 0 @tail = 0 @count = 0 @mutex = Thread::Mutex.new @full_cond = Thread::ConditionVariable.new @empty_cond = Thread::Condit...
module VraptorScaffold module Runner class Start def run(args) validate Kernel.system("ant vraptor-scanning") Kernel.system("sh $APPENGINE_SDK_HOME/bin/dev_appserver.sh #{Configuration::WEB_APP}") end private def validate unless File.exist?("src") ...
class RemoveAttributefromVideo < ActiveRecord::Migration[5.1] def change remove_column :videos, :video_image add_attachment :videos, :image end end
module Api class SessionController < ApplicationApiController def create valid, obj = User.signIn session_params if valid render json: obj, status: :ok else render :json => { :mssg => 'There was an error signing in' }, status: :unprocessable_entity end end def session_params params.req...
require 'spec_helper' describe Sprawl do it 'has a version number' do expect(Sprawl::VERSION).not_to be nil end end
require 'spec_helper' describe Subscription do before do @subscription = Factory(:subscription) end it { should belong_to(:user) } it { should belong_to(:topic) } it { should validate_presence_of(:topic_id) } it { should validate_presence_of(:user_id) } it { should validate_uniqueness_of(:topic_id)...
When(/^Estar logado na aplicação e ter acesso a funcionalidade de incluir Leads$/) do visit 'https://app-staging.rdstation.com.br/login' #Informar os dados de acesso. fill_in 'user_email', with: 'marciosacco@gmail.com' fill_in 'user_password', with: 'Asdf0147*' #Clicar no botão de entrar usando o...
require './quicksort_op4.rb' require 'benchmark' LISTS = [ [100], (1..100_000).to_a.shuffle, (1..100_000).to_a, (1..100_000).to_a.reverse, 100_000.times.collect{rand(10)} | 100_000.times.collect{rand(1_000_000)}, (1..100_000).to_a.zip(100_001..200_000).flatten, ...
require './base.rb' class Q6::Method < Base def self.execute puts "「y」 キーを押してスロットマシーンを回してください!" begin input_key = gets.chomp unless input_key == "y" raise end rescue puts "「y」キーを押してください" retry end numbers = [1, 3, 5, 7] number = numbers.sample nu...
class CreatePushNotifications < ActiveRecord::Migration def change create_table :push_notifications do |t| t.integer :push_notifiable_id, index: true t.string :push_notifiable_type, index: true t.text :message t.timestamps end end end
# -*- coding: utf-8 -*- # Module for FileDocument models module FileDocumentsHelper def link_to_file(id = '', link_text = 'File', file_type = 'document', mouse_over = nil, is_required = false, required_path = nil, lookup_file_type = true) if id.blank? || (id.to_i < 1) if is_required.blank? || is_required ...
# frozen_string_literal: true # game of life v 0.0001 # x - 1, y - 1 | x, y - 1 | x + 1, y - 1 # x - 1, y | x, y | x + 1, y # x - 1, y + 1 | x, y + 1 | x + 1, y + 1 # class Cell class Cell def initialize @live = [true, false].sample # [' ', '*'].sample end def alive? @live end def dead?...
class ProfileSkill < ApplicationRecord belongs_to :profile belongs_to :skill #validtaion validates_presence_of :profile, :skill, :level end
module Testy class Runnable def register(klass) @runnable_list ||= [] @runnable_list << klass end def run(reporter) @runnable_list.each { |klass| klass.run reporter } end end end
# Return Value of break # In the previous exercise, you learned that the while loop returns nil unless break is used. Locate the documentation for break, and determine what value break sets the return value to for the while loop. # The documentation does not spell out a return value for break when it is not supplied ...
# encoding: utf-8 # vim: ft=ruby expandtab shiftwidth=2 tabstop=2 require 'shellwords' # node.set_unless[:wpcli][:dbpassword] = secure_password execute "mysql-install-wp-privileges" do command "/usr/bin/mysql -u root -p\"#{node[:mysql][:server_root_password]}\" < #{node[:mysql][:conf_dir]}/wp-grants.sql" action ...
class Entry < ApplicationRecord belongs_to :day, optional: true attr_accessor :user scope :archived, -> { where.not(:archived_at => nil) } scope :not_archived, -> { where(:archived_at => nil) } def archive self.archived_at = DateTime.now self.save end def unarchive self.archived_at = nil ...
class Api::V2::NoticesController < ApplicationController before_action :set_notice, only: [:show, :edit, :update, :destroy] def allNotices @campus_id = params[:campus_id] if @campus_id == nil @notices = Notice.where("date >= ?", (Time.now - 3.day).to_i) else @notices = Notice.where("cam...
module MLP class MLP def initialize(opts) # default initial weight is random, but # if someone wants to be fancy and pass in some # parameters we will let them. opts[:initial_weight] ||= Proc.new { |a, b, c| rand } opts[:learning_rate] ||= 0.1 opts[:structure] ||= [2, 2, 2] ...
class RemoveGroupColumnFromPests < ActiveRecord::Migration[5.1] def change remove_column :pests, :group, :string end end
component 'repo_definition' do |pkg, settings, platform| pkg.version '2018.3.22' if platform.is_deb? pkg.url "file://files/#{settings[:target_repo]}.list.txt" pkg.install_configfile "#{settings[:target_repo]}.list.txt", "/etc/apt/sources.list.d/#{settings[:target_repo]}.list" pkg.install do "sed ...
require 'spec_helper' describe Workfile do describe "validations" do context "file name with valid characters" do it "is valid" do workfile = Workfile.new :file_name => 'work_(-file).sql' workfile.should be_valid end end context "file name with question mark" do it "is...
require 'spec_helper' class TestLogger def self.log(msg);"info: #{msg}";end def self.err_log(msg);"err: #{msg}";end end describe SiteMapper::Logger do before(:all) { SiteMapper::Logger.use_logger(TestLogger) } let(:logger) { SiteMapper::Logger } let(:system_logger) { SiteMapper::Logger::Syste...
class AddStartTimeAndDurationToContest < ActiveRecord::Migration def change add_column :contests, :start_time, :integer add_column :contests, :duration_in_minutes, :integer end end
class AddModelTypeToUserSettings < ActiveRecord::Migration def change add_column :user_settings, :model_type, :string end def down remove_column :user_settings, :model_type end end
class ImageUploader < CartoAssetsUploader include CarrierWave::RMagick # Extensions White List def extensions_white_list %w(gif jpeg jpg png) end version :full do process :store_dimensions end version :xx_large do process :crop resize_to_limit 1600, nil end version :x_large do ...
def map(source_array) new_array = [] source_array.length.times do |index| new_array.push(yield(source_array[index])) #take the element at whatever index we're at and yield it to a block of code passed in when the method is called. Then we'll push that manipulated variable into our new array. end return ...
require "capybara" require "capybara/rspec" require "selenium-webdriver" RSpec.configure do |config| config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = true end config.mock_with :rspec do |mocks| mocks.verify_partial_doubles = true end co...
# -*- encoding : utf-8 -*- class BellsController < InheritedResources::Base # GET /bells # GET /bells.json #has_scope :search , :only => [:index] ,:type => :hash, :default => {:zone=>"zh"} def index @bells = Bell.search(params[:search]||{}).page(params[:page]).per(params[:per]||3) respond_to do |format...
require File.expand_path('../helper', __FILE__) class AndPredicateTest < Test::Unit::TestCase def test_terminal? rule = AndPredicate.new assert_equal(false, rule.terminal?) end def test_match rule = AndPredicate.new('a') match = rule.match(input('b')) assert_equal(nil, match) match = ...
require 'spec_helper' describe "numeric_extensions" do describe "elapsed_time" do it "should convert 0 seconds to '00:00:00'" do 0.elapsed_time_s.should == '00:00:00' end it "should convert 59 seconds to '00:00:59'" do 59.elapsed_time_s.should == '00:00:59' end it "should convert 60...
class Search attr_accessor :keyword, :topic, :podcasts def initialize(keyword) @keyword = keyword end def podcasts if topic.podcasts.any? topic.podcasts else Api.new(keyword).load end end private def topic @topic = Topic.find_or_create_by(name: keyword) end end
class Notification < ActiveRecord::Base attr_accessible :user_id, :event_id, :committed belongs_to :user belongs_to :event validates_presence_of :user_id, :event_id validates_inclusion_of :committed, :in => [0, 1] validates_uniqueness_of :user_id, :scope => :event_id end
class Netmask < ActiveRecord::Base belongs_to :server validates_presence_of :netmask_ip end
FactoryGirl.define do factory :proposal do name "redesign" user_name "Joe" send_date "2014-01-01" client after(:create) do |proposal| create_list(:proposal_section, 4, proposal: proposal) end end factory :client do name "Doe" company "Apple" website "http://www.apple.c...
# The VideoFile model has a class attribute that holds a VLC::LibVLC # instance which is slow to initialize (see the vlcrb gem). Referencing # the model here forces the class to be auto-loaded up front. That way # the cost is incurred now rather than later while the app is in use. VideoFile
# encoding: utf-8 # # = Resent-From Field # # The Resent-From field inherits resent-from StructuredField and handles the Resent-From: header # field in the email. # # Sending resent_from to a mail message will instantiate a Mail::Field object that # has a ResentFromField as its field type. This includes all Mail::C...
require 'pry' class Queens def initialize input={white: [0, 3], black: [7, 3]} raise ArgumentError.new if input[:white] == input[:black] @info = input end def to_s string = '' for y in 0..7 for x in 0..7 if @info[:white] == [y, x] string += 'W ' elsif @info[:blac...
package "redis-server" template '/etc/redis/redis.conf' do owner 'root' group 'root' mode '0644' source 'redis-conf.erb' notifies :reload, "service[redis-server]" end service "redis-server" do supports :start => true, :stop => true, :restart => true, :reload => true action [:enable, :star...