conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix escaped <br> tag on confirmation page [Finishes 83851866]\n" }, { "from": "human", "value": "class ConfirmationPresenter < Presenter\n def submitted_at\n date(target.submitted_at)\n end\n\n def attachments\n attachment_filenames.join tag(:br)\n end\n\n...
ruby
chosen
[ { "from": "system", "value": "Break out user join to a separate query in DiscussionSerializer" }, { "from": "human", "value": "class DiscussionSerializer\n include TalkSerializer\n include EmbeddedAttributes\n include ModerationActions\n \n all_attributes\n attribute :latest_comment\n can...
ruby
chosen
[ { "from": "human", "value": "Add starling bank CSV import\n" }, { "from": "gpt", "value": "require 'csv'\n\n# @note This is used to import Starling Bank CSV Statements\n# Export the statement CSV from within the app\n\nclass Import::Csv::StarlingBank\n def initialize(path, ynab_account_id = ENV...
ruby
chosen
[ { "from": "system", "value": "Add spec for UserName in bitlbee.plist.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'bitlbee' do\n let(:facts) do\n {\n :boxen_home => '/opt/boxen',\n :boxen_user => 'testuser',\n }\n end\n it { should include_class('bitlb...
ruby
chosen
[ { "from": "system", "value": "Use ruby singleton pattern instead of manual implementation" }, { "from": "human", "value": "module Machinist\n module Caching\n # The shop takes care of caching database objects.\n #\n # Calling make! on a class requests objects from the shop; you don't\n...
ruby
chosen
[ { "from": "system", "value": "Change to use symbols as choice names and add key escape event\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative \"../lib/tty-prompt\"\n\nprompt = TTY::Prompt.new\n\nwarriors = %w(Scorpion Kano Jax Kitana Raiden)\n\nprompt.on(:keyp...
ruby
chosen
[ { "from": "system", "value": "Fix error logging when an exception is raised in IdempotentPublisher\n" }, { "from": "human", "value": "module Ehonda\n class IdempotentPublisher\n def initialize limit: 100, publisher_client: nil, logger: nil\n @limit = limit\n @publisher_id = ENV['DY...
ruby
chosen
[ { "from": "system", "value": "Store the edit date in local time to match the PHP app\n" }, { "from": "human", "value": "class WikiMotion < ActiveRecord::Base\n self.table_name = \"pw_dyn_wiki_motion\"\n\n belongs_to :division\n belongs_to :user\n\n validates :title, presence: true\n\n attr_...
ruby
chosen
[ { "from": "human", "value": "Add specs for page context defaults\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Status::Context::Page, '.new' do\n let(:object) { described_class }\n\n subject { object.new(attributes) }\n\n let(:content) { mock('Content') ...
ruby
chosen
[ { "from": "system", "value": "Add summary and description to .gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'beautiful_public_key/version'\n\nGem::Specification.ne...
ruby
chosen
[ { "from": "system", "value": "Change ref to spec/support dir\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Rambo::RSpec::SpecFile do\n let(:raml_file) { File.expand_path('../support/foobar.raml', __FILE__) }\n let(:raml) { Raml::Parser.parse(File.open(raml_file, 'r+', &:...
ruby
chosen
[ { "from": "system", "value": "Use symbols rather than selectors for :within option. This is so we can change the tags the element use and change only one location to update them\n" }, { "from": "human", "value": "module CapybaraExt\n # Just a shorter way of writing it.\n def assert_seen(text, ...
ruby
chosen
[ { "from": "human", "value": "Add Intel XDK IoT Edition v52" }, { "from": "gpt", "value": "class IntelXdkIot < Cask\n version '52'\n sha256 'f8b378b36848245503127fc079a4dccf483aa949eb0b05ea0b7c50f0153b3db1'\n\n url \"https://download.xdk.intel.com/iot-packages/iot_web_mac_master-iot_00#{versio...
ruby
chosen
[ { "from": "system", "value": "Use shared core API to satisfy Embedded and Server\n" }, { "from": "human", "value": "module Neo4j::ActiveRel\n module Initialize\n extend ActiveSupport::Concern\n include Neo4j::Shared::Initialize\n\n # called when loading the rel from the database\n #...
ruby
chosen
[ { "from": "system", "value": "Add some tests for exists? method\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Morph::Scraperwiki do\n describe \"#sqlite_database\" do\n it \"should get the scraperwiki sqlite database via their api\" do\n result = double\n Mor...
ruby
chosen
[ { "from": "system", "value": "Use git to ensure that all files are included in gem\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'spree_flexi_variants'\n s.version = '1.0.0'\n s.summary = 'Add gem summary here...
ruby
chosen
[ { "from": "system", "value": "Modify Style/OpMethod to use NodePattern\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RuboCop\n module Cop\n module Style\n # This cop makes sure that certain binary operator methods have their\n # sole parameter named `o...
ruby
chosen
[ { "from": "system", "value": "Fix this ancient load/save exp\n\nfixes #1173\n" }, { "from": "human", "value": "def create_app(testbed)\n testbed.create(:application) do |reply|\n if reply.success?\n app = reply.resource\n\n app.on_subscribed do\n app.request([:platform])\n\n...
ruby
chosen
[ { "from": "human", "value": "Update relationships hash for those without any relationships.\n" }, { "from": "gpt", "value": "class UpdateRelationshipsHash < ActiveRecord::Migration\n def self.up\n Site.each do\n # only update those without any relationships\n Person.all(:conditions...
ruby
chosen
[ { "from": "system", "value": "Fix a migration, which probably would have destroyed manual approvals\n" }, { "from": "human", "value": "Sequel.migration do\n up do\n LicenseFinder::DB << <<-EOS\n UPDATE dependencies\n SET manually_approved =\n (SELECT state\n FROM\...
ruby
chosen
[ { "from": "system", "value": "Remove gemspec's dependency on rake\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'rake'\n\n# ------- Default Package ----------\nFILES = FileList[\n 'HISTORY',\n 'LICENSE',\n 'free-image.gemspec',\n 'Rakefile',\n '*.rdoc',\n 'lib/**/*.rb',\n ...
ruby
chosen
[ { "from": "system", "value": "Add required ruby version to gemspec.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib/', __FILE__)\n$:.unshift lib unless $:.include?(lib)\n\nrequire 'hpcloud/version'\n\nGem::Specification.new do |s|\n \n s.name =...
ruby
chosen
[ { "from": "system", "value": "Add route to add vote to a question\n" }, { "from": "human", "value": "get '/questions' do\n @questions = Question.all\n\n erb :'questions/index'\nend\n\nget '/questions/:id' do\n @question = Question.find(params[:id])\n\n erb :'questions/show'\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Save 198MB of memory per request\n" }, { "from": "human", "value": "# Component Helper\nmodule ComponentHelper\n extend self\n\n def generate_components_json\n ids = Version\n .indexed\n .select(:component_id)\n .to_a.map(&:component_...
ruby
chosen
[ { "from": "system", "value": "Fix an issue to show minute with 0\n" }, { "from": "human", "value": "require 'uri'\nrequire 'cgi'\n\nmodule VideosHelper\n\n def get_title(video)\n if video && video.title.length > 0\n video.title\n else\n \"(no title)\"\n end\n end\n\n def ge...
ruby
chosen
[ { "from": "system", "value": "Fix condition type calculation so it reflects FTA's TERM model\n" }, { "from": "human", "value": "class ConditionType < ActiveRecord::Base\n \n # default scope\n default_scope { where(:active => true) }\n \n def self.max_rating \n order(\"rating DESC\")...
ruby
chosen
[ { "from": "system", "value": "Fix typo in kind_if -> kind_of.\n" }, { "from": "human", "value": "actions :create, :create_if_missing, :touch, :delete\n\ndefault_action :create_if_missing\n\nattribute :path, kind_if: String, name_attribute: true\nattribute :remote_path, kind_of: String\nattribute...
ruby
chosen
[ { "from": "system", "value": "Fix Bundler require in Thor task." }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler'\nBundler.require(:default)\n\nclass Data < Thor\n include Mongo\n DIRECTORY = \"NYPD\"\n\n desc \"load_from_xml PATH\", \"Load XML Datashare data from PATH\"\...
ruby
chosen
[ { "from": "system", "value": "Remove related videos variable to enable playlist embeds\n" }, { "from": "human", "value": "# Jekyll - Easy Youtube Embed\n#\n# Katie Harron - https://github.com/pibby\n#\n# Input:\n# {% youtube Al9FOtZcadQ %}\n# Output:\n# <div class=\"video\">\n# <fi...
ruby
chosen
[ { "from": "system", "value": "Use the same upload path as in the engine era\n\nI'd rather have the directory set explicitly for each model, rather than\nrelying on the class name, but this is a quick fix for the immediate\nproblem.\n" }, { "from": "human", "value": "# encoding: utf-8\nclass Imag...
ruby
chosen
[ { "from": "system", "value": "Revert \"Deliver login code emails as part of request\"\n\nThis reverts commit 07ab85451bffb4dee42d5509687fc4e10ff5c6e6.\n\nDecided to revert this because of the failure modes: what if Mailgun\ngoes down for a little bit? Don't want our requests failing.\n" }, { "from":...
ruby
chosen
[ { "from": "human", "value": "Add rspec to cover wechat_config_js helper\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nRSpec.describe Wechat::Helpers do\n include Wechat::Helpers\n include ActionView::Helpers::JavaScriptHelper\n include ActionView::Helpers::TagHelper\n let(:contro...
ruby
chosen
[ { "from": "system", "value": "Update to rubygems 1.3.6 - 1.3.7 currently breaks chef!\n" }, { "from": "human", "value": "#\n# Author:: Adam Jacob <adam@opscode.com>\n# Cookbook Name:: rubygems\n# Recipe:: default\n#\n# Copyright 2009, Opscode, Inc.\n#\n# Licensed under the Apache License, Versio...
ruby
chosen
[ { "from": "system", "value": "Clean up spec for nonexistent config directory\n\nThis fixes a recurring issue where running specs in random order can\ncreate a named config directory ahead of a spec testing if does not\nexist.\n\nThis now creates a temp directory and immediately discards it before\ntesting f...
ruby
chosen
[ { "from": "system", "value": "Update description, summary, homepage 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 'git_pissed/version'\n\nGem::Specification.new do |spec|...
ruby
chosen
[ { "from": "system", "value": "Mark current version as incompatible with puma 6\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/guard/puma/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Jesse Cooke\"]\n gem.email ...
ruby
chosen
[ { "from": "system", "value": "Add Student and Employee traits to person factory\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :person do\n first_name { Faker::Name.first_name }\n preferred_name { first_name }\n last_name { Faker::Name.last_name }\n display_name ...
ruby
chosen
[ { "from": "human", "value": "Add test coverage for press page\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nfeature \"Press\" do\n scenario \"viewing page\" do\n visit press_path\n expect(page).to have_content \"Press\"\n end\n\n scenario \"viewing article\" do\n 5.times ...
ruby
chosen
[ { "from": "system", "value": "Add Pry as a development dependency.\n\nThis makes it possible to do `bundle exec uspec` and still have access\nto Pry.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PAT...
ruby
chosen
[ { "from": "system", "value": "Make view data script show average sentence length.\n\nSigned-off-by: Sam Phippen <e5a09176608998a68778e11d5021c871e8fae93c@googlemail.com>\n" }, { "from": "human", "value": "require \"pp\"\n\nhash = Marshal.load(File.binread(\".andrey\"))\nouter_count = hash.keys.c...
ruby
chosen
[ { "from": "system", "value": "Use <root>/static instead of just <root> for static files.\n" }, { "from": "human", "value": "require \"rubygems\"\nrequire \"sinatra/base\"\nrequire \"haml\"\nrequire \"sass\"\nrequire \"compass\"\n\ndef Blossom(config_file, index = :index)\n root = File.dirname(c...
ruby
chosen
[ { "from": "system", "value": "Disable instead of skip if evacuate unavailable, show error message\n" }, { "from": "human", "value": "class ApplicationHelper::Button::InstanceEvacuate < ApplicationHelper::Button::Basic\n def skip?\n !@record.is_available?(:evacuate)\n end\nend\n" }, { ...
ruby
chosen
[ { "from": "human", "value": "Convert human-readible random-example txt files to csv\n" }, { "from": "gpt", "value": "#!/usr/bin/ruby\n\n# Transform the human-formatted random-examples output txt files and turn them\n# into a csv. In general this shouldn't be necessary, since random examples can\...
ruby
chosen
[ { "from": "system", "value": "Add setup vars test for default spec values\n\n[#152505115]\n\nSigned-off-by: Vlad Stoian <3a646ed2933376f6ad3d8f73c719d7c5225000dd@pivotal.io>\n" }, { "from": "human", "value": "RSpec.describe 'setup-vars.bash file generation', template: true do\n let(:output) do\...
ruby
chosen
[ { "from": "system", "value": "Add code to run if standalone feature\n" }, { "from": "human", "value": "#! ruby\nrequire File.dirname(__FILE__) + '/legal_markdown/version'\nrequire File.dirname(__FILE__) + '/legal_markdown/make_yaml_frontmatter.rb'\nrequire File.dirname(__FILE__) + '/legal_markdo...
ruby
chosen
[ { "from": "system", "value": "Allow rails 3.2 through all of rails 4\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'iced/rails/version'\n\nGem::Specification.new do |gem|\n gem.name = \"ic...
ruby
chosen
[ { "from": "system", "value": "Add helper module methods for composing fully-qualified queue names\n" }, { "from": "human", "value": "require 'bunny'\n\nrequire 'fluffle/version'\nrequire 'fluffle/client'\nrequire 'fluffle/handlers/base'\nrequire 'fluffle/handlers/delegator'\nrequire 'fluffle/han...
ruby
chosen
[ { "from": "system", "value": "Remove handlers from @response_handlers after running them\n\nRight now they just stay in there forever.\n" }, { "from": "human", "value": "require \"neovim/logging\"\n\nmodule Neovim\n # @api private\n class Message\n def self.from_array((kind, *payload))\n ...
ruby
chosen
[ { "from": "system", "value": "Use consistent quotes around strings" }, { "from": "human", "value": "require \"action_controller\"\nrequire 'rqrcode'\nrequire 'rqrcode_rails3/renderers/svg.rb'\n\nmodule RQRCode\n Mime::Type.register \"image/svg+xml\", :svg\n Mime::Type.register \"image/png\", ...
ruby
chosen
[ { "from": "human", "value": "Add script for seeing how many students create a Bibliography sandbox\n" }, { "from": "gpt", "value": "campaign = Campaign.find_by_slug 'fall_2021'\nno_bibliography = [['course', 'title', 'exists?']]\n\ncampaign.courses.each do |course|\n puts course.slug\n sandbox...
ruby
chosen
[ { "from": "human", "value": "Add IO library to handle input/output\n" }, { "from": "gpt", "value": "require 'io/console'\nclass IO\n\n attr_reader :input\n attr_reader :output\n\n def initialize(params = {})\n @input = params.fetch(:input, STDIN)\n @output = params.fetch(:...
ruby
chosen
[ { "from": "system", "value": "Update GridOne to subclass Grid\n" }, { "from": "human", "value": "class GridOne\n\n attr_reader :map, :program_1, :background\n\n def initialize(window, user)\n @window, @user = window, user\n @map = Map.new(@window, 'media/grid_one.txt', 'media/grid_one_ti...
ruby
chosen
[ { "from": "human", "value": "Prepare for a fat binary gem.\n" }, { "from": "gpt", "value": "begin\n require \"#{RUBY_VERSION[/\\A[0-9]+\\.[0-9]+/]}/unf_ext.so\"\nrescue LoadError\n require \"unf_ext.so\"\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Clean up the gemspec, using Bundler's default as a guide\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib/', __FILE__)\n$:.unshift lib unless $:.include?(lib)\nrequire 'acts_as_geocodable/version'\n\nGem::Specification.new...
ruby
chosen
[ { "from": "system", "value": "Add ssl_allowed to WMS proxy\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'uri'\nrequire 'json'\nrequire_relative '../../../../services/wms/proxy'\n\nclass Api::Json::WmsController < Api::ApplicationController\n ssl_required :index\n\n def proxy\n...
ruby
chosen
[ { "from": "system", "value": "Update license field in gemspec to match LICENSE file\n\nMIT instead of ISC" }, { "from": "human", "value": "# coding: utf-8\nrequire File.expand_path('../lib/pwhois/version', __FILE__)\n\nGem::Specification.new do |spec|\n spec.name = \"pwhois\"\n spec.v...
ruby
chosen
[ { "from": "system", "value": "Add missing controller line for ApplicantMailer\n" }, { "from": "human", "value": "class ApplicationsController < ApplicationController\n before_action :get_event, only: [:show, :new, :create, :destroy]\n skip_before_action :authenticate, only: [:new, :create]\n\n...
ruby
chosen
[ { "from": "system", "value": "Use only dashboard_migration feature flag for the new views\n" }, { "from": "human", "value": "# coding: UTF-8\n\nclass DataLibraryController < ApplicationController\n layout 'data_library'\n\n ssl_allowed :index, :search\n before_filter :get_viewed_user\n\n def...
ruby
chosen
[ { "from": "system", "value": "Add URL of event at the end of summary in calendar entry\n" }, { "from": "human", "value": "class StaticPagesController < ApplicationController\n def home\n end\n\n def contact\n end\n\n def feed\n @title = \"Developers Connect Philippines\"\n @entries = ...
ruby
chosen
[ { "from": "system", "value": "Use 'DojoEventService.count' for number of dojos being measured\n" }, { "from": "human", "value": "class StaticPagesController < ApplicationController\n def home\n @dojo_count = Dojo.count\n @regions_and_dojos = Dojo.includes(:prefecture).default_order...
ruby
chosen
[ { "from": "system", "value": "Set default encoding to avoid raising an error from failed assertions (mu_pp).\n" }, { "from": "human", "value": "# TODO: this require causes a warning, but removing it causes an error...\nrequire 'jquery'\n\nrequire 'opal-jquery'\nrequire 'opal-haml'\n\nrequire 'ac...
ruby
chosen
[ { "from": "system", "value": "Update bower configuration file to match readme\n\nIt was missing the last line from [Configuration.](https://github.com/42dev/bower-rails/tree/92a85cdc16e4e51d0c4561b6f7eb3aa63dbcf340#configuration)" }, { "from": "human", "value": "BowerRails.configure do |bower_ra...
ruby
chosen
[ { "from": "system", "value": "Reduce verbosity of service definition\n" }, { "from": "human", "value": "require \"statsd\"\nrequire \"gds_api\"\nrequire \"gds_api/publishing_api\"\nrequire \"gds_api/content_store\"\nrequire \"gds_api/imminence\"\n\nmodule Services\n def self.publishing_api\n ...
ruby
chosen
[ { "from": "system", "value": "Optimize the code and updated to 1.0.1\n" }, { "from": "human", "value": "module UrlLink\n module ::ActionView\n module Helpers # :nodoc:\n module TextHelper\n\n def proper_url_link(url_link)\n unless url_link.blank?\n \n url_...
ruby
chosen
[ { "from": "system", "value": "Make it easier on _ in names.\n" }, { "from": "human", "value": "activate :aria_current\nactivate :directory_indexes\nactivate :syntax do |syntax|\n syntax.css_class = \"syntax-highlight\"\nend\n\nset :markdown, tables: true, autolink: true, gh_blockcode: true, fen...
ruby
chosen
[ { "from": "system", "value": "Add Lookback as a vendored framework\n" }, { "from": "human", "value": "require \"json\"\n\njson = File.read(File.join(__dir__, \"package.json\"))\npackage = JSON.parse(json).deep_symbolize_keys\n\nPod::Spec.new do |s|\n s.name = package[:name]\n s.version = packa...
ruby
chosen
[ { "from": "system", "value": "Update JOSM to version 9963\n" }, { "from": "human", "value": "cask 'josm' do\n version '9900'\n sha256 '33ee382336c8f26b4fa4de99515e8d95278d80b54bc460a368b0281fe0f5a38f'\n\n url \"https://josm.openstreetmap.de/download/macosx/josm-macosx-#{version}.zip\"\n name...
ruby
chosen
[ { "from": "system", "value": "Return the content for VLAN interfaces\n\nWe need to return the content of the file, and not the raw values. This\nwill ensure proper formatting of file to include new lines.\n" }, { "from": "human", "value": "require 'puppet_x/bsd/hostname_if/vlan'\n\nmodule Puppe...
ruby
chosen
[ { "from": "human", "value": "Add spec on Paginated behavior.\n" }, { "from": "gpt", "value": "# encoding: utf-8\nrequire 'spec_helper'\nrequire 'kaminari'\n\ndescribe Paginated::FoosController, type: :controller do\n\n before do\n 20.times do\n Foo.create!(name: Faker::Name.name, publis...
ruby
chosen
[ { "from": "system", "value": "Use a custom Sinatra condition to detect Haml URLs.\n" }, { "from": "human", "value": "require \"rubygems\"\nrequire \"sinatra/base\"\nrequire \"haml\"\nrequire \"sass\"\nrequire \"compass\"\n\ndef Blossom(config_file, index = :index)\n root = File.dirname(config_f...
ruby
chosen
[ { "from": "system", "value": "Add slug to categories entity\n" }, { "from": "human", "value": "module Entity\n class Category < Base\n expose :id#, documentation: {type: 'Integer', desc: 'Category ID'}\n expose :name#, documentation: {type: 'String', desc: 'The name of the category of art...
ruby
chosen
[ { "from": "system", "value": "Refactor out constants for default template\n" }, { "from": "human", "value": "require \"active_support\"\nrequire \"active_support/core_ext\"\nrequire \"yaml\"\n\nrequire \"hexflex/hexaflexagon\"\n\nmodule Hexflex\n\n class << self\n def make_template_vector(si...
ruby
chosen
[ { "from": "system", "value": "Remove linkage of plugin to common_tasks plugin\n" }, { "from": "human", "value": "# The following section loads ActiveRecord if not already loaded\nunless Object.const_defined? :ActiveRecord\n require 'erb'\n\n def add_to_paths(root_dir)\n Dir.glob( File.join(...
ruby
chosen
[ { "from": "human", "value": "Add migrate data for taxons\n" }, { "from": "gpt", "value": "class MigrateDataForTaxons < ActiveRecord::Migration\n def up\n Spree::Taxon.transaction do\n Spree::Taxon.find_each do |taxon|\n taxon.update_attributes!(taxon.untranslated_attributes, :wit...
ruby
chosen
[ { "from": "system", "value": "Add redirect_url, we need to check it when exchanging code\n" }, { "from": "human", "value": "require 'carto/db/migration_helper'\n\ninclude Carto::Db::MigrationHelper\n\nmigration(\n Proc.new do\n create_table :oauth_apps_users do\n Uuid :id, primar...
ruby
chosen
[ { "from": "system", "value": "Allow models to be passed as a string rather than as files\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'scoruby/version'\nrequire 'scoruby/model_factory'\nrequire 'nokogiri'\nrequire 'logger'\n\nmodule Scoruby\n class << self\n at...
ruby
chosen
[ { "from": "system", "value": "Load rails tasks only if not already loaded\n" }, { "from": "human", "value": "# This task is manually loaded after the engine has been initialized\nrequire 'rake'\n\nDATA_MIGRATE_TASK_NAME = 'data:migrate'\n\nif ENV['RAILS_ENV'] == 'test'\n DATA_MIGRATE_TASK_NAME ...
ruby
chosen
[ { "from": "system", "value": "Allow IP to be sent in Google Books API request\n\nGoogle Books requires an IP address to be sent\nwith all requests for Geo purposes - this breaks\non Heroku so we need to specify one manually." }, { "from": "human", "value": "class BookDetailsImporter\n class Boo...
ruby
chosen
[ { "from": "system", "value": "Add dependency on abstraction gem\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"amee-data-persistence\"\n s.version = '0.0.1'\n s.date = \"2011-03-24\"\n s.summary = \"\"\n s.email = \"james@floppy.org.uk\"\n s.homepage = \"http...
ruby
chosen
[ { "from": "system", "value": "Add check for JRuby apart from Windows on build_extensions method\n" }, { "from": "human", "value": "require 'rubygems/installer'\n\nmodule Bundler\n class GemInstaller < Gem::Installer\n def check_executable_overwrite(filename)\n # Bundler needs to install...
ruby
chosen
[ { "from": "system", "value": "Use more accurate timestamps for InfluxDB.\n\nThis changes the timestamp of metrics to be more accurate/unique by\nusing Time#to_f combined with a small random jitter value. This\ncombination hopefully reduces the amount of collisions, though there's\nno way to fully prevent an...
ruby
chosen
[ { "from": "system", "value": "Move start check into initializer to make sure Rails logs failures\n" }, { "from": "human", "value": "module Librato\n module Rails\n class Railtie < ::Rails::Railtie\n\n # don't have any custom http vars anymore, check if hostname is UUID\n on_heroku ...
ruby
chosen
[ { "from": "system", "value": "Fix the rubocop linting error for quotes.\n" }, { "from": "human", "value": "#\n# Author:: John Bellone (<jbellone@bloomberg.net>)\n# License:: Apache License, Version 2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use thi...
ruby
chosen
[ { "from": "human", "value": "Create the address picker endpoint\n" }, { "from": "gpt", "value": "module Onfido\n module AddressPicker\n def list_addresses(postcode)\n get(\n url: url_for('addresses/pick'),\n payload: {postcode: postcode.delete(' ')}\n )\n end\n en...
ruby
chosen
[ { "from": "system", "value": "Use new Pagelime Rack routes and filtering instead of duplicating\n" }, { "from": "human", "value": "\nmodule Pagelime\n module Rails\n class Engine < ::Rails::Engine\n engine_name :pagelime\n # paths[\"config/routes\"] << 'config/routes.rb'\n ini...
ruby
chosen
[ { "from": "system", "value": "Add summary, description and homepage to the gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'xero/version'\n\nGem::Specification.new d...
ruby
chosen
[ { "from": "system", "value": "Comment to explain the monkey patch\n" }, { "from": "human", "value": "require 'active_record/connection_adapters/sqlite3_adapter'\n\nmodule ActiveRecord\n module ConnectionAdapters\n class SQLite3Adapter < AbstractAdapter\n private\n def _type_cast(va...
ruby
chosen
[ { "from": "system", "value": "Return city and region in bot response\n" }, { "from": "human", "value": "require 'unirest'\nrequire 'open-uri'\n\nclass Now\n include Cinch::Plugin\n\n match /(now) (.+)/, prefix: /^(\\.)/\n match /(help now)$/, method: :help, prefix: /^(\\.)/\n\n def execute(m...
ruby
chosen
[ { "from": "human", "value": "Add Rake task to output generated CSVs to a file\n\nThis adds a new Rake task, 'topic_changes:prepare', which invokes the \nTopicChanges::Preparer class and writes the CSV returned to a file in\nthe 'tmp/' directory.\n\nThe Rake task takes two required arguments: the 'source_top...
ruby
chosen
[ { "from": "system", "value": "Use `require` instead of `autoload` for version.rb\n" }, { "from": "human", "value": "require 'active_support/dependencies/autoload'\n\nmodule SexyScopes\n %w( Version VERSION ).each do |constant|\n autoload constant, 'sexy_scopes/version'\n end\n \n extend A...
ruby
chosen
[ { "from": "system", "value": "Add validation to restricted hours\n" }, { "from": "human", "value": "class RestrictedHour < ActiveRecord::Base\n belongs_to :restaurant\nend\n" }, { "from": "gpt", "value": "class RestrictedHour < ActiveRecord::Base\n belongs_to :restaurant\n\n valid...
ruby
chosen
[ { "from": "system", "value": "Add more specs for the /api/v1/mutes/details endpoint\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Api::V1::MutesController, type: :controller do\n render_views\n\n let(:user) { Fabricate(:user, account: Fabricate(:account, username...
ruby
chosen
[ { "from": "human", "value": "Initialize omniauth autho0 and add shell of content\n" }, { "from": "gpt", "value": "Rails.application.config.middleware.use OmniAuth::Builder do\n provider(\n :auth0,\n 'YOUR_CLIENT_ID',\n 'YOUR_CLIENT_SECRET',\n 'YOUR_NAMESPACE',\n callback_path: \"...
ruby
chosen
[ { "from": "human", "value": "Add flipper http shared adapter spec\n\n* ensures flipper http adapter implements adapter api correctly\n" }, { "from": "gpt", "value": "require 'helper'\nrequire 'flipper/adapters/http'\nrequire 'flipper/adapters/memory'\nrequire 'flipper/spec/shared_adapter_specs'\...
ruby
chosen
[ { "from": "system", "value": "Make sample integration test more descriptive\n" }, { "from": "human", "value": "require File.expand_path('../../spec_helper', __FILE__)\n\ndescribe 'default node' do\n describe file('/var/lib/puppet') do\n it { should be_directory }\n end\n\n describe package...
ruby
chosen
[ { "from": "system", "value": "Fix inspect spec to guarantee the target thread is actually sleeping.\n\nA reminder for folks adding Thread specs: You *CAN NOT* know that a target\nthread is sleeping unless you are polling for status == 'sleep'. No amount\nof channel, lock, or state variable tricks will get a...
ruby
chosen
[ { "from": "human", "value": "Add plasticscm cask for version 7.0.16.2505\n" }, { "from": "gpt", "value": "cask 'plasticscm-cloud' do\n\n version '7.0.16.2505'\n sha256 \"78c66572adf68eea54379bb8e6f0176ceb748f90049368a654c708fdfaf2bfe8\"\n\n url \"https://s3.eu-west-2.amazonaws.com/plastic-rel...
ruby
chosen
[ { "from": "human", "value": "Add Spek audio spectrum analyzer\n\nInitial commit\n" }, { "from": "gpt", "value": "class Spek < Cask\n url 'https://spek.googlecode.com/files/spek-0.8.3.dmg'\n homepage 'http://spek.cc'\n version '0.8.3'\n sha1 'b66d940180991788346fd6abacb2f6c2f01c4351'\n link ...
ruby
chosen
[ { "from": "system", "value": "Fix for new refinery version" }, { "from": "human", "value": "Refinery::Admin::PagesController.class_eval do\n def load_valid_templates\n @valid_layout_templates = Refinery::Themes::Theme.layouts\n @valid_view_templates = Refinery::Themes::Theme.templates\n ...
ruby
chosen
[ { "from": "system", "value": "Replace find_each with each to use order and limit methods\n" }, { "from": "human", "value": "module Jobs\n module Headlines\n class CollectDomainsCountry < Jobs::Scheduled\n every 30.minutes\n\n def execute(_args)\n domains.find_each do |domain...
ruby
chosen