conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Make sure lib/tasks exists before putting a file ther.\n" }, { "from": "human", "value": "class FriendlyIdGenerator < Rails::Generator::Base\n def manifest\n record do |m|\n unless options[:skip_migration]\n m.migration_template(\n 'create_s...
ruby
chosen
[ { "from": "human", "value": "Add tests for plants routing\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe PlantsController do\n it 'routes GET /plants/new' do\n expect(get: '/plants/new').to route_to('plants#new')\n end\n\n it 'routes POST /plants' do\n expect(post: ...
ruby
chosen
[ { "from": "system", "value": "Delete an unexisted key does not raise an error\n" }, { "from": "human", "value": "shared_examples \"undo integration\" do\n subject { Undo }\n let(:object) { Hash.new hello: :world }\n\n it \"stores and restores object\" do\n uuid = subject.store object\n ...
ruby
chosen
[ { "from": "system", "value": "Install 'libffi-dev' as prerequisite for certain Ruby verisons\n" }, { "from": "human", "value": "\nnode.set['chruby']['rubies'] = {\n '1.9.3-p392' => false,\n node['railsstack']['ruby_version'] => true }\n\nnode.set['chruby']['default'] = node['railsstack']['ruby...
ruby
chosen
[ { "from": "system", "value": "Remove an extra whitespace in test files\n\nPartial CE backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10565\n\nSigned-off-by: Takuya Noguchi <b6ff22f4ae6fe3ca1371a0ef8d104f1c4bca551b@gmail.com>\n" }, { "from": "human", "value": "FactoryBot.define...
ruby
chosen
[ { "from": "system", "value": "Add newline between library require and inner require\n" }, { "from": "human", "value": "require 'digest/sha1'\nrequire 'em-midori/version'\nrequire 'em-midori/string'\nrequire 'em-midori/const'\nrequire 'em-midori/define_class'\nrequire 'em-midori/error'\nrequire '...
ruby
chosen
[ { "from": "system", "value": "Add website_address attribute to Principal factory\n" }, { "from": "human", "value": "FactoryGirl.define do\n sequence(:fca_number, 100000) { |n| n }\n\n factory :principal do\n fca_number\n first_name { Faker::Name.first_name }\n last_name { Faker::Name....
ruby
chosen
[ { "from": "human", "value": "Add utility script for guessing encoding mappings\n" }, { "from": "gpt", "value": "# Utility function (to be used in irb) that allows looking at lines in tituly.txt and manually guess\n# encoding mappings.\n# This is because the encoding isn't really windows-1250...\...
ruby
chosen
[ { "from": "system", "value": "Update spec to version 0.2.0\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'SEJSONViewController'\n spec.version = '0.1.0'\n spec.authors = {'Sérgio Estêvão' => 'sergioestevao@gmail.com'}\n spec.homepage = 'https://github.com/SergioEst...
ruby
chosen
[ { "from": "system", "value": "Change strategy for auto-generating test user\n\nWe need to ensure that the FIRST user always has the resource_manager\npermission, not just the user with the name \"Test User\".\n\nAlso, we don't need to set GDS::SSO.test_user because by default it will\nuse User.first.\n" }...
ruby
chosen
[ { "from": "system", "value": "Add respond_to checks for :course and :lessons back into spec\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Section do\n let(:course) { double(\"Course\", :id => 1) }\n\n subject(:section) { Section.new(\n :title => \"test section\",\n ...
ruby
chosen
[ { "from": "system", "value": "Break out object inspection into helper methods\n" }, { "from": "human", "value": "module Bullet\n module Detector\n class UnusedEagerAssociation < Association\n def add_unused_preload_associations(klazz, associations)\n notice = Bullet::Notice::...
ruby
chosen
[ { "from": "system", "value": "Add signatures for `Fetch` module.\n" }, { "from": "human", "value": "# typed: true\n# frozen_string_literal: true\n\nmodule Homebrew\n # @api private\n module Fetch\n def fetch_bottle?(f, args:)\n return true if args.force_bottle? && f.bottle\n retur...
ruby
chosen
[ { "from": "system", "value": "Add UpdateFulfillmentOrder action to FulfillmentOutboundShipment\n" }, { "from": "human", "value": "module MWS\n module API\n class FulfillmentOutboundShipment < Base\n Actions = [\n :cancel_fulfillment_order,\n :create_fulfillment_order,\n ...
ruby
chosen
[ { "from": "system", "value": "Handle license dupes without member_to\n" }, { "from": "human", "value": "class FixDupeLicenses < ActiveRecord::Migration\n def change\n Person.current = RacingAssociation.current.person\n\n Person.transaction do\n Person.where(license: \"\").update_all(...
ruby
chosen
[ { "from": "human", "value": "Add rake task to publish interstitial page\n" }, { "from": "gpt", "value": "desc \"Publish interstitial page\"\ntask publish_interstitial_page: :environment do\n content_id = \"4dc3b42e-4e96-4f66-b9d1-0cb5e9676e3c\"\n params = {\n base_path: \"/interstitial\",\n...
ruby
chosen
[ { "from": "system", "value": "Rename task module to railties\n" }, { "from": "human", "value": "# require 'rake'\n\n# load rake tasks in case GEM is included within rails project\n\nrequire 'csv'\nrequire 'yaml'\nrequire 'open-uri'\nrequire 'i18n_docs/missing_keys_finder'\nrequire 'i18n_docs/csv...
ruby
chosen
[ { "from": "system", "value": "Fix failing test - Modify string conctactenation\n" }, { "from": "human", "value": "class Payment\n def self.tips\n { check_payment_instructions:\n \"Checks should be made out to:<br /><strong>Church in Anaheim -\"\\\n \"YP</strong><br /> and presented...
ruby
chosen
[ { "from": "system", "value": "Fix duplication in the risk analyzer\n\n+ high risk, medium risk, and low risk need to be mutually exclusive\n+ we're ditching the whole risk analysis module in the next round anyway so not work testing\n+ resolves #62\n" }, { "from": "human", "value": "class Studen...
ruby
chosen
[ { "from": "system", "value": "Fix stub for tagdata, now get_tagdata.\n" }, { "from": "human", "value": "shared_examples '#download_summary_pdf' do |object|\n context 'download pdf file' do\n let(:record) { FactoryBot.create(object) }\n let(:pdf_options) { controller.instance_variable_get(...
ruby
chosen
[ { "from": "system", "value": "Fix TextMateFormatter for Ruby <= 2.1.\n\n`CGI.h` isn’t available before Ruby 2.1.0.\n" }, { "from": "human", "value": "require 'cgi'\nrequire 'rspec/core/formatters/html_formatter'\n\n# This formatter is only used for RSpec 3 (older RSpec versions ship their own Te...
ruby
chosen
[ { "from": "system", "value": "Remove more duplication from API application controller\n" }, { "from": "human", "value": "class Api::ApplicationController < ApplicationController\n skip_before_action :verify_authenticity_token\n before_action :check_api_key\n\n rescue_from ActiveRecord::Record...
ruby
chosen
[ { "from": "system", "value": "Fix create_admin_user.\nUnmock Ajax so we don't interfere with the rest of the tests.\n" }, { "from": "human", "value": "module Ajax\n module Spec\n module Extension\n\n def integrate_ajax\n Ajax.enabled = true\n end\n\n def disable_ajax\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Adjusting name of Pod to be detected by i18n script\"\n\nThis reverts commit 935fc64f79c154767ab1c45647417a7c864f36a4.\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint NAME.podspec' to ensure this is a\n# valid spec and remove all commen...
ruby
chosen
[ { "from": "system", "value": "Set default :pty value to false\n\n`:pty` had previously been incorrectly set to default to `true`\n\nCloses issue #652\n" }, { "from": "human", "value": "set :scm, :git\nset :branch, :master\nset :deploy_to, \"/var/www/#{fetch(:application)}\"\nset :tmp_dir, \"/tmp...
ruby
chosen
[ { "from": "system", "value": "Use a wildcard for an unused variable.\n" }, { "from": "human", "value": "module Admin::Resources::FiltersHelper\n\n def build_filters(resource = @resource, params = params)\n if (typus_filters = resource.typus_filters).any?\n locals = {}\n\n locals[:f...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in GitHub 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 => 'github' do\n version :latest\n sha256 :no...
ruby
chosen
[ { "from": "system", "value": "Upgrade QtSpim to 9.1.15 and pkg file\n\nQtSpim Remove trailing space\n\nAdd uninstall directive to QtSpim\n" }, { "from": "human", "value": "cask :v1 => 'qtspim' do\n version :latest\n sha256 :no_check\n\n url 'http://sourceforge.net/projects/spimsimulator/files...
ruby
chosen
[ { "from": "human", "value": "Add Huge model for use in test\n" }, { "from": "gpt", "value": "class Huge < Dinamo::Model\n strict false\n self.table_name = \"dinamo_tests2\"\n hash_key :id, type: :number\n range_key :type, type: :string\n field :lucky_number, default: 1\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Set encoding of the multibyte test helpers file to UTF-8 so the strings can be read by Ruby 1.9.\n" }, { "from": "human", "value": "module MultibyteTestHelpers\n UNICODE_STRING = 'こにちわ'\n ASCII_STRING = 'ohayo'\n BYTE_STRING = \"\\270\\236\\010\\210\\245\"\n\n d...
ruby
chosen
[ { "from": "human", "value": "Add code wards justify text\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/text-align-justify/ruby\n# --- Iteration 1 ---\ndef justify(text, width)\n current_count = 0\n words_with_len = text.split.each_with_object([]) do |word, list|\n if list....
ruby
chosen
[ { "from": "system", "value": "Update rake dependency for CVE-2020-8130\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire File.expand_path('lib/dribbble/version', __dir__)\n\nGem::Specification.new do |s|\n s.name = 'dribbble'\n s.version = Dribbble::VERSI...
ruby
chosen
[ { "from": "human", "value": "Test that starbucksstats gets list of beverage types\n" }, { "from": "gpt", "value": "require 'spec_helper.rb'\n\ndescribe \"#starbucksstats get beverage types\" do\n it 'gets a list of all available beverage types' do\n actual_beverages = ['bottled-drinks', 'bre...
ruby
chosen
[ { "from": "system", "value": "Check if the last commit has a last build\n\nThis silences another cron error with duck tape.\n" }, { "from": "human", "value": "class Scheduler\n def perform\n projects = Project.where(always_build: true).all\n projects.each do |project|\n last_commit =...
ruby
chosen
[ { "from": "system", "value": "Update Gemspec to release updated README to rubygems." }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"attribute_ext\"\n s.version = \"1.0\"\n s.aut...
ruby
chosen
[ { "from": "system", "value": "Make sure address is populated in the monit configuration\n" }, { "from": "human", "value": "default['optoro_memcached']['log_dir'] = '/var/log/memcached'\ndefault['optoro_memcached']['log_path'] = \"#{node['optoro_memcached']['log_dir']}/memcached.log\"\ndefault['o...
ruby
chosen
[ { "from": "system", "value": "Add lower limit bundler version\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'awesome_scrub/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add batch_action to toggle validated for GuestBook AA resource\n" }, { "from": "human", "value": "ActiveAdmin.register GuestBook do\n menu parent: I18n.t('admin_menu.modules')\n\n permit_params :id,\n :username,\n :content,\n ...
ruby
chosen
[ { "from": "system", "value": "Disable forgery check for agile_pois (because of caching)\n" }, { "from": "human", "value": "class AgilePoisController < AuthenticatedApplicationController\n before_action :set_agile_poi, only: [:show, :edit, :update, :destroy]\n respond_to :html, :json\n\n def i...
ruby
chosen
[ { "from": "system", "value": "Add sorting to category & album listing" }, { "from": "human", "value": "class CategoriesController < ApplicationController\n respond_to :html, :json, :js\n load_and_authorize_resource find_by: :slug\n\n def index\n @categories = @categories.roots\n respond...
ruby
chosen
[ { "from": "system", "value": "Change cache to 1 day\n" }, { "from": "human", "value": "require 'dashboard'\n\nclass AggregateSchoolService\n def initialize(school)\n @school = school\n end\n\n def aggregate_school\n Rails.cache.fetch(cache_key, expires_in: 3.hours) do\n meter_colle...
ruby
chosen
[ { "from": "system", "value": "Fix wrongful mentions breaking status update\n" }, { "from": "human", "value": "class ProcessMentionsService < BaseService\n # Scan status for mentions and fetch remote mentioned users, create\n # local mention pointers, send Salmon notifications to mentioned\n #...
ruby
chosen
[ { "from": "system", "value": "Update the mysql source url\n\nThe previous source URL was being problematic, so moved to a new source\n" }, { "from": "human", "value": "#\n# Copyright 2013, Craig Tracey <craigtracey@gmail.com>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\")...
ruby
chosen
[ { "from": "system", "value": "Update podspec for 1.3.0 release\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"FileKit\"\n s.version = \"1.2.0\"\n s.summary = \"Simple and expressive file management in Swift.\"\n s.hom...
ruby
chosen
[ { "from": "system", "value": "Add csrf protection to reset action\n\nSigned-off-by: Nick Quaranto <75ef9faee755c70589550b513ad881e5a603182c@quaran.to>\n" }, { "from": "human", "value": "class Api::V1::ApiKeysController < Api::BaseController\n before_action :redirect_to_root, unless: :signed_in?...
ruby
chosen
[ { "from": "system", "value": "Use hash syntax for query conditions\n" }, { "from": "human", "value": "class MetadataValuesController < ApplicationController\n\n def index\n raise \"Corpus ID is missing!\" unless received_id_for?(:corpus)\n\n render json: MetadataValue\n .joins(:metad...
ruby
chosen
[ { "from": "human", "value": "Add default for price on events and tables\n" }, { "from": "gpt", "value": "class AddDefaultPrice < ActiveRecord::Migration[5.0]\n def up\n change_column_default :events, :price, 0\n change_column_default :tables, :price, 0\n\n Event.find_each do |event|\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Taxon name from string to text\"\n\nThis reverts commit 1575c3424acb2d177afd03acbf13ac1b1fc16fee.\n" }, { "from": "human", "value": "class CreateCdxTaxons < ActiveRecord::Migration[5.1]\n def change\n create_table :cdx_taxons do |t|\n t.text :name,...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) - from to step sequence generator\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/56459c0df289d97bd7000083/\n# --- iteration 1 ---\ndef generator(from, to, step)\n return [] if step < 1\n if to < from\n from.downto(to).to_a.map....
ruby
chosen
[ { "from": "system", "value": "Make sure the number for ABRT signal does not lead to IOT\n\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\n\ndescribe \"Signal.signame\" do\n it \"takes a signal name with a well known signal number\" do\n Signal.s...
ruby
chosen
[ { "from": "system", "value": "Fix for blank line numbers - use .blank? [ci skip]\n" }, { "from": "human", "value": "# encoding: utf-8\nmodule NoticesHelper\n def notice_atom_summary notice\n render :partial => \"notices/atom_entry.html.haml\", :locals => {:notice => notice}\n end\n\n def l...
ruby
chosen
[ { "from": "system", "value": "Increase railties dependency version, in hopes of supporting Rails 4.0.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'dependent-fields-rails'\n s.version = '0.4.0'\n s.author = 'Lion Vollnhals'\n s.email = 'lion@giantmonkey.d...
ruby
chosen
[ { "from": "system", "value": "Add JSON Content-Type to the POST request\n\nPer Discord support, this appears to be the issue." }, { "from": "human", "value": "class SlackNotification\n def self.perform(url, payload)\n json = payload.to_json\n request = HTTParty.post(url, body: json)\n ...
ruby
chosen
[ { "from": "system", "value": "Rename method - \"process\" is smelly language\n" }, { "from": "human", "value": "class OhlifeImporter\n def initialize(user, import)\n @user = user\n @import = import\n end\n\n def run\n export.each_line(separator) do |line|\n if is_start_of_entry?...
ruby
chosen
[ { "from": "system", "value": "Add valid relationship edges for RiskyAttribute [story:562852]\n" }, { "from": "human", "value": "class RiskyAttribute < ActiveRecord::Base\n include AuthoredModel\n include SluggedModel\n include SearchableModel\n include AuthorizedModel\n include RelatedModel...
ruby
chosen
[ { "from": "system", "value": "fix: Use client_id from params in OpenID initialization\n\nWe were previously pulling the `client_id` from the first `LtiInstall` record\nwith a matching `iss`. This approach only works if there's only one\n`LtiInstall` record with a matching `iss` though. In practice, we may v...
ruby
chosen
[ { "from": "system", "value": "Use the new School.with_location_info scope" }, { "from": "human", "value": "class ParticipatingSchoolsController < ApplicationController\n def index\n @schools = School\n .participating\n .includes(town: {municipality: :state})\n .order('town_id,...
ruby
chosen
[ { "from": "system", "value": "Fix for when products deleted.\n" }, { "from": "human", "value": "Spree::StockLocation.class_eval do\n\n belongs_to :supplier\n attr_accessible :supplier_id\n\n scope :with_supplier, ->(supplier) { where(supplier_id: supplier) }\n\n # Wrapper for creating a new ...
ruby
chosen
[ { "from": "system", "value": "Add allele registry to assertion detail presenter\n" }, { "from": "human", "value": "class AssertionDetailPresenter < AssertionIndexPresenter\n def as_json(opts = {})\n super.merge(\n {\n gene: {name: assertion.gene.name, id: assertion.gene.id},\n ...
ruby
chosen
[ { "from": "system", "value": "Update Boards::Lists::DestroyService to remove list on a specic board\n" }, { "from": "human", "value": "module Boards\n module Lists\n class DestroyService < Boards::BaseService\n def execute(list)\n return false unless list.destroyable?\n\n ...
ruby
chosen
[ { "from": "system", "value": "Make name a method arg.\n" }, { "from": "human", "value": "module Capybara::Harness::Dom\n class Field\n include Capybara::DSL\n\n attr_accessor :name, :label, :data_type, :through\n attr_accessor :name, :label, :as, :through\n\n def initialize(options ...
ruby
chosen
[ { "from": "system", "value": "Update React Native documentation (0.36)\n" }, { "from": "human", "value": "module Docs\n class ReactNative < React\n self.name = 'React Native'\n self.slug = 'react_native'\n self.type = 'react'\n self.release = '0.35'\n self.base_url = 'https://fac...
ruby
chosen
[ { "from": "system", "value": "Use %r{} notation in order to avoid warning\n\n\"warning: ambiguous first argument; put parentheses or a space even\nafter `/' operator\"\n" }, { "from": "human", "value": "module Garufa\n module API\n module Routes\n module Channels\n Server.route('...
ruby
chosen
[ { "from": "system", "value": "Send the feed, not the id\n" }, { "from": "human", "value": "require 'xmlrpc'\nrequire 'xmlrpc/rack_server'\n\nclass Ping\n def self.call(env)\n server = XMLRPC::RackServer.new\n server.add_introspection\n server.add_handler('weblogUpdates', self.new)\n ...
ruby
chosen
[ { "from": "system", "value": "Add a rake task to create an uberadmin invitation\n" }, { "from": "human", "value": "# desc \"Explaining what the task does\"\n# task :invitational do\n# # Task goes here\n# end\n" }, { "from": "gpt", "value": "namespace :invitational do\n desc \"Crea...
ruby
chosen
[ { "from": "system", "value": "Fix the issue with the create_uberadmin rake task\n" }, { "from": "human", "value": "namespace :invitational do\n desc \"Creates an Uberadmin User\"\n task :create_uberadmin => [:environment] do\n email = Digest::SHA1.hexdigest(DateTime.now.to_s) + \"@localhost...
ruby
chosen
[ { "from": "system", "value": "Fix metrics for new HTML Format of Facebook\n\nCloses #66\n" }, { "from": "human", "value": "module Funky\n # @api private\n module HTML\n class Parser\n def parse(html:)\n {\n view_count: extract_views_from(html),\n share_count: e...
ruby
chosen
[ { "from": "human", "value": "Add rake task to re-do PD calculations\n\nUseful just after migration\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"benchmark\"\n\nnamespace :pd do\n desc \"Applies the PD Calculations that are normally done when a user saves a regime. ...
ruby
chosen
[ { "from": "system", "value": "Update gemspec for Lita 3.0 compatibility.\n" }, { "from": "human", "value": "Gem::Specification.new do |spec|\n spec.name = \"lita-poop\"\n spec.version = \"1.0.1\"\n spec.authors = [\"Mitch Dempsey\"]\n spec.email = [\"mitch@mitchd...
ruby
chosen
[ { "from": "system", "value": "Remove test/tmp dir after running generator tests\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass SimpleFormGeneratorTest < Rails::Generators::TestCase\n tests SimpleForm::Generators::InstallGenerator\n destination File.expand_path('../../tmp', _...
ruby
chosen
[ { "from": "human", "value": "Add a tool to process logs looking for frequency of method calls\n\nEnhance developer insight into what is used\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nRAILS_ROOT = File.expand_path(File.join(__dir__, %w(.. ..)))\nrequire 'manageiq-gems-pending'\nrequ...
ruby
chosen
[ { "from": "human", "value": "Add PayPal Transactions Controller for Preapproval\n\nAdd a controller to handle the response from PayPal for when a\nPreapproval request is granted via the PayPal request forms.\n" }, { "from": "gpt", "value": "class PaypalTransactionsController < ApplicationControl...
ruby
chosen
[ { "from": "system", "value": "Add more asset.precompile directives for ckeditor\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :produc...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded player query from invites\n" }, { "from": "human", "value": "class Tournaments::InvitesController < ApplicationController\n before_filter :authenticate_user!\n before_filter :find_invite_for_tournament, :only => [:show, :update]\n before_filter :f...
ruby
chosen
[ { "from": "system", "value": "Delete SPEC_TEMP_DIR only by main process.\n\nIf a spec call Process.fork, lib/mspec/helpers/tmp.rb's at_exit is\ncalled by the forked process. This means the temp dir, which is still\nused, may be removed other than main process.\n" }, { "from": "human", "value": "...
ruby
chosen
[ { "from": "system", "value": "Add support for format parameter in the command line\n\nIn order to call the rake task and get JSON output will be like so:\n\n```\nrake stats\\[test/dummy,json\\]\n```\n" }, { "from": "human", "value": "desc \"Report code statistics (KLOCs, etc) from the current (o...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to allow rails 5 and later rails 4 versions" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"canvas_spaces/version\"\n\n# Describe your gem and declare its dependencies:\nGem:...
ruby
chosen
[ { "from": "system", "value": "Make Tfl widget use async HTTP\n" }, { "from": "human", "value": "require 'yajl'\nrequire 'httparty'\n\nmodule Sonia\n module Widgets\n class Tfl < Sonia::Widget\n\n def initial_push\n fetch_data\n EventMachine::add_periodic_timer(150) { fetch...
ruby
chosen
[ { "from": "system", "value": "Fix an annoying i18n bug\n" }, { "from": "human", "value": "module Tenon\n class I18nLookup\n def initialize(klass)\n @klass = klass\n end\n\n def fields\n self.class.fields[:tables][@klass.to_s.underscore.pluralize.to_sym] || []\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Use the Aruba API instead of a step in a step def\n" }, { "from": "human", "value": "Given /^the following profiles? (?:are|is) defined:$/ do |profiles|\n step 'a file named \"cucumber.yml\" with:', profiles\nend\n\nThen /^the (.*) profile should be used$/ do |prof...
ruby
chosen
[ { "from": "system", "value": "FIX: Remove output from db helper\n" }, { "from": "human", "value": "module DbHelpers\n def db_concat(*args)\n env = ENV['RAILS_ENV'] || 'development'\n adapter = ActiveRecord::Base.configurations[env]['adapter'].to_sym\n args.map! { |arg| arg.class == Sym...
ruby
chosen
[ { "from": "system", "value": "Add missing class to builds page\n" }, { "from": "human", "value": "module NavHelper\n def nav_menu_collapsed?\n cookies[:collapsed_nav] == 'true'\n end\n\n def nav_sidebar_class\n if nav_menu_collapsed?\n \"sidebar-collapsed\"\n else\n \"sideb...
ruby
chosen
[ { "from": "system", "value": "Clean up the gemspec a tiny bit\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'typedeaf/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Include test files in gemspec.\n" }, { "from": "human", "value": "# encoding: utf-8\nlib = File.expand_path('../lib/', __FILE__)\n$:.unshift lib unless $:.include?(lib)\n\nrequire 'typhoeus/version'\n\nGem::Specification.new do |s|\n s.name = \"typhoeus\"\n...
ruby
chosen
[ { "from": "system", "value": "Use expand_path because require_relative doesn't work :)\n" }, { "from": "human", "value": "name 'chef-sugar'\nmaintainer 'Seth Vargo'\nmaintainer_email 'sethvargo@gmail.com'\nlicense 'Apache 2.0'\ndescription 'Installs chef-sugar. Pl...
ruby
chosen
[ { "from": "system", "value": "Remove the unused apt cookbook\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "name 'openvpn'\nversion '3.0.0'\nmaintainer 'Sous Chefs'\nmaintainer_email 'help@sous-chef...
ruby
chosen
[ { "from": "system", "value": "Update AWS SDK to v3\n\nObvious fix.\n" }, { "from": "human", "value": "name 'aws'\nmaintainer 'Chef Software, Inc.'\nmaintainer_email 'cookbooks@chef.io'\nlicense 'Apache-2.0'\ndescription 'Provides resources for managing AWS resources'\nlong_description IO.read(Fi...
ruby
chosen
[ { "from": "system", "value": "Move error collection to a safe method with the same name\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'active_record/prunable'\n\nmodule Prunable\n @@eager_load = nil\n\n class << self\n def models\n @@eager_load ||= Rails.a...
ruby
chosen
[ { "from": "system", "value": "Make maximum use of 767 bytes\n" }, { "from": "human", "value": "class CreateFriendlyIdSlugs < ActiveRecord::Migration\n def change\n create_table :friendly_id_slugs do |t|\n t.string :slug, :null => false\n t.integer :sluggable_id, :nul...
ruby
chosen
[ { "from": "system", "value": "Fix credit card spec that was depending on current year\n\nAfter this commit https://github.com/openfoodfoundation/spree/commit/5d93d1dedb0c727c9a78770d35a4363a16fa1691, this static fix was meant to fail https://github.com/openfoodfoundation/openfoodnetwork/commit/3f33e28839cc6...
ruby
chosen
[ { "from": "system", "value": "Configure action dispatch trusted proxies\n" }, { "from": "human", "value": "require_relative 'boot'\n\nrequire \"rails\"\n# Pick the frameworks you want:\nrequire \"active_model/railtie\"\nrequire \"active_job/railtie\"\nrequire \"active_record/railtie\"\nrequire \...
ruby
chosen
[ { "from": "system", "value": "Change config load defaults to 6.0\n" }, { "from": "human", "value": "require_relative 'boot'\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundler.require(*Rails.groups)...
ruby
chosen
[ { "from": "system", "value": "Put timestamps in the standard rails logger\n" }, { "from": "human", "value": "# Load the rails application\nrequire File.expand_path('../application', __FILE__)\n\n# Initialize the rails application\nTrackalong::Application.initialize!\n" }, { "from": "gpt"...
ruby
chosen
[ { "from": "system", "value": "Raise errors when a mustache variable/method isn't found.\n" }, { "from": "human", "value": "require 'mustache'\n\nmodule MozNav\n class MustacheBase < Mustache\n self.view_path = MozNav::Root + 'moz_nav/views'\n self.template_path = MozNav::Root + 'moz...
ruby
chosen
[ { "from": "system", "value": "Move these requires into spec helper\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'rspec'\nrequire 'isbm'\n\n# Not run with spec_helper in order to test default config values\ndescribe Isbm::Config do\n before do\n ENV[\"RACK_ENV\"] = \"test\"\...
ruby
chosen
[ { "from": "human", "value": "Add first test for Pieces::Listener" }, { "from": "gpt", "value": "describe Pieces::Listener do\n within_tmp_dir\n\n context 'when first listening' do\n subject do\n Pieces::Generator.init\n Pieces::Listener.new.listen\n Dir['build/*']\n end\n\...
ruby
chosen
[ { "from": "human", "value": "WIP: Change size 3 to 6 for measure_type_id columns\n" }, { "from": "gpt", "value": "Sequel.migration do\n up do\n alter_table :additional_code_type_measure_types_oplog do\n set_column_type :measure_type_id, String, size: 6\n end\n alter_table :chief_m...
ruby
chosen
[ { "from": "system", "value": "Add Thor as a runtime 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 'eventide/generators/version'\n\nGem::Specification.new do |spec|\n spe...
ruby
chosen
[ { "from": "system", "value": "Make supported extensions array to contain strings\n" }, { "from": "human", "value": "require 'shellwords'\nrequire \"poi2csv/version\"\n\nmodule Poi2csv\n\n Poi2csvException = Class.new(StandardError)\n SUPPORTED_EXTENSIONS = [:xls, :xlsx]\n\n def self.to_csv(in...
ruby
chosen
[ { "from": "system", "value": "Add ability to customize path via block and sets debug to true by default\n" }, { "from": "human", "value": "class SeedBed\n \n @@debug = false\n \n \n \n def plant( file )\n puts \"Loading #{File.expand_path(\"db/seeds/#{file.to_s}.rb\")}\" if SeedBed.debu...
ruby
chosen