conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Delete all matching devices in reset_device\n" }, { "from": "human", "value": "module SimCtl\n class Command\n module Create\n COMMAND = %w[xcrun simctl create]\n\n # Creates a device\n #\n # @param name [String] name of the new device\n ...
ruby
chosen
[ { "from": "system", "value": "Update podspec for going live\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Aperitif'\n s.version = '0.1.0'\n s.summary = 'Check Installr for a new version of your app and prompt users to update.'\n s.homepage ...
ruby
chosen
[ { "from": "system", "value": "Delete the Japanese font files from the tmp directory when doing a delete assets sweep\n" }, { "from": "human", "value": "require_relative \"../resume/output\"\n\nnamespace :resume do\n desc \"Delete assets downloaded into the local tmpdir\"\n task :delete_assets ...
ruby
chosen
[ { "from": "system", "value": "Add zap procedures for MacDown\n" }, { "from": "human", "value": "cask :v1 => 'macdown' do\n version '0.3'\n sha256 '3d0b49792525830b44dc912bc4a0d3801ce2d4f6453a1835c681d379b3c63128'\n\n url \"http://macdown.uranusjr.com/download/v#{version}/\"\n appcast 'http:/...
ruby
chosen
[ { "from": "system", "value": "Build a universal binary on Leopard\n\nFixes #69\n" }, { "from": "human", "value": "require 'formula'\n\nclass Xdebug <Formula\n url 'http://xdebug.org/files/xdebug-2.0.5.tgz'\n homepage 'http://xdebug.org'\n md5 '2d87dab7b6c499a80f0961af602d030c'\n\n def instal...
ruby
chosen
[ { "from": "system", "value": "Update min iOS version to 10.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"IDPDesign\"\n s.version = \"0.1.0\"\n s.summary = \"Placeholder\"\n s.description = <<-DESC\n Placeholder\n DESC...
ruby
chosen
[ { "from": "system", "value": "Add 'preproyecto' status to Proyecto's status enum\n" }, { "from": "human", "value": "class Project < ActiveRecord::Base\n\tacts_as_taggable_on :tags\n\tenum status: [:en_progreso, :terminado, :cancelado]\n\n\thas_and_belongs_to_many :users\n\thas_many :stages\n\tha...
ruby
chosen
[ { "from": "system", "value": "Add asmith as admin on HostedIn.NZ machines\n" }, { "from": "human", "value": "name \"hostedinnz\"\ndescription \"Role applied to all servers at HostedIn.NZ\"\n\ndefault_attributes(\n :hosted_by => \"HostedIn.NZ\",\n :location => \"Wellington, New Zealand\",\n :n...
ruby
chosen
[ { "from": "system", "value": "Simplify the audits controller a bit more.\n" }, { "from": "human", "value": "class AuditsController < ApplicationController\n # GET /audits\n # GET /audits.json\n def index\n if params[:start_date] and params[:end_date]\n @start_date = parse_date params[...
ruby
chosen
[ { "from": "system", "value": "Podspec: Change email, homepage and version number\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"UIView-I7ShakeAnimation\"\n s.version = \"0.0.1\"\n s.summary = \"very easy way to shake a UIView.\"\n s.homepage = \"ww...
ruby
chosen
[ { "from": "system", "value": "Fix link to create new from home view.\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n before_action :set_situation, only: [:show]\n\n require 'Situation'\n\n # GET /index\n def index\n @situation = Situation.find(params[:id]...
ruby
chosen
[ { "from": "system", "value": "Add spec with an array\n" }, { "from": "human", "value": "require 'app'\n\nRSpec.describe Honeypot::Log do\n describe '#create_collection' do\n it 'works when the collection exists' do\n expect do\n described_class.create_collection\n end.to cha...
ruby
chosen
[ { "from": "system", "value": "Add more specs for option parser.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Hangman::Player::Options do\n subject { Hangman::Player::Options.new(opts) }\n\n describe \"default options\" do\n let(:opts) { ['lorem'] }\n\n it { assert...
ruby
chosen
[ { "from": "system", "value": "Add helper method to parse markdown files\n\nAdds a helper method `parse_markdown` to BlogPosts that reads markdown\nfiles and creates html rederable output (that will not be escaped by\nrails automatically)\n\nIncludes stub methods for getting render options, and getting markd...
ruby
chosen
[ { "from": "human", "value": "Add unit tests for stamp_changelog action\n" }, { "from": "gpt", "value": "describe Fastlane::Actions::StampChangelogAction do\n describe 'Stamp CHANGELOG.md action' do\n\n \tlet (:changelog_mock_path) {'./fastlane-plugin-changelog/spec/fixtures/CHANGELOG_MOCK.md'}...
ruby
chosen
[ { "from": "system", "value": "Fix checking for misisng attribute on git tags\n" }, { "from": "human", "value": "module RepoTags\n def download_tags(token = nil)\n existing_tag_names = github_tags.pluck(:name)\n github_client(token).refs(full_name, 'tags').each do |tag|\n next unless ...
ruby
chosen
[ { "from": "system", "value": "Add confirmation alert when marking stage complete\n" }, { "from": "human", "value": "module Cms::UsersHelper\n def format_date(date)\n if date.nil?\n '--'\n else\n date.strftime('%b %d, %Y')\n end\n end\n\n def complete_sales_stage_link(stage)...
ruby
chosen
[ { "from": "system", "value": "Make migration resistant to validations\n" }, { "from": "human", "value": "class AddCommentCountToActivityObject < ActiveRecord::Migration\n def up\n add_column :activity_objects, :comment_count, :integer, :default => 0\n\n ActivityObject.record_timestamps = ...
ruby
chosen
[ { "from": "system", "value": "Use pure delegate in Spree::Gateway, compared with delegate_belongs_to\n\nThe provider method here is not a belongs_to association, so there's no good reason why we should be using delegate_belongs_to at all. Further more, delegate_belongs_to defines setters for these methods, ...
ruby
chosen
[ { "from": "system", "value": "Add regression spec for passing options to super\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"mobility/plugins/fallthrough_accessors\"\n\ndescribe Mobility::Plugins::FallthroughAccessors do\n include Helpers::Plugins\n\n context \"option v...
ruby
chosen
[ { "from": "system", "value": "Add a description and homepage to the gemspec." }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'proxyprotocol/version'\n\nGem::Specification.new do |spec|\...
ruby
chosen
[ { "from": "system", "value": "Stop duplicate generation of code\n" }, { "from": "human", "value": "#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:...
ruby
chosen
[ { "from": "system", "value": "Add license information to gemspec.\n\nFixes #9.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |gem|\n gem.name = 'actionpack-page_caching'\n gem.version = '1.0.2'\n gem.author = 'David Heinemeier ...
ruby
chosen
[ { "from": "system", "value": "Copy data tsv and sql files to the public folder\n" }, { "from": "human", "value": "namespace :db do\n desc 'deploy local data files to remote database'\n task load_remote: [:copy_data_to_remote, :restore_remote_db]\n\n desc 'copy local data files to remote serve...
ruby
chosen
[ { "from": "system", "value": "Fix an undefined method error.\n\ns/file/fail/\n" }, { "from": "human", "value": "Given /^a node specified by \"([^\\\"]*)\"$/ do |file|\n # file: yaml node file\n fail(\"Cannot find node facts #{file}.\") unless File.exist?(file)\n @node = YAML.load_file(file)\n...
ruby
chosen
[ { "from": "system", "value": "Tweak gemspec a little, trying to work around 'DefaultKey' issue, but to no avail\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = 'master_slave_adapter_s...
ruby
chosen
[ { "from": "system", "value": "Update TraceHelper to make headers no-color compatible\n" }, { "from": "human", "value": "module Inch\n module CLI\n module TraceHelper\n def debug(msg)\n return unless ENV['DEBUG']\n msg.to_s.lines.each do |line|\n trace edged :dark,...
ruby
chosen
[ { "from": "system", "value": "Remove cruddy tests; this needs some love\n" }, { "from": "human", "value": "ENV['RACK_ENV'] = 'test'\n\nrequire File.join(File.dirname(__FILE__), '../', \"prey_fetcher.rb\")\nrequire 'test/unit'\nrequire 'rack/test'\n\nclass PreyFetcherTest < Test::Unit::TestCase\n...
ruby
chosen
[ { "from": "system", "value": "Use fetch, and ff-only merge\n" }, { "from": "human", "value": "require 'fileutils'\n\npulled, skipped, failed = [], [], []\n\nroot = ARGF.argv[0]\n\nraise ArgumentError.new(\"Please pass a root directoy!\") if root.nil?\nraise ArgumentError.new(\"Please pass a vali...
ruby
chosen
[ { "from": "system", "value": "Raise a useful exception when a 400 error occurs\n" }, { "from": "human", "value": "require 'rest-client'\nrequire 'oj'\n\nmodule SiebelDonations\n class Base\n\n def initialize(json = {})\n json.each do |key, value|\n instance_variable_set(\"@#{key....
ruby
chosen
[ { "from": "system", "value": "Add ability to disable Thumbor using an ENV variable" }, { "from": "human", "value": "require 'ruby-thumbor'\n\nmodule ThumborRails\n module Helpers\n include ActionView::Helpers::AssetTagHelper\n\n def thumbor_url(image_url, options = {})\n if ThumborRa...
ruby
chosen
[ { "from": "system", "value": "Drop a bunch of unnecessary files from built gems.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'que/version'\n\nGem::Specification.new do |spec|\n s...
ruby
chosen
[ { "from": "system", "value": "Rename pubic_link_to_flyer to public_link_to_flyer. Haha.\n" }, { "from": "human", "value": "# Display email link to promoter. Uses event email if there is one.\n# Displays promoter email in promoter's name is blank.\n# Displays just promoter's name if there are no ...
ruby
chosen
[ { "from": "system", "value": "Fix off-by-one in max timeslot selection\n" }, { "from": "human", "value": "module EventsHelper\n\n def fix_http_proto(url)\n if url.start_with?('https') or url.start_with?('http') or url.start_with?('ftp')\n url\n else\n \"http://#{url}\"\n end\...
ruby
chosen
[ { "from": "system", "value": "Remove initialization, no longer needed.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nmodule TTY\n class Table\n class Border\n\n # A class that represents no border.\n class Null < Border\n\n # @api private\n def initi...
ruby
chosen
[ { "from": "system", "value": "Use post size medium by default\n" }, { "from": "human", "value": "require 'redcarpet'\nrequire 'rouge'\nrequire 'rouge/plugins/redcarpet'\n\nclass MarkdownRenderer < Redcarpet::Render::HTML\n include ActionView::Helpers::AssetTagHelper\n include Rouge::Plugins::R...
ruby
chosen
[ { "from": "system", "value": "Add expired scope to EditroRequests\n" }, { "from": "human", "value": "# +editor+ would like to become an editor for +person+. Sent in an email with link keyed by +token+.\n# Sends email with link after_create. See EditorRequestMailer.\nclass EditorRequest < ActiveR...
ruby
chosen
[ { "from": "system", "value": "Add issue number to email subject.\n" }, { "from": "human", "value": "class MentionMailer < ActionMailer::Base\n layout 'mailer'\n default from: Setting.mail_from\n def self.default_url_options\n Mailer.default_url_options\n end\n \n \n def notify_mentioni...
ruby
chosen
[ { "from": "system", "value": "Allow Volt.env to be set by RACK_ENV also. This makes heroku work out of the box for example." }, { "from": "human", "value": "module Volt\n class Environment\n def initialize\n @env = ENV['VOLT_ENV']\n\n # If we're in opal, we can set the env from JS...
ruby
chosen
[ { "from": "system", "value": "Use all subclasses of AR::Base, not just direct descendants\n" }, { "from": "human", "value": "require 'active_support'\nrequire 'active_support/core_ext/object/try'\nrequire \"rescue_from_duplicate/active_record/version\"\n\nmodule RescueFromDuplicate\n module Act...
ruby
chosen
[ { "from": "system", "value": "Change accessiblity of SolidusSubscriptions::OrderCreator from protected to private\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule SolidusSubscriptions\n class OrderCreator\n def initialize(installment)\n @installment = installme...
ruby
chosen
[ { "from": "system", "value": "Fix refresh plan display when no plan is defined for chart\n" }, { "from": "human", "value": "module DashboardHelper\n\n\tdef title (page_title, page_description)\n\t\tcontent_for :title, page_title.to_s\n\t\tcontent_for :description, page_description.to_s\n\tend\n\...
ruby
chosen
[ { "from": "system", "value": "Create format_date_for helper to get formatted date in relations\n" }, { "from": "human", "value": "module RelationsHelper\nend\n" }, { "from": "gpt", "value": "module RelationsHelper\n\n def format_date_for(relation)\n if relation.to.nil?\n ret...
ruby
chosen
[ { "from": "system", "value": "Remove gem version specifiers of bundler\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nlib = File.expand_path('lib', __dir__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'flog/version'\n\nGem::Specification.new do |spec|\n...
ruby
chosen
[ { "from": "system", "value": "Update the summary and description of gemspec\n" }, { "from": "human", "value": "# encoding: utf-8\n\nGem::Specification.new do |s|\n s.name = \"rails-i18n\"\n s.version = '0.6'\n s.authors = [\"Rails I18n Group\"]\n s.email = \"rails-i1...
ruby
chosen
[ { "from": "system", "value": "Support Ruby2.1. Add curses to dependencies.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ruby-anything/version'\n\nGem::Specification.new ...
ruby
chosen
[ { "from": "system", "value": "Use chefstart file for systemd as well\n" }, { "from": "human", "value": "include_recipe 'marathon::install'\n\nstart_command = \"#{node['marathon']['path']}/bin/start\"\nnode['marathon']['options'].each do |opt, value|\n start_command << \" --#{opt} #{value}\"\nen...
ruby
chosen
[ { "from": "system", "value": "Validate deleted dossiers dossier_id uniqueness\n" }, { "from": "human", "value": "class DeletedDossier < ApplicationRecord\n belongs_to :procedure\n\n enum reason: {\n user_request: 'user_request',\n manager_request: 'manager_request',\n user_removed:...
ruby
chosen
[ { "from": "system", "value": "Add validation to Organization User for org and user ID\n" }, { "from": "human", "value": "class OrganizationUser < ActiveRecord::Base\n belongs_to :organization\n belongs_to :user\n\n def invite_mailer(invited_by)\n OrganizationUserMailer.invite(self, invited...
ruby
chosen
[ { "from": "system", "value": "Create bookings for credit turnover and expenses in cash up.\n" }, { "from": "human", "value": "class Day < ActiveRecord::Base\n after_update :create_bookings\n \n private\n def create_bookings\n BookingTemplate.create_booking('day:cash', :amount => cash, :va...
ruby
chosen
[ { "from": "system", "value": "Fix table name in spec helper.\n" }, { "from": "human", "value": "# This file is copied to spec/ when you run 'rails generate rspec:install'\nENV[\"RAILS_ENV\"] ||= 'test'\nrequire File.expand_path(\"../../config/environment\", __FILE__)\nrequire 'rspec/rails'\nrequ...
ruby
chosen
[ { "from": "system", "value": "Use Postgres for testing, because of course.\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\nrequire 'minitest/autorun'\nrequire 'minitest/hooks'\n\nrequire 'sequel'\n\nDB = Sequel.sqlite\n\nDB.create_table :widgets d...
ruby
chosen
[ { "from": "system", "value": "Remove more spec run noise\n" }, { "from": "human", "value": "if self.class.const_defined?(:EY_ROOT)\n raise \"don't require the spec helper twice!\"\nend\n\nif ENV['COVERAGE']\n require 'simplecov'\n SimpleCov.start\nend\n\nEY_ROOT = File.expand_path(\"../..\", ...
ruby
chosen
[ { "from": "system", "value": "Add `integration` group to Simplecov\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'support/detect_os'\nrequire 'support/acceptance_helpers'\nrequire 'webmock/rspec'\nrequire 'rubygems/package'\nrequire 'zlib'\n\nRSpec.configure do |config|\n conf...
ruby
chosen
[ { "from": "system", "value": "Change spec filter :iso to :focus for compatibility with `fit` method.\n" }, { "from": "human", "value": "require 'pry'\nrequire 'rspec/its'\n\n\nRSpec.configure do |c|\n # Enable 'should' syntax\n c.expect_with(:rspec) { |c| c.syntax = [:should, :expect] }\n c.m...
ruby
chosen
[ { "from": "system", "value": "Exit the specs with a clear message when the VDDK is not present at all.\n" }, { "from": "human", "value": "require 'minitest'\nrequire 'minitest/autorun'\nrequire 'ffi-vix_disk_lib'\n" }, { "from": "gpt", "value": "require 'minitest'\nrequire 'minitest/...
ruby
chosen
[ { "from": "system", "value": "Remove deprecation warning when running spec tests\n\nSee https://tickets.puppetlabs.com/browse/PDK-916\n" }, { "from": "human", "value": "require 'puppetlabs_spec_helper/module_spec_helper'\n\nRSpec.configure do |config|\n config.hiera_config = 'spec/fixtures/hier...
ruby
chosen
[ { "from": "system", "value": "Set up test helper for Carrierwave\n\nUse separate upload directory\nClean the directory after each test" }, { "from": "human", "value": "require 'simplecov'\nrequire 'simplecov-rcov'\nSimpleCov.formatter = SimpleCov::Formatter::RcovFormatter\nSimpleCov.start 'rails...
ruby
chosen
[ { "from": "system", "value": "Call request as an instance var\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] ||= 'test'\nrequire File.expand_path(\"../../config/environment\", __FILE__)\nrequire 'rspec/rails'\nrequire 'rspec/autorun'\n\nDir[Rails.root.join(\"spec/support/**/*.rb\")].each ...
ruby
chosen
[ { "from": "system", "value": "Use api-alt.rollbar.com for oraclejdk7 tests.\n" }, { "from": "human", "value": "require 'rubygems'\n\nENV['RAILS_ENV'] = ENV['RACK_ENV'] = 'test'\nrequire File.expand_path('../dummyapp/config/environment', __FILE__)\nrequire 'rspec/rails'\nrequire 'database_cleaner...
ruby
chosen
[ { "from": "system", "value": "Update tests to new rspec standards\n" }, { "from": "human", "value": "require 'matrix'\nrequire 'vector'\n\ndescribe Vector do\n\t\n\tbefore :each do\n\t\t@v = Vector[-0.1, -0.9, -10]\n\tend\n\n\tit \"has an x-coordinate\" do\n\t\texpect(@v.x).to eq(-0.1)\n\tend\n ...
ruby
chosen
[ { "from": "system", "value": "Add rake task to run refresh in a transaction.\n" }, { "from": "human", "value": "namespace :easy do\n namespace :reference_data do\n desc \"Refreshes reference data values for the current environment.\"\n task :refresh => :environment do\n files = Dir[F...
ruby
chosen
[ { "from": "system", "value": "Use I18n strings if available\n\nLike #67 but I18n is used on Rails' side\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule EmailAddress\n\n # ActiveRecord validator class for validating an email\n # address with this library.\n # Note th...
ruby
chosen
[ { "from": "system", "value": "Prepend new classpath entries if already defined\n" }, { "from": "human", "value": "default['tez']['tez_site']['tez.lib.uris'] = '${fs.default.name}/apps/tez/,${fs.default.name}/apps/tez/lib/'\ndefault['tez']['tez_env']['tez_conf_dir'] = \"/etc/tez/#{node['tez']['co...
ruby
chosen
[ { "from": "system", "value": "Add MIT license to gemspec\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/abstract_type/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'abstract_type'\n gem.version = AbstractType::VERSION.d...
ruby
chosen
[ { "from": "system", "value": "Make sure developer exists before creating connection\n" }, { "from": "human", "value": "class Authenticator\n attr_reader :auth\n\n def self.call(*args)\n new(*args).find_or_create_from_oauth\n end\n\n def initialize(auth)\n @auth = auth\n end\n\n def f...
ruby
chosen
[ { "from": "system", "value": "Update Newstitle to new module format\n\nSigned-off-by: Aki Saarinen <278bc57fbbff6b7b38435aea0f9d37e3d879167e@akisaarinen.fi>\n" }, { "from": "human", "value": "Kernel.load(\"fetch_uri.rb\")\n\ndef parseNewsTitle(url)\n hosts = {\n /.*iltalehti\\.fi/ => /(.*) \...
ruby
chosen
[ { "from": "system", "value": "Make compression the same for both pipelines\n" }, { "from": "human", "value": "require 'sinatra/assetpack' unless defined? Sinatra::AssetPack\nrequire 'padrino-pipeline/pipelines/common'\n\nmodule Padrino\n module Pipeline\n class AssetPack\n include Padri...
ruby
chosen
[ { "from": "system", "value": "Revert using expand_fixture_path in factory\n" }, { "from": "human", "value": "include ActionDispatch::TestProcess\n\nFactoryBot.define do\n factory :ci_job_artifact, class: Ci::JobArtifact do\n job factory: :ci_build\n file_type :archive\n\n after :build ...
ruby
chosen
[ { "from": "system", "value": "Update the development rake gem dependency version requirement\n" }, { "from": "human", "value": "# encoding: utf-8\n\nGem::Specification.new do |spec|\n spec.name = \"rspec-wait\"\n spec.version = \"0.0.3\"\n\n spec.author = \"Steve Richert\"\n spec.ema...
ruby
chosen
[ { "from": "system", "value": "Update account setting spec for updating email address\n" }, { "from": "human", "value": "require 'spec_helper'\n\nfeature \"Account Settings\", js: true do\n include AuthenticationWorkflow\n\n describe \"as a logged in user\" do\n let(:user) { create(:user, em...
ruby
chosen
[ { "from": "system", "value": "Add test for all form parameters save in localStorage\n" }, { "from": "human", "value": "feature 'Save server URL in localStorage', :js => true do\n scenario 'Put server URL in form and process form' do\n visit '/'\n fill_in 'uri', :with => 'http://localhost:...
ruby
chosen
[ { "from": "system", "value": "Add test for `items` attribute\n" }, { "from": "human", "value": "module Core\n RSpec.describe SearchResultCollection do\n let(:items) { [] }\n let(:attributes) { { items: items } }\n subject(:result_collection) { described_class.new(attributes) }\n\n i...
ruby
chosen
[ { "from": "system", "value": "Use requester_id for actions rather than requester\n" }, { "from": "human", "value": "class Edition\n include Mongoid::Document\n \n embedded_in :guide\n \n embeds_many :parts\n embeds_many :actions\n \n field :version_number, :type => Integer, :default => 1...
ruby
chosen
[ { "from": "system", "value": "Add sign in redirection in dashboard controller spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe DashboardController do\n describe 'GET #show' do\n it 'renders the :show template' do\n login_user build_stubbed(:user)\n\n get :s...
ruby
chosen
[ { "from": "system", "value": "Deal with brackets in urls\n" }, { "from": "human", "value": "class Asset < ActiveRecord::Base\n belongs_to :item\n\n before_validation :set_metadata\n\n scope :videos, -> { where(\"mime like 'video%'\") }\n\n class << self\n def help_text\n <<-EOT\n ...
ruby
chosen
[ { "from": "system", "value": "Save the PLANT THE FLAG\n" }, { "from": "human", "value": "class Email < ActiveRecord::Base\n after_create :check_account\n\n def check_account\n account = Account.where(slug: self.to.split('@')[0]).first\n if account && !account.empty?\n\n end\n end\nen...
ruby
chosen
[ { "from": "system", "value": "Add development dependencies to gemspec.\n" }, { "from": "human", "value": "lib = File.expand_path(\"../lib/\", __FILE__)\n$:.unshift lib unless $:.include?(lib)\n\nrequire \"htmlentities/version\"\n\nspec = Gem::Specification.new do |s|\n s.name = \"ht...
ruby
chosen
[ { "from": "system", "value": "Improve documentation for `have_return_type` rspec matcher\n" }, { "from": "human", "value": "RSpec::Matchers.define :have_return_type do |type|\n match do |method_object|\n return_tags = method_object.tags(:return)\n\n expect(return_tags.size).to be > 0\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix to_ruby_literal test on DateTime/Time\n" }, { "from": "human", "value": "require 'spec_helper'\nmodule Alf\n describe \"Support#to_ruby_literal\" do\n\n it 'works on Integers' do\n Support.to_ruby_literal(12).should eql(\"12\")\n end\n\n it 'works...
ruby
chosen
[ { "from": "system", "value": "Set OS X deployment target\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"Cartography\"\n s.version = \"0.1.0\"\n s.summary = \"Declarative Auto Layout in Swift\"\n\n s.description = <<-DESC\n Set up y...
ruby
chosen
[ { "from": "system", "value": "Change seed.rb to add snack food, shirt size\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 ...
ruby
chosen
[ { "from": "system", "value": "Add feature spec for MIR output\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'support/editor'\n\nRSpec.feature \"Compiling to different formats\", type: :feature, js: true do\n before do\n visit '/'\n editor.set(code)\n end\n\n scenario...
ruby
chosen
[ { "from": "system", "value": "Add each podcast episode to Sitemap\n" }, { "from": "human", "value": "# Set the host name for URL creation\nSitemapGenerator::Sitemap.default_host = \"https://coderdojo.jp\"\n\nSitemapGenerator::Sitemap.create do\n # Put links creation logic here.\n #\n # The ro...
ruby
chosen
[ { "from": "system", "value": "Fix my mistake and the corresponding merge conflict\n" }, { "from": "human", "value": "###\n# Page options, layouts, aliases and proxies\n###\n\n# Per-page layout changes:\n#\n# With no layout\npage '/*.xml', layout: false\npage '/*.json', layout: false\npage '/*.tx...
ruby
chosen
[ { "from": "system", "value": "Add sha256 hash for Homebrew\n\nFixes #151\n" }, { "from": "human", "value": "require 'formula'\n\nclass Howdoi < Formula\n homepage 'https://github.com/gleitz/howdoi/'\n url 'https://pypi.python.org/packages/23/2d/9790707eed08c802daee32183e7c98ec2e9797564dad22973...
ruby
chosen
[ { "from": "system", "value": "Remove Comments controller 'index' spec\n\nThe 'index' action no longer exists, so the spec in the Comments\ncontroller should be removed.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe CommentsController do\n\n before(:each) do\n @user ...
ruby
chosen
[ { "from": "system", "value": "Add destroy route to users controller\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n\t\n\tdef new\n\tend\n\n\tdef show\n\t\t@user = User.find(params[:id])\n\t\tif @user\n\t\t\tlink_to user_path(@user)\n\t\telse\n\t\t\tredirect_to ...
ruby
chosen
[ { "from": "system", "value": "Disable this for now as it's just hanging" }, { "from": "human", "value": "class StartServiceJob < ApplicationJob\n def perform(service)\n return if service.container_id\n fail 'Cannot be performed on an external service' unless service.hosted?\n\n Rails.l...
ruby
chosen
[ { "from": "system", "value": "Make sure user gets unsuspended.\n" }, { "from": "human", "value": "class InAppPurchase < ActiveRecord::Base\n\n belongs_to :user\n\n validates :transaction_id, uniqueness: true\n\n after_commit :extend_subscription, on: :create\n\n def self.create_from_receipt_...
ruby
chosen
[ { "from": "system", "value": "Fix title/description update (previously unable to update those information on available attachments).\nMake :title and :description attributes accessible\n" }, { "from": "human", "value": "class PageAttachment < ActiveRecord::Base\n acts_as_list :scope => :page_id...
ruby
chosen
[ { "from": "system", "value": "Fix vendor key in physical server\n\nVendor key should be always downcase.\n" }, { "from": "human", "value": "class PhysicalServer < ApplicationRecord\n include NewWithTypeStiMixin\n include MiqPolicyMixin\n\n acts_as_miq_taggable\n\n belongs_to :ext_management_...
ruby
chosen
[ { "from": "system", "value": "Add deprecations for downloadKey and itemId\n" }, { "from": "human", "value": "class SingleUseLink < ActiveRecord::Base\n validate :expiration_date_cannot_be_in_the_past\n validate :cannot_be_destroyed\n\n alias_attribute :downloadKey, :download_key\n alias_attr...
ruby
chosen
[ { "from": "system", "value": "Make actionpack a dev dependency only\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'strong_routes/version'\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "system", "value": "Update knife-cloud requirement from >= 1.2.0, < 4.0 to >= 1.2.0, < 5.0\n\nUpdates the requirements on [knife-cloud](https://github.com/chef/knife-cloud) to permit the latest version.\n- [Release notes](https://github.com/chef/knife-cloud/releases)\n- [Changelog](https://github....
ruby
chosen
[ { "from": "system", "value": "Allow setting a timeout on waiting for a resource" }, { "from": "human", "value": "require \"thread\"\nrequire \"monitor\"\n\nclass FutureResource\n def initialize\n @resource_lock = Monitor.new\n @resource_value_blocker = @resource_lock.new_cond\n ...
ruby
chosen
[ { "from": "system", "value": "Switch Value to class << self\n" }, { "from": "human", "value": "require 'virtus'\n\nmodule Kamerling\n class Value\n include Virtus.value_object\n\n def self.defaults(hash = {})\n hash.each do |name, default|\n attribute name, attribute_set[name]...
ruby
chosen
[ { "from": "system", "value": "Make module_function declaration in stop words more explicit.\n" }, { "from": "human", "value": "module Lunar\n # @private Internally used by {Lunar::Words} to filter out\n # common words like an, the, etc.\n module Stopwords\n def include?(word)\n stopwo...
ruby
chosen
[ { "from": "human", "value": "Allow for conversion to camel case and snake case for strings\n" }, { "from": "gpt", "value": "class String\n def to_snake_case\n gsub(\"::\", \"/\").\n gsub(/([A-Z]+)([A-Z][a-z])/, \"\\1_\\2\").\n gsub(/([a-z]\\d)([A-Z])/).\n tr(\"-\", \"_\").\n ...
ruby
chosen
[ { "from": "system", "value": "Make readers public to avoid weird ruby warnings\n\nSee https://github.com/thoughtbot/guides/pull/190\nSee https://twitter.com/tomstuart/status/486143792140271616\n" }, { "from": "human", "value": "require_relative 'diff'\nrequire_relative 'diff_collection'\n\nmodul...
ruby
chosen