conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Delete invalid activities in migration\n" }, { "from": "human", "value": "class MigrateFactRelationActivitiesWorker\n @queue = :aaa_migration\n\n def self.perform\n Activity.find(action: :added_supporting_evidence).each do |a|\n migrate_activity a, 'suppor...
ruby
chosen
[ { "from": "human", "value": "Write a spec for Enumerator::Lazy\n" }, { "from": "gpt", "value": "# -*- encoding: us-ascii -*-\n\nrequire File.expand_path('../../../../spec_helper', __FILE__)\n\nruby_version_is \"2.0\" do\n describe \"Enumerator::Lazy\" do\n it \"is a subclass of Enumerator\" ...
ruby
chosen
[ { "from": "system", "value": "Add tests for the HTTP_HOST hedaer in the Simple adapter.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Rack::Client::Simple do\n describe \"HTTP_USER_AGENT\" do\n it 'adds the user agent header to requests' do\n app = lambda {|env| [...
ruby
chosen
[ { "from": "system", "value": "Add http verb to protected page route\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n\n mount G5Authenticatable::Engine => '/g5_auth'\n\n resource :home, only: [:index, :show]\n\n match '/protected_page', to: 'home#show', as: :protected_page...
ruby
chosen
[ { "from": "system", "value": "Remove references to database elo score in calculations\n" }, { "from": "human", "value": "class Artist < ActiveRecord::Base\n validates :name, presence: true, uniqueness: true\n validates :elo_score, presence: true\n\n has_many :winning_votes, foreign_key: :winn...
ruby
chosen
[ { "from": "system", "value": "Add callback function to Recipe.\n" }, { "from": "human", "value": "class Recipe < ActiveRecord::Base\n\n has_many :menu_recipes\n has_many :menus, through: :menu_recipes\n has_many :recipe_courses\n has_many :courses, through: :recipe_courses\n # has_many :rec...
ruby
chosen
[ { "from": "system", "value": "Fix bullet unoptimised query error\n\n\n```\n Bullet::Notification::UnoptimizedQueryError:\n user: despo\n POST /admin/events/omnis-1/invitation/e5jkug2T-bpuY0Yeqegb3A/verify\n AVOID eager loading detected\n Invitation => [:verified_by]\n Remo...
ruby
chosen
[ { "from": "system", "value": "Order autocomplete results by citation\n" }, { "from": "human", "value": "class Admin::ReferencesController < Admin::StandardAuthorizationController\n respond_to :json, :only => [:index, :update]\n\n def index\n index! do |format|\n format.json {\n ...
ruby
chosen
[ { "from": "human", "value": "test/cli: Add tests for `kbsecret generator`\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"helpers\"\n\n# Tests for KBSecret::CLI::Command::Generator\nclass KBSecretCommandGeneratorTest < Minitest::Test\n include Helpers\n include Help...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 0.2.3 to 0.2.4\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-messaging'\n s.summary = 'Messaging primitives for EventStore using the EventStore Client HTTP library...
ruby
chosen
[ { "from": "system", "value": "Add additional specs to the cron_d resource\n\nWhy not\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Copyright:: Copyright 2018, Chef Software, Inc.\n# License:: Apache License, Version 2.0\n#\...
ruby
chosen
[ { "from": "system", "value": "Fix expected argument mismatch message on Puppet 4.3.0\n\nThe exception message raised under Puppet 4.3.0 for arity mismatches in\nfunctions changed:\n\n expected split(\"foo\") to have raised ArgumentError matching /mis-matched arguments/\n instead of ArgumentError('spli...
ruby
chosen
[ { "from": "human", "value": "Add a basic spec for the Heat generator\n\nSigned-off-by: Tomas Sedovic <2bc6038c3dfca09b2da23c8b6da8ba884dc2dcc2@sedovic.cz>\n" }, { "from": "gpt", "value": "# Copyright 2012 Red Hat, Inc.\n# Licensed under the Apache License, Version 2.0, see README for details.\n\...
ruby
chosen
[ { "from": "system", "value": "Rewrite a step to verify a lockfile content\n" }, { "from": "human", "value": "Given 'lockfile' do |content|\n create_file expand('$tmp').to_lockfile_path, expand(content)\nend\n\nGiven /^I delete lockfile$/ do\n delete_path expand('$tmp').to_lockfile_path\nend\n\...
ruby
chosen
[ { "from": "system", "value": "Add controller spec for deselecting distributors\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'spree/core/current_order'\n\ndescribe Spree::DistributorsController do\n include Spree::Core::CurrentOrder\n\n it \"selects distributors\" do\n d...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.4.0.0 to 0.4.0.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-client-http'\n s.version = '0.4.0.0'\n s.summary = 'HTTP Client for EventStore'\n s.descripti...
ruby
chosen
[ { "from": "human", "value": "Add tests for null store.\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass NullStoreTest < Minitest::Test\n def store; @store ||= AccessToken::NullStore.new; end\n\n test 'implements set' do\n assert store.set('key', 'value', 3600)\n end\n\n tes...
ruby
chosen
[ { "from": "human", "value": "Add standard GNOME themes for gtk+3 and for gtk+ (optionally)\n" }, { "from": "gpt", "value": "require 'formula'\n\nclass GnomeThemesStandard < Formula\n homepage 'http://gnome.org/'\n url 'http://ftp.gnome.org/Public/GNOME/sources/gnome-themes-standard/3.12/gnome-...
ruby
chosen
[ { "from": "system", "value": "Add a check if user is logged in and has a Librarian role.\n" }, { "from": "human", "value": "class LocSearchController < ApplicationController\n def index\n if params[:page].to_i <= 0\n page = 1\n else\n page = params[:page].to_i\n end\n @que...
ruby
chosen
[ { "from": "system", "value": "Remove addionial slash / in article url when no categories\n" }, { "from": "human", "value": "module Kennedy\n class PostDecorator < Georgia::PageDecorator\n\n def template_path\n \"posts/templates/#{model.template}\"\n end\n\n def url options={}\n ...
ruby
chosen
[ { "from": "system", "value": "Fix certificates download without next appointment\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass ConsultationPresenter < SimpleDelegator\n def date\n created_at.strftime('%F')\n end\n\n def long_date\n created_at.strftime('%b %d,...
ruby
chosen
[ { "from": "system", "value": "Fix downcase issue on rails 4\n" }, { "from": "human", "value": "module Librato\n module Rails\n module Subscribers\n\n # Controllers\n\n ActiveSupport::Notifications.subscribe 'process_action.action_controller' do |*args|\n\n event = ActiveSupp...
ruby
chosen
[ { "from": "system", "value": "Use name tag for create temporary file\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule SwaggerDocsGenerator\n # # Parse classes\n #\n # @abstract Classes for parsing Rails classes\n #\n # @!attribute [r] controller\n # It's a name ...
ruby
chosen
[ { "from": "system", "value": "Update gemspec with dependency and homepage\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'tomato_paste/version'\n\nGem::Specification.new do |spec|\n ...
ruby
chosen
[ { "from": "system", "value": "Make generated war ignore its environment\n" }, { "from": "human", "value": "# Warbler web application assembly configuration file\nWarbler::Config.new do |config|\n config.includes = FileList[\"appengine-web.xml\", \"datastore-indexes.xml\"]\n\n if ENV['JRUBY_RAC...
ruby
chosen
[ { "from": "system", "value": "Stop require resource model and fix namespace\n" }, { "from": "human", "value": "require 'api/job_instance_resource'\nclass Kuroko2::Api::JobInstancesController < Kuroko2::Api::ApplicationController\n include Garage::RestfulActions\n\n validates :create do\n ha...
ruby
chosen
[ { "from": "system", "value": "Remove JRClj testing code from Home controller.\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n def index\n @users = User.all\n\n clj = JRClj.new\n clj.inc 0\n\n circle = JRClj.new \"circle.init\"\n\n db = JRClj.new ...
ruby
chosen
[ { "from": "system", "value": "Use correct server log location\n" }, { "from": "human", "value": "=begin rdoc\n=Description\nTails the rsna edge servers logs\n=end\nclass TailController < ApplicationController\n before_filter :super_authenticate\n before_filter :get_cart\n hipaa_filter\n\n # ...
ruby
chosen
[ { "from": "system", "value": "Add \"archive_pending_delete\" to state presenter" }, { "from": "human", "value": "class StateChangePresenter < BasePresenter\n\n presents :version\n\n def change\n if version.changeset['state'].present?\n new_state = version.changeset['state'].last\n ...
ruby
chosen
[ { "from": "system", "value": "Clear deliveries after spec runs\n" }, { "from": "human", "value": "# This file is copied to spec/ when you run 'rails generate rspec:install'\nENV['RAILS_ENV'] ||= 'test'\nrequire File.expand_path('../../config/environment', __FILE__)\n# Prevent database truncation...
ruby
chosen
[ { "from": "system", "value": "Intsort: Fix igor script, add plot script.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\nrequire 'igor'\n\n# inherit parser, sbatch_flags\nload '../../../igor_common.rb'\n\nIgor do\n include Isolatable\n\n database '~/exp/sosp.db', :intsort\n\n # isolat...
ruby
chosen
[ { "from": "system", "value": "Disable SM generation of UG's for now\n" }, { "from": "human", "value": "SitemapGenerator::Sitemap.default_host = 'https://ugl.st'\nSitemapGenerator::Sitemap.sitemaps_host = \"http://uglst-#{Rails.env}.s3.amazonaws.com/\"\nSitemapGenerator::Sitemap.public_path = 'tm...
ruby
chosen
[ { "from": "system", "value": "Refactor to include policy user predicates into policy scopes" }, { "from": "human", "value": "class ApplicationPolicy\n attr_reader :user, :record\n \n def initialize(user, record)\n @user = user\n @record = record\n end\n \n def index?\n true\n end...
ruby
chosen
[ { "from": "system", "value": "Fix for one liner OpenStruct method\n" }, { "from": "human", "value": "require './lib/ruby-prof/rails/config'\nrequire './lib/ruby-prof/rails/profiles'\nrequire './lib/ruby-prof/rails/printers'\nrequire './lib/ruby-prof/rails/filename_module'\nrequire 'digest/sha1'\...
ruby
chosen
[ { "from": "system", "value": "Fix to return simply class instance.\n" }, { "from": "human", "value": "module VersatileRJS\n class Proxy\n module FrameworkDependent\n def self.included(base)\n base.extend ClassMethods\n end\n\n module ClassMethods\n def new_instan...
ruby
chosen
[ { "from": "system", "value": "Remove stuff making errors harder to figure out\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Spec\n CommandExecution = Struct.new(:command, :working_directory, :exitstatus, :stdout, :stderr) do\n def to_s\n c = Shellwords.shell...
ruby
chosen
[ { "from": "human", "value": "Add capybara tests for liking and dislike\n" }, { "from": "gpt", "value": "require 'rails_helper'\nrequire 'spec_helper'\n\nRSpec.feature \"Likes\", type: :feature do\n\tdescribe \"With a single like\" do\n\t\tlet!(:user_moderator){ FactoryGirl.create(:user_moderator...
ruby
chosen
[ { "from": "system", "value": "Use a simple dynamic class instead of constant stuff to test default store.\n" }, { "from": "human", "value": "require 'helper'\n\ndescribe Toy::Connection do\n describe \"store\" do\n it \"should set the default store\" do\n Toy.store = RedisStore\n T...
ruby
chosen
[ { "from": "system", "value": "Remove usage of RubyGems in newly added SQLServer adapter\n\nSigned-off-by: Alex Coles <60c6d277a8bd81de7fdde19201bf9c58a3df08f4@alexcolesportfolio.com>\n" }, { "from": "human", "value": "require DataMapper.root / 'lib' / 'dm-core' / 'adapters' / 'data_objects_adapt...
ruby
chosen
[ { "from": "system", "value": "Add disabled to list of field attributes\n" }, { "from": "human", "value": "module Yaks\n # Based on the HTML living standard over at WHATWG\n # https://html.spec.whatwg.org/multipage/forms.html\n #\n # Does not aim to be complete, does aim to be a strict subset...
ruby
chosen
[ { "from": "system", "value": "Update use of RMagick API to read the image data from a blob since the content comes via arguments and not a local file\n\n\ngit-svn-id: 6d9b9a8f21f96071dc3ac7ff320f08f2a342ec80@33 daa9635f-4444-0410-9b3d-b8c75a019348\n" }, { "from": "human", "value": "require 'RMag...
ruby
chosen
[ { "from": "system", "value": "Remove height/width options as they don't make sense for this embed\n" }, { "from": "human", "value": "require 'uri'\nrequire 'net/http'\n\nAutoHtml.add_filter(:instagram).with(:width => 616, :height => 714) do |text, options|\n text << '/' unless text.end_with?('/...
ruby
chosen
[ { "from": "human", "value": "Add :locale param to routes of scoped engines\n\nThis prevents an invalid \"?locale=xx\" from being added to the\nquerystring on engine routes for engines mounted with a scope that\nhas its own :locale parameter\n" }, { "from": "gpt", "value": "module Rails\n class ...
ruby
chosen
[ { "from": "system", "value": "Add the Ruby version as the title of the notification" }, { "from": "human", "value": "module InfinityTest\n module Core\n class Notifier\n include ::Notifiers\n\n attr_reader :test_framework, :library\n\n IMAGES = File.expand_path(File.join(File....
ruby
chosen
[ { "from": "system", "value": "Increase the version to make the documentation go live.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"devise_browserid_authenticatable\"\n s.summary = \"BrowserID/Persona authentication for Devise 2+\"\n s.description ...
ruby
chosen
[ { "from": "system", "value": "Fix bundler dependency for Ruby 2.0.0\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'proc_to_ast/version'\n\nGem::Specification.new do |spec|\n spec.n...
ruby
chosen
[ { "from": "human", "value": "Add task for disabling system comments\n" }, { "from": "gpt", "value": "# encoding: utf-8\n#--\n# Copyright (C) 2013 Gitorious AS\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public L...
ruby
chosen
[ { "from": "system", "value": "Add weekly event and url.\n" }, { "from": "human", "value": "require \"utopia_dungeon_notifier\"\n\nrequire \"summons_board\"\nrequire 'thor'\nrequire \"im-kayac\"\n\nmodule UtopiaDungeonNotifier\n class CLI < Thor\n desc \"check \\${uid} \\${imKayac_UserName} \...
ruby
chosen
[ { "from": "system", "value": "Fix for reading binary file on Windows\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# NOTE: This class has to be defined in compact style in\n# order for rendering context subclassing to work correctly.\nclass ActiveRecord::FixtureSet::RenderC...
ruby
chosen
[ { "from": "system", "value": "Use factory to create test member\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe MembersController do\n\n describe \"GET 'index'\" do\n it \"returns http success\" do\n get 'index'\n response.should be_success\n end\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add spec for workers controller\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Kuroko2::WorkersController, :type => :controller do\n routes { Kuroko2::Engine.routes }\nend\n" }, { "from": "gpt", "value": "require 'rails_help...
ruby
chosen
[ { "from": "system", "value": "Add newline at end of status check\n" }, { "from": "human", "value": "module EndpointBase\n module Sinatra\n class Base < ::Sinatra::Base\n include EndpointBase::Concerns::TokenAuthorization\n include EndpointBase::Concerns::ParamProcessor\n inclu...
ruby
chosen
[ { "from": "system", "value": "Fix exception name in unit test\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe SecretsController, type: :controller do\n before do\n @secret = FactoryGirl.build(:secret)\n end\n\n describe \"GET #show\" do\n it \"returns http su...
ruby
chosen
[ { "from": "system", "value": "Fix user answers questions spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"User answers question\" do\n fixtures :users, :questions\n let(:user) { users(:tester) }\n\n describe \"answering question\" do\n\n before(:each) do\n c...
ruby
chosen
[ { "from": "system", "value": "Remove default because MYSQL blows up\n" }, { "from": "human", "value": "class AddAllowedChildrenCacheToPages < ActiveRecord::Migration\n def self.up\n add_column :pages, :allowed_children_cache, :text, default: ''\n Page.reset_column_information\n Page.fi...
ruby
chosen
[ { "from": "system", "value": "Update cover_image_uploader spec to use rspec 3\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe CoverImageUploader do\n\n def fixture_image\n File.open(File.join(Rails.root, '/spec/fixtures/images/transparent.png'))\n end\n\n let(:cover_im...
ruby
chosen
[ { "from": "system", "value": "Change render from login to new\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def new\n render :login\n end\n\n def create\n @user = User.find_by(email: params[:email])\n if @user && @user.authenticate(params[:pa...
ruby
chosen
[ { "from": "system", "value": "Add logic to session controller\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n def new\n end\n\n def create\n end\n\n def destroy\n end\nend\n" }, { "from": "gpt", "value": "class SessionsController < Applicat...
ruby
chosen
[ { "from": "system", "value": "Sort upgrades by server name in upgrades/index\n" }, { "from": "human", "value": "class UpgradesController < InheritedResources::Base\n respond_to :html, :js\n\n include SortHelpers\n\n protected\n\n def sort_column_prefix\n \"upgrades.\"\n end\n helper_met...
ruby
chosen
[ { "from": "system", "value": "Correct the lookup for the switch on order cancelled mail\n" }, { "from": "human", "value": "class IslayShop::OrderMailer < ActionMailer::Base\n helper '/islay/public/application'\n\n default :from => Settings.for(:shop, :email),\n :bcc => Settings.for(:s...
ruby
chosen
[ { "from": "system", "value": "Add details_text field for answers\n" }, { "from": "human", "value": "require 'roar/decorator'\nrequire 'roar/json'\nrequire 'roar/xml'\n\nclass AnswerRepresenter < Roar::Decorator\n include Roar::JSON\n include Roar::XML\n\n self.representation_wrap = :answer\n\...
ruby
chosen
[ { "from": "system", "value": "Check for any character which is not whitespace\n" }, { "from": "human", "value": "module Etsource\n def self.datasets\n @datasets ||= Hash[Atlas::Dataset::Derived.all.map do |dataset|\n [dataset.geo_id, dataset]\n end]\n end\n\n # Returns all dataset ...
ruby
chosen
[ { "from": "system", "value": "Stop messing with LDFLAGS when cross-compiling\n\nLDFLAGS cannot be used to link to specific versions, instead\nwe should use extconf '--with-opt-dir'.\n" }, { "from": "human", "value": "# use rake-compiler for building the extension\nrequire 'rake/extensiontask'\n\...
ruby
chosen
[ { "from": "system", "value": "Improve robustness of warden password strategy\n" }, { "from": "human", "value": "Dir.glob(File.dirname(__FILE__) + '/warden_plugin/**/*.rb').each { |f| require f }\n\nmodule SinatraMore\n module WardenPlugin\n def self.registered(app)\n app.use Warden::Ma...
ruby
chosen
[ { "from": "system", "value": "Set local caching to false." }, { "from": "human", "value": "Wetheentities::Application.configure do\n # Settings specified here will take precedence over those in config/application.rb\n\n # In the development environment your application's code is reloaded on\n ...
ruby
chosen
[ { "from": "human", "value": "Add new \"rake fastly:purge\" command for purging Fastly cache\n\n This is useful when making changes to the code that cause\n sudden changes in the displayed badge level.\n\n This isn't tested yet, so there may be further changes to come.\n\nSigned-off-by: David A. Wheeler <...
ruby
chosen
[ { "from": "system", "value": "Read bing api key from ENV to be Heroku friendly\n" }, { "from": "human", "value": "require 'yaml'\nmodule WhosDatedWho\n class BingClient\n API_KEY = YAML.load_file( File.expand_path('~/.whos_dated_who.yml'))[:bing_api_key]\n\n def initialize(api_key=API_KEY...
ruby
chosen
[ { "from": "system", "value": "Fix a syntax error in etcd report handler.\n" }, { "from": "human", "value": "require 'chef/handler'\nrequire 'etcd'\nrequire 'json'\n\nclass Chef\n class Handler\n class EtcdReport < Chef::Handler\n\n attr_reader :etcd\n\n def initialize(options={})\n...
ruby
chosen
[ { "from": "human", "value": "Test that email alerts are configured correctly\n\nWe currently don't test that the \"keys\" to which a user can subscribe\nare actually valid. If one of the keys is mistyped or the original\nvalue removed, this would result in people being subscribed to subjects\nfor which an e...
ruby
chosen
[ { "from": "system", "value": "Allow anonymous access to files\n" }, { "from": "human", "value": "module Lanes::API::Handlers\n\n class Asset\n\n def self.saver\n lambda do\n Lanes.logger.debug \"Saving File. Root=#{CarrierWave.root}\"\n\n path =...
ruby
chosen
[ { "from": "system", "value": "Refactor Destroy operation to remove fail_fast directives\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Pragma\n module Operation\n # Finds an existing record, destroys it and responds 204 No Content.\n #\n # @author Alessandro...
ruby
chosen
[ { "from": "system", "value": "Fix to work in Rails 4.x\n" }, { "from": "human", "value": "module S3MultipartUpload\n class File\n attr_accessor :url, :file_size, :mime_type\n\n def part(starts, ends)\n end\n\n def split_into_parts(part_size)\n boundaries = Range.new(0, file_siz...
ruby
chosen
[ { "from": "system", "value": "Fix delete when something is not yet there\n" }, { "from": "human", "value": "# Copyright (c) 2014, Stuart Glenn, OMRF\n# Distributed under a BSD 3-Clause\n# Full license available in LICENSE.txt distributed with this software\n\nclass Optical::Filters::NullFilter\n...
ruby
chosen
[ { "from": "system", "value": "Extend attachment cleanup to all objects\n" }, { "from": "human", "value": "namespace :attachments do\n\n desc \"Clean attachments older than 2 years\"\n\n task :cleanup => :environment do\n Invoice.where(\"pdf_updated_at < ?\", 2.years.ago).each do |i|\n ...
ruby
chosen
[ { "from": "system", "value": "Change sub command name `generate` to `new`\n\nBecause Rails uses `new` to create new project. I want to use `generate`\nto generate other files such as concrete crawlers and processors.\n" }, { "from": "human", "value": "require 'thor'\nrequire 'daimon_skycrawlers/...
ruby
chosen
[ { "from": "human", "value": "Create Bank Billet class inheriting from Payment class\n" }, { "from": "gpt", "value": "module E4commerce\n\n\tclass BankBillet < E4CPayment\n\t\tattr_accessor :product_list\n\t\tattr_accessor :total\n\n\t\tdef calculate_total(products)\n\n\t\tend\n\n\t\tdef create_p...
ruby
chosen
[ { "from": "system", "value": "Fix tomorrow? to account for last day of month\n" }, { "from": "human", "value": "module TimeHelpers\n def self.today?(time)\n now = Time.new\n today_start = Time.new(now.year, now.month, now.day)\n today_end = today_start + 86399\n (today_start..today_...
ruby
chosen
[ { "from": "system", "value": "Change variable passphrase to password.\n\nThe variable passphrase does no longer exists in GPGME.\n" }, { "from": "human", "value": "require 'gpgme'\n\nmodule GooderData\n\n class SessionId\n\n def initialize(user_email, options = {})\n @crypto = GPGME::Cr...
ruby
chosen
[ { "from": "human", "value": "Add Admin Controller show Action\n\nAdd an Admin controller with a show action.\n" }, { "from": "gpt", "value": "class AdminController < ApplicationController\n before_filter :authenticate_user!\n before_filter :get_club\n\n def show\n authorize! :update, @club...
ruby
chosen
[ { "from": "system", "value": "Make new club action render show instead of index\n\nThat seems to be a bit more natural\n" }, { "from": "human", "value": "class ClubsController < ApplicationController\n def index\n @clubs = Club.all\n end\n\n def create\n @club = Club.new(params.require(...
ruby
chosen
[ { "from": "system", "value": "Manage case for nomenclature change output default value\n" }, { "from": "human", "value": "module ParsePgArray\n def parse_array(attribute)\n # byebug\n attr = read_attribute(attribute)\n return [] unless attr.present?\n attr.map(&:to_s)\n end\nend\n"...
ruby
chosen
[ { "from": "system", "value": "Remove unused instance variable in user controller.\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n def index\n\n end\n\n def show\n \t@user = User.find(params[:id])\n @question = Question.find(params[:id])\n end\n\n\nend" ...
ruby
chosen
[ { "from": "system", "value": "Update Users Controller for Mercury Actions\n\nUpdate the Users controller to handle the parameters passed by the\nMercury editor.\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n def edit\n if user_signed_in?\n @user = cur...
ruby
chosen
[ { "from": "system", "value": "feat: Remove pwm number from dimmer device\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: dimmer_devices\n#\n# id :integer not null, primary key\n#\n\nclass DimmerDevice < ActiveRecord::Base\n\n inherit DeviceBase\n include ...
ruby
chosen
[ { "from": "system", "value": "Make sure that migration file ends with .rb\n" }, { "from": "human", "value": "require 'rails/generators/active_record'\n\nmodule ActiveRecord\n module Generators\n class DeviseUserbinGenerator < ActiveRecord::Generators::Base\n source_root File.expand_path...
ruby
chosen
[ { "from": "human", "value": "Add a test for ca usages so ca_cert rotation works\n\nIf you use ((ca.certificate)) when refering to a certificate's CA cert,\nthen you will only get the latest CA certificate interpolated in the\nmanifest\n\nYou must instead use ((certficate.ca))\n\nWhen you use ((certificate.c...
ruby
chosen
[ { "from": "system", "value": "Refactor a client used in test\n" }, { "from": "human", "value": "Oven.bake :ApiClient, destination: \"tmp/\" do\n format :json\n\n get :users, \"/api/v2/users\"\n get :user, \"/api/v2/users/:id\"\n post :user, \"/api/v2/users\"\n patch :user, \"/api/v2...
ruby
chosen
[ { "from": "system", "value": "Update Gemfile description and summary\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'minimal_state_machine/version'\n\nGem::Specification.ne...
ruby
chosen
[ { "from": "system", "value": "Change variable names in test\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nWhen(/^jeg søker på verket i lånergrensesnittet$/) do\n page = @site.SearchPatronClient\n page.visit\n page.search_with_text(@context[:title])\nend\n\nThen(/^vil jeg finne verke...
ruby
chosen
[ { "from": "system", "value": "Add simple test for finding items by role\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative '../test_helper'\nrequire 'atspi_app_driver'\n\ndescribe 'test driving a dummy application' do\n before do\n @driver = AtspiAppDriver.n...
ruby
chosen
[ { "from": "human", "value": "Add an integration test for the 'my stuff' index.\n" }, { "from": "gpt", "value": "require_relative '../integration_test_helper'\n\nclass MyStuffTest < ActionDispatch::IntegrationTest\n\n def setup\n alice = FactoryGirl.create(:user, name: \"Alice\", uid: \"alice...
ruby
chosen
[ { "from": "system", "value": "Use the same annotator set as the corenlp.run UI\n\nMotivation:\n-makes the results comparable\n-otherwise, for some reason, the results differ making the tool harder\nto work with\n\nChange Explanation:\n-pass additional annotators, don't pass parse\n" }, { "from": "hu...
ruby
chosen
[ { "from": "system", "value": "Test for removal of trailing zeros when inspecting a microsecond-precision time\n" }, { "from": "human", "value": "require_relative '../../spec_helper'\nrequire_relative 'shared/inspect'\n\ndescribe \"Time#inspect\" do\n it_behaves_like :inspect, :inspect\n\n ruby...
ruby
chosen
[ { "from": "system", "value": "Add awesome print to gemspec.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"toolsmith/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s....
ruby
chosen
[ { "from": "system", "value": "Fix first-run issue with pipeline\n" }, { "from": "human", "value": "class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension\n self.supports_multiple_instances = true\n\n option :name, nil, 'The name of the pipeline', required: true\n option :comma...
ruby
chosen
[ { "from": "system", "value": "Add owner_id and owner_name to playlists table\n" }, { "from": "human", "value": "class CreatePlaylists < ActiveRecord::Migration[4.2]\n def self.up\n create_table :playlists, id: :uuid, default: \"uuid_generate_v4()\", force: true do |t|\n t.string :provid...
ruby
chosen
[ { "from": "system", "value": "Correct log output for scheduler\n\nCopy/paste mistake from previous work.\n" }, { "from": "human", "value": "require 'chronic'\n\n# https://github.com/ssoroka/scheduler_daemon for help\nclass ManagementInformationV2GenerationTask < Scheduler::SchedulerTask\n every...
ruby
chosen
[ { "from": "system", "value": "Add files to spec helper\n" }, { "from": "human", "value": "require 'rspec-puppet'\n\nfixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))\n\nRSpec.configure do |c|\n c.module_path = File.join(fixture_path, 'modules')\n c.manifest_dir = File.join...
ruby
chosen
[ { "from": "system", "value": "Remove requires from spec helper\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n\nrequire 'tempfile'\nrequire 'rspec'\nrequire 'fakefs/spec_helpers'\nrequire 'mocha'\nrequire 'bio'\nrequire 'genomer'\nrequire '...
ruby
chosen
[ { "from": "system", "value": "Use CodeClimate only if ENVs defined\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'codeclimate-test-reporter'\nrequire 'stringio'\n\nCodeClimate::TestReporter.start do\n add_filter '/spec/'\nend\n\n$LOAD_PATH.unshift File.dirname(__FILE__) + '/.....
ruby
chosen