conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Handle RecordNotFound exceptions in Jobs with Raven\n" }, { "from": "human", "value": "class ApplicationJob < ActiveJob::Base\n # Send handled exceptions to Sentry (which normally only sends unhandled exceptions).\n require \"error_handler_delegator\"\n\n def sel...
ruby
chosen
[ { "from": "system", "value": "Remove helper method call from mailer\n" }, { "from": "human", "value": "class AlertMailer < ApplicationMailer\n add_template_helper(AlertsChartsHelper)\n\n def alert_email\n @email_address = params[:email_address]\n @events = params[:events]\n @school = ...
ruby
chosen
[ { "from": "system", "value": "Add research area uniqueness validation\n" }, { "from": "human", "value": "class ResearchArea < ActiveRecord::Base\n has_many :courses\n has_many :professors, :through => :professor_research_areas\n\n validates :name, :presence => true\n validates :code, :presen...
ruby
chosen
[ { "from": "system", "value": "Fix register decision task spec.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nfeature \"Register Decision\", js: true do\n\n let(:journal) { Journal.create! }\n\n let!(:editor) do\n User.create! username: 'albert',\n first_name: 'Albert',\n ...
ruby
chosen
[ { "from": "system", "value": "Update generator to work with recent decoupling from Rails\n" }, { "from": "human", "value": "# This generator bootstraps a Rails project for use with Cucumber\nclass FeatureGenerator < Rails::Generator::NamedBase\n def manifest\n record do |m|\n m.director...
ruby
chosen
[ { "from": "system", "value": "Revert \"Added Twitter following button\"\n\nThis reverts commit 1811e612bbbef8033cd149ff28096f617ef0bb32.\n" }, { "from": "human", "value": "module GuideHelpers\n def page_title\n title = \"Susy: \"\n if data.page.title\n title << data.page.title\n e...
ruby
chosen
[ { "from": "human", "value": "Add session controller POST session/login\n" }, { "from": "gpt", "value": "class SessionController < ApplicationController\n def login\n\n new_user = User.find_by(username: params[:username])\n if new_user && new_user.authenticate(params[:password])\n p p...
ruby
chosen
[ { "from": "system", "value": "Fix tests for multiple speakers\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Confs do\n subject { Confs::Client.new }\n\n describe 'speakers' do\n it 'returns the speakers list' do\n expect(subject.speakers.count).to eq 15\n end\...
ruby
chosen
[ { "from": "system", "value": "Fix KDAs, ignore the order lol\n" }, { "from": "human", "value": "class Match < ActiveRecord::Base\n\n scope :with_opponent, -> { where('opponent_champion IS NOT NULL') }\n\n belongs_to :summoner, inverse_of: :matches\n # TODO uniqueness\n\n validates :match_id,...
ruby
chosen
[ { "from": "system", "value": "Fix done_cards to return only cards guessed true\n" }, { "from": "human", "value": "class Round < ActiveRecord::Base\n belongs_to :user\n has_many :guesses\n has_many :cards, through: :guesses\n\n def done_cards\n # cards.where(id: guesses.pluck(:card_id))\n ...
ruby
chosen
[ { "from": "system", "value": "Create a temporary groove git checkout.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: groove\n# Recipe:: default\n#\n# Copyright 2014, YOUR_COMPANY_NAME\n#\n# All rights reserved - Do Not Redistribute\n#\n" }, { "from": "gpt", "value": "#\n# Co...
ruby
chosen
[ { "from": "system", "value": "Add environment to Bundle loading\n" }, { "from": "human", "value": "require 'bundler'\nBundler.require :default\n\nmodule Caskbot\n class << self\n extend Memoist\n\n attr_accessor :bot\n\n def github\n Github.new do |c|\n c.oauth_token = ENV[...
ruby
chosen
[ { "from": "system", "value": "Add default content-type header. Helps Chrome.\n" }, { "from": "human", "value": "Dir.chdir(File.dirname(__FILE__))\nrequire File.expand_path('../config/boot', __FILE__)\n\nmaps = {\n '/' => ApplicationController,\n '/openid' => OpenidController,\n '/user...
ruby
chosen
[ { "from": "system", "value": "Remove old capacity scheduler template\n" }, { "from": "human", "value": "hadoop_templates =\n %w{\n capacity-scheduler.xml\n fair-scheduler.xml\n }\n\nhadoop_templates.each do |t|\n template \"/etc/hadoop/conf/#{t}\" do\n source \"hdp_#{t}.erb\"\n m...
ruby
chosen
[ { "from": "system", "value": "Add license details to gemspec.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nversion = File.read(File.expand_path('VERSION', File.dirname(__FILE__)))\n\nGem::Specification.new do |s|\n s.name = \"cryptopp\"\n s.version = version\n\n s.required_...
ruby
chosen
[ { "from": "system", "value": "Use superenv if HOMEBREW_DEVELOPER for Linuxbrew\n" }, { "from": "human", "value": "require \"hardware\"\nrequire \"extend/ENV/shared\"\nrequire \"extend/ENV/std\"\nrequire \"extend/ENV/super\"\n\ndef superenv?\n if OS.linux?\n ARGV.env == \"super\"\n else\n ...
ruby
chosen
[ { "from": "human", "value": "Set basepath where it is nil.\n" }, { "from": "gpt", "value": "class SetBasepathWhereNil < ActiveRecord::Migration\n def self.up\n OntologyVersion.where(basepath: nil).find_each do |ov|\n ov.basepath = ov.ontology.read_attribute(:basepath)\n ov.file_ext...
ruby
chosen
[ { "from": "human", "value": "Add class stolen from branch: user-merge-tool\n" }, { "from": "gpt", "value": "# Aggregates the user data. It is an entry point to reach all the data directly\n# related to the users. Can be used to add inteligence in between those\n# integration points.\n#\n# TODO:\...
ruby
chosen
[ { "from": "system", "value": "Work harder to make sure tests set up a nice initial environment for themselves" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), 'test_helper')\n\nclass AlterTableTest < Test::Unit::TestCase\n def setup\n ActiveRecord::Migration.verbose...
ruby
chosen
[ { "from": "system", "value": "Include teamcity simplecov formatter in spec helper\n" }, { "from": "human", "value": "require 'rspec'\nrequire 'savon/mock/spec_helper'\nrequire 'simplecov'\n\nSimpleCov.start do\n minimum_coverage 100\n\n if ENV['TEAMCITY_VERSION']\n at_exit do\n SimpleC...
ruby
chosen
[ { "from": "system", "value": "Add cha gem to 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 'capistrano/chatwork/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix timing failure in test\n" }, { "from": "human", "value": "require \"minitest\"\nrequire \"minitest/autorun\"\nrequire_relative \"../../lib/celluloid_benchmark/runner\"\nrequire \"fakeweb\"\n\nFakeWeb.allow_net_connect = false\n\nmodule CelluloidBenchmark\n clas...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 1.2.0.1 to 1.2.2.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-schema'\n s.summary = \"Primitives for schema and data structure\"\n s.version = '1.2.0.1'\n s.descri...
ruby
chosen
[ { "from": "human", "value": "Improve test coverage for TimeslotsController\n" }, { "from": "gpt", "value": "require 'rails_helper'\ndescribe TimeslotsController do\n let(:user) { FactoryGirl.create(:user) }\n let!(:timeslot) { FactoryGirl.build(:timeslot) }\n\n context \"#show\" do\n it \"...
ruby
chosen
[ { "from": "system", "value": "Allow user to view PDF in browser before download\n" }, { "from": "human", "value": "class DonationApplicationsController < ApplicationController\n before_action :authenticate_user!\n\n def create\n @listing = Listing.find(params[:id])\n submission_status ||...
ruby
chosen
[ { "from": "system", "value": "Fix error when using breadcrumbs_on_rails 4\n" }, { "from": "human", "value": "module CamaleonCms::Admin::BreadcrumbHelper\n # draw the title for the admin admin panel according the breadcrumb\n def cama_admin_title_draw\n res = [t(\"camaleon_cms.admin.sidebar_...
ruby
chosen
[ { "from": "system", "value": "Revert \"Attempt to fix error in prod. with adjustable_type\"\n\nThis reverts commit 0099fadab39dab6eadc880e30e1c088900d124c5.\n" }, { "from": "human", "value": "module Sprangular\n class AdjustmentSerializer < BaseSerializer\n attributes :id, :source_type, :sou...
ruby
chosen
[ { "from": "system", "value": "Test should of course render_views.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ProposalsController, :type => :controller do\n describe '#generate' do\n it 'doesn\\'t die horribly when you try to use it' do\n lambda do\n post...
ruby
chosen
[ { "from": "system", "value": "Fix rspec problem in dummy\n" }, { "from": "human", "value": "Dummy::Application.configure do\n # Settings specified here will take precedence over those in config/application.rb\n\n # In the development environment your application's code is reloaded on\n # ever...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.0.1 to 0.1.0.2\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-messaging'\n s.summary = 'Messaging primitives for EventStore using the EventStore Client HTTP ...
ruby
chosen
[ { "from": "system", "value": "Load stylesheet only when it is needed\n" }, { "from": "human", "value": "class ProgressiveProjectsListListener < Redmine::Hook::ViewListener\n def view_layouts_base_html_head(context)\n stylesheet_link_tag('progressive_projects_list', :plugin => :progressive_pr...
ruby
chosen
[ { "from": "system", "value": "Update bundler requirement for new version\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'rolify/version'\n\nGem::Specification.new do |s|\n s.name = 'rolify'\n s.summary = %q{Roles l...
ruby
chosen
[ { "from": "system", "value": "Add an image to a LogoEntry\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass CreateLogoEntries < ActiveRecord::Migration[5.2]\n def change\n create_table(:logo_entries, &:timestamps)\n end\nend\n" }, { "from": "gpt", "value"...
ruby
chosen
[ { "from": "human", "value": "Add a script to redirect a specialist sector\n\nCurrently, when changing a slug for a specialist sector, we first\narchive the sector at the old slug (causing it to return a 410 Gone HTTP\nstatus), and then apply a change with router-data to redirect the old\nslug to the new one...
ruby
chosen
[ { "from": "system", "value": "Make NPC move a little more often\n" }, { "from": "human", "value": "class NPC < Player\n\n def initialize(window, x, y)\n super\n @window, @x, @y, = window, x, y\n\n @facing_up, @facing_down, @facing_left, @facing_right =\n Gosu::Image.load_tiles(win...
ruby
chosen
[ { "from": "system", "value": "Return a sensible default GOVUK_APP_DOMAIN value\n\nThe way Plek works, and is used, means that it tries to find\n`ENV['GOVUK_APP_DOMAIN']` immediately, which will causes any Rails apps\nthat include Plek in an initialiser to die when instantiating\nthemselves.\n\nThis makes si...
ruby
chosen
[ { "from": "system", "value": "Fix for when CLASSPATH environment path is set\n\nSay, I had a CLASSPATH of:\nexport CLASSPATH=opsin-big-0.1.0.jar\nrcdk would concatenate that directly to form a classpath of\nopsin-big-0.1.0.jarfilelocation/../java/lib/cdk-1.2 ...\ngiving no colon separation in the path.\n\nT...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary disabling of rubocop\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 tr...
ruby
chosen
[ { "from": "system", "value": "Update to use latest Faraday" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'faraday-request-timer/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "human", "value": "Add tool to remove grouping from report results\n\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1590908\n\nSome aggregation information was persisted into the miq_report_results\ntable in the report column's `extras[:grouping]` section. We don't need\nthe grouping after we've ge...
ruby
chosen
[ { "from": "system", "value": "Rename dependency to match new name of XNGAPIClient\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'XINGAPIClientTester'\n s.version = '0.0.1'\n s.license = 'MIT'\n s.ios.deployment_target = '6.0'\n s.osx.deployment_target = '10.7'\n s.summ...
ruby
chosen
[ { "from": "system", "value": "Allow batch posts of followings\n" }, { "from": "human", "value": "module FollowingsConcern extend ActiveSupport::Concern\n def create\n @following = current_user.followings.build(:leader_id => params[:leader_id])\n if @following.save\n render :json => @...
ruby
chosen
[ { "from": "system", "value": "Add back SPEC assignment, since it is used in the Rakefile.\n" }, { "from": "human", "value": "require 'caruby/version'\nrequire 'date'\n\nGem::Specification.new do |s|\n s.name = \"caruby-core\"\n s.summary = \"Ruby facade for caBIG applications.\"...
ruby
chosen
[ { "from": "system", "value": "Add LSB packages as dependencies\n" }, { "from": "human", "value": "name \"td-agent\"\n#version '' # git ref\n\ndependency \"jemalloc\"\ndependency \"ruby\"\ndependency \"nokogiri\"\ndependency \"postgresql\"\ndependency \"fluentd\"\n\nenv = {}\n\nbuild do\n Dir.gl...
ruby
chosen
[ { "from": "system", "value": "Stop ghost <a> appearing at checkout\n" }, { "from": "human", "value": "Spree::CheckoutHelper.module_eval do\n\tdef checkout_progress\n states = checkout_states\n items = states.map do |state|\n text = Spree.t(\"order_state.#{state}\").titleize\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove category from book attributes\n" }, { "from": "human", "value": "class Collection < ActiveRecord::Base\n belongs_to :user\n has_many :book_collections, :dependent => :destroy\n has_many :books, :through => :book_collections\n has_many :comments, :dependen...
ruby
chosen
[ { "from": "system", "value": "Implement respond_to_missing? companion method for method_missing?\n\nSee https://thoughtbot.com/blog/always-define-respond-to-missing-when-overriding\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: data_points\n#\n# id :integer...
ruby
chosen
[ { "from": "system", "value": "Remove friendly_token and generate_token methods which do not appear to be used anywhere\n" }, { "from": "human", "value": "module Spree\n class User < ActiveRecord::Base\n include Core::UserAddress\n\n devise :database_authenticatable, :registerable, :recove...
ruby
chosen
[ { "from": "system", "value": "Remove the config as it is in the wrong place\n" }, { "from": "human", "value": "# Technique caged from http://stackoverflow.com/questions/4460800/how-to-monkey-patch-code-that-gets-auto-loaded-in-rails\nRails.configuration.to_prepare do\n Asset.class_eval do\n ...
ruby
chosen
[ { "from": "human", "value": "Create a recipe in wt_monitoring to handle ldap backups in optimize. Right now it just mounts the newly created optimize_backups share\n" }, { "from": "gpt", "value": "#\n# Cookbook Name:: wt_monitoring\n# Recipe:: ldap_backup\n#\n# Copyright 2012, Webtrends\n#\n# A...
ruby
chosen
[ { "from": "system", "value": "Upgrade to zookeeper ~> 6.0\n\nCloses #41\n" }, { "from": "human", "value": "name 'exhibitor'\nmaintainer 'EverTrue'\nmaintainer_email 'devops@evertrue.com'\nlicense 'Apache v2.0'\ndescription 'Installs Netflix Exhibitor'\nversion ...
ruby
chosen
[ { "from": "system", "value": "Remove apt/yum, since they're handled by hadoop cookbook\n" }, { "from": "human", "value": "name 'impala'\nmaintainer 'Cask'\nmaintainer_email 'ops@cask.co'\nlicense 'All rights reserved'\ndescription 'Installs/Configures Impala'\nlon...
ruby
chosen
[ { "from": "system", "value": "Use `suggests` instead of `recommends` for Berkshelf\n\nThis is for Berkshelf users who will get errors when trying to upload wrapper cookbooks, similar to this one:\n\n Dependency 'java' was not found. Please make sure it is in your Berksfile, and then run berks install to do...
ruby
chosen
[ { "from": "human", "value": "Add unique constraint to avoid duplicate schedules\n" }, { "from": "gpt", "value": "Sequel.migration do\n up do\n alter_table(:schedules) do\n add_unique_constraint([:group_id, :name], name: :unique_within_group)\n end\n end\n\n down do\n drop_constr...
ruby
chosen
[ { "from": "system", "value": "Add test for 401 error\n" }, { "from": "human", "value": "require 'helper'\nrequire 'deviantart'\n\ndescribe DeviantArt::Error do\n before(:all) do\n @da = DeviantArt.new\n end\n describe '#get_deviation' do\n before do\n @error = fixture('error_404.js...
ruby
chosen
[ { "from": "system", "value": "Add test for unknown database type\n" }, { "from": "human", "value": "require \"test_helper\"\nrequire \"shnotes/notes\"\n\nmodule Shnotes\n class NotesTest < Test::Unit::TestCase\n context \"for PStore instance\" do\n setup do\n @temp_file = Tempfil...
ruby
chosen
[ { "from": "system", "value": "Add homepage in podspec file.\n" }, { "from": "human", "value": "\nPod::Spec.new do |s|\n s.name = \"RNSettings\"\n s.version = \"0.0.1\"\n s.summary = \"RNSettings\"\n s.description = <<-DESC\n Access iOS and Android device s...
ruby
chosen
[ { "from": "system", "value": "Use MiniTest::Unit::TestCase instead of Minitest::Test\n\nSince Rails 4.0.x is depending on Minitest 4.x, the constant won't be\navailable so the gist won't run.\n\n[ci skip]\n" }, { "from": "human", "value": "# Activate the gem you are reporting the issue against.\...
ruby
chosen
[ { "from": "system", "value": "Remove tilt as a dependency\n" }, { "from": "human", "value": "$:.unshift File.join(File.dirname(__FILE__), 'lib')\nrequire 'generated-assets/version'\n\nGem::Specification.new do |s|\n s.name = \"generated-assets\"\n s.version = ::GeneratedAssets::VERSION\n ...
ruby
chosen
[ { "from": "system", "value": "Add another test to increase coverage.\n" }, { "from": "human", "value": "describe Hbc::CLI::InternalStanza, :cask do\n it \"shows stanza of the Specified Cask\" do\n command = described_class.new(\"gpg\", \"with-gpg\")\n expect do\n command.run\n end...
ruby
chosen
[ { "from": "system", "value": "Set proper rails generator defaults\n\nTo avoid the requirement to provide additional flags while using the\nbuiltin rails generators I have added some flags to the application\nconfiguration. Now the generator always uses rspec, slim and\nfactory_girl by default, and test_unit...
ruby
chosen
[ { "from": "system", "value": "Set config.reload_plugins = true because that would make things less\ntedious so we don't have to restart the server every time we change a\ncontroller in a plugin.\n" }, { "from": "human", "value": "# Settings specified here will take precedence over those in confi...
ruby
chosen
[ { "from": "system", "value": "Use preview asset host unless told not to\n" }, { "from": "human", "value": "Calendars::Application.configure do\n # Settings specified here will take precedence over those in config/application.rb\n\n # In the development environment your application's code is re...
ruby
chosen
[ { "from": "system", "value": "Switch to the actual class names in the resource\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Author:: Seth Chisamore (<schisamo@chef.io>)\n# Cookbook:: transmission\n# Resource:: torrent_file...
ruby
chosen
[ { "from": "system", "value": "Format and indent migration message\n\nIt's much clearer to read this way:\n\n```\n== OldMigrationsRemoved: migrating ===========================================\nrake aborted!\nStandardError: An error has occurred, this and all later migrations canceled:\n\n You haven't ...
ruby
chosen
[ { "from": "system", "value": "Comment on why Article is needed\n" }, { "from": "human", "value": "class Article < ActiveRecord::Base\nend\n" }, { "from": "gpt", "value": "##\n# This model is not enabled in typus but is used to test things things like:\n#\n# - Article.read_model_c...
ruby
chosen
[ { "from": "system", "value": "Create `env` before attempting to use it\n" }, { "from": "human", "value": "#\n# Copyright 2014 Chef Software, Inc.\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.\n# You may...
ruby
chosen
[ { "from": "system", "value": "Update path for imba dist sources\n\nIn Imba 0.14.3 we moved builds from lib/browser to dist/.\r\nThey were also renamed, imba.js -> imba.dev.js, and imba.min.js -> imba.js." }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)...
ruby
chosen
[ { "from": "system", "value": "Add summary and description to avoid warning." }, { "from": "human", "value": "# encoding: utf-8\n\n$:.unshift File.expand_path('../lib', __FILE__)\nrequire 'capybara/polyglot/version'\n\nGem::Specification.new do |s|\n s.name = \"capybara-polyglot\"\n s....
ruby
chosen
[ { "from": "system", "value": "Build system: use new SmartFileTask interface in MustacheTask\n" }, { "from": "human", "value": "# encoding: UTF-8\nrequire 'rake/smart_file_task'\nrequire 'mustache'\n\nmodule Rake\n # Rake task to generate files from Mustache templates using a CLI-like approach\n...
ruby
chosen
[ { "from": "system", "value": "Fix issue with command-line not showing help when called without arguments\n" }, { "from": "human", "value": "require 'optparse'\nrequire 'highline/import'\n\nmodule AutoExpreso\n # @author Jonah Ruiz <jonah@pixelhipsters.com>\n # A Simple class for the executable...
ruby
chosen
[ { "from": "system", "value": "Change usage of DataMapper::Resource::ClassMethods to use Model\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'pathname'\n\ngem 'dm-core', '~>0.9.10'\nrequire 'dm-core'\n\nrequire Pathname(__FILE__).dirname.expand_path / 'dm-is-versioned' / 'is' / '...
ruby
chosen
[ { "from": "system", "value": "Create a more advance new helper for display an avatar picture\n\nThis helper can verifiy if a user have a picture in the db and return it, but if not the helper will return the gravatar picture" }, { "from": "human", "value": "module UsersHelper\n # Get the grav...
ruby
chosen
[ { "from": "system", "value": "Add comments to requires to explain pry and RestClient.proxy\n" }, { "from": "human", "value": "require 'dotenv'\nDotenv.load\nrequire 'pry'\nrequire 'pry-doc'\n# require rest client prior to linkeddata, so the latter can use it.\nrequire 'rest-client'\nRestClient.p...
ruby
chosen
[ { "from": "system", "value": "Add rails 3 generator instructions\n" }, { "from": "human", "value": "# When the BlogKit plugin is installed run the blog_assets generator\nbegin\n\tif defined?(Rails)\n\t\trails_root = Rails.root\n\telsif defined?(RAILS_ROOT)\n\t\trails_root = RAILS_ROOT\n\telse\n\...
ruby
chosen
[ { "from": "system", "value": "Use --no-document option instead of --no-rdoc and --no-ri option\n" }, { "from": "human", "value": "version = ARGV.pop\n\nif version.nil?\n puts \"Usage: ruby install.rb version\"\n exit(64)\nend\n\n%w( activesupport activemodel activerecord actionpack actionview ...
ruby
chosen
[ { "from": "system", "value": "Change a stray 409 to a 400\n" }, { "from": "human", "value": "class CollaboratorsController < ApplicationController\n\n before_action :login_required\n\n def create\n account = Account.lookup(pick(params, :email)[:email])\n return not_found if !account\n ...
ruby
chosen
[ { "from": "system", "value": "Use legacy layout for landing pages." }, { "from": "human", "value": "class LandingPagesController < ApplicationController\n include InheritedResources::DSL\n\n layout 'nodes'\n\n before_filter :load_region, :load_status, :load_type\n\n def index\n @nodes = @...
ruby
chosen
[ { "from": "system", "value": "Remove unneccesary methods from Registrations controller\n" }, { "from": "human", "value": "class RegistrationsController < Devise::RegistrationsController \n def new\n super\n end\n\n def create\n if params[:user][:role].present? && current_user.role?(:sup...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for Facebook SDK for iOS.\n" }, { "from": "human", "value": "cask 'facebook-ios-sdk' do\n version '3.24.4'\n sha256 'dc9ae3e6c9969a03b15e041dd24d7f0d0bdfcd35f8a7eb8d35c2e21434a3a0b3'\n\n # origincache.facebook.com/developers was verified ...
ruby
chosen
[ { "from": "system", "value": "Change gem description to be more verbose.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'memcache_check/version'\n\nGem::Specification.new do |spec|\n...
ruby
chosen
[ { "from": "system", "value": "Allow paths to include ”admin”\n\nThere is only need to check if the path begins with the excluded\nprefixes.\n\nAlso we should be able to rely on PATH_INFO.\n" }, { "from": "human", "value": "Journey::Router.class_eval do\n def find_routes_with_resolver env\n p...
ruby
chosen
[ { "from": "system", "value": "Set the correct content types.\n" }, { "from": "human", "value": "require 'sinatra/base'\nrequire 'json'\nrequire 'cgi'\n\nclass Optica < Sinatra::Base\n get '/' do\n params = CGI::parse(request.query_string)\n\n # include only those nodes that match passed-i...
ruby
chosen
[ { "from": "system", "value": "Remove bogus log file from message.\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/command'\nrequire 'catissue/database'\n\nmodule CaTissue\n module CLI\n class Smoke < Command\n # Creates a new Smoke command.\n def initialize\n ...
ruby
chosen
[ { "from": "human", "value": "Add a ContainerOrchestrator class for communicating with the OpenShift API\n\nAs a first pass it implements a #scale method which can be used to\nchange the desired number of replicas in a deployment config.\n\nIt also handles authenticating to the API using the pod's service\na...
ruby
chosen
[ { "from": "system", "value": "Fix bugs detected through tests\n" }, { "from": "human", "value": "# encoding: utf-8\n\n# => author: lawitschka\n# => email: moritz.lawitschka@urbanvention.com\nmodule Faker\n module PhoneNumberDE\n extend ModuleUtils\n extend self\n\n # Mobile prefixes ar...
ruby
chosen
[ { "from": "system", "value": "Delete letters method, add flat_map delegator\n" }, { "from": "human", "value": "class GreekString\n class Container\n require 'forwardable'\n extend Forwardable\n\n def_delegators :@container, :[], :<<, :each, :map\n\n def initialize\n @container ...
ruby
chosen
[ { "from": "system", "value": "Update Node.js documentation (6.7.0, 4.6.0)\n" }, { "from": "human", "value": "module Docs\n class Node < UrlScraper\n self.name = 'Node.js'\n self.slug = 'node'\n self.type = 'node'\n self.links = {\n home: 'https://nodejs.org/',\n code: 'htt...
ruby
chosen
[ { "from": "system", "value": "Add .pre for next release\n" }, { "from": "human", "value": "module EY\n VERSION = '2.2.0'\n ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.2.0'\nend\n" }, { "from": "gpt", "value": "module EY\n VERSION = '2.2.1.pre'\n ENG...
ruby
chosen
[ { "from": "system", "value": "Include VERSION file in gem.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"console-mux\"\n s.version = File.read('VERSION')\n s.platform = Gem::Platform::RUBY\n s.authors = [\"CG Labs\"]\n s.email = [\"eng...
ruby
chosen
[ { "from": "system", "value": "Make sure Configuration.view is reset\n" }, { "from": "human", "value": "class Ettu\n class Configuration < ActiveSupport::OrderedOptions\n def initialize\n super\n set_defaults\n end\n\n def reset\n set_defaults\n end\n\n private\n\n ...
ruby
chosen
[ { "from": "system", "value": "Simplify GraphPersistor to a lambda\n" }, { "from": "human", "value": "module Atlas\n class GraphPersistor\n def initialize(dataset, path, export_modifier: nil)\n @dataset = dataset\n @path = path\n @export_modifier = export_modif...
ruby
chosen
[ { "from": "system", "value": "Change raise stop loop with while\n" }, { "from": "human", "value": "require 'hashie'\n\nmodule BeezupApi\n\n class OrderList\n include Helpers::Request\n include Api::QueryHelpers\n\n attr_accessor :client, :options,\n :pagination_result, :request, :...
ruby
chosen
[ { "from": "system", "value": "Use map.with_index instead of zip for performance\n\n $ cat bench.rb\n require \"benchmark/ips\"\n\n a = Array.new(100) { 1 }.freeze\n b = Array.new(100) { 2 }.freeze\n\n Benchmark.ips do |x|\n x.report('lazy.zip.map.to_a') { a.lazy.zip(b).map {|l,r| l + r }.to_a }\n ...
ruby
chosen
[ { "from": "system", "value": "Use static file lists because otherwise gem doesn't build on Github.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"conversions\"\n s.version = \"1.1\"\n s.date = \"2009-01-12\"\n s.summary = \"A Ruby on Rails plugin that...
ruby
chosen
[ { "from": "system", "value": "Make republish rake task more specific\n\nThis rake task is doing four things at the moment: republish the\npolicy, the email signup page for the policy, the parent policy and\nsends the data to rummager. We only want it to send the policy to the\npublishing-api. This also allo...
ruby
chosen
[ { "from": "system", "value": "Update the bindfs release number for source installations\n" }, { "from": "human", "value": "module VagrantPlugins\n module Bindfs\n VERSION = \"0.4.3\"\n SOURCE_VERSION = \"1.12.6\"\n end\nend\n" }, { "from": "gpt", "value": "module VagrantPlugi...
ruby
chosen
[ { "from": "system", "value": "Use array instead of if statement\n" }, { "from": "human", "value": "require 'cinch'\nrequire 'yaml'\nrequire 'redis'\n\n$config = YAML.load_file(File.join('config', 'config.yml'))\n\nclass PollingPlugin\n include Cinch::Plugin\n\n timer $config['irc']['poll_inter...
ruby
chosen
[ { "from": "system", "value": "[143] Fix the ask to open in browser dialog on Mac\n\nWhy:\n\nGitReflow::Sandbox#ask_to_open_in_browser method currently only works\nfor linux.\nThis change addresses the need by:\n\nAdd OS.mac? to the initial if statement guarding other platforms.\n\nClose #143\nLGTM given by:...
ruby
chosen
[ { "from": "system", "value": "Order sync_logs descending by started_at time\n" }, { "from": "human", "value": "class ChangeSyncPresenter < ApplicationPresenter\n presents ChangeSync\n\n def sync_logs\n SyncLogPresenter.map(model.sync_logs)\n end\nend\n" }, { "from": "gpt", "val...
ruby
chosen