text
stringlengths
10
2.61M
require 'spec_helper' describe file('/opt/stager') do it { should be_directory } end describe file('/etc/nginx/sites-enabled') do it { should be_directory } it { should be_owned_by 'root' } it { should be_grouped_into 'docker' } it { should be_mode 775 } end # services we expect to be runnning stager_serv...
#!/usr/bin/env ruby require 'rubygems' require 'monkeyshines' require 'monkeyshines/runner' require 'pathname' # # # require 'wuclan/twitter' # un-namespace request classes. include Wuclan::Twitter::Scrape Monkeyshines::WORK_DIR = '/tmp' WORK_DIR = Pathname.new(Monkeyshines::WORK_DIR).realpath.to_s # ===============...
Shows list page: *list of Shows As a user, when I visit home page, see list of shows. Each show should include Show Name and Show Picture. As an admin, on home page, 'add show' button click 'add show' button, new page Fill in how Name and Show Picture and click submit, success message. Then I visit home page, I shoul...
class AddStripeCardTokenToDonation < ActiveRecord::Migration def change add_column :donations, :card_token, :string end end
class BulkApiImport::Validator def initialize(organization:, resources:) @organization = organization @params = resources end def validate error = validate_schema unless error.present? error = validate_facilities end error end def validate_schema schema_errors = JSON::Vali...
class CreateQuestions < ActiveRecord::Migration[6.0] def change create_table :questions do |t| t.integer :philosophy_id , null: false t.integer :color_id , null: false t.integer :my_type_id , null: false t.integer :like_type_id , null: false t.int...
class UserMap include MongoMapper::Document key :value, Integer ensure_index :_id end
module SNMP4EM # Returned from SNMP4EM::SNMPv1.set(). This implements EM::Deferrable, so you can hang a callback() # or errback() to retrieve the results. class SnmpSetRequest < SnmpRequest attr_accessor :snmp_id # For an SNMP-SET request, @pending_varbinds will by an SNMP::VarBindList, initially popul...
FactoryGirl.define do factory :treatment do patient doctor treatment_type sequence(:medicine) { |n| "medicine#{n}" } start_days 40 end end
# frozen_string_literal: true class MenuSeeds def initialize(db) @db = db @location_ids = @db["SELECT * FROM Restaurants.Locations"].to_a.map { |location| location[:id] } @chef_ids = @db[" SELECT e.id FROM Staff.Employees AS e INNER JOIN Staff.EmployeeLocationRoles AS er ON e.id = er.em...
module Net RSpec.describe ICAP do it "has a default port" do expect(ICAP.default_port).to eq 1344 end it "can be instantiated with an address" do icap = ICAP.new 'localhost' expect(icap.address).to eq 'localhost' end it "uses the default ICAP port" do icap = ICAP.new 'lo...
class HashTable attr_accessor :buckets def initialize @buckets = [] end def insert(key, val) index = index_from(key) buckets[index] ||= [] buckets[index] << [key, val] end def index_from(key) key.to_sym.object_id % 100 end def find(key) index = index_from(key) buckets[index].each do |item|...
# frozen_string_literal: true class PageStats attr_reader :page, :total_visits def initialize(page:) @page = page @total_visits = 0 @visitors = Hash.new(0) end def add_visit(visitor:) @total_visits += 1 @visitors[visitor] += 1 end def unique_visits @visitors.size end end
module Misc defaults = { :domain => "clockingit.com", :replyto => "admin", :from => "admin", :prefix => "[ClockingIT]" } $CONFIG ||= { } defaults.keys.each do |k| $CONFIG[k] ||= defaults[k] end $CONFIG[:email_domain] = $CONFIG[:domain].gsub(/:\d+/, '') # Format minutes => <tt>1w 2d 3h 3m</tt> de...
require 'json' require 'open-uri' module Github class Client def self.fetch username new.fetch username end def fetch username records = JSON.parse get username records.each do |record| checksum_from_hash = Digest::MD5.hexdigest Marshal.dump(record) record['checksum'] =...
class CreateProviderProfiles < ActiveRecord::Migration def self.up create_table :provider_profiles do |t| t.integer :provider_id, :null => false t.string :user_key, :null => false t.string :name, :null => false t.string :pic_square, :null => false t.string :url, :null => false ...
require 'rake/testtask' require 'rake/rdoctask' #require 'rake/packagetask' require 'rake/gempackagetask' Rake::TestTask.new 'test' do |t| t.pattern = 'test/**/test*.rb' end spec = Gem::Specification.new do |s| s.summary = "An interface to the Digital NZ public API." s.description = "An interface to the Digi...
module Api class EventsController < ApplicationController skip_before_action :authenticate_user! respond_to :json def participant_form event = Event.find_by(unique_id: params[:event_id]) if event event_form_data_presenter = Api::EventFormDataPresenter.new(event) respond_with...
%w{ git gcc openssl-devel readline-devel gdbm-devel db4-devel libffi-devel libyaml-devel tk-devel zlib-devel }.each do |pkg| package pkg end rbenv_path = "/home/#{node["rbenv"]["user"]}/.rbenv" plugin_path = "#{rbenv_path}/plugins" rbenv_command = "#{rbenv_path}/bin/rbenv" git rbenv_path do repository node["...
class User < ActiveRecord::Base has_many :time_tickets has_secure_password validates_confirmation_of :password validate :username_not_changed attr_readonly :name validates :name, uniqueness: true private def username_not_changed if name_changed? && self.persisted? errors.add(:name, "Change...
json.array!(@activities) do |activity| json.extract! activity, :id, :name, :address, :city, :country, :lat, :lng, :days, :hrs, :rating, :description, :cost, :date json.url activity_url(activity, format: :json) end
require 'csv' require 'daru' require 'tmpdir' require 'yquotes/version' require 'yquotes/yahoo' module YQuotes class Client def initialize @yahoo_client = Yahoo.new end # get_quote: returns Daru::DataFrame of the quote with volume and close def get_quote(ticker, args = {}) if args.is_a? ...
class Patient < ApplicationRecord belongs_to :user belongs_to :appointment end
require('minitest/autorun') require('minitest/rg') require_relative('../bear.rb') require_relative('../river.rb') require_relative('river_spec.rb') # attr_reader :name :type class BearTest < MiniTest::Test def setup() @bear = Bear.new("Yogi", "Grizzly",[]) @fish_1 = Fish.new("Salmon") @fish_2 = Fish.new("Trout") ...
class Api::V1::RandomInvoicesController < Api::ApiController respond_to :json def show respond_with Invoice.random end end
class RemovePositionFromPhoneBook < ActiveRecord::Migration def up remove_column :phone_books, :position end def down add_column :phone_books, :position, :integer end end
#!/usr/bin/env ruby require 'rubygems' require 'fileutils' require 'thor' require 'yaml' require 'ostruct' class TvClean < Thor include Thor::Actions # -------------------------------------------------------------------------- def initialize(*args) super $config_file = "#{Dir.home}/tvclean_config.yml" ...
class UserGroup include Mongoid::Document include Mongoid::Timestamps field :team_id, type: String field :channel_id, type: String field :code, type: String field :last_message_thread, type: String end
require 'test_helper' class Links::Season::BtnPlayerBreakdownTest < ActiveSupport::TestCase test "#site_name" do assert_equal "Behind the Net", Links::Season::BtnPlayerBreakdown.new.site_name end test "#description" do assert_equal "Player Breakdown", Links::Season::BtnPlayerBreakdown.new.description ...
require "rails_helper" RSpec.describe Certificate, type: :model do let(:certificate) {FactoryGirl.create :certificate} subject {certificate} context "associations" do it {is_expected.to belong_to :user} end context "validates" do it {is_expected.to validate_presence_of :name} it {is_expected.to ...
require 'rails_helper' describe Admin::Authenticator do describe '#authenticate' do it 'should return true if password is valid' do m = build(:administrator) expect(Admin::Authenticator.new(m).authenticate('pw')).to be_truthy end it 'should return false if password is invalid' do m = b...
class AddImageToPhotos < ActiveRecord::Migration def self.up add_column :photos, :image, :string remove_column :photos, :url remove_column :photos, :thumbnail_url rename_column :photos, :title, :notes end def self.down remove_column :photos, :image add_column :photos, :url, :string ad...
require 'spec_helper' # require 'pry' describe Mastermind::Game_Engine do let(:game) { Mastermind::Game_Engine.new } before :each do allow_message_expectations_on_nil allow(game).to receive(:puts).and_return(nil) end describe "#exact_match" do it 'returns exact matches' do expect(game.e...
require 'test_helper' class FbAdresasControllerTest < ActionController::TestCase setup do @fb_adresa = fb_adresas(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:fb_adresas) end test "should get new" do get :new assert_response :succe...
class Api::V1::CommitAdjustmentsController < ApplicationController skip_before_action :authorized, only: [:create, :show, :index, :update, :destroy] before_action :admin_authorized, only: [:create] def index commit_adjustments = CommitAdjustment.all render json: commit_adjustments end def show c...
describe Catalog::SoftDelete do let(:tenant) { create(:tenant) } let(:portfolio_item) { create(:portfolio_item, :tenant_id => tenant.id) } describe "#process" do context "when soft-deleting a record" do let!(:subject) { described_class.new(portfolio_item).process } it "discards the record" do ...
Deface::Override.new(:virtual_path => "spree/admin/shared/_order_details", :name => %q{replace_order_details_line_item}, :replace => %q{[data-hook='order_details_line_item_row']}, :partial => "spree/admin/orders/line_item_row", :disable...
class Stop < ApplicationRecord belongs_to :route validates :patient_name, presence: true validates :patient_address, presence: true end
require 'sieve/version' module Sieve class Generator # infinite generator - we add a class level ordered member (array) # in order to reuse as much computation results over different instances (memoization) # Singleton is not an option :O # we need not to inherit from Enumerable, each, map and so on ...
require 'spec_helper' describe GroupDocs::Document::Annotation do it_behaves_like GroupDocs::Api::Entity include_examples GroupDocs::Api::Helpers::AccessMode subject do file = GroupDocs::Storage::File.new document = GroupDocs::Document.new(:file => file) described_class.new(:document => document) ...
class RemoveExpireTimeFromPosts < ActiveRecord::Migration def change remove_column :posts, :expire_time, :datetime end end
require 'test_helper' class UserTest < ActiveSupport::TestCase def setup @user = User.new(name: 'Sterling Archer', email: 'archer@figgis.agency', admin: false, password: 'foobarfoobargoof...
module JeraPush module Service class SendMessage def initialize(*args) args[0].map { |attr_name, value| instance_variable_set("@#{attr_name}", value) } end def call return false unless valid? message_content = JeraPush::Message.format_hash @message case @type....
require 'test_helper' module KepplerLanguages class LanguagesControllerTest < ActionDispatch::IntegrationTest include Engine.routes.url_helpers setup do @language = keppler_languages_languages(:one) end test "should get index" do get languages_url assert_response :success end ...
class HdfsFile attr_reader :hadoop_instance, :path def initialize(path, hadoop_instance, attributes={}) @attributes = attributes @hadoop_instance = hadoop_instance @path = path end def contents hdfs_query = Hdfs::QueryService.new(hadoop_instance.host, hadoop_instance.port, hadoop_instance.user...
module PryIb module Command module Chart def self.build(commands) commands.create_command "chart" do description "Get Chart from stock quotes" group 'pry-ib' def options(opt) opt.on :m1, 'use 1 min period' opt.on :m5, 'use 5 min period' ...
class AddNameRemoveQuestionsFromEvaluations < ActiveRecord::Migration def change add_column :evaluations, :name, :string remove_column :evaluations, :q1 remove_column :evaluations, :q2 remove_column :evaluations, :q3 remove_column :evaluations, :q4 end end
# # Copyright 2009 Huygens Instituut for the History of the Netherlands, Den Haag, The Netherlands. # # This file is part of New Women Writers. # # New Women Writers 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 Foundat...
require_relative '../../db/config' class Student < ActiveRecord::Base validates :email, :uniqueness => true validates :age, numericality: {:greater_than => 5} validates :email, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i } validates :phone, length: {minimum: 10} def name "#{first_name}...
class CreateCommentSnapTemplates < ActiveRecord::Migration def change create_table :comment_snap_templates do |t| t.string :name, :title_overlay, :body_overlay, null: false t.boolean :active, null: false, default: true t.timestamps end end end
class AddPreToCourses < ActiveRecord::Migration[5.0] def change add_column :courses, :pre, :string end end
class Admin::CommentsController < ApplicationController before_action :admin_access def index @comments = Comment.all.limit(100) end def destroy @comment = Comment.find(params[:id]) @comment.destroy end end
RSpec.describe MonstersController do describe "GET index" do it "blocks unauthenticated access" do sign_in nil get :index expect(response).to redirect_to(:root) end context 'with login' do before do @user = create(:user) @monster = create(:monster, user: @user) ...
class WeightRate < ActiveRecord::Base belongs_to :calculator validates_presence_of :base_weight, :base_cost, :rate_per_unit named_scope :for_calculator, lambda{ |calc| if calc.is_a?(Calculator) {:conditions => {:calculator_id => calc.id}} else {:conditions => {:calculator_id => calc.to_i}}...
class DealsNotification < ActiveRecord::Base validates_presence_of :email validates_format_of(:email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i) after_create :call_count_mailer belongs_to :city def call_count_mailer user_count = DealsNotification.count(:all) unless self.city.nil? ...
class AddTemplateFieldsToThankYouCards < ActiveRecord::Migration def change add_column :thank_you_cards, :template, :text end end
class FormMailer < ActionMailer::Base default :from => Noodall::FormBuilder.noreply_address def form_response(form, response) @form = form @response = response mail(:to => form.email, :reply_to => response.email, :subject => "[#{Noodall::UI.app_name}] Response to the #{form....
class AddValidtimeToPartner < ActiveRecord::Migration def change add_column :Partner, :GueltigVon, :datetime add_column :Partner, :GueltigBis, :datetime end 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 rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel...
# == Schema Information # # Table name: sections # # id :integer not null, primary key # resource_id :integer # title :string # created_at :datetime not null # updated_at :datetime not null # row :integer # # Indexes # # index_sections_on_resource_id (resource_i...
# coding: utf-8 require 'rails_helper' feature 'gerenciar Usuario' do scenario 'incluir Usuario' do # , :js => true do visit new_usuario_path preencher_e_verificar_usuario end scenario 'alterar Usuario' do #, :js => true do usuario = FactoryGirl.create(:usuario) visit edit_usuario_pat...
class Room < ApplicationRecord mount_uploader :images, CoverUploaderUploader geocoded_by :address after_validation :geocode, if: :address_changed? belongs_to :user end
# frozen_string_literal: true class Question < ApplicationRecord belongs_to :lesson belongs_to :user has_many :answers has_many:qmetoos,class_name: "Metoo" validates :title, presence: true validates :body, presence: true default_scope -> { order(created_at: :desc) } end
module TestPassagesHelper def total_questions_helper t('helpers.test_passage.total', total: @test_passage.test.total_questions) end def result_message(result) if @test_passage.successful? content_tag(:h2, t('helpers.test_passage.success', result: result), class: 'text-success') elsif @test_pass...
class EngineerHiring < ApplicationRecord belongs_to :office belongs_to :hiring_contact, class_name: "Contact", required: false belongs_to :engineer enum status:ApplicationRecord.cmn_statuses after_initialize :set_default_value, if: :new_record? scope :active, -> {where('status=1')} private def set_default_val...
require "mpipe.so" require "mpipe/version" class MPipe @@min_poll = 0.01 @@max_poll = 0.32 def self.min_polling_interval=(time) @@min_poll = time end def self.max_polling_interval=(time) @@max_poll = time end # emulate IO.select def self.select(rd_ary, wt_ary=nil, er_ary=nil, timeout=nil) ...
FactoryBot.define do factory :item do name { Faker::Commerce.product_name } category_id { 2 } price { Faker::Number.between(300, 9_999_999) } status_id { 2 } description { Faker::Lorem.sentence } prefecture_id { 2 } date_of_shipment_id { 2 } burden_id { 2 } associat...
class CreateGames < ActiveRecord::Migration[5.2] def change create_table :games do |t| t.string :opposing_team t.string :oppsoing_game_id t.integer :goalie_id t.integer :period , default: 1 t.boolean :home_bool t.datetime :date t.timestamps end end end
# Instructions: # Count elements in an Array by returning a hash with keys of the elements and # values of the amount of times they occur. def count(array) hash = {} array.each do |item| hash[item] = array.count(item) end hash end test = ['cat', 'dog', 'fish', 'fish'] count(test) #=> { 'cat' => 1, 'dog...
class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable, :omniauthable, omniauth_providers: [:facebook, :google_...
require 'nokogiri' require 'httparty' class Scraper def initialize(keywords, site) @keywords = keywords @site = site @jobs = [] end def scrape page = 1 last_page = last_page(@site, parse_html(make_url(@site, 1))) return 'no job found' if last_page.zero? puts "Total no. of pages: #{l...
class PlacesController < ApplicationController before_action :authenticate_user! def initialize @gooPla = GooglePlaces.new(ENV["GP_KEY"]) end def index render json: @gooPla.text_search(params[:type], params[:city]) end def show render json: @gooPla.detail_search(params[:place_id]) end end
# gen_node_tree.rb module Gen class Node attr_accessor :name, :symbol, :child_table_name, :child_table_join_column_name, :parent_table_join_column_name, :nodes def initialize(name, symbol=nil, child_table_name=nil, child_table_join_column_name=nil, parent_table_join_column_name=nil) @name = name ...
require "rails_helper" RSpec.describe OverviewQuery do around do |example| with_reporting_time_zone { example.run } end describe "#inactive_facilities" do let!(:active_facility) { create(:facility) } let!(:inactive_facility) { create :facility } let!(:inactive_facility_with_zero_bps) { create :f...
# Kubernetes REST-API Client module Kubeclient VERSION = '4.1.2'.freeze end
module ApplicationHelper def hdate(dt, divider={}) return '' if dt.blank? divider = "." if divider.blank? dt.strftime("%Y#{divider}%m#{divider}%d") end def hdatetime(dt, divider={}) return '' if dt.blank? divider = "." if divider.blank? dt.strftime("%Y#{divider}%m#{divider}%d %H:%M") end def hti...
# encoding: UTF-8 require File.join(File.dirname(__FILE__), "helper") setup do "Similique quibusdam consectetur provident sit aut in. Quia dolorem qui nihil expedita quod. Doloremque nobis et labore. Fugit facilis eveniet similique voluptatem dolore rerum laboriosam occaecati. Veniam voluptatem autem in." end test...
require 'set' # @param {Integer[]} nums # @return {Boolean} def contains_duplicate(nums) set = Set.new nums.each do |elem| return true if set.include? elem set.add elem end return false end nums = [1, 2, 3] p contains_duplicate nums
class PurchasedCustomization < ApplicationRecord belongs_to :order belongs_to :customization end
# frozen_string_literal: true class AddCarrierwaveAssetsToFieldTests < ActiveRecord::Migration[5.0] def change add_column :field_tests, :carrierwave_assets, :string, after: :carrierwave_asset end end
log "Installing gradle version #{node[:gradle][:version]}" do level :info end # On Ubuntu apt installs same version '1.5' of package 'gradle' as chef recipe package 'gradle' do action :install end # NOTE: ignoring possible collsion. include_recipe 'gradle' log 'Finished configuring gradle.' do level :info end ...
class ExtendAccountTypesDropValues < ActiveRecord::Migration def self.up drop_table :account_values add_column :account_types, :max_monthly_sales, :integer add_column :account_types, :max_products, :integer add_column :account_types, :commission, :boolean add_column :account_types, :flat...
# frozen_string_literal: true require 'test_helper' class AttachmentsControllerTest < ActionDispatch::IntegrationTest test 'should destroy attachment' do event = events(:one) event.attachments.attach(io: StringIO.new('Test Data'), filename: 'file.pdf') attachment = event.attachments.first assert_di...
$:.push File.expand_path("../lib", __FILE__) require "coercell/version" Gem::Specification.new do |s| s.name = "coercell" s.version = Coercell::VERSION s.authors = ["Rafael Barros","Gustavo Sales"] s.email = ["rafael.barros@jazz.etc.br","vatsu21@gmail.com"] s.homepage = "https://gith...
class Asset < ActiveRecord::Base belongs_to :project validates :file, presence: true mount_uploader :file, FileUploader end
class User < ApplicationRecord has_secure_password mount_uploader :image, UserUploader has_many :following_friends, foreign_key: "follower_id", class_name: "Friend", dependent: :destroy has_many :followings, through: :following_friends has_many :follower_friends, foreign_key: "following_id", class_name: "Fr...
#!/usr/bin/env ruby require 'optparse' require 'fileutils' multistage = true stages = ["dev", "prod"] OptionParser.new do |opts| opts.banner = "Usage: #{File.basename($0)} [path]" opts.on("-h", "--help", "Displays this help info") do puts opts exit 0 end opts.on("-n", "--no-multistage", "Disabling ...
require 'rails_helper' RSpec.describe 'mechanics show page' do before do @mechanic1 = Mechanic.create(name: 'Kara Smith', years_experience: 11) @mechanic2 = Mechanic.create(name: 'Sam Jones', years_experience: 7) @ride1 = Ride.create(name: 'Ferris Wheel', thrill_rating: 3, open: true) visit "/mechani...
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Typhoid::RequestBuilder do context "a request builder object" do it "should provide an http method by default" do req = Typhoid::RequestBuilder.new(Game, 'http://localhost/') req.http_method.should eql :get end it ...
module Shipindo module Helpers module RupiahToFloat # convert rupiah string to float # @param [Hash] options conversion options # @option options [String] :prefix ("Rp.") prefix to remove # @option options [String] :thousand_separator (".") separator for thousands # @option options [...
# Models class Bird include Mongoid::Document field :name, type: String field :family, type: String field :continents, type: Array field :added, type: String, default: -> { Date.today } field :visible, type: Boolean, default: -> { false } validates :name, presence: true validates :family, presence: true...
require 'spec_helper' feature 'invitation' do background do clear_email end after { clear_email } scenario 'user sends out an invitation and has it fulfilled', {js: true, vcr: true} do charge = double(charge, successful?: true) StripeWrapper::Charge.stub(:create).and_return(charge) bob = Fab...
Gem::Specification.new do |s| s.name = 'aqueductron' s.version = '0.0.2' s.date = '2013-03-05' s.summary = 'Dataflow in a functional, self-modifying pipeline style' s.description = 'Aqueductron lets you create a path for data, then flow data through it, then find the results at the end. ...
require "spec_helper" describe Api::HabitDescriptionsController, type: :controller do before do coach = create(:coach) login(coach) @habit_description = create_list(:habit_description, 2, user: coach).first end describe "GET #...
# Generate a gallery from an image gallery subreddit. Requires imagemagick to be installed in your # path. Assumes the billboards are rendered at 512x512. require 'open-uri' require 'json' require 'uri' # For the vector class # (note: install gmath3D gem if not already installed) require 'gmath3D' SUBREDDIT = "aww"....
require 'open3' module Girth class Repo def self.open(dir = nil) repo = new(dir) if block_given? && block.arity == 1 yield repo elsif block_given? repo.instance_eval(&block) else repo end end attr_reader :git_dir def self.init(dir = nil, bare =...
require "./player" # This class provides the basic functionality # for making guesses toward the code. class Codebreaker < Player # Initializes instance variables that # are useful only when the computer is # playing as codebreaker def initialize @previous_black_pins = -1 # -1 to distinguish between firs...
class AddDeletedToWesellItems < ActiveRecord::Migration def change add_column :wesell_items, :deleted, :boolean, default: false, null: false WesellItem.where('status = 11').update_all deleted: true, status: 10 end end
class BoardsController < ApplicationController include ActionView::Helpers::AssetTagHelper def controller;self;end;private(:controller) before_filter :signed_in_user_board, only: [:new, :create] def new @board = Board.new end def create @board = current_user.boards.create(params[:board]) ...
####### # NOTE! # - Can take hours # - Need to create ports & fronts in Redis Datamapper via script/rserve_dm.rb first ####### task data_mapper: ["data_mapper:create_database_records"] namespace :data_mapper do # To create records in DataMapper/redis: `script/rserve_dm.rb` desc "Loads up efficient frontiers...