conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add range parameter and default to failures\n\nAvoids fetching too much data\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass FailuresController < ApplicationController\n include Concerns::Controller::Platform\n include Concerns::Controlle...
ruby
chosen
[ { "from": "system", "value": "Make sure that flash and flash.now are being used properly.\n\nWhen redirecting, we want to use flash[:<key>] in order to make the\nflash message available to the next view. However, when rendering, we\nwant to use flash.now[:<key>] in order to make the flash message\navailable...
ruby
chosen
[ { "from": "system", "value": "Switch name formatting to be compatible with Zenodo\n" }, { "from": "human", "value": "require 'open-uri'\n\nclass SessionsController < ApplicationController\n def new\n end\n\n def create\n user = User.from_omniauth(env[\"omniauth.auth\"])\n\n #FIXME this ...
ruby
chosen
[ { "from": "system", "value": "Refactor original sessions controller with helper methods\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n def create\n user = User.from_omniauth(env[\"omniauth.auth\"])\n session[:user_id] = user.id\n redirect_to root_...
ruby
chosen
[ { "from": "system", "value": "Add fallback status indicator message\n" }, { "from": "human", "value": "module StatusIndicatorHelper\n def status_indicator(record)\n content_tag(:span, '',\n class: \"status-indicator status-indicator--#{record.status}\",\n title: \"Page status: #{t(...
ruby
chosen
[ { "from": "human", "value": "Add model auth_config from spree_auth_devise\n" }, { "from": "gpt", "value": "module Spree\n class AuthConfiguration < Preferences::Configuration\n preference :registration_step, :boolean, :default => true\n preference :signout_after_password_change, :boolean,...
ruby
chosen
[ { "from": "human", "value": "Add spec for resources controller fields method\n" }, { "from": "gpt", "value": "describe Adminable::ResourcesController do\n class Broken\n end\n\n class Adminable::BrokenController < Adminable::ResourcesController\n end\n\n context Adminable::BrokenController ...
ruby
chosen
[ { "from": "system", "value": "Use constants rather than hardcoded values.\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')\n\ndescribe \"servers:add command\" do\n def cli\n @cli ||= HP::Cloud::CLI.new\n end\n\n before(:all) do\n...
ruby
chosen
[ { "from": "system", "value": "Remove unused code from service_requests controller.\n" }, { "from": "human", "value": "class ServiceRequestsController < ApplicationController\n skip_before_action :admin_only\n\n def show\n @service_request = ServiceRequest.find(params[:user_id])\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Reset groups task take 2\n" }, { "from": "human", "value": "desc \"Reset Group Table, and sets all members' group_id to null\"\ntask :reset_groups_pg do\n Member.update_all(group_id: nil)\n ActiveRecord::Base.connection.execute(\"TRUNCATE TABLE groups RESTART IDEN...
ruby
chosen
[ { "from": "system", "value": "[skip] Replace deprecated calls to `before_filter` with `before_action` (1m)\n" }, { "from": "human", "value": "module Houston\n module SupportForm\n class RequestsController < Houston::SupportForm::ApplicationController\n attr_reader :project\n before...
ruby
chosen
[ { "from": "system", "value": "Fix default fallback for URL encoding\n" }, { "from": "human", "value": "module LinkedIn\n module FaradayMiddleware\n class LinkedinFormatRequest < Faraday::Middleware\n def initialize(app=nil, options={})\n super app\n\n @options = options\n ...
ruby
chosen
[ { "from": "system", "value": "Check whether Net::FTP.default_passive is defined.\n" }, { "from": "human", "value": "require \"net/ftp\"\n\nNet::FTP.default_passive = false\n" }, { "from": "gpt", "value": "require \"net/ftp\"\n\nif defined?(Net::FTP.default_passive)\n Net::FTP.defaul...
ruby
chosen
[ { "from": "system", "value": "Fix bug on text diff operation\n" }, { "from": "human", "value": "require \"diff/lcs\"\nrequire \"nokogiri\"\nrequire \"markdiff/operations/base\"\n\nmodule Markdiff\n module Operations\n class TextDiffOperation < Base\n # @param [Nokogiri::XML::Node] after...
ruby
chosen
[ { "from": "system", "value": "Update gemfile to include rake, for travis\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"merimee/version\"\n\nGem::Specification.new do |s|\n s.name = \"merimee\"\n s.version = Me...
ruby
chosen
[ { "from": "system", "value": "Move object allocation out of loop\n\nRight now BenchmarkCleaner allocates hundreds of strings on every request with an exception. This patch moves those strings to be generated at boot once and re-used.\n\n## Bench Methods\n\nI took a modified form of CodeTriage https://github...
ruby
chosen
[ { "from": "system", "value": "Sort result of found files when creating release\n\n[#111655044](https://www.pivotaltracker.com/story/show/111655044)\n\nSigned-off-by: Maria Shaldibina <dc03896a0185453e5852a5e0f0fab6cbd2e026ff@pivotal.io>\n" }, { "from": "human", "value": "module Bosh::Cli\n clas...
ruby
chosen
[ { "from": "system", "value": "Add .pre for next release\n" }, { "from": "human", "value": "module EY\n module Serverside\n class Adapter\n VERSION = \"2.3.0\"\n end\n end\nend\n" }, { "from": "gpt", "value": "module EY\n module Serverside\n class Adapter\n VERSI...
ruby
chosen
[ { "from": "system", "value": "Allow anyone to create a section\n" }, { "from": "human", "value": "class Ability\n include CanCan::Ability\n\n def initialize(user)\n # Define abilities for the passed in user here. For example:\n #\n user ||= User.new # guest user (not logged in)\n i...
ruby
chosen
[ { "from": "system", "value": "Change initialization arguments of reservation system class.\n" }, { "from": "human", "value": "require 'active_support/core_ext/string/inflections'\n\nmodule Motel\n module Reservations\n\n class ReservationSystem\n\n def self.source(source_type, config)\n...
ruby
chosen
[ { "from": "system", "value": "Fix call signature for GitInfo.from_path\n" }, { "from": "human", "value": "require 'shipitron'\nrequire 'shellwords'\nrequire 'shipitron/git_info'\n\nmodule Shipitron\n module Server\n module Git\n class CloneLocalCopy\n include Metaractor\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add conditional to accurately reflect attending guests\n" }, { "from": "human", "value": "class Event < ActiveRecord::Base\n has_many :event_wines\n has_many :wine_bringers, through: :event_wines\n has_many :wines, through: :event_wines\n\n belongs_to :creator, ...
ruby
chosen
[ { "from": "system", "value": "Refactor attending_users and winelist to reflect new associations\n" }, { "from": "human", "value": "class Event < ActiveRecord::Base\n has_many :event_wines\n has_many :wine_bringers, through: :event_wines\n\n belongs_to :creator, class_name: \"User\", foreign_k...
ruby
chosen
[ { "from": "system", "value": "Add `commit` property to `Seeds::Seed`\n" }, { "from": "human", "value": "module Seeds\n class Seed\n\n # @return [String] the name of the seed\n #\n attr_accessor :name\n\n # @return [String] the version of the seed\n #\n attr_accessor :version\n...
ruby
chosen
[ { "from": "system", "value": "Convert Proj4::Point away from a Struct.\n" }, { "from": "human", "value": "\nmodule Proj4\n class Point < Struct.new(:x, :y, :z)\n end\nend\n" }, { "from": "gpt", "value": "\nmodule Proj4\n class Point\n attr_accessor :x, :y, :z\n\n def initial...
ruby
chosen
[ { "from": "system", "value": "Fix view_paths error that all view_paths are remained\n" }, { "from": "human", "value": "module Nyanko\n class Function\n attr_reader :block, :unit, :label\n\n class << self\n def units\n @units ||= []\n end\n\n def current_unit\n ...
ruby
chosen
[ { "from": "system", "value": "Add rake as a development dependency\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire File.expand_path('../lib/impressionist/version', __FILE__)\n\nGem::Specification.new do |s|\n s.add_dependency 'httpclient', '~> 2.2'\n s.add_dependency 'nokogiri', ...
ruby
chosen
[ { "from": "system", "value": "Fix sanitizing of various types of dates/times\n" }, { "from": "human", "value": "require \"active_support\"\nrequire \"active_support/time\"\nrequire \"active_support/core_ext/time/zones\"\nmodule Elmas\n module Resource\n module Sanitizer\n # Parse the at...
ruby
chosen
[ { "from": "system", "value": "Clean postgres first now we have an updater\n" }, { "from": "human", "value": "Before do\n $tables_created ||= false\n return $tables_created if $tables_created\n delete_all_titles_from_elasticsearch # es-updater should recreate\n sleep($ELASTICSEARCH_SLEEP.to_i...
ruby
chosen
[ { "from": "system", "value": "Add lib to autoload paths.\n" }, { "from": "human", "value": "require 'statsd'\n\nmodule RadCore\n class Engine < ::Rails::Engine\n initializer :append_migrations do |app|\n unless app.root.to_s.match root.to_s\n config.paths['db/migrate'].expanded.e...
ruby
chosen
[ { "from": "system", "value": "Add @ab9 as an author." }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/form_object_model/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Sean Geoghegan\"]\n gem.email = [\"sean@se...
ruby
chosen
[ { "from": "system", "value": "Add masks to image library.\n" }, { "from": "human", "value": "require_relative \"../image_library\"\n\n# Load Tokyo image\ntokyo = ImageLibrary::Core.load_image(\"tokyo.png\")\n\n# Blur the image multiple times\nfor i in 1..10\n tokyo = tokyo.apply_filter(ImageL...
ruby
chosen
[ { "from": "system", "value": "Add 'pry' as development dependency\n" }, { "from": "human", "value": "# encoding: UTF-8\n# frozen_string_literal: true\n\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'message_broker/version'\n\nGem::S...
ruby
chosen
[ { "from": "system", "value": "Fix: Sort inflight queies by starttime\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass StvInflight < Redshift\n self.table_name = 'stv_inflight'\n\n # TODO: using ActiveRecord::QueryMethods\n def self.find_running_queries\n sql = <<'E...
ruby
chosen
[ { "from": "system", "value": "Backup CSV's dataset with ROM::ArrayDataset\n" }, { "from": "human", "value": "module ROM\n module CSV\n class Adapter < ROM::Adapter\n def self.schemes\n [:csv]\n end\n\n class Dataset\n include Charlatan.new(:rows)\n include...
ruby
chosen
[ { "from": "system", "value": "Use new syntax for tests\n" }, { "from": "human", "value": "require_relative '../helper'\n\ndescribe \"reload_code\" do\n describe \"reload_current_file\" do\n it 'raises an error source code not found' do\n proc do\n eval <<-RUBY, TOPLEVEL_BINDING, ...
ruby
chosen
[ { "from": "system", "value": "Rework service spec using mixin.\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\ndescribe RegApi2 do\n\n describe :nop do\n it \"should return list of services if requested\" do\n ans = RegApi2.service.nop(services: [\n { dname:\"test....
ruby
chosen
[ { "from": "system", "value": "Add spec for zsh getting installed\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'default recipe on Ubuntu 14.04' do\n let(:chef_run) do\n ChefSpec::ServerRunner.new do |node|\n node.automatic[:lsb][:codename] = 'trusty'\n end.conv...
ruby
chosen
[ { "from": "system", "value": "Add missing Font Awesome icon\n" }, { "from": "human", "value": "require \"rails_admin/config/actions\"\n\nmodule RailsAdmin\n module Config\n module Actions\n class Import < Base\n RailsAdmin::Config::Actions.register(self)\n\n register_insta...
ruby
chosen
[ { "from": "system", "value": "Raise error if case clash occurs\n" }, { "from": "human", "value": "require \"ruby_git_hooks\"\n\nclass CaseClashHook < RubyGitHooks::Hook\n def check\n downcase_hash = {}\n\n ls_files.map(&:strip).each do |filename|\n downcase_hash[filename.downcase] ||...
ruby
chosen
[ { "from": "system", "value": "Fix another place where parsing features can be nil\n" }, { "from": "human", "value": "module Testjour\nmodule Commands\n\n class Command\n \n def initialize(args = [], out_stream = STDOUT, err_stream = STDERR)\n @options = {}\n @args = args\n ...
ruby
chosen
[ { "from": "system", "value": "Include multiple file lines check in apache::mod::jk spec test\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'apache::mod::jk', :type => :class do\n it_behaves_like 'a mod class, without including apache'\n\n shared_examples 'minimal resourc...
ruby
chosen
[ { "from": "human", "value": "Add feature test for merge request version\n\nSigned-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nfeature 'Merge Request versions', js: true, feature: true do\n before do\n...
ruby
chosen
[ { "from": "system", "value": "Remove redundant parts of the gemspec.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"childprocess/version\"\n\nGem::Specification.new do |s|\n s.name = \"childprocess\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Setup default hireable option for homepage\"\n\nThis reverts commit aece357df0a17c485608728f2fe790493418bb13.\n" }, { "from": "human", "value": "module SetupRequestParams\n extend ActiveSupport::Concern\n\n included do\n before_action :request_params\n...
ruby
chosen
[ { "from": "system", "value": "Add virtual attribute for full name\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n has_many :posts, :foreign_key => 'author_id'\n has_attached_file :avatar, styles: { medium: \"200x200>\", thumb: \"100x100>\" }\n validates_attachment_content...
ruby
chosen
[ { "from": "system", "value": "Modify ApplicationController for API use\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_forgery with...
ruby
chosen
[ { "from": "system", "value": "Set time zone to US Eastern.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n before_action CASClient::Frameworks::Rails::GatewayFilter, :except => [ :set_gender ]\n before_action :check_login\n\n def check_login\n @log...
ruby
chosen
[ { "from": "system", "value": "Add guard clause to result_decorator path method" }, { "from": "human", "value": "class SearchResultDecorator < Draper::Decorator\n delegate :description\n\n def to_partial_path\n 'search_result'\n end\n\n def path\n object.link\n end\n\n def title\n ...
ruby
chosen
[ { "from": "system", "value": "Use invitation code in push notification, rather than invitation id\n" }, { "from": "human", "value": "class InvitationPushNotifier\n\n def self.deliver(invitation)\n pusher = Grocer.pusher(\n certificate: Rails.application.config.apns_certificate,\n ...
ruby
chosen
[ { "from": "system", "value": "Disable corn responsible for photo/document cleanup" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\n# Use this file to easily define all of your cron jobs.\n#\n# It's helpful, but not entirely necessary to understand cron before proceeding.\n# http://en...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary lines from a test\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'test_helper'\nrequire 'support/oauth'\nrequire 'support/web_mocking'\n\nclass FacebookDupUsernameRegistrationTest < ActionDispatch::IntegrationTest\n i...
ruby
chosen
[ { "from": "system", "value": "Enhance rake:spec to run javascript specs too" }, { "from": "human", "value": "require 'konacha'\nrequire 'capybara/poltergeist'\n\nmodule MAS\n module DevelopmentDependencies\n module Konacha\n class Railtie < Rails::Railtie\n initializer 'mas.konac...
ruby
chosen
[ { "from": "system", "value": "Fix failing Travis: Correct class hierarchy\n" }, { "from": "human", "value": "class ApplicationHelper::Button::MiqTemplateScan < ApplicationHelper::Button::GenericFeatureButtonWithDisable\n needs :@record\n\n def visible?\n true\n end\n\n def disabled?\n ...
ruby
chosen
[ { "from": "system", "value": "Add rake to development dependancy\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/reditor/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = ['hibariya']\n gem.email = ['celluloid.ke...
ruby
chosen
[ { "from": "system", "value": "FIX: Allow indifferent access to institution config hash\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\nrequire 'rails/all'\nrequire 'csv'\nrequire 'yaml'\nrequire 'grape-active_model_serializers'\n\n# Precompile assets before depl...
ruby
chosen
[ { "from": "system", "value": "Add ckeditor assets to precompile list\n\nThe ckeditor gem requires the ckeditor directory be manually added to\nthe assets precompile list. At this point, the ckeditor is functioning\nas expected.\n" }, { "from": "human", "value": "require File.expand_path('../boot...
ruby
chosen
[ { "from": "system", "value": "Fix canable require in demo\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\n# Pick the frameworks you want:\n# require \"active_record/railtie\"\nrequire \"action_controller/railtie\"\nrequire \"action_mailer/railtie\"\nrequire \"...
ruby
chosen
[ { "from": "system", "value": "Set default value for hash argument to be empty hash\n" }, { "from": "human", "value": "module Pavlov\n module Helpers\n def interactor name, hash\n Pavlov.interactor name, with_pavlov_options(hash)\n end\n\n def query name, hash\n Pavlov.query n...
ruby
chosen
[ { "from": "system", "value": "Fix skipping the each statement if no folders defined\n" }, { "from": "human", "value": "require 'vagrant/action/builtin/mixin_synced_folders'\n\nmodule Vagrant\n module Syncer\n class Machine\n\n include Vagrant::Action::Builtin::MixinSyncedFolders\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix add command when only one addon is provided\n" }, { "from": "human", "value": "require 'thor'\nrequire 'thor/group'\n\nrequire 'tiny-rails/actions'\nrequire 'tiny-rails/commands/new'\nrequire 'tiny-rails/commands/add'\n\nmodule TinyRails\n class CLI < Thor\n ...
ruby
chosen
[ { "from": "system", "value": "Fix migration that does not contain position\n" }, { "from": "human", "value": "class AddDescriptionToCategories < ActiveRecord::Migration\n def up\n add_column :categories, :description, :text, null: true\n\n # While we're at it, remove unused columns\n r...
ruby
chosen
[ { "from": "system", "value": "Update primary taxons migration - take more care in setting the default primary taxon\n" }, { "from": "human", "value": "class AddPrimaryTaxonToProducts < ActiveRecord::Migration\n def up\n add_column :spree_products, :primary_taxon_id, :integer\n\n add_index...
ruby
chosen
[ { "from": "system", "value": "Update rom dep in gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rom/sql/version'\n\nGem::Specification.new do |spec|\n spec.name = \...
ruby
chosen
[ { "from": "system", "value": "Use ActiveUtils::HTTPRequestError as base exception class\n" }, { "from": "human", "value": "module ActiveUtils #:nodoc:\n class ActiveUtilsError < StandardError #:nodoc:\n end\n\n class ConnectionError < ActiveUtilsError # :nodoc:\n end\n\n class RetriableConn...
ruby
chosen
[ { "from": "system", "value": "Order search based on date created\n" }, { "from": "human", "value": "class SearchController < ApplicationController\n def index\n @search = params[:search]\n if @search\n posts_query = 'post_translations.title LIKE ? or post_translations.body LIKE ?'\n ...
ruby
chosen
[ { "from": "system", "value": "DOCS: Add details on how authorise? works\n" }, { "from": "human", "value": "module AuthorisationHelpers\n def get_permission_hash(role, perm_hash, _other)\n perm_hash[role] unless perm_hash.nil?\n end\n\n #\n # Authorises if the user can perform an action on...
ruby
chosen
[ { "from": "system", "value": "Return to same level of abstraction\n" }, { "from": "human", "value": "require \"active_storage/blob\"\nrequire \"mini_magick\"\n\n# Image blobs can have variants that are the result of a set of transformations applied to the original.\nclass ActiveStorage::Variant\...
ruby
chosen
[ { "from": "system", "value": "Make method name more obvious\n\nIt blows up if invalid\n\nSigned-off-by: Tim Hausler <0e2fe13acea22d58959d12c030372eeff089f09b@pivotal.io>\n" }, { "from": "human", "value": "module Bosh\n module Director\n module Api\n class CloudConfigManager\n def...
ruby
chosen
[ { "from": "system", "value": "Use IO.select to make it more clear which select is used\n" }, { "from": "human", "value": "require 'gelf/transport/tcp_socket'\n\nmodule GELF\n module Transport\n class TCP\n attr_reader :addresses\n\n def initialize(addresses)\n @sockets = []\...
ruby
chosen
[ { "from": "system", "value": "Fix for transaction naming in New Relic\n" }, { "from": "human", "value": "\nrequire 'jellyfish'\nrequire 'rack/request'\nrequire 'new_relic/agent/instrumentation/controller_instrumentation'\n\nmodule Jellyfish\n module NewRelic\n include ::NewRelic::Agent::Inst...
ruby
chosen
[ { "from": "system", "value": "Add TypeError for determining if sns or not\n" }, { "from": "human", "value": "module Queuel\n module SQS\n class Message < Base::Message\n def raw_body\n @raw_body ||\n (message_object && raw_body_with_sns_check) ||\n encoded_body\...
ruby
chosen
[ { "from": "system", "value": "Add an X-Github-Event header to DeployHQ service.\n\nTo make DeployHQ more compatible with Github webooks (now the reccomended way\nof integrating), Deploy now expects an X-Github-Event push header to be present.\n" }, { "from": "human", "value": "class Service::Dep...
ruby
chosen
[ { "from": "system", "value": "Add custom postgres options to column \"index:\" properties as well.\n" }, { "from": "human", "value": "module SchemaPlusPgIndexes\n module Middleware\n module Postgresql\n module Dumper\n\n module Indexes\n\n # Dump index extensions\n ...
ruby
chosen
[ { "from": "system", "value": "Add simple cov as a development dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"sandbox/version\"\n\nGem::Specification.new do |spec|\n s...
ruby
chosen
[ { "from": "system", "value": "Add file change info to CIA messages\n" }, { "from": "human", "value": "\ndef timestamp_to_epoch(timestamp)\n\tdt = DateTime.parse(timestamp).new_offset\n\tTime.send(:gm, dt.year, dt.month, dt.day, dt.hour, dt.min, dt.sec).to_i\nend\n\nservice :cia do |data, payload...
ruby
chosen
[ { "from": "system", "value": "Fix the asset pipeline images to reference S3\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production...
ruby
chosen
[ { "from": "system", "value": "Modify conditions ability to only allow teaching staff\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule Course::ConditionsAbilityComponent\n include AbilityHost::Component\n\n def define_permissions\n allow_staff_manage_conditions if use...
ruby
chosen
[ { "from": "system", "value": "Include the name in the test snake's start response\n" }, { "from": "human", "value": "require \"json\"\n\nclass RubySnake < Sinatra::Base\n def initialize(*)\n @@i ||= 0\n super\n end\n\n def move\n @@i = (@@i + 1) % 4\n %w(up left down right)[@@i]\n...
ruby
chosen
[ { "from": "human", "value": "Add beginnings of NavData specs\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'arbdrone/nav_data'\n\nclass NavDrone\n include ARbDrone::NavData\nend\n\ndescribe ARbDrone::NavData do\n describe \"#receive_data\" do\n before :each do\n @dron...
ruby
chosen
[ { "from": "system", "value": "Add rake as development dependency.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"soprano/version\"\n\nGem::Specification.new do |s|\n s.name = \"soprano\"\n s.version = Capone::V...
ruby
chosen
[ { "from": "system", "value": "Correct `puppet module list` check in beaker\n\nThe final check during the prep stage, where `puppet module list` is\nrun so that its output can be used for debugging, should run on the\ncurrent host in the loop, not the first host in the array.\n\nChange-Id: Id17d26acda26b5baa...
ruby
chosen
[ { "from": "system", "value": "[tests] Split message tests into 3 different tests\n\nCurrently messaging tests are failing because emoji's are not (yet)\nsupported. I split the tests so that the lack of emojis don't make the\ntests of the whole functionality fail.\n" }, { "from": "human", "value"...
ruby
chosen
[ { "from": "human", "value": "Add test for cli release command" }, { "from": "gpt", "value": "require \"test_helper\"\nrequire \"./lib/roger/cli\"\nrequire \"test_construct\"\n\nrequire File.dirname(__FILE__) + \"/../../helpers/cli\"\n\nmodule Roger\n # These tests ar for the roger generate comm...
ruby
chosen
[ { "from": "human", "value": "Add iOS podspec which references the package.json file\n" }, { "from": "gpt", "value": "require \"json\"\n\njson = File.read(File.join(__dir__, \"package.json\"))\npackage = JSON.parse(json).deep_symbolize_keys\n\nPod::Spec.new do |s|\n s.name = package[:name]\n s....
ruby
chosen
[ { "from": "system", "value": "Add example for variable that's not expected in the context\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'test_doubles'\n\ndescribe LightService::Orchestrator do\n class TestExecute\n extend LightService::Orchestrator\n\n def self.run(con...
ruby
chosen
[ { "from": "human", "value": "Add integration test to make sure front end is working as expected\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nfeature \"Viewing contractors\", :type => :feature do\n scenario \"visiting page and contractors are there\" do\n contractor = create(:co...
ruby
chosen
[ { "from": "system", "value": "Add schweinelinks to homepage and product page.\n" }, { "from": "human", "value": "Deface::Override.new(:virtual_path => 'spree/home/index',\n :name => 'add_schweine_links_to_sidebar_on_home_page',\n :insert_bottom => '[data-h...
ruby
chosen
[ { "from": "system", "value": "Use `:hybrid` which migrates old sessions from Marshal format to JSON\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.action_dispatch.cookies_serializer = :hybrid # :json\n" }, { "fro...
ruby
chosen
[ { "from": "system", "value": "Increase delayed job time to a day for now.\n\nMight need to higher in future...\n" }, { "from": "human", "value": "SEEK::Application.configure do\n\n Delayed::Worker.destroy_failed_jobs = false\n Delayed::Worker.sleep_delay = 3\n Delayed::Worker.max_attempts = 1...
ruby
chosen
[ { "from": "system", "value": "Replace before_filter for Rails 5.1" }, { "from": "human", "value": "module Spina\n module Admin\n class ProjectsController < AdminController\n before_filter :set_breadcrumb\n before_action :set_project, only: [:show, :edit, :update, :destroy]\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add unique index on votes so a user cannot vote twice\n" }, { "from": "human", "value": "class CreateVotes < ActiveRecord::Migration\n def change\n create_table :votes do |t|\n t.boolean :is_up, default: true\n t.references :user, null: false\n t....
ruby
chosen
[ { "from": "system", "value": "Add default of [ ] for array, to allow new users to see their profile\n" }, { "from": "human", "value": "class CreateUsers < ActiveRecord::Migration[5.1]\n def change\n create_table :users do |t|\n t.string :first_name, :last_name, :email, :password_digest,...
ruby
chosen
[ { "from": "system", "value": "Add authors, email, summary and description again...\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\n spec.name = 'refgs_dev2_stanza...
ruby
chosen
[ { "from": "system", "value": "Expand constraint on Faraday gem to allow for version 0.17.3\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rabbitmq/http/client/version'\n\n...
ruby
chosen
[ { "from": "system", "value": "Clean up archive test script\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass ArchiveTest < ActiveSupport::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", "value": "# Encoding: utf-8\nrequire '...
ruby
chosen
[ { "from": "system", "value": "Split RelationshipMappersFinalizer into smaller methods" }, { "from": "human", "value": "module DataMapper\n class Finalizer\n\n class RelationshipMappersFinalizer < self\n\n # @api private\n def run\n finalize_relationship_mappers\n fina...
ruby
chosen
[ { "from": "system", "value": "Set faraday-middleware dependency to 0.8.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/cube/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Ticean Bennett\"]\n gem.email = [...
ruby
chosen
[ { "from": "system", "value": "Expand incineration tests to cover all processed statuses\n" }, { "from": "human", "value": "require_relative '../../test_helper'\n\nclass ActionMailbox::InboundEmail::IncinerationTest < ActiveSupport::TestCase\n test \"incinerate emails 30 days after they have bee...
ruby
chosen
[ { "from": "system", "value": "Remove the drop_table from the oracle adapter.\n\nThis belongs in the migrations plugin\n\n[#1298]" }, { "from": "human", "value": "require 'dm-constraints/adapters/dm-do-adapter'\n\nmodule DataMapper\n module Constraints\n module Adapters\n\n module Oracle...
ruby
chosen