conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove description method from DeclarationOrder\n\nThe `description` method is being deprecated.\n\nChange-Id: I27efec67970d21e98a1fe3e8db95d6ff4c23090a\nReviewed-on: http://gerrit.causes.com/36726\nTested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com>\nRevie...
ruby
chosen
[ { "from": "system", "value": "Add method to write source file.\n" }, { "from": "human", "value": "module RamlPoliglota\n module Code\n module Generator\n\n class CodeGenerator\n\n include Support\n\n attr_accessor :namespace, :output_dir\n\n def self.create(language...
ruby
chosen
[ { "from": "system", "value": "Use `@payment` instead of `payment`\n" }, { "from": "human", "value": "class AdditionalPaymentPaymentController < ApplicationController\n\n before_action :get_payment\n\n def get_payment\n\n Rails.logger.info(\"My params are: #{params.inspect}\")\n\n additio...
ruby
chosen
[ { "from": "system", "value": "Fix logic error when displaying Cockpit button\n\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1447100\n" }, { "from": "human", "value": "class ApplicationHelper::Button::CockpitConsole < ApplicationHelper::Button::Basic\n needs :@record\n\n def disabled?\n reco...
ruby
chosen
[ { "from": "system", "value": "Remove version constraints for dependencies\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ops_care/version'\n\nGem::Specification.new do |spec|\n spe...
ruby
chosen
[ { "from": "system", "value": "Use localhost to do SMTP forward delivery in mailcatcher\n" }, { "from": "human", "value": "class MailCatcher::DeliveryService\n attr_reader :message\n\n mattr_accessor :address\n mattr_accessor :port\n mattr_accessor :domain\n mattr_accessor :user_name\n matt...
ruby
chosen
[ { "from": "system", "value": "Fix Generator's compatibility with Rails 3.x\n\n(Fixes #185)\n" }, { "from": "human", "value": "require 'rails/generators/base'\n\nmodule PgSearch\n module Migration\n class Generator < Rails::Generators::Base\n hide!\n\n def self.inherited(subclass)\n...
ruby
chosen
[ { "from": "system", "value": "Format value as output value such as booleans converted to 1 and 0\n" }, { "from": "human", "value": "module X\n module Editable\n module Rails\n module ViewHelpers \n def editable(object, method, options = {})\n object = object.last if o...
ruby
chosen
[ { "from": "human", "value": "Migrate for add the fourth box.\n\nMigrate for add the fourth box to existing enviroments and profiles.\n\nSigned-off-by: Thiago Ribeiro <25630c3dd4509f5915a846461794b51273be2039@hotmail.com>\n" }, { "from": "gpt", "value": "class AddBlockToEnvironmentAndProfile < Ac...
ruby
chosen
[ { "from": "system", "value": "[FIX] Upgrade Amplitude version to 4.0.4 in podspec\n" }, { "from": "human", "value": "require \"json\"\n\njson = File.read(File.join(__dir__, \"package.json\"))\npackage = JSON.parse(json).deep_symbolize_keys\n\nPod::Spec.new do |s|\n s.name = package[:name]\n s....
ruby
chosen
[ { "from": "system", "value": "Fix test helper: app id must be an integer\n" }, { "from": "human", "value": "require \"securerandom\"\nrequire \"hashie/mash\"\n\nmodule Garage\n module Test\n module AuthenticationHelper\n def stub_access_token_request(attributes = {})\n Hashie::Ma...
ruby
chosen
[ { "from": "system", "value": "Fix warning for overly strict dependencies\n\nModify gemspec to loosen restrictions on rspec and httparty versions.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib...
ruby
chosen
[ { "from": "system", "value": "Fix typo in test URL\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'rails_helper'\n\nRSpec.describe 'V1::WorkshopProjectClick', type: :request do\n describe 'GET /v1/projects/:id/redirect/:type_of' do\n let(:project) { create(:works...
ruby
chosen
[ { "from": "system", "value": "Fix for ^M for executable files\n" }, { "from": "human", "value": "\nmodule Docman\n class ExecuteScriptCmd < Docman::Command\n\n register_command :script\n\n\n def validate_command\n raise Docman::CommandValidationError.new(\"Please provide 'execution_d...
ruby
chosen
[ { "from": "system", "value": ":bug: Expand Array object to string joined with space\n" }, { "from": "human", "value": "require \"magellan/gcs/proxy\"\n\nmodule Magellan\n module Gcs\n module Proxy\n module ExpandVariable\n\n class InvalidReferenceError < StandardError\n en...
ruby
chosen
[ { "from": "system", "value": "Add trait to create GeolocationHint with attitude\n\nErr, I mean altitude.\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :mdui_geolocation_hint, class: 'MDUI::GeolocationHint' do\n uri { \"geo:#{Faker::Number.number(3)},#{Faker::Number.numbe...
ruby
chosen
[ { "from": "system", "value": "Fix Pauper including custom cards for some reason\n" }, { "from": "human", "value": "class FormatPauper < FormatVintage\n def format_pretty_name\n \"Pauper\"\n end\n\n def in_format?(card)\n card.printings.each do |printing|\n next if @time and printin...
ruby
chosen
[ { "from": "system", "value": "Modify logic of spec test files.\n" }, { "from": "human", "value": "require_relative '../spec_helper.rb'\n\ndescribe service('zabbix_agentd') do\n it { should be_enabled }\nend\n\ndescribe port(10_050) do\n it { should be_listening.with('tcp') }\nend\n\ndescribe '...
ruby
chosen
[ { "from": "system", "value": "Fix specs for label controller\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe LabelController, type: :controller do\n\n describe \"GET #new\" do\n it \"returns http success\" do\n get :new\n expect(response).to have_http_st...
ruby
chosen
[ { "from": "human", "value": "Add shared examples for api interface.\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\nshared_examples_for 'api interface' do\n\n it { should respond_to :endpoint }\n\n it { should respond_to :site }\n\n it { should respond_to :user }\n\n it { should respon...
ruby
chosen
[ { "from": "system", "value": "Add the event helper to tag attributes.\n" }, { "from": "human", "value": "module Hamlbars\n module CompilerExtension\n end\nend\n\nmodule Haml\n module Compiler\n class << self\n # Overload build_attributes in Haml::Compiler to allow\n # for the cre...
ruby
chosen
[ { "from": "system", "value": "Remove raise error in connection_pool method for Base class.\n" }, { "from": "human", "value": "module Motel\n module Property\n module MultiTenant\n extend ActiveSupport::Concern\n\n included do\n\n mattr_accessor :motel, instance_writer: false...
ruby
chosen
[ { "from": "system", "value": "Add HighLine gem to the dependencies.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'driveregator/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "human", "value": "Add skipped tests for WarnLib\n" }, { "from": "gpt", "value": "require 'gir_ffi_test_helper'\n\nGirFFI.setup :WarnLib\n\ndescribe WarnLib do\n describe 'WarnLib::Whatever' do\n it 'has a working method #do_boo' do\n skip 'Needs testing'\n end\n it 'has...
ruby
chosen
[ { "from": "system", "value": "gemspec: Fix incorrect dependency version spec, bump to 0.0.4.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n\ts.name = 'ruby-eval-in'\n\ts.version = '0.0.3'\n\ts.required_ruby_version = '>= 2.0.0'\n\ts.summary = 'ruby-eval-in - A Ruby interface ...
ruby
chosen
[ { "from": "system", "value": "Add missing magic comment (linting)\n" }, { "from": "human", "value": "require \"zeitwerk\"\n\nlib = File.expand_path(\"..\", __dir__)\n\nloader = Zeitwerk::Loader.new\nloader.tag = \"action_cable\"\n\nloader.push_dir(lib)\n\nloader.ignore(\n __FILE__,\n \"#{lib}/...
ruby
chosen
[ { "from": "system", "value": "Fix serializer to properly serialize relationship for castings\n" }, { "from": "human", "value": "class FullMangaSerializer < MangaSerializer\n embed :ids, include: true\n\n attributes :cover_image,\n :cover_image_top_offset,\n :featured_ca...
ruby
chosen
[ { "from": "system", "value": "Fix tag reference in podspec\n\nThanks to @Keithbsmiley for the tip to keep it in sync with the\npodspec version.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"SharedInstanceGCD\"\n s.version = \"1.0.1\"\n s.summary = \"A ...
ruby
chosen
[ { "from": "system", "value": "Improve specs for class 2 exercise 6\n" }, { "from": "human", "value": "RSpec.describe 'Class 2 Exercise 6' do\n let(:exercise6) do\n load File.expand_path('../../../lib/class2/exercise6.rb', __FILE__)\n end\n\n before do\n allow_any_instance_of(Kernel).to ...
ruby
chosen
[ { "from": "system", "value": "Use a shared example to DRY up specs." }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'serve_resource', type: :controller do\n context \"when a resource class is not explicitly specified\" do\n class UsersController < ApplicationController\n ...
ruby
chosen
[ { "from": "system", "value": "Update spec to check for all search providers listed in domains.yml, not just google\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe FirstClickFree do\n describe \"#permitted_domains\" do\n subject { described_class.permitted_domains }\n ...
ruby
chosen
[ { "from": "system", "value": "Support sprockets up to 3.0\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'sprockets_illusionist/version'\n\nGem::Specification.new do |spec|\n spec.n...
ruby
chosen
[ { "from": "human", "value": "Add routing spec for targets\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe TargetsController do\n describe \"routing\" do\n\n it \"#index\" do\n expect(get(\"/targets\")).to route_to(\"targets#index\")\n end\n\n it \"#show\" do\n ...
ruby
chosen
[ { "from": "human", "value": "Add rspec-system test for mysql_user.\n" }, { "from": "gpt", "value": "require 'spec_helper_system'\n\ndescribe 'mysql_user' do\n\n describe 'setup' do\n it 'should work with no errors' do\n pp = <<-EOS\n class { 'mysql::server': }\n EOS\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add index on topic_links post_id. Remove a redundant index.\n" }, { "from": "gpt", "value": "class AddAndRemoveIndexesOnTopicLinks < ActiveRecord::Migration\n def up\n # Index (topic_id) is a subset of (topic_id, post_id, url)\n remove_index :topic_links, :top...
ruby
chosen
[ { "from": "human", "value": "Add root_account_id to Lti::LineItems table\n\ncloses PLAT-5481\nflag=none\n\nTest plan\n- n/a\n\nChange-Id: I0be294ede5e44d91c8d2edc29728df115fa04ced\nReviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/229399\nTested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a17...
ruby
chosen
[ { "from": "system", "value": "Use a monospace font to avoid kerning issues.\n" }, { "from": "human", "value": "module PoltergeistStyleOverrides\n module StyleInjector\n def inject_special_test_code\n (<<-'SNIPPET'\n <style>\n * { transition: none !important; }\n html....
ruby
chosen
[ { "from": "system", "value": "Add spec for connection_established method in api requester spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe CodeclimateCi::ApiRequester do\n let(:token) { 'token' }\n let(:repo_id) { 'repo-id' }\n let(:api_requester) { CodeclimateCi::Api...
ruby
chosen
[ { "from": "human", "value": "Add spec for Configuration class\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nmodule CodeclimateCi\n describe Configuration do\n let(:options) do\n {\n 'codeclimate_api_token' => '12345678',\n 'repo_id' => '124356',\n 'branc...
ruby
chosen
[ { "from": "system", "value": "Check if gem name has valid format\n" }, { "from": "human", "value": "require 'reform/rails'\n\nclass ExistsInRubygemsDotOrgValidator < ActiveModel::EachValidator\n def validate_each(record, attribute, value)\n record.errors[attribute] << \"is not the name of a ...
ruby
chosen
[ { "from": "system", "value": "Add trigger to ChoiceUser model to auto-create SurveyUser records\n" }, { "from": "human", "value": "class ChoiceUser < ActiveRecord::Base\n belongs_to :user\n belongs_to :choice\nend\n" }, { "from": "gpt", "value": "class ChoiceUser < ActiveRecord::Ba...
ruby
chosen
[ { "from": "system", "value": "Add ruby shebang to test and chmod +x\n" }, { "from": "human", "value": "utf = IO.read(\"index.html\")\n\nem = utf.scan(/<em[^>]*>&#([^;]*);<\\/em>/)\ndd = utf.scan(/<dd>&#38;#([^;]*);<\\/dd>/)\n\nem = em.drop(3).map{|i| i[0].to_i}\ndd = dd.drop(2).map{|i| i[0].to_i...
ruby
chosen
[ { "from": "system", "value": "Make omniauth_callbacks redirect after sign_in\n" }, { "from": "human", "value": "module Rhinoart\n class OmniauthCallbacksController < Devise::OmniauthCallbacksController\n\n def google_oauth2\n # binding.pry\n @user = Rhinoart::User.from_omniauth(req...
ruby
chosen
[ { "from": "system", "value": "Fix uber service nil bug\n" }, { "from": "human", "value": "class UberApiService\n\n attr_accessor :token\n\n BASE_URL = \"https://api.uber.com/v1.2\"\n\n def initialize(token)\n @token = token\n end\n\n # Returns a TFF url based on passed params\n def esti...
ruby
chosen
[ { "from": "system", "value": "Use a .com domain that belongs to us for localhost resolution.\n\nEnough of dealing with funny domains like smackaho.st and lvh.me\nrun by third parties.\n(cherry picked from commit 9f83156bc7bf55351e24bf902fe28d5baa195266)\n" }, { "from": "human", "value": "Given /...
ruby
chosen
[ { "from": "system", "value": "Use a .com domain that belongs to us for localhost resolution.\n\nEnough of dealing with funny domains like smackaho.st and lvh.me\nrun by third parties.\n(cherry picked from commit 9f83156bc7bf55351e24bf902fe28d5baa195266)\n\nConflicts:\n\tfeatures/step_definitions/setup_steps...
ruby
chosen
[ { "from": "system", "value": "test: BUMP terraform spec to `v0.11`\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe command('hash kubectl') do\n its(:exit_status) { should eq 0 }\nend\n\ndescribe command('node --version') do\n its(:exit_status) { should eq 0 }\n its(...
ruby
chosen
[ { "from": "system", "value": "Add todo regarding filthy tree.js\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Version of your assets, change this if you want to expire all your assets.\nRails.application.config.assets.version = '1.0'\n\n# Add...
ruby
chosen
[ { "from": "system", "value": "Drop debug statement in spec\n" }, { "from": "human", "value": "require_relative './../spec_helper'\nrequire_relative './../../examples/library_with_fines'\n\ndescribe LibraryWithFines do\n\n let(:xml) { File.read(xml_for('library_with_fines')) }\n let(:library) {...
ruby
chosen
[ { "from": "system", "value": "Fix rspec for reports generation job\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe ReportsGenerationJob, type: :job do\n include ActiveJob::TestHelper\n\n SpreeMarketing::CONFIG ||= { Rails.env => {} }\n\n class GibbonServiceTest; end...
ruby
chosen
[ { "from": "system", "value": "Cut invalid option `:unique` passed to `add_column`\n" }, { "from": "human", "value": "class AddWebhookToOrganizations < ActiveRecord::Migration\n def change\n add_column :organizations, :webhook_id, :string, unique: true\n add_column :organizations, :is_webh...
ruby
chosen
[ { "from": "system", "value": "Add strong params for spots\n" }, { "from": "human", "value": "class SpotsController < ApplicationController\n before_filter :load_spot, only: [:show]\n def index\n \t@spots = Spot.all\n end\n\n def show\n end\n\n def new\n \t@spot = Spot.new\n end\n\n pri...
ruby
chosen
[ { "from": "system", "value": "Allow multiple logging topics to be managed in 1 rule." }, { "from": "human", "value": "require 'puppet/provider/mikrotik_api'\n\nPuppet::Type.type(:mikrotik_logging_rule).provide(:mikrotik_api, :parent => Puppet::Provider::Mikrotik_Api) do\n confine :feature => :m...
ruby
chosen
[ { "from": "system", "value": "Change test script to follow Serverspec V2\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe command('which man') do\n it { should return_exit_status 0 }\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe command(...
ruby
chosen
[ { "from": "system", "value": "Allow use of more versions of generators\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'seo_meta'\n s.authors = ['Philip Arndt']\n s.homepage = 'http://phil...
ruby
chosen
[ { "from": "system", "value": "Fix a broken spec, oops!\n" }, { "from": "human", "value": "require 'spec_helper'\n\nfeature \"User account\" do\n scenario \"User creates new account\" do\n @email = \"bishop@weylandindustries.com\"\n visit new_user_registration_path\n\n within \"#new_use...
ruby
chosen
[ { "from": "system", "value": "Fix model tests for alternate names.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe AlternateName do\n before (:each) do\n @an = FactoryGirl.create(:alternate_tomato)\n end\n\n it 'should save a basic alternate name' do\n @an.save.shou...
ruby
chosen
[ { "from": "system", "value": "Make those patch requests work again.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_forgery with: :...
ruby
chosen
[ { "from": "system", "value": "Refactor current_format to use a Struct\n\nThis commit changes `current_format` to be a hash of Structs.\n\n/cc @h-lame\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # Fo...
ruby
chosen
[ { "from": "system", "value": "Fix typo in before action\n" }, { "from": "human", "value": "class RestaurantsController < ApplicationController\n before_action :set_post, except: %i(index create)\n\n def index\n @restaurants = policy_scope(Restaurant)\n render json: @restaurants\n end \n...
ruby
chosen
[ { "from": "system", "value": "Move publishing to private methods.\n\nThey make visual clutter and I'd love to see them somewhere else\nso aspects maybe?\n" }, { "from": "human", "value": "require 'citrus/core'\n\nmodule Citrus\n module Core\n class ExecuteBuildService\n include Publishe...
ruby
chosen
[ { "from": "system", "value": "Test wants this built at instantiation" }, { "from": "human", "value": "module MessageQueue\n class Listener\n def initialize(topic:, channel:, processor: nil, consumer: nil)\n @topic = topic\n @channel = channel\n @processor = processor || ...
ruby
chosen
[ { "from": "system", "value": "Fix up the asset disposition service to limit to a specific organization and set the default fiscal year to the current planning year.\n" }, { "from": "human", "value": "#------------------------------------------------------------------------------\n#\n# AssetServi...
ruby
chosen
[ { "from": "system", "value": "Update TextExpander to version 5.0\n\nThis commit updates the logic for determining which version of\nTextExpander to install. Version 5.0 is only supported on Yosemite\nand upwards, so I've modified the existing 4.3.6 case to be for\nLion to Mavericks only, and added a new cas...
ruby
chosen
[ { "from": "system", "value": "Add golang to the gem description\n" }, { "from": "human", "value": "require File.expand_path('../lib/starscope/version.rb', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'starscope'\n gem.version = StarScope::VERSION\n gem.summary ...
ruby
chosen
[ { "from": "system", "value": "Remove resources from the podspec.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"FSImageViewer\"\n s.version = \"3.2\"\n s.summary = \"FSImageViewer is a photo viewer for iOS.\"\n s.homepage = \"https://github.com/x2o...
ruby
chosen
[ { "from": "system", "value": "Add 16.04 Xenial to the allowed list" }, { "from": "human", "value": "if not %w(jessie squeeze wheezy sid lucid precise saucy trusty utopic wily).include? node['postgresql']['pgdg']['release_apt_codename']\n raise \"Not supported release by PGDG apt repository\"\ne...
ruby
chosen
[ { "from": "system", "value": "Use attr_accessible for any rails 3 builds\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n if Rails.version[0..2] == '3.2'\n attr_accessible :email, :password\n end\n\n def self.do_custom_events\n Librato.group 'custom.model' do |g|\n ...
ruby
chosen
[ { "from": "system", "value": "Send error messages to STDERR\n" }, { "from": "human", "value": "class Hotspots\n module Exit #:nodoc: all\n class Error\n attr_reader :code, :message\n\n def initialize(options)\n @message = options[:message]\n @code = options[:code]\...
ruby
chosen
[ { "from": "human", "value": "Add railtie to load locales automatically\n\nBased on https://github.com/svenfuchs/rails-i18n/blob/master/lib/rails_i18n/railtie.rb\n" }, { "from": "gpt", "value": "require 'rails'\nmodule KaminariI18n\n class Engine < ::Rails::Engine\n end\n \n class Railtie < :...
ruby
chosen
[ { "from": "system", "value": "Fix check for production hstore migration.\n" }, { "from": "human", "value": "class SetupHstore < ActiveRecord::Migration\n def self.up\n # Creating hstore extension in a given database requires\n # superuser permission, which we will not have on production....
ruby
chosen
[ { "from": "system", "value": "Fix create role rake task deprecation warrning.\n" }, { "from": "human", "value": "namespace :base_app do\n\n namespace :admin do\n\n desc \"Creates role.\"\n task :create_role, :role, :needs => :environment do |t, args|\n\n unless args[:role]\n p...
ruby
chosen
[ { "from": "human", "value": "Write a spec for CVE-2010-1330\n" }, { "from": "gpt", "value": "require_relative '../spec_helper'\n\ndescribe \"String#gsub\" do\n\n it \"resists CVE-2010-1330 by raising an exception on invalid UTF-8 bytes\" do\n # This original vulnerability talked about KCODE,...
ruby
chosen
[ { "from": "system", "value": "Add category_names to allow shared create_races across competitions. Add source_events? method to scope results by source events or not.\n" }, { "from": "human", "value": "module Concerns\n module Competition\n module Categories\n # Array of ids (integers)\...
ruby
chosen
[ { "from": "system", "value": "Remove `platform` attributes in lieu of `deployment_target`\n\nFixes problem that causes pod install to error out with:\n\nReference:\n\nhttps://guides.cocoapods.org/syntax/podspec.html#platform\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name ...
ruby
chosen
[ { "from": "human", "value": "Archive all Published Worldwide Priorities\n\nThis commit adds a data migration to archive all published Worldwide Priorities.\n" }, { "from": "gpt", "value": "reason = \"This information has been archived. See [what the UK government is doing around the world](https...
ruby
chosen
[ { "from": "human", "value": "Add migration to change reference in visualizations table from query to dataset\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nclass ChangeQueryIdInGdataVisualizations < ActiveRecord::Migration[5.2]\n def change\n add_reference :gdata_visualiza...
ruby
chosen
[ { "from": "system", "value": "Add explicit iOS and OS X deployment targets\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'TransitionKit'\n s.version = '1.1.1'\n s.license = 'Apache2'\n s.summary = 'A block-based State Machine API for Objective-C.'\n s.homepage = ...
ruby
chosen
[ { "from": "system", "value": "Change the notice message for missing birthday field\n" }, { "from": "human", "value": "class Contact < ActiveRecord::Base\n belongs_to :user\n\n def self.birthdays_today\n # postgres version: \n where(\"extract(day FROM birthday) = ? AND extract(month FROM ...
ruby
chosen
[ { "from": "system", "value": "Fix url path for default image.\n" }, { "from": "human", "value": "class Project < ActiveRecord::Base\n validates_presence_of :name,\n :description,\n :purpose,\n :technology,\n ...
ruby
chosen
[ { "from": "system", "value": "Change set_primary_key to self.primary_key= per deprecation warning\n" }, { "from": "human", "value": "class Request < ActiveRecord::Base\n #eval(\"attr_accessible #{column_names.map { |cn| cn.to_sym }.to_s.gsub(/\\[|\\]/,\"\")}\")\n set_primary_key \"service_requ...
ruby
chosen
[ { "from": "system", "value": "Fix typo in active? method.\n" }, { "from": "human", "value": "class Request < ActiveRecord::Base\n before_create :defaultly_unfulfilled\n\n has_many :messages\n has_many :transactions\n\n belongs_to :requester, class_name: 'User'\n belongs_to :responder, class...
ruby
chosen
[ { "from": "system", "value": "Remove existence check for deleting files\n" }, { "from": "human", "value": "module Algorithmia\n class DataFile < DataObject\n\n def initialize(client, data_uri)\n super(client, data_uri)\n validate_data_uri\n end\n\n def validate_data_uri\n ...
ruby
chosen
[ { "from": "human", "value": "Add default spec acceptance helper\n" }, { "from": "gpt", "value": "require 'beaker-rspec'\n\nhosts.each do |host|\n # Install Puppet\n on host, install_puppet\nend\n\nRSpec.configure do |c|\n module_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))...
ruby
chosen
[ { "from": "system", "value": "Add parsed json to response\n" }, { "from": "human", "value": "require 'rest_client'\nrequire 'values'\n\nmodule CrystalApi\n class StoreEndpoint\n attr_reader :base_url, :token\n\n class Response < Value.new(:parsed, :raw)\n def to_s\n \"<Crystal...
ruby
chosen
[ { "from": "system", "value": "Add Search Into Sections For API Items\n" }, { "from": "human", "value": "class Api::ItemsController < ApiController\n def index\n item_type_id = params[:item_type_id]\n number = params[:number]\n agenda_id = params[:agenda_id]\n synopsis = params[:syno...
ruby
chosen
[ { "from": "system", "value": "Add project_id to Groonga table via pgroonga index\n" }, { "from": "human", "value": "class AddIndexToSearcherRecords < ActiveRecord::Migration\n def change\n reversible do |d|\n case\n when Redmine::Database.postgresql?\n opclass = \"pgroonga.v...
ruby
chosen
[ { "from": "system", "value": "Use memoiser instead of private instance\n" }, { "from": "human", "value": "require 'faraday'\nrequire 'faraday_middleware'\nrequire 'nark/emitter'\n\nmodule Nark\n class EventGatewayEmitter < Nark::Emitter\n def initialize(options = {})\n @url = options.fe...
ruby
chosen
[ { "from": "system", "value": "Apply mask to clipping mask before clipping\n" }, { "from": "human", "value": "class PSD\n class Renderer\n class ClippingMask\n attr_reader :canvas, :mask\n\n def initialize(canvas)\n @canvas = canvas\n @node = @canvas.node\n \n ...
ruby
chosen
[ { "from": "system", "value": "Index options need to be accessible for SphinxQL middleware.\n" }, { "from": "human", "value": "module ThinkingSphinx::Core::Index\n extend ActiveSupport::Concern\n\n included do\n attr_reader :reference, :offset\n attr_writer :definition_block\n end\n\n d...
ruby
chosen
[ { "from": "system", "value": "Fix renaming call to Artice.update_all_caches\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"#{Rails.root}/lib/course_revision_updater\"\n\n#= Pulls in new revisions for a single course and updates the corresponding records\nclass Upda...
ruby
chosen
[ { "from": "system", "value": "Use older version of fog to prevent json gem version collisions.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: rackspacecloud\n# Attributes:: default \n#\n# Copyright:: 2013, Rackspace Hosting <ryan.walker@rackspace.com>\n#\n# Licensed under the Apache Lic...
ruby
chosen
[ { "from": "system", "value": "Stop warnings when running features\n" }, { "from": "human", "value": "Given /^a passing scenario \"(.+)\" with:$/ do |name, body|\n @test_case = SteppingStone::GherkinCompiler.new.compile(\"Feature: test\\nScenario: #{name}\\n\" << body)[0]\n @sut = SteppingStone...
ruby
chosen
[ { "from": "system", "value": "Create fake directory for unit file.\n" }, { "from": "human", "value": "module Runner\n class Rails < Base\n def process_options\n super(Nginx::Builder::RailsHttp, Nginx::Builder::RailsHttps)\n end\n\n def protocol_factory(options)\n protocol_cla...
ruby
chosen
[ { "from": "human", "value": "Add list repository. The repository is an interface to the database and handles mapping entities (pure Ruby objects) to data models (Mongoid documents)\n" }, { "from": "gpt", "value": "module ListRepository\n extend self\n\n def find_by_date(date)\n ListData.whe...
ruby
chosen
[ { "from": "human", "value": "Add missing geckoboard request spec\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nRSpec.describe 'Widgets', type: :request, allow_forgery_protection: true do\n describe 'GET #claim_creation_source' do\n context 'with format html' do\n bef...
ruby
chosen
[ { "from": "system", "value": "Use consistent naming for release announcements in controller code\n" }, { "from": "human", "value": "class Admin::StatisticalReleaseAnnouncementsController < Admin::BaseController\n before_filter :find_release_announcement, only: [:edit, :update, :destroy]\n\n de...
ruby
chosen
[ { "from": "system", "value": "Remove inherited resources from regions-controller\n" }, { "from": "human", "value": "class RegionsController < ApplicationController\n# inherit_resources\n\n layout 'home'\n\n has_scope :depth, :default => 1, :only => :index\n\n # If no param is set, default to ...
ruby
chosen
[ { "from": "human", "value": "Add lesson plan item model\n" }, { "from": "gpt", "value": "class Course::LessonPlanItem < ActiveRecord::Base\n actable\n stampable\n validates :base_exp, numericality: { only_integer: true }\n validates :time_bonus_exp, numericality: { only_integer: true }\n va...
ruby
chosen
[ { "from": "system", "value": "Remove col3 from dashboard widgets\n" }, { "from": "human", "value": "module MiqWidgetSet::SetData\n extend ActiveSupport::Concern\n\n SET_DATA_COLS = %i[col1 col2 col3].freeze\n\n included do\n validate :set_data do\n errors.add(:set_data, \"One widget m...
ruby
chosen