conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use ETSource fixture in the GQL controller spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Data::GqueriesController do\n render_views\n\n let!(:admin) { FactoryGirl.create :admin }\n let!(:gquery) { Gquery.all.first }\n\n before do\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"All tests inside states.js need to be JavaScript and click the 'More' link first\"\n\nThis reverts commit 2eb1a091eee2804cf217e2e88c07d8f785f718c0.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"States\", :js => true do\n stub_autho...
ruby
chosen
[ { "from": "system", "value": "Fix crash in color indicator count condition\n" }, { "from": "human", "value": "class ConditionColorCountExpr < ConditionSimple\n def initialize(a, op, b)\n @a = a.downcase\n @op = op\n @b = b.to_i\n end\n\n def match?(card)\n if @a == \"c\"\n a ...
ruby
chosen
[ { "from": "system", "value": "Fix migration (add default time zone)\n" }, { "from": "human", "value": "class AddUserTimeZones < ActiveRecord::Migration\n def self.up\n add_column :users, :time_zone, :string\n end\n\n def self.down\n remove_column :users, :time_zone\n end\nend\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Generalize before block outside be able to reuse it in dashboard spec\n" }, { "from": "human", "value": "describe ReportController do\n context \"::Dashboards\" do\n context \"#db_edit\" do\n let(:user) { FactoryGirl.create(:user, :features => \"db_edit\") ...
ruby
chosen
[ { "from": "human", "value": "Add unit test for airbrake-1781551925379466692\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe 'Airbrake-1781551925379466692' do\n\tit 'can deal with comment is nil' do\n\t\tquestionnaire = Questionnaire.new\n\t\tqs = VmQuestionResponse.new(questi...
ruby
chosen
[ { "from": "system", "value": "Fix specs - delete comment is now a button instead of simple link\n" }, { "from": "human", "value": "require 'spec_helper'\n\nshared_examples 'reportable note' do\n include NotesHelper\n\n let(:comment) { find(\"##{ActionView::RecordIdentifier.dom_id(note)}\") }\n...
ruby
chosen
[ { "from": "system", "value": "Fix down migration - removing column removes index\n" }, { "from": "human", "value": "class AddFieldsToLocalities < ActiveRecord::Migration\n def self.up\n add_column :localities, :qualifier_locality, :string\n add_column :localities, :qualifier_district, :st...
ruby
chosen
[ { "from": "system", "value": "Check for index before creation in merit points score\n" }, { "from": "human", "value": "class AlignSchemaAndLiveDb < ActiveRecord::Migration[5.2]\n def change\n change_column_null :sashes, :created_at, false\n change_column_null :sashes, :updated_at, false\n...
ruby
chosen
[ { "from": "system", "value": "Exclude acts_as_list 0.6.0 because of a bug.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"rticles/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new...
ruby
chosen
[ { "from": "system", "value": "Update the example with the new features of WDM\n" }, { "from": "human", "value": "require_relative '../lib/wdm'\n\nmonitor = WDM::Monitor.new\nmonitor.watch('C:\\Users\\Maher\\Desktop\\test') { puts \"change 1!\" }\nmonitor.watch('C:\\Users\\Maher\\Desktop\\psds') ...
ruby
chosen
[ { "from": "system", "value": "Allow copy/move to copy between sites when multi_site is installed.\n" }, { "from": "human", "value": "module CopyMoveHelper \n def page_parent_select_tag\n home = Page.find_by_parent_id nil\n list = build_tree home, []\n options = options_for_select lis...
ruby
chosen
[ { "from": "system", "value": "Add Pension Awareness Week WDYH options\n" }, { "from": "human", "value": "class WhereYouHeard\n OPTIONS = {\n '1' => 'An employer',\n '2' => 'A Pension Provider',\n '3' => 'Internet search',\n '4' => 'Online advertising',\n '5' => 'Social media...
ruby
chosen
[ { "from": "system", "value": "Set migrate file in administrators table\n" }, { "from": "human", "value": "class CreateAdministrators < ActiveRecord::Migration\n def change\n create_table :administrators do |t|\n\n t.timestamps null: false\n end\n end\nend\n" }, { "from": "gp...
ruby
chosen
[ { "from": "system", "value": "Remove focus from sessions controller." }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Coursewareable::SessionsController, :focus => true do\n let(:user) { Fabricate(:confirmed_user) }\n\n describe 'GET new' do\n before do\n @controller....
ruby
chosen
[ { "from": "system", "value": "Update webmock version 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 'wordpress_client/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "system", "value": "Tidy the context wording to make the specs read better\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'world_writable_files' do\n context 'file with a mode of 640' do\n let(:code) do\n <<-TEST_CLASS\n class locked_down_file {\n ...
ruby
chosen
[ { "from": "system", "value": "Change type of name for define_method to symbol.\n" }, { "from": "human", "value": "module BeGateway\n class Client\n include Connection\n TRANSACTIONS = %w(authorize capture void payment credit chargeback fraud_advice refund checkup)\n\n TRANSACTIONS.each...
ruby
chosen
[ { "from": "system", "value": "Add test that client -> server requests are handled in order\n" }, { "from": "human", "value": "require 'acceptance/test_helper'\nrequire 'timeout'\n\ndescribe \"Client requests information from the Server\" do\n\n before do\n @server, @client1, @client2 = self....
ruby
chosen
[ { "from": "system", "value": "Use present? to handle empty array\n" }, { "from": "human", "value": "module Mobility\n module ActiveRecord\n class UniquenessValidator < ::ActiveRecord::Validations::UniquenessValidator\n def validate_each(record, attribute, value)\n klass = record....
ruby
chosen
[ { "from": "system", "value": "[Gemspec] Include all files in lib\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.unshift File.expand_path('../lib', __FILE__)\nrequire 'claide'\n\nGem::Specification.new do |s|\n s.name = \"claide\"\n s.version = CLAide::VERSION\n s.licens...
ruby
chosen
[ { "from": "system", "value": "Revert \"Attempt to fix specs with Rubinius\"\n\nThis reverts commit f1e6798ad6c24fa3185141f6918be0169da2dc09.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Omniorder::Orderable do\n let(:order) { Omniorder::Order.new }\n\n describe '#add_pr...
ruby
chosen
[ { "from": "system", "value": "Fix bug with fetching option hash key\n" }, { "from": "human", "value": "require 'alephant/logger'\n\nmodule Alephant\n module Broker\n class BatchResponse\n include Logger\n attr_reader :status, :content_type, :content\n\n def initialize(request,...
ruby
chosen
[ { "from": "system", "value": "Sort (new) entries before writing them\n\nMake that hostsfile look pretty." }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Erforscher\n class Runner\n def initialize(config)\n @config = config\n end\n\n def self.run(config)\n new(con...
ruby
chosen
[ { "from": "system", "value": "Add Thomas von Deyen to authors\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'capistrano/alchemy/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "human", "value": "Support for dav_fs apache module.\n" }, { "from": "gpt", "value": "#\n# Cookbook Name:: apache2\n# Recipe:: dav_fs\n#\n# Copyright 2011, Atriso\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance w...
ruby
chosen
[ { "from": "system", "value": "Fix warning regarding putting a space before parentheses.\n" }, { "from": "human", "value": "module CachingHelpers\n\tdef cached_directory\n\t\t\"spec/dummy/public/refinery/cache/pages\"\n\tend\n\n\tdef cached_file_path(page)\n\t\t\"#{cached_directory}#{refinery.pag...
ruby
chosen
[ { "from": "system", "value": "Add support for secrets deployment\n" }, { "from": "human", "value": "role :app, %w(deploy@localhost)\nrole :web, %w(deploy@localhost)\nrole :db, %w(deploy@localhost)\nserver 'localhost', user: 'deploy', roles: %w(web app)\nset :rails_env, 'production'\nset :linked...
ruby
chosen
[ { "from": "system", "value": "Fix to pulling in sales tax items\n" }, { "from": "human", "value": "class QbwcWorkers::Requests::SalesTaxItemImport < QbwcWorkers::Requests::BaseImport\n self.query ={\n :sales_tax_item_query_rq =>{\n }\n }\n\nend\n" }, { "from": "gpt", "value...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for Lingo.\n" }, { "from": "human", "value": "cask 'lingo' do\n version :latest\n sha256 :no_check\n\n # nounproject.s3.amazonaws.com/lingo was verified as official when first introduced to the cask.\n url 'https://nounproject.s3.amazona...
ruby
chosen
[ { "from": "human", "value": "Add Active Storage field type\n" }, { "from": "gpt", "value": "module RailsAdmin\n module Config\n module Fields\n module Types\n class ActiveStorage < RailsAdmin::Config::Fields::Types::FileUpload\n RailsAdmin::Config::Fields::Types.register...
ruby
chosen
[ { "from": "system", "value": "Add Rakefile creation to the list\n" }, { "from": "human", "value": "require 'souschef/template/base'\nrequire 'souschef/template/metadata'\nrequire 'souschef/template/license'\nrequire 'souschef/template/readme'\nrequire 'souschef/template/rubocop'\nrequire 'sousch...
ruby
chosen
[ { "from": "system", "value": "Add 'db:setup' to Travis CI task\n" }, { "from": "human", "value": "if Rails.env.development? or Rails.env.test?\n require 'coveralls/rake/task'\n Coveralls::RakeTask.new\n task :test_with_coveralls => ['spec', :cucumber, 'coveralls:push']\nend\n" }, { "f...
ruby
chosen
[ { "from": "human", "value": "Add integration tests for repositories\n" }, { "from": "gpt", "value": "require 'serverspec_helper'\n\ndescribe 'nexus::repositories' do\n describe command('curl -uadmin:admin123 http://localhost:8081/service/siesta/rest/v1/script -X POST -H \"Content-Type: applicat...
ruby
chosen
[ { "from": "system", "value": "Fix response hash text class\n" }, { "from": "human", "value": "require \"rexml/document\"\n\n# Monkey Patching\nmodule REXML\n class XMLDecl\n\n private\n # Force to use double-quotation as attribute delimiter and downcase encoding name for XMLDecl\n ...
ruby
chosen
[ { "from": "system", "value": "Include iso_code3 in emissions request\n" }, { "from": "human", "value": "module Api\n module V1\n module HistoricalEmissions\n class RecordSerializer < ActiveModel::Serializer\n belongs_to :location\n belongs_to :gas\n belongs_to :data...
ruby
chosen
[ { "from": "system", "value": "Raise proper error when response is not expected\n" }, { "from": "human", "value": "require 'active_support/core_ext/hash'\nrequire 'httparty'\n\nmodule Wechatpay\n module Service\n class << self\n def unified_order(options)\n config = Wechatpay::Con...
ruby
chosen
[ { "from": "system", "value": "[JRO] Use friendly_id for finding messageboard obj\n" }, { "from": "human", "value": "module Thredded\n class ApplicationController < ::ApplicationController\n helper Thredded::Engine.helpers\n helper_method :messageboard, :topic, :preferences\n before_fil...
ruby
chosen
[ { "from": "system", "value": "Fix chef api_fqdn config causing bookshelf reachability issues (ipv4 shortcut does not work)\n" }, { "from": "human", "value": "# default[\"chef-server\"][\"fqdn\"] = # Not known à priori! => reprovision or dynamically set in recipe\n# For cloud config see running i...
ruby
chosen
[ { "from": "system", "value": "Allow check frequency to be every minute\n" }, { "from": "human", "value": "define :disk_monitor, :template => \"alert.sh.erb\", :bin_path => \"/usr/local/bin\" do\n application = Hash.new(\"\").tap do |a|\n a[:alert_level] = params[:name]\n a[:app_name] = pa...
ruby
chosen
[ { "from": "system", "value": "Update Ruby from 2.4.4 to 2.4.5\n\nThis resolves a CVE and fixes a few bugs\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "build_iteration 1\n\n# Using pins that agree with chef 13.0.118.\noverride :...
ruby
chosen
[ { "from": "system", "value": "Add more acceptance tests for printing the Vagrant version\n" }, { "from": "human", "value": "require File.expand_path(\"../base\", __FILE__)\n\nclass VersionTest < AcceptanceTest\n should \"print the version to stdout\" do\n result = execute(\"vagrant\", \"vers...
ruby
chosen
[ { "from": "system", "value": "Remove description from pod spec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Banana\"\n s.version = \"0.0.1\"\n s.summary = \"A customizable dropdown menu\"\n s.description = <<-DESC\n A longer descri...
ruby
chosen
[ { "from": "system", "value": "Update generator to include backend JS\n" }, { "from": "human", "value": "module SpreeShippingMatrix\n module Generators\n class InstallGenerator < Rails::Generators::Base\n class_option :auto_run_migrations, :type => :boolean, :default => false\n\n de...
ruby
chosen
[ { "from": "system", "value": "Add rails as a development dependency due to the dummy app" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/jquery-qtip2-rails/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Tanguy Krotoff...
ruby
chosen
[ { "from": "system", "value": "Update test to check debugging option default and override.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass TestInitialization < Test::Unit::TestCase\n \n test \"should return initialized client object\" do\n assert_not_nil SalesforceBulk::Cli...
ruby
chosen
[ { "from": "system", "value": "Update the minimum deployment target in the podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"pgoapi\"\n s.version = \"0.0.2\"\n s.summary = \"A Pokèmon Go API written in swift.\"\n s.description = <<-DESC\n This ...
ruby
chosen
[ { "from": "system", "value": "Use lazy for the default values instead of the initializer\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Cookbook:: freebsd\n# Resource:: port_options\n#\n# Copyright:: 2012-2016, ZephirWorks\n...
ruby
chosen
[ { "from": "system", "value": "Switch from using 'git ls-files' to Ruby Dir globbing\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'sensu/plugins/kue/version'\n\nGem::Specification.n...
ruby
chosen
[ { "from": "system", "value": "Fix NameError when installing plugin\n" }, { "from": "human", "value": "module OpenProject::Revisions::Subversion\n VERSION = \"0.0.1\"\nend\n" }, { "from": "gpt", "value": "module OpenProject\n module Revisions\n module Subversion\n VERSION = ...
ruby
chosen
[ { "from": "system", "value": "Remove secret key reference for prod\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'sinatra/static_assets'\nrequire 'json'\nrequire 'rest_client'\nrequire 'fast-aes'\nrequire 'profiler'\nrequire 'sanitize'\n\nconfigure do\n set :views, ['views/layou...
ruby
chosen
[ { "from": "system", "value": "Fix github jquery-rails redirect issue\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), 'lib', 'social_stream', 'version')\n\nGem::Specification.new do |s|\n s.name = \"social_stream\"\n s.version = SocialStream::VERSION.dup\n s.summar...
ruby
chosen
[ { "from": "system", "value": "GlibcRequirement: Fix system_version for old Ruby\n" }, { "from": "human", "value": "require \"requirement\"\n\nclass GlibcRequirement < Requirement\n fatal true\n default_formula \"glibc\"\n @@system_version = nil\n\n def initialize\n # Bottles for Linuxbrew...
ruby
chosen
[ { "from": "system", "value": "Update gem's summary and description\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'dartsduino/games/countup/version'\n\nGem::Specification.new do |spe...
ruby
chosen
[ { "from": "system", "value": "Correct syntax for update column\n" }, { "from": "human", "value": "class AddDummyForMissingEmails < ActiveRecord::Migration\n def up\n Enterprise.all.each do |enterprise|\n enterprise.update_column({:email => \"missing@example.com\"}) if enterprise.read_at...
ruby
chosen
[ { "from": "system", "value": "Add account OAuth scope in order to get the user's email\n" }, { "from": "human", "value": "OmniAuth.config.logger = Rails.logger\n\nRails.application.config.middleware.use OmniAuth::Builder do\n provider :trello, ENV['TRELLO_KEY'], ENV['TRELLO_SECRET'],\n app_n...
ruby
chosen
[ { "from": "human", "value": "Add integration test for mini_magick\n" }, { "from": "gpt", "value": "# Copyright 2011-2019, The Trustees of Indiana University and Northwestern\n# University. Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except ...
ruby
chosen
[ { "from": "system", "value": "Remove Tree concern, explicitly require Core FieldTypes due to eager-loading issues\n" }, { "from": "human", "value": "\nrequire 'cortex/field_types/core/*'\nrequire 'cortex/field_types/core/text/text_field_type'\nrequire 'cortex/field_types/core/text/text_cell'\n\n...
ruby
chosen
[ { "from": "system", "value": "Correct detection of whether a guest already has choices for this course.\n" }, { "from": "human", "value": "require_dependency \"ruby_wedding/application_controller\"\n\nmodule RubyWedding\n class InvitationsController < ApplicationController\n\n before_filter ...
ruby
chosen
[ { "from": "system", "value": "Add homepage to the 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 'kuromi/version'\n\nGem::Specification.new do |spec|\n spec.name = ...
ruby
chosen
[ { "from": "system", "value": "Add license and description to gemspec.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'lancat'\n s.version = '0.0.1'\n s.summary = 'Zero-configuration LAN file transfer'\n s.author = 'Graham Edgecombe'\n s.email...
ruby
chosen
[ { "from": "system", "value": "Add ability for servicedown to respond to json\n\nAPI queries should also respond in kind\nand indicate that service is unavailable.\n" }, { "from": "human", "value": "class PagesController < ApplicationController\n skip_load_and_authorize_resource\n before_action...
ruby
chosen
[ { "from": "system", "value": "Add @irubnich and me as gem authors\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"seed_migration/version\"\n\n# Describe your gem and declare its dependencies:\n\nGem::Specification.new...
ruby
chosen
[ { "from": "system", "value": "Revert \"add {} in user params.fetch\"\n\nThis reverts commit b5f12c39c4b962cb28787d45ffd08fb601c19c32.\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n load_and_authorize_resource\n before_action { @navbar = \"Users\" }\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Use 'benchmark' for benchmarking (duh)." }, { "from": "human", "value": "def benchmark_once\n start = Time.now\n yield\n stop = Time.now\n stop - start\nend\n\ndef benchmark(&b)\n runs = 100\n total = 0.0\n runs.times do |i|\n result = benchmark_once(&b)\n...
ruby
chosen
[ { "from": "system", "value": "Change gemspec activerecord dependency to 3.2.8" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"active_record/uuid/version\"\n\nGem::Specification.new do |s|\n s.name = \"activerecord-uuid...
ruby
chosen
[ { "from": "system", "value": "Improve reporting for subscription sweeper\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass SweepSubscriptionsJob < ApplicationJob\n queue_as :default\n\n def perform\n start_time = Time.current\n report = ''\n report += \"Started...
ruby
chosen
[ { "from": "system", "value": "Fix validation. rehab year must be entered\n" }, { "from": "human", "value": "#\n# Schedule Rehabilitation update event. This is event type is required for\n# all implementations\n#\nclass ScheduleRehabilitationUpdateEvent < AssetEvent\n \n # Callbacks\n afte...
ruby
chosen
[ { "from": "system", "value": "Add stdout/stderr redirection of puma in log/puma.out and log/puma.err\n" }, { "from": "human", "value": "# config/puma.rb\n\nthreads 2,8\n" }, { "from": "gpt", "value": "# config/puma/development.rb\n\n# Number of threads to start (min / max)\nthreads 2...
ruby
chosen
[ { "from": "system", "value": "Make this a \"regular\" functional test\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Bunny::Session do\n n = if RUBY_ENGINE == \"jruby\"\n 100\n else\n 4000\n end\n\n n.times do |i|\n it \"can be closed (take #{...
ruby
chosen
[ { "from": "system", "value": "Add greater_than_or_equal_to and greater_than_or_equal_to support to NumericalityValidator\n" }, { "from": "human", "value": "module ValidatedFields\n module Validators\n #\n # Sets options for ActiveModel::Validations::NumericalityValidator\n #\n modul...
ruby
chosen
[ { "from": "system", "value": "Fix minor bug that prevented certain segment times from displaying in effort show view.\n" }, { "from": "human", "value": "class EffortShowView\n attr_reader :effort, :split_rows\n\n def initialize(effort)\n @effort = effort\n @splits = effort.event.ordered_...
ruby
chosen
[ { "from": "system", "value": "Remove SRV record for LKP datacenter\n" }, { "from": "human", "value": "require 'resolv'\n\nSRV_RECORDS = %w[\n _rubyapps._tcp.live.lkp.primelabs.se\n _rubyapps._tcp.sth.twingly.network\n]\n\nresolver = Resolv::DNS.new\n\nservers = SRV_RECORDS.map do |srv_record|\...
ruby
chosen
[ { "from": "system", "value": "Configure VCR to filter sensitive data in it's cassettes\n\nWhy:\n* Someone can see sensitive data in fixtures/cassettes/*\n\nThis change addresses the need by:\n* Security\n" }, { "from": "human", "value": "VCR.configure do |c|\n c.cassette_library_dir = 'spec/fix...
ruby
chosen
[ { "from": "system", "value": "Remove Rails 5.2 `delete` monkey-patch\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n#\n# = Functional Test Case\n#\n# The test case class that all functional tests currently derive from.\n# Includes:\n#\n# 1. Some general-purpose helpers a...
ruby
chosen
[ { "from": "system", "value": "Update model extension to support some extra irisi specific cruft\n" }, { "from": "human", "value": "module Domgen\r\n module Iris\r\n class IrisElement < BaseConfigElement\r\n attr_reader :parent\r\n\r\n def initialize(parent, options = {}, &block)\r\...
ruby
chosen
[ { "from": "system", "value": "Set RACK_ENV if not set so a Rakefile can pick up the environment." }, { "from": "human", "value": "require 'bundler'\nBundler.require(:default, ENV['RACK_ENV'])\n\nclass App < Sinatra::Base\n\n configure do\n env = ENV['RACK_ENV'] || 'development'\n enable ...
ruby
chosen
[ { "from": "system", "value": "Fix bug that hides attributes for hidden people (even when viewer can see the person).\n" }, { "from": "human", "value": "module ActiveRecord\n module Associations\n module ClassMethods\n def inherited_attribute(name, parent)\n name = name.to_s\n ...
ruby
chosen
[ { "from": "human", "value": "Add seed for dummy app\n" }, { "from": "gpt", "value": "# create users\nUser.create(email: 'partner@example.com')\npartner = User.first\n4.times do |n|\n User.create(email: \"m#{n}@example.com\")\n User.last.tap do |u|\n partner.reload.partnership.referrals << u...
ruby
chosen
[ { "from": "system", "value": "Implement attributes for a model\n" }, { "from": "human", "value": "module MyMongoid\n def self.models\n @models ||= []\n end\n\n module Document\n\n module ClassMethods\n def is_mongoid_model?\n true\n end\n end\n\n def self.included...
ruby
chosen
[ { "from": "system", "value": "Use closures & define_singleton_method to avoid creating extra instance variables\n" }, { "from": "human", "value": "require 'resync'\n\nmodule Resync\n\n class Augmented\n attr_writer :client\n\n def client\n @client ||= Client.new\n end\n\n alias...
ruby
chosen
[ { "from": "system", "value": "Simplify code and make helper methods private\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RuboCop\n module Cop\n module RSpec\n # Checks for let scattered across the example group.\n #\n # Group lets together\n ...
ruby
chosen
[ { "from": "system", "value": "Fix for json attributes in sphinx" }, { "from": "human", "value": "class Riddle::Query::Insert\n attr_reader :columns, :values\n\n def initialize(index, columns = [], values = [])\n @index = index\n @columns = columns\n @values = values.first.is_a?(Arr...
ruby
chosen
[ { "from": "system", "value": "Kill unneeded assignment to local var\n" }, { "from": "human", "value": "module ZombieScout\n class MethodCallFinder\n\n def initialize(ruby_project)\n @ruby_project = ruby_project\n end\n\n def count_calls(method_name)\n method_name = method_nam...
ruby
chosen
[ { "from": "system", "value": "Make sure UserDefinedTypeInfo is available\n" }, { "from": "human", "value": "require 'ffi'\n\nrequire 'gir_ffi-base'\n\nrequire 'ffi-gobject_introspection'\n\nrequire 'gir_ffi/ffi_ext'\nrequire 'gir_ffi/class_base'\nrequire 'gir_ffi/type_map'\nrequire 'gir_ffi/info...
ruby
chosen
[ { "from": "system", "value": "Add cane as 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 'github/auth/version'\n\nGem::Specification.new do |spec|\n spec.name...
ruby
chosen
[ { "from": "system", "value": "Add active_support before using core_ext to prevent weird travis err\n" }, { "from": "human", "value": "require 'csv2api/version'\nrequire 'csv2api/utils'\nrequire 'csv2api/parser'\nrequire 'active_support/core_ext'\n\n# @author Jonah Ruiz <jonah@pixelhipsters.com>\...
ruby
chosen
[ { "from": "system", "value": "Implement make() and dump() methods as a skelton\n" }, { "from": "human", "value": "require 'sisimai/version'\n\nmodule Sisimai\n # Imported from p5-Sisimail/lib/Sisimai.pm\n class << self\n def version(); return Sisimai::VERSION; end\n def sysname(); return...
ruby
chosen
[ { "from": "system", "value": "Add not about assets.precompile & initialize_on_precompile\n" }, { "from": "human", "value": "require 'rails'\nrequire 'jquery-rails'\nrequire 'haml'\n\nmodule SublimeVideoLayout\n class Engine < ::Rails::Engine\n initializer 'assets' do |app|\n app.config....
ruby
chosen
[ { "from": "human", "value": "Add data migration for team memberships\n" }, { "from": "gpt", "value": "namespace :migrate do\n desc \"Make all current team members confirmed\"\n task :team_members do\n require 'bundler'\n Bundler.require\n require 'exercism'\n\n TeamMembership.updat...
ruby
chosen
[ { "from": "system", "value": "Add support for parsing LOGS_READONLY_DATABASE_URL\n" }, { "from": "human", "value": "require 'travis/config/helpers'\nrequire 'travis/config/heroku/database'\nrequire 'travis/config/heroku/memcached'\n\nmodule Travis\n class Config\n class Heroku # TODO rename ...
ruby
chosen
[ { "from": "system", "value": "Refactor / fix window positioning logic.\n\nThis implementation works with newlines properly.\n" }, { "from": "human", "value": "module Winnow\n class Fingerprinter\n attr_reader :guarantee, :noise\n alias_method :guarantee_threshold, :guarantee\n alias_me...
ruby
chosen
[ { "from": "system", "value": "Test fetching the published package and starting it\n" }, { "from": "human", "value": "#\n# Cookbook:: build_cookbook\n# Recipe:: smoke\n#\n# Copyright:: 2017, Jp Robinson, All Rights Reserved.\n\nbuild_root = \"#{workflow_workspace_repo}/build\"\n\ntemplate '#{work...
ruby
chosen
[ { "from": "system", "value": "Add a spec using pull request data\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe GithubPulls::API do\n let(:api) { GithubPulls::API.new('holysugar/github_pulls') }\n\n describe \"#pulls\" do\n subject { api.pulls }\n\n it \"is a collec...
ruby
chosen
[ { "from": "system", "value": "Remove ref to top-level constant\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe TaskMapper::Basecamp do\n let(:tm) { create_instance }\n\n describe \"#new\" do\n it \"creates a new TaskMapper instance\" do\n expect(tm).to be_a TaskMap...
ruby
chosen
[ { "from": "human", "value": "Write specs of Phone model\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe Phone do\n it \"does not allow duplicate phone numbers per contact\" do\n contact = Contact.create(\n firstname: \"Joe\",\n ...
ruby
chosen
[ { "from": "system", "value": "Fix a type in the gem home URL.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/rack/pretty_json/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Damien Wilson\"]\n gem.email = [...
ruby
chosen
[ { "from": "system", "value": "Fix compile issues with cocoapods 1.5+\n\nAdd React as explicit dependency" }, { "from": "human", "value": "require \"json\"\npackage = JSON.parse(File.read('package.json'))\n\nPod::Spec.new do |s|\n s.name = package['name']\n s.version = package['v...
ruby
chosen
[ { "from": "system", "value": "Create new comment to avoid nil form object\n" }, { "from": "human", "value": "class CommentsController < ApplicationController\n\n def new\n @trail = Trail.find(params[:trail_id])\n @comments = @trail.comments\n render :new\n end\n\n def create\n @co...
ruby
chosen
[ { "from": "system", "value": "Allow sort queries on All Products page\n" }, { "from": "human", "value": "class ProductsController < ApplicationController\n def index\n @productsbytitle = Product.order(title: :asc)\n @statuscounts = Product.group(:status).count\n end\n\n def show\...
ruby
chosen