conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add an email address to gemspec" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"active_metric/version\"\n\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|...
ruby
chosen
[ { "from": "system", "value": "Fix Travis CLI installation check\n" }, { "from": "human", "value": "# travis login --pro\n# travis history -l1 -bmaster\nmodule Herkko\n # Checks status of CI build from Travis.\n class Travis\n def status_for(branch)\n if travis_cli_installed?\n s...
ruby
chosen
[ { "from": "system", "value": "Remove Optparse usage, simplify it with ARGV\n" }, { "from": "human", "value": "require_relative 'lib/prime.rb'\nrequire_relative 'lib/multiplication_table'\nrequire 'terminal-table'\n# require 'optparse'\n#\n# options = { size: 10 }\n#\n# OptionParser.new do |optio...
ruby
chosen
[ { "from": "system", "value": "Update the URL to apache2 cookbook\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "# Shamelessly copied from https://github.com/onehealth-cookbooks/apache2/blob/master/test/fixtures/serverspec_helper....
ruby
chosen
[ { "from": "system", "value": "Fix unit test for sync\n\nChange-Id: I8d7180f6b40754cfb70b81c2dfa7b59384e8bb5a\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe '{{cookiecutter.project_name}}::db::sync' do\n\n shared_examples_for '{{cookiecutter.project_name}}-dbsync' do\n\n ...
ruby
chosen
[ { "from": "system", "value": "Use `fail` instead of `raise`\n" }, { "from": "human", "value": "module InternetScrabbleClub\n\n class MultiQueue\n def initialize\n @queues = Hash.new { [] }\n end\n\n def dequeue(name, default = nil)\n return @queues[name].shift if @queues[name...
ruby
chosen
[ { "from": "system", "value": "Fix case in test resource\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Cookbook:: end_to_end\n# Recipe:: _macos_userdefaults\n#\n# Copyright:: Copyright (c) Chef Software Inc.\n#\n\nmac_os_x_u...
ruby
chosen
[ { "from": "human", "value": "Remove duplicate drafts for specialist publisher.\n\nA bunch of these were created a while ago when we\nrestructured the database. They need to go away\nso that things don't show as \"redrafted\" when they\naren't really." }, { "from": "gpt", "value": "namespace :sp...
ruby
chosen
[ { "from": "system", "value": "Remove allow_n_plus_1 block from DeleteMergedBranchesService\n\nFixes #37438\nFixes gitaly#999\n" }, { "from": "human", "value": "class DeleteMergedBranchesService < BaseService\n def async_execute\n DeleteMergedBranchesWorker.perform_async(project.id, current_u...
ruby
chosen
[ { "from": "system", "value": "Fix handling of multiple structure.sql files\n" }, { "from": "human", "value": "require 'activerecord-clean-db-structure/clean_dump'\n\nRake::Task['db:structure:dump'].enhance do\n filenames = ENV['DB_STRUCTURE']\n\n if ActiveRecord::VERSION::MAJOR >= 6\n Activ...
ruby
chosen
[ { "from": "system", "value": "Update spec\nAdded LUKeychainAccess for passing arround twitter App credential\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"TWReverseAuth\"\n s.version = \"0.1.0\"\n s.summary = \"OAuth for Twitter using reverse auth and ...
ruby
chosen
[ { "from": "system", "value": "Allow user class name to be passed to common:test_app rake task\n" }, { "from": "human", "value": "unless defined?(Spree::InstallGenerator)\n require 'generators/spree/install/install_generator'\nend\n\ndesc \"Generates a dummy app for testing\"\nnamespace :common ...
ruby
chosen
[ { "from": "system", "value": "Add links to reference source .NET implementation for Cargo\n" }, { "from": "human", "value": "class Cargo\n def transport_status\n return false\n end\n\n attr_accessor :tracking_id\n attr_accessor :route_specification\n attr_accessor :itinerary\n attr_acce...
ruby
chosen
[ { "from": "system", "value": "Fix so that we don't recreate records if they already exist\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 al...
ruby
chosen
[ { "from": "system", "value": "Add a seed admin for development\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:setu...
ruby
chosen
[ { "from": "system", "value": "Add require csv to seed file\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:setup).\...
ruby
chosen
[ { "from": "human", "value": "Add a spec for the copyright year\n\nSo that it doesn't say 2021 until mid December 2022 ;-)\n" }, { "from": "gpt", "value": "describe :locale_contents do\n locale_files = Rails.root.join(\"locale\").glob(\"*.yml\")\n\n context \"Copyright year\" do\n locale_fil...
ruby
chosen
[ { "from": "system", "value": "Fix random tests in LoggerProxy\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Rollbar::LoggerProxy do\n let(:logger) { double(:logger) }\n let(:message) { 'the-message' }\n\n subject { described_class.new(logger) }\n\n shared_examples 'del...
ruby
chosen
[ { "from": "system", "value": "Revert to minimal sermon factory\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :sermon do\n group\n name { Forgery('lorem_ipsum').sentence }\n published_at { DateTime.now }\n speaker { Forgery('name').full_name }\n audio_url { \"...
ruby
chosen
[ { "from": "system", "value": "Use \"table_name\" argument for table if given\n" }, { "from": "human", "value": "module BazaModels::Model::BelongsToRelations\n def self.included(base)\n base.extend(ClassMethods)\n end\n\n module ClassMethods\n def belongs_to(relation_name, args = {})\n ...
ruby
chosen
[ { "from": "system", "value": "Set proper endpoint for the AgingReceivablesList\n" }, { "from": "human", "value": "module Elmas\n # We can use the AgingReceivablesList to change the status of SalesInvoices from\n # Open to 'Verwerkt' while at the same time sending a PDF of the invoice to the\n ...
ruby
chosen
[ { "from": "system", "value": "Add Rails 5 compatibility fix\n" }, { "from": "human", "value": "module GoogleVisualr\n module Rails\n module ViewHelper\n extend ActiveSupport::Concern\n\n included do\n helper_method \"render_chart\"\n end\n\n def render_chart(chart,...
ruby
chosen
[ { "from": "system", "value": "Fix acceptance tests for EL\n\nThe return value of fact('selinux') is a stringified bool.\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\n# These tests ensure that postgres can change itself to an alternative pgdata\n# location properly.\n\n# ...
ruby
chosen
[ { "from": "system", "value": "Use common sublist class for credit memo item list\n" }, { "from": "human", "value": "module NetSuite\n module Records\n class CreditMemoItemList\n include Namespaces::TranCust\n\n def initialize(attributes = {})\n case attributes[:item]\n ...
ruby
chosen
[ { "from": "system", "value": "Update list of files in gem distribution\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"hamlbars/version\"\n\nGem::Specification.new do |s|\n s.name = \"hamlbars\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Remove tab from description string.\n" }, { "from": "human", "value": "class Iasl < Formula\n desc \"Intel ACPI\tcompiler and decompiler\"\n homepage \"https://github.com/RehabMan/Intel-iasl\"\n head \"https://github.com/RehabMan/Intel-iasl.git\"\n\n devel do\n ...
ruby
chosen
[ { "from": "system", "value": "Test more aspects of Tilt integration.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nrequire \"representative/tilt_integration\"\n\ndescribe Representative::Tilt do\n\n def with_template(file_name, content)\n @template = Tilt.new(file_name, 1) { co...
ruby
chosen
[ { "from": "system", "value": "Remove line auto-assigning a variable to `nil`\n\nThis is one of the most strange behaviours in ruby: if a variable\ndoesn't exist, assigning to itself will return `nil`.\n\nSo a line like:\n\nmdmkdfm = ooops if mdmkdfm.respond_to?(:uiqpior)\n\nSurprisingly will not raise any e...
ruby
chosen
[ { "from": "system", "value": "Update on Image Conversion Attachement\n" }, { "from": "human", "value": "class ProductImage < ApplicationRecord\n has_attached_file :picture, \n styles: { \n thumb: \"64x64#\", \n small: \"100x100#\", \n...
ruby
chosen
[ { "from": "system", "value": "Simplify gemspec (AR has AS 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 'scopy/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "human", "value": "Add divide-and-conquer string splitting algorithm\n" }, { "from": "gpt", "value": "# find cheapest way to split up a string made up of chars '1' - '9'\ndef cheapest_split(str)\n return 0 if str.length < 2\n\n (1...str.length).map do |split_pt|\n left, right = st...
ruby
chosen
[ { "from": "system", "value": "Document the options for date filter\n" }, { "from": "human", "value": "module Mutations\n class DateFilter < InputFilter\n @default_options = {\n :nils => false, # true allows an explicit nil to be valid. Overrides any other options\n }\n\n def...
ruby
chosen
[ { "from": "system", "value": "Test that lists allow dups and preserve order.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe DatastaxRails::Types::DirtyList do\n subject {described_class.new(double(\"record\", :changed_attributes => {}), 'list', [], {})}\n \n before(:each...
ruby
chosen
[ { "from": "system", "value": "Make Time instance easier to read" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Task::Comments::Invited do\n let(:task) { FactoryGirl.create(:task) }\n let(:invite_count) { 2 }\n let(:user) { FactoryGirl.create(:user, first_name: 'Generic', ...
ruby
chosen
[ { "from": "human", "value": "Add simple interface for generating the page.\n" }, { "from": "gpt", "value": "require 'avoid_metreon/event_loader'\nrequire 'avoid_metreon/haml_renderer'\n\nmodule AvoidMetreon\n # Looks up events for the given date and outputs the appropriate HTML page.\n class P...
ruby
chosen
[ { "from": "system", "value": "Order migrations by their timestamp so they are imported in the correct order\n" }, { "from": "human", "value": "namespace :buffalo_pages do\n task install: :environment do\n migrations = Dir[\"#{BuffaloPages.root}/db/migrate/*\"]\n target_dir = \"#{Rails.roo...
ruby
chosen
[ { "from": "system", "value": "Raise an error if no exchange name is specified\n" }, { "from": "human", "value": "require 'bunny'\n\nmodule GovukSeedCrawler\n class Messaging\n def connect(options = {})\n conn = Bunny.new(options)\n conn.start\n\n @channel = conn.create_channel...
ruby
chosen
[ { "from": "system", "value": "Support jobs releasing themselves with a delay\n" }, { "from": "human", "value": "module Quebert\n module Controller\n # Handle interactions between a job and a Beanstalk queue.\n class Beanstalk < Base\n attr_reader :beanstalk_job, :queue, :job\n \...
ruby
chosen
[ { "from": "system", "value": "Work around client side policy violations.\n" }, { "from": "human", "value": "class AmfSocket::PolicyConnection < EM::Connection\n def post_init\n policy = <<-eos\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <cross-domain-policy xmlns:xsi=\"http://ww...
ruby
chosen
[ { "from": "system", "value": "Update or create handle if necessary\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RubyRabbitmqJanus\n module Janus\n module Transactions\n # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>\n\n # This class work with jan...
ruby
chosen
[ { "from": "system", "value": "Fix name in CTCP VERSION\n" }, { "from": "human", "value": "require 'time'\n\nmodule VoiceBot\n module Plugin\n class CoreCTCP\n include Cinch::Plugin\n\n ctcp :version\n ctcp :time\n ctcp :ping\n ctcp :clientinfo\n\n def ctcp_versi...
ruby
chosen
[ { "from": "system", "value": "Use camelize instead of capitalize to support CamelCase model name.\n" }, { "from": "human", "value": "require 'verbs'\n\nmodule Resonance\n module Supports\n module Converter\n private\n\n def classify(str)\n str.capitalize.constantize\n e...
ruby
chosen
[ { "from": "system", "value": "Disable asset runtime errors entirely\n\nThese are not useful for konacha in either run or serve mode." }, { "from": "human", "value": "module Konacha\n class Engine < Rails::Engine\n # Do not mess up the application's namespace.\n # http://api.rubyonrails.or...
ruby
chosen
[ { "from": "system", "value": "Test recording of skipped tests" }, { "from": "human", "value": "require_relative './test_case'\nrequire 'tunit/reporter'\n\nmodule Tunit\n class ReporterTest < TestCase\n def setup\n self.reporter = Reporter.new\n end\n attr_accessor :reporter\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update Raw Photo Processor SHA2\n" }, { "from": "human", "value": "class RawPhotoProcessor < Cask\n version '4.7.2'\n sha256 'ce003b7c78916baaf51b39e26633f9ac069e78b7e5bf8904b966c4c409c06f39'\n\n url 'http://www.raw-photo-processor.com/RPP/RPP_64.zip'\n appcast ...
ruby
chosen
[ { "from": "system", "value": "Use user_return_to rather than just 'return_to'\n\nDevise now requires the scope to be prefixed to the return_to session variable when using it as a location store\n\nFixes #58\n" }, { "from": "human", "value": "require 'cancan'\n\nclass Forem::ApplicationController...
ruby
chosen
[ { "from": "system", "value": "Change generated FGRs to match Jadu XSD. i.e, /\\d{10}00/\n" }, { "from": "human", "value": "require 'json'\n\nclass FeeGroupReference < Struct.new(:postcode)\n def status\n error? ? 500 : 201\n end\n\n def payload\n body.to_json\n end\n\n def body\n e...
ruby
chosen
[ { "from": "system", "value": "Fix warning: circular require considered harmful.\n" }, { "from": "human", "value": "require 'active_support/core_ext/module/deprecation'\nrequire 'active_support/deprecation/instance_delegator'\nrequire 'active_support/deprecation/behaviors'\nrequire 'active_suppor...
ruby
chosen
[ { "from": "system", "value": "Fix issue where project ids were not accepted in the activities API" }, { "from": "human", "value": "class ApiV1::ActivitiesController < ApiV1::APIController\n skip_before_filter :touch_user\n before_filter :get_target, :only => [:index]\n\n def index\n @activ...
ruby
chosen
[ { "from": "system", "value": "Create results and update ratings in a transaction\n" }, { "from": "human", "value": "class ResultService\n def self.create(game, params)\n winner = Player.find(params[:winner_id])\n loser = Player.find(params[:loser_id])\n\n result = game.results.build(\n...
ruby
chosen
[ { "from": "system", "value": "Remove extra line in analytics controller\n" }, { "from": "human", "value": "module V1\n class AnalyticsController < ApplicationController\n SEGMENT_WRITE_KEY = Rails.application.secrets.segment_write_key\n\n def identify\n segment(:identify, %w(user_id ...
ruby
chosen
[ { "from": "system", "value": "Set up to have directory controller work like people controller. HOwever, currently acts_as_site_limited messed up pagination.\n" }, { "from": "human", "value": "class Groups::DirectoryController < ApplicationController\n\n def index\n @groups = Group.paginate(p...
ruby
chosen
[ { "from": "system", "value": "Enable connection pooling for the sneakers workers and reconect after fork. This prevents us creating too many physical TCP connections to the database and hitting a hard limit set on the DB instance.\n" }, { "from": "human", "value": "require 'sneakers/handlers/max...
ruby
chosen
[ { "from": "system", "value": "Update spec selectors due to overlay component changes" }, { "from": "human", "value": "class NewAdhocCardOverlay < CardOverlay\n\n def self.launch(session)\n overlay = session.find('.overlay-container')\n overlay.click_button 'New Task Card'\n new overlay...
ruby
chosen
[ { "from": "human", "value": "Include Specs for APIConnection constants\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'api_connection'\nrequire 'common'\n\ndescribe ZendeskAppsTools::APIConnection do\n let(:subdomain_validation_pattern) { ZendeskAppsTools::APIConnection::SUBDOM...
ruby
chosen
[ { "from": "system", "value": "Use a default that works for most networks\n" }, { "from": "human", "value": "module CCCB::Core::AutoCut\n extend Module::Requirements\n \n def module_load\n default_setting 9999, \"options\", \"auto_cut_length\"\n default_setting 20, \"options\", \"auto_cu...
ruby
chosen
[ { "from": "human", "value": "Create test to attaches controllers\n\nSigned-off-by: Karine Valença <81c9686be0876624a969b7a8b3eb717d09328dbb@gmail.com>\nSigned-off-by: Lucas Andrade <cf3349e1d5414df4c8ea6c38b698f96e945f0bc5@gmail.com>\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclas...
ruby
chosen
[ { "from": "system", "value": "TEST: Check combination of project and tutorial must be unique\n" }, { "from": "human", "value": "require \"test_helper\"\n\nclass TutorialEnrolmentModelTest < ActiveSupport::TestCase\n def test_default_create\n tutorial_enrolment = FactoryGirl.create(:tutorial_...
ruby
chosen
[ { "from": "system", "value": "Move before block to a clearer place.\n\nSigned-off-by: Federico Builes <4398fca13d724d48186a783e21c40201bb8cf2d7@gmail.com>\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../../spec_helper'\nrequire 'matrix'\n\ndescribe \"Matrix.diagonal\" do...
ruby
chosen
[ { "from": "system", "value": "Add description to deployment hook\n\n* Add description variable that will\nhold the stage of the project on deploy.\n" }, { "from": "human", "value": "require 'new_relic/recipes'\nmodule CapistranoDeploy\n module Newrelic\n def self.load_into(configuration)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix rspec load order issue\n" }, { "from": "human", "value": "unless Rails.env.production?\n desc 'Regenerate JSON fixtures for jasmine tests'\n RSpec::Core::RakeTask.new(:backbone_fixtures) do |t|\n options = ['--tag fixture']\n t.rspec_opts = options\n ...
ruby
chosen
[ { "from": "system", "value": "style(hash-syntax): Change to Ruby 1.9+ hash syntax\n" }, { "from": "human", "value": "class Zipcode < ActiveRecord::Base\n belongs_to :county\n belongs_to :state\n\n validates :code, :uniqueness => true, :presence => true\n validates :state_id, :county_id, :cit...
ruby
chosen
[ { "from": "human", "value": "Add test coverage for lazy Subscription pull\n" }, { "from": "gpt", "value": "# Copyright 2015 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License....
ruby
chosen
[ { "from": "system", "value": "Update session test for user login url\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass SessionsControllerTest < ActionDispatch::IntegrationTest\n test \"should get new\" do\n get sessions_new_url\n assert_response :success\n end\n\nend\n" ...
ruby
chosen
[ { "from": "system", "value": ":anchor: Add an accessor for the username\n" }, { "from": "human", "value": "module Discordrb::Webhooks\n # A class that acts as a builder for a webhook message object.\n class Builder\n def initialize(content: '', username: nil, avatar_url: nil, tts: false, fi...
ruby
chosen
[ { "from": "human", "value": "Add coverage on azure sparkle attribute\n" }, { "from": "gpt", "value": "require_relative '../../rspecs'\n\nRSpec.describe SparkleFormation::SparkleAttribute::Azure do\n let(:instance) do\n klass = Class.new(SparkleFormation::SparkleStruct)\n klass.include des...
ruby
chosen
[ { "from": "system", "value": "Fix last line condition for frozen-string-literal\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire_relative '../text_compiler'\n\nmodule Faml\n module FilterCompilers\n class Base\n def need_newline?\n true\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix a bug that caused creating projects to fail\n" }, { "from": "human", "value": "module Lab\n\n module Subcommands\n\n class Repository < Thor\n\n desc \"list\", \"List repositories\"\n def list\n Gitlab.projects.each do |project|\n p...
ruby
chosen
[ { "from": "system", "value": "Use the internal API to get the singleton class\n\nOtherwise redefining the method would break the syntax." }, { "from": "human", "value": "require 'opal/nodes/scope'\n\nmodule Opal\n module Nodes\n class SingletonClassNode < ScopeNode\n handle :sclass\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add a rake task to fix specialist sectors\n\nAs a result of various name changes etc, there are ~3700 specialst sectors in whitehall with nil tags. This rake task reconstructs the correct tags for these using data from the publishing-api.\n" }, { "from": "gpt", "valu...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) - two to one\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/5656b6906de340bd1b0000ac/\n# --- iteration 1 ---\ndef longest(a1, a2)\n (a1 + a2).chars.sort.uniq.join\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Fix cache buster to work with more filenames\n" }, { "from": "human", "value": "require 'digest/sha1'\n\nmodule CacheBuster\n def self.fingerprint(item)\n return 'dev' if ENV['NANOC_ENV'] == 'dev'\n\n content = item.binary? ? File.read(item[:filename]) : item...
ruby
chosen
[ { "from": "system", "value": "Use text parameter in parse method.\n" }, { "from": "human", "value": "module Identifier\n module UUID\n def self.format(uuid)\n uuid.to_s\n end\n\n def self.random\n Random.get\n end\n\n def self.uuid?(text)\n uuid = parse(text).to_s\...
ruby
chosen
[ { "from": "system", "value": "GroupsCreator: Make sure to add result for balance groups only\n" }, { "from": "human", "value": "class Keepr::GroupsCreator\n def initialize(target)\n @target = target\n end\n\n def run\n case @target\n when 'Balance' then\n load 'asset.txt', :targ...
ruby
chosen
[ { "from": "system", "value": "Update example to use new API\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\nrequire 'mailman'\n\nMailman::Application.new do\n\n from('%user%@%domain%') do\n puts \"Got #{message.subje...
ruby
chosen
[ { "from": "system", "value": "Load extensions inside the module\n" }, { "from": "human", "value": "require 'sprockets'\n\nmodule NYNY\n module Assets\n def self.registered app\n assets = Sprockets::Environment.new(NYNY.root) do |env|\n env.append_path File.join('app', 'assets', '...
ruby
chosen
[ { "from": "system", "value": "Fix a incompatible bug to upgrade Padrino 0.12.x to 0.13.x\n" }, { "from": "human", "value": "#encoding: UTF-8\n\nmodule PadrinoGrape\n\n module Extend\n\n def root\n @_root ||= File.expand_path('..', __FILE__)\n end\n\n def dependencies\n @_depe...
ruby
chosen
[ { "from": "system", "value": "Fix migration to clear old unused attributes\n" }, { "from": "human", "value": "class RenameMyMemberAndMyDeputyToMemberAndDeputy < Mongoid::Migration\n def self.up\n PositionApplication.all.each do |a|\n a.member = a.my_member\n a.deputy = a.my_deputy\...
ruby
chosen
[ { "from": "system", "value": "Use TRAVIS_JOB_ID as part of subdomain.\n" }, { "from": "human", "value": "\nrequire 'cloudflare/rspec/connection'\n\nRSpec.describe Cloudflare::DNS, order: :defined, timeout: 30 do\n\tinclude_context Cloudflare::Zone\n\t\n\tlet(:subdomain) {\"dyndns#{Time.now.to_i}...
ruby
chosen
[ { "from": "human", "value": "Add a migration to populate the User role column\n" }, { "from": "gpt", "value": "class PopulateUserRole < ActiveRecord::Migration\n def self.up\n\n # Richard Dale\n u1 = User.find(1)\n u1.role = 'developer'\n u1.save\n\n # Paul Sherwood\n u5 = Use...
ruby
chosen
[ { "from": "system", "value": "Add back in empty migration methods\n\nWe have replaced this migration, but need the empty methods there otherwise we get errors\n" }, { "from": "human", "value": "# This has now been replaced by a newer migration: 20180727140643_remove_change_note_v2\n\n# Remove a ...
ruby
chosen
[ { "from": "system", "value": "Support patch versions of httparty updates\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'animatedgifme/version'\n\nGem::Specification.new do |spec|\n ...
ruby
chosen
[ { "from": "system", "value": "Check if period that includes date is locked\n" }, { "from": "human", "value": "module Skr\n\n class GlPeriod < Skr::Model\n\n is_immutable\n\n def self.current\n attr = { year: Time.now.year, period: Time.now.month }\n GlPerio...
ruby
chosen
[ { "from": "system", "value": "Remove debugging puts from Display.titles spec\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\nrequire File.expand_path(File.dirname(__FILE__) + '../../spec_helper')\nrequire 'uwdc'\n\ndescribe UWDC::Display do\n \n context 'PBO' do\n before(:eac...
ruby
chosen
[ { "from": "system", "value": "Fix sentry exception message to send the error\n" }, { "from": "human", "value": "require \"#{Rails.root}/app/helpers/promos_helper\"\nnamespace :promo do\n # Generates the promo tokens and sends emails\n task :launch_promo => :environment do\n include PromosHe...
ruby
chosen
[ { "from": "system", "value": "Configure helper specs to be generated by default when invoked by Rails.\n\nCloses #115.\n" }, { "from": "human", "value": "require 'generators/rspec'\n\nmodule Rspec\n module Generators\n class HelperGenerator < Base\n include Rails::Generators::ResourceHe...
ruby
chosen
[ { "from": "system", "value": "Fix yet another require issue\n" }, { "from": "human", "value": "module Twingly\n class URL\n class NullURL\n include Comparable\n\n def method_missing(name, *)\n error = NoMethodError.new(\"undefined method `#{name}'\")\n raise error unl...
ruby
chosen
[ { "from": "system", "value": "Fix key for error store\n\nThe issue here was that when a validation error happens using this\nvalidator the error keys that are getting stored was the primary attribute\nwhile the nested attributes are stored on the message.\n\nBut because of the implementation of the nested v...
ruby
chosen
[ { "from": "system", "value": "Use kaminary param_name for pagination\n\nHistory index only allow use :page parameter name.\r\nKaminary has a configuration to custom param_name, and this change use that configuration like does in [Main index](https://github.com/sferik/rails_admin/blob/9abc1be0c1fee006a7a7465...
ruby
chosen
[ { "from": "human", "value": "Add PyCharm 4.5.1 with bundled JDK 1.8\n" }, { "from": "gpt", "value": "cask :v1 => 'pycharm-bundled-jdk' do\n version '4.5.1'\n sha256 '42bcac6de8c1065b482d74a2a8f3dd6b0b2f21c6835f3423c33c4a135a7f0897'\n\n url \"https://download.jetbrains.com/python/pycharm-profe...
ruby
chosen
[ { "from": "system", "value": "Update podspec version number to 0.1.2\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'GGNLocationPicker'\n s.version = '0.1.1'\n s.summary = 'Easily present a view controller for picking a location.'\n s.homepag...
ruby
chosen
[ { "from": "human", "value": "Add spec for the handling of puts in step definitions.\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'cucumber/formatter/spec_helper'\nrequire 'cucumber/formatter/pretty'\n\nmodule Cucumber\n module RbSupport\n describe RbWorld do\n extend ...
ruby
chosen
[ { "from": "system", "value": "Document update action no longer requires an ID parameter\n\nAlso included more informational messages after executing.\n" }, { "from": "human", "value": "class Api::V1::DocumentsController < ApplicationController\n # PATCH/PUT /documents/1\n # PATCH/PUT /document...
ruby
chosen
[ { "from": "system", "value": "Handle the empty array, hash, YAML cases\n" }, { "from": "human", "value": "class Article < ActiveRecord::Base\n\tbelongs_to :user\n\tvalidates :link, :quote, presence: true\n\n\tdef tags_array\n\t\tif self.tags.kind_of?(String)\n\t\t\tif self.tags.scan(/\\-\\-\\-\\...
ruby
chosen
[ { "from": "system", "value": "Fix bundler dependency for travis\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'guard/pow/version'\n\nGem::Specification.new do |s|\n s.name ...
ruby
chosen
[ { "from": "system", "value": "Remove authenticate user from timeline controller\n" }, { "from": "human", "value": "module Schools\n class TimelineController < ApplicationController\n load_and_authorize_resource :school\n def show\n @academic_year = if params[:academic_year]\n ...
ruby
chosen
[ { "from": "system", "value": "Use the staged script name for build_job\n" }, { "from": "human", "value": "class OscJob < ActiveRecord::Base\n has_many :osc_job_jobs, dependent: :destroy\n has_machete_workflow_of :osc_job_jobs\n\n\n # Name that defines the template/target dirs\n def staging_t...
ruby
chosen
[ { "from": "system", "value": "Add explicit dependency on omniauth-oauth2\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'omniauth/phabricator/version'\n\nGem::Specification.new do |s...
ruby
chosen
[ { "from": "human", "value": "Add Helper for deliver_interval options (?unused)\n" }, { "from": "gpt", "value": "module Renalware\n module PDAssessmentsHelper\n\n def delivery_interval_options\n PD::Assessment::VALID_RANGES.delivery_intervals.map do |interval|\n [pluralize(interva...
ruby
chosen
[ { "from": "system", "value": "Create first meaningful sessions test\n\nCreate test to ensure that 'sessions#new' renders the new sessions template\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe SessionsController, :type => :controller do\n describe \"true\" do\n ...
ruby
chosen