conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update bundler to version ~> 2.0\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'idoru/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "human", "value": "Add unit test for fd_limit\n\n[#149734315]\n\nSigned-off-by: Vlad Stoian <3a646ed2933376f6ad3d8f73c719d7c5225000dd@pivotal.io>\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'bosh/template/renderer'\n\nRSpec.describe 'Configuration', template: true d...
ruby
chosen
[ { "from": "system", "value": "Fix JSONP integration test for newer rack-contrib versions\n\nThe JSONP padding changed from functionName() to /**/functionName()\nin rack-contrib 1.2\n\n#441" }, { "from": "human", "value": "require 'rails_helper'\n\n# Basic middleware integration test to ensure Ra...
ruby
chosen
[ { "from": "system", "value": "Add a pending test to support namespaced classes\n" }, { "from": "human", "value": "require 'emoji_test_love/rspec/rspec_integration'\n\nclass Foo\n def passed_display\n \".\"\n end\n def failed_display\n \"F\"\n end\n def pending_display\n \"P\"\n en...
ruby
chosen
[ { "from": "human", "value": "Raise error on missing translation keys\n" }, { "from": "gpt", "value": "# From: https://robots.thoughtbot.com/better-tests-through-internationalization\n\nI18n.exception_handler = lambda do |exception, locale, key, options|\n raise \"missing translation: #{key}\"\n...
ruby
chosen
[ { "from": "system", "value": "Change the path to where ruby will be\n" }, { "from": "human", "value": "env 'PATH', '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'\n\nevery :day, at: '9:00am' do\n runner 'Assignment.send_reminders!'\nend\n" }, { "from": "gpt", "value":...
ruby
chosen
[ { "from": "system", "value": "Optimize reconciliation of contract kinds\n" }, { "from": "human", "value": "PREFIX kinds: <http://purl.org/procurement/public-contracts-kinds#>\nPREFIX pc: <http://purl.org/procurement/public-contracts#>\nPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\n\...
ruby
chosen
[ { "from": "system", "value": "Add specs for other attributes\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"conceptual/attributes\"\n\nRSpec.describe Conceptual::Attribute do\n describe(\"StringAttribute\") do\n subject(:attr) { Conceptual::StringAttribute.new(:name) }...
ruby
chosen
[ { "from": "system", "value": "Add tests for object population from the client" }, { "from": "human", "value": "require (File.expand_path('./../../../spec_helper', __FILE__))\n\ndescribe KanbanTool::Client do\n\n let(:client) { KanbanTool::Client.new(\"test\", \"123456789ABC\") }\n\n after do\n...
ruby
chosen
[ { "from": "system", "value": "Update minitest requirement from ~> 5.3, < 5.15 to ~> 5.3, < 5.16\n\nUpdates the requirements on [minitest](https://github.com/seattlerb/minitest) to permit the latest version.\n- [Release notes](https://github.com/seattlerb/minitest/releases)\n- [Changelog](https://github.com/...
ruby
chosen
[ { "from": "system", "value": "Make compatible with rails 3" }, { "from": "human", "value": "# common.rb - Common settings, requires and helpers\nunless defined? TOURBUS_LIB_PATH\n TOURBUS_LIB_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))\n $:<< TOURBUS_LIB_PATH unless...
ruby
chosen
[ { "from": "system", "value": "Remove member_actions as it is not being used.\n" }, { "from": "human", "value": "require \"canonical-rails/engine\"\n\nmodule CanonicalRails\n\n # Default way to setup CanonicalRails. Run `rails g canonical_rails:install` to create\n # a fresh initializer with al...
ruby
chosen
[ { "from": "system", "value": "Add a generator note to the org-mode output\n" }, { "from": "human", "value": "module Kindle\n class OrgMode\n def self.save(book, path)\n filename = path + \"/\" + book.to_file_name + \".org\"\n\n ::File.open(filename, 'w') do |file|\n file.put...
ruby
chosen
[ { "from": "system", "value": "Add the private methods to the class instance\n" }, { "from": "human", "value": "require 'play_store_info/errors'\nrequire 'play_store_info/app_parser'\nrequire 'metainspector'\nrequire 'sanitize'\n\nmodule PlayStoreInfo\n MIN_IDS_REGEXP_MATCHES = 2\n FIRST_ID_REG...
ruby
chosen
[ { "from": "system", "value": "Remove gem post_install and pre_uninstall hooks\n\nYARD itself supports --document=yri,yard flags from v0.9.1.\nSee http://www.rubydoc.info/gems/yard/file/CHANGELOG.md#0_9_1_-_July_18th__2016\n" }, { "from": "human", "value": "require 'rubygems/commands/yardoc_comma...
ruby
chosen
[ { "from": "system", "value": "Simplify signature of methods in S3Storage::Null\n\nThere's not much value in duplicating the method signatures from\nS3Storage and doing so for some methods I'm about to add would make the\ndynamically generating suitable examples a lot more complicated, i.e.\nwe'd need to che...
ruby
chosen
[ { "from": "system", "value": "Add accessor for default keychain" }, { "from": "human", "value": "require \"mellon/version\"\nrequire \"mellon/keychains\"\n\nmodule Mellon\n class << self\n def keychain(name)\n keychain = keychains.find { |keychain| keychain === name }\n\n if keycha...
ruby
chosen
[ { "from": "system", "value": "Rename methods to be more descriptive\n" }, { "from": "human", "value": "# \n# Copyright (c) 2012-2013 by Lifted Studios. All Rights Reserved.\n# \n\nrequire 'html/pipeline'\n\nmodule HTML\n class Pipeline\n # An `HTML::Pipeline` filter class that detects wiki-...
ruby
chosen
[ { "from": "system", "value": "Move class saving to disable\n\nThis means if you override the Connection after the gem is loaded, then\ncall disable_net_connect!, your override is saved.\n" }, { "from": "human", "value": "module JsonApiClientMock\n module ResourceExtensions\n extend ActiveSup...
ruby
chosen
[ { "from": "system", "value": "Change the door status format in the DoorLogEntry factory\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :door_log_entry, :class => 'Door::LogEntry' do\n door \"closed\"\n latch \"locked\"\n end\nend\n" }, { "from": "gpt", "va...
ruby
chosen
[ { "from": "system", "value": "Improve not found guides message in test\n" }, { "from": "human", "value": "require 'spec_helper'\n\nfeature 'When public org' do\n scenario 'should access normally' do\n visit '/exercises'\n\n expect(page).to have_text('Nobody')\n end\nend\n\nfeature 'When ...
ruby
chosen
[ { "from": "human", "value": "Add missing group policy spec\n\nSigned-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe GroupPolicy, models: true do\n let(:guest) { create(:user) }\n let(:reporter)...
ruby
chosen
[ { "from": "system", "value": "Chore: Update gemspec to latest version\n\n--------------------------------------------------------------------------------\nSigned-off-by: Jeff Felchner <8a84c204e2d4c387d61d20f7892a2bbbf0bc8ae8@thekompanee.com>\n" }, { "from": "human", "value": "# -*- encoding: ut...
ruby
chosen
[ { "from": "system", "value": "Use git to specify gem files\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"webhookr/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.na...
ruby
chosen
[ { "from": "system", "value": "Test for the <pre> hider.\n" }, { "from": "human", "value": "require 'minitest/autorun'\nrequire './transformationhooks.rb'\n\nclass TestTransformations < Minitest::Test\n\n def setup\n @tab_hide_hook = TabHideHook.new\n @html_tag_token = HtmlTagToken.new\n ...
ruby
chosen
[ { "from": "system", "value": "Update gem version to include (minor) changes in master.\n" }, { "from": "human", "value": "# encoding: utf-8\nGem::Specification.new do |s|\n s.name = \"indubitably\"\n s.version = \"0.4.1\"\n s.date = \"2015-02-13\"\n s.summary = \"Maybe ...
ruby
chosen
[ { "from": "system", "value": "Update spec to version 2.1.14\n" }, { "from": "human", "value": "\nPod::Spec.new do |s|\n s.name = \"LightRoute\"\n s.version = \"2.1.13\"\n s.summary = \"LightRoute is easy transition between view controllers and support many popylar arhitectur...
ruby
chosen
[ { "from": "system", "value": "Add a comment to reveal why `self.runtimes` is called\n" }, { "from": "human", "value": "require \"execjs/runtimes\"\nrequire \"execjs/runtimes_jxa_version\"\n\nmodule ExecJS\n module Runtimes\n JXA = ExternalRuntime.new(\n name: \"JXA\",\n comm...
ruby
chosen
[ { "from": "system", "value": "Fix bug in attribute sharing, breaking printable directory.\n" }, { "from": "human", "value": "module ActiveRecord\n module Associations\n module ClassMethods\n def inherited_attribute(name, parent)\n name = name.to_s\n class_eval \"def #{name...
ruby
chosen
[ { "from": "system", "value": "Fix style issues in Killer::Rspec\n" }, { "from": "human", "value": "module Mutant\n class Killer\n # Runner for rspec tests\n class Rspec < self\n\n private\n\n # Run rspec test\n #\n # @return [true]\n # when test is NOT successful\...
ruby
chosen
[ { "from": "system", "value": "Make sure this is scoped to root\n" }, { "from": "human", "value": "require 'rails/railtie'\nrequire 'quick_count/active_record/base'\nrequire 'count_estimate/active_record/relation'\nrequire 'pry'\n\nmodule QuickCount\n class Railtie < Rails::Railtie\n\n # rake...
ruby
chosen
[ { "from": "system", "value": "Remove deprecated POST /websocket route.\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n if Rails.version >= '4.0.0'\n match \"/websocket\", :to => WebsocketRails::ConnectionManager.new, via: [:get, :post]\n else\n match \"/websocket\",...
ruby
chosen
[ { "from": "system", "value": "Add more information to the attributes file and remove old ad-likewise\nentries\n" }, { "from": "human", "value": "#default[:authorization] = {}\n#default[:authorization][:ad_likewise] = {}\ndefault[:authorization][:ad_auth][:ad_network] = \"\"\n" }, { "from...
ruby
chosen
[ { "from": "system", "value": "Change the Podspec to reference *.png\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"PaymentKit\"\n s.version = \"1.0.0\"\n s.summary = \"Utility library for creating credit card payment forms.\"\n s.l...
ruby
chosen
[ { "from": "system", "value": "Make sure data is available.\n" }, { "from": "human", "value": "module FeedCrawler\n class UpdateYoutubeVideos\n include Sidekiq::Worker\n sidekiq_options queue: :parse\n\n def perform(feed_id)\n feed = Feed.find(feed_id)\n entries = feed.entries...
ruby
chosen
[ { "from": "system", "value": "Change create_order to use new OrderDetailsUpdater\n" }, { "from": "human", "value": "module Users\n module OrderManipulator\n extend ActiveSupport::Concern\n\n def can_create_order_at?(organization)\n super_admin? || member_at?(organization)\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Fix for xpath due to slight redesign/markup change\n" }, { "from": "human", "value": "module Fletcher\r\n module Model\r\n class Etsy < Fletcher::Model::Base\r\n # A regular expression for determining if a url comes from a specific service/website\r\n ...
ruby
chosen
[ { "from": "system", "value": "Remove accidental dependency on ActiveRecord\n" }, { "from": "human", "value": "module HydraShield::Helpers\n\n def shield(object, **options)\n if object.is_a?(Enumerable) || object.is_a?(ActiveRecord::Relation) # not needed in rails >= 5.0\n shield_collect...
ruby
chosen
[ { "from": "system", "value": "Add hidden scope to make it easier to play with categories.\n" }, { "from": "human", "value": "class Category < ActiveRecord::Base\n has_many :skills\n has_many :courses, through: :skills\n\n validates_presence_of :name, :handle\n validates_uniqueness_of :handle...
ruby
chosen
[ { "from": "system", "value": "Comment out TED link embed since it doesn't work yet.\n" }, { "from": "human", "value": "class Resource < ActiveRecord::Base\n include AutoHtml\n\n belongs_to :curriculum\n belongs_to :user\n\n scope :ordered, -> { order(updated_at: :desc) }\n\n validates :titl...
ruby
chosen
[ { "from": "system", "value": "Update Kitematic to version 0.8.2\n" }, { "from": "human", "value": "cask :v1 => 'kitematic' do\n version '0.8.1'\n sha256 'e7d56f723dbf84c66cf1595aeb92c7240eee1ba56a9eb1ed6642b939215b7e53'\n\n # github.com is the official download host per the vendor homepage\n ...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in ShareTool Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'sharetool' do\n version '2.4.2'\n sha2...
ruby
chosen
[ { "from": "human", "value": "Add a couple of user helper tasks for scripted user management\n" }, { "from": "gpt", "value": "#\n# Some helper tasks to create and delete users\n#\n\nnamespace :libra2 do\n\ndesc \"Delete all users\"\ntask del_users: :environment do |t, args|\n\n count = 0\n User...
ruby
chosen
[ { "from": "system", "value": "Fix for Rails 2: code was injected even if query reviewer was disabled" }, { "from": "human", "value": "require 'query_reviewer'\n\nmodule QueryReviewer\n def self.inject_reviewer\n # Load adapters\n ActiveRecord::Base\n adapter_class = ActiveRecord::Conne...
ruby
chosen
[ { "from": "system", "value": "Add documentation for error classes\n" }, { "from": "human", "value": "module ShardHandler\n class SetupError < StandardError; end\n class UnknownShardError < StandardError; end\nend\n" }, { "from": "gpt", "value": "module ShardHandler\n # This error ...
ruby
chosen
[ { "from": "system", "value": "Load gems of assets group before of precompile\n" }, { "from": "human", "value": "require 'rake'\nrequire 'rake/sprocketstask'\nrequire 'sprockets'\n\nmodule Sprockets\n module Rails\n class Task < Rake::SprocketsTask\n attr_accessor :cache_path\n\n de...
ruby
chosen
[ { "from": "system", "value": "Mark acceptance test as pending\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe 'puppetserver' do\n\n context 'with defaults' do\n it 'should idempotently run' do\n pp = <<-EOS\n class { 'puppetserver': }\n EOS\n\...
ruby
chosen
[ { "from": "system", "value": "Fix price ordering on product listings\n" }, { "from": "human", "value": "Deface::Override.new(:virtual_path => \"spree/shared/_products\",\n :replace => \".price\",\n :text => '<span class=\"price selling\" itemprop=\"price\"...
ruby
chosen
[ { "from": "system", "value": "Add more delta to diff between created_at and updated_at for Pages.\n" }, { "from": "human", "value": "# Static Pages.\n#\n# * body is in markdown (extended).\n#\nclass Page < ActiveRecord::Base\n # friendly_id, use Page's title.\n has_friendly_id :title, :use_s...
ruby
chosen
[ { "from": "system", "value": "Update reference to Gravatar module\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n has_many :startups\n\n include Gravatar\n\n # Include default devise modules. Others available are:\n # :token_authenticatable, :lockable, :timeoutable and :...
ruby
chosen
[ { "from": "system", "value": "Add name validation on minimum 2 characters\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\ninclude ActiveModel::Validations\n\tvalidates :name, :city, :email, presence: true\n\tvalidates :email, uniqueness: { case_sensitive: false }, on: :create...
ruby
chosen
[ { "from": "system", "value": "Reduce code mass of as_json method\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n extend Enumerize\n # Include default devise modules. Others available are:\n # :token_authenticatable, :confirmable,\n # :lockable, :timeoutable and :omniauth...
ruby
chosen
[ { "from": "system", "value": "Create relations in User model\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n # Remember to create a migration!\nend\n" }, { "from": "gpt", "value": "class User < ActiveRecord::Base\n # Remember to create a migration!\n has_many ...
ruby
chosen
[ { "from": "system", "value": "Change the way that the email address is pulled from github's oauth hash to hopefully catch all people\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n mount_uploader :avatar, PictureUploader\n\n acts_as_taggable_on :skills\n\n # Include defau...
ruby
chosen
[ { "from": "system", "value": "Fix references to index.html in Keyword Index.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'nokogiri'\nrequire 'fileutils'\n\nclass UpdateKeywordIndex\n attr_accessor :header_title\n attr_accessor :content_title\n attr_accessor :filename\n \n ...
ruby
chosen
[ { "from": "system", "value": "Update invocation on parent package when checking for arbitrary options after package refactoring work to dynamically define DSL accessor at runtime\n" }, { "from": "human", "value": "module Sprinkle\n module Installers\n class Installer\n attr_accessor :de...
ruby
chosen
[ { "from": "system", "value": "Fix syntax error in serverspec test\n" }, { "from": "human", "value": "require 'serverspec'\n\n# Required by serverspec\nset :backend, :exec\n\ncase os[:family]\nwhen 'debian','ubuntu'\n package_name = 'redis-server'\n service_name = 'redis-server'\n config_file ...
ruby
chosen
[ { "from": "system", "value": "Add tests for automatically finding git remote for GitBranchFinalizer\n" }, { "from": "human", "value": "require \"test_helper\"\nrequire \"roger/testing/mock_release\"\n\nmodule Roger\n # Test for Roger GitBranchFinalizer\n class GitBranchTest < ::Test::Unit::Tes...
ruby
chosen
[ { "from": "system", "value": "Split up form_with method to lower complexity" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# rubocop:disable Metrics/AbcSize, Metrics/MethodLength\nmodule ClientSideValidations\n module ActionView\n module Helpers\n module FormHelper\n ...
ruby
chosen
[ { "from": "system", "value": "Remove 'size' as a required attribute\n" }, { "from": "human", "value": "#\n# Author:: Seth Vargo <sethvargo@gmail.com>\n# Cookbook:: swap\n# Resource:: file\n#\n# Copyright 2012-2013, Seth Vargo\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\")...
ruby
chosen
[ { "from": "system", "value": "Update SIP from v. 11 to 11.1\n\nSigned-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>\n" }, { "from": "human", "value": "require 'formula'\n\n# Note: this project doesn't save old releases, so it breaks often as\n# downloads disappear....
ruby
chosen
[ { "from": "human", "value": "Add a gemspec file so that bundler can build the gem\n" }, { "from": "gpt", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib/', __FILE__)\n$:.unshift lib unless $:.include?(lib)\n \nGem::Specification.new do |s|\n s.name = \"decision-tree\"...
ruby
chosen
[ { "from": "system", "value": "Call correct method in cron runner\n" }, { "from": "human", "value": "# Use this file to easily define all of your cron jobs.\n#\n# It's helpful, but not entirely necessary to understand cron before proceeding.\n# http://en.wikipedia.org/wiki/Cron\n\n# Example:\n#\n...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in FBReader Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'fbreader' do\n version '0.99.5-alpha'\n ...
ruby
chosen
[ { "from": "system", "value": "Add CF CLI plugin repo prior to installing plugins\n" }, { "from": "human", "value": "replay_plugin_config_path = \"#{node['sprout']['home']}/.cf/plugins/CmdSetRecords\"\n\n[\n ::File.join(node['sprout']['home'], '.cf'),\n ::File.join(node['sprout']['home'], '.cf'...
ruby
chosen
[ { "from": "human", "value": "Write solution for zero hero\n" }, { "from": "gpt", "value": "def no_boring_zeros(num)\n array = num.to_s.chars.reverse\n num_zeroes = find_num_zeroes(array)\n array.drop(num_zeroes).reverse.join(\"\").to_i\nend\n\ndef find_num_zeroes(arr)\n\tcounter = 0\n\tarr.ea...
ruby
chosen
[ { "from": "system", "value": "Handle exception when new hash syntax is passed\n" }, { "from": "human", "value": "require 'cuba'\nrequire 'cuba/render'\nrequire 'json'\n\nCuba.plugin Cuba::Render\n\nCuba.define do\n\n on get do\n on root do\n hash = ''\n on param('q') do | hash |\n ...
ruby
chosen
[ { "from": "system", "value": "Put back missing rescue of Interrupt.\n" }, { "from": "human", "value": "# coding: utf-8\n\n#* mysh/process.rb -- The mysh command processors.\nmodule Mysh\n\n #Process from the console.\n def self.process_console\n process_source(Console.new)\n end\n\n #Proc...
ruby
chosen
[ { "from": "system", "value": "Update to work with most recent version of replay\n" }, { "from": "human", "value": "require 'replay'\nrequire \"replay/rails/version\"\n\nmodule Replay\n module Rails\n class ActiveRecordEventStore \n class Event < ActiveRecord::Base\n self.table_na...
ruby
chosen
[ { "from": "system", "value": "Extend timeout for CMR runner. " }, { "from": "human", "value": "require 'timeout'\nmodule Rubotium\n class CMD\n attr_reader :read, :write\n attr_reader :command_to_run, :buffer, :pid\n\n class << self\n\n def run_command(command_to_run, opts = {})\n...
ruby
chosen
[ { "from": "system", "value": "Prepare \"cancel\" vs ConfExecutor spec\n" }, { "from": "human", "value": "\n#\n# specifying flor\n#\n# Wed Apr 6 14:50:53 JST 2016\n#\n\nrequire 'spec_helper'\n\n\ndescribe Flor::Conf do\n\n describe '.prepare' do\n\n it 'reads a file and returns the object co...
ruby
chosen
[ { "from": "system", "value": "Change gem dependency to be bson ~> 4.2\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'mongo/version'\n\nGem::Specification.new do |s|\n s.name = 'mongo'\...
ruby
chosen
[ { "from": "system", "value": "Fix development dependencies are too strong\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'omise/version'\n\nGem::Specification.new do |spec|\n spec.n...
ruby
chosen
[ { "from": "system", "value": "Update swift version and pod version\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Fisticuffs\"\n s.version = \"0.0.7\"\n s.summary = \"Fisticuffs is a data binding framework for Swift, inspired by Knockout.\"\...
ruby
chosen
[ { "from": "system", "value": "Make migration templates visible in Rails app\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'rails_event_store_active_record/generators/migration_generator'\nrequire 'rails_event_store_active_record/generators/index_by_event_type_genera...
ruby
chosen
[ { "from": "system", "value": "Refactor tests to use MiniTest::Spec\n\nAs minimal required ruby is 1.9.2 there is no point to keep using\nTest::Unit\n" }, { "from": "human", "value": "require 'test/unit'\nrequire 'sitemap_reader'\n\nclass SitemapReaderTest < Test::Unit::TestCase\n def test_get_u...
ruby
chosen
[ { "from": "system", "value": "Remove more un-needed code from the fake Customer\n\nRemove more un-needed code from the Customer which came from the ActionPack\ntests\n" }, { "from": "human", "value": "require \"active_model\"\n\nclass Customer < Struct.new(:name, :id)\n extend ActiveModel::Nami...
ruby
chosen
[ { "from": "system", "value": "Allow overriding app_type from Rake apps\n\nFixes #351\n" }, { "from": "human", "value": "require 'bugsnag'\n\nRake::TaskManager.record_task_metadata = true\n\nclass Rake::Task\n\n def execute_with_bugsnag(args=nil)\n Bugsnag.configuration.app_type = \"rake\"\n ...
ruby
chosen
[ { "from": "system", "value": "Make prodcution default for api\n" }, { "from": "human", "value": "module Doccy\n module Config\n \n class << self\n attr_accessor :endpoints\n attr_accessor :prefix\n attr_accessor :partner_key\n attr_accessor :app_secret\n attr_acce...
ruby
chosen
[ { "from": "system", "value": "Use a monotonic time for Rack::Runtime, if available\n\nTime.now is prone to inaccuracies if the system time changes during the\nrequest. This could be due to DST, NTP, etc. Using a monotonic clock\n(available in Ruby 2.1+ on certain platforms) avoids this problem.\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Use const_defined? and const_get correctly in Rollbar::JSON\n\nPassing inherit = false we ensure we only find constants in the passed module.\n" }, { "from": "human", "value": "require 'multi_json'\nrequire 'rollbar/json/oj'\nrequire 'rollbar/json/default'\n\nbegin\...
ruby
chosen
[ { "from": "human", "value": "Add a class for dumping the routes to a file\n" }, { "from": "gpt", "value": "require \"csv\"\nrequire \"zlib\"\n\nclass RouteDumper\n FIELDS = %w(incoming_path handler backend_id disabled redirect_to).freeze\n\n def initialize(filename)\n @filename = filename\n...
ruby
chosen
[ { "from": "system", "value": "Use post instead of get\n" }, { "from": "human", "value": "module Slack\n class Client < API\n METHODS = %w(users.list channels.history channels.mark\n channels.list files.upload files.list\n im.history im.list groups.history groups...
ruby
chosen
[ { "from": "human", "value": "Add ruby svn client proof of concept using ffi\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\n#\n# Please remember to run:\n# sudo apt install libsvn-dev\n#\n\nrequire 'pp'\nrequire 'ffi'\n\nmodule MyLib\n class SvnVersionT < FFI::Struct\n layout(\...
ruby
chosen
[ { "from": "system", "value": "Revert \"Final test fix attempt\"\n\nThis reverts commit a3f0900487cfc60581fb1d17a5c0ad9dec148e50.\n" }, { "from": "human", "value": "# SampleAttribute\nFactory.define(:sample_attribute) do |f|\n f.sequence(:title) { |n| \"Sample attribute #{n}\" }\n f.association...
ruby
chosen
[ { "from": "system", "value": "Add some tests for cookies_concern\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Referrals::CookiesConcern, type: :controller do\n controller(ApplicationController) do\n include Referrals::CookiesConcern\n\n def fake_action; rend...
ruby
chosen
[ { "from": "system", "value": "Remove the change for timestamp append.\n" }, { "from": "human", "value": "use_s3_caching ENV['USE_S3_CACHE'] || false\ns3_access_key ENV['CACHE_AWS_ACCESS_KEY_ID']\ns3_secret_key ENV['CACHE_AWS_SECRET_ACCESS_KEY']\ns3_bucket ENV['CACHE_AWS_BUCKET']\ns3_region ENV['...
ruby
chosen
[ { "from": "system", "value": "Switch site to readonly mode on ramoth\n" }, { "from": "human", "value": "name \"web\"\ndescription \"Role applied to all web/api servers\"\n\ndefault_attributes(\n :accounts => {\n :users => {\n :rails => {\n :status => :role,\n :members => [...
ruby
chosen
[ { "from": "system", "value": "Make (most) date helpers locale-aware.\n" }, { "from": "human", "value": "module DatesHelper\n\n # Format a datestamp as \"December 26, 2015 at 8:45 PM\"\n def long_friendly_datetime(date)\n date.strftime(\"%B %e, %Y at %l:%M%p\")\n end\n\n # Format a datesta...
ruby
chosen
[ { "from": "system", "value": "Create a gravatar helper for get users pictures\n\n" }, { "from": "human", "value": "module UsersHelper\nend\n" }, { "from": "gpt", "value": "module UsersHelper\n # Get the gravatar picture of a user.\n # This take an user object as parameter.\n ...
ruby
chosen
[ { "from": "system", "value": "Reduce number of Puma processes and threads\n\nUsing a simple Suspenders application, I profiled memory usage for our\ndefault configuration, as well as a few others. I found the following:\n\n* A Puma cluster uses a master process and multiple worker processes.\n The amount o...
ruby
chosen
[ { "from": "system", "value": "Add rake a development dependency.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/flavour_saver/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"James Harton\"]\n gem.email = [\...
ruby
chosen
[ { "from": "human", "value": "Add Glyphish Color Changer 1.0-beta.2\n\nCloses #7260.\n" }, { "from": "gpt", "value": "class GlyphishColorChanger < Cask\n version '1.0-beta.2'\n sha256 '2fe6d7b5b056a67ca69c4f5cf477bc0c9ecf47a8d7aa95eefcb97c0fde0e75d8'\n\n url \"https://github.com/glyphish/color...
ruby
chosen
[ { "from": "human", "value": "Remove pre tax amount column on shipments and line items\n\nThis column is no longer needed, as we do the calculation of\nthe pre tax amount on the fly whenever needed.\n" }, { "from": "gpt", "value": "class RemovePreTaxAmountOnLineItemAndShipment < ActiveRecord::Mig...
ruby
chosen
[ { "from": "system", "value": "Fix next <-> previous :sweat_drops:\n" }, { "from": "human", "value": "class Post < ActiveRecord::Base\n belongs_to :site\n belongs_to :category\n\n scope :published, -> { where('published_at <= ?', Time.current) }\n scope :order_by_recently, -> { order(:publish...
ruby
chosen
[ { "from": "system", "value": "Remove the custom devise junk.\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n self.table_name = 'wafflemix_users'\n\n attr_accessor :login\n attr_accessible :email, :username, :password, :password_confirmation, :remember_me, :login\n\n devi...
ruby
chosen
[ { "from": "system", "value": "Add more logging to find_or_create_from_oauth\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n\thas_many :students, order: :first_name\n\n # Include default devise modules. Others available are:\n # :confirmable, :lockable, :timeoutable and :om...
ruby
chosen
[ { "from": "system", "value": "Update number of Dojos in 2017/04\n\ncf.\nhttps://speakerdeck.com/tkc49/shi-min-shu-coderdojohuo-dong-shuo-ming-hui\n" }, { "from": "human", "value": "class Dojo < ApplicationRecord\n NUM_OF_COUNTRIES = \"69\"\n NUM_OF_WHOLE_DOJOS = \"1,200\"\n NUM_OF_JAPAN_DOJ...
ruby
chosen
[ { "from": "system", "value": "Add documentation for weird method in 'Game'\n" }, { "from": "human", "value": "require_relative '../concepts/game_state'\nrequire_relative '../concepts/player_state'\nrequire_relative '../services/apply_action'\n\nclass Game < ActiveRecord::Base\n has_many :player...
ruby
chosen
[ { "from": "system", "value": "Create class method User.new_token to create a new token\n" }, { "from": "human", "value": "require 'bcrypt'\n\nclass User < ApplicationRecord\n validates :username, presence: { message: \"Username field can't be left blank\"}, length: { in: 4..15, message: 'Userna...
ruby
chosen