conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Make route for 'get stats'\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n resources :scrapers\n root to: \"listings#home\"\n resources :listings, :phrases\n get '/discriminatory', to: 'listings#discriminatory'\n get '/visualization', to: ...
ruby
chosen
[ { "from": "system", "value": "Handle documents without SVG root elements\n" }, { "from": "human", "value": "module InlineSvg::TransformPipeline::Transformations\n class AriaAttributes < Transformation\n def transform(doc)\n doc = Nokogiri::XML::Document.parse(doc.to_html)\n svg = d...
ruby
chosen
[ { "from": "system", "value": "Change pod spec files to swift\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name \t= \"MOAspects\"\n s.version \t= \"0.2.2\"\n s.summary \t= \"AOP Library.\"\n s.homepage \t= \"https://github.com/MO-AI/MOAspects\"\n s.licens...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.1 to 0.1.2\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'attribute'\n s.version = '0.1.1'\n s.summary = 'Define an attribute on a class using an imperative API'\n s.d...
ruby
chosen
[ { "from": "system", "value": "Fix memory leak by removing the old handler when switching puzzles.\n" }, { "from": "human", "value": "require 'vienna'\n\nmodule Monorail\n class Application < Vienna::Model\n include Vienna::Observable\n\n attributes :router, :puzzle, :autohint\n\n def i...
ruby
chosen
[ { "from": "human", "value": "Add solution for challenge 4.3 release 4 formatting address\n" }, { "from": "gpt", "value": "# Format an Address\n\n# I worked on this challenge [by myself, with: ].\n\n\n# Your Solution Below\ndef make_address(street, city, state, zip)\n \nreturn 'You live at ' + st...
ruby
chosen
[ { "from": "system", "value": "Stop search from timing out\n" }, { "from": "human", "value": "class GamesController < ApplicationController\n before_action :set_game, only: [:show]\n before_action :set_query, only: [:index]\n before_action :set_games, only: [:index]\n\n def index\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Stop crash if user not found; remove `@` symbols\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n # index:\n # /users\n #\n # search:\n # /users?perspective=0xff902fc776998336a213c5c6050a4572b7453643&skill=UX&depth=4\n def ind...
ruby
chosen
[ { "from": "system", "value": "Handle nil dates in search results\n" }, { "from": "human", "value": "class ProjectSearchResult\n include Status\n\n attr_reader :language\n attr_reader :platform\n attr_reader :name\n attr_reader :description\n attr_reader :status\n attr_reader :latest_relea...
ruby
chosen
[ { "from": "system", "value": "Update paperclip paths for store model\n\nWhat I changed is inline with what is on solidus core for regular images: https://github.com/solidusio/solidus/blob/e15ca73e8f7083633343f0678023695a96e24d31/core/app/models/spree/image.rb#L9\r\n\r\nMoreover, how it was would not correct...
ruby
chosen
[ { "from": "system", "value": "Fix failing article model test\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass ArticleTest < ActiveSupport::TestCase\n test 'it creates' do\n assert_difference('Article.count', 1) do\n Article.create(title: 'title', content: 'content', use...
ruby
chosen
[ { "from": "system", "value": "Hide papers that have not made it to review yet\n" }, { "from": "human", "value": "atom_feed do |feed|\n feed.title(setting(:name))\n feed.updated(@papers[0].created_at) if @papers.length > 0\n\n @papers.each do |paper|\n feed.entry(paper) do |entry|\n en...
ruby
chosen
[ { "from": "system", "value": "Disable retry option for sidekiq's job. Re-enable before and after create actions.\n" }, { "from": "human", "value": "class StatusUpdateWorker\n include Sidekiq::Worker\n\n def perform(application_id)\n # app = Application.find(application_id)\n # app.update...
ruby
chosen
[ { "from": "human", "value": "Change type for url on feed_entries from string to text\n" }, { "from": "gpt", "value": "class ChangeTypeForUrlOnFeedEntries < ActiveRecord::Migration\n def up\n change_column :feed_entries, :url, :text\n end\n def down\n change_column :feed_entries, :url, :...
ruby
chosen
[ { "from": "system", "value": "Set has_rdoc=\"yard\" and remove extra_rdoc_files\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = \"filesize\"\n s.version = \"0.1.0\"\n\n s.authors = [\"Dominik Honnef\"]\n s.description = \"filesize is a s...
ruby
chosen
[ { "from": "system", "value": "Revert \"Just testing on live, nothing to see here\"\n\nThis reverts commit 1478750dd2b4a20337db7e30b46f7c27da1805e1.\n" }, { "from": "human", "value": "module FluffyPaws\n class App < Sinatra::Base\n enable :sessions\n\n configure do\n set :session_secr...
ruby
chosen
[ { "from": "system", "value": "Make blobstore_id and sha1 as strings\n\n[#118957819]\nhttps://www.pivotaltracker.com/story/show/118957819\n\nSigned-off-by: Ivan Rodriguez <489d99cb1180510ba868a41f5ab2ce6b721fdf5f@pivotal.io>\n" }, { "from": "human", "value": "Sequel.migration do\n change do\n ...
ruby
chosen
[ { "from": "human", "value": "Add the implied nil problem\n" }, { "from": "gpt", "value": "# Implied nil\n# Let's implement a simple search feature - for our naive implementation, we search for a game by its exact title, and if it's found, we show it.\n# Comparing something with nil in an if stat...
ruby
chosen
[ { "from": "system", "value": "Use git tag at podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Timepiece\"\n s.version = \"0.3.4\"\n s.summary = \"Intuitive NSDate extensions in Swift\"\n s.homepage = \"https://github.com/naoty/Timepiece\"\n ...
ruby
chosen
[ { "from": "system", "value": "Use -no-cache option to docker build\n" }, { "from": "human", "value": "require \"fileutils\"\nrequire \"tmpdir\"\nrequire \"groonga_packages_regression_test/subcommand/base\"\n\nmodule GroongaPackagesRegressionTest\n module Subcommand\n class Install\n inc...
ruby
chosen
[ { "from": "system", "value": "Fix to the upgradeable? method to be all around better\n" }, { "from": "human", "value": "module MetasploitDataModels::ActiveRecordModels::Session\n def self.included(base)\n base.class_eval {\n belongs_to :host, :class_name => \"Mdm::Host\"\n\n has_on...
ruby
chosen
[ { "from": "system", "value": "Set the quiz owner to the user's Google+ profile ID\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Quizzes\" do\n %w(/ /quizzes).each do |path|\n it 'should redirect you to login' do\n visit path\n page.current_url.should == 'ht...
ruby
chosen
[ { "from": "system", "value": "Fix to set DSL file path as __FILE__\n" }, { "from": "human", "value": "require 'inline_template_loader'\n\nmodule MrMongo\n class Loader\n def initialize(context)\n @context = context\n end\n\n def load(file)\n dsl_script = ::File.read(file).sub...
ruby
chosen
[ { "from": "system", "value": "Add comma to even the last line of Hash/Array\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe 'project_assignments/index', type: :view do\n let(:user) { FactoryGirl.create(:user) }\n let(:project) { FactoryGirl.create(:project, owner: u...
ruby
chosen
[ { "from": "system", "value": "Work on documentation for the PayDirt::Result class\n" }, { "from": "human", "value": "module PayDirt\n class Result\n # The response from a use case execution\n #\n # Every use case should return a Result after it runs.\n #\n # @param [options] opti...
ruby
chosen
[ { "from": "system", "value": "Fix example description for self referential 1:N specs \n" }, { "from": "human", "value": "require 'spec_helper_integration'\n\ndescribe 'Relationship - Self referential Many To One' do\n include_context 'Models and Mappers'\n\n before(:all) do\n setup_db\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix message for first git commit" }, { "from": "human", "value": "require \"happy-cli/version\"\nrequire 'thor'\n\nmodule HappyCLI\n class Command < Thor\n include Thor::Actions\n\n source_root(File.expand_path('../happy-cli/templates', __FILE__))\n\n desc...
ruby
chosen
[ { "from": "system", "value": "Disable digests to help LiveReload find the file to reload!" }, { "from": "human", "value": "require \"monitor\"\nrequire \"weak_observable\"\nrequire \"filewatcher\"\n\nmodule Livereload\n class Middleware\n def initialize(app, assets: )\n @app = app\n ...
ruby
chosen
[ { "from": "system", "value": "Simplify iteration over candidate gateway IP addresses\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'set'\n\nmodule VagrantPlugins\n module AnsibleAuto\n module Cap\n module Guest\n module POSIX\n class GatewayAd...
ruby
chosen
[ { "from": "system", "value": "Add homepage url to 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 'php_session/rails/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Use \"rails\" as default progname\n" }, { "from": "human", "value": "class Swoop::Formatter\n\n def call(severity, datetime, progname, msg)\n if Swoop.colorize?\n \"#{ severity[0].bold.send(severity_color(severity)) } #{ datetime.iso8601.bold.black } #{ (pr...
ruby
chosen
[ { "from": "human", "value": "Add simple task task for tagging\n" }, { "from": "gpt", "value": "desc \"Create git tag with version\"\ntask release: :environment do\n sh \"git tag -m \\\"Version #{version}\\\" #{version_tag}\"\nend\n\ndef version\n DockerRails::Application::VERSION\nend\n\ndef v...
ruby
chosen
[ { "from": "system", "value": "Add accessors and rules to web game engine\n" }, { "from": "human", "value": "$: << File.dirname(__FILE__)\n\nclass WebGameEngine\n\n attr_reader :ttt_board\n attr_accessor :comp_player\n\n def initialize(args)\n @ttt_board = args.fetch(:ttt_board, nil)\n @...
ruby
chosen
[ { "from": "system", "value": "Remove mention of body tag\n" }, { "from": "human", "value": "IEConditionalTag.configure do |config|\n\n # The standard `config.on` line looks like:\n #\n # on IE_CONDITIONAL_COMMENT_EXPRESSION, HTML_OPTIONS\n #\n # The `:class` option is special; unlike othe...
ruby
chosen
[ { "from": "system", "value": "Switch to double quotes for Rails linter\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'activefile'\n s.version = '0.1'\n s.authors = 'David Heinemeier Hansson'\n s.email = 'david@basecamp.com'\n s.summary = 'Store files ...
ruby
chosen
[ { "from": "human", "value": "Add Ansible Tower ConfiguredSystem subclass\n" }, { "from": "gpt", "value": "class ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfiguredSystem < ::ConfiguredSystem\n include ProviderObjectMixin\n\n def provider_object(connection = nil)\n (connectio...
ruby
chosen
[ { "from": "system", "value": "Tweak regex following dominikh's advice\n" }, { "from": "human", "value": "require 'cinch'\nrequire 'open-uri'\nrequire 'nokogiri'\nrequire 'cgi'\n\nclass Google\n include Cinch::Plugin\n plugin \"google\"\n help \"!g(oogle) [number] <query> - search Google\"\n ...
ruby
chosen
[ { "from": "system", "value": "Switch pagination links to absolute URLs.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule UsesThis\n module Api\n # A class that models a static API endpoint.\n class Endpoint\n def self.publish(output_path, items, type, pagina...
ruby
chosen
[ { "from": "system", "value": "Fix editor -> builder migrations\n\nGmaps visualizations migrated from v2 to v3 were breaking JS\n" }, { "from": "human", "value": "module Carto\n module VisualizationMigrator\n # Runs all needed actions for visualizations that have just changed to v3.\n # Mu...
ruby
chosen
[ { "from": "system", "value": "Fix infrastructure voltage type db migration.\n" }, { "from": "human", "value": "class CreateInfrastructureVoltageTypes < ActiveRecord::Migration[5.2]\n def change\n create_table :infrastructure_voltage_types do |t|\n t.name :string\n t.boolean :active...
ruby
chosen
[ { "from": "system", "value": "Remove duplicate definition of replace_all field on MemberList\n\nSupport::Sublist already defines the replace_all field.\n" }, { "from": "human", "value": "module NetSuite\n module Records\n class MemberList < Support::Sublist\n include Namespaces::ListAcc...
ruby
chosen
[ { "from": "system", "value": "Tweak the slot date format\n" }, { "from": "human", "value": "Time::DATE_FORMATS[:appointment_date] = lambda { |time| time.strftime(\"%A, %B #{time.day.ordinalize}\") }\nTime::DATE_FORMATS[:appointment_date_short] = \"%d %b %y\" #th Nov 09\nTime::DATE_FORMATS[:appoi...
ruby
chosen
[ { "from": "system", "value": "Use RFC 2606 reserved invalid DNS name in tests.\n\nThis test used a DNS name which, while currently not existing, is not\nactually reserved. This can manifest as a test failure on poorly\nconfigured (like Time Warner Cable) networks. This changes said DNS\nname to one using a ...
ruby
chosen
[ { "from": "system", "value": "Use the faster total_count method here too\n" }, { "from": "human", "value": "require 'eventmachine'\nrequire 'sinatra'\nrequire \"sinatra/namespace\"\n\nmodule Toshi\n class Web < ::Sinatra::Base\n register Sinatra::Namespace\n class NotFoundError < Standard...
ruby
chosen
[ { "from": "system", "value": "GithubLatest: Align test URL with example\n" }, { "from": "human", "value": "# typed: false\n# frozen_string_literal: true\n\nrequire \"livecheck/strategy/github_latest\"\n\ndescribe Homebrew::Livecheck::Strategy::GithubLatest do\n subject(:github_latest) { describ...
ruby
chosen
[ { "from": "system", "value": "Reset `repo_var` so it actually is re-computed.\n" }, { "from": "human", "value": "class Tap\n module Compat\n def initialize(user, repo)\n super\n\n return unless user == \"caskroom\"\n\n old_initial_revision_var = \"HOMEBREW_UPDATE_BEFORE#{repo_...
ruby
chosen
[ { "from": "system", "value": "Remove Chef 11 compatibility code\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.\n# License:: Apache License, Version 2.0\n#\n# Licensed u...
ruby
chosen
[ { "from": "system", "value": "Add missing rake task which should run before migration.\n" }, { "from": "human", "value": "class AddConstraintsToMostRecentForFormAnswerTransitions < ActiveRecord::Migration\n disable_ddl_transaction!\n\n def up\n add_index :form_answer_transitions, [:form_ans...
ruby
chosen
[ { "from": "system", "value": "Upgrade Intel HAXM to 1.1.4\n\nPrevious download URL returns a 404 error (not found)\n\nUses the provided install and uninstall script (silent_install.sh)\n" }, { "from": "human", "value": "cask :v1 => 'intel-haxm' do\n version '1.1.1'\n sha256 'dd6dabfc34ebf73a19...
ruby
chosen
[ { "from": "system", "value": "Add encoding declaration to the gemspec file" }, { "from": "human", "value": "require File.expand_path(\"../lib/lingohub/version\", __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'lingohub'\n gem.version = Lingohub::VERSION\n gem.authors...
ruby
chosen
[ { "from": "system", "value": "Update bundler version from 1.7 to 1.8\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'everyday/version'\n\nGem::Specification.new do |spec|\n spec.nam...
ruby
chosen
[ { "from": "system", "value": "Add Rake as a development dependency.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/analysand/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"David Yip\"]\n gem.email = [\"yip...
ruby
chosen
[ { "from": "system", "value": "Update Users model attribute comment\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: users\n#\n# id :integer not null, primary key\n# first_name :string\n# last_name :string\n# ssn :string\n# dob ...
ruby
chosen
[ { "from": "system", "value": "Change models to reflect the changes in the db\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n\tattr_accessor :password\n\tvalidates_confirmation_of :password\n\tbefore_save :encrypt_password\n\tbelongs_to :region\n\thas_many :sales\n\thas_many ...
ruby
chosen
[ { "from": "human", "value": "Add a separate decorator for Network Providers\n" }, { "from": "gpt", "value": "class ManageIQ::Providers::NetworkManagerDecorator < MiqDecorator\n def self.fonticon\n 'pficon pficon-server'\n end\n\n def fonticon\n nil\n end\n\n def fileicon\n \"svg/ve...
ruby
chosen
[ { "from": "system", "value": "Exit on any of the exit statuses\n" }, { "from": "human", "value": "require 'extensions/kernel' if defined?(require_relative).nil?\nrequire_relative '../../App'\n\nmodule WebBlocks\n module BuildServer\n class App\n \n module Support\n \n c...
ruby
chosen
[ { "from": "system", "value": "Change route to share application\n" }, { "from": "human", "value": "#module CatarseStripe\n #class Engine < ::Rails::Engine\n #isolate_namespace CatarseStripe\n #end\n#end\nmodule ActionDispatch::Routing\n class Mapper\n def mount_catarse_stripe_at(catarse...
ruby
chosen
[ { "from": "system", "value": "Change route to share application\n" }, { "from": "human", "value": "#module CatarseStripe\n #class Engine < ::Rails::Engine\n #isolate_namespace CatarseStripe\n #end\n#end\nmodule ActionDispatch::Routing\n class Mapper\n def mount_catarse_stripe_at(catarse...
ruby
chosen
[ { "from": "system", "value": "Exclude patch version from version constraints\n" }, { "from": "human", "value": "require_relative 'lib/prawn/emoji/version'\n\nGem::Specification.new do |spec|\n spec.name = 'prawn-emoji'\n spec.version = Prawn::Emoji::VERSION\n spec.author ...
ruby
chosen
[ { "from": "system", "value": "Add runtime dependency on activmodel (>= 3.1)\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'unchanged_validator/version'\n\nGem::Specification.new do ...
ruby
chosen
[ { "from": "system", "value": "Update email in Gem spec." }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'git_diff/version'\n\nGem::Specification.new do |spec|\n spec.name = \"...
ruby
chosen
[ { "from": "system", "value": "Tweak the archive configs, add the page_prefix\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Dimples\n module Configuration\n def self.defaults\n {\n source_path: Dir.pwd,\n destination_path: File.join(Dir.pwd, 'si...
ruby
chosen
[ { "from": "system", "value": "Allow hierarchical or flat NTEE dimensions (because Thoth client receives flattened values)\n" }, { "from": "human", "value": "require 'search_dimensions'\n\nmodule NTEE\n class SearchDimension < SearchDimensions::HierarchicalDimension\n def value_class\n N...
ruby
chosen
[ { "from": "system", "value": "Use import job class name instead of to_json\n" }, { "from": "human", "value": "module CartoDB\n module Resque\n module Metrics\n def self.logger\n @metric_logger ||= ::Logger.new(\"#{Rails.root}/log/resque_metrics.log\")\n end\n end\n end\n...
ruby
chosen
[ { "from": "human", "value": "Test files for 4.2 submission\n" }, { "from": "gpt", "value": "# Solution Below\nold_string = \"Ruby is cool\"\nnew_string = old_string.reverse.upcase\n\n# RSpec Tests. They are included in this file because the local variables you are creating are not accessible acr...
ruby
chosen
[ { "from": "system", "value": "Add minitest as a development_dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/harness/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"twinturbo\"]\n gem.email = [\"me...
ruby
chosen
[ { "from": "system", "value": "Add licensing information for the transitive dependencies of Chef Server.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"veil/version\"\nrequire \"f...
ruby
chosen
[ { "from": "system", "value": "Set default locale before each test\n\napp/views/selection_notification/make_notification.text.erb overwrites\nlocale, leading to flip flopping tests.\n" }, { "from": "human", "value": "ENV['RAILS_ENV'] ||= 'test'\nrequire File.expand_path('../../config/environment'...
ruby
chosen
[ { "from": "system", "value": "Update cocoapod spec to 0.0.2\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Forecastr\"\n s.version = \"0.0.1\"\n s.summary = \"A simple Objective-C wrapper for the Forecast.io API\"\n s.homepage = \"https://github.co...
ruby
chosen
[ { "from": "system", "value": "Update README: repo is deprecated ... again :)\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'HRLEngine'\n s.version = '0.2.6'\n s.summary = 'Use Machine Learning to predict if a person is working out based of hi...
ruby
chosen
[ { "from": "system", "value": "Fix really dumb podspec error\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'InstagramSimpleOAuth'\n s.version = '0.4.0'\n s.summary = 'A quick and simple way to authenticate an Instagram user in y...
ruby
chosen
[ { "from": "system", "value": "Set podspec version to 0.0.2\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"MGCommand\"\n s.version = \"0.0.1\"\n s.summary = \"This library provides a lightweight way for executing commands sequentially or concurrently.\"\...
ruby
chosen
[ { "from": "system", "value": "Simplify Session.start signature and kill mutation\n" }, { "from": "human", "value": "module ROM\n\n # Extends ROM's environment with IdentityMap and state-tracking functionality\n #\n # @api public\n class Session\n include Concord.new(:environment)\n\n #...
ruby
chosen
[ { "from": "system", "value": "Add user for git retrieval\n" }, { "from": "human", "value": "#\n# Cookbook Name:: dotjanus\n# Recipe:: default\n#\n# Copyright 2015, Marcin Nowicki\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated...
ruby
chosen
[ { "from": "system", "value": "Add the maximum collection return as a constant\n\nSo users of the items-search API can retrieve the maximum\n" }, { "from": "human", "value": "require 'active_resource'\nrequire 'arena_api/version'\nrequire 'arena_api/configuration'\n\nmodule ArenaApi\n API_VERSIO...
ruby
chosen
[ { "from": "human", "value": "Migrate translations from unsupported pa-ur locale to pa-pk\n\nCo-authored-by: Peter Hartshorn <1117c31d7ee48714d5fa71842e06c8443afb8c81@digital.cabinet-office.gov.uk>\n" }, { "from": "gpt", "value": "translations = Edition::Translation.where(locale: \"pa-ur\")\n\ntr...
ruby
chosen
[ { "from": "system", "value": "Create index.md in new sites\n" }, { "from": "human", "value": "require 'fileutils'\nrequire_relative 'extra'\n\nclass MDSSInit\n def self.mdss_init(name)\n MDSSExtra.new.puts_err(\"Directory exists\") if File.exists?(name)\n \n Dir.mkdir(nam...
ruby
chosen
[ { "from": "system", "value": "Move alter outside of migration block\n" }, { "from": "human", "value": "Sequel.migration do\n up do\n alter_table :organizations do\n add_column :builder_enabled, :boolean, null: false, default: false\n end\n\n alter_table :users do\n Rails::Seq...
ruby
chosen
[ { "from": "system", "value": "Add checking for full schedule items to specs\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Reservation do\n describe 'validations' do\n it { is_expected.to validate_presence_of :user }\n it { is_expected.to validate_presence_of ...
ruby
chosen
[ { "from": "system", "value": "Mark rails API specs as pending\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'A Secure Rails API endpoint' do\n let(:params) {}\n let(:headers) {}\n\n describe 'GET articles index' do\n subject(:api_call) { get '/rails_api/articles', pa...
ruby
chosen
[ { "from": "system", "value": "Use RSpec.shared_example vs just shared_example.\n" }, { "from": "human", "value": "shared_examples :node_set do |options|\n example 'return a NodeSet instance' do\n @set.is_a?(Oga::XML::NodeSet).should == true\n end\n\n example 'return the right amount of row...
ruby
chosen
[ { "from": "system", "value": "Increase the minimum ruby version constraint to 2.1\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__)) + '/lib/'\nrequire 'sparkle_formation/version'\nGem::Specification.new do |s|\n s.name = 'sparkle_formation'\n s.vers...
ruby
chosen
[ { "from": "human", "value": "Add tests for Construi module\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nRSpec.describe Construi do\n describe 'run' do\n let(:targets) { ['target1', 'target2'] }\n let(:config) { { 'image' => 'image:latest' } }\n\n let(:runner) { instance_do...
ruby
chosen
[ { "from": "system", "value": "Update podspec and add screenshots\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"GSKStretchyHeaderView\"\n s.version = \"0.1.0\"\n s.summary = \"A short description of GSKStretchyHeaderView.\"\n\n s.descriptio...
ruby
chosen
[ { "from": "system", "value": "Fix data migration not finding a method.\n" }, { "from": "human", "value": "class RemoveOntologyFromProofAttemptConfiguration < MigrationWithData\n def up\n ProofAttemptConfiguration.find_each do |pac|\n pac.send(:generate_locid)\n pac.save!\n end\n...
ruby
chosen
[ { "from": "system", "value": "Fix typo in method name\n" }, { "from": "human", "value": "require \"best_boy/engine.rb\"\n\nmodule BestBoy\n mattr_accessor :base_controller, :before_filter, :custom_redirect, :orm,\n :precompile_assets, :skip_after_filter, :skip_before_filter, :test_mode\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in OBS 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 => 'obs' do\n version '0.10.1'\n sha256 '3ac583f...
ruby
chosen
[ { "from": "system", "value": "Fix class -> c alias\n" }, { "from": "human", "value": "module Goku\n class CLI < Thor\n\n desc \"c PATH\", \"Create a class\"\n def c(raw_path)\n path = Goku::Path.new(raw_path)\n factory = Goku::ElementFactory.new(path)\n\n implementation = f...
ruby
chosen
[ { "from": "system", "value": "Fix ISO-3166-1-alpha2 exceptions for GB/UK and GR/EL\n" }, { "from": "human", "value": "require 'net/http'\nrequire 'uri'\nrequire 'json'\nrequire 'json_vat/country'\nrequire 'json_vat/file_cache_backend'\n\nmodule JSONVAT\n\n class << self\n\n def perform_cachi...
ruby
chosen
[ { "from": "system", "value": "Check if Capistrano::VERSION is defined\n\nV2 uses Capistrano::Version, not ::VERSION, so this would have thrown\nan error when used in V2. (Thanks to @avaranovich for pointing this out)\n" }, { "from": "human", "value": "require \"capistrano-resque/version\"\n\nif ...
ruby
chosen
[ { "from": "system", "value": "Check for the private ip if public ip is empty\n" }, { "from": "human", "value": "require 'aws-sdk'\n\nunless Capistrano::Configuration.respond_to?(:instance)\n abort 'capistrano/ec2tag requires Capistrano >= 2'\nend\n\nmodule Capistrano\n class Configuration\n ...
ruby
chosen
[ { "from": "system", "value": "Add a default base_path for Organizer\n" }, { "from": "human", "value": "module Catalog\n class Organizer\n def initialize(base_path:)\n @base_path = base_path\n end\n\n def run!\n new_documents.each do |document|\n matcher = DrawerMatcher...
ruby
chosen
[ { "from": "system", "value": "[views] Make view count default to 0\n" }, { "from": "human", "value": "class AddUpdatedAtAndCountToViews < ActiveRecord::Migration\n def change\n add_column :forem_views, :updated_at, :datetime\n add_column :forem_views, :count, :integer\n end\nend\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Add caveat about setting NODENV_ROOT\n" }, { "from": "human", "value": "class Nodenv < Formula\n homepage \"https://github.com/OiNutter/nodenv\"\n head \"https://github.com/OiNutter/nodenv.git\"\n url \"https://github.com/OiNutter/nodenv/archive/v0.2.0.tar.gz\"\n...
ruby
chosen
[ { "from": "human", "value": "Create interactor for global discussions\n" }, { "from": "gpt", "value": "module Interactors\n module Feed\n class GlobalDiscussions\n include Pavlov::Interactor\n\n arguments :timestamp, :count\n\n def authorized?\n true\n end\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add field for post-login action.\n" }, { "from": "gpt", "value": "class AddPostLoginActionToUsers < ActiveRecord::Migration\n def self.up\n add_column :users, :post_login_action, :string\n end\n\n def self.down\n remove_column :users, :post_login_action\n e...
ruby
chosen
[ { "from": "system", "value": "Migrate old hash syntax to new ruby style\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n\n mount Calligraph::Engine => \"/\"\n\n devise_for :calligraph_admin_users, {\n :class_name => \"Calligraph::AdminUser\",\n path_names: {sign_in: ...
ruby
chosen
[ { "from": "system", "value": "Verify that we sort version numbers the same way RubyGems does\n" }, { "from": "human", "value": "require 'test/unit'\nrequire 'version_sorter'\n\nclass VersionSorterTest < Test::Unit::TestCase\n def test_sorts_versions_correctly\n versions = %w(1.0.9 1.0.10 2.0...
ruby
chosen
[ { "from": "system", "value": "Add an additional test for the missing case\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe GraphQL::Execution::Typecast do\n\n let(:schema) { DummySchema }\n let(:context) { GraphQL::Query::Context.new(query: OpenStruct.new(schema: schema),...
ruby
chosen
[ { "from": "system", "value": "Add valid file check for shared template examples\n" }, { "from": "human", "value": "RSpec.shared_examples 'an ImageTemplate' do |options|\n let(:image_template) { described_class.new(options) }\n\n describe '#to_html' do\n it 'renders a String' do\n expec...
ruby
chosen