conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix some Rubocop offences & warnings in AWS config\n\nI was seeing the following locally:\n\n* Layout/IndentationWidth\n* Layout/ElseAlignment\n* Lint/EndAlignment\n\nFor some reason these were not picked up by the Jenkins CI build of the\nmaster branch. I plan to investigate w...
ruby
chosen
[ { "from": "human", "value": "Add tests to validate sample files\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass Chelsy::SampleTest < Minitest::Test\n SAMPLE_DIR = File.expand_path('../../sample/', __FILE__)\n\n def test_hello\n validate_generate_sample 'hello_chelsy'\n end\...
ruby
chosen
[ { "from": "system", "value": "Exclude /dev and /proc from find\n" }, { "from": "human", "value": "require 'ajimi/server/ssh'\nrequire 'ajimi/server/entry'\n\nmodule Ajimi\n class Server\n def initialize(options = {})\n @options = options\n end\n\n def host\n @options[:host]\n...
ruby
chosen
[ { "from": "system", "value": "Update Dwarf Fortress MacNewbie to 0.9.16a.\n" }, { "from": "human", "value": "cask :v1 => 'dwarf-fortress-macnewbie' do\n version '0.9.9'\n sha256 'ca04045341330e2258e1eedf296eefa2b5fe339c7a01618449f4b1adf6478358'\n\n url \"http://dffd.wimbli.com/download.php?id...
ruby
chosen
[ { "from": "system", "value": "Switch to test/unit for compatibility\n" }, { "from": "human", "value": "require 'bundler/setup'\nrequire 'minitest/autorun'\n\nrequire 'ventana'\n\n# Remove deprecation warning\nI18n.enforce_available_locales = true\n\nclass TestCase < Minitest::Unit::TestCase\nend...
ruby
chosen
[ { "from": "system", "value": "Print warning if test database is missing." }, { "from": "human", "value": "$:.unshift File.expand_path(\"../../lib\", __FILE__)\n\nrequire \"bundler\"\nBundler.setup(:test)\nrequire \"simplecov\"\nSimpleCov.start\n\nrequire \"etest-unit\"\nrequire \"active_record/m...
ruby
chosen
[ { "from": "system", "value": "Add frozen string literal comment for test\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'helper'\n\nclass TestFakerJobVN < Test::Unit::TestCase\n include DeterministicHelper\n\n assert_methods_are_deterministic(FFaker::JobVN, :title)\n\n def se...
ruby
chosen
[ { "from": "system", "value": "Switch to modular sinatra style (subclass `Sinatra::Application`)\n" }, { "from": "human", "value": "require 'sinatra'\n\nrequire './models/student'\n\nget '/hi' do \n \"Hello world!\"\nend\n\nget '/' do\n @students = Student.all\n @cluster = (params[:cluster] !...
ruby
chosen
[ { "from": "system", "value": "Test case where no injection targets are defined\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"attr_inject\"\n\nclass SimpleInject\n\n attr_inject :foo\n attr_inject :bar\n\nend\n\nclass InjectViaInitialize\n\n attr_inject :bat\n attr_inj...
ruby
chosen
[ { "from": "system", "value": "Fix integration tests for local .gemrc installation\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'sprout-ruby' do\n before :all do\n expect(File).not_to be_exists('/etc/gemrc')\n end\n\n it 'converges without errors' do\n expect(syst...
ruby
chosen
[ { "from": "system", "value": "Set peding failing test due to brightpearl bug\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Spree::BpHook do\n describe '#set_products' do\n before do\n Spree::Config[:brightpearl_email] = 'steven@crowdint.com'\n Spree::Config[:...
ruby
chosen
[ { "from": "system", "value": "Add example of include_context impacting the recorded timing\n" }, { "from": "human", "value": "describe 'Example of slow shared examples' do\n # this should add 1.5s to the total timing of this test file recorded by knapsack_pro\n it_behaves_like 'slow shared exa...
ruby
chosen
[ { "from": "system", "value": "Fix locales for invite people emails\n" }, { "from": "human", "value": "class InvitePeopleMailer < BaseMailer\n layout 'invite_people_mailer'\n def after_membership_request_approval(invitation, sender_email, message_body)\n @invitation = invitation\n @group ...
ruby
chosen
[ { "from": "system", "value": "Include \"derived\" with sparse area data\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Api\n module V3\n class AreaPresenter\n # These attributes will be kept as part of the JSON representation of the\n # area when the use...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 0.1.0.0 to 0.2.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'messaging'\n s.version = '0.1.0.0'\n s.summary = 'Messaging primitives for Eventide'\n s.description = ' '\n...
ruby
chosen
[ { "from": "system", "value": "Change exit by abort to exit properly in require during tests\n" }, { "from": "human", "value": "$: << File.expand_path(File.join(File.dirname(__FILE__)))\nrequire 'rubygems'\n\nCSVGEM = RUBY_VERSION.match(/^[0-1]\\.[0-8]\\./) ? 'faster_csv' : 'csv'\n\nbegin\n\trequ...
ruby
chosen
[ { "from": "system", "value": "Test all popular libs for ruby related to GPG\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nmodule Scanny::Checks::SystemTools\n describe GpgUsageCheck do\n before do\n @runner = Scanny::Runner.new(GpgUsageCheck.new)\n @message = \"Usi...
ruby
chosen
[ { "from": "system", "value": "Prepare for new version on rubygems\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n#require File.expand_path('../lib/money', __FILE__)\n\nextra_rdoc_files = ['CHANGELOG.md', 'LICENSE', 'README.md']\n\nGem::Specification.new do |s|\n s.name ...
ruby
chosen
[ { "from": "system", "value": "Rework the way services are searched so except is no longer required.\n" }, { "from": "human", "value": "require 'thor'\n\nmodule Namesies\n class CLI < Thor\n\n option :only, type: :array, aliases: 'o'\n option :except, type: :array, aliases: 'e'\n desc \...
ruby
chosen
[ { "from": "system", "value": "Update to xcode 8 beta 6\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Auk\"\n s.version = \"5.0.0\"\n s.license = { :type => \"MIT\" }\n s.homepage = \"https://github.com/evgenyneu/Auk\"\n s.summary = \"An image sli...
ruby
chosen
[ { "from": "human", "value": "Add test file: must be removed later\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n# encoding: UTF-8\nrequire 'prawn'\nrequire 'base64'\nrequire 'open-uri'\n# Third party gem that will need installing\nrequire 'zip'\nrequire 'fileutils'\n\nipa_2_fonts = 'IPAe...
ruby
chosen
[ { "from": "system", "value": "Convert min_length option to integer\n" }, { "from": "human", "value": "require 'optparse'\nrequire_relative 'lib/streaming_client'\n\noptions = {}\nOptionParser.new do |opts|\n opts.banner = 'Usage: bundle exec ruby app.rb [options]'\n\n opts.separator ''\n opts...
ruby
chosen
[ { "from": "system", "value": "Add another mongo mapper extension test" }, { "from": "human", "value": "require 'test_helper'\n\nclass MongoMapperTest < Test::Unit::TestCase\n\n context \"The MongoMapper extension\" do\n setup do\n setup_fixtures\n @person = MongoMapperPerson.create...
ruby
chosen
[ { "from": "system", "value": "Add rake as dev dependency for travis-ci\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'simple_xlsx_reader/version'\n\nGem::Specification.new...
ruby
chosen
[ { "from": "system", "value": "Adjust middleman dependency to >= 3.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'font-awesome-middleman/version'\n\nGem::Specification....
ruby
chosen
[ { "from": "system", "value": "Refactor and shorten grouping time records code\n" }, { "from": "human", "value": "require 'delegate'\nrequire_relative 'time_duration'\n\nclass TimeRecords < SimpleDelegator\n def initialize(time_records)\n super\n end\n\n def grouped_by_task\n uniques = m...
ruby
chosen
[ { "from": "system", "value": "Set the context item direct instead of merging it\n" }, { "from": "human", "value": "module Dimples\n module Renderable\n def render(context = {}, body = nil)\n context[:site] ||= @site\n context.merge!(type => Hashie::Mash.new(@metadata))\n\n out...
ruby
chosen
[ { "from": "human", "value": "Add rough folder importer worker." }, { "from": "gpt", "value": "module FolderImport\n DATE_FORMAT = '%y%m%d'\n ALBUM_FOLDER_PATTERN = /^(?<date>\\d{6})(?<title>.+)$/\n ALLOWED_EXTS = ImageUploader::EXTENSION_WHITE_LIST.dup\n ALLOWED_EXTS.push(*ALLOWED_EXTS.map(&...
ruby
chosen
[ { "from": "system", "value": "Change to relax dev dependencies\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'benchmark/perf/version'\n\nGem::Specification.new do |spec|\n spec.name = \"be...
ruby
chosen
[ { "from": "system", "value": "Move the summary alias back alongside description\n" }, { "from": "human", "value": "module RSSCache\n class Feed\n # A single RSS or Atom item/entry.\n class Item\n # Returns either an RSS::Rss::Item or RSS::Atom::Entry depending\n # on the #type o...
ruby
chosen
[ { "from": "system", "value": "Print message and quit if auth_token isn't set in environment\n" }, { "from": "human", "value": "module Snapme\n module CLI\n class Command\n def self.start(args)\n options = Options.parse(args)\n Process.daemon(true) if options.daemon\n ...
ruby
chosen
[ { "from": "system", "value": "Set our custom output path.\n" }, { "from": "human", "value": "module UsesThis\n class Interview < Salt::Post\n end\nend" }, { "from": "gpt", "value": "module UsesThis\n class Interview < Salt::Post\n\n def output_path(parent_path)\n File.join...
ruby
chosen
[ { "from": "human", "value": "Add a test file for BMFF::Box::DegradationPriority.\n" }, { "from": "gpt", "value": "# coding: utf-8\n# vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:\n\nrequire_relative '../../minitest_helper'\nrequire 'bmff/box'\nrequire 'stringio'\n\nclass Te...
ruby
chosen
[ { "from": "system", "value": "Fix name of oEmbed format test name\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass OembedControllerTest < ActionController::TestCase\n \n tests ApiController\n\n def test_oembed_response\n get :oembed, :format => \"json\"\n assert_respons...
ruby
chosen
[ { "from": "system", "value": "Add password to admin panel.\n" }, { "from": "human", "value": "ActiveAdmin.register User do\n# See permitted parameters documentation:\n# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters\n#\n# perm...
ruby
chosen
[ { "from": "system", "value": "Update description, because it's true!" }, { "from": "human", "value": "require File.expand_path(\"../lib/luna/rspec/formatters/version.rb\", __FILE__)\n\nGem::Specification.new do |spec|\n spec.homepage = \"https://github.com/envygeeks/luna-rspec-formatters\"\n s...
ruby
chosen
[ { "from": "system", "value": "Use slugs for URL links\n\nThis feature makes the app feel a bit more polished.\n\nChange-Id: I913ee6523e31b22d9ceb1f83c9cea19a22873104\n" }, { "from": "human", "value": "class Url < ActiveRecord::Base\n validates_presence_of :viewport_width,\n ...
ruby
chosen
[ { "from": "system", "value": "Modify phone numbers in seed data\n" }, { "from": "human", "value": "# Messages\nm1 = Message.create(body: 'help fire', phone_number: '+15558675309')\nm2 = Message.create(body: 'omg i need a doc', phone_number: '+18005551234')\nm3 = Message.create(body: 'send help',...
ruby
chosen
[ { "from": "system", "value": "Create some test users in dev and test environments.\n\nThey're called test1, test2, test3 and have passwords password1 etc.\nRun `rake db:seed` or `rake db:setup` to get them.\n" }, { "from": "human", "value": "# This file should contain all the record creation nee...
ruby
chosen
[ { "from": "system", "value": "Create 10 questions with 3 answers each\n" }, { "from": "human", "value": "\n10.times do\n User.create(name: TubularFaker.name, password: '123')\nend\n\nQuestion.create(title: TubularFaker.company, content: TubularFaker.lingo, user: User.find(User.pluck(:id).sample...
ruby
chosen
[ { "from": "system", "value": "Add subfamily level for SocialTraits\n" }, { "from": "human", "value": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can then be loaded with the rake db:seed (or created alongside the db with db:...
ruby
chosen
[ { "from": "system", "value": "Set the author of the gem to Chef Software\n\nThis mirrors many of our other projects.\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "$:.unshift(File.dirname(__FILE__) + \"/lib\")\nrequire \"cheffish...
ruby
chosen
[ { "from": "system", "value": "Add flash messaging to accounts controller" }, { "from": "human", "value": "class AccountsController < ApplicationController\n before_action :ensure_logged_in\n\n def show\n\n end\n\n def update\n if current_user.update_attributes(user_params)\n redirect...
ruby
chosen
[ { "from": "system", "value": "Change redirect path on Picture Destroy\n" }, { "from": "human", "value": "class PicturesController < ApplicationController\n before_action :set_picture, only: [:destroy]\n\n def new\n @picture = Picture.new\n end\n\n def create\n @picture = Picture.new(pi...
ruby
chosen
[ { "from": "system", "value": "Support a JSON representation of a student\n" }, { "from": "human", "value": "# Handles requests relating to students\nclass StudentsController < ApplicationController\n before_action :set_student, only: [:show]\n\n def index\n # TODO: would be nice to group th...
ruby
chosen
[ { "from": "system", "value": "Add test for Main class to see if the class is accessable\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nRSpec.describe StrSanitizer do\n it \"has a version number\" do\n expect(StrSanitizer::VERSION).not_to be nil\n end\n\n it \"has a method na...
ruby
chosen
[ { "from": "system", "value": "Use new fails_with DSL syntax\n\nSigned-off-by: Jack Nagel <43386ce32af96f5c56f2a88e458cb94cebee3751@gmail.com>\n" }, { "from": "human", "value": "require 'formula'\n\nclass BaliPhy < Formula\n homepage 'http://www.biomath.ucla.edu/msuchard/bali-phy/'\n url 'http:...
ruby
chosen
[ { "from": "human", "value": "Add a publishing-api-sync-check for Working Groups\n" }, { "from": "gpt", "value": "# Working Groups are called PolicyGroup in the code as they have been partially\n# renamed\ntake_part_pages = PolicyGroup.all\ncheck = DataHygiene::PublishingApiSyncCheck.new(take_par...
ruby
chosen
[ { "from": "system", "value": "Align thumbnail_url in PositionedFile with ImageFile\n" }, { "from": "human", "value": "module Pageflow\n class PositionedFile\n attr_reader :file, :position_x, :position_y\n\n delegate :thumbnail_url, to: :file\n\n def initialize(file, position_x = nil, p...
ruby
chosen
[ { "from": "system", "value": "Allow bundler version < 3.0.\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire_relative 'lib/awsecrets/version'\n\nGem::Specification.new do |spec|\n spec.name = ...
ruby
chosen
[ { "from": "system", "value": "Use -std=c++98 for old compilers\n" }, { "from": "human", "value": "# frozen-string-literal: true\nrequire 'mkmf'\n\n$CFLAGS << ' -Wall -W'\n$CXXFLAGS << ' -Wall -W -std=c++03'\nhoudini_dir = File.expand_path('../../vendor/houdini', __dir__)\n$INCFLAGS << \" -I#{hou...
ruby
chosen
[ { "from": "system", "value": "Update Axiom::Types::Encodable to make it easier for YARD to parse\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Axiom\n module Types\n\n # Add encoding constraints to a type\n module Encodable\n if RUBY_VERSION >= '1.9'\n\n # Hoo...
ruby
chosen
[ { "from": "system", "value": "Add alias attach_internet_gateway of internet_gateway=\n" }, { "from": "human", "value": "module Akashi\n class Vpc\n class Instance < Akashi::Vpc::Base\n def_delegators :@object, :cidr_block, :instance_tenancy, :state\n\n def internet_gateway=(interne...
ruby
chosen
[ { "from": "system", "value": "Make sure we have a <String>, not a <ModelName>\n" }, { "from": "human", "value": "module Mongoid\n\n module Autoinc\n\n class Incrementor\n attr_accessor :model_name, :field_name, :scope_key, :collection, :seed, :step\n\n def initialize(model_name, fi...
ruby
chosen
[ { "from": "system", "value": "Raise error if response is not 200\n" }, { "from": "human", "value": "module Bipbip\n\n class Plugin::Nginx < Plugin\n\n def metric_identifier(server)\n Bipbip.fqdn + '::localhost'\n end\n\n def metrics_schema\n [\n {:name => 'connection...
ruby
chosen
[ { "from": "system", "value": "Remove the 's' from the end of DefinedWords and fix the fakers that were not working.\n" }, { "from": "human", "value": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can then be loaded with the r...
ruby
chosen
[ { "from": "system", "value": "Create account for me to add admin powers to later\n" }, { "from": "human", "value": "require 'faker'\n\n10.times do\n User.create(username: Faker::Internet.user_name, password: \"password\", first_name: Faker::Name.first_name, last_name: Faker::Name.last_name, bio:...
ruby
chosen
[ { "from": "system", "value": "Introduce constants and reference to src\n" }, { "from": "human", "value": "require 'monit'\n\nmodule Bipbip\n\n class Plugin::Monit < Plugin\n\n def metrics_schema\n [\n {:name => 'Running', :type => 'gauge', :unit => 'Boolean'},\n {:name...
ruby
chosen
[ { "from": "system", "value": "Add development dependency on Rake.\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)\nrequire 'paper_trail/version_number'\n\nGem::Specification.new do |s|\n s.name = 'paper_trail'\n s.version = PaperTrail::...
ruby
chosen
[ { "from": "system", "value": "Fix bug with closed TCP connection\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'link_thumbnailer/response'\nrequire 'link_thumbnailer/processor'\nrequire 'link_thumbnailer/scraper'\n\nmodule LinkThumbnailer\n class Page\n\n attr_r...
ruby
chosen
[ { "from": "system", "value": "Store predicate proc in a variable\n" }, { "from": "human", "value": "require 'microspec/predicates'\n\nmodule Microspec\n module Expectation\n def self.type(boolean)\n boolean ? 'assert' : 'refute'\n end\n\n def self.evaluate(boolean, actual, method,...
ruby
chosen
[ { "from": "system", "value": "Fix encoding-issues in Rails 3.1\n" }, { "from": "human", "value": "module PremailerRails\n class Hook\n def self.delivering_email(message)\n if html_part = message.html_part or (\n message.content_type =~ /text\\/html/ and\n html_part = messa...
ruby
chosen
[ { "from": "human", "value": "Add skeleton of a Rack Handler\n" }, { "from": "gpt", "value": "module Rack\n module Handler\n\n class RackJax\n def self.run(app, option={})\n port = options.delete(:Port) || 7070\n end\n\n def self.valid_options\n environment = ENV...
ruby
chosen
[ { "from": "system", "value": "Change server url to environmental variable\n" }, { "from": "human", "value": "module FluffyPaws\n module Mailers\n class TokenMailer\n include SendGrid\n\n def send(params)\n from = Email.new(email: 'app65106927@heroku.com')\n subject = ...
ruby
chosen
[ { "from": "human", "value": "Create a rake task to copy the production database and restore locally." }, { "from": "gpt", "value": "namespace :db do\n namespace :copy do\n namespace :production do\n desc 'Copy production database'\n task to_local: ['db:drop'] do\n MongodbClo...
ruby
chosen
[ { "from": "system", "value": "Update year for user report csv\n" }, { "from": "human", "value": "namespace :users_reports do\n\n desc \"CSV of users for sending them a survey\"\n task export_csv: :environment do\n output_directory = Rails.root.join('tmp').to_s\n\n CSV.open(Rails.root.joi...
ruby
chosen
[ { "from": "system", "value": "Adjust in GeocodedByAddress module to run more fast in test\n" }, { "from": "human", "value": "module GeocodedByAddress\n\n\n unless Rails.env.test?\n def geocoder_by_address\n nil\n end\n else\n def geocoder_by_address\n geocoded_by :address do...
ruby
chosen
[ { "from": "system", "value": "Update gem version after adding direction feature\n" }, { "from": "human", "value": "\nGem::Specification.new do |s|\n s.name = 'chip-gpio'\n s.version = '0.0.1'\n s.date = '2016-09-10'\n s.homepage = 'http://github.com/willia4/chip-gpio'\n ...
ruby
chosen
[ { "from": "system", "value": "Add scheduled time to bot response\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'open-uri'\n\nmodule Cinch\n module Plugins\n class Popsinseoul\n include Cinch::Plugin\n\n match /(popsinseoul)$/\n match /(help popsinseoul)$/, met...
ruby
chosen
[ { "from": "system", "value": "Check for conflicting link definition.\n" }, { "from": "human", "value": "require 'spinoza/system/model'\nrequire 'spinoza/system/store'\nrequire 'spinoza/system/table'\nrequire 'spinoza/system/lock-manager'\n\n# A top level entity in the system model, representing ...
ruby
chosen
[ { "from": "system", "value": "Add router for sponsor and sponsor level\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRails.application.routes.draw do\n # Devise\n devise_for :admin_users, path: :admin\n\n scope '(:locale)', locale: /#{Settings.locales.join('|')}/ do\n ...
ruby
chosen
[ { "from": "system", "value": "Add devise route for registrations\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRails.application.routes.draw do\n mount GraphqlPlayground::Rails::Engine, at: \"/graphql/playground\", graphql_path: \"/graphql\"\n\n root 'application#index'\n...
ruby
chosen
[ { "from": "system", "value": "Change routing from /contracts to /mou\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n # Render legal documents by using Keiyaku CSS\n # https://github.com/cognitom/keiyaku-css\n resources :contracts, only: [:index, :show]\n\n # Redirects\n...
ruby
chosen
[ { "from": "system", "value": "Change active route to a requests controller action\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n root to: 'welcome#index'\n\n get '/login', :to => 'sessions#new', :as => :login\n get '/logout', :to => 'sessions#destroy', :as => :logou...
ruby
chosen
[ { "from": "system", "value": "ENHANCE: Update logger module to use new DoubtfireLogger\n" }, { "from": "human", "value": "#\n# A universal logger\n#\nmodule LogHelper\n def logger\n # Grape::API.logger\n Rails.logger\n end\n\n # Export functions as module functions\n module_function :l...
ruby
chosen
[ { "from": "system", "value": "Add missing tags to seed data\n" }, { "from": "human", "value": "# coding: utf-8\n\ntitles = [\"title 1\", \"second\", \"3rd title\"]\n\ntitles.each do |title|\n Article.create(\n title: title,\n body: \"Hi, this is a test!\",\n posted_by: \"naoki\",\n ...
ruby
chosen
[ { "from": "system", "value": "Test that Object responds to respond_to_missing? instead of Test::Unit::TestCase\n" }, { "from": "human", "value": "require File.expand_path('../test_helper', __FILE__)\n\nclass RespondToMissingTest < Test::Unit::TestCase\n module Mock\n def self.respond_to_miss...
ruby
chosen
[ { "from": "system", "value": "Improve string memory management when receiving data.\n" }, { "from": "human", "value": "module EventMachine\n module IMAP\n # Intercepts the receive_data event and generates receive_response events\n # with parsed data.\n module ResponseParser\n def ...
ruby
chosen
[ { "from": "system", "value": "Add missing require for action cable\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\n# Pick the frameworks you want:\nrequire \"active_record/railtie\"\nrequire \"action_controller/railtie\"\nrequire \"action_mailer/railtie\"\nreq...
ruby
chosen
[ { "from": "system", "value": "Update deprecated calls for Ruby 3.0\n" }, { "from": "human", "value": "require 'game_icons'\nrequire 'open-uri'\nrequire 'zip'\nrequire 'fileutils'\n\nmodule GameIcons\n class Update\n @@URL = 'http://game-icons.net/archives/svg/zip/ffffff/000000/game-icons...
ruby
chosen
[ { "from": "human", "value": "Create a failing test for Vote model\n\nVotes go against the pattern and don't use the 'id' field as the\nprimary key by default. Votes require a composite primary key, but\nwithout the 'composite_primary_key' gem and the attributes specified\nin the Vote model, testing produced...
ruby
chosen
[ { "from": "system", "value": "[api] Return relative attachment url for product images\n" }, { "from": "human", "value": "object @image\nattributes *image_attributes\nattributes :viewable_type, :viewable_id\n" }, { "from": "gpt", "value": "object @image\nattributes *image_attributes\n...
ruby
chosen
[ { "from": "system", "value": "Revert \"Give Process Log access to the url_helpers so it can create direct links. Known and intended violation of MVC\"\nThe url_helpers need to live in the caller, not the process log.\n\nThis reverts commit 963aa4d10e52f3606495c1a1044d9864971121a0.\n" }, { "from": "...
ruby
chosen
[ { "from": "human", "value": "Add a package for the Toolbar API Plugin.\n" }, { "from": "gpt", "value": "class Toolbar < Kosmos::Package\n title 'Toolbar Plugin'\n aliases 'toolbar'\n url 'http://blizzy.de/toolbar/Toolbar-1.7.1.zip'\n\n def install\n merge_directory 'Toolbar-1.7.1/GameData...
ruby
chosen
[ { "from": "system", "value": "Use a not deprecated github repo for premailer-rails" }, { "from": "human", "value": "# encoding: UTF-8\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'spree_html_email'\n s.version = '1.0.1'\n s.summary = 'HTML em...
ruby
chosen
[ { "from": "system", "value": "Remove overwritten definition of index\n\nAlso clean up indentation" }, { "from": "human", "value": "class SubstitutionsController < ApplicationController\n load_and_authorize_resource\n include CrudActions\n\n def index\n \t@substitutions = Substitution.active\...
ruby
chosen
[ { "from": "system", "value": "Remove fake Sequel model association\n\nThe visualization is retrieved through a class method defined below,\nand trying to use the association in the sequel model can yield\nerrors:\n\n/var/lib/gems/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/inflector/methods.rb:263:...
ruby
chosen
[ { "from": "system", "value": "Remove source of factory duplication\n\nFactory_girl_rails was loading factories, and further down in this file\nso was refinery.\n" }, { "from": "human", "value": "require 'refinerycms-core'\nrequire 'rspec-rails'\nrequire 'factory_girl_rails'\n\nmodule Refinery\n ...
ruby
chosen
[ { "from": "human", "value": "Add rails patch for ActiveRecord::Fixture::FixtureError: table has no column named error.\n" }, { "from": "gpt", "value": "module RailsPatch22584\n def insert_fixture(fixture, table_name)\n # A regression with rails 4.2.5 breaks fixtures with symbol keys, specifi...
ruby
chosen
[ { "from": "system", "value": "Add Route for Topic show\n\nUpdate the routes file to include a route for the Topic show action.\n" }, { "from": "human", "value": "Ifsimply::Application.routes.draw do\n devise_for :users, :controllers => { :registrations => 'registrations' }\n\n root :to => 'hom...
ruby
chosen
[ { "from": "system", "value": "Simplify out the routing a little\n" }, { "from": "human", "value": "Ilp2::Application.routes.draw do\n\n resources :views\n resources :settings\n resources :timetables\n resources :events do\n collection do\n get :more\n end\n member do\n get...
ruby
chosen
[ { "from": "human", "value": "Add special forms for Clojure 1.3.0.\n" }, { "from": "gpt", "value": "class AddSpecialForms130 < ActiveRecord::Migration\n\n def self.add_special_form(lib, ns, name, doc)\n\n return if not lib or not ns\n \n f = Function.new\n f.name = name\n f.doc = ...
ruby
chosen
[ { "from": "human", "value": "Add tests for new functionality\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass UserChangePasswordTest < ActionDispatch::IntegrationTest\n def setup\n @admin = users(:david)\n @service_user = users(:service_user)\n log_in_as(@admin)\n end\n...
ruby
chosen
[ { "from": "human", "value": "Add the Comic Neue font\n\nPublic domain, available at http://comicneue.com/\n" }, { "from": "gpt", "value": "class FontComicNeue < Cask\n url 'http://comicneue.com/comic-neue-1.1.zip'\n homepage 'http://comicneue.com/'\n version '1.1'\n sha256 'e4c2bd402348d73d8...
ruby
chosen
[ { "from": "system", "value": "Fix for blank email address in try_email\n" }, { "from": "human", "value": "=begin rdoc\n=Description\nScaffolding for EmailConfiguration Model\n=end\nclass EmailConfigurationsController < ApplicationController\n before_filter :super_authenticate\n before_filter :...
ruby
chosen
[ { "from": "system", "value": "Use more than 2 workers.\n" }, { "from": "human", "value": "working_directory \"/var/www/deployments/gluedb/current\"\npid \"/var/www/deployments/gluedb/shared/pids/unicorn.pid\"\nstderr_path \"/var/www/deployments/gluedb/shared/log/unicorn.log\"\nstdout_path \"/var...
ruby
chosen
[ { "from": "human", "value": "Add Rover class with initialize and get photos methods\n" }, { "from": "gpt", "value": "module MarsPhotos\n\tclass Rover\n\t\tattr_accessor :name\n\n\t\tdef initialize(name)\n\t\t\tself.name = name\n\t\tend\n\n\t\tdef get(sol)\n\t\t\tHTTParty.get(\"https://api.nasa.g...
ruby
chosen
[ { "from": "system", "value": "Use correct attribute to look up site thumbnail\n" }, { "from": "human", "value": "module DiscoveryMethod\n class Standard\n# SELECTOR_REGEX = /^http(s)?:\\/\\//\n SELECTOR_REGEX = //\n\n def initialize(doc)\n @doc = doc\n end\n\n def discover_n...
ruby
chosen
[ { "from": "system", "value": "Include Industry from MecsRatio to allow iso tests\n" }, { "from": "human", "value": "require 'earth/locality'\n\nclass MecsRatio < ActiveRecord::Base\n set_primary_key :name\n\n col :name\n col :census_region\n col :naics_code\n col :consumption_per_dollar_of_...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary inclusion of CaseValues\n" }, { "from": "human", "value": "module Generator\n # Contains methods accessible to the ERB template\n class TemplateValues\n attr_reader :abbreviated_commit_hash, :version, :test_cases\n\n def initialize(abbrevi...
ruby
chosen