conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use table_name in tags where clause\n" }, { "from": "human", "value": "module HasTags\n extend ActiveSupport::Concern\n\n included do\n scope :with_tag, -> (key) { where(\"tags ? '#{key}'\") }\n scope :with_tag_equals, -> (key, value) { where(\"tags -> '#{ke...
ruby
chosen
[ { "from": "system", "value": "Add factory trait for current season's conference\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :conference do\n name { [FFaker::CheesyLingo.title, 'Conf'].join ' ' }\n tickets 2\n end\nend\n" }, { "from": "gpt", "value": "Fa...
ruby
chosen
[ { "from": "system", "value": "Add carlhuda/bundler/master to rails master gemfile" }, { "from": "human", "value": "remove_file 'Gemfile'\ncreate_file 'Gemfile' do\n<<-GEMFILE\nsource 'http://gemcutter.org'\n\ngit 'git://github.com/rails/rails.git'\n\ngit 'git://github.com/snusnu/dm-core.git', 'b...
ruby
chosen
[ { "from": "system", "value": "Fix spec - set host\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe EZAPIClient do\n\n it 'has a version number' do\n expect(EZAPIClient::VERSION).not_to be nil\n end\n\n describe \".new\" do\n context \"with complete credentials\" do\n...
ruby
chosen
[ { "from": "human", "value": "Add spec for is.gd shrinker api\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe LinkShrink::Shrinkers::IsGd do\n include_examples 'shared_examples'\n\n let(:link_shrink) { described_class.new }\n let(:is_gd) { 'http://is.gd/create.php' }\n\n de...
ruby
chosen
[ { "from": "system", "value": "Create HBase's rootdir, either in HDFS or the local filesystem, depending on configuration\n" }, { "from": "human", "value": "#\n# Cookbook Name:: hadoop\n# Recipe:: hbase_master\n#\n# Copyright (C) 2013 Continuuity, Inc.\n# \n# Licensed under the Apache License, Ve...
ruby
chosen
[ { "from": "system", "value": "Update spec description to be easier to read.\n\nWhy:\n\n* The name in the spec was confusing.\n\nThis change addresses the need by:\n\n* Update the spec describe string.\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'support/shared_examples/a_di...
ruby
chosen
[ { "from": "system", "value": "doc: Mark RUUID::UUID marshal methods private\n" }, { "from": "human", "value": "module RUUID\n class UUID\n include Comparable\n\n # @private\n def self.from_data(data)\n uuid = allocate\n uuid.instance_variable_set :@data, data.dup.freeze\n ...
ruby
chosen
[ { "from": "system", "value": "Reduce complexity of sync algorithm\n" }, { "from": "human", "value": "class DatapointsSync\n def initialize(calculated, stored, beeminder_goal)\n @stored = stored\n @calculated = calculated\n @beeminder_goal = beeminder_goal\n last_value = stored.last ...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to support spree 1-2-stable" }, { "from": "human", "value": "# encoding: utf-8\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'spree_email_to_friend'\n s.version = '1.2'\n s.summary = 'Spree extensio...
ruby
chosen
[ { "from": "system", "value": "Add guard against empty AR configs\n\nSometimes when Rake is loaded for loading tasks AR is loaded, but its\nconfig is not. This now checks for empty config and bails to reading the\nYAML file if loaded config is empty.\n" }, { "from": "human", "value": "module WCC\...
ruby
chosen
[ { "from": "system", "value": "Fix syntax to Ruby 2.0.0\n" }, { "from": "human", "value": "require 'sinatra'\n\n# [Redis To Go | Heroku Dev Center](https://devcenter.heroku.com/articles/redistogo)\nconfigure do\n require 'redis'\n uri = URI.parse(ENV['REDISTOGO_URL'])\n REDIS = Redis.new(:host...
ruby
chosen
[ { "from": "system", "value": "Switch to the simpler Sinatra Base style - let's keep it simple for now and remove unnecessary complexity.\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'sinatra'\n\nclass Grokily < Sinatra::Application\n\n # Not using the API? Just redirect to Gith...
ruby
chosen
[ { "from": "system", "value": "REmove the marketcap from message.\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'httparty'\nrequire 'json'\nrequire 'nokogiri'\nrequire 'open-uri'\n\nURL = \"https://coinmarketcap.com/currencies/views/all/\"\n\nget '/' do\n 'Nothing to see here.'\n...
ruby
chosen
[ { "from": "system", "value": "Update IP to point to host-only IP used in bosh-solo\n" }, { "from": "human", "value": "require 'riak'\n\n# Create a client interface\nclient = Riak::Client.new\n\n# Create a client interface that uses Excon\nclient = Riak::Client.new(:http_backend => :Excon)\n\n# A...
ruby
chosen
[ { "from": "system", "value": "Fix testing default search for association columns\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), '../test_helper.rb')\nrequire File.join(File.dirname(__FILE__), '../model_stub')\n\nclass AssociationColumnTest < Test::Unit::TestCase\n ...
ruby
chosen
[ { "from": "human", "value": "Create test for `Notifiers` module\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass NotifiersTest < ActiveSupport::TestCase\n test 'pushbullet' do\n assert Notifiers.new(:pushbullet).instance_of?(Notifiers::Pushbullet)\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Add a legacy model to make_states_events_polymorphic migration\n" }, { "from": "human", "value": "class MakeStateEventsPolymorphic < ActiveRecord::Migration\n def self.up\n rename_column :state_events, :order_id, :stateful_id\n add_column :state_events, :stat...
ruby
chosen
[ { "from": "human", "value": "Load 'Gitlab::Jira::Middleware' if it exists\n\nLoads 'Gitlab::Jira::Middleware' only if it exists\nso this initializer can be backported to CE.\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\n# Changes JIRA DVCS user agent requests in order to be s...
ruby
chosen
[ { "from": "system", "value": "Use the new \"sexy\" validations for SnapshotDiffCluster\n\nAs pointed out by Rubocop. This resolves all of the cops for this file.\n\nChange-Id: I51fa7444f9f717f3f2848ff1bb87bd409ebbbe7b\n" }, { "from": "human", "value": "# Contains information about a cluster of d...
ruby
chosen
[ { "from": "system", "value": "Add Cucumber page not accessible\n" }, { "from": "human", "value": "Then(/^the page should be accessible$/) do\n expect(page).to be_accessible\nend\n\nThen(/^\"(.*?)\" should be accessible$/) do |scope|\n expect(page).to be_accessible(scope)\nend\n\nThen(/^\"(.*?)...
ruby
chosen
[ { "from": "system", "value": "Switch to better error type\n" }, { "from": "human", "value": "module ActiveInteraction\n class ArrayFilter < Filter\n include MethodMissing\n\n # @param value [Object]\n #\n # @return [Array<Object>]\n #\n # @raise (see Filter#cast)\n def cast...
ruby
chosen
[ { "from": "system", "value": "Add to_h method for grabbers\n" }, { "from": "human", "value": "require 'open-uri'\n\nclass IdsPlease\n module Grabbers\n class Base\n\n def self.interact(links)\n links.map { |l| self.new(l).grab_link }\n end\n\n attr_reader :avatar, :disp...
ruby
chosen
[ { "from": "system", "value": "Allow classes to have attributes added more than once\n\nIn case they change things and a third party wants to monkey patch." }, { "from": "human", "value": "# @abstract The base class for all JIRA objects that can given by the server.\nclass JIRA::Entity\n\n class...
ruby
chosen
[ { "from": "system", "value": "Decrease active_record requirement from 3.1 to 3.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n \nGem::Specification.new do |s|\n s.name = 'foreigner'\n s.version = '1.2.0'\n s.summary = 'Foreign Keys for Rails'\n s.description = 'Adds helpers ...
ruby
chosen
[ { "from": "system", "value": "Replace an if statement with when/case\n" }, { "from": "human", "value": "module DidYouMean\n module NameErrorFinders\n def self.included(*)\n raise \"Do not include this module since it overrides Class.new method.\"\n end\n\n def self.new(exception)\...
ruby
chosen
[ { "from": "system", "value": "Update the install generator to add the new location responder commented out\n" }, { "from": "human", "value": "module Responders\n module Generators\n class InstallGenerator < Rails::Generators::Base\n source_root File.expand_path(\"..\", __FILE__)\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add an html extension to the temp file\n\nAn extension can be added to the temp file (created behind the scene by `Tempfile.new`). It helps Safari recognize that the file is an HTML document.\r\n\r\nIt is a possible solution for https://github.com/ianks/octodown/issues/34" }...
ruby
chosen
[ { "from": "human", "value": "Refactor stack parsing and engine interaction\n" }, { "from": "gpt", "value": "require 'ruote'\nrequire 'json'\nrequire 'stackmate/stack'\nrequire 'stackmate/logging'\nrequire 'stackmate/classmap'\nrequire 'stackmate/participants/cloudstack'\nrequire 'stackmate/parti...
ruby
chosen
[ { "from": "system", "value": "Add a dev gem dependency.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/firmata/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"'Mike Breen'\"]\n gem.email = [\"hardbap@gmail....
ruby
chosen
[ { "from": "system", "value": "Create the entire path if needed.\n" }, { "from": "human", "value": "require \"json\"\n\nmodule Jekyll\n API_DIRECTORY = \"api\"\n\n class ApiStaticFile < StaticFile\n def initialize(site, base, dir, name, content)\n super(site, base, dir, name)\n\n @...
ruby
chosen
[ { "from": "system", "value": "Drop --source flag from update\n" }, { "from": "human", "value": "module Bummr\n class Updater\n def initialize(outdated_gems)\n @outdated_gems = outdated_gems\n end\n\n def update_gems\n puts \"Updating outdated gems\".green\n\n @outdated_g...
ruby
chosen
[ { "from": "system", "value": "Fix a nullpointer exception on empty result set\n" }, { "from": "human", "value": "require 'active_support/time'\nrequire 'ap'\nrequire 'forwardable'\nrequire 'irb'\nrequire 'ripl'\nrequire 'terminal-table'\n\nrequire 'druid'\n\nRipl::Shell.class_eval do\n def form...
ruby
chosen
[ { "from": "system", "value": "Remove `nil` from collected URLs\n" }, { "from": "human", "value": "class Ghn\n class Collector\n def initialize(client, repo_full_name = nil)\n @client = client\n @repo_full_name = repo_full_name\n end\n\n def collect(page = 1)\n notificati...
ruby
chosen
[ { "from": "system", "value": "Fix a typo in the CollectionView template.\n" }, { "from": "human", "value": "class <%= @name_camel_case %>ControllerStylesheet < ApplicationStylesheet\n\n include <%= @name_camel_case %>CellStylesheet\n\n def setup\n # Add stylesheet specific setup stuff here....
ruby
chosen
[ { "from": "system", "value": "Add intro paragraph to new request template" }, { "from": "human", "value": "# Add a callback - to be executed before each request in development,\n# and at startup in production - to patch existing app classes.\n# Doing so in init/environment.rb wouldn't work in de...
ruby
chosen
[ { "from": "system", "value": "Refactor Rip::Nodes::Try to accept catches and finally" }, { "from": "human", "value": "module Rip::Nodes\n class Try < Base\n attr_reader :body\n\n def initialize(location, body)\n super(location)\n @body = body\n end\n\n def ==(other)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix new submissions not being reported to Slack\n\nThe scheduled job that reports new submissions to Slack on a weekly\nbasis was reporting 0 new submissions, despite there being two.\n\nThis was caused by the query checking the `created_at` (a `DateTime`)\nagainst an array of ...
ruby
chosen
[ { "from": "system", "value": "Update sniff dependency to 1.x\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"purchase/version\"\n\nGem::Specification.new do |s|\n s.name = %q{purchase}\n s.version = BrighterPlanet::Purchas...
ruby
chosen
[ { "from": "system", "value": "Update the commit hash in the podspec to work and pass validation.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Forecastr\"\n s.version = \"0.0.1\"\n s.summary = \"A simple Objective-C wrapper for the Forecast.io API\"\n ...
ruby
chosen
[ { "from": "system", "value": "Fix test fallout from dashboard cleanup\n" }, { "from": "human", "value": "require \"rails_helper\"\n\ndescribe \"dashboard\" do\n before :each do\n active_user = create(:user, active: true)\n login_as(active_user, :scope => :user)\n visit dashboards_path\...
ruby
chosen
[ { "from": "system", "value": "Refactor specs to remove duplication\n" }, { "from": "human", "value": "class NoArgsClass\n include Nala::Publisher\n\n def call\n end\nend\n\nclass OneArgClass\n include Nala::Publisher\n\n def call(_)\n end\nend\n\nRSpec.describe Nala::Publisher do\n descri...
ruby
chosen
[ { "from": "human", "value": "Add test for QML signal connect\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe \"QML signal connection\" do\n\n let(:component) do\n QML::Component.new(data: <<-QML)\n import QtQuick 2.0\n QtObject {\n signal someSignal(var ar...
ruby
chosen
[ { "from": "system", "value": "Check if methods are available\n" }, { "from": "human", "value": "require 'CLIntegracon'\n\ndescribe 'CLIntegracon::Adapter::Bacon' do\n\n describe '#describe_cli' do\n\n # These specs are executed in a sub-shell, to ensure we don't get any output we don't want....
ruby
chosen
[ { "from": "system", "value": "Update Fontawesome to sha256 checksums\n" }, { "from": "human", "value": "class FontFontawesome < Cask\n url 'http://fortawesome.github.io/Font-Awesome/assets/font-awesome-4.0.3.zip'\n homepage 'http://fortawesome.github.io/Font-Awesome/'\n version '4.0.3'\n sha...
ruby
chosen
[ { "from": "system", "value": "Add a test case for show action in account controller.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass AccountsControllerTest < ActionController::TestCase\n test \"should get index\" do\n get :index\n assert_response :success\n assert_not...
ruby
chosen
[ { "from": "system", "value": "Add transpec as a development dependency\n" }, { "from": "human", "value": "lib = File.expand_path(\"../lib\", __FILE__)\n$:.unshift lib unless $:.include? lib\n\nrequire \"savon/multipart/version\"\n\nGem::Specification.new do |s|\n s.name = \"savon-multipa...
ruby
chosen
[ { "from": "system", "value": "Order benefit checks by ID\n" }, { "from": "human", "value": "class DwpMonitor\n\n def initialize\n dwp_results\n end\n\n def state\n if percent >= 50.0\n 'offline'\n elsif percent >= 25.0\n 'warning'\n else\n 'online'\n end\n end\n...
ruby
chosen
[ { "from": "system", "value": "Add runtime and development 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 'perfecta/version'\n\nGem::Specification.new do |gem|\...
ruby
chosen
[ { "from": "human", "value": "Make sure that rspec booster works even if the split config is empty\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe \"RSpec Booster behvaviour when split configuration is empty\" do\n\n let(:project_path) { \"/tmp/project_path-#{SecureRandom.uu...
ruby
chosen
[ { "from": "system", "value": "Fix paths so that the tests can require the formatter\n" }, { "from": "human", "value": "require 'aruba/cucumber'\n" }, { "from": "gpt", "value": "require 'aruba/cucumber'\n\nBefore do\n # ensure Cucumber's Ruby process can require the plugin as though ...
ruby
chosen
[ { "from": "system", "value": "Fix test runner output on 1.9\n" }, { "from": "human", "value": "module Hector\n class TestCase < Test::Unit::TestCase\n undef_method :default_test if method_defined?(:default_test)\n\n def self.test(name, &block)\n define_method(\"test #{name.inspect}\"...
ruby
chosen
[ { "from": "system", "value": "[Specs] Fix issue with missing tmp dir\n" }, { "from": "human", "value": "# Restores the config to the default state before each requirement\n\nmodule Bacon\n class Context\n old_run_requirement = instance_method(:run_requirement)\n\n define_method(:run_requi...
ruby
chosen
[ { "from": "system", "value": "Set test logger level to WARN\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"metal_archives\"\n\nMetalArchives.configure do |c|\n ## Application identity (required)\n c.app_name = \"MetalArchivesGemTestSuite\"\n c.app_version = Meta...
ruby
chosen
[ { "from": "system", "value": "Remove return params check as is no longer required due to save and complete button being removed" }, { "from": "human", "value": "class ClaimsController < ApplicationController\n before_action :ensure_claim_in_progress, only: %i<show update>\n skip_before_actio...
ruby
chosen
[ { "from": "system", "value": "[ManageController] Refactor how PushJobs are loaded.\n\n(Not working yet as the class methods are not working)\n" }, { "from": "human", "value": "require 'app/controllers/app_controller'\nrequire 'app/helpers/manage_helper'\nrequire 'app/models/pod'\n\nrequire 'sina...
ruby
chosen
[ { "from": "system", "value": "Fix error when anchor is undefined in params\n" }, { "from": "human", "value": "require 'addressable/uri'\n\nclass SearchController < ApplicationController\n def search\n @results = @search.perform\n\n respond_to do |format|\n format.html {\n if @...
ruby
chosen
[ { "from": "system", "value": "Add retired to service active states\n" }, { "from": "human", "value": "class ServiceRetireRequest < MiqRetireRequest\n TASK_DESCRIPTION = 'Service Retire'.freeze\n SOURCE_CLASS_NAME = 'Service'.freeze\n\n delegate :service_template, :to => :source, :allow_nil =...
ruby
chosen
[ { "from": "system", "value": "Make Activity objects serializable for db-storage\n" }, { "from": "human", "value": "require 'statisfaction/activity/dsl'\n\nmodule Statisfaction\n class Activity\n def initialize(klass, method)\n self.watched_class = klass\n self.watched_activity = me...
ruby
chosen
[ { "from": "system", "value": "Set dependency to match >= 0.20.0dev\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"RKTableController\"\n s.version = \"0.5.0\"\n s.summary = \"RKTableController provides stateful, network integrated UITableViews powered by...
ruby
chosen
[ { "from": "system", "value": "Add spec for a shared backend with other prefixes\n" }, { "from": "human", "value": "describe 'standard_memory_with_prefix', adapter: :Memory do\n moneta_store :Memory, {prefix: \"moneta\"}\n moneta_specs STANDARD_SPECS.without_persist.with_each_key\n\n context '...
ruby
chosen
[ { "from": "system", "value": "Set color of 'Save' button on PoemPicker\n" }, { "from": "human", "value": "class PoemsNumberSelectedItem < BBBadgeBarButtonItem\n\n class << self\n def create_with_origin_x(org_x, title=nil)\n self.alloc.initWithCustomUIButton(create_base_button(title)).ta...
ruby
chosen
[ { "from": "system", "value": "Change call to parameterize to use Rails 5 syntax\n" }, { "from": "human", "value": "require \"graphviz\"\n\nmodule AASM\n class Graph < ::GraphViz\n def initialize(class_name, options = {})\n options = {path: '.'}.merge(options)\n\n @file_path = File....
ruby
chosen
[ { "from": "system", "value": "Declare methods in a singleton class, removing redundant calls in self\n" }, { "from": "human", "value": "module SRT\n class Parser\n def self.framerate(framerate_string)\n mres = framerate_string.match(/(?<fps>\\d+((\\.)?\\d+))(fps)/)\n mres ? mres[\"...
ruby
chosen
[ { "from": "system", "value": "Change csv separation to 'tab'\n" }, { "from": "human", "value": "require 'csv'\nrequire 'json'\n\n\nnamespace :db do\n task :seed_words, [:directory] => :environment do |args|\n CSV.foreach(File.open(Rails.root + \"test/testdata/words.csv\", \"r\"), col_sep: ';...
ruby
chosen
[ { "from": "system", "value": "Add a rake task to resolve all redirect chains\n" }, { "from": "human", "value": "namespace :db do\n task remove_unused_fields_from_assets: :environment do\n if Asset.unscoped.where(access_limited: true).none?\n Asset.update_all('$unset' => { 'access_limite...
ruby
chosen
[ { "from": "system", "value": "Make Rspec fail on first error (--fail-fast) so as to not overwhelm gym members\n" }, { "from": "human", "value": "desc \"Run the exercise specs\"\ntask :go => \"spec:exercises\"\n" }, { "from": "gpt", "value": "desc \"Run the exercise specs\"\nRSpec::Co...
ruby
chosen
[ { "from": "human", "value": "Add test for Hanzo::Deploy module\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Hanzo::CLI do\n describe :deploy do\n let(:env) { 'production' }\n let(:branch) { '1.0.0' }\n let(:deploy!) { Hanzo::CLI.new(['deploy', env]) }\n let(:mi...
ruby
chosen
[ { "from": "system", "value": "Call super and add a comment\n" }, { "from": "human", "value": "class AuthenticatedUser < User\n def payload\n attrs = {\n \"id\" => id,\n \"handle\" => handle,\n \"mfa\" => mfa_level\n }\n attrs[\"email\"] = email unless hide_email\n att...
ruby
chosen
[ { "from": "system", "value": "Fix warnings from `pod lib lint`\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\ns.name = 'AEXML'\ns.summary = 'Swift minion for simple and lightweight XML parsing'\ns.version = '4.4.0'\ns.license = { :type => 'MIT', :file => 'LICENSE' }\n\ns.source = { :...
ruby
chosen
[ { "from": "system", "value": "Refactor PublisherUpdate to be enumerable\n\nAlso, comment to steps performed on each feature.\n" }, { "from": "human", "value": "module Georelevent\n module Services\n class PublisherUpdate < Struct.new(:features, :publisher)\n def self.call(*args)\n ...
ruby
chosen
[ { "from": "human", "value": "Add convenience loader for Commands\n" }, { "from": "gpt", "value": "require File.expand_path(File.join(File.dirname(__FILE__), 'commands', 'base'))\nrequire File.expand_path(File.join(File.dirname(__FILE__), 'commands', 'pick'))\nrequire File.expand_path(File.join(F...
ruby
chosen
[ { "from": "system", "value": "Comment out password line. Not using text passwords for now.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: basic_config\n# Recipe:: default\n#\n\n# Your application(s) shouldn't run as root.\n# Each should have a username assigned to it.\n\n# Allow Chef to...
ruby
chosen
[ { "from": "system", "value": "Remove dependency on alpha cut\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"paper_ticket/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n...
ruby
chosen
[ { "from": "system", "value": "Allow application routes to work within custom layouts.\n\n* Changed `ExceptionallyBeautiful::ApplicationController` to inherit from `::ApplicationController`.\n* Include `Rails.application.routes.url_helpers` as a helper in our `ExceptionallyBeautiful::ApplicationController` s...
ruby
chosen
[ { "from": "system", "value": "Fix typo in package name.\n" }, { "from": "human", "value": "cask :v1 => 'photoshop-webm' do\n version '1.0.1'\n sha256 '68a2d856d545a4b7e3ccc39f5cbf635ed97d33322eac494b121c40bb32a69688'\n\n url 'http://www.fnordware.com/downloads/WebM_Premiere_v1.0.1.dmg'\n nam...
ruby
chosen
[ { "from": "system", "value": "Use Version.latest.count instead of total_count since AR hates DISTINCT\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n def index\n @count = Rubygem.total_count\n @latest = Rubygem.latest\n @downloaded = Rubygem.downloaded...
ruby
chosen
[ { "from": "system", "value": "Fix bug @latest_release for Github\n" }, { "from": "human", "value": "class RootController < ApplicationController\n def index\n\n if user_signed_in?\n redirect_to users_dossiers_path\n\n elsif gestionnaire_signed_in?\n redirect_to backoffice_dossie...
ruby
chosen
[ { "from": "system", "value": "Include the pundit serializer in the ApplicationPolicy class.\n" }, { "from": "human", "value": "class ApplicationPolicy\n\n attr_reader :user, :record\n\n def initialize(user, record)\n @user = user\n @record = record\n end\n\n def index?\n scope.exist...
ruby
chosen
[ { "from": "system", "value": "Fix the logic for pry-rails dependency checking\n\nThe check was just backwards so I made the name of the method more explicit\nand changed the if to an unless.\n" }, { "from": "human", "value": "require 'rails/version'\n\nmodule ActiveAdmin\n module DependencyChec...
ruby
chosen
[ { "from": "system", "value": "Change to pass data to transition event.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule FiniteMachine\n # A class representing a callback transition event\n class TransitionEvent\n\n attr_accessor :from\n\n attr_accessor :to\n\n attr_acces...
ruby
chosen
[ { "from": "system", "value": "Use class_eval with block in Representer::Timestamped\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule Panther\n module Representer\n module Timestamped\n def self.included(klass)\n klass.class_eval <<-RUBY\n property...
ruby
chosen
[ { "from": "human", "value": "test/cli: Add tests for `kbsecret todo`\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"helpers\"\n\n# Tests for KBSecret::CLI::Command::Todo\nclass KBSecretCommandTodoTest < Minitest::Test\n include Helpers\n include Helpers::CLI\n\n d...
ruby
chosen
[ { "from": "system", "value": "Update Podspec by removing \"v\" prefix in pod tag.\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = \"GAuth\"\n spec.version = \"0.1.0\"\n spec.summary = \"Authentication to Google services made easy.\"\n spec.homepage = \"https://www.gi...
ruby
chosen
[ { "from": "system", "value": "Make sure db/migrate exists before copying to it.\n" }, { "from": "human", "value": "\n# copy migrations\nDir[\"#{Rails.root}/vendor/plugins/simple_metrics_engine/db/migrate/*.rb\"].each do |file|\n puts \"Copying #{File.basename(file)} to db/migrate\"\n FileUtils...
ruby
chosen
[ { "from": "system", "value": "1.0.13: Update to kramdown-1.4; include LICENSE file in gem\n" }, { "from": "human", "value": "spec = Gem::Specification.new do |s|\n s.name = 'kramdown-rfc2629'\n s.version = '1.0.12'\n s.summary = \"Kramdown extension for generating RFC 2629 XML.\"\n s.descrip...
ruby
chosen
[ { "from": "system", "value": "Fix test for DDL transactions. (better regex for DDL specific message)\n" }, { "from": "human", "value": "require 'cases/sqlserver_helper'\n\nclass MigrationTestSqlserver < ActiveRecord::TestCase\n \n context 'For transactions' do\n \n setup do\n @conne...
ruby
chosen
[ { "from": "system", "value": "Fix bad reference to Sprockets::Asset.pathname\n" }, { "from": "human", "value": "# Naive fallback asset finder for when sprockets >= 3.0 &&\n# config.assets.precompile = false\n# Thanks to @ryanswood for the original code:\n# https://github.com/AbleHealth/inline_sv...
ruby
chosen
[ { "from": "system", "value": "Fix count in log note and use tables\n" }, { "from": "human", "value": "module Footnotes\n module Notes\n class LogNote < AbstractNote\n\n autoload :NoteLogger, 'rails-footnotes/notes/log_note/note_logger'\n\n cattr_accessor :logs\n cattr_accessor...
ruby
chosen
[ { "from": "system", "value": "Use :try to catch missing :public role.\n" }, { "from": "human", "value": "module Roleify\n module RoleifyableController\n\n def self.included(base)\n base.before_filter :allowed?\n end\n\n #TODO make deny action configurable, now depends on Clearance...
ruby
chosen
[ { "from": "system", "value": "Use :try to catch missing :public role.\n" }, { "from": "human", "value": "module Roleify\n module RoleifyableController\n\n def self.included(base)\n base.before_filter :allowed?\n end\n\n #TODO make deny action configurable, now depends on Clearance...
ruby
chosen
[ { "from": "system", "value": "Update podspec version: 0.6.4 -> 0.6.5\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'POSRx'\n s.version = '0.6.4'\n s.license = 'MIT'\n s.summary = 'Utilities around ReactiveCocoa.'\n s.homepage = 'https://github...
ruby
chosen
[ { "from": "system", "value": "Update bundler requirement from ~> 1.6 to ~> 2.1\n\nUpdates the requirements on [bundler](https://github.com/bundler/bundler) to permit the latest version.\n- [Release notes](https://github.com/bundler/bundler/releases)\n- [Changelog](https://github.com/bundler/bundler/blob/mas...
ruby
chosen
[ { "from": "system", "value": "Fix `nil[]` error with unknown Vagrant version\n" }, { "from": "human", "value": "vagrant_version = Gem::Version.new(Vagrant::VERSION)\nsupported_version = {\n \"< 1.1.0\" => \"1_0\",\n \"~> 1.1.0\" => \"1_1\",\n \"~> 1.2.0\" => \"1_2\",\n \"~> 1.3.0\" => \"1_3...
ruby
chosen
[ { "from": "system", "value": "Test with invalid API key\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass OauthTest < ActionDispatch::IntegrationTest\n setup do\n @application = create(:application) # OAuth application\n @questionnaire = create(:questionnaire)\n @user =...
ruby
chosen
[ { "from": "system", "value": "Fix Bug for ruby 1.8.7\n" }, { "from": "human", "value": "module Libvirt\n module Ruby\n class Util\n extend FFI::Library\n\n def self.method_missing(method, *args)\n args.flatten!\n return_type = args.delete(args.last)\n dispatche...
ruby
chosen
[ { "from": "system", "value": "Add methods to Integer: divisible?, up, down\n" }, { "from": "human", "value": "class Integer\n\n\tdef factors\n\t\t#first half\n\t\tfactors = []\n\t\tfor i in 1..self\n\t\t\tif self % i == 0\n\t\t\t\tif i < self/i\n\t\t\t\t\tfactors << i\n\t\t\t\telse break\n\t\t\t...
ruby
chosen
[ { "from": "system", "value": "Remove ugly & incomplete fix for Rubinius File.relative_path\n" }, { "from": "human", "value": "def File.relative_path(path, base=nil)\n base ||= '.'\n casefold = File::ALT_SEPARATOR=='\\\\'\n # Note: currently Rubinius differs from MRI in that\n # File.expa...
ruby
chosen
[ { "from": "system", "value": "Return numbers from screen_size, kthxbai...\n" }, { "from": "human", "value": "class Pry::TerminalInfo\n # Return a pair of [rows, columns] which gives the size of the window.\n #\n # If the window size cannot be determined, return nil.\n def self.screen_size\n ...
ruby
chosen
[ { "from": "system", "value": "Remove debug logging that broke stuff\n" }, { "from": "human", "value": "require 'shipitron'\nrequire 'shipitron/find_docker_volume_name'\n\nmodule Shipitron\n class S3Copy\n include Metaractor\n\n required :source\n required :destination\n required :re...
ruby
chosen