conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add constantize to String object if the String object cannot constantize." }, { "from": "gpt", "value": "String.class_eval do\n def constantize\n const = Kernel\n self.split('::').each do |const_str|\n const = const.const_get const_str\n end\n retur...
ruby
chosen
[ { "from": "system", "value": "Print out USAGE when not properly called\n" }, { "from": "human", "value": "require 'tankulator/entry'\nrequire 'tankulator/gastank'\n\nmodule Tankulator\n\tdef self.run\n\t\tinputFileName = ''\n\t\tif ARGV.count == 0\n\t\t\tprint 'Please enter the name of the file ...
ruby
chosen
[ { "from": "system", "value": "Add debug statement to Shell.exec\n\nFor, you know, debugging purposes. I’d prefer to have some kind of\nlogger, but for now this’ll work." }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Tara\n class Shell\n def self.exec(command)\n output = %x...
ruby
chosen
[ { "from": "system", "value": "Update spec to version 2.1.10\n" }, { "from": "human", "value": "\nPod::Spec.new do |s|\n s.name = \"LightRoute\"\n s.version = \"2.1.9\"\n s.summary = \"LightRoute is easy transition between view controllers and support many popylar arhitecture...
ruby
chosen
[ { "from": "system", "value": "Add package requirements for RHEL\n" }, { "from": "human", "value": "#\n# Cookbook Name:: omf\n# Recipe:: default\n#\n# Copyright 2014, YOUR_COMPANY_NAME\n#\n# All rights reserved - Do Not Redistribute\n#\n%w(ruby ruby-dev build-essential libssl-dev).each do |p|\n ...
ruby
chosen
[ { "from": "system", "value": "Use .each, not .all? to enumerate formulae\n" }, { "from": "human", "value": "require \"formula_versions\"\n\nmodule Homebrew\n def versions\n raise \"Please `brew install git` first\" unless which \"git\"\n raise \"Please `brew update` first\" unless (HOMEBR...
ruby
chosen
[ { "from": "system", "value": "Change string to integer in init code\n" }, { "from": "human", "value": "require 'oboefu/util'\n\nif defined?(Rails) and Rails::VERSION::MAJOR == \"3\"\n module OboeFu\n class Railtie < Rails::Railtie\n initializer \"oboe_fu.start\" do |app|\n OboeFu...
ruby
chosen
[ { "from": "system", "value": "Fix closing old printer and not curses printer\n" }, { "from": "human", "value": "require './lib/Server'\nrequire 'yaml'\nrequire './lib/GameStatistics'\nrequire 'curses'\nrequire './lib/CursesStatsPrinter'\nrequire 'optparse'\n\noptions = {}\nOptionParser.new do |o...
ruby
chosen
[ { "from": "system", "value": "Remove mass assignmente test, because rails 4 move this funcionality to controller\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: microposts\n#\n# id :integer not null, primary key\n# content :string\n# user_id ...
ruby
chosen
[ { "from": "system", "value": "Load Villein::Client, Agent in default\n" }, { "from": "human", "value": "require \"villein/version\"\n\nmodule Villein\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "require \"villein/version\"\n\nmodule Villein\n # Your code goes he...
ruby
chosen
[ { "from": "system", "value": "Use input filename as base for output filename\n" }, { "from": "human", "value": "require \"net/http\"\nrequire \"optparse\"\n\nclass YumlCmd\n \n def YumlCmd.generate(args)\n ext = \"png\"\n input = \"\"\n type = \"/scruffy\"\n opts = OptionParser.new...
ruby
chosen
[ { "from": "system", "value": "Move appium.txt loading to appium_lib\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'rubygems'\nGem::Specification.class_eval { def self.warn( args ); end }\nrequire 'pry'\n\nmodule Appium; end unless defined? Appium\n\nmodule Appium::Console\n # Ch...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 0.4.0.0 to 0.4.1.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'messaging'\n s.version = '0.4.0.0'\n s.summary = 'Messaging primitives for Eventide'\n s.description = ' '\n...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.12.3.0 to 0.12.3.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '0.12.3.0'\n s.summary = 'Messaging primitives for Eventide'\n s.descripti...
ruby
chosen
[ { "from": "system", "value": "Remove constraint on Prime class usage.\n\nSince this was throwing an error in new versions of Ruby it is best\nto remove it since it was impacting the exercise.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# frozen_string_literal: true\n\ngem 'minitest',...
ruby
chosen
[ { "from": "system", "value": "Fix broken http spec (bad spec)\n" }, { "from": "human", "value": "describe HTTP do\n describe '#body' do\n async 'returns the response body as a string' do\n HTTP.get('data/simple.txt') do |response|\n run_async { response.body.should == \"hey\" }\n...
ruby
chosen
[ { "from": "human", "value": "Add 'Endorsing, sponsoring and supporting visa applicants'\n\nhttps://www.pivotaltracker.com/story/show/64751384\n" }, { "from": "gpt", "value": "MainstreamCategory.create!(\n slug: \"endorsing-sponsoring-and-supporting-visa-applicants\",\n title: \"Endorsing, spon...
ruby
chosen
[ { "from": "system", "value": "Add `nihon` method for CLI\n" }, { "from": "human", "value": "require 'thor'\n\nmodule RomajiKit\n class CLI < Thor\n desc 'hepburnize', 'Convert kana to hepburn'\n option :upcase, type: :boolean, aliases: '-u'\n def hepburnize(text)\n puts Converter....
ruby
chosen
[ { "from": "system", "value": "Fix extra word in comment\n" }, { "from": "human", "value": "module Vagrant\n module Syncer\n module Actions\n class StartSyncer\n\n def initialize(app, env)\n @app = app\n end\n\n def call(env)\n @app.call(env)\n\n ...
ruby
chosen
[ { "from": "system", "value": "Refactor of building the morse instructions - first pass\n" }, { "from": "human", "value": "module Vail\n class Generator\n def initialize(config)\n @config = config\n @config[:repetitions] ||= 1\n Dot.class_variable_set(:@@duration, @config[:dot]...
ruby
chosen
[ { "from": "system", "value": "Change creator and commentable factories.\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :ecm_comments_comment, class: Ecm::Comments::Comment do\n association :creator, factory: :user\n association :commentable, factory: :post\n nam...
ruby
chosen
[ { "from": "human", "value": "Add an acceptance test that hits the network\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe WhosDatedWho do\n let(:client) { WhosDatedWho::Client.new }\n\n context \"smoke test\" do\n it \"fetches and parses the correct results\" do\n re...
ruby
chosen
[ { "from": "system", "value": "Update start and end dates in test\n\nValidations where failing because we were trying to schedule a project\nstart date for before today.\n" }, { "from": "human", "value": "require 'rails_helper'\n\nfeature 'Project creation' do\n scenario 'staff creates a project...
ruby
chosen
[ { "from": "system", "value": "Add TODO to write specs\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe WillPaginate::Materialize do\n it 'has a version number' do\n expect(WillPaginate::Materialize::VERSION).not_to be nil\n end\n\n it 'does something useful' do\n exp...
ruby
chosen
[ { "from": "system", "value": "Add progress update destroy route\n" }, { "from": "human", "value": "require \"pry\"\n\nclass ProgressUpdatesController < ApplicationController\n def show\n @update = ProgressUpdate.find(params[:id])\n @comment = Comment.new\n end\n\n def user_index\n @u...
ruby
chosen
[ { "from": "system", "value": "Leverage association when building model\n" }, { "from": "human", "value": "module Renalware\n class EventsController < BaseController\n\n before_action :load_patient, :only => [:new, :create, :index]\n\n def new\n @event = Event.new\n authorize @ev...
ruby
chosen
[ { "from": "system", "value": "Add a spec verifying that Time.iso8601 returns an instance of Time\n" }, { "from": "human", "value": "describe \"Time\" do\n\n describe \"parsing an iso8601 formatted time to a Time object\" do\n before do\n @time = Time.iso8601(\"2012-05-31T19:41:33Z\")\n ...
ruby
chosen
[ { "from": "system", "value": "Use module instead of class\n" }, { "from": "human", "value": "class OpinionType\n def self.types\n ['believes', 'disbelieves', 'doubts']\n end\nend\n" }, { "from": "gpt", "value": "module OpinionType\n def self.types\n ['believes', 'disbelieves...
ruby
chosen
[ { "from": "system", "value": "Update Tinkey URL and SHA-256 hash for Tink 1.6.0.\n\nPiperOrigin-RevId: 374341425\n" }, { "from": "human", "value": "# A Homebrew formula for Tinkey on Linux and macOS.\n# Usage:\n# brew tap google/tink https://github.com/google/tink\n# brew install tinkey\n\nclass...
ruby
chosen
[ { "from": "human", "value": "Add working directory for w9\n" }, { "from": "gpt", "value": "# Numbers to English Words\n\n\n# I worked on this challenge [Alone].\n# This challenge took me [#] hours.\n\n\n# Pseudocode_____________________________________________________\n# INPUT: Numbers\n# OUTPUT...
ruby
chosen
[ { "from": "human", "value": "Add spec for ThreadGroup::Default constant\n\nBased on MRI docs and passing in MIR 1.9.3\n" }, { "from": "gpt", "value": "require File.expand_path('../../../spec_helper', __FILE__)\n\ndescribe \"ThreadGroup::Default\" do\n it \"is a ThreadGroup instance\" do\n Th...
ruby
chosen
[ { "from": "human", "value": "Add considertion to work directory. [admin]\n" }, { "from": "gpt", "value": "## THIS IS NOT THUROUGH ENOUGH\n## PROBABY SHOULD MAKE SPECIAL SUBCLASSES\n## OF HASH TO HANDLE THIS CONCEPT.\n#\n# IMPORTANT TODO!!!!\n\n#\n\nclass Hash\n\n attr_accessor :fallback\n\n # ...
ruby
chosen
[ { "from": "system", "value": "Rollback previous commit to use DATABSE_URL\n" }, { "from": "human", "value": "require 'sequel'\n\nRACK_ENV = (ENV['RACK_ENV'] ||= 'development')\n\nif RACK_ENV == 'development'\n require 'ruby-debug'\nend\nmodule Db\n class << self\n def name(env=RACK_ENV)\n ...
ruby
chosen
[ { "from": "system", "value": "Add spec to test uploading from URL\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'homepage upload', :type => :feature do\n include UploadHelper\n\n before(:each) do\n user = create(:user)\n login_as(user, :scope => :user)\n end\n\n ...
ruby
chosen
[ { "from": "human", "value": "Improve item tests, part 2\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe Item do\n let(:item) { FactoryBot.create(:item)}\n\n before do\n # Do nothing\n end\n\n after do\n # Do nothing\n end\n\n context 'when creating an Item' ...
ruby
chosen
[ { "from": "system", "value": "Change to seed-fu for seeding during tests too.\n" }, { "from": "human", "value": "RSpec.configure do |config|\n config.before(:suite) do\n DatabaseCleaner[:mongoid].strategy = :truncation\n DatabaseCleaner.clean\n Rails.application.load_seed\n end\nend\n...
ruby
chosen
[ { "from": "system", "value": "Check if metric is activated; was bypassing ripper check\n" }, { "from": "human", "value": "def enable_hotspots\n MetricFu.configure\n hotspot_metrics = MetricFu::Metric.metrics.map(&:name)\n hotspot_metrics.each do |metric_name|\n path = \"#{metric_name}/#{me...
ruby
chosen
[ { "from": "human", "value": "Add initial file for GPS 2.3\n" }, { "from": "gpt", "value": "# Your Names\n# 1)Catie Stallings\n# 2)\n\n# We spent [#] hours on this challenge.\n\n# Bakery Serving Size portion calculator.\n\ndef serving_size_calc(item_to_make, num_of_ingredients)\n library = {\"co...
ruby
chosen
[ { "from": "system", "value": "Add support for searching using tags operator\n" }, { "from": "human", "value": "module Clarifai\n class Client\n # Defines methods related to Curator Index management\n module CuratorSearch\n def search(index, query, size=50, start=0, search_options={})...
ruby
chosen
[ { "from": "system", "value": "Fix repo order with Postgres\n" }, { "from": "human", "value": "require_dependency 'project'\n\nmodule RedmineGitHosting\n module Patches\n module ProjectPatch\n\n def self.included(base)\n base.send(:include, InstanceMethods)\n base.class_eva...
ruby
chosen
[ { "from": "system", "value": "Fix ruby 2.0 compatability issue\n" }, { "from": "human", "value": "module MinitestToRspec\n module Exp\n\n # Data object. Represents a `:hash` S-expression.\n class HashExp < Base\n def initialize(sexp)\n assert_sexp_type(:hash, sexp)\n @...
ruby
chosen
[ { "from": "system", "value": "Add one more tech debt todo\n" }, { "from": "human", "value": "module Services\n class TaskTwitter\n include Import[:twitter, 'services.url_shortener']\n\n def call(task)\n tweet text(task)\n end\n\n private\n\n def link_to_task(task_id)\n ...
ruby
chosen
[ { "from": "system", "value": "Test aria-required for hidden inputs.\n\n[#780]\n" }, { "from": "human", "value": "# encoding: UTF-8\nrequire 'test_helper'\n\nclass HiddenInputTest < ActionView::TestCase\n test 'input should generate a hidden field' do\n with_input_for @user, :name, :hidden\n ...
ruby
chosen
[ { "from": "system", "value": "Stop image showing up as an attachment" }, { "from": "human", "value": "class DeviseMailer < Devise::Mailer\n\n add_template_helper(ApplicationHelper)\n\n def headers_for(action, opts)\n headers = super\n if action == :confirmation_instructions\n header...
ruby
chosen
[ { "from": "system", "value": "Fix a file name error in the gemspec.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"jsrebuild\"\n s.version = \"0.1.0\"\n \n s.author = \"Benedict Eastaugh\"\n s.email = \"benedict@eastaugh.net\"\n s.homepa...
ruby
chosen
[ { "from": "system", "value": "Downgrade rails dependency to 3.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'gretel/version'\n\nGem::Specification.new do |gem|\n gem.na...
ruby
chosen
[ { "from": "system", "value": "Improve inspect output for dependency collections\n" }, { "from": "human", "value": "class Dependencies\n include Enumerable\n\n def initialize(*args)\n @deps = Array.new(*args)\n end\n\n def each(*args, &block)\n @deps.each(*args, &block)\n end\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Fix migration for better search [SCI-2108]\n" }, { "from": "human", "value": "class CreateRepositoryListValues < ActiveRecord::Migration[5.1]\n def change\n create_table :repository_list_items do |t|\n t.references :repository, index: true, foreign_key: tru...
ruby
chosen
[ { "from": "system", "value": "Change if condition for gretting call\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'data_mapper'\n\nrequire './helpers/birthday'\n\nrequire './models/vip_clients.rb'\nrequire './models/invitations.rb'\n\ninclude Birthday\n\nDataMapper.setup(:default...
ruby
chosen
[ { "from": "system", "value": "Change away from unlocker stub\n" }, { "from": "human", "value": "require 'active_record'\nrequire 'json'\nrequire 'twilio-ruby'\nrequire 'phone'\nrequire './lib/models'\nrequire './lib/greeter'\nrequire './lib/unlocker_stub'\nrequire './lib/twilio_watcher'\nrequire...
ruby
chosen
[ { "from": "system", "value": "Update Geo Sans Light to sha256 checksums\n" }, { "from": "human", "value": "class FontGeoSansLight < Cask\n url 'http://moorstation.org/typoasis/designers/klein03/text02/pc/GeosansLight.zip'\n homepage 'http://moorstation.org/typoasis/designers/klein03/text02/geo...
ruby
chosen
[ { "from": "system", "value": "Add the activesupport 3 dependency.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'periscope/version'\n\nGem::Specification.new do |s|\n s.name = 'periscope'\n s.version = Periscope::...
ruby
chosen
[ { "from": "human", "value": "Add migration to create a spree_users table if it doesn't already exist\n" }, { "from": "gpt", "value": "class CreateUsers < ActiveRecord::Migration\n def up\n unless table_exists?(\"spree_users\")\n create_table \"spree_users\", :force => true do |t|\n ...
ruby
chosen
[ { "from": "human", "value": "Add implementation of thirtieth-fourth rule of disambiguator prefix\n" }, { "from": "gpt", "value": "module Sastrawi\n module Morphology\n module Disambiguator\n class DisambiguatorPrefixRule34\n def disambiguate(word)\n contains = /^pe([bcdf...
ruby
chosen
[ { "from": "system", "value": "Add user to docker group\n\n- Fixes \"Cannot connect to docker daemon\"\n" }, { "from": "human", "value": "apt_repository \"docker\" do\n uri \"https://apt.dockerproject.org/repo\"\n components [\"main\"]\n distribution \"ubuntu-#{node['lsb']['codename']}\"\n ke...
ruby
chosen
[ { "from": "system", "value": "Use docker repo rather than shell installer\n" }, { "from": "human", "value": "\nremote_file \"/tmp/install_docker\" do\n source \"https://get.docker.com/\"\n mode 0755\nend\n\nexecute \"install docker\" do\n command \"sh /tmp/install_docker\"\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Improve syntax for working with first-order functions\n" }, { "from": "human", "value": "module Rupture::Fn\n def self.identity\n lambda {|x| x}\n end\n\n def self.juxt(*fs)\n lambda do |*args|\n fs.collect {|f| f[*args]}\n end\n end\n\n def self....
ruby
chosen
[ { "from": "system", "value": "Add log notice for cron task\n" }, { "from": "human", "value": "namespace :om do\n desc \"Fetch data for all cafeterias\"\n task :fetch => :environment do\n date = Time.zone.now.to_date\n\n Cafeteria.all.each do |cafeteria|\n next if cafeteria.last_fetc...
ruby
chosen
[ { "from": "human", "value": "Add test around /etc/my.cnf Preflight\n" }, { "from": "gpt", "value": "require 'boxen/test'\nrequire 'boxen/preflight/etc_my_cnf'\n\nclass BoxenPreflightEtcMyCnfTest < Boxen::Test\n def test_file_check\n preflight = Boxen::Preflight::EtcMyCnf.new(mock('config'))\...
ruby
chosen
[ { "from": "system", "value": "Add CSS Class to name Column of Admin Table\n\nFeature spec depends on exact class name.\n" }, { "from": "human", "value": "module Pageflow\n module Admin\n class MembersTab < ViewComponent\n def build(entry)\n if entry.memberships.any?\n ta...
ruby
chosen
[ { "from": "system", "value": "Change ternary operator to if else statement\n" }, { "from": "human", "value": "require './config/environment'\nrequire 'sinatra/base'\n\nclass App < Sinatra::Base\n\n # config.yml file must be created first (in config folder)\n configure do\n yaml = YAML.load_...
ruby
chosen
[ { "from": "system", "value": "Change file path for news-form\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'sinatra/reloader'\n\nconfigure do\n set :public_folder, File.dirname(__FILE__) + \"/public\"\nend\n\nget '/' do\n send_file File.join('app/views/index.html')\nend\n\nget ...
ruby
chosen
[ { "from": "human", "value": "Create controller at root dir\n" }, { "from": "gpt", "value": "require 'pry'\nrequire 'sinatra/base'\nrequire_relative 'lib/tictactoe_rules'\nrequire_relative 'lib/tictactoe_board'\nrequire_relative 'lib/comp_player'\nrequire_relative 'lib/web_game_engine'\n\nclass T...
ruby
chosen
[ { "from": "system", "value": "Fix appending size to github urls\n" }, { "from": "human", "value": "module GithubUrlHelper\n DEFAULT_AVATAR = URI.parse('https://avatars.githubusercontent.com/u/583231?')\n\n def github_url\n \"https://github.com\"\n end\n\n def github_avatar(user, options={...
ruby
chosen
[ { "from": "human", "value": "Add Rspec test for \"i\" shortcut\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nfeature 'Project shortcuts', feature: true do\n let(:project) { create(:project) }\n let(:user) { create(:user) }\n\n describe 'On a project', js: true do\n before do\n ...
ruby
chosen
[ { "from": "system", "value": "Update Podspec to specify swift version support" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'Re-Lax'\n spec.version = '1.0.1'\n spec.summary = 'Recreating Parallax on tvOS'\n spec.homepage = 'https://github.com/asynchrony/Re-Lax'\n sp...
ruby
chosen
[ { "from": "system", "value": "Add gem description and summary" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'aggregator/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Declare tvOS support for CocoaPods\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"C4\"\n s.version = \"3.0.0\"\n s.summary = \"Code, Creatively.\"\n s.description = <<-DESC\n C4 is an open-source creati...
ruby
chosen
[ { "from": "system", "value": "Remove pry-debugger from dev dependencies\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'business_calendar/version'\n\nGem::Specification.new do |spec|...
ruby
chosen
[ { "from": "system", "value": "Make sure example inherits from base\n" }, { "from": "human", "value": "module OnlinePimp::Verificators\n class ServiceExample\n attr_reader :name\n\n def initialize(name)\n @name = \"http://example.com/#{name}\"\n end\n\n def available?\n Res...
ruby
chosen
[ { "from": "system", "value": "Update method for finding visible Comments\n\nOld method is deprecated. Use newer 'where(conditions)' instead.\n" }, { "from": "human", "value": "class Idea < ActiveRecord::Base\n\n belongs_to :owner, :class_name => 'User'\n belongs_to :current\n\n has_many :vote...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary attr_accessor in User model\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n devise :database_authenticatable, :recoverable,\n :rememberable, :trackable, :validatable, :confirmable\n\n has_attached_file :avatar, style...
ruby
chosen
[ { "from": "system", "value": "Add primary keys to Vote model\n\nSpecify the 'idea_id' and 'user_id' attributes are to be used as unique\nprimary keys. Records will be uniquely identified by this composite\nkey, not the 'id' field created and used by Rails by default.\n" }, { "from": "human", "va...
ruby
chosen
[ { "from": "system", "value": "Remove unused logic path in helper\n" }, { "from": "human", "value": "module SupportersHelper\n def number_in_cents_to_currency(number)\n number_to_currency(number.to_f / 100)\n end\n\n def plan_image_tag(plan, size='64x64')\n image_tag(\"supporter-badge-#{pl...
ruby
chosen
[ { "from": "system", "value": "Use NewsletterSetting instead of StringBox as welcome_user mail content\n" }, { "from": "human", "value": "#\n# == Newsletter Mailer\n#\nclass NewsletterMailer < ApplicationMailer\n add_template_helper(HtmlHelper)\n default from: Setting.first.try(:email)\n layou...
ruby
chosen
[ { "from": "system", "value": "Add Default League ID to spec\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nfeature \"user visits roster transactions page\" do\n scenario \"and views a list of waiver claims in a league\" do\n fantasy_league = create(:fantasy_league, id: 1)\n ...
ruby
chosen
[ { "from": "system", "value": "Automate methods can access categories and entries\n\n https://bugzilla.redhat.com/show_bug.cgi?id=1254953\n\n Made the tests directly call the service model methods\ninstead of calling automate methods. Makes the tests run\nfaster without the overhead of Automate models\n\n...
ruby
chosen
[ { "from": "system", "value": "Deal with Registry connection problems\n" }, { "from": "human", "value": "require 'xa/registry/client'\n\nclass RegistryService\n def self.sync_rules\n last_sync = SyncAttempt.last\n\n cl = XA::Registry::Client.new(ENV.fetch('XA_REGISTRY_URL', nil) || Setting...
ruby
chosen
[ { "from": "system", "value": "Update to Community Edition 14.0.1" }, { "from": "human", "value": "case node[:platform]\nwhen \"centos\", \"redhat\", \"debian\", \"ubuntu\"\n default['intellij_community_edition']['download_url']=\"http://download.jetbrains.com/idea/ideaIC-13.1.tar.gz\"\n\n defa...
ruby
chosen
[ { "from": "human", "value": "Change sheltered housing transaction to LGSL 107\n\nWe want to use LGSL 107 (instead of 230) for the sheltered housing local\ntransaction as it is supported in England and Wales.\n\nThis migration is one of the last bits of the puzzle from this Trello card:\nhttps://trello.com/c...
ruby
chosen
[ { "from": "system", "value": "Use real brain instead of stub\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Ruboty::ToggleSwitch::Storage do\n subject(:storage) { Ruboty::ToggleSwitch::Storage.new(brain) }\n let(:brain) { double('brain', data: {}) }\n let(:key) { 'key' }...
ruby
chosen
[ { "from": "system", "value": "Add blank line after private\n" }, { "from": "human", "value": "class DigestMailer < ApplicationMailer\n default template_path: 'digest_mailer'\n default template_name: 'digest_mailer'\n\n def digest_mailer(history, user_id)\n @user = User.find user_id\n @p...
ruby
chosen
[ { "from": "system", "value": "Add uniqueness validation to procedure path\n" }, { "from": "human", "value": "class ProcedurePath < ApplicationRecord\n validates :path, format: { with: /\\A[a-z0-9_\\-]{3,50}\\z/ }, presence: true, allow_blank: false, allow_nil: false\n validates :administrateur...
ruby
chosen
[ { "from": "system", "value": "Fix deleting current user from session on signout\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_for...
ruby
chosen
[ { "from": "human", "value": "Add option tests for model base\n\nCloses #1\n" }, { "from": "gpt", "value": "require \"minitest/autorun\"\nrequire \"nidyx/model_base\"\n\nclass TestModelBase < Minitest::Test\n\n MOCK_OPTS = {\n :author => \"test_author\",\n :company => \"test_company\",\n ...
ruby
chosen
[ { "from": "system", "value": "Add totals to allocation output." }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(\"../../../lib\", __FILE__)\nrequire 'rspec/core'\nrequire 'allocation_stats'\n\ndef benchmark_allocations(burn: 1, min_allocations: 0)\n stats = AllocationStats.n...
ruby
chosen
[ { "from": "system", "value": "Remove sweeper code, let the implementation to be done in the container app\n" }, { "from": "human", "value": "class PostSweeper < ActionController::Caching::Sweeper\n observe CrowdblogCore::Post\n\n def after_create(post)\n expire_all(post)\n end\n\n def aft...
ruby
chosen
[ { "from": "system", "value": "QUALITY: Use .nil? over double negation\n" }, { "from": "human", "value": "#\n# Finds or creates a student if not found\n#\ndef find_or_create_student(username)\n user_created = nil\n using_cache = !!@user_cache\n if !using_cache || !@user_cache.key?(username)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix \"undefined method `generate' for nil:NilClass\"\n\nFixes #45\n" }, { "from": "human", "value": "require \"paperclip/storage/dropbox/private_url_generator\"\nrequire \"paperclip/storage/dropbox/public_url_generator\"\nmodule Paperclip\n module Storage\n modu...
ruby
chosen
[ { "from": "human", "value": "Add task to check missing category names\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nnamespace :gobierto_budgets do\n namespace :missing_categories do\n desc \"Check missing categories\"\n task :check, [:site_domain] => [:environment] do ...
ruby
chosen
[ { "from": "system", "value": "Add test for ProtectBranche uniqueness\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')\n\ndescribe RepositoryProtectedBranche do\n\n def build_protected_branch(opts = {})\n build(:repository_protected_branc...
ruby
chosen
[ { "from": "system", "value": "Update Item price validation. Include comment pointing out that format still needs to be set\n" }, { "from": "human", "value": "class Item < ApplicationRecord\n validates :name, presence: { message: \"Name field can't be left blank\"}, length: { in: 3..64, message...
ruby
chosen
[ { "from": "system", "value": "Fix setting a User's twitter handle to nil\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n # Include default devise modules. Others available are:\n # :confirmable, :lockable, :timeoutable and :omniauthable\n devise :database_authenticatable,...
ruby
chosen
[ { "from": "system", "value": "Add comments for new User attributes.\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n\n # https://github.com/EppO/rolify\n rolify\n\n # Public: Name of user.\n # column :name\n\n # Public: Email address for user.\n # column :email\n\n # P...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.29.0.12 to 1.0.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '0.29.0.12'\n s.summary = 'Common primitives for platform-specific messagin...
ruby
chosen
[ { "from": "system", "value": "Update template to generate 'decorates' line\n" }, { "from": "human", "value": "class <%= singular_name.camelize %>Decorator < Draper::Base\n\n # Helpers from Rails an Your Application\n # You can access any helper via a proxy to ApplicationController\n #\n # ...
ruby
chosen
[ { "from": "system", "value": "Fix rspec run fail when using custom error message\n" }, { "from": "human", "value": "require \"validates_email_format_of\"\n\nRSpec::Matchers.define :validate_email_format_of do |attribute|\n match do\n actual = subject.is_a?(Class) ? subject.new : subject\n ...
ruby
chosen
[ { "from": "system", "value": "Revert add art to playing in web.\n" }, { "from": "human", "value": "require 'models/player'\nrequire 'models/spotify'\n\nmodule Spot\n class App < Sinatra::Base\n get '/' do\n 'Welcome to Spot!<br/>http://github.com/minton/Spot'\n end\n put '/play' d...
ruby
chosen
[ { "from": "system", "value": "Move rspec to development dependency" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'modelling/version'\n\nGem::Specification.new do |s|\n s.name = 'modelling'\n s.version = Modelling::V...
ruby
chosen
[ { "from": "system", "value": "Fix DB URL on Heroku\n" }, { "from": "human", "value": "configure :development do\n set :database, 'sqlite3:///development.sqlite3'\nend\n\nconfigure :production do\n db = URI.parse(ENV['DATABASE_URL'] || 'postgres:///localhost/mydb')\n\n ActiveRecord::Base.estab...
ruby
chosen