conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add a homepage and safer dependency to the gemspec.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"knife-wsfusion\"\n s.version = \"0.1.0\"\n s.summary = \"VMware Workstation/Fusion support for Knife\"\n\n s.required_rubyge...
ruby
chosen
[ { "from": "system", "value": "Add model-level default sort order to Query::User.\n\nSee query.rb.old line 698.\nAlso see abstract_query.rb.old#old\n" }, { "from": "human", "value": "class Query::User < Query::Base\n def self.parameter_declarations\n super.merge(\n created_at?: [:time],\...
ruby
chosen
[ { "from": "system", "value": "Fix and improve S3/Heroku integration\n\n- The existing code caused exceptions in all environments but production. This is now fixed.\n- No need to use a constant – a regular variable will do just fine.\n- Use Pathname's own #exist? method rather than FileTest.\n- There should ...
ruby
chosen
[ { "from": "system", "value": "Update test of data to check for the method actually used rather than assume that an object that responds to :to_a can respond to :map.\n\nThis resolves https://github.com/bellycard/napa/issues/216\n" }, { "from": "human", "value": "module Napa\n module GrapeHelper...
ruby
chosen
[ { "from": "system", "value": "Update the podspec to point to correct tag (2.1.1)\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"ETA-SDK\"\n s.version = \"2.1.0\"\n s.summary = \"eTilbudsavis iOS SDK.\"\n s.description = <<-DESC\n A...
ruby
chosen
[ { "from": "system", "value": "Remove api call from CurrentWeather class\n" }, { "from": "human", "value": "class CurrentWeather\n\n attr_reader :zip\n\n def initialize(zip = \"#{DEFAULT}\")\n if zip.downcase == 'work'\n zip = \"#{WORK}\"\n elsif zip.downcase == 'home'\n zip = \...
ruby
chosen
[ { "from": "system", "value": "Add delayed_job_args variable for Capistrano recipe to allow configuration of started workers (e.g. \"-n 2 --max-priority 10\")\n" }, { "from": "human", "value": "# Capistrano Recipes for managing delayed_job\n#\n# Add these callbacks to have the delayed_job process...
ruby
chosen
[ { "from": "system", "value": "Use Time.zone instead of Date.today\n\nMake use of the apps configured `London` timezone when\ngetting todays date.\n\nUsing Date.today will use the time on the server and not\nthe time zone configured by the application. This can lead\nsome indetermination when running code ou...
ruby
chosen
[ { "from": "system", "value": "Revert \"no need to compute clone_dir if homepage is empty\"\n\nThis reverts commit 1a1a43c660c38d5bb2552e120df93e6b8caf6558.\n\nReason: for future refactorings\n" }, { "from": "human", "value": "require 'rubygems'\n\nGem.post_install do |installer|\n if (repo = in...
ruby
chosen
[ { "from": "system", "value": "Make sure the version_option is available" }, { "from": "human", "value": "if RUBY_VERSION.to_f < 0.11\n\n ui = Gem::UserInteraction.new\n ui.alert_warning 'rubygems-compile requires MacRuby 0.11 or newer'\n ui.alert_warning 'rubygems-compile will not be loaded'\...
ruby
chosen
[ { "from": "system", "value": "Enable provision with --provision-with flag\n" }, { "from": "human", "value": "module VagrantPlugins\n module CommandUp\n module StartMixins\n # This adds the standard `start` command line flags to the given\n # OptionParser, storing the result in the ...
ruby
chosen
[ { "from": "system", "value": "Remove \"closed\" from Bug Factory\n\nNot necessary for a valid record." }, { "from": "human", "value": "FactoryGirl.define do\n factory(:bug, class: 'Bug') do\n title { \"#{Faker::Commerce.product_name} can’t #{Faker::Company.bs}\" }\n reporter\n descript...
ruby
chosen
[ { "from": "system", "value": "Fix undefined method `raw_push` error\n\nError:\n\n sidekiq-2.17.7/lib/sidekiq/testing.rb:59:in `alias_method':\n undefined method `raw_push' for class `Sidekiq::Client' (NameError)\n\nSee https://github.com/mperham/sidekiq/issues/1125\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Fix DEPRECATION WARNING of Devise\n\n```\nDEPRECATION WARNING: [Devise] including `Devise::TestHelpers` is deprecated and will be removed from Devise.\nFor controller tests, please include `Devise::Test::ControllerHelpers` instead.\n```\n" }, { "from": "human", "val...
ruby
chosen
[ { "from": "human", "value": "Add a Cask for Seashore.\n" }, { "from": "gpt", "value": "class Seashore < Cask\n url 'https://sourceforge.net/projects/seashore/files/seashore%20binaries/Seashore%200.5.1/Seashore.zip/download'\n homepage 'http://seashore.sourceforge.net/'\n version '0.5.1'\n co...
ruby
chosen
[ { "from": "human", "value": "Add WireOver.app v100 of the beta\n\nAdd support for the installation of WireOver, a desktop application\nfor sending and receiving files.\n\nFix version and checksum for WireOver.app Cask\n\nChange version to 'latest' and SHA256 to 'no_checksum'\nper pull request review.\n\nFix...
ruby
chosen
[ { "from": "system", "value": "Use a Set for better performance of whitelist\n" }, { "from": "human", "value": "module Bouncer\n class Base < Struct.new(:context, :renderer)\n extend Forwardable\n\n def_delegators :context, :request\n\n private\n def guarded_redirect(url)\n if leg...
ruby
chosen
[ { "from": "system", "value": "Fix undefined Coffee module issue\n" }, { "from": "human", "value": "require 'rails/railtie'\n\nmodule Coffee::Rails\n class Railtie < ::Rails::Railtie\n config.app_generators.javascript_engine :coffee\n end\nend\n" }, { "from": "gpt", "value": "req...
ruby
chosen
[ { "from": "system", "value": "Switch custom routes over to rails 4\n" }, { "from": "human", "value": "# Here you can override or add to the pages in the core website\n\nAlaveteli::Application.routes.draw do\n # brand new controller example\n # match '/mycontroller' => 'general#mycontroller...
ruby
chosen
[ { "from": "system", "value": "Refactor so can selectively generate different jpa elements\n" }, { "from": "human", "value": "module Domgen\n module Generator\n def self.define_jpa_templates\n template_dir = \"#{File.dirname(__FILE__)}/templates\"\n java_class_prefix = 'java/#{objec...
ruby
chosen
[ { "from": "system", "value": "Remove AS and AP stuff from API backtrace\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(\"../dummy/config/environment\", __FILE__)\nrequire 'rspe...
ruby
chosen
[ { "from": "system", "value": "Add explicit dependency on rake gem\n\nThis appears to be required as of Ruby 2.3, otherwise we get a LoadError\nwhen attempting to run `bundle exec rspec` (since our SimpleCov\nintegration loads rake).\n" }, { "from": "human", "value": "$LOAD_PATH << File.expand_pa...
ruby
chosen
[ { "from": "system", "value": "Allow to configure multiple omniauth strategies\n" }, { "from": "human", "value": "require 'omniauth'\nrequire 'omniauth-registrar'\n\nmodule Registrar\n module Middleware\n def self.configure(&blk)\n yield config\n\n convert_params_to_registrar_schema...
ruby
chosen
[ { "from": "system", "value": "Use mate or show! in irb to open in EDITOR\n" }, { "from": "human", "value": "require 'uri'\n\nmodule Sinatra\n \n module TestMethods\n\n %w(get post put delete).each do |verb|\n module_eval <<-end_eval\n def #{verb}_it(path, params = {})\n ...
ruby
chosen
[ { "from": "system", "value": "Use more descriptive variable names.\n" }, { "from": "human", "value": "require 'uri'\nrequire 'strscan'\n\nmodule URI\n #\n # Expands a URI decoded path, into a proper absolute path.\n #\n # @param [String] path\n # The path from a URI.\n #\n # @return [St...
ruby
chosen
[ { "from": "human", "value": "Create test for `Notifiers::Base` class\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass Notifiers::BaseTest < ActiveSupport::TestCase\n test '#notify' do\n base = Notifiers::Base.new\n base.define_singleton_method(:perform) do\n true\n ...
ruby
chosen
[ { "from": "system", "value": "Add a rake task to create a whitehall asset\n" }, { "from": "human", "value": "require 'asset_processor'\n\nnamespace :govuk_assets do\n desc 'Delete file from NFS for assets uploaded to S3'\n task delete_file_from_nfs_for_assets_uploaded_to_s3: :environment do\n ...
ruby
chosen
[ { "from": "system", "value": "Make substitution a method of *target* alphabet.\n" }, { "from": "human", "value": "class Alphabet\n # chars is an array of character strings, like [\"A\", \"B\", \"C\" ...]\n def initialize(chars, options = {})\n @chars = chars.to_a.rotate(options[:shift] || 0...
ruby
chosen
[ { "from": "system", "value": "Add missing require statements to module\n" }, { "from": "human", "value": "require \"dataly/version\"\n\nrequire 'logger'\nrequire 'csv'\nrequire 'active_support/core_ext/class/attribute'\nrequire 'active_support/core_ext/object/blank'\n\nmodule Dataly\nend\n\nrequ...
ruby
chosen
[ { "from": "system", "value": "Reset trend arrows styling, new ones are too thin\n" }, { "from": "human", "value": "module GithubDashing\n\tclass Helper\n\n\t\t# Compare to last month by using multiplier based on month \"progress\"\n\t\t# Example: 50 requests in all of March, 40 requests until 15...
ruby
chosen
[ { "from": "system", "value": "Add require for Holidays Wrapper\n" }, { "from": "human", "value": "# Usage:\n#\n# Nickel.parse \"some query\", Time.local(2011, 7, 1)\n#\n# The second term is optional.\n\nrequire 'nickel/version'\nrequire 'nickel/nlp'\n\nmodule Nickel\n class << self\n def p...
ruby
chosen
[ { "from": "system", "value": "Make sure load internals module first.\n" }, { "from": "human", "value": "require 'yajl'\nrequire 'json'\nrequire 'uri'\nrequire 'hashie'\nrequire 'active_model'\n\nrequire_relative 'plotrb/visualization'\nrequire_relative 'plotrb/errors'\nrequire_relative 'plotrb/d...
ruby
chosen
[ { "from": "system", "value": "Use standard GOV.UK authors and email in the gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib/', __FILE__)\n$:.unshift lib unless $:.include?(lib)\n\nrequire 'plek/version'\n\nGem::Specification.new do |s|\n s.nam...
ruby
chosen
[ { "from": "system", "value": "Move array: true to the end of the migration\n" }, { "from": "human", "value": "class AddTagsToArticles < ActiveRecord::Migration[4.2]\n def change\n \tadd_column :articles, :tags, :string, array: true, default: []\n end\nend\n" }, { "from": "gpt", "v...
ruby
chosen
[ { "from": "system", "value": "Move let!(:certificate) to each context\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'rails_helper'\n\nRSpec.describe LetsEncrypt::VerificationsController, type: :controller do\n routes { LetsEncrypt::Engine.routes }\n class OtherMod...
ruby
chosen
[ { "from": "system", "value": "Remove test files from build gem\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'alchemy/pg_search/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "human", "value": "Add Busca Binária em Ruby" }, { "from": "gpt", "value": "\ndef BuscaBinaria(valor, vetor, esquerda, direita)\n\tmeio = ((esquerda+direita)/2).floor\n\n\tif esquerda <= direita\n\n\t\tif valor > vetor[meio]\n\t\t\tesquerda = meio + 1\n\t\t\treturn BuscaBinaria(valor, ...
ruby
chosen
[ { "from": "system", "value": "Update podspec version to v1.0.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"AutoLayoutBuilder\"\n s.version = \"0.0.3\"\n s.license = \"MIT\"\n s.summary = \"Create adaptive layouts with an expressive yet concise ...
ruby
chosen
[ { "from": "system", "value": "Update the pod spec for new release.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Underscore.m'\n s.version = '0.2.1'\n s.license = 'MIT'\n s.summary = 'A functional toolbelt for Objective-C.'\n s.homepage = 'https://github.com/rob...
ruby
chosen
[ { "from": "system", "value": "Fix logins to zendesk when user signups with a single name\n\nWhen a user signs up for an account at https://manage.chef.io/signup and\nonly enters a single name then only the last name field is populated.\nThis causes an error when trying to zendesk because the name we send is...
ruby
chosen
[ { "from": "system", "value": "Make minimum listen version 2.7\n\nBecause versions of listen < 2.7 have a bug where the rails console and tests stop responding to SIGINT, and this is affecting all of our projects that use guard" }, { "from": "human", "value": "# encoding: utf-8\n$:.push File.expa...
ruby
chosen
[ { "from": "system", "value": "Update Tokyo Dystopia to 0.9.14\n" }, { "from": "human", "value": "require 'formula'\n\nclass TokyoDystopia <Formula\n url 'http://1978th.net/tokyodystopia/tokyodystopia-0.9.13.tar.gz'\n homepage 'http://1978th.net/tokyodystopia/'\n sha1 '073b2edd6a74e2ae1bbdc7fa...
ruby
chosen
[ { "from": "system", "value": "Make rubocop happy with latest spec additions\n" }, { "from": "human", "value": "describe Chirp::Runner do\n subject { described_class.new(%w(whatever)) }\n\n it 'has a Child class' do\n expect(Chirp::Runner::Child).to_not be_nil\n end\n\n it 'accepts an acti...
ruby
chosen
[ { "from": "system", "value": "Fix typo that caused admin model specs to fail\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Admin, type: :model do\n it \"is invalid without a user\" do\n expect(build(:parent, user_attributes: {})).not_to be_valid\n end\nend\n" ...
ruby
chosen
[ { "from": "system", "value": "Fix podspec and update version\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"HATransparentView\"\n s.version = \"0.3\"\n s.summary = \"UIView transparent subclass based on Rdio stations menu.\"\n s.homepage = \"https:...
ruby
chosen
[ { "from": "system", "value": "Update ProductStatuses printing for new features.\n\n-------------\nCreated by MOE: https://github.com/google/moe\nMOE_MIGRATED_REVID=197388670\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# Encoding: utf-8\n#\n# Copyright:: Copyright 2016, Google Inc. Al...
ruby
chosen
[ { "from": "system", "value": "Drop the correct table when rolling back a migration\n" }, { "from": "human", "value": "class CreateExternalQuestionnaires < ActiveRecord::Migration\n def self.up\n create_table :external_questionnaires do |t|\n t.string :token, :null => false\n t.inte...
ruby
chosen
[ { "from": "system", "value": "Revert \"Move readonly database traffic to katla\"\n\nThis reverts commit e1bad7cf91c5b6ac6b435d2489b55ab86b165d9a.\n" }, { "from": "human", "value": "name \"web\"\ndescription \"Role applied to all web/api servers\"\n\ndefault_attributes(\n :accounts => {\n :us...
ruby
chosen
[ { "from": "system", "value": "Add name to Fragmentarium cask.\n" }, { "from": "human", "value": "cask \"fragmentarium\" do\n version \"0.9.12b\"\n sha256 \"562ebee281691e993a42b06409b42d996fce38dcff3b836c9291db0b8907d4df\"\n\n url \"https://github.com/downloads/Syntopia/Fragmentarium/Fragment...
ruby
chosen
[ { "from": "system", "value": "Upgrade Lyrics Master.app to v2.4.2\n" }, { "from": "human", "value": "class LyricsMaster < Cask\n version '2.4.1'\n sha256 '773cb3996b5f946b506214a0087afebdb7f7350ac17f477cc3f31bedf2a9be0c'\n\n url 'http://www.kenichimaehashi.com/lyricsmaster/download/LyricsMast...
ruby
chosen
[ { "from": "system", "value": "Reorder keys in coverage metrics results\n" }, { "from": "human", "value": "module BuildLogParser\n module CoverageMatcher\n PATTERNS = {\n rspec: /\\s([\\d]+) \\/ ([\\d]+) LOC \\(([\\d]+\\.[\\d]+)%\\) covered\\./,\n phpunit: /Lines:\\s+([\\d.]+)% ...
ruby
chosen
[ { "from": "system", "value": "Use method syntax to allow lambdas if needed\n" }, { "from": "human", "value": "module HTMLHelpers\n class << self\n def strip_comments! html\n html.xpath('//comment()').remove\n html\n end\n\n def unnest! html\n html\n .xpath('//div ...
ruby
chosen
[ { "from": "system", "value": "Configure ActionView to omit the stupid .field_with_errors.\n" }, { "from": "human", "value": "module Islay\n class Engine < ::Rails::Engine\n # Explicitly require the ActivityLog to avoid having it reloaded in dev.\n require File.expand_path(\"../../../app/m...
ruby
chosen
[ { "from": "system", "value": "Make it work with pow\n" }, { "from": "human", "value": "require './lib/tammer_saleh'\n\nuse Rack::Static, :urls => [\"/stylesheets\", \"/images\"],\n :root => \"public\"\n\nrun TammerSaleh\n\n" }, { "from": "gpt", "value": "Encoding.def...
ruby
chosen
[ { "from": "system", "value": "Fix documentation to the custom Deprecator\n\n[ci skip]" }, { "from": "human", "value": "require 'active_support/deprecation/method_wrappers'\n\nclass Module\n # deprecate :foo\n # deprecate bar: 'message'\n # deprecate :foo, :bar, baz: 'warning!', qux: 'go...
ruby
chosen
[ { "from": "system", "value": "Add suffix for bottles to avoid cache confusion.\n" }, { "from": "human", "value": "# Builds binary brew package\nbrew_install\n\ndestination = HOMEBREW_PREFIX + \"Bottles\"\nif not File.directory?(destination)\n Dir.mkdir destination\nend\n\nARGV.each do|formula|\...
ruby
chosen
[ { "from": "system", "value": "Add utility method to check if we are previewing a page\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule PagesCore\n module PreviewPagesController\n extend ActiveSupport::Concern\n\n included do\n before_action :disable_xss_prot...
ruby
chosen
[ { "from": "system", "value": "Update Android NDK to the latest r5 revision.\n\nSigned-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>\n" }, { "from": "human", "value": "require 'formula'\n\nclass AndroidNdk <Formula\n url 'http://dl.google.com/android/ndk/android-nd...
ruby
chosen
[ { "from": "system", "value": "Use end_with? instead of regular expression\n" }, { "from": "human", "value": "require \"multi_logger/version\"\n\nmodule MultiLogger\n class << self\n def add_logger(name, path=nil)\n name = name.to_s\n if path.nil?\n path = name.underscore\n ...
ruby
chosen
[ { "from": "system", "value": "Set domain to www for now\n" }, { "from": "human", "value": "# This file is used by Rack-based servers to start the application.\n\nrequire 'rack-rewrite'\n \nDOMAIN = 'aqueousband.net'\n \n# Redirect to the www version of the domain in production\nuse Rack::Rewrite...
ruby
chosen
[ { "from": "system", "value": "Revert \"use 2.1 aware oobgc\"\n\nThis reverts commit 5a7522c3580e682a324a51a87b2cbff154cf5320.\n" }, { "from": "human", "value": "# This file is used by Rack-based servers to start the application.\nif defined? Unicorn\n use Raindrops::Middleware\n require 'gctoo...
ruby
chosen
[ { "from": "system", "value": "Drop Prometheus metrics_prefix; using label app=runner in PromQL is simpler\n" }, { "from": "human", "value": "$stdout.sync = true\n$stderr.sync = true\n\nrequire 'rack'\nuse Rack::Deflater, if: ->(_, _, _, body) { body.any? && body[0].length > 512 }\n\nunless ENV['...
ruby
chosen
[ { "from": "system", "value": "Use RSpec.describe in spec template\n\nFixes #311" }, { "from": "human", "value": "require '<%= File.exists?('spec/rails_helper.rb') ? 'rails_helper' : 'spec_helper' %>'\n\ndescribe <%= class_name %>Policy do\n\n let(:user) { User.new }\n\n subject { described_cla...
ruby
chosen
[ { "from": "system", "value": "Handle Stripe::Charge objects in Stripe::Invoice::PaymentSucceeded\n" }, { "from": "human", "value": "require \"stripe_event/base\"\n\nmodule StripeEvent\n module Invoice\n class PaymentSucceeded < Base\n\n def call(event)\n @event = event\n\n ...
ruby
chosen
[ { "from": "system", "value": "Use OptionParser to make command-line not horrible\n" }, { "from": "human", "value": "#!/usr/bin/env ruby -i\nrequire_relative 'marky-markov/markov-dictionary'\nrequire_relative 'marky-markov/two-word-dictionary'\nrequire_relative 'marky-markov/persistent-dictionary...
ruby
chosen
[ { "from": "system", "value": "Allow building objects with no attributes\n" }, { "from": "human", "value": "module OBIX\n\n class Builder\n attr_reader :objects\n\n # Initialize a new builder.\n #\n # parent - An Objects::Object instance or derivative thereof describing the parent\n ...
ruby
chosen
[ { "from": "system", "value": "Fix PhoneNumber.vcard; add PhoneNumber.object association.\n" }, { "from": "human", "value": "class PhoneNumber < ActiveRecord::Base\n belongs_to :vcard\n\n def to_s\n case phone_number_type\n when 'phone'\n return \"Tel: #{number}\"\n when 'fax'\n ...
ruby
chosen
[ { "from": "system", "value": "Convert from \"or\" to \"||\" operator" }, { "from": "human", "value": "module HL7\n class Message::Segment::DG1 < HL7::Message::Segment\n weight 92\n add_field :set_id\n add_field :diagnosis_coding_method\n add_field :diagnosis_code\n add_field :dia...
ruby
chosen
[ { "from": "human", "value": "Implement ArrayInput input type for SimpleForm\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n# https://railsguides.net/simple-form-array-text-input/\n# https://tenforward.consulting/blog/integrating-an-array-column-in-rails-with-simple-form\nclass A...
ruby
chosen
[ { "from": "system", "value": "Fix spec to test in the right direction\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Dummy application\" do\n it \"should be an application\" do\n Dummy::Application.should be_a(Rails.application)\n end\nend\n" }, { "from": "gp...
ruby
chosen
[ { "from": "system", "value": "Add field names for Conference rooms\n" }, { "from": "human", "value": "class Conferences < ActiveRecord::Base\nend" }, { "from": "gpt", "value": "class Conferences\n include Mongoid::Document\n # room_number and pin are strings so they can accomodate ...
ruby
chosen
[ { "from": "human", "value": "Add spec/support file to make DJ work inline\n\nIf you specify ``immediate_delayed_job_work_off: true`` in the metadata for your spec then DJ will work inline. Otherwise it will do whatever the app is configured for (which is currently not to inline perform things).\n" }, {...
ruby
chosen
[ { "from": "system", "value": "Validate CLI command now prints 1 or 0\n" }, { "from": "human", "value": "require \"gli\"\nrequire \"vindetta/version\"\n\nmodule Vindetta\n class CLI\n extend GLI::App\n\n program_desc \"Vehicle Identification Number (VIN) CLI\"\n version Vindetta::VERSIO...
ruby
chosen
[ { "from": "system", "value": "Use application timezone (not server timezone) for determining default time frame.\n\nAlso use beginning_of_day and end_of_day methods for setting time frame limits.\n" }, { "from": "human", "value": "# Filters added to this controller apply to all controllers in th...
ruby
chosen
[ { "from": "system", "value": "Secure up invitation finding process\n" }, { "from": "human", "value": "class InvitationsController < ApplicationController\n before_action :authenticate_user!, except: :show\n\n def create\n invitation = current_user.company.invitations.build invitation_params...
ruby
chosen
[ { "from": "system", "value": "Add process_operation method that catches AR exceptions\n" }, { "from": "human", "value": "module JSONAPI\n class ActiveRecordOperationsProcessor < OperationsProcessor\n\n private\n def transaction\n ActiveRecord::Base.transaction do\n yield\n ...
ruby
chosen
[ { "from": "system", "value": "Simplify implementation of environments serializer\n" }, { "from": "human", "value": "class EnvironmentSerializer < BaseSerializer\n Struct.new('Item', :name, :size, :id, :latest)\n\n entity EnvironmentEntity\n\n def within_folders\n tap { @itemize = true }\n ...
ruby
chosen
[ { "from": "human", "value": "Add basic login routes to sessions controller\n" }, { "from": "gpt", "value": "get '/login' do\n @user = User.new\n erb :'/login'\nend\n\npost '/login' do\n @user = User.find_by(email: params[:user][:email])\n if @user && @user.password == params[:user][:password...
ruby
chosen
[ { "from": "system", "value": "Add profiling to stations adding\n" }, { "from": "human", "value": "class StationsController < ApplicationController\n include StationsHelper\n\n def index\n @stations = Station.paginate(page: params[:page])\n end\n\n def show\n @station = Station.find(par...
ruby
chosen
[ { "from": "system", "value": "Update gemspec as it would be generated by enginex nowadays.\n" }, { "from": "human", "value": "# Provide a simple gemspec so you can easily use your enginex\n# project in your rails apps through git.\nGem::Specification.new do |s|\n s.name = \"lyb_sidebar\"\n s.s...
ruby
chosen
[ { "from": "system", "value": "Update bundler (1.7.13 -> 1.9.9)\n" }, { "from": "human", "value": "# container for all constants including vendor-specific ones\nmodule Configs\n\n NAME = \"ruby\"\n BUILDPACK_VERSION = \"v77\"\n DEFAULT_RUBY_VERSION = \"ruby-2.0.0\"\n\n PAAS_VENDOR_FOLDER = \...
ruby
chosen
[ { "from": "human", "value": "Add Prolific USB Serial Cable Driver 1.5.1 Cask\n" }, { "from": "gpt", "value": "class ProlificUsbSerialDriver < Cask\n url 'http://pbxbook.com/other/sw/PL2303_MacOSX_v1_5_1.zip'\n homepage 'http://pbxbook.com/other/mac-tty.html'\n version '1.5.1'\n sha1 'e251e2a...
ruby
chosen
[ { "from": "system", "value": "Update rspec requirement from ~> 3.8.0 to ~> 3.9.0\n\nUpdates the requirements on [rspec](https://github.com/rspec/rspec) to permit the latest version.\n- [Release notes](https://github.com/rspec/rspec/releases)\n- [Commits](https://github.com/rspec/rspec/compare/v3.8.0...v3.9....
ruby
chosen
[ { "from": "system", "value": "Change mongoid step_definition to match thoughtbot version\n" }, { "from": "human", "value": "Given /^an (.+) exists with an? \"([^\"]*)\" of \"([^\"]*)\"$/ do |model, field, value|\n Factory model, field => value\nend" }, { "from": "gpt", "value": "Giv...
ruby
chosen
[ { "from": "system", "value": "Use instance variable for school_scope\n" }, { "from": "human", "value": "class StudentSectionAssignmentsImporter\n\n def initialize(options:)\n @school_scope = options.fetch(:school_scope)\n @log = options.fetch(:log)\n @imported_assignments = []\n end\n...
ruby
chosen
[ { "from": "system", "value": "Remove pre from as_formatted_html method\n" }, { "from": "human", "value": "module Forem\n module FormattingHelper\n # override with desired markup formatter, e.g. textile or markdown\n def as_formatted_html(text)\n raw('<pre>')+h(text)+raw('</pre>')\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"bump gemspec version to 3.0.0-rc1\"\n\nThis reverts commit dfaf8150a4ab935a4f77db967f35285b73b35607.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'slop'\n s.version = '3.0.0-rc1'\n s.summary = 'Option gathering made easy'\n...
ruby
chosen
[ { "from": "system", "value": "Fix test: open .gem file in binary mode\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'digest'\n\nclass GetGemspecTest < TrivialGemServer::TestCase\n include Rack::Test::Methods\n\n def test_it_returns_gem\n get '/gems/rack-1.5.0.gem'\n a...
ruby
chosen
[ { "from": "system", "value": "Update Omnioutliner Beta to build 4.4.x-r251827\n\nThis commit updates the version and sha256 tokens.\n" }, { "from": "human", "value": "cask 'omnioutliner-beta' do\n version '4.4.x-r250030'\n sha256 '2b8c51ef4d5321b7701858264ea5f0da8358281259d8a1c94d1ac0d55792ba7...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to get rid of warnings\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'probe/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Set to display in browser\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'erb'\nrequire 'twilio-ruby'\n\nget '/' do\n erb :root\nend\n\nget '/client' do\n # build up a response\n\n response = Twilio::TwiML::Response.new do |r|\n r.Dial do |d|\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Fixe la version de Paperclip pour éviter un bug corrigé dans une future version de Rich\"\n\nThis reverts commit 023f472a73e9dd84d5be602ffa9dd3bdda3f9209.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your g...
ruby
chosen
[ { "from": "system", "value": "[fix] Fix dependency with libxml (to libxml-ruby)\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rocx/version'\n\nGem::Specification.new do |...
ruby
chosen
[ { "from": "system", "value": "Fix Rails 5 html rendering issue\n" }, { "from": "human", "value": "if(RailsExceptionHandler.configuration.activate?)\n class ErrorResponseController < ApplicationController\n def index\n if Rails::VERSION::MAJOR > 4\n render(:plain => request.env['e...
ruby
chosen
[ { "from": "system", "value": "Change name of ENV variable to SHOW_COMMERCIAL_PAGE\n" }, { "from": "human", "value": "class GroupRequestsController < BaseController\n skip_before_filter :authenticate_user!\n\n def create\n @group_request = GroupRequest.new(permitted_params.group_request)\n ...
ruby
chosen
[ { "from": "system", "value": "Add the comma gem DSL for the Alumni record\n\n- Include Alumni Data\n- Include Alumni status\n- Include TieAlumni details\n\nSigned-off-by: Siddharth Kannan <805f056820c7a1cecc4ab591b8a0a604b501a0b7@gmail.com>" }, { "from": "human", "value": "class Alumni < ActiveR...
ruby
chosen
[ { "from": "system", "value": "Delete comment from Upload model\n" }, { "from": "human", "value": "class Upload < ActiveRecord::Base\n #attr_accessible :upload\n has_attached_file :upload\n validates_attachment_content_type :upload, :content_type => [\"image/jpg\", \"image/jpeg\", \"image/png\...
ruby
chosen
[ { "from": "system", "value": "Add proper file listings to gemspec\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(\"../lib\", __FILE__)\nrequire \"spin/version\"\n\nGem::Specification.new \"spin\", Spin::VERSION do |s|\n s.authors = [\"Jesse Storimer\"]\n s.email ...
ruby
chosen
[ { "from": "system", "value": "Set oursolution as default from in mailer\n" }, { "from": "human", "value": "class UserMailer < ActionMailer::Base\n\n default :from => \"Test <oursolutionis@gmail.com>\",\n :return_path => \"oursolutionis@gmail.com\"\n\n def password_reset(user)\n @us...
ruby
chosen
[ { "from": "system", "value": "Convert lat/lng to floats before saving\n" }, { "from": "human", "value": "require \"edition\"\nrequire 'attachable_with_metadata'\n\nclass NodeEdition < Edition\n include AttachableWithMetadata\n\n # name from artefact\n field :level, type: Integer\n fi...
ruby
chosen