text
stringlengths
10
2.61M
class Loan < ActiveRecord::Base attr_accessible :amount_due_in_btc, :amount_repaid_in_btc, :award_pdf, :borrower_id, :date_started, :days_late, :interest_in_percent, :loan_amount_in_btc, ...
class InvoiceMilestone < ActiveRecord::Base belongs_to :invoice_schedule belongs_to :invoice validates :estimate_percentage, :numericality => {:only_integer => true, :greater_than_or_equal_to => 0, :less_than_or_equal_to => 100} end
ActiveAdmin.register Evenement do config.per_page = 10 # See permitted parameters documentation: # https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters # # Uncomment all parameters which should be permitted for assignment # # permit_params :n...
class Student < ApplicationRecord has_many :student_subjects, dependent: :destroy has_many :subjects, through: :student_subjects has_many :teachers, through: :subjects has_many :books, through: :subjects has_attached_file :avatar, :default_url => ActionController::Base.helpers.asset_path('assetsmissing.png') ...
class Fixsensiagain < ActiveRecord::Migration def change remove_column :isolates, :sensitivity end end
require_relative "rendering_context" class HtmlView def initialize(style_sheet) @style_sheet= style_sheet @accumulator = '' end def self.wrap_page(body) [ "<html>", " <head>", " <link href='tastydoc.css' rel='stylesheet' type='text/css'>", " </head>", " ...
require 'rails_helper' RSpec.feature 'Managing schools from the support area', type: :feature do let(:local_authority) { create(:local_authority, name: 'Coventry') } let(:responsible_bodies_page) { PageObjects::Support::ResponsibleBodiesPage.new } let(:responsible_body_page) { PageObjects::Support::ResponsibleBo...
# # Cookbook Name:: gitlab # Recipe:: default # # Configures a production ready stack for GitLab # # Copyright (C) 2013 Andrew Fecheyr # # 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 withou...
class NutrientSerializer include FastJsonapi::ObjectSerializer attributes :name, :category, :uom, :value end
class Tenant < ActiveRecord::Base has_many :authentications has_many :container_groups has_many :container_projects has_many :container_templates has_many :endpoints has_many :service_instances has_many :service_offerings has_many :service_plans has_many :sources has_many :tasks acts_as_taggable ...
require 'active_support/core_ext/object/to_query' require 'active_support/core_ext/object/to_param' module Restfulie::Client module Formatter module FormUrlEncoded class Driver def marshal(content, rel) if content.kind_of? Hash content.to_param else conte...
require "minitest/autorun" require_relative "../lib/k_means_clustering" class KMeansClusteringTest < Minitest::Test def test_simple_case datapoints = [ { x: 10, y: 0 }, { x: 9, y: 1 }, { x: 0, y: 10 }, { x: 1, y: 9 }, ] clustering = KMeansClustering.new datapoints.e...
require 'rails_helper' describe Information do describe '#validation' do context '開催日が現在日時以降かつ、申し込み期限が開催日時以前の場合' do let(:information) { build(:information, start_date: 2.minute.since, expire_date: 1.minute.since)} it 'エラーが生じない' do expect(informati...
class AddColumnToAuthors < ActiveRecord::Migration def change add_column :authors, :image, :string end end
class CreateBillingPlans < ActiveRecord::Migration def self.up create_table :billing_plans do |t| t.string :title t.string :coupon t.string :coupon_description t.string :billing_frequency, :default => "month" t.integer :price_euro, :default => 0 t.integer :price_dollar, :d...
require __dir__ + '/uniparser.rb' def doParse if File.exist?("/etc/atceph/config") parser = UniParser.new("/etc/atceph/config") else parser = UniParser.new( __dir__ + "/../etc/config" ) end parser.parse_all() parser.parse_cli( ["-h", "--help"], "Show this help", false) parser.parse_cli( ["-c", "--config"], ...
class Product < ApplicationRecord has_many :line_items end
class CreateMemberships < ActiveRecord::Migration[5.2] def change create_table :memberships do |t| t.references :member t.references :community t.boolean :approved, default: false, null: false t.integer :status, default: 0, null: false t.timestamps end end end
class Api::InquiriesController < Api::BaseController before_action :authenticate_admin!, only: :destroy def index @inquiries = Inquiry.all.paginate(page: params[:page], per_page: 10) end def new @industries = ['Accounting and Finance', 'General Services', 'Management and Consultanc...
desc 'Creates the required configuration files' task :config do require 'fileutils' dir = File.expand_path('../../config', __FILE__) Dir[File.join(dir, '*.default.rb')].each do |file| basename = File.basename(file) new_name = basename.gsub('default.', '') new_file = File.join(dir, new_name) Fil...
class Branch < ActiveRecord::Base has_many :leafs, :dependent => :destroy belongs_to :board accepts_nested_attributes_for :leafs, :allow_destroy => true # pagination cattr_reader :per_page @@per_page = BRANCHES_PER_PAGE default_scope -> { order('updated_at DESC') } end
class IcalRetriever def initialize(proxy_uri = nil) @retriever = if proxy_uri.present? proxy_uri = URI.parse(proxy_uri) unless proxy_uri.kind_of?(URI) Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port) else Net::HTTP end end def fetch_and_parse(calendar) RiCal.parse_string(fe...
MRuby::Gem::Specification.new('mruby-plato-sensor-hdc1080') do |spec| spec.license = 'MIT' spec.authors = 'Plato developers' spec.description = 'PlatoDevice::HDC1080 class (AE-HDC1080 - Integrated low power humidity and temperature digital sensor)' spec.add_dependency('mruby-plato-i2c') spec.add_dependency('...
class FontAhuramzda < Formula version "1.000" url "https://fontlibrary.org/assets/downloads/ahuramazda/b2c0eeb9186f389749746f075b5a1abf/ahuramazda.zip" desc "Ahuramzda" homepage "https://fontlibrary.org/font/ahuramazda/" def install parent = File.dirname(Dir.pwd) != (ENV['HOMEBREW_TEMP'] || '/tmp') ? '.....
# -*- mode: ruby -*- # # vi: set ft=ruby : required_plugins = %w( vagrant-hostmanager vagrant-cachier ) required_plugins.each do |plugin| system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin end Vagrant.configure(2) do |config| k8nodes=(ENV['K8_NODES'] || 3) config.hostmanager.enabled = ...
class Book < ActiveRecord::Base scope :published, -> { where(published: true) } belongs_to :user has_many :notes validates :user_id, presence: true end
# frozen_string_literal: true module GraphQL module Tracing module NewRelicTrace include PlatformTrace # @param set_transaction_name [Boolean] If true, the GraphQL operation name will be used as the transaction name. # This is not advised if you run more than one query per HTTP request, for ...
# frozen_string_literal: true module MagickCanvas class CLI < Thor TYPES = %w[png gif].freeze DEFAULT_TYPE = TYPES.first desc 'new PATH [-t=TYPE]', 'generate the basic template file to PATH' method_option :type, aliases: '-t', desc: "Image type (options: #{TYPES.j...
class Category < ActiveRecord::Base belongs_to :project acts_as_list :scope => :project has_many :sub_categories, -> { order(:position) }, dependent: :destroy validates :name, presence: true def sum_of_point_50 sub_categories.map(&:sum_of_point_50).inject(0, :+) end def sum_of_point_50_by_project_ta...
# frozen_string_literal: true require 'orangetheses' namespace :oai do desc 'Index Published Item using the OAI-PMH' # rubocop:disable Rails/RakeEnvironment task :index_record, [:identifier] do |_task, args| harvester = Orangetheses::Harvester.new indexer = Orangetheses::Indexer.new identifier = ar...
class CreateCollaborators < ActiveRecord::Migration[5.1] def self.up create_table :collaborators do |t| t.references :list, foreign_key: true t.references :user, foreign_key: true t.boolean :accept t.timestamps end end def self.down drop_table :collaborators end end
module Dashboard class Deck < Syro::Deck include Shield::Helpers include Mote::Helpers include Hacefrio::Requirements::Import[ 'storage.devices', 'storage.admins', 'storage.alerts', ] def device_finder @device_finder ||= Hacefrio::Workflows::DeviceLookup.new end d...
class RemoveCreatorIdFromTrails < ActiveRecord::Migration def up remove_column :trails, :creator_id end def down add_column :trails, :creator_id, :integer end end
class User < ApplicationRecord has_many :reviews has_many :likes has_many :purchases has_many :orders, through: :purchase has_secure_password end
class LeaveDetailsController < ApplicationController before_action :set_leave_detail, only: [:show, :edit, :update, :destroy] # GET /leave_details # GET /leave_details.json def index @leave_details = LeaveDetail.all end # GET /leave_details/1 # GET /leave_details/1.json def show end # GET /le...
# frozen_string_literal: true require 'bolt/apply_target' require 'bolt/config' require 'bolt/error' require 'bolt/inventory' require 'bolt/apply_inventory' require 'bolt/pal' require 'bolt/puppetdb' require 'bolt/util' Bolt::PAL.load_puppet require 'bolt/catalog/logging' module Bolt class Catalog def initial...
require 'rails_helper' RSpec.feature 'Submitting no business' do before do travel_to Time.zone.local(2018, 7, 2) mock_sso_with(email: 'email@example.com') mock_incomplete_tasks_endpoint! mock_task_with_framework_endpoint! mock_no_business_endpoint! mock_submission_completed_no_business_endpo...
class AddIsValidToJobs < ActiveRecord::Migration def change add_column :jobs, :is_valid, :boolean, default: false end end
require "rails_helper" RSpec.describe Classroom, :type => :model do before do @student = create(:student) @course = create(:course) end context "has a valid factory" do it { expect(create(:classroom, student: @student, course: @course)).to be_valid } end context "validation require" do it ...
class TeamsController < ApplicationController skip_before_filter :admin_authorize before_action :set_team, only: [:show, :edit, :update, :destroy] # GET /teams # GET /teams.json def index @teams = Team.all end # GET /teams/1 # GET /teams/1.json def show @sub = "team" end # GET /teams/n...
=begin The goal of this self-assignment was to better undertand a couple points. Mostly it's about understanding more about me and the way I work through a problem. I map it out in theory, then find it gets close and a bug displays itself. It's a challenge not to get too focused on the bug (needs more work) and also no...
class Property < ActiveRecord::Base include ContentManagement::Model include PublicActivity::Model tracked DATA_KEY_MAP = "map" DATA_KEY_GROUP = "group" DATA_KEY_DEFAULT = "default_value" DATA_KEY_VALIDATE = "validate_rules" MAP_TYPES = %w(map sale_map stock_map) PROP_TYPES = %w(string integer numbe...
class Transaction < ApplicationRecord belongs_to :transaction_type belongs_to :store monetize :value_cents end
# License: GPL v3 # Author: Leonardo Leite (2014) # Receita de instalação do Radar Parlamentar user = node['radar']['linux_user'] home = "/home/#{user}" radar_folder = "#{home}/radar" repo_folder = "#{home}/radar/repo" venv_folder = "#{home}/radar/venv_radar" cache_folder = "/tmp/django_cache" log_folder = "/var/log/r...
require 'forwardable' class FakeIO extend Forwardable def_delegators :@items, :to_s, :include?, :length def initialize @items = [] end def puts(*args) @items.push(*args) end def print(*args) @items.push(*args) end end
class Scout < ActiveRecord::Base attr_accessible :birthday, :name has_one :advancement, :dependent => :destroy accepts_nested_attributes_for :advancement attr_accessible :advancement_attributes end
require 'open3' module Git module Run # Git::Run # # This module extracts all the git binary calls. # # The two main methods are run and exec. # # Difference is that one will return the stdout and the other will # suppress it. extend self # run # # :action -> what git...
require "includes" class IntegrationTest < Minitest::Test TRACK_NAMES = ["bass", "snare", "hh_closed", "hh_closed2", "agogo", "tom4", "tom2"] OUTPUT_FOLDER = "test/integration_output" def setup # Make sure no output from previous tests is still around clean_output_folder end def test_bad_song_erro...
require 'rails_helper' describe "Beerlist page" do before :all do Capybara.register_driver :selenium do |app| capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( chromeOptions: { args: ['headless', 'disable-gpu'] } ) Capybara::Selenium::Driver.new app, browser: :ch...
#==============================================================================# # ** IEX(Icy Engine Xelion) - Equipment States #------------------------------------------------------------------------------# # ** Created by : IceDragon (http://www.rpgmakervx.net/) # ** Script-Status : Addon (Equipment) # ** Script ...
require 'ostruct' module HasModerated module Preview module Saveable def update_moderation if @based_on_moderation.present? data = @based_on_moderation.parsed_data # attributes data[:attributes] ||= Hash.new @has_moderated_fake_attributes.each_pair do |key, v...
class Part < ActiveRecord::Base mount_uploader :piece, PieceUploader belongs_to :piece belongs_to :library validates :piece_id, presence: true validates :name, presence: true end
class AddMissingIndexesToLeaguesConferencesDivisions < ActiveRecord::Migration def change add_index :leagues, :sport_id add_index :conferences, :league_id add_index :divisions, :league_id end end
module CouchCloner module Clone def self.included(base) base.property :clone_id base.send :include, InstanceMethods end module InstanceMethods def clone(&block) verify_clone_preconditions block ||= Proc.new {} property_names = properties.map(&:name) ...
#Assignment 2: Programming in Ruby #CSCI3308-F13 #Morgan Garske #Last updated: 9/18/13 #Part 1 - Classes #a) class Dessert def initialize(name, calories) @name = name @calories = calories end def name=(name) @name = name end def calories=(calories) @calories = calories ...
require 'spec_helper' describe EmailService do let(:mail) { double('MailObject') } let(:charity) { double('Charity') } describe ".new_charity" do before do mail.should_receive(:deliver).once AdminMailer.should_receive(:new_charity).with(charity).and_return(mail) end it "sends email to a...
module Bgg class << self def adapter @adapter ||= Rails.env.development? ? Bgg::Local : Bgg::Http end def adapter=(clazz) @adapter = clazz end def geek_list(id = GeekList::AUSSIE_MID_YEAR_2014_ID) @geek_list ||= GeekList.new(Nokogiri::XML(adapter.geeklist(id))) end def...
module ActsAsCachedTree def self.included klass klass.class_eval do acts_as_tree alias_method :calculate_ancestors, :ancestors has_and_belongs_to_many :descendants, :class_name=>self.name, :join_table=>"#{self.name.underscore}_descendants", :foreign_key=>"ancestor_id", :association_foreign_key=...
class Driver < ActiveRecord::Base has_secure_password has_many :contents validates :username, uniqueness: true validates :phone_number, uniqueness: true def slug username = self.username slug = username.downcase.strip.gsub(" ","-") end end
#encoding: utf-8 $:.unshift "." require 'rake' require 'rspec/core/rake_task' require 'yaml' require 'query' require 'attribute_query_message' require 'pp' require 'query_agent' require 'formatter' task :default => [:spec] RSpec::Core::RakeTask.new(:spec) task :setup do config_file = "config.yaml" config = Y...
class NewDealAgencySerializer < ActiveModel::Serializer attributes :id, :slug, :name, :description, :created_at, :updated_at end
class AddColumnsToPhotos < ActiveRecord::Migration def change add_column :photos, :photos_on, :date add_column :photos, :user_id, :integer add_column :photos, :author, :string end end
# coding: utf-8 def route_to_path route return campaigns_path if route == "the campaigns page" return campaign_path(@campaign) if route == "this campaign page" return new_campaign_path ...
require "rails_helper" module Clockface RSpec.describe EventsController, type: :controller do routes { Clockface::Engine.routes } describe "GET #index" do it "assigns the ordered list of all events, wrapped in a presenter" do event1 = create(:event) event2 = create(:event) get...
module Fitter module Contracts module ExerciseRecords class NewExerciseRecord < Dry::Validation::Contract include Import["repositories.exercise_type_repo"] params do required(:exercise_type_id).filled(:integer) end rule(:exercise_type_id) do type = exerc...
class ApplicationController < ActionController::Base protect_from_forgery with: :exception def after_sign_in_path_for(resource) kclass = resource.class.to_s case kclass when "Admin" session['admin_return_to'] = admin_path when "User" session['user_return_to'] = home_path end end end
# represent an event where backoffice has released payout class AdminSwitchedFreelancerPackageEvent < WorkspaceEvent CNAME = 'admin_switched_freelancer_package_event' field :reason belongs_to :user belongs_to :prev_freelancer, :class_name => 'FreelancerMember' belongs_to :new_freelancer, :class_name => 'Fre...
# -*- encoding : utf-8 -*- class SorceryCore < ActiveRecord::Migration def self.up create_table :users do |t| t.string :email, :null => false t.string :crypted_password, :default => nil t.string :salt, :default => nil t.integer :admin_per t.integer :asp...
require 'spec_helper' describe "Adding Skills" do before(:each) { @current_user = FactoryGirl.create(:account) # Login as fake user during test # Credit: http://library.edgecase.com/oath-and-capybara if Capybara.current_driver == :webkit page.driver.browser.set_cookie("stub_...
def nyc_pigeon_organizer(pigeon_data) formatted_hash = {} #make a new hash to store everything in later pigeon_data.each do |key, value| # key: :color, :gender, :lives # value: another hash value.each do |nested_key, pigeons| #in the first iteration the #nested key is :purple #pigeons is...
require 'faker' FactoryGirl.define do factory :post do title { Faker::Book.unique.title + ((1..1000).to_a).sample.to_s } summary { Faker::Lorem.paragraph + ((1..1000).to_a).sample.to_s } body Faker::Lorem.paragraph category end end
namespace :populate do require 'populator' require 'faker' desc 'See Cars' task cars: :environment do cars = { chevrolet: ['Silverado', 'Malibu', 'Camaro'], ford: ['Focus', 'F150', 'Fusion', 'Mustang'], kia: ['Optima','Sophia'], honda: ['S2000', 'Civic', 'CRV'], toyota: ['Taco...
class Policy < ActiveRecord::Base attr_accessible :body, :title extend FriendlyId friendly_id :title, use: :slugged RailsAdmin.config do |config| config.model Policy do navigation_label 'CMS' edit do field :title field :body, :ck_editor end end...
RSpec.describe NumbersToKurdishWords do it "has a version number" do expect(NumbersToKurdishWords::VERSION).not_to be nil end it "converts 1 to یەک" do expect(1.to_words).to eq("یەک") end it "converts 11 to یازدە" do expect(11.to_words).to eq("یازدە") end it "converts 25 to بیست و پێنج" d...
# == Route Map # # Prefix Verb URI Pattern Controller#Action # new_user_session GET /users/sign_in(.:format) devise/sessions#new # user_session POST /users/sign_in(.:format) devise/sessio...
class ExchangesController < ApplicationController def create @exchange = Exchange.new(exchange_params) session[:exchange_amount] = exchange_amount if @exchange.buy buy else sell end end private def exchange_amount params[:exchange][:units].to_f * p...
class User < ApplicationRecord authenticates_with_sorcery! # def has_unread_messages # #current_userのメッセージがある場合 # unless self.rooms.room_ids.messages # end VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/ VALID_PASSWORD_REGEX = /\A(?=.*?[a-z])(?=.*?[A-Z])(?=.*?[\d])[a-z,A-Z,\d]{8,20}\z/ #  all...
# frozen_string_literal: true module Inferno module USCore310ProfileDefinitions class USCore310ObservationLabSequenceDefinitions MUST_SUPPORTS = { extensions: [], slices: [ { name: 'Observation.category:Laboratory', path: 'category', discriminat...
class PostSearchQuery def initialize(relation = Post.unscoped.order("published_at DESC, created_at DESC")) @relation = relation return nil # This prevents AR from doing a full table load on the line above end def filter(params={}) if params[:published].present? if params[:published].to_bool ...
# UserStock has the association of users and their stocks class UserStock < ApplicationRecord belongs_to :user belongs_to :stock end
require 'base64' require 'fileutils' class DMConfig CONFIG_FILE = "dm_config" #App-specific. A config file we create and manage, stores our UI configuration... #These are TkVariables... Code typically references the .value attribute, as in account_name.value. attr_accessor :account_name, :user_name, :p...
require 'colorize' class Tile attr_reader :board, :position attr_accessor :revealed, :flagged, :bombed def initialize(board, pos) @bombed = false @flagged = false @revealed = false @board = board @position = pos end def reveal self.revealed = true unless flagged if neighbor_bo...
class Daylite::Phone < Daylite::Base belongs_to :contact, foreign_key: 'contactid' belongs_to :organization, foreign_key: 'organizationid' belongs_to :label, foreign_key: 'labelid' end
require 'docking_station' require 'support/shared_examples_for_bike_container' describe DockingStation do it { is_expected.to respond_to :release_bike } # Let's upgrade our syntax, to: # use a '#' before a method name # to imply that it is an instance # method. Also look: nested describes! describ...
require 'rails_helper' RSpec.describe GroupsController, vcr: true do describe 'GET show' do before(:each) do get :show, params: { group_id: 'ziLwaBLc' } end it 'response have a response with http status ok (200)' do expect(response).to have_http_status(:ok) end it 'assigns @group' d...
module Mathtype class FileParser attr_reader :raw attr_reader :equation def initialize(path) read_from_file(path) end def read_from_file(path) f = File.open(path, "rb") @raw = f.read end end end require_relative "wmf.rb" require_relative "ole.rb"
module CDI module V1 module ServiceConcerns module PostParams extend ActiveSupport::Concern def attributes_hash @options[:post] end def publish_async? CDI::Config.enabled?(:publish_post_to_subscribers_async) end def publish_post_to_subs...
class TradingController < ApplicationController include TradingHelper before_action :set_categories before_action :set_trading_item before_action :item_present? before_action :set_item_search_query before_action :set_trading_item_users before_action :set_new_message before_action :item_user? before_ac...
class TaskBriefSetting include Mongoid::Document include Mongoid::Timestamps store_in database: 'sribulancer_development', collection: 'task_brief_settings' # Briefs list based on partial names, will be used to render partial, brief name => model name TASK_BRIEFS_LIST = {"cleaning_service_1" => "CleaningServi...
class RomanNumerals ROMAN_RANGES = [1..5, 5..10, 10..50, 50..100, 100..500, 500..1000] def initialize(base_numbers) @base_numbers = base_numbers end def to_roman(number) if @base_numbers.is_base? number return @base_numbers.get_base number else return decompose_to_bases number e...
require "repositories/modification_repository" RSpec.describe ModificationRepository do describe "#load" do subject(:load_hashes) { repository.load(modification_hashes, dependencies) } it "adds the dependencies to the modification" do load_hashes modification = repository.fetch(1) expect(m...
json.array!(@persons) do |persons| json.extract! persons, :id, :first_name, :last_name end
class InsuredUsersController < ApplicationController before_action :authenticate_user! before_action :set_insured_user, only: [:show, :edit, :update, :destroy, :create_parent] before_action :breadcrumb, only: [:show, :edit, :index] # GET /insured_users # GET /insured_users.json def index page = params...
require 'rails_helper' RSpec.describe User, type: :model do describe '.alphabetical' do let(:superman){ FactoryGirl.create :user, :name => 'Superman' } let(:batman){ FactoryGirl.create :user, :name => 'Batman' } let(:wonderwoman){ FactoryGirl.create :user, :name => 'Wonder Woman '} before do ...
class Pmail < ActiveRecord::Base validates :sender_id, presence: true validates :receiver_id, presence: true validates :mail_detail, presence: true, length: {in: 5..500} validates :sender_name, presence: true validates :receiver_name, presence: true end
# -*- encoding : utf-8 -*- class AdmissionsAdmin::JobsController < ApplicationController layout "admissions" before_filter :before_new_and_create_and_search, only: [:new, :create, :search] filter_access_to [:new, :create, :search, :edit, :update, :show, :destroy], attribute_check: true def new end def cre...
require File.dirname(__FILE__) + '/../../test_helper' class Jobs::RenameSequencesInDbTest < ActiveSupport::TestCase context "Testing rename sequences in db" do setup do @new_prefix = "KEV_" @biodatabase = biodatabases(:biodatabases_001) @job = Jobs::RenameSequencesInDb.new("Rename sequences in ...
# frozen_string_literal: true module Ruboty module Github VERSION = '0.3.2' end end
=begin =============================================================================== Fantasy Bestiary v3.3 (20/11/2014) ------------------------------------------------------------------------------- Created By: Shadowmaster/Shadowmaster9000/Shadowpasta (www.crimson-castle.co.uk) ================================...
require_relative 'robot' VALID_COMMANDS = %w[PLACE MOVE LEFT RIGHT REPORT EXIT] place_robot_hint = "Place your robot using PLACE X,Y,F command or type EXIT\n" list_of_commands_hint = "Available Commands: #{VALID_COMMANDS.join(',')} \n" robot = Robot.new def valid_command?(command) VALID_COMMANDS.include?(command...