conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update podspec to Swift 5\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Disk\"\n s.version = \"0.5.0\"\n s.summary = \"Delightful framework for iOS to easily persist structs, images, and data\"\n s.description = <<-DESC\...
ruby
chosen
[ { "from": "system", "value": "Put bytestream.? in the right place\n" }, { "from": "human", "value": "require \"mkmf\"\nhave_header(\"stdint.h\")\ncreate_makefile(\"bytestream\")\n" }, { "from": "gpt", "value": "require \"mkmf\"\nhave_header(\"stdint.h\")\ncreate_makefile(\"crypt/byte...
ruby
chosen
[ { "from": "system", "value": "Add route for single survey\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'mongo'\nrequire 'mongo_mapper'\nrequire 'pry'\nrequire 'json/ext'\n\nclass Survey\n include MongoMapper::Document\n\n key :survey_id, Integer\n key :inputs, Array\nend\n\nc...
ruby
chosen
[ { "from": "system", "value": "Package version patch number is incremented from 0.1.6 to 0.1.7\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'telemetry-logger'\n s.version = '0.1.6'\n s.summary = 'Logging to STDERR with coloring and leve...
ruby
chosen
[ { "from": "system", "value": "Kill GFS processes when upgrading\n" }, { "from": "human", "value": "include_recipe \"gluster::upgrade_common\"\n\ninclude_recipe \"gluster::server_install\"\n\ninclude_recipe \"gluster::server_setup\"\n" }, { "from": "gpt", "value": "include_recipe \"gl...
ruby
chosen
[ { "from": "system", "value": "Fix test for Ruby 1.8.7\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), 'test_helper')\nrequire 'workflow'\nclass InheritanceTest < ActiveRecordTestCase\n\n test '#69 inheritance' do\n class Animal\n include Workflow\n\n wo...
ruby
chosen
[ { "from": "system", "value": "Remove duplication by using method defined in parent and fix test" }, { "from": "human", "value": "class FakeUI < UI\n attr_reader :output\n\n def initialize(game_wrapper, test, test_data, dice_roller)\n super(game_wrapper)\n\n @test = test\n @tes...
ruby
chosen
[ { "from": "system", "value": "Add some 'alias' specs that fail on rbx and pass on MRI\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../spec_helper'\n" }, { "from": "gpt", "value": "require File.dirname(__FILE__) + '/../spec_helper'\n\nclass AliasObject\n def ...
ruby
chosen
[ { "from": "system", "value": "Add logger debug line for controller based action requests\n" }, { "from": "human", "value": "class RouteAction\n include EventMachine::Deferrable\n\n class << self\n def controller(name, app)\n controllers[name] ||= Object.const_get(name).new(app)\n en...
ruby
chosen
[ { "from": "system", "value": "Add VLAN support to HP collector.\n\nWe work around the lack of VLAN ID information from the VLAN\ncollector by obtaining the VLAN ID from the ifName.\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/hp/ports')\n\nmodule Copian\...
ruby
chosen
[ { "from": "system", "value": "Remove Print node and just transform puts/print into calls against System.out.\n" }, { "from": "human", "value": "module Duby::AST\n class Print < Node\n attr_accessor :println\n\n def initialize(parent, line_number, println, &block)\n super(parent, line...
ruby
chosen
[ { "from": "system", "value": "Update gem dependencies, add version constraints\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'vagrant_cloud'\n s.version = '0.2.1'\n s.summary = 'Vagrant Cloud API wrapper'\n s.description = 'Very minimalistic ruby ...
ruby
chosen
[ { "from": "system", "value": "Use the rakefile helper to create sample.rake\n" }, { "from": "human", "value": "gem \"mysql2\"\n\n# TODO what about Windows?\n\n# if scroll?(\"eycloud\")\n# mysql_versions = [\n# [\"MySQL 5.0\", \"mysql_50\"],\n# [\"MySQL 5.5 (beta)\", \"mysql_55\"]\n# ...
ruby
chosen
[ { "from": "system", "value": "Add albums attribute to PlaylistifiedEntry\n" }, { "from": "human", "value": "class PlaylistifiedEntry\n attr_reader(:id,\n :url,\n :title,\n :descriptions,\n :visual_url,\n :locale,\n :t...
ruby
chosen
[ { "from": "human", "value": "Add Rack::Handler::Mizuno for rackup -s support\n" }, { "from": "gpt", "value": "require 'mizuno'\n\nbegin\n require 'rjack-logback'\n RJack::Logback.config_console( :stderr => true, :thread => true )\nrescue LoadError => e\n require 'rjack-slf4j/simple'\nend\n\nm...
ruby
chosen
[ { "from": "system", "value": "Remove direct require of Faraday test adapter\n" }, { "from": "human", "value": "# encoding: UTF-8\n$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')\n\nrequire 'rspec'\nrequire 'tinder'\nrequire 'fakeweb'\n\nrequire 'faraday/adapter/test'\n\nFakeWeb.a...
ruby
chosen
[ { "from": "system", "value": "Use the doc formatter for specs\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "require 'chefspec'\nrequire 'chefspec/berkshelf'\n\nRSpec.configure do |config|\n config.color = true\n config.log_lev...
ruby
chosen
[ { "from": "system", "value": "Set RACK_ENV before juici has a chance to\n" }, { "from": "human", "value": "require 'juici'\nrequire 'mocha'\n\nrequire 'fileutils'\n\nENV['RACK_ENV'] ||= \"test\"\n\nDir[\"#{File.expand_path(File.dirname(__FILE__))}/helpers/**/*.rb\"].each do |f|\n puts \"Requiri...
ruby
chosen
[ { "from": "system", "value": "Include fakefs in spec helper\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.dirname(__FILE__))\nrequire 'rspec'\nrequire 'putkitin'\n\n# Requires supporting files with custom matchers a...
ruby
chosen
[ { "from": "system", "value": "Implement nesting feature for HashObject\n" }, { "from": "human", "value": "require 'minitest/autorun'\nrequire 'minitest/spec'\n\nrequire 'bound'\n\n# HashObject behaves like an OpenStruct\n# but there is no method_missing involved.\n#\n# Missing keys in the source...
ruby
chosen
[ { "from": "system", "value": "Fix another problem with height/width for text blocks not set\n" }, { "from": "human", "value": "class Layout < Slide\n def content\n headline 'Layout'\n bullet 'not so much juggling of x and y'\n bullet 'Flows & Stacks'\n end\nend\n\nOFFSET_FOR_EMPTY_LIN...
ruby
chosen
[ { "from": "system", "value": "Resolve deprecation warning in spec\n" }, { "from": "human", "value": "require 'rspec-expectations'\nrequire 'chefspec'\nrequire 'chefspec/berkshelf'\nrequire 'chefspec/server'\n\nat_exit { ChefSpec::Coverage.report! }\n" }, { "from": "gpt", "value": "re...
ruby
chosen
[ { "from": "system", "value": "Set up \"spork\" for rspec.\n\nSigned-off-by: Daniel Hackney <2591e5f46f28d303f9dc027d475a5c60d8dea17a@haxney.org>\n" }, { "from": "human", "value": "# This file is copied to spec/ when you run 'rails generate rspec:install'\nENV[\"RAILS_ENV\"] ||= 'test'\nrequire F...
ruby
chosen
[ { "from": "system", "value": "Coverage: Check the main code only, not the test code\n" }, { "from": "human", "value": "# This file was generated by the `rspec --init` command. Conventionally, all\n# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.\n# Require this file u...
ruby
chosen
[ { "from": "system", "value": "Add Compatibility with Rails 4" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"spectabular/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Sp...
ruby
chosen
[ { "from": "system", "value": "Allow alternate Router class to be specified with Adapter\n" }, { "from": "human", "value": "module YARD\n module Server\n class FinishRequest < RuntimeError; end\n class NotFoundError < RuntimeError; end\n\n class Adapter\n # @return [String] the loc...
ruby
chosen
[ { "from": "system", "value": "Use github reference in application template\n" }, { "from": "human", "value": "gem \"rglossa\", git: \"git://github.com/textlab/rglossa.git\"\n\nrun \"bundle install\"\n\nrun \"rm public/index.html\"\n\nroute \"mount Rglossa::Engine => '/'\"\n\nrake(\"railties:inst...
ruby
chosen
[ { "from": "human", "value": "Add Excel column problem from Leetcode\n" }, { "from": "gpt", "value": "# encoding: UTF-8\nrequire 'minitest/autorun'\n\n# Given a positive integer, return its corresponding column title as appear in an Excel sheet.\n\n# For example:\n\n# 1 -> A\n# 2 -> B\n# ...
ruby
chosen
[ { "from": "system", "value": "Improve tests for rest impl\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe TWW do\n let(:config) { TWW.config }\n let(:client) { TWW.client }\n\n it { expect(config).to_not be_nil }\n it { expect(config.from).to eq('ACME Inc.') }\n it { ex...
ruby
chosen
[ { "from": "system", "value": "Increase the initial size of MyHash\n\nThis is necessary because the initial size is not large enough to prevent scenarios where someone is attempting to access the value of a certain key that doesn't actually exist yet. Without this fix, MyHash would raise an exception.\n" }...
ruby
chosen
[ { "from": "system", "value": "Return 401 unless this teacher has access to this classroom\n" }, { "from": "human", "value": "class Teachers::ProgressReports::Standards::ClassroomTopicsController < Teachers::ProgressReportsController\n include UnitsWithCompletedActivities\n\n def index\n res...
ruby
chosen
[ { "from": "system", "value": "Add tvOS to the Podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"NSURL+QueryDictionary\"\n s.version = \"1.1.0\"\n s.summary = \"Make working with NSURL queries more pleasant.\"\n s.description = \"NSURL, NSStri...
ruby
chosen
[ { "from": "system", "value": "Use html_escape instead of sanitize to avoid stripping HTML completely\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule PostsHelper\n def render_links(text)\n raw(text.split(%r{((?:https?:)?\\/{2}[^\\)\\s]*)}).map.with_index do |s, i|\n...
ruby
chosen
[ { "from": "system", "value": "Use conditional uploading to FHIR endpoint to avoid record duplication\n" }, { "from": "human", "value": "require 'os'\n\nclass FhirUploadJob < ActiveJob::Base\n queue_as :default\n\n def perform(json)\n json_file = Tempfile.new('patient_json')\n json_file.w...
ruby
chosen
[ { "from": "system", "value": "Enable plural Readline invocations sans warnings.\n" }, { "from": "human", "value": "# Readline for Jruby\nclass Bond::Jruby < Bond::Readline\n def self.readline_setup\n require 'readline'\n require 'jruby'\n class << Readline\n ReadlineExt = org.jrub...
ruby
chosen
[ { "from": "system", "value": "Remove annoying debug print that has been around for a while.\n" }, { "from": "human", "value": "module Byebug\n\n # Implements byebug \"kill\" command\n class KillCommand < Command\n self.allow_in_control = true\n\n def regexp\n / ^\\s*\n (?:ki...
ruby
chosen
[ { "from": "system", "value": "Fix issue with Union and CTEs\n" }, { "from": "human", "value": "require_relative '../query_modifier'\n\nmodule ConceptQL\n module QueryModifiers\n module Gdm\n class ProviderQueryModifier < QueryModifier\n def self.provided_columns\n [:prov...
ruby
chosen
[ { "from": "system", "value": "Remove old delayed job files from Binary interface.\n" }, { "from": "human", "value": "module FlyingSphinx::Binary\n def self.load\n require 'flying_sphinx/binary/translator'\n require 'flying_sphinx/binary/delayed_delta'\n require 'flying_sphinx/binary/fl...
ruby
chosen
[ { "from": "system", "value": "Remove reference to Rack::Deflate. Seems to blow up aganist production\n" }, { "from": "human", "value": "module FrontendServer\n module Rack\n def app\n server = self\n\n builder = ::Rack::Builder.new\n\n self.class.configurations.each do |config...
ruby
chosen
[ { "from": "system", "value": "Fix bug when passing no component\n" }, { "from": "human", "value": "require \"thor\"\n\nmodule HealthInspector\n class CLI < Thor\n class_option 'repopath', :type => :string, :aliases => \"-r\",\n :default => \".\",\n :banner => \"Path to your local c...
ruby
chosen
[ { "from": "system", "value": "Update bundler version for development.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"rgversion/version\"\n\nGem::Specification.new do |spec|\n sp...
ruby
chosen
[ { "from": "system", "value": "Use rack.exception as metric name." }, { "from": "human", "value": "require 'metrics/middleware_helpers'\n\nmodule Rack\n class Instrumentation\n include Metrics::MiddlewareHelpers\n\n def initialize(app)\n @app = app\n end\n \n def call(env)\n ...
ruby
chosen
[ { "from": "system", "value": "Add collection method for gathering all outlet details at once\n" }, { "from": "human", "value": "module Ropian\n module Meter\n class Raritan\n def inspect\n \"#<#{self.class} #{@manager.host}@#{@manager.community}>\"\n end\n def initializ...
ruby
chosen
[ { "from": "system", "value": "Update Test class definition to fix yardoc issue.\n" }, { "from": "human", "value": "##\n# Test extension.\n#\n# Default implementation of http://shex.io/extensions/Test/\n#\n# @see http://shex.io/extensions/Test/\nrequire 'shex'\n\nclass ShEx::Test < ShEx::Extensio...
ruby
chosen
[ { "from": "system", "value": "Use module_eval to define the type reader.\n\nThis is so we follow normal method binding.\n" }, { "from": "human", "value": "# encoding: utf-8\nmodule BSON\n\n # Provides constant values for each to the BSON types and mappings from raw\n # bytes back to these type...
ruby
chosen
[ { "from": "system", "value": "Implement rake tasks for clearing photos, tweets and posts\n" }, { "from": "human", "value": "namespace :mingle do\n\n desc \"Fetch everything\"\n task fetch: ['twitter:fetch', 'facebook:fetch', 'instagram:fetch']\n\n namespace :twitter do\n\n desc \"Fetch twe...
ruby
chosen
[ { "from": "system", "value": "lib: Fix error message for direct invocation\n\nFor commands that contain dashes our error message suggested to run via\n`brew random command`, but that should have been `brew random-command`.\n" }, { "from": "human", "value": "# Refuse to run on ancient Ruby versio...
ruby
chosen
[ { "from": "system", "value": "Allow older version of sprockets for Rails 3\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ember/handlebars/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Revert \"put require in try/catch\"\n\nThis reverts commit 5ce207567b81245d50ac903bea75f9630ca9f733.\n\nsince this gets loaded a compile time, we cannot install the gem from a\nrecipe.\n" }, { "from": "human", "value": "begin\n require 'zookeeper'\nrescue LoadError...
ruby
chosen
[ { "from": "system", "value": "Add Integration Spec for user sign up feature.\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe \"the signin process\", :type => :feature do\n scenario 'with valid email and password' do\n sign_up_with 'valid@example.com', 'password'\n\n ...
ruby
chosen
[ { "from": "system", "value": "Change the name from ada to adam in the slug test\n" }, { "from": "human", "value": "describe 'adds slug when creating a profile' do\n let!(:user) { Profile.create!(FactoryGirl.attributes_for(:published, firstname: 'Ada', lastname: 'Lovelace')) }\n\n describe 'slu...
ruby
chosen
[ { "from": "human", "value": "Add factory for CMA user\n" }, { "from": "gpt", "value": "FactoryGirl.define do\n factory :user do\n sequence(:uid) { |n| \"uid-#{n}\"}\n sequence(:name) { |n| \"Joe Bloggs #{n}\" }\n sequence(:email) { |n| \"joe#{n}@bloggs.com\" }\n if defined?(GDS::SSO::C...
ruby
chosen
[ { "from": "system", "value": "Raise proper error if creating the dummy app fails\n" }, { "from": "human", "value": "module Reactify\n module Specs\n module Generators\n def file_in_dummy_app(path)\n File.expand_path path, dummy_app_path\n end\n\n # These methods allow u...
ruby
chosen
[ { "from": "system", "value": "Add some RDoc to branch node classes.\n" }, { "from": "human", "value": "module BehaviorTree\n class BranchNode\n def initialize(*children)\n @children = children.flatten\n end\n\n attr_reader :children\n\n def <<(node)\n @children << node\n ...
ruby
chosen
[ { "from": "system", "value": "Add uninstall :launchctl for AppFresh.app\n" }, { "from": "human", "value": "cask :v1 => 'appfresh' do\n version :latest\n sha256 :no_check\n\n url 'http://backend.metaquark.de/download/appfresh'\n name 'AppFresh'\n appcast 'http://backend.metaquark.de/appcast/...
ruby
chosen
[ { "from": "system", "value": "Add migration versioning numbers when creating `Migration` instances\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe ActiveRecord::Turntable::Migration do\n before(:all) do\n reload_turntable!(File.join(File.dirname(__FILE__), \"../../../c...
ruby
chosen
[ { "from": "system", "value": "fix: Allow user deletion, but can't delete super users\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'ditty/policies/application_policy'\n\nmodule Ditty\n class UserPolicy < ApplicationPolicy\n def register?\n # TODO: Check ema...
ruby
chosen
[ { "from": "system", "value": "Allow dash in locale filenames when merging data\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule I18n::Tasks\n module LocalePathname\n class << self\n def replace_locale(path, from, to)\n path&.gsub(path_locale_re(from), to...
ruby
chosen
[ { "from": "system", "value": "Update shutdown request to API v2\n\nResolves #215" }, { "from": "human", "value": "require 'vagrant-digitalocean/helpers/client'\n\nmodule VagrantPlugins\n module DigitalOcean\n module Actions\n class ShutDown\n include Helpers::Client\n\n de...
ruby
chosen
[ { "from": "human", "value": "Allow resync of activity states based on data element name\n" }, { "from": "gpt", "value": "namespace :activities do\n desc \"update names of activity states\"\n task resync: :environment do\n project = Project.find(ENV.fetch(\"PROJECT_ID\"))\n data_compound ...
ruby
chosen
[ { "from": "system", "value": "Add missing depedency for development unit test\n" }, { "from": "human", "value": "require './lib/sinatra/assetpack/version'\n\nGem::Specification.new do |s|\n s.name = \"sinatra-assetpack\"\n s.version = Sinatra::AssetPack.version\n s.summary = %{Asset packager ...
ruby
chosen
[ { "from": "system", "value": "Fix check of SERVER_PORT env variable" }, { "from": "human", "value": "module Vidibus\n module User\n module Warden\n module Helper\n\n # Sets credentials for Connector login in session.\n # The client_secret will be validated through Vidibus'...
ruby
chosen
[ { "from": "system", "value": "Fix unfinished spec for BookingTemplate.build_booking.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe BookingTemplate do\n context 'Factory methods' do\n context '.build_booking' do\n it 'should raise an exception if no matching templa...
ruby
chosen
[ { "from": "human", "value": "Add unit test for aix memory plugin\n" }, { "from": "gpt", "value": "#\n# License:: Apache License, Version 2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obta...
ruby
chosen
[ { "from": "system", "value": "Use CommonCrypto modulemaps with the pod\n\nThis blog post provided helpful instructions: https://ind.ie/labs/blog/using-system-headers-in-swift/\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"OneTimePassword\"\n s.version = \"2....
ruby
chosen
[ { "from": "system", "value": "Update to 1.2.4, change Cocoalumberjack dependency to 3.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"JSONModel\"\n s.version = \"1.2.3\"\n s.summary = \"Magical Data Modelling Framework for JSON. Create rapidly powerful...
ruby
chosen
[ { "from": "system", "value": "Update rake to avoid CVE-2020-8130\n" }, { "from": "human", "value": "# enccoding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rack/logs/version'\n\nGem::Specification.new do |spec|\n spec.nam...
ruby
chosen
[ { "from": "system", "value": "Fix uniqueness of team invitations\n" }, { "from": "human", "value": "class TeamInvitation < ActiveRecord::Base\n self.inheritance_column = nil\n\n belongs_to :team\n belongs_to :user\n\n INVITED_BY_TEAM = 1\n INVITATION_REQUEST = 2\n\n scope :requests_to_j...
ruby
chosen
[ { "from": "system", "value": "Add pagination support to CrossRef's API wrapper.\n" }, { "from": "human", "value": "class SearchCrossref\n def initialize(query, opts = {})\n @query = query[:everything]\n end\n\n def run\n response = conn.get \"/works\", {\n query: @query,\n }\n\n...
ruby
chosen
[ { "from": "system", "value": "Improve failure messages for be_now and be_at\n" }, { "from": "human", "value": "RSpec::Matchers.define :be_now do\n match do |actual|\n actual.to_i == Time.zone.now.to_i\n end\n\n failure_message_for_should do |actual|\n actual = 'nil' unless actual\n \...
ruby
chosen
[ { "from": "system", "value": "[BUGFIX] Fix require of blather/client stuff, blather/client.rb is an executable script now?\n" }, { "from": "human", "value": "require 'blather/client'\n\nmodule Adhearsion\n class XMPP\n module Connection\n\n class << self\n\n attr_accessor :client...
ruby
chosen
[ { "from": "system", "value": "Add round model specs for finish and is_over method\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Round, type: :model do\n let(:round) { FactoryGirl.create(:round) }\n let!(:old_turn) { FactoryGirl.create(:turn) }\n let(:new_turn) { ...
ruby
chosen
[ { "from": "system", "value": "Use newer version of rspec syntax\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Outbox::Rails do\n it 'has a version number' do\n Outbox::Rails::VERSION.should_not be_nil\n end\nend\n" }, { "from": "gpt", "value": "require 'sp...
ruby
chosen
[ { "from": "system", "value": "Add the \"get a single topic\" endpoint to the API\n" }, { "from": "human", "value": "class DiscourseApi::Client < DiscourseApi::Resource\n\n def initialize(host, port=80, protocol='http')\n @host = host\n @port = port\n @protocol = protocol\n end\n\n po...
ruby
chosen
[ { "from": "system", "value": "Switch default editor ofr WYMEditor\n" }, { "from": "human", "value": "class EditorConfiguration < Configuration\n preference :enabled, :boolean, :default => true\n preference :current_editor, :string, :default => 'TinyMCE'\n preference :ids, :text, :default => '...
ruby
chosen
[ { "from": "system", "value": "Destroy dependent document and settings" }, { "from": "human", "value": "class Node < ActiveRecord::Base\n has_many :documents\n has_many :settings, :class_name => 'NodeSetting'\n\n acts_as_nested_set\n acts_as_list :scope => :parent_id\n\n # Add a child node a...
ruby
chosen
[ { "from": "system", "value": "Remove junk from Rule model\n" }, { "from": "human", "value": "class Rule < ActiveRecord::Base\n # strange naming b/c :transaction is a reserved method in AR::B\n belongs_to :transact, class_name: 'Transaction', foreign_key: 'transaction_id'\n has_many :applied_c...
ruby
chosen
[ { "from": "system", "value": "Add Method in User Model\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: users\n#\n# id :integer not null, primary key\n# name :string\n# password :string\n# email :string\n# admin :boolean\n# cre...
ruby
chosen
[ { "from": "system", "value": "Add uniqueness validation for email on create & update\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\ninclude ActiveModel::Validations\n\tvalidates :name, :city, :email, presence: true\nend\n" }, { "from": "gpt", "value": "class User...
ruby
chosen
[ { "from": "system", "value": "Add set_civic_json method to User\n" }, { "from": "human", "value": "class User < ApplicationRecord\n has_many :documents\n\n validates :address, :first_name, :last_name, :zip_code, :city, :state, presence: true\nend\n" }, { "from": "gpt", "value": "cl...
ruby
chosen
[ { "from": "human", "value": "Add 0xed to homebrew cask.\n\n0xED is a native OS X hex editor based on the Cocoa framework.\n" }, { "from": "gpt", "value": "class ZeroXed < Cask\n url 'http://www.suavetech.com/cgi-bin/download.cgi?0xED.tar.bz2'\n homepage 'http://www.suavetech.com/0xed/'\n vers...
ruby
chosen
[ { "from": "system", "value": "Fix the problem that cannot call `page_name` method\n" }, { "from": "human", "value": "module Comable\n module Admin\n class UserSessionsController < Devise::SessionsController\n layout 'comable/admin/application'\n end\n end\nend\n" }, { "from"...
ruby
chosen
[ { "from": "system", "value": "Fix issues with Ruby 1.9.3.\n\n`#to_h` does exist on `Middleman::Configuration::ConfigurationManager`.\n`#to_h` is known as `#to_hash` on Hash.\n" }, { "from": "human", "value": "require \"middleman-core\"\n\nmodule Middleman\n class DisqusExtension < Extension\n ...
ruby
chosen
[ { "from": "system", "value": "Change the source URL for the HTML timetables to no longer use drafts\n" }, { "from": "human", "value": "require 'open-uri'\n\nmodule Timetable\n REMOTE_HOST = \"www.doc.ic.ac.uk\"\n REMOTE_PATH = \"internal/timetables/timetable/:season/class\"\n REMOTE_FILE = \"...
ruby
chosen
[ { "from": "system", "value": "Update gemspec description and summary\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib/', __FILE__)\n$:.unshift lib unless $:.include?(lib)\n\nrequire 'phil/version'\n\nGem::Specification.new do |s|\n s.name = \"phil\"\n...
ruby
chosen
[ { "from": "system", "value": "Tag GameDev external posts with a tag of \"question\"\n" }, { "from": "human", "value": "class GamedevWorker\n include Sidekiq::Worker\n def perform\n fetch_questions.each do |question|\n create_post(question)\n end\n end\n\n def fetch_questions\n ...
ruby
chosen
[ { "from": "system", "value": "Add allowed_push_host to gemspec to fix release script\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'graphql/batch/version'\n\nGem::Specification.new ...
ruby
chosen
[ { "from": "system", "value": "Fix BP diastolic < systolic comparison where one is a string\n\nPreviously if diastolic was “100 “ and systolic “80” the former was interpretted as a string and the comparison raised `comparison of Integer with String failed`\n" }, { "from": "human", "value": "# fro...
ruby
chosen
[ { "from": "system", "value": "Add another check around assigning reviewers just in case.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nfeature \"Assigns Reviewer\", js: true do\n let(:journal) { FactoryGirl.create(:journal) }\n let(:paper) { FactoryGirl.create(:paper, journal: jo...
ruby
chosen
[ { "from": "system", "value": "Remove commented code from home controller.\n" }, { "from": "human", "value": "# Homepage\nclass HomeController < ApplicationController\n caches_page :index, :if => Proc.new { |c| !mobile_request? }\n\n # Show homepage\n # === Assigns\n # * upcoming_events: inst...
ruby
chosen
[ { "from": "system", "value": "Implement create action for PetsController\n" }, { "from": "human", "value": "class PetsController < ApplicationController\n before_action :set_pet, only: [:show, :edit, :update, :destroy]\n\n # GET /pets\n # GET /pets.json\n def index\n @pets = Pet.all\n en...
ruby
chosen
[ { "from": "system", "value": "Remove obsolete method in mailer\n" }, { "from": "human", "value": "class NotificationMailer < ApplicationMailer\n\n def validation_result(user, aru, validation_report, validation_report_csv_file)\n @user = user\n @aru = aru\n @status = validation_report[:...
ruby
chosen
[ { "from": "system", "value": "Update root links, notably rename `accounts` to `account`\n" }, { "from": "human", "value": "class RootSerializer < ApplicationSerializer\n adapter Oat::Adapters::HAL\n\n schema do\n link :accounts,\n href: \"/accounts/{address}\", \n templated: true\...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary before(:all) call from a button spec\n" }, { "from": "human", "value": "describe ApplicationHelper::Button::IsoDatastoreNew do\n let(:view_context) { setup_view_context_with_sandbox({}) }\n let(:button) { described_class.new(view_context, {}, {}...
ruby
chosen
[ { "from": "system", "value": "Use `unscoped` when create stock items in migration\n\nBy the time the migration runs the default scope with deleted_at was\nalready defined so mocking acts_as_paranoid doesn't make any difference\n\nrelated to #3805\n" }, { "from": "human", "value": "class CreateDe...
ruby
chosen
[ { "from": "system", "value": "Add after sign up path\n" }, { "from": "human", "value": "require_dependency \"ajo_register/application_controller\"\nclass AjoRegister::PasswordsController < Devise::PasswordsController\n\n def new\n super\n end\n\n def create\n super\n end\n\n def destr...
ruby
chosen
[ { "from": "system", "value": "Add a test for searching in the wrong section\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'test_helper'\nrequire 'support/web_mocking'\n\nclass Search < ActionDispatch::IntegrationTest\n include WebMocking\n\n before do\n create(...
ruby
chosen
[ { "from": "system", "value": "Fix hound ci style violation. :cop:" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'active_model'\nrequire 'doorkeeper'\nrequire 'doorkeeper/oauth/invalid_token_response'\n\nmodule Doorkeeper::OAuth\n describe InvalidTokenResponse do\n describe ...
ruby
chosen
[ { "from": "system", "value": "Fix typo: CarMarker -> CarMarkerFactory\n" }, { "from": "human", "value": "require \"cars_api/in_memory\"\nrequire \"cars_api/car_marker\"\n\nmodule CarsApi\n module InMemory\n # job: InMemory::CarStore understands cars data.\n class CarStore\n def initi...
ruby
chosen
[ { "from": "system", "value": "Add newline for append_file arguments in add_javascripts (install)\n\nUsing append_file without a new line in add_javascripts() causes the\nfile `all.js' to be saved without a new line at the end and making the\nnext (different) plugin install fail to write valid data to this f...
ruby
chosen