conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Use the expect() syntax when generating view specs for :show. Use factory_girl's build_stubbed instead of rspec's stub_model.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\n<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time,...
ruby
chosen
[ { "from": "system", "value": "Set sanitizer_vendor to correct constant.\n" }, { "from": "human", "value": "require \"rails/deprecated_sanitizer/version\"\nrequire \"rails/deprecated_sanitizer/html-scanner\"\nrequire \"active_support/lazy_load_hooks\"\n\nmodule Rails\n module DeprecatedSanitizer...
ruby
chosen
[ { "from": "system", "value": "Update template to include 'week'.\n" }, { "from": "human", "value": "# This file contains descriptions of all your stripe plans\n\n# Example\n# Stripe::Plans::PRIMO #=> 'primo'\n\n# Stripe.plan :primo do |plan|\n#\n# # plan name as it will appear on credit card s...
ruby
chosen
[ { "from": "system", "value": "Exit with correct exit code\n\nReturns the correct exit code, rather than raising an exception.\n" }, { "from": "human", "value": "desc 'Analyse Javascript with JSHint and Javascript Code Style checker'\ntask :analyse_javascript do\n puts 'Running Javascript code a...
ruby
chosen
[ { "from": "human", "value": "Add data migration to fix first_published_at values\n\nAlong with the first_public_at values for scheduled content which\nhasn't been published yet.\n\nThis is necessary, as Whitehall has been sending the\nfirst_published_at values for content which hasn't been published\nyet......
ruby
chosen
[ { "from": "human", "value": "Add fgdc reader module 'lineage'\ninclude minitest\n" }, { "from": "gpt", "value": "# MdTranslator - minitest of\n# readers / fgdc / module_lineage\n\n# History:\n# Stan Smith 2017-08-31 original script\n\nrequire 'nokogiri'\nrequire 'adiwg/mdtranslator/internal/in...
ruby
chosen
[ { "from": "system", "value": "Put something other than 0 for local and peer as\n\nThis will allow it to fully start up for now.\n" }, { "from": "human", "value": "default[:exabgp][:local_as] = 0\ndefault[:exabgp][:peer_as] = 0\ndefault[:exabgp][:community] = [0]\n\ndefault[:exabgp][:hold_time] =...
ruby
chosen
[ { "from": "system", "value": "Make repository available from Sentence.\n" }, { "from": "human", "value": "class Sentence < ActiveRecord::Base\n include Metadatable\n include Readability\n\n belongs_to :ontology\n has_and_belongs_to_many :symbols, class_name: 'OntologyMember::Symbol'\n has_m...
ruby
chosen
[ { "from": "system", "value": "Fix regexp and remove , from the answer\n" }, { "from": "human", "value": "# encoding: utf-8\nclass Wearther < Base\n match /^[zurg].+como.+tempo.+em\\s(.+)[?]$/, :use_prefix => false, :method => :weather\n\n def initialize(*args)\n super\n GeoPlanet.appid =...
ruby
chosen
[ { "from": "system", "value": "Rename Thomas to Tom in the .gemspec.\n\n:bowtie:\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'fdic/version'\n\nGem::Specification.new do |spec|\n s...
ruby
chosen
[ { "from": "system", "value": "Make custom validation method private\n" }, { "from": "human", "value": "class CategoryTopic < ActiveRecord::Base\n belongs_to :category, polymorphic: true, touch: true\n belongs_to :topic, touch: true\n\n validates :topic_id,\n presence: true,\n ...
ruby
chosen
[ { "from": "system", "value": "Add uniqueness validation to OrgIdentifier\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: org_identifiers\n#\n# id :integer not null, primary key\n# attrs :string\n# identifier :str...
ruby
chosen
[ { "from": "system", "value": "Make RecordsController allow three arguments\n" }, { "from": "human", "value": "# lib/frecon/controllers/records_controller.rb\n#\n# Copyright (C) 2014 Christopher Cooper, Sam Craig, Tiger Huang, Vincent Mai, Sam Mercier, and Kristofer Rye\n#\n# This file is part of...
ruby
chosen
[ { "from": "system", "value": "Add test for changing label after applying\n" }, { "from": "human", "value": "require 'rails_helper'\n\n\n\nfeature \"First login as User\" do\n background do\n @current_user = FactoryGirl.create(:user)\n login_as @current_user\n end\n\n scenario \"Display ...
ruby
chosen
[ { "from": "system", "value": "Remove unused partial in RequestStartedOnMiddleware specs.\n\nAdded RSpec to outer describe block.\n" }, { "from": "human", "value": "describe RequestStartedOnMiddleware do\n context \".long_running_requests\" do\n before do\n allow(described_class).to rece...
ruby
chosen
[ { "from": "system", "value": "Stop displaying errors for code blocks with no language.\n" }, { "from": "human", "value": "module ApplicationHelper\n def body_class\n %|#{controller.controller_name} #{controller.controller_name}-#{controller.action_name} #{@body_class}|\n end\n\n class HTML...
ruby
chosen
[ { "from": "system", "value": "Change old field by new one\n" }, { "from": "human", "value": "FactoryBot.define do\n factory :account do\n debtor { false }\n reconcilable { false }\n nature { 'general' }\n sequence(:name) { |n| \"Compte 801 - #{n}\" }\n sequence(:number) { |n| (80...
ruby
chosen
[ { "from": "system", "value": "Add coverage for counters persisting between flushes\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass MetricsRailsTest < ActiveSupport::TestCase\n \n test 'is a module' do\n assert_kind_of Module, Metrics::Rails\n end\n \n test 'client is av...
ruby
chosen
[ { "from": "system", "value": "Allow superusers to access private questions w/ a group" }, { "from": "human", "value": "class QuestionPermission < Prequel::Record\n column :id, :integer\n column :secret, :string\n column :question_id, :integer\n column :user_id, :integer\n\n belongs_to :ques...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.1.0 to 0.2.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-entity_store'\n s.version = '0.1.1.0'\n s.summary = 'Store of entities that are projected from...
ruby
chosen
[ { "from": "system", "value": "Update authors list in gemspec" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'claim_token/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "human", "value": "Add test for `Settings::ExportController` index view\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"rails_helper\"\n\ndescribe Settings::ExportController, type: :controller do\n describe \"#index\" do\n subject { get :index }\n\n c...
ruby
chosen
[ { "from": "system", "value": "Make DelayedConstraint class simple again\n" }, { "from": "human", "value": "require 'libz3'\n\nclass Object\n\t@@constraints = {}\n\n\tdef self.constraint(name, definition)\n\t\t@@constraints[name] = definition\n\tend\n\n\tdef constraint(name, definition)\n\t\tself...
ruby
chosen
[ { "from": "system", "value": "Add rspec to development dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/rspec/retry/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Yusuke Mito\"]\n gem.email = [\"y...
ruby
chosen
[ { "from": "system", "value": "Add private dyno size constants\n" }, { "from": "human", "value": "require 'dynosaur/client/heroku_client'\n\n# Start a detached rake task on a one-off dyno\nmodule Dynosaur\n class Process\n class Heroku < Process\n # Valid dyno sizes under Heroku's new pr...
ruby
chosen
[ { "from": "system", "value": "Add file and line numbers when class_eval'ing\n" }, { "from": "human", "value": "module FieldAttributeBuilder\n VERSION = \"#{MAJOR}.#{MINOR}.#{TINY}\"\n\n MAJOR = 0\n MINOR = 0\n TINY = 1\n\n module ActiveRecordExtensions\n def field_attr_builder(associati...
ruby
chosen
[ { "from": "human", "value": "Add CountGen module for mixin\n" }, { "from": "gpt", "value": "module CountGen\n\n # Generates an array of numbers, counting by how many player records\n # are on each HTML page. Allows other methods to paginate through the \n # stat pages and collect them all.\n ...
ruby
chosen
[ { "from": "system", "value": "Send ping every 30 seconds\n" }, { "from": "human", "value": "require 'json'\nrequire 'websocket-client-simple'\n\nmodule Ruboty\n module SlackRTM\n class Client\n def initialize(websocket_url:)\n @client = WebSocket::Client::Simple.connect(websocket...
ruby
chosen
[ { "from": "human", "value": "Add task to convert Textile content to Markdown\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nnamespace :publify do\n desc \"Convert content in Textile format to Markdown\"\n task textile_to_markdown: :environment do\n Content.find_each do |c...
ruby
chosen
[ { "from": "system", "value": "Add ti reset sequesces the tables that we migrated\n" }, { "from": "human", "value": "namespace :db do\n desc \"Reset all sequences. Run after data imports\"\n task :reset_sequences, [:model_class] => :environment do |t, args|\n if args[:model_class]\n cla...
ruby
chosen
[ { "from": "system", "value": "Set both digest keys for backwards compatibility\n" }, { "from": "human", "value": "require \"action_controller/railtie\"\n\nmodule Sprockets\n autoload :StaticNonDigestGenerator, \"sprockets/static_non_digest_generator\"\nend\n\nmodule TurboSprockets\n class Rail...
ruby
chosen
[ { "from": "system", "value": "Allow skipping triggers for a single run\n\nTriggers won't run if VAGRANT_NO_TRIGGERS environment variable is set\n" }, { "from": "human", "value": "begin\n require \"vagrant\"\nrescue LoadError\n raise \"The Vagrant Triggers plugin must be run within Vagrant.\"\n...
ruby
chosen
[ { "from": "system", "value": "Change check connection to receive connection on params\n" }, { "from": "human", "value": "# Company\n# Metadata that describes the Company.\n# https://developers.veeqo.com/docs/versions/1-0-0-beta/resources/company\n\nmodule Veeqo\n class Company < Resource\n i...
ruby
chosen
[ { "from": "system", "value": "Update pod version to 1.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"UPCarouselFlowLayout\"\n s.version = \"1.0.0\"\n s.summary = \"A fancy carousel flow layout for UICollectionView.\"\n s.description ...
ruby
chosen
[ { "from": "system", "value": "Include parent class into the module\n" }, { "from": "human", "value": "require \"rest_client\"\n\nrequire \"webtrends/version\"\nrequire \"webtrends/event\"\nrequire \"webtrends/configuration\"" }, { "from": "gpt", "value": "require \"rest_client\"\n\nr...
ruby
chosen
[ { "from": "system", "value": "Remove a useless method in the fixture template class" }, { "from": "human", "value": "module ActionView #:nodoc:\n class FixtureResolver < PathResolver\n def initialize(hash = {}, options = {})\n super(options)\n @hash = hash\n end\n\n private\n\n...
ruby
chosen
[ { "from": "system", "value": "Add License information to gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/aloha/rails/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = ['Kurakin Alexander']\n gem.email = '...
ruby
chosen
[ { "from": "system", "value": "Fix crash on bad argument to Table.exists?\n" }, { "from": "human", "value": "require_relative './db'\n\nmodule Rake\n module TableTask\n\n # Represents a table accessed via a database, roughly analogous to the File class.\n class Table\n\n def initializ...
ruby
chosen
[ { "from": "system", "value": "Remove some redundant return statements\n" }, { "from": "human", "value": "class PublicationsController < InheritedResources::Base\n def show\n edition = Edition.find_or_create_from_panopticon_data(params[:id], current_user)\n\n if edition.persisted?\n U...
ruby
chosen
[ { "from": "system", "value": "Update show method with correct user\n" }, { "from": "human", "value": "class QuestionsController < ApplicationController\n\n before_action :set_question, only: [:show, :edit, :update, :destroy]\n\n def index\n @questions = Question.all.order('created_at DESC')...
ruby
chosen
[ { "from": "system", "value": "Remove cr0sskrypt proteccion for now\n" }, { "from": "human", "value": "class VoicemailController < ApplicationController\n layout 'twilio_xml'\n\n def prompt\n end\n\n def router\n end\n\n def new\n end\n\n def create\n if params['RecordingDuration'].to_...
ruby
chosen
[ { "from": "human", "value": "WIP: Test for enterprise user access in reports\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Spree::Admin::ReportsController do\n\n # Given two distributors\n let (:ba) { create(:address) }\n let (:da) { create(:address, :address1 => \"distri...
ruby
chosen
[ { "from": "system", "value": "Add mysql dependency when running tests on MySQL.\n" }, { "from": "human", "value": "spec = Gem::Specification.new do |s|\n s.name = \"songkick-oauth2-provider\"\n s.version = \"0.10.0\"\n s.summary = \"Simple OAuth 2.0 provider t...
ruby
chosen
[ { "from": "human", "value": "Add test for .run method\n" }, { "from": "gpt", "value": "describe KnapsackPro::Runners::Queue::MinitestRunner do\n describe '.run' do\n let(:test_suite_token_minitest) { 'fake-token' }\n let(:queue_id) { 'fake-queue-id' }\n let(:test_dir) { 'fake-test-dir'...
ruby
chosen
[ { "from": "system", "value": "Update dashboard controller to load chart data\n" }, { "from": "human", "value": "class DashboardController < ApplicationController\n def index\n @current_account = current_account\n @entries = current_entries\n\n mount_entries_lists\n mount_totalizers\...
ruby
chosen
[ { "from": "system", "value": "Fix permission and set employer\n" }, { "from": "human", "value": "class EmployersController < ApplicationController\n before_action :authenticate_employer!, only: :edit\n before_action :authenticate_user!, except: :edit\n before_action :set_employer, only: :show...
ruby
chosen
[ { "from": "system", "value": "Fix /proposals displaying resolution-proposals as currently-open resolutions.\n" }, { "from": "human", "value": "class ProposalsController < ApplicationController\n respond_to :html\n \n def index\n # Fetch open proposals\n @proposals = co.proposals.current...
ruby
chosen
[ { "from": "system", "value": "Set adapter name on reply" }, { "from": "human", "value": "class SmsTestsController < ApplicationController\n # authorization via CanCan\n load_and_authorize_resource :class => \"Sms::Test\"\n\n def new\n end\n\n # handles a request for a test. this will be an ...
ruby
chosen
[ { "from": "system", "value": "Add comment in PostagDiff about its current status\n" }, { "from": "human", "value": "module LLT\n class Diff::Parser\n class PostagDiff\n attr_reader :original, :new\n\n def initialize(original, new)\n @original = original\n @new = new\n...
ruby
chosen
[ { "from": "system", "value": "Add validation to custom field name\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule GobiertoCommon\n class CustomField < ApplicationRecord\n belongs_to :site\n has_many :records, dependent: :destroy, class_name: \"CustomFieldRecord\...
ruby
chosen
[ { "from": "system", "value": "Remove \"in £\" from money input\n\nAs recommended by the Content Designers.\n" }, { "from": "human", "value": "class MoneyQuestionPresenter < QuestionPresenter\n include SmartAnswer::FormattingHelper\n\n def response_label(value)\n format_money(SmartAnswer::Mo...
ruby
chosen
[ { "from": "system", "value": "Change to class style schema\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nAnnictSchema = GraphQL::Schema.define do\n query ObjectTypes::Query\n mutation ObjectTypes::Mutation\n\n use GraphQL::Batch\n\n id_from_object ->(object, type_defini...
ruby
chosen
[ { "from": "system", "value": "Remove farm attribute form places.\n" }, { "from": "human", "value": "collection @places\nattributes :id, :name, :city, :address, :latitude, :longitude,\n:accepts_new_members, :is_established, :description, :contact_name,\n:contact_phone, :contact_url, :type, :user_...
ruby
chosen
[ { "from": "system", "value": "Revert issue introduced by misunderstanding of rescue modifier\n" }, { "from": "human", "value": "module RemoteCommandHelpers\n def test_dir_exists(path)\n exists?(\"d\", path)\n end\n\n def test_symlink_exists(path)\n exists?(\"L\", path)\n end\n\n def t...
ruby
chosen
[ { "from": "system", "value": "Fix issue with finding the latest version of models\n" }, { "from": "human", "value": "versions = []\nDir.glob(Rails.root.join(\"app\", \"models\", \"*\")).each do |path|\n idx = path.rindex(/\\//)\n if idx\n file_portion = path.slice(idx+1, path.length)\n v...
ruby
chosen
[ { "from": "system", "value": "Remove _ttl from logger. Needs to be in Logstash -> Elasticsearch bit.\n" }, { "from": "human", "value": "if Rails.env.test? && Rails.logger.level == 0\n ActiveSupport::Notifications.subscribe(/process_action.action_controller|racing_on_rails/) do |name, start, fin...
ruby
chosen
[ { "from": "system", "value": "Update spec to pass on latest rom\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"anima\"\n\ndescribe \"CSV adapter\" do\n subject(:rom) { setup.finalize }\n\n let(:path) { File.expand_path(\"./spec/fixtures/users.csv\") }\n\n # If :csv is n...
ruby
chosen
[ { "from": "system", "value": "Make console integration spec more specific\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"A request sent to CloudStack for console access\", :vcr do\n let(:config_hash) do\n {\n url: CONFIG['url'],\n api_key: CONFIG...
ruby
chosen
[ { "from": "system", "value": "Fix dynamic constant assignment error\n" }, { "from": "human", "value": "describe 'Refs callback' do\n before do\n stub_const 'Foo', Class.new\n Foo.class_eval do\n include React::Component\n end\n end\n\n it \"is invoked with the actual Ruby instan...
ruby
chosen
[ { "from": "system", "value": "Add record count to the filename\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"fileutils\"\n\nclass ExportAsyncJob < ApplicationJob\n def perform(user_id, controller_name, resource_class_name, sql_string)\n ::ActiveRecord::Base.lo...
ruby
chosen
[ { "from": "system", "value": "Refactor PickupCards into a struct for simplicity\n" }, { "from": "human", "value": "class PickupCards\n attr_reader :errors\n\n def initialize(player, round)\n @player = player\n @round = round\n @errors = []\n end\n\n def call\n @round.game.with_l...
ruby
chosen
[ { "from": "system", "value": "Add specs for Organization validations\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Organization do\n\n it 'can be converted to full tree hash with all recursive children' do\n FactoryGirl.create(:kirjasto)\n tree = Organization.root.t...
ruby
chosen
[ { "from": "human", "value": "Add some initial unit tests for null part" }, { "from": "gpt", "value": "require 'rodakase/view/null_part'\n\nRSpec.describe Rodakase::View::NullPart do\n subject(:part) do\n Rodakase::View::NullPart.new(renderer, data)\n end\n\n let(:name) { :user }\n let(:da...
ruby
chosen
[ { "from": "system", "value": "Allow gem to work with Rails 4.1\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"simple_form_fancy_uploads/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specificati...
ruby
chosen
[ { "from": "system", "value": "Fix timing attack vulnerability in ActiveSupport::MessageVerifier.\n\nUse a constant-time comparison algorithm to compare the candidate HMAC with the calculated HMAC to prevent leaking information about the calculated HMAC.\n\nSigned-off-by: Michael Koziarski <17b9e1c64588c7fa6...
ruby
chosen
[ { "from": "system", "value": "[aphrodite] Add counters information to documents\n" }, { "from": "human", "value": "collection @documents\nattributes :id, :title, :created_at\n" }, { "from": "gpt", "value": "collection @documents\nattributes :id, :title, :created_at, :percentage\n\nno...
ruby
chosen
[ { "from": "human", "value": "Add example create authorization request with an account\n" }, { "from": "gpt", "value": "require_relative \"../boot\"\n\n# Create Authorization with Account\n#\n# You need to give:\n# - notification_url\n# - redirect_url\n# - permissions defaults to al...
ruby
chosen
[ { "from": "system", "value": "Fix for ignored date params in compare search.\n\nProposed fix for #118 'date picker not working in compare view'. The\nproblem was that seeding the user selections model with the given\nfrom and to dates was using symbol keys not string keys.\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Move render to end of statement\n" }, { "from": "human", "value": "class ExportsController < ApplicationController\n include Concerns::JwtToken\n include Concerns::CanvasSupport\n include AttendanceExportsHelper\n include ExamExportHelper\n before_action :valid...
ruby
chosen
[ { "from": "system", "value": "Use Device provided `before_action :authenticate_user!` instead of `user_signed_in?` from the Authentication concern.\n" }, { "from": "human", "value": "class ProfileController < ArticlesController\n before_action :require_sign_in\n\n def edit\n end\n\n def upda...
ruby
chosen
[ { "from": "system", "value": "Use rufus-json's automatic JSON library loading" }, { "from": "human", "value": "require \"bumbleworks/storage_adapter\"\nrequire \"ruote-redis\"\n\nmodule Bumbleworks\n module Redis\n class Adapter < Bumbleworks::StorageAdapter\n class << self\n def...
ruby
chosen
[ { "from": "system", "value": "Add test for table header on pages list\n\nMake sure the table header is html, not escaped text.\n\nConflicts:\n\tspec/features/config_spec.rb\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'Configuration of a site' do\n describe 'valid confi...
ruby
chosen
[ { "from": "system", "value": "Test the configuration too after adding the wsdl\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe PixiClient do\n before do\n PixiClient.configure do |configuration|\n configuration.endpoint = 'endpoint'\n configuration.username = '...
ruby
chosen
[ { "from": "human", "value": "Add basic RelatedContent model spec to check multiple models can be related\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe RelatedContent do\n\n let(:parent_relationable) { create([:proposal, :debate, :budget_investment].sample) }\n let(:child_...
ruby
chosen
[ { "from": "system", "value": "Improve capture_io handling of unexpected exceptions\n\nWe frequently use `capture_io` in specs for testing running CLI\ncommands, many of which will indirectly end up calling `exit 1` in\nfailure conditions.\n\nFor a happy-path spec, if a regression breaks the spec, this is\np...
ruby
chosen
[ { "from": "system", "value": "Use path-only URLs for chart slices.\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n def index\n can?(:read, 'home') do\n @graphs = Rails.cache.fetch('graphs', :expires_in => 60.seconds) do\n require 'net/http'\n ...
ruby
chosen
[ { "from": "system", "value": "Support public battlegroup name/description on Discord links\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass SiteController < ApplicationController\n def index\n # Just render a view\n if params[:character]\n @character = Charac...
ruby
chosen
[ { "from": "system", "value": "Add a hlper method to render FontAwesome icons\n" }, { "from": "human", "value": "module FontAwesomeHelper\n\n def checked_image2(checked = true)\n if checked\n image_tag 'toggle_check.png'\n else\n image_tag 'exclamation.png'\n end\n end\n\n\n ...
ruby
chosen
[ { "from": "system", "value": "Use Rails voodoo to get DST offset automatically\n" }, { "from": "human", "value": "class PromptDeliveryHour\n def initialize(hour, time_zone)\n @hour = hour.to_i\n @time_zone = time_zone\n end\n\n def in_time_zone\n in_24_hours(hour + offset)\n end\n\n...
ruby
chosen
[ { "from": "system", "value": "Change rails dependency to railties\n" }, { "from": "human", "value": "$:.push File.expand_path(\"lib\", __dir__)\n\nrequire \"rocket_job_mission_control/version\"\n\nGem::Specification.new do |s|\n s.name = \"rocketjob_mission_control\"\n s.version = R...
ruby
chosen
[ { "from": "system", "value": "Make Saveable a little prettier" }, { "from": "human", "value": "module KeplerProcessor\n module Saveable\n def full_output_filename\n \"#{@options[:output_path]}/#{output_filename}\"\n end\n\n def output_filename\n nil # defaults to nil, child c...
ruby
chosen
[ { "from": "system", "value": "Sort repositories by push date\n" }, { "from": "human", "value": "require \"octokit\"\n\nmodule Magnum::Integration\n class Github < Base\n def initialize(oauth_token)\n @oauth_token = oauth_token\n end\n\n def repositories\n client.repositories....
ruby
chosen
[ { "from": "system", "value": "Add plural rules to I18n load path\n\nThis adds the native plural rules in rails-i18n and the bespoke list we\ncreated in `config/locales/plurals.rb`. This allows them to be located\nwhen we lookup the plural rules for all our supported languages.\n\n`concat` and `Dir` have bee...
ruby
chosen
[ { "from": "human", "value": "Make sure MySQL would not use CURRENT_TIMESTAMP\n\nfor timestamp columns magically. See:\n\nhttps://gitlab.com/gitlab-org/gitlab-ce/issues/36405\n" }, { "from": "gpt", "value": "# Make sure that MySQL won't try to use CURRENT_TIMESTAMP when the timestamp\n# column is...
ruby
chosen
[ { "from": "system", "value": "Revert \"the flush was causing an app error, why was this not caught earlier?\"\n\nThis reverts commit 834ebf3a026ae3de951917b231eecf70062756d9.\n" }, { "from": "human", "value": "Refraction.configure do |req|\n if req.host =~ /travis\\.heroku\\.com/\n if req.pa...
ruby
chosen
[ { "from": "system", "value": "Refactor tests and add todo for new test cases.\n" }, { "from": "human", "value": "require 'bitmap'\nrequire 'color'\n\nRSpec.describe Bitmap, \"#init\" do\n context \"With a given width and height\" do\n width, height = 2, 2\n it \"initializes a 2D array wit...
ruby
chosen
[ { "from": "system", "value": "Create testing keyspace if needed\n" }, { "from": "human", "value": "require 'cassandra/mapper'\n" }, { "from": "gpt", "value": "require 'cassandra/mapper'\n\nTEST_KEYSPACE = 'test_mapper'\n\n# create testing keyspace if needed\ncassandra = Cassandra.new...
ruby
chosen
[ { "from": "system", "value": "Include job folder contents in payload\n" }, { "from": "human", "value": "json.extract! @osc_job, :name, :batch_host, :created_at, :updated_at\n" }, { "from": "gpt", "value": "json.extract! @osc_job, :name, :batch_host, :created_at, :updated_at\njson.fol...
ruby
chosen
[ { "from": "system", "value": "Hide delayed job sql messages in production.log" }, { "from": "human", "value": "if Rails.env.production?\n\n log_file = \\\n File.join Rails.root, 'log', 'delayed_job.log'\n\n Delayed::Worker.logger = \\\n Logger.new log_file\n\n if caller.last =~ /script\...
ruby
chosen
[ { "from": "system", "value": "Exclude spec/dummy from SimpleCov for Coveralls\n" }, { "from": "human", "value": "require 'coveralls'\nCoveralls.wear!\n\nENV[\"RAILS_ENV\"] ||= 'test'\nrequire File.expand_path(\"../dummy/config/environment.rb\", __FILE__)\nrequire 'rspec/rails'\n\nRSpec.configure...
ruby
chosen
[ { "from": "system", "value": "Update specs helper to prevent monkey patching.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nif RUBY_VERSION > '1.9' and (ENV['COVERAGE'] || ENV['TRAVIS'])\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatter::Mult...
ruby
chosen
[ { "from": "system", "value": "Remove contents of tmp dir after build\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'rubyxls'\n" }, { "from": "gpt", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire '...
ruby
chosen
[ { "from": "system", "value": "Set sandbox to true for tests\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'bloom_remit_client'\nrequire 'pathname'\nrequire 'yaml'\nrequire 'pry'\n\nSPEC_DIR = Pathname.new(File.dirname(__FILE__))\n\nDir[SPE...
ruby
chosen
[ { "from": "system", "value": "Move Bundler.require to get coverage back.\n" }, { "from": "human", "value": "require 'bundler'\nBundler.require\n\nrequire 'coveralls'\nCoveralls.wear! do\n add_filter 'spec'\nend\n\nrequire 'acfs'\nrequire 'webmock/rspec'\n\nDir[File.expand_path('spec/support/**/...
ruby
chosen
[ { "from": "system", "value": "Drop test coverage to 98%\n\nTests are good but 99% is very high and we need\nthe VPN functionality ASAP.\n" }, { "from": "human", "value": "# SimpleCov must run _first_ according to its README\nif ENV['COVERAGE']\n require 'simplecov'\n\n # monkey-patch to preven...
ruby
chosen
[ { "from": "system", "value": "Clarify mobile client API routes\n\nShorten the base routes and move required paramaters. Add basic\npseudocode to methods.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'sinatra' \nrequire 'json'\n\nget '/' do\n \"It runs from Heroku!\"\nend\n\nge...
ruby
chosen
[ { "from": "system", "value": "Remove extra string in stub acceptance test\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe \"filebeat class:\" do\n\n package_name = 'filebeat'\n service_name = 'filebeat'\n pid_file = '/var/run/filebeat.pid'\n\n describe \"d...
ruby
chosen
[ { "from": "system", "value": "Fix yaml erb parsing when Rails is not loaded\n" }, { "from": "human", "value": "require 'spec_helper_lite'\nrequire 'faker'\nrequire 'yaml'\nrequire 'active_record'\nrequire 'factory_girl'\nrequire 'rack/test'\nrequire 'shoulda/matchers'\n\nrequire_relative './supp...
ruby
chosen
[ { "from": "human", "value": "Add test for conference registration controller edit and update action\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe ConferenceRegistrationsController, type: :controller do\n let(:conference) { create(:conference) }\n let(:user) { create(:user)...
ruby
chosen
[ { "from": "system", "value": "Add newline in configure block for cleanliness\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'slim'\nrequire 'data_mapper'\nrequire 'dm-postgres-adapter'\nrequire 'pathname'\n\nconfigure :development do\n require 'dm-sqlite-adapter'\nend\n\nconfigur...
ruby
chosen