conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Revert \"Added more to the Bad Request error message to help people debug easier.\"\n\nThis reverts commit dffa9fb73e0cd432be8439e304b5695aae5a4ac6.\n" }, { "from": "human", "value": "module SmartyStreets\n BAD_CREDENTIALS = 'Unauthorized: The credentials were prov...
ruby
chosen
[ { "from": "system", "value": "Use proper name in paypal express response address\n" }, { "from": "human", "value": "module ActiveMerchant #:nodoc:\n module Billing #:nodoc:\n class PaypalExpressResponse < Response\n def email\n @params['payer']\n end\n \n def name\...
ruby
chosen
[ { "from": "system", "value": "Use lvh.me instead of now-defunct smackaho.st.\n" }, { "from": "human", "value": "Given /^the application is set up$/ do\n # Using smackaho.st to give us automatic resolution to localhost\n # N.B. This means some Cucumber scenarios will fail if your machine\n # i...
ruby
chosen
[ { "from": "human", "value": "Write okay solution for unlucky days\n" }, { "from": "gpt", "value": "require \"date\"\n\ndef unlucky_days(year)\n\tdates = get_dates(year)\n\n\tresults = 0\n\tdates.each do |date|\n\t\tresults += 1 if date.friday? && date.day == 13\n\tend\n\tresults\nend\n\ndef get_...
ruby
chosen
[ { "from": "system", "value": "Add log-in exception for books index\n" }, { "from": "human", "value": "class BooksController < ApplicationController\n before_action do\n @current_user = User.find_by id: session[:user_id]\n if @current_user.blank?\n redirect_to sign_in_path\n end\n ...
ruby
chosen
[ { "from": "system", "value": "Add new action for drop\n" }, { "from": "human", "value": "\nclass DropsController < ApplicationController\n\n def show\n drops = Drop.order(\"created_at DESC\").limit(50).to_json\n render json: drops\n end\n\n def create\n # needs `current_user` helper ...
ruby
chosen
[ { "from": "system", "value": "Use strong parameters for search\n" }, { "from": "human", "value": "class SearchController < ApplicationController\n def search\n @query = Query.new(params[:query])\n @query.site_id = current_site.id\n searcher = PostSearcher.new\n @result_set = searche...
ruby
chosen
[ { "from": "system", "value": "Refactor controller to call private methods; leaner request\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'rest-client'\nrequire 'json'\n\n# All of these endpoints should use https://www.inaturalist.org as the base URL, particularly endpoints that r...
ruby
chosen
[ { "from": "system", "value": "Add method for delivery page\n" }, { "from": "human", "value": "class PagesController < ApplicationController\n include CurrentCart\n skip_before_action :authenticate_user!\n before_action :set_cart, only: [:show, :edit, :update, :destroy]\n skip_authorization_c...
ruby
chosen
[ { "from": "system", "value": "Revert \"Quick teacher exam fix\"\n\nThis reverts commit 88a0dd8842fc4046a3b572432468737773d97b90.\n" }, { "from": "human", "value": "module WithMetadata\n extend ActiveSupport::Concern\n\n included do\n serialize :metadata, Mumukit::Auth::Metadata\n\n valid...
ruby
chosen
[ { "from": "system", "value": "Use helpers instead of html in helper, interpolate strings instead of concat\n" }, { "from": "human", "value": "module Spree::ReviewsHelper\n\n def star(the_class)\n \"<span class=\\\"#{the_class}\\\"> &#10030; </span>\"\n end\n\n def mk_stars(m)\n (1..5).c...
ruby
chosen
[ { "from": "system", "value": "Use FigNetwon for test database location\n" }, { "from": "human", "value": "require 'sequel'\nrequire 'database_cleaner'\nrequire 'database_cleaner/cucumber'\n\nDB_URI = 'sqlite://gateway/data/test.sqlite'\nDatabaseCleaner[:sequel, {:connection => Sequel.connect(DB_...
ruby
chosen
[ { "from": "human", "value": "Add multi select paged example.\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\nrequire 'tty-prompt'\n\nprompt = TTY::Prompt.new\n\nalfabet = ('A'..'Z').to_a\n\nprompt.multi_select('Which letter?', alfabet, per_page: 5)\n" } ]
ruby
chosen
[ { "from": "system", "value": "Address Rails 5.2 deprecation warning in specs\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key for verifying the integrity of signed cookies.\n# If you change this key, all old signed cookies will b...
ruby
chosen
[ { "from": "system", "value": "Remove line that made install failing\n" }, { "from": "human", "value": "require 'formula'\n\nclass WkhtmltopdfOld < Formula\n url 'http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9.tar.bz2'\n homepage 'http://code.google.com/p/wkhtmltopdf/'\n sha256 'e63...
ruby
chosen
[ { "from": "system", "value": "Extend spec to test reference support.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ninclude WebMock::API\ninclude Tootsie::API\n\ndescribe V1 do\n\n include Rack::Test::Methods\n\n def app\n V1\n end\n\n let! :application do\n app = Tootsie:...
ruby
chosen
[ { "from": "system", "value": "Fix ChefSpec failures from new idempotence check\n\n- Add ChefSpec test case for .NET already being installed\n- Add ChefSpec test to ensure windows_reboot is properly notified\n" }, { "from": "human", "value": "describe 'dotnetframework::default' do\n\n let(:chef_...
ruby
chosen
[ { "from": "system", "value": "Put it back into headless mode\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nENV['RAILS_ENV'] ||= 'test'\nrequire 'spec_helper'\nrequire File.expand_path('../../config/environment', __FILE__)\nrequire 'rspec/rails'\nrequire 'support/devise/test...
ruby
chosen
[ { "from": "system", "value": "Improve error reporting in system tests\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'support/environment'\n\nmodule HttpHelpers\n include EnvironmentHelpers\n\n def make_get_request(path, args={})\n try_catch {\n RestClient:...
ruby
chosen
[ { "from": "system", "value": "Use a regexp for the content type.\n" }, { "from": "human", "value": "# Frozen-string-literal: true\n# Copyright: 2012 - 2018 - MIT License\n# Encoding: utf-8\n\nrequire \"jekyll/assets\"\n\nmodule Jekyll\n module Assets\n module Plugins\n class ImageOptim ...
ruby
chosen
[ { "from": "human", "value": "Add a rake task to generate a CSV of Local Transactions\n\n- Generates a CSV of the form \"slug\",\"lgsl\",\"lgil\",\"title\".\n- This might need to be done again in future, and across environments,\n hence the rake task.\n" }, { "from": "gpt", "value": "desc \"Expo...
ruby
chosen
[ { "from": "system", "value": "Add to_json to payload object.\n" }, { "from": "human", "value": "module ThreeSeventyApi\n module Helpers\n module Request\n def client\n @client ||= RestClient::Resource::new(@url, :user => @username, :password => @password)\n end\n def ge...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in Wuala Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'wuala' do\n version :latest\n sha256 :no_c...
ruby
chosen
[ { "from": "system", "value": "Make sure content types update their column.\n" }, { "from": "human", "value": "module Concerns\n module ContentType\n extend ActiveSupport::Concern\n\n def column\n ::ContentColumn.where(content_type: self.class.name, content_id: id).take\n end\n en...
ruby
chosen
[ { "from": "system", "value": "Add a 'rerender' command to the publish dialogue\n\nwhich is a developer-only feature that allows the public site to be re-rendered using the current published content to pick up any template/asset changes\n" }, { "from": "human", "value": "module Spontaneous::Rack:...
ruby
chosen
[ { "from": "human", "value": "Add task which fixes dangling projects\n" }, { "from": "gpt", "value": "desc 'Removes projects with missing owners'\ntask :fix_dangling_projects do\n [User, Group].each do |owner|\n table_name = owner.table_name.to_sym\n\n projects = Project.unscoped.\n j...
ruby
chosen
[ { "from": "system", "value": "Remove 'Square' from the title of the RSS feed\n" }, { "from": "human", "value": "xml.rss({:version => \"2.0\"}) do\n xml.channel do\n xml.title(\"Square Build Server RSS Feed\")\n xml.link(root_url)\n xml.language(\"en\")\n xml.ttl(10)\n \n @buil...
ruby
chosen
[ { "from": "system", "value": "Fix rspec expectation set on nil warning\n" }, { "from": "human", "value": "describe ApplicationHelper::Button::HostIntrospectProvide do\n let(:provision_state) { 'not_manageable' }\n let(:record) { FactoryGirl.create(:host_openstack_infra, :with_hardware) }\n le...
ruby
chosen
[ { "from": "system", "value": "Make sure the Ruby-FFI fixtures are compiled regardless of the current working directory.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'spec'\n\nrequire \"ffi\"\ninclude FFI\n\nmodule TestLibrary\n FIXTURE_DIR = File.expand_path(\"../fixtures\", _...
ruby
chosen
[ { "from": "system", "value": "Fix dataset edit form by Nora\n" }, { "from": "human", "value": "class DatasetEditForm\n include ActiveModel::Model\n include Virtus.model\n\n EditableAttributesCollection.items.each do |item|\n attribute item.key, Float, default: item.default\n end\n\n # At...
ruby
chosen
[ { "from": "system", "value": "Handle sign in with the session method\n\nThe recomended in method with an authentication token did not work,\ntherefore I used the sign in method. I still have to check why it\nwasn't working, I do not yet understand how the sign in method works.\n" }, { "from": "human...
ruby
chosen
[ { "from": "system", "value": "Revert commit to restore raise_404 if region ISO is GL\n" }, { "from": "human", "value": "class RegionController < ApplicationController\n before_filter :load_vars\n\n def show\n end\n\n private\n\n def load_vars\n @region = Region.where(iso: params[:iso].up...
ruby
chosen
[ { "from": "system", "value": "Fix error handling and update user types\n" }, { "from": "human", "value": "class MailchimpSubscriber\n class Error < StandardError; end\n\n def initialize(mailchimp_api)\n @mailchimp_api = mailchimp_api\n end\n\n def subscribe(school, user)\n list = @mail...
ruby
chosen
[ { "from": "human", "value": "Create tests to 'test an answer' feature\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe \"Test an answer\", type: :feature, js: true do\n let(:user) { create(:user, :teacher) }\n let(:exercise) { create(:exercise, user: user) }\n let!(:questio...
ruby
chosen
[ { "from": "system", "value": "Test for error without content or non json content\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe BaseCRM::Middlewares::RaiseError do\n\n describe \"on_complete 200..300\" do\n raise_error = BaseCRM::Middlewares::RaiseError.new\n it { ...
ruby
chosen
[ { "from": "system", "value": "Raise if page not found\n" }, { "from": "human", "value": "module Brightcontent\n module Pages\n module Methods\n def current_page\n @current_page ||= Page.find_by_slug(request.fullpath[1..-1])\n end\n end\n end\nend\n" }, { "from": ...
ruby
chosen
[ { "from": "system", "value": "Upgrade Opera Beta.app to v30.0.1835.47\n" }, { "from": "human", "value": "cask :v1 => 'opera-beta' do\n version '30.0.1835.18'\n sha256 '7c27bfd506a5d3a9a41eabd27908344269d1d4f5a85d451d2d2ce0a9ee602993'\n\n url \"http://get.geo.opera.com/pub/opera-beta/#{version...
ruby
chosen
[ { "from": "system", "value": "Create CRUD methods for materials controller\n" }, { "from": "human", "value": "class Api::MaterialsController < ApplicationController\n skip_before_action :verify_authenticity_token\n \n def index\n end\n\n def create\n end\n\n def update\n end\n\n def des...
ruby
chosen
[ { "from": "system", "value": "Add missing gitlab_user_name attribute to attributes reported for gitlab_client_identity.\n" }, { "from": "human", "value": "json.id gitlab_client_identity.id\njson.user_id gitlab_client_identity.user_id\njson.host gitlab_client_identity.host\njson.gitlab_user_id gi...
ruby
chosen
[ { "from": "system", "value": "Include a JSON healthcheck for ELB which does not 500 if the app is up\n" }, { "from": "human", "value": "class HealthChecksController < ApplicationController\n\n def index\n @health_checks = HealthChecks.all\n\n respond_to do |format|\n if HealthChecks....
ruby
chosen
[ { "from": "system", "value": "Allow NS::COMBINED to be used in building xml\n" }, { "from": "human", "value": "module ActiveCMIS\n # This module defines namespaces that often occur in the REST/Atompub API to CMIS\n module NS\n CMIS_CORE = \"http://docs.oasis-open.org/ns/cmis/core/200908/\"\...
ruby
chosen
[ { "from": "system", "value": "Include DSL and RSpecMatchers into system specs by default\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'rspec/core'\nrequire 'capybara/dsl'\nrequire 'capybara/rspec/matchers'\nrequire 'capybara/rspec/features'\nrequire 'capybara/rspec...
ruby
chosen
[ { "from": "system", "value": "Use attr_reader instead of manual getter method\n" }, { "from": "human", "value": "module Grabble\n class Vertex\n def initialize(data)\n @data = data\n end\n\n def data\n @data\n end\n\n end\nend\n" }, { "from": "gpt", "value": "...
ruby
chosen
[ { "from": "system", "value": "Remove stupid comments from experiments\n" }, { "from": "human", "value": "require 'kahuna/event'\nrequire 'kahuna/member_collection'\n\nmodule Kahuna\n class Handler\n attr_reader :event, :members\n\n # def self.build\n # klass = Class.new(BasicObject) ...
ruby
chosen
[ { "from": "system", "value": "Add base skeleton structure to Character\n" }, { "from": "human", "value": "module Poke\n # +Character+ is a base class for both non-player and player characters. It\n # contains various methods for moving, updating, drawing, and collision\n # detection.\n class...
ruby
chosen
[ { "from": "system", "value": "Clear Doc cache when Organization language changes\n" }, { "from": "human", "value": "# The OrganizationsController is responsible for organization management\n\nclass OrganizationsController < ApplicationController\n layout 'workspace'\n\n # Administrators of an ...
ruby
chosen
[ { "from": "system", "value": "Fix syntax errors, abort on any thread exception\n" }, { "from": "human", "value": "require 'vagrant'\n\nrequire 'vagrant-mirror/errors'\nrequire 'vagrant-mirror/version'\nrequire 'vagrant-mirror/config'\n\n# Require the sync tasks\nrequire 'vagrant-mirror/sync/base...
ruby
chosen
[ { "from": "system", "value": "Set expiration date to session cookie\n" }, { "from": "human", "value": "# frozen_string_literal: true\n# Be sure to restart your server when you modify this file.\n\nRails.application.config.session_store(\n :cookie_store,\n key: '_nippo_session',\n secure: Rail...
ruby
chosen
[ { "from": "system", "value": "Update Beatport Pro to 2.1.4\n" }, { "from": "human", "value": "cask :v1 => 'beatport-pro' do\n version '2.1.1_137'\n sha256 '62526d08723e5a54953473a2c1530e5b298ab2a50a491dd2a846bf7c0b9499cb'\n\n url \"http://pro.beatport.com/mac/#{version}/beatportpro_#{version}...
ruby
chosen
[ { "from": "system", "value": "Mark DownloadManuscriptWorker spec as pending\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe DownloadManuscriptWorker do\n let(:paper) { FactoryGirl.create(:paper) }\n let(:url) { \"https://tahi-test.s3.amazonaws.com/temp/about_equations.docx...
ruby
chosen
[ { "from": "system", "value": "Fix for *BSD and Darwin about locale charmap.\n\n* The result of locale charmap is not standardized.\n So even if LANG=C, locale charmap name is not predictable.\n\n* LC_ALL is prior to LANG, so we use LC_ALL.\n" }, { "from": "human", "value": "require File.expand_...
ruby
chosen
[ { "from": "system", "value": "Change file pattern in pod\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"DSSparseArray\"\n s.version = \"1.2.1\"\n s.author = { \"David W. Stockton\" => \"stockton@syntonicity.net\" }\n s.license = 'MIT'\n s.source = { :git => \"https://g...
ruby
chosen
[ { "from": "system", "value": "Use maruku instead of rdiscount for compatibility with JRuby and Rubinius in 1.9 mode\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire File.expand_path('../lib/fcc_reboot/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.add_dependency 'fara...
ruby
chosen
[ { "from": "system", "value": "Use stackable_flash/test_helpers instead of reinventing the wheel\n" }, { "from": "human", "value": "require 'cacheable_flash/test_helpers'\n\nmodule CacheableFlash\n module RspecMatchers\n include CacheableFlash::TestHelpers\n RSpec::Matchers.define :have_fl...
ruby
chosen
[ { "from": "system", "value": "Refactor how an InternalChangeNote is stored\n\nThis refactor will make it easier to optionally add a value for edition_number to the `other_fields` in the next commit.\n" }, { "from": "human", "value": "class InternalChangeNotesController < ApplicationController\n ...
ruby
chosen
[ { "from": "human", "value": "Add package for Deadly Reentry.\n" }, { "from": "gpt", "value": "class DeadlyReentry < Kosmos::Package\n title 'Deadly Reentry'\n url 'https://github.com/NathanKell/DeadlyReentry/releases/download/v4.7/DeadlyReentryCont_v4.7.zip'\n\n def install\n merge_directo...
ruby
chosen
[ { "from": "system", "value": "Rename helper method for clarity\n\nThe method also submits the form so `fill_form` was not accurate.\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'integration/concerns/authentication'\n\nclass AdCreationTest < ActionDispatch::IntegrationTest\n ...
ruby
chosen
[ { "from": "system", "value": "Update Islay dependency to 1.0.3 (which actually exists)\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"islay_blog/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Sp...
ruby
chosen
[ { "from": "system", "value": "Improve method for data load\n" }, { "from": "human", "value": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).\...
ruby
chosen
[ { "from": "system", "value": "Make it so people can find the source from the Gemspec" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"phantomjs-binaries/version\"\n\nGem::Specification.new do |s|\n s.name = \"phantomjs-...
ruby
chosen
[ { "from": "system", "value": "Fix setting paths for Rails 3.1\n" }, { "from": "human", "value": "require 'bulk/routes'\n\nmodule Bulk\n class Engine < Rails::Engine\n initializer \"do not include root in json\" do\n # TODO: handle that nicely\n ActiveRecord::Base.include_root_in_js...
ruby
chosen
[ { "from": "system", "value": "Sort the spec_paths to avoid undefined ordering\n\nI think that it's good practice to keep file lists sorted. Otherwise we\ncan get file-system dependent (undefined) file ordering, and we'll have\norder-dependent tests showing up as unreproducible failures on the build\nserver,...
ruby
chosen
[ { "from": "system", "value": "Add duration, time zone, start, end, location and all day attributes to the calendar item\n" }, { "from": "human", "value": "module Viewpoint::EWS::Types\n class CalendarItem\n include Viewpoint::EWS\n include Viewpoint::EWS::Types\n include Viewpoint::EWS...
ruby
chosen
[ { "from": "system", "value": "Handle missing DBs in connect_to_db?\n\nThis ensures CurrentSettings#connect_to_db? returns \"false\" in the event\nof a database not existing, instead of raising an error.\n" }, { "from": "human", "value": "module Gitlab\n module CurrentSettings\n def current_a...
ruby
chosen
[ { "from": "system", "value": "Handle command arguments arity errors\n" }, { "from": "human", "value": "module Scube\n module CLI\n module Commands\n class Base\n extend Forwardable\n def_delegator :@env, :input\n def_delegator :@env, :print\n def_delegator :@...
ruby
chosen
[ { "from": "system", "value": "Update Coordinates to use new uppercase constants\n" }, { "from": "human", "value": "class Coordinates\n\n def initialize(window, user)\n @window, @user = window, user\n @coordinate_text = Gosu::Font.new(@window, Media::Font, 16)\n end\n\n def update\n @...
ruby
chosen
[ { "from": "system", "value": "Add log messages to instance methods\n" }, { "from": "human", "value": "module Kaleidoscope\n module InstanceMethods\n def colors_for\n end\n\n def generate_colors\n end\n\n def destroy_colors\n end\n end\nend" }, { "from": "gpt", "va...
ruby
chosen
[ { "from": "system", "value": "Drop extra variable from test\n" }, { "from": "human", "value": "require 'abstract_unit'\n\nclass LoadPathsTest < ActiveSupport::TestCase\n def test_uniq_load_paths\n load_paths_count = $LOAD_PATH.inject({}) { |paths, path|\n expanded_path = File.expand_pat...
ruby
chosen
[ { "from": "system", "value": "Remove warning remeving the method before redefining\n\nWe need to test if the same method defined more than once only register\none subscriber for it. We can safelly remove because the method body is\nthe same and Subscriber use method_added hook for register the\nsubscriber.\...
ruby
chosen
[ { "from": "system", "value": "Change shared examples to proper conventions\n" }, { "from": "human", "value": "# encoding: utf-8\nshared_examples_for \"a binary encoded string\" do\n\n let(:binary_encoding) do\n Encoding.find(BSON::BINARY)\n end\n\n it \"returns the string with binary encod...
ruby
chosen
[ { "from": "system", "value": "Add binary paths to chrome(driver) finder(s)\n\nWith the buildpacks we've now added to our heroku apps, we now have two\nbinaries available that we can use when we drive our applications. The\nchanges here point to the location of both of those binaries.\n" }, { "from":...
ruby
chosen
[ { "from": "system", "value": "Improve status report for GoCD issues\n" }, { "from": "human", "value": "require 'pp'\nrequire 'active_support/core_ext/hash'\nrequire 'json'\nrequire 'fileutils'\n\nclass GocdClient\n def initialize(gocd_addr, username, password, projects)\n @gocd_addr = gocd_a...
ruby
chosen
[ { "from": "system", "value": "Make sure files require in the correct order.\n" }, { "from": "human", "value": "require 'ostruct'\nrequire 'json'\nrequire 'monster_mash'\n\nDir.glob(File.dirname(__FILE__) + \"/**/*.rb\").each do |f|\n require f\nend\n\nmodule AlchemyApi\n @api_key = nil\n @bas...
ruby
chosen
[ { "from": "system", "value": "Fix warning instance variable @robots not initialized\n" }, { "from": "human", "value": "require 'spidr/settings/proxy'\nrequire 'spidr/settings/timeouts'\nrequire 'spidr/settings/user_agent'\nrequire 'spidr/agent'\n\nmodule Spidr\n extend Settings::Proxy\n extend...
ruby
chosen
[ { "from": "system", "value": "Add rake task for import alliances\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nnamespace :eve do\n desc 'Import EveOnline Races'\n task races: :environment do\n ActiveRecord::Base.transaction do\n Eve::Race.destroy_all\n\n Race...
ruby
chosen
[ { "from": "system", "value": "Revert \"Use puma for browser specs\"\n\nThis reverts commit a4ff77f90abbe84d1f14ddd3520c217b7e5510ab.\n" }, { "from": "human", "value": "require 'selenium-webdriver'\nrequire 'loadable_component'\n\nrequire_relative 'pages/page'\nrequire_relative 'pages/menu'\nrequ...
ruby
chosen
[ { "from": "system", "value": "Use standard variable casing in specs" }, { "from": "human", "value": "require \"liquid\"\nrequire \"liquid/autoescape/template_variable\"\n\nmodule Liquid\n module Autoescape\n describe TemplateVariable do\n\n it \"requires a variable name\" do\n ex...
ruby
chosen
[ { "from": "system", "value": "Refactor to use ceiling and modulus\n" }, { "from": "human", "value": "NATURAL_NOTES = {\n 'C' => 0,\n 'D' => 2,\n 'E' => 4,\n 'F' => 5,\n 'G' => 7,\n 'A' => 9,\n 'B' => 11\n}.freeze\n\nMODIFIERS = {\n '#' => 1,\n 'b' => -1,\n 'B#' => -11,\n 'Cb' => 11\n}...
ruby
chosen
[ { "from": "system", "value": "Make note of copies existing in preview/production\n" }, { "from": "human", "value": "require 'gds_api/base'\nrequire 'gds_api/content_api'\n\nGdsApi::Base.logger = Logger.new(Rails.root.join(\"log/#{Rails.env}.api_client.log\"))\nGdsApi::Base.default_options = {dis...
ruby
chosen
[ { "from": "system", "value": "Add quotes around GO ID in API call to only get exact matches\n" }, { "from": "human", "value": "require 'open-uri'\n\nmodule Genome; module OnlineUpdaters; module Go;\n class ApiClient\n def genes_for_go_id(id, start=0, rows=500)\n get_entries(gene_lookup_...
ruby
chosen
[ { "from": "human", "value": "Add data type strategy (Tools::DataType)\n\nThe DataType strategy uses the data type of any primitive or enum property as the generated data.\nMight help you to visually understand a JSON Schema better (maybe).\n" }, { "from": "gpt", "value": "#\n# The DataType strat...
ruby
chosen
[ { "from": "system", "value": "Add http protocol to homepage URI in gemspec\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"locationer/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification....
ruby
chosen
[ { "from": "system", "value": "Make sure message does not get sent when no commitee has been selected\n" }, { "from": "human", "value": "class ContactController < ApplicationController\n\ndef index \n @contact = Contact.new\nend\n\ndef create \n if params[:value].blank? then\n contact_pa...
ruby
chosen
[ { "from": "human", "value": "Add examples for command line options.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nRSpec.describe Aws::SSM::Console::Options, type: :lib do\n describe '#new' do\n subject { described_class.new(argv) }\n\n describe '--instance-id' do\n contex...
ruby
chosen
[ { "from": "system", "value": "Hide Display Name option choices in profile edit if blank\n\nIt's possible the user name options for setting Display Name\nare blank or empty strings so let's check for that in addition\nto if they're set in the first place.\n" }, { "from": "human", "value": "module...
ruby
chosen
[ { "from": "system", "value": "Remove timepicker from allocation views\n" }, { "from": "human", "value": "module AllocationsHelper\n def start_time_form_column(record, options)\n options[:class] += \" time_picker\"\n text_field :record, :start_time, {\n }.merge(options)\n end\n def en...
ruby
chosen
[ { "from": "system", "value": "FIX: Switch gsub in lesc to ensure running on text\n" }, { "from": "human", "value": "module ApplicationHelper\n def application_reference_date\n @application_reference_date ||=\n if Doubtfire::Application.config.respond_to?(:application_reference_date)\n ...
ruby
chosen
[ { "from": "system", "value": "Add width and height to opengraph image\n" }, { "from": "human", "value": "module ApplicationHelper\n\n def build_meta_tags(description: \"We're a bunch of professionals and hobbyists who share a passion in programming with Ruby.\", title: nil, image: path_to_image...
ruby
chosen
[ { "from": "system", "value": "Correct `event_host?` with nil check on `@event`\n\n`@event` will be nil if we aren't in an event's scope!\n" }, { "from": "human", "value": "module ApplicationHelper\n\n def admin?\n !current_user.nil? and current_user.admin?\n end\n\n def event_host?\n ev...
ruby
chosen
[ { "from": "system", "value": "Remove unrelated specs from the config suite\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe file('/etc/rundeck/realm.properties') do\n it { should be_file }\n it { should be_mode 644 }\n it { should be_owned_by 'rundeck' }\n it { should be_...
ruby
chosen
[ { "from": "system", "value": "Adjust tests for analisys module\n\n- check only if response to methods\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'test_helper'\nclass PcRailsCodeQuality::Analysis::Test < ActiveSupport::TestCase\n teardown do\n FileUtils.rm_rf('p...
ruby
chosen
[ { "from": "system", "value": "Add ActionCable require statement to plugin\n\nWhen generating a plugin without ActiveRecord (-O),\nActionCable wasn't include, which causes problems with the\nrequire action_cable statement in cable.js\n\nadd active_job require statement\n\nalso updated order of require statem...
ruby
chosen
[ { "from": "system", "value": "Support T and F as boolean suffixes\n" }, { "from": "human", "value": "# This module lets models fill Yes/No fields more succinctly.\n#\n# Invoke like this:\n#\n# when /Married(#{boolean_regex})/\n# boolean_field $1 do married? end\n#\n# This will support all bool...
ruby
chosen
[ { "from": "system", "value": "Remove delete digitals on soft delete of variant\n" }, { "from": "human", "value": "Spree::Variant.class_eval do\n \n has_many :digitals, :dependent => :destroy\n after_save :destroy_digital, :if => :deleted?\n \n # Is this variant to be downloaded by the custo...
ruby
chosen
[ { "from": "system", "value": "Use https in the gemspec homepage\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire_relative 'lib/abstract_class/version'\n\nGem::Specification.new do |s|\n s.name = 'abstract_class'\n s.version = AbstractClass::Version\n s.platform = G...
ruby
chosen
[ { "from": "system", "value": "Add keywords for category selection.\n\n~ 800 categories / 10'000 articles with these key words.\n" }, { "from": "human", "value": "arr = []\nline_num=0\ntext=File.open(ARGV[0]).read\ntext.gsub!(/\\r\\n?/, \"\\n\")\ntext.each_line do |line|\n line.scan(/'([^']*)',/...
ruby
chosen
[ { "from": "human", "value": "Add code wars (6) - extract ids from data set\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/5158bfce931c51b69b000001\n# ---- iteration 1 ---\ndef extract_ids(data)\n result_ids = []\n result_ids << data[:id]\n if data[:items]\n data[:items].e...
ruby
chosen
[ { "from": "system", "value": "Fix another typo in filter\n\n-.-\n" }, { "from": "human", "value": "\n# NOTE: the percentage may easily go above 100% when there are more\n# changes than the whole site had lines before.\n\nWCC::Filters.add 'rel_changes_of' do |data,args|\n\tnext true if data...
ruby
chosen
[ { "from": "system", "value": "Revert using SSH URL to HTML URL so it can be opened in the browser\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'json'\n\nmodule Github\n class Repo\n attr_reader :name, :link\n\n def initialize(name, link)\n @name = name\...
ruby
chosen
[ { "from": "system", "value": "Use gsub instead of delete method to fetch OGP description\n" }, { "from": "human", "value": "class Document\n attr_reader :id, :filename\n DIR_PATH = 'db/docs'\n URL_PATH = 'docs'\n\n class << self\n def all\n Dir.glob(\"#{DIR_PATH}/*.md\").sort.map do ...
ruby
chosen