conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update podspec to version 1.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"PullToMakeSoup\"\n s.version = \"1.0\"\n s.summary = \"Custom animated pull-to-refresh that can be easily added to UIScrollView\"\n\n s.homepag...
ruby
chosen
[ { "from": "human", "value": "Migrate Lightroom 5.7.1 from homebrew-cask\n" }, { "from": "gpt", "value": "cask :v1 => 'adobe-photoshop-lightroom' do\n version '5.7.1'\n sha256 '155a91e2c90927a05ccaa244a99fed4784fa7cf26d08c634f5f111629f6b0418'\n\n url \"http://download.adobe.com/pub/adobe/light...
ruby
chosen
[ { "from": "system", "value": "Enhance specs for worker killing" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Vidibus::Recording::Worker do\n let(:recording) do\n Recording.create({\n :name => 'Example Stream',\n :stream => 'rtmp://example.host'\n })\n end\n...
ruby
chosen
[ { "from": "system", "value": "Fix feed reeding by properly rescuing error\n" }, { "from": "human", "value": "class Entry < ActiveRecord::Base\n has_many :remote_apps\n accepts_nested_attributes_for :remote_apps\n\n validates :uid, uniqueness: true\n scope :recently_modified, -> { order(\"upd...
ruby
chosen
[ { "from": "system", "value": "Add show_all Action to Courses Controller\n\nUpdate the Courses controller to include the show_all action.\n" }, { "from": "human", "value": "class CoursesController < ApplicationController\n before_filter :authenticate_user!\n before_filter :get_course, :only => ...
ruby
chosen
[ { "from": "system", "value": "Simplify redirects in the InvitesController\n" }, { "from": "human", "value": "class InvitesController < ApplicationController\n before_action :authenticate_user!\n\n def accept\n invite = current_user.invites.open.find(params[:id])\n handle = params[:handle...
ruby
chosen
[ { "from": "system", "value": "Add Rails 4.1 new scope syntax\n" }, { "from": "human", "value": "module Spree\n class HomePageFeature < ActiveRecord::Base\n\n validates :title,\n presence: true,\n length: { minimum: 1 }\n\n validates :body,\n presence: true,\n length: {...
ruby
chosen
[ { "from": "system", "value": "Handle other exceptions when statistic empty\n" }, { "from": "human", "value": "class StatisticPresenter\n def initialize model\n @model = model\n @statistic = model.statistic\n end\n\n def percentage_of_global_pas\n percentage = (pa_area / global_statis...
ruby
chosen
[ { "from": "system", "value": "Fix memory problem on UIWebView\n" }, { "from": "human", "value": "module HBFav2\n class WebView < UIWebView\n def stopLoading\n super\n App.shared.networkActivityIndicatorVisible = false\n end\n\n def dealloc\n NSLog(\"dealloc: \" + self.cl...
ruby
chosen
[ { "from": "system", "value": "Update Intel HAXM to version 1.1.1\n" }, { "from": "human", "value": "cask :v1 => 'intel-haxm' do\n version '1.0.8'\n sha256 'cee233cf1a0293d9e19b15c375f2c4cb7cf0c6948b7fd579bec28719e0b51d35'\n\n url 'https://software.intel.com/sites/default/files/managed/68/45/h...
ruby
chosen
[ { "from": "system", "value": "Update VirtualBox to version 4.3.8\n" }, { "from": "human", "value": "class Virtualbox < Cask\n url 'http://download.virtualbox.org/virtualbox/4.3.6/VirtualBox-4.3.6-91406-OSX.dmg'\n homepage 'http://www.virtualbox.org'\n version '4.3.6-91406'\n sha256 '60678b7c...
ruby
chosen
[ { "from": "system", "value": "Set the version of the podspec to 0.0.2." }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"EECircularMusicPlayerControl\"\n s.version = \"0.0.1\"\n s.summary = \"A control to play a music with a progress indicator.\"\n s.descri...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to depend on Guard ~> 2.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'guard/compass/version'\n\nGem::Specification.new do |s|\n s.name = 'guard-compass'\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Remove knowledge of serialization details by marshaling twice\n" }, { "from": "human", "value": "require 'set'\n\nclass BuildEnvironment\n attr_accessor :proc\n\n def initialize(*settings)\n @settings = Set.new(*settings)\n end\n\n def merge(*args)\n @sett...
ruby
chosen
[ { "from": "system", "value": "Update to return a document response\n" }, { "from": "human", "value": "module BoaVistaStubs\n class RequestsController < BoaVistaStubs::ApplicationController\n def index\n # Returns a Document::CPF or Document::CNPJ instance\n document = Document.iden...
ruby
chosen
[ { "from": "system", "value": "Hide the search on load\n" }, { "from": "human", "value": "class AppDelegate\n def application(application, didFinishLaunchingWithOptions:launchOptions)\n @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)\n @window.rootViewController = Device...
ruby
chosen
[ { "from": "system", "value": "Add default scope for game appointments to order by table\n" }, { "from": "human", "value": "class Round < ApplicationRecord\n include YearlyModel\n\n belongs_to :tournament\n has_many :game_appointments, dependent: :destroy\n validates :number, presence: true\n...
ruby
chosen
[ { "from": "system", "value": "Allow use of libvips through env variable [SCI-3881]\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'active_storage/previewer/libreoffice_previewer'\n\nRails.application.config.active_storage.previewers = [ActiveStorage::Previewer::Poppl...
ruby
chosen
[ { "from": "system", "value": "Set booth and officer assignments to Poll Voter on officing panel\n" }, { "from": "human", "value": "class Officing::VotersController < Officing::BaseController\n respond_to :html, :js\n\n before_action :load_officer_assignment\n before_action :verify_officer_ass...
ruby
chosen
[ { "from": "system", "value": "Raise ActiveRecord::RecordNotFound if source is not imported\n" }, { "from": "human", "value": "class SourceDownloadController < ApplicationController\n def show\n @branch = Branch.find_by!(name: params[:branch])\n @srpm = @branch.srpms.find_by!(name: params[...
ruby
chosen
[ { "from": "system", "value": "Add missing url_helpers used in the OBS layout\n" }, { "from": "human", "value": "module ObsFactory\n module ApplicationHelper\n\n # Catch some url helpers used in the OBS layout and forward them to\n # the main application\n %w(root_path project_show_path...
ruby
chosen
[ { "from": "system", "value": "Fix the project_id setting for Airbrake\n\nThis changed recently in Airbrake 1.4.1, so a project ID needs to be set\nproperly.\n" }, { "from": "human", "value": "Airbrake.configure do |config|\n config.project_key = ENV['ECHO_TRELLO_AIRBRAKE_API'] || \"airb...
ruby
chosen
[ { "from": "human", "value": "Add migration that creates album_tracks table\n" }, { "from": "gpt", "value": "class CreateAlbumTracks < ActiveRecord::Migration[4.2]\n def self.up\n create_table :album_tracks do |a|\n a.uuid :track_id, :null => false\n a.uuid :album_id, :null => false...
ruby
chosen
[ { "from": "system", "value": "Use activerecord `values_for_create` to replace `scope_for_create`\n\nIn relation to the changes in `activerecord` version `5.2.2`\nin using `scope_for_create` (https://github.com/rails/rails/pull/33639/files),\nwe must use the new method `values_for_create` provided.\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Change metric names, add begin/ensure around conn\n" }, { "from": "human", "value": "module Collective::Collectors\n class Postgres < Collective::Collector\n MEGABYTE = 1024 * 1024\n\n requires :pg\n\n resolution '600s'\n\n collect do\n group 'post...
ruby
chosen
[ { "from": "system", "value": "Simplify set creation in Graph::Edge\n" }, { "from": "human", "value": "class Graph\n class Edge\n attr_reader :name\n attr_reader :left\n attr_reader :right\n\n def initialize(name, left, right)\n @name = name.to_sym\n @left = left\n @...
ruby
chosen
[ { "from": "human", "value": "Add script to migrate object dbs\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n# Migrates .yardocs to --single-db\n$:.unshift(File.dirname(__FILE__) + '/../')\n$:.unshift(File.dirname(__FILE__) + '/../lib')\n$:.unshift(File.expand_path(File.dirname(__FILE__) ...
ruby
chosen
[ { "from": "system", "value": "Make MLton formula install statically-linked-gmp\n\nCloses Homebrew/homebrew#9529\n\nSigned-off-by: Misty De Meo <85d6b3741948526aebc363d97f74b6575b2cc027@gmail.com>\n" }, { "from": "human", "value": "require 'formula'\n\n# Installs the binary build of MLton.\n# Sin...
ruby
chosen
[ { "from": "system", "value": "Fix issue with Ruby 1.8.7 which did not allow for the return in an each_pair of the hash\n" }, { "from": "human", "value": "#\n# upcase.rb\n#\n\nmodule Puppet::Parser::Functions\n newfunction(:upcase, :type => :rvalue, :doc => <<-EOS\nConverts a string or an array ...
ruby
chosen
[ { "from": "system", "value": "Fix the redirection login in the /login route.\n" }, { "from": "human", "value": "module Shield\n module Sinatra\n module Default\n def self.registered(m)\n m.set :shield_redirect_after_login, \"/\"\n m.set :shield_redirect_after_logout, \"/\...
ruby
chosen
[ { "from": "system", "value": "Fix so that options are passed to each row\n" }, { "from": "human", "value": "module TableCloth\n module Presenters\n class Default < ::TableCloth::Presenter\n def render_table\n wrapper_tag :table do\n render_header + render_rows\n e...
ruby
chosen
[ { "from": "system", "value": "Use new DSL in the plugin\n" }, { "from": "human", "value": "module Danger\n class Files < Plugin\n def protect_files(path: nil, message: nil, fail_build: true)\n raise \"You have to provide a message\" if message.to_s.length == 0\n raise \"You have to...
ruby
chosen
[ { "from": "system", "value": "Remove gem constraint on rake\n\nRake is a very stable gem and it doesn't seem necessary to keep a\nconstraint on it as it requires frequently updating it.\n" }, { "from": "human", "value": "lib = File.expand_path(\"lib\", __dir__)\n$LOAD_PATH.unshift(lib) unless $L...
ruby
chosen
[ { "from": "human", "value": "Fix /specialist-guides/ links in detailed guide body text\n\nSome detailed guides have cross links to the old admin url for detailed guides /admin/specialist-guides/ and so these don't get govspokenified on frontend to refer to the public url for the latest edition of that guide...
ruby
chosen
[ { "from": "system", "value": "Add dependency on glimpse now that it's on RubyGems\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'glimpse-git/version'\n\nGem::Specification...
ruby
chosen
[ { "from": "system", "value": "Test updates for non-GCS releases\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Releases::Create do\n it \"creates a release object\" do\n Release.destroy_all\n url = \"http://foo.bar/baz\"\n expect(Release).to receive(:transload)....
ruby
chosen
[ { "from": "system", "value": "Upgrade Opera Beta.app to v29.0.1795.26\n" }, { "from": "human", "value": "cask :v1 => 'opera-beta' do\n version '29.0.1795.21'\n sha256 'ffcf288fbbe993c772658ea20f5230525246e046f69a162e5eeabb6de4ecd73c'\n\n url \"http://get.geo.opera.com/pub/opera-beta/#{version...
ruby
chosen
[ { "from": "system", "value": "Add pry as a development dependency, fails otherwise\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\n spec.name = \...
ruby
chosen
[ { "from": "system", "value": "Replace use of deprecated Active Record method\n" }, { "from": "human", "value": "class Identity < ApplicationRecord\n belongs_to :user\n\n validates_presence_of :provider, :uid\n validates_uniqueness_of :uid, scope: :provider\n\n def self.find_or_create(auth)\n...
ruby
chosen
[ { "from": "human", "value": "Add basic ping pong example\n" }, { "from": "gpt", "value": "#!/bin/env ruby\n\nrequire 'bundler/setup'\nrequire 'ffi/libevent'\nrequire 'socket'\n\nbase = FFI::Libevent::Base.new\ntrapper = FFI::Libevent::Event.new(base, \"INT\", FFI::Libevent::EV_SIGNAL) { base.loo...
ruby
chosen
[ { "from": "system", "value": "Add connection-server as a runtime dependency\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'http-server'\n s.version = '0.0.2.3'\n s.summary = 'Simple HTTP Server using http-protocol'\n s.description = ' '\n\n s.aut...
ruby
chosen
[ { "from": "system", "value": "Change the redirect destination after entry creation\n" }, { "from": "human", "value": "class EntriesController < ApplicationController\n before_action :logged_in_user\n before_action :set_live\n before_action :draft_live\n\n def index\n @entries = @live.song...
ruby
chosen
[ { "from": "system", "value": "Fix bug in before filter again\n" }, { "from": "human", "value": "# route handlers dealing with the collection\nget '/entries' do\n @entries = Entry.most_recent\n erb :'entries/index'\nend\n\npost '/entries' do\n @entry = Entry.new(params[:entry])\n\n if @entry....
ruby
chosen
[ { "from": "system", "value": "Move document check to before_action filter\n\nHandle a 404 for a non-existent document in a before filter to keep\nexceptional behaviour out of the normal logic.\n\nAlso extract a `document` method to fetch the document object.\n" }, { "from": "human", "value": "re...
ruby
chosen
[ { "from": "system", "value": "Revert \"Remove delete digitals on soft delete of variant\"\n\nThis reverts commit d23462fadb5ef049b9ed4f667bd405e343c654b1.\n" }, { "from": "human", "value": "Spree::Variant.class_eval do\n has_many :digitals, :dependent => :destroy\n \n # Is this variant to be ...
ruby
chosen
[ { "from": "system", "value": "Remove hashing from secure_compare and clarify documentation\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"digest/sha2\"\n\nmodule ActiveSupport\n module SecurityUtils\n # Constant time string comparison, for fixed length strings....
ruby
chosen
[ { "from": "system", "value": "Use Ruby keyword args in CreateManualService\n\nI think that using language features instead of custom code makes this\neasier to understand.\n" }, { "from": "human", "value": "class CreateManualService\n def initialize(dependencies)\n @manual_repository = depen...
ruby
chosen
[ { "from": "system", "value": "Update WSDL URL and start setting ReturnType\n" }, { "from": "human", "value": "require 'savon'\nrequire 'backport_dig'\nrequire 'byebug'\n\nmodule Asendia\n # Handles communication with Asendia API\n class Client\n WSDL_URL = 'https://demo0884331.mockable.io/?...
ruby
chosen
[ { "from": "system", "value": "Define class methods instead of scopes\n\nMaybe CodeClimate will like it more...\n" }, { "from": "human", "value": "require \"active_record\"\n\nmodule Authem\n class Session < ::ActiveRecord::Base\n self.table_name = :authem_sessions\n\n belongs_to :subject,...
ruby
chosen
[ { "from": "system", "value": "Include hash of details and expanded_links in dump\n" }, { "from": "human", "value": "require \"csv\"\nrequire \"zlib\"\n\nclass ContentDumper\n FIELDS = %w(base_path content_id locale document_type schema_name rendering_app publishing_app updated_at).freeze\n\n d...
ruby
chosen
[ { "from": "system", "value": "Optimize row counts for most common browser widths.\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n\n def index\n if current_user\n @src_sets = SrcSet.active.most_recent(8)\n @src_images = SrcImage.without_image.includ...
ruby
chosen
[ { "from": "system", "value": "Change git hash command to use log instead of show\n" }, { "from": "human", "value": "module SameBoat\n class Crew\n def initialize(file_path)\n @file_path = file_path\n end\n\n def present\n git? ? git_commit_hash : file_hash\n end\n\n pri...
ruby
chosen
[ { "from": "system", "value": "Make event export/import streaming to conserve memory\n" }, { "from": "human", "value": "\nnamespace :events do\n desc \"Exports events from a given timestamp to tmp/events.json\"\n task export: :environment do\n timestamp = ENV.fetch(\"TIMESTAMP\")\n dateti...
ruby
chosen
[ { "from": "human", "value": "Add rake task to create CSV from check in data\n\nFix #52\n" }, { "from": "gpt", "value": "class Record\n attr_accessor :created_at, :meeting_date, :club_name, :leaders, :attendance,\n :notes\n\n def initialize(created_at, meeting_date, club_name, leaders, atten...
ruby
chosen
[ { "from": "system", "value": "Make hipchat room name a constant\n" }, { "from": "human", "value": "require 'logger'\nrequire 'em-irc'\nrequire 'hipchat'\n\nIRC_HOST = 'irc.freenode.net'\nIRC_PORT = '6667'\nIRC_CHANNEL = '#emacs'\n\nhipchat_client = HipChat::Client.new(ENV['HIPCHAT_AUTH_TOKEN'], ...
ruby
chosen
[ { "from": "system", "value": "Remove flash notice after successful signin\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n \n def create\n user = User.find_by(username: params[:user][:username])\n if user && user.authenticate(params[:user][:password])...
ruby
chosen
[ { "from": "human", "value": "Create tracker object helper methods\n" }, { "from": "gpt", "value": "module Landable\n module TrafficHelper\n def crawl_tracker\n @tracker if @tracker.is_a? Landable::Traffic::CrawlTracker\n end\n\n def noop_tracker\n @tracker if @tracker.is_a? L...
ruby
chosen
[ { "from": "system", "value": "Add scope for get active copayments\n" }, { "from": "human", "value": "module Spree\n class CopaymentRelation < ActiveRecord::Base\n belongs_to :relatable, class_name: 'Spree::Variant', touch: true\n belongs_to :related_to, class_name: 'Spree::Variant'\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove scope deprecation warning sytax\n" }, { "from": "human", "value": "Spree::Shipment.class_eval do\n scope :exportable, joins(:order).where('spree_shipments.state != ?', 'pending')\n\n def self.between(from, to)\n joins(:order).where('(spree_shipments.upda...
ruby
chosen
[ { "from": "system", "value": "Remove protocol prefix from hostname\n" }, { "from": "human", "value": "require \"swagger/blocks\"\n\nmodule ApiFlashcards\n include Swagger::Blocks\n host = if ENV['RAILS_ENV'] == \"production\"\n \"https://mkdev-flashcards.herokuapp.com\"\n else\n \"local...
ruby
chosen
[ { "from": "system", "value": "Use domain_id in search query\n" }, { "from": "human", "value": "class DomainController < ApplicationController\n before_filter :set_body_template\n helper_method :resource, :resource_path\n\n def dashboard\n @body_template = :body_yield\n end\n\n def search...
ruby
chosen
[ { "from": "system", "value": "Fix AppSignal loading when using Sinatra::Base\n\nLooks like that when using `require \"sinatra/base\"` instead of\n`require \"sinatra\"` the root path is not set on the sinatra application.\nThe user should do this themselves, but it's not required.\n\nhttps://github.com/sinat...
ruby
chosen
[ { "from": "system", "value": "Decompress a few lines for better readability\n" }, { "from": "human", "value": "require 'singleton'\nrequire 'forwardable'\nrequire 'yaml'\nrequire 'hashie/mash'\n\nclass Chamber\n include Singleton\n\n class << self\n extend Forwardable\n\n def_delegators ...
ruby
chosen
[ { "from": "system", "value": "Fix invalid encoding on generated reply_to destination during responding to requests\n" }, { "from": "human", "value": "module Messaging\n module MessageHandlers\n class BaseMessageHandler < Struct.new(:callback, :destination, :logger)\n attr_reader :proper...
ruby
chosen
[ { "from": "system", "value": "Add Ability To Delete By Service Name\n" }, { "from": "human", "value": "require 'duration'\nrequire 'httpclient'\n\nmodule Clowder\n CLOWDER_ROOT_URL = 'http://www.clowder.io'\n CLOWDER_API_URL = CLOWDER_ROOT_URL + '/api'\n\n class Client\n attr_reader :api_k...
ruby
chosen
[ { "from": "system", "value": "Remove old settings path code from\n" }, { "from": "human", "value": "require 'git-helper/menus/menu'\nrequire 'git-helper/menus/main'\nrequire 'git-helper/actions/settings/main_branch_action'\n\nmodule GitHelper\n class SettingsMenu < Menu\n include Settings\n\...
ruby
chosen
[ { "from": "system", "value": "Update gemspec for new release.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'capistrano-detect-migrations'\n s.version = '0.5.1'\n s.date = '2012-04-11'\n s.summary = \"Detect pending Rails migrations with Gi...
ruby
chosen
[ { "from": "system", "value": "Fix scoping issue on params\n" }, { "from": "human", "value": "require \"ferrety_ferret/version\"\nrequire \"httparty\"\nmodule Ferrety\n \n class Ferret\n attr_accessor :alerts\n\n def initialize(params)\n clear_alerts\n params = parse(params)\n ...
ruby
chosen
[ { "from": "system", "value": "Add requiring gems to before_configuration\n" }, { "from": "human", "value": "module Kuroko2\n class Engine < ::Rails::Engine\n isolate_namespace Kuroko2\n end\nend\n" }, { "from": "gpt", "value": "module Kuroko2\n class Engine < ::Rails::Engine\n ...
ruby
chosen
[ { "from": "system", "value": "Add rake as development dependency in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'lyricfy/version'\n\nGem::Specification.new do |g...
ruby
chosen
[ { "from": "system", "value": "Increase session expiration to 6 months\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRails.application.config.session_store :redis_store,\n servers: ENV[\"REDIS_URL\"] + \"/0/sessions\",\n ...
ruby
chosen
[ { "from": "system", "value": "Make session cookie domain :all for single sign out\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.session_store :cookie_store, key: '_marli_session'\n" }, { "from": "gpt", "valu...
ruby
chosen
[ { "from": "system", "value": "Move scopes to tree structure\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule GitHub\n module Token\n class << self\n EXPANSIONS = {\n user: [\"read:user\", \"user:email\", \"user:follow\"],\n repo: ...
ruby
chosen
[ { "from": "system", "value": "Store screenshot when feature test fails\n\nThis is useful when debugging a failing test.\n\nCo-authored-by: Stephan Kulow <f965a4a1b587c4e3c1892642aed563e43902502b@kulow.org>\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRSpec.configure do |co...
ruby
chosen
[ { "from": "system", "value": "Fix ivar naming in Mutant::Color\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Mutant\n # Class to colorize strings\n class Color\n include Adamantium::Flat, Concord.new(:color)\n\n # Format text with color\n #\n # @param [String] text...
ruby
chosen
[ { "from": "system", "value": "Load host and service object from remote status.dat on boot\n" }, { "from": "human", "value": "require 'nagip/dsl'\n\nmodule Nagip\n class Loader\n #module_function\n\n class << self\n include Nagip::DSL\n\n def run\n instance_eval File.read(...
ruby
chosen
[ { "from": "system", "value": "Set default value for args in caller instantiation on API.\n" }, { "from": "human", "value": "module Qmetrics\n class HTTPStatusError < StandardError\n end\n\n class API\n\n def initialize(server: , port: , user: , pass: )\n @base_route = \"http://#{serve...
ruby
chosen
[ { "from": "system", "value": "Update pod version to 1.19.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"netfox\"\n s.version = \"1.18.0\"\n s.summary = \"A lightweight, one line setup, iOS/OSX network debugging library!\"\n\n s.descriptio...
ruby
chosen
[ { "from": "system", "value": "Support directories inside partials directory.\n" }, { "from": "human", "value": "module Troy\n module Helpers\n def h(content)\n CGI.escapeHTML(content)\n end\n\n def t(*args)\n I18n.t(*args)\n end\n\n def partial(name, locals = {})\n ...
ruby
chosen
[ { "from": "system", "value": "Copy secrets to server before db:migrate\n" }, { "from": "human", "value": "set :application, 'cms'\nset :repo_url, 'git@github.com:obduk/cms.git'\n\nset :deploy_to, '/var/www/cms'\n\nset :linked_dirs, ['tmp/pids', 'tmp/sockets']\n\nset :log_level, :info\n\nset :kee...
ruby
chosen
[ { "from": "system", "value": "Delete vote when it's set to less than or equal to 0.\n\nAnd why is it even configurable.\n" }, { "from": "human", "value": "module PostVoteMethods\n module ClassMethods\n def recalculate_score(id=nil)\n conds = []\n cond_params = []\n\n sql = \"U...
ruby
chosen
[ { "from": "system", "value": "Fix NPR for assets that are not initialized\n" }, { "from": "human", "value": "class BasicReportRow\n \n attr_accessor :key, :count, :replacement_cost, :id_list\n \n def initialize(key)\n self.key = key\n self.count = 0\n self.replacement_cost = 0\n ...
ruby
chosen
[ { "from": "human", "value": "Add tests for Collector paths\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nmodule Schemacop\n class CollectorTest < Minitest::Test\n def test_no_root_node\n s = Schema.new do\n req :a, :string\n end\n\n col = s.validate(a: 0)\n ...
ruby
chosen
[ { "from": "system", "value": "Add support for active_record.table_name_prefix and active_record.table_name_suffix.\nThanks accy.\n" }, { "from": "human", "value": "module Foreigner\n module ConnectionAdapters\n module Sql2003\n def supports_foreign_keys?\n true\n end\n \n...
ruby
chosen
[ { "from": "system", "value": "Remove redundant freeze (required by CircleCI)\n\nSigned-off-by: David A. Wheeler <9ae72d22d8b894b865a7a496af4fab6320e6abb2@dwheeler.com>\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass UrlValidator < ActiveModel::EachValidator\n # The URL...
ruby
chosen
[ { "from": "system", "value": "Add deployment targets to podspec.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'XcodeEditor'\n s.version = '1.6.1'\n s.license = 'Apache2.0'\n s.summary = 'An API for manipulating Xcode Projects using objective-C.'\n s.homepage = '...
ruby
chosen
[ { "from": "system", "value": "Fix running specs multiple times.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe DynamoDBMutex::Lock do\n\n let(:locker) { DynamoDBMutex::Lock }\n let(:lockname) { 'test.lock' }\n\n describe '#with_lock' do\n\n def run(id, seconds)\n ...
ruby
chosen
[ { "from": "system", "value": "Make it v1.0.0, since it's production ready\n" }, { "from": "human", "value": "module ActivePresenter\n module VERSION\n MAJOR = 0\n MINOR = 0\n TINY = 5\n \n STRING = [MAJOR, MINOR, TINY].join('.')\n end\nend\n" }, { "from": "gp...
ruby
chosen
[ { "from": "system", "value": "Include all columns by default, not just content_columns. This is because we definitely\nwant to include foreign keys in the parameters to watch as well.\n\n\ngit-svn-id: 36d0598828eae866924735253b485a592756576c@7743 da5c320b-a5ec-0310-b7f9-e4d854caa1e2\n" }, { "from": ...
ruby
chosen
[ { "from": "system", "value": "Print sync completion to logs\n" }, { "from": "human", "value": "module FBPi\n # This Object is responsible for contacting the Farmbot Web App via REST calls\n # in order to fetch the latest command execution schedules.\n class SyncBot < Mutations::Command\n r...
ruby
chosen
[ { "from": "system", "value": "Add pluralize method to StringFormatter module\n" }, { "from": "human", "value": "module StringFormatter\n def truncate(count)\n total_length = 0\n truncated = false\n new_string = \"\"\n\n self.to_s.strip.split(/\\s/).each do |word|\n word = word....
ruby
chosen
[ { "from": "system", "value": "Support web console on vagrant\n" }, { "from": "human", "value": "Rails.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 # ...
ruby
chosen
[ { "from": "system", "value": "Add log file for delayed job\n" }, { "from": "human", "value": "Delayed::Worker.destroy_failed_jobs = false\n" }, { "from": "gpt", "value": "Delayed::Worker.destroy_failed_jobs = false\nDelayed::Worker.logger = Logger.new(File.join(Rails.root, 'log', 'de...
ruby
chosen
[ { "from": "system", "value": "Use OnlyOnce to build the middleware stack\n" }, { "from": "human", "value": "require_relative 'action/configure_apt_proxy'\nrequire_relative 'action/configure_chef_proxy'\nrequire_relative 'action/configure_env_proxy'\n\nmodule VagrantPlugins\n module ProxyConf\n ...
ruby
chosen
[ { "from": "system", "value": "Allow dot releases to fog\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'propono/version'\n\nGem::Specification.new do |spec|\n spec.name = \...
ruby
chosen
[ { "from": "system", "value": "Add logic to create a new person along with the account and user (and sync emails between user and person).\n" }, { "from": "human", "value": "class AccountsController < ApplicationController\n def new\n @account = Account.new\n @new_account_user = User.new\n...
ruby
chosen
[ { "from": "system", "value": "Put the notice back and removed TODO\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n \n skip_before_filter :require_current_user, :except => [:destroy]\n \n def new\n end\n\n def create\n user = User.find_by_email(param...
ruby
chosen
[ { "from": "system", "value": "Fix sessions controller bug for nonexistent users." }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n before_action :prevent_duplicate_sign_in, only: [:create, :new]\n\n def create\n if params[:session][:login].match(User::EMA...
ruby
chosen
[ { "from": "system", "value": "Add stories instance variable to show controller\n" }, { "from": "human", "value": "class SnippetsController < ApplicationController\n\n def index\n @snippets = Snippet.random\n end\n\n def new\n @snippet = Snippet.new\n end\n\n def create\n @snippet =...
ruby
chosen
[ { "from": "system", "value": "Remove redundant user of require in UserForm. The FormObject is autoloaded.\n" }, { "from": "human", "value": "require \"form_object\"\n\nclass UserForm < FormObject::Base\n attributes :name, :age, :gender, of: :user\n attributes :address, of: :email\n\n self.roo...
ruby
chosen