conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Package version increased from 0.1.11 to 0.1.12\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'raygun_client'\n s.version = '0.1.11'\n s.summary = 'Client for the Raygun API using the Obsidian HTTP client'\...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 0.2.2.0 to 0.3.2.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'raygun_client'\n s.version = '0.2.2.0'\n s.summary = 'Client for the Raygun API using the Obsidian HTTP clien...
ruby
chosen
[ { "from": "system", "value": "Fix some weird PG behavior\n" }, { "from": "human", "value": "module Emotions\n module Emotional\n extend ActiveSupport::Concern\n\n included do\n has_many :emotions, as: :emotional, class_name: 'Emotions::Emotion', dependent: :destroy\n\n Emotions....
ruby
chosen
[ { "from": "system", "value": "Mark code as needed for JRuby support\n" }, { "from": "human", "value": "require 'gir_ffi/class_base'\n\nmodule GirFFI\n # Base class for generated classes representing boxed types.\n class BoxedBase < ClassBase\n extend FFI::DataConverter\n\n def self.nativ...
ruby
chosen
[ { "from": "system", "value": "Add link to fakeweb readme\n" }, { "from": "human", "value": "require 'airtable'\nrequire 'fakeweb'\nrequire 'minitest/pride'\nrequire 'minitest/autorun'\n\nFakeWeb.allow_net_connect = false\n\ndef stub_airtable_response(url, response)\n FakeWeb.register_uri(:get, ...
ruby
chosen
[ { "from": "system", "value": "Make tests run on Rails master.\n" }, { "from": "human", "value": "require 'rubygems'\n\nbegin\n gem \"test-unit\"\nrescue LoadError\nend\n\nbegin\n gem \"ruby-debug\"\n require 'ruby-debug'\nrescue LoadError\nend\n\nrequire 'test/unit'\nrequire 'mocha'\n\nENV[\"...
ruby
chosen
[ { "from": "system", "value": "Work around double test reporters from rails.\n" }, { "from": "human", "value": "require \"rails/all\"\nrequire \"measured\"\nrequire \"measured-rails\"\nrequire \"minitest/autorun\"\nrequire \"minitest/reporters\"\nrequire \"mocha/setup\"\nrequire \"pry\" unless EN...
ruby
chosen
[ { "from": "system", "value": "cli: Convert rbld list usage to Ruby\n\nSigned-off-by: Dmitry Fleytman <a8cf97adadec4e1b734a39bc5aea71b5741cfca1@daynix.com>\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nmodule Rebuild\n class RbldListCommand < Command\n legacy_usage_implementation ...
ruby
chosen
[ { "from": "system", "value": "[COOK-3482] Add git to the PATH for the current chef-client run on Windows\n\nThe windows_path resource doesn't change the current process' environment variables. Therefore, git won't actually be on the PATH until the next chef-client run. By directly modifying ENV, we allow gi...
ruby
chosen
[ { "from": "system", "value": "Add by_genre and reached_goal methods\n" }, { "from": "human", "value": "class Project < ApplicationRecord\n belongs_to :user\n has_many :progress_updates, dependent: :destroy\n\n has_many :project_genres, dependent: :destroy\n has_many :genres, through: :projec...
ruby
chosen
[ { "from": "system", "value": "Fix the redirect in the friends destroy action\n\n" }, { "from": "human", "value": "class FriendsController < ApplicationController\n\n before_action :authenticate_user!\n before_action :set_user\n before_action :user_owner\n\n layout \"user-feed\"\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove redundant @content assignment from LandingController\n" }, { "from": "human", "value": "class LandingController < ApplicationController\n def location_search\n @content = AppContentSet.first\n @most_recent_messages = FeedbackInput.includes(:subject).wh...
ruby
chosen
[ { "from": "system", "value": "Comment single stack out until implemented\n" }, { "from": "human", "value": "require 'sfn-parameters/version'\nrequire 'sfn-parameters/infrastructure'\nrequire 'sfn-parameters/single-stack'\n" }, { "from": "gpt", "value": "require 'sfn-parameters/versio...
ruby
chosen
[ { "from": "system", "value": "Fix SlackNotifier url and audit results rule name\n" }, { "from": "human", "value": "require 'json'\n\nclass SlackNotifier\n def initialize(webhook, project_id, commit_hash, audit_result)\n project = Projects[id: project_id]\n @project_name = project.name\n ...
ruby
chosen
[ { "from": "system", "value": "Add memoization to methods generated by `setting` DSL\n\nAs this method is dynamically generated, it is a little uglier than just\nwriting:\n\n @foo ||= self.[](__method__) || options[:default]\n\nbut this brings us to parity with the other method in the class,\n`#repositories...
ruby
chosen
[ { "from": "system", "value": "Use ActiveSupport for class Attributes\n" }, { "from": "human", "value": "module Dataly\n class Mapper\n attr_reader :model\n\n def self.field(from, symbol_or_proc)\n fields[from] = symbol_or_proc\n end\n\n def self.fields\n @@fields ||= {}\n ...
ruby
chosen
[ { "from": "system", "value": "Correct matcher actions causing ChefSpec failures\n" }, { "from": "human", "value": "if defined?(ChefSpec)\n def create_elasticsearch(resource_name)\n ChefSpec::Matchers::ResourceMatcher.new(:elasticsearch, :create, resource_name)\n end\n\n def delete_elastics...
ruby
chosen
[ { "from": "system", "value": "Remove Rails dependency of mattr_accessor\n" }, { "from": "human", "value": "module KmEverything\n mattr_accessor :record_every_controller_action\n mattr_accessor :event_names\n\n class KmEvents < Struct.new(:controller_name, :action_name)\n def event\n s...
ruby
chosen
[ { "from": "system", "value": "Bring back after_create hook with different method name\n" }, { "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 would...
ruby
chosen
[ { "from": "system", "value": "Use an Array of UINT8s.\n" }, { "from": "human", "value": "require 'ffi'\n\nmodule FFI\n module PCap\n class MACAddr < FFI::Struct\n # Number of bytes for an ethernet address\n SIZE = 6\n\n layout :bytes, [:uchar, SIZE]\n\n def self.parse(str...
ruby
chosen
[ { "from": "system", "value": "Fix VCR bug by requiring it explicitly\n" }, { "from": "human", "value": "# Configure Rails Environment\nENV[\"RAILS_ENV\"] = \"test\"\n\nrequire File.expand_path(\"../dummy/config/environment.rb\", __FILE__)\nrequire \"rails/test_help\"\n\nRails.backtrace_cleaner....
ruby
chosen
[ { "from": "system", "value": "Fix for testing the local binary, not the installed binary\n" }, { "from": "human", "value": "$:.unshift(File.join(File.dirname(__FILE__),'..','lib'))\n\nrequire 'rubygems'\nrequire 'bundler'\nBundler.require(:default)\nrequire 'minitest/autorun'\nrequire 'fake_serv...
ruby
chosen
[ { "from": "system", "value": "Change function call to explicitly pass Hash\n\n2.7.0 is more strict about the conversion between positional and named\nparameters\n" }, { "from": "human", "value": "require 'simplecov'\nSimpleCov.start \"rails\"\n\nENV['RAILS_ENV'] ||= 'test'\nrequire File.expand_p...
ruby
chosen
[ { "from": "system", "value": "Update helper with method to read fixture content.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'test/unit'\nrequire 'shoulda'\nrequire 'mocha'\nrequire 'webmock/test_unit'\nrequire 'salesforce_bulk'\n\nclass Test::Unit::TestCase\n \n def self.te...
ruby
chosen
[ { "from": "system", "value": "Return regular play to top of list" }, { "from": "human", "value": "CURRENT_TOP_ROW_VALUES = [200, 400].freeze\n\nPLAY_TYPES = {\n \"toc\" => \"Tournament of Champions\",\n \"regular\" => \"regular play\",\n \"teachers\" => \"T...
ruby
chosen
[ { "from": "system", "value": "Add thor as gemspec dependency\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'billboard_client'\n s.version = '0.0.0'\n s.date = '2014-05-17'\n s.platform = Gem::Platform::RUBY\n s.summary = 'Billboard clie...
ruby
chosen
[ { "from": "system", "value": "Tidy up the format and add homepage to gemspec" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"modest_model\"\n s.authors = [\"Mike Fulcher\"]\n s.summary = \"Simple, tableless ActiveModel-compliant models\"\n s.description = \"Simple...
ruby
chosen
[ { "from": "system", "value": "Add dependency to non-rc rails 4\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'transmitter/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Change to use more recent bundler\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'tty/spinner/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "human", "value": "Add initial fixtures for CI builds\n" }, { "from": "gpt", "value": "Gitlab::Seeder.quiet do\n project = Project.first\n commits = project.repository.commits('master', nil, 10)\n commits_sha = commits.map { |commit| commit.raw.id }\n ci_commits = commits_sha.map d...
ruby
chosen
[ { "from": "system", "value": "Add glass initializer spec cases\n" }, { "from": "human", "value": "require \"glass\"\n\ndescribe Glass do\n it \"should return an empty glass with capacity, weight and name\" do\n \tpint = Glass.new(0.473, 0.2, \"pint\")\n \texpect(pint.capacity).to eq(1)\n \te...
ruby
chosen
[ { "from": "system", "value": "Use shorter index names for db's with identifier limits.\n" }, { "from": "human", "value": "class CreatePreferences < ActiveRecord::Migration\n def self.up\n create_table :preferences do |t|\n t.column :definition_id, :integer, :null => false, :unsigne...
ruby
chosen
[ { "from": "system", "value": "Change be_truthy to eq(true) for utils class\n" }, { "from": "human", "value": "require_relative 'helper'\n\ndescribe 'String' do\n it 'should normalize attributes' do\n vars = %w(key_name keyName KeyName KeyNAME)\n target = 'key_name'\n vars.each { |s| ex...
ruby
chosen
[ { "from": "system", "value": "Change spec of symbolize to match the MediaWiki link normalisation a little\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Wptemplates::Utils do\n \n describe '.symbolize' do\n it \"symbolizes strings\" do\n expect(subject.symbolize(\...
ruby
chosen
[ { "from": "human", "value": "Add 4.2.3 Local Variables and Basic Arithmetical Expressions Assignment\n" }, { "from": "gpt", "value": "# Solution Below\nnum1 = 8\nnum2 = 3\n\nsum = num1 + num2\ndifference = num1 - num2\nquotient = num1.to_f / num2.to_f\nproduct = num1 * num2\nmodulus = num1 % num...
ruby
chosen
[ { "from": "system", "value": "Add support for multiple node names in a block to unquoted_node_name\n" }, { "from": "human", "value": "# Public: Check the manifest for unquoted node names and record a warning for\n# each instance found.\nPuppetLint.new_check(:unquoted_node_name) do\n def check\n...
ruby
chosen
[ { "from": "system", "value": "Return the right ActiveModel::Name on operation\n\nReturn the ActiveModel::Name for Op Model Class instead of Op Class\n" }, { "from": "human", "value": "module Trailblazer::Operation::Responder\n # TODO: test me.\n def self.included(base)\n base.extend ClassMe...
ruby
chosen
[ { "from": "system", "value": "Change redis close connection method\n\n`disconnect` was not working properly and was making my wellness believe the service was unhealthy when in reality it was. Using the `quit` method yields the expected behavior." }, { "from": "human", "value": "require 'wellnes...
ruby
chosen
[ { "from": "system", "value": "Revert \"Revert \"Make our session cookie good across all subdomains\"\"\n\nThis reverts commit 897199c643bac4bb5439ca856b891dda313d5ac6.\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nPaperSearchApi::Application.co...
ruby
chosen
[ { "from": "system", "value": "Remove cookie domain for now\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nRooms::Application.config.session_store :cookie_store, key: '_room_reservation_session', :domain => ENV['ROOMS_COOKIE_DOMAIN']\n\n# Use the...
ruby
chosen
[ { "from": "system", "value": "Add support for validating IPv6 address\n" }, { "from": "human", "value": "module ParsleySimpleForm\n module Validators\n module IPAddress\n def initialize(options)\n @parsley_name = 'ipaddress'\n super\n end\n\n def validate_each(re...
ruby
chosen
[ { "from": "system", "value": "Allow empty arrays in where predicates\n" }, { "from": "human", "value": "module ActiveRecord\n class PredicateBuilder\n class ArrayHandler # :nodoc:\n def call(attribute, value)\n values = value.map { |x| x.is_a?(Base) ? x.id : x }\n ranges, ...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement to ~> 0.49.1\n\nUpdates requirements on [rubocop](https://github.com/bbatsov/rubocop) to permit the latest version.\n- [Release notes](https://github.com/bbatsov/rubocop/releases)\n- [Changelog](https://github.com/bbatsov/rubocop/blob/master/CHANGELOG...
ruby
chosen
[ { "from": "system", "value": "Set library local domain up for session cookie\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.session_store :cookie_store, key: '_umbra_session', domain: :all\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Update to bugfix release 1.1.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"SMCalloutView\"\n s.version = \"1.1\"\n s.summary = \"A lightweight callout view class for iOS mimicking UICalloutView.\"\n s.description = <<-...
ruby
chosen
[ { "from": "system", "value": "Fix bug where auto-inject strategies were not respected" }, { "from": "human", "value": "require \"dry-auto_inject\"\n\nmodule Dry\n module Component\n class Injector\n # @api private\n attr_reader :container\n\n # @api private\n attr_reader ...
ruby
chosen
[ { "from": "system", "value": "Use erb to read in config\n" }, { "from": "human", "value": "module ElasticRecord\n class Railtie < Rails::Railtie\n initializer 'elastic_record.require_log_subscriber' do\n require 'elastic_record/log_subscriber'\n end\n\n initializer \"elastic_recor...
ruby
chosen
[ { "from": "system", "value": "Handle exception when user want to login to admin panel using Facebook user\n" }, { "from": "human", "value": "class Social::Users::SessionsController < Devise::SessionsController \n \n layout \"layouts/admin/admin\"\n\n helper_method :backend?\n\n def backend?\...
ruby
chosen
[ { "from": "system", "value": "Fix indentation to match rest of file.\n" }, { "from": "human", "value": "Kernel.load File.dirname(__FILE__) + '/lib/net/vnc/version.rb'\n\nPKG_NAME = 'ruby-vnc'\nPKG_VERSION = Net::VNC::VERSION\n\nGem::Specification.new do |s|\n\ts.name = PKG_NAME\n\ts.version = PK...
ruby
chosen
[ { "from": "system", "value": "Add glib dep to prevent compile errors\n\nCloses Homebrew/homebrew#4402.\n\nSigned-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com>\n" }, { "from": "human", "value": "require 'formula'\n\nclass KdePhonon <Formula\n url 'ftp://ftp.kde....
ruby
chosen
[ { "from": "system", "value": "Use single quotes for uninterpolated strings\n" }, { "from": "human", "value": "require \"tmpdir\"\n\nmodule Bosh::Director\n class TarGzipper\n include Bosh::RunsCommands\n\n SourceNotFound = Class.new(RuntimeError)\n SourceNotAbsolute = Class.new(Runtime...
ruby
chosen
[ { "from": "system", "value": "Store the nickname on start" }, { "from": "human", "value": "class Api::AttemptsController < Api::BaseController\n def index\n attempts = current_player.attempts\n render json: AttemptRepresenter.for_collection.new(attempts)\n end\n\n def show\n attempt ...
ruby
chosen
[ { "from": "system", "value": "Add RESTful route for new social networks\n" }, { "from": "human", "value": "require 'twitter'\n\n#Twitter Services\n\nget '/twitter-authenticate' do\n\tget_twitter_info\nend\n\nget '/twitter-authentication-return' do\n\tget_twitter_access_token\n\tstore_twitter_acc...
ruby
chosen
[ { "from": "system", "value": "Fix aircraft_type typo in indexable_formatter\n" }, { "from": "human", "value": "require \"abstract_indexable_formatter\"\n\nclass AaibReportIndexableFormatter < AbstractIndexableFormatter\n def type\n \"aaib_report\"\n end\n\nprivate\n def extra_attributes\n ...
ruby
chosen
[ { "from": "system", "value": "Return 404 if articles not found\n" }, { "from": "human", "value": "class ArticlesController < ApplicationController\n layout 'application'\n\n def index\n @articles = Article.published.order(published_on: :desc).page(params[:page])\n end\n\n def list\n y,...
ruby
chosen
[ { "from": "system", "value": "Make sure search only returns results from your own account." }, { "from": "human", "value": "class CommentsController < ApplicationController\n\n permit \"admin or manager of account\", :only => :destroy\n\n layout \"hotink\"\n \n def index\n page = params[:...
ruby
chosen
[ { "from": "system", "value": "Fix plurality mistake in EpisodesController\n" }, { "from": "human", "value": "class EpisodesController < ApplicationController\n def index\n respond_to do |format|\n format.html do\n @anime = Anime.find(params[:anime_id])\n preload_to_ember! ...
ruby
chosen
[ { "from": "system", "value": "Order the expenses by date desc\n" }, { "from": "human", "value": "class ExpensesController < ApplicationController\n def new\n @expense = Expense.new\n end\n\n def create\n @expense = Expense.new(expense_params)\n use_new_category\n if @expense.save\...
ruby
chosen
[ { "from": "system", "value": "Delete show action in therapists_controller\n" }, { "from": "human", "value": "class PatientsController < ApplicationController\n\n def index\n therapist = Therapist.find(session[:therapist_id])\n @patients = Patient.all\n end\n\n def create\n therapist ...
ruby
chosen
[ { "from": "system", "value": "Allow Language show to accept json and html requests.\n" }, { "from": "human", "value": "class LanguagesController < ApplicationController\n before_action :set_language, only: [:show, :destroy]\n\n def index\n @languages = Language.all\n end\n\n def new\n ...
ruby
chosen
[ { "from": "system", "value": "Raise controller exceptions in test environment\n" }, { "from": "human", "value": "class PositionsController < ApplicationController\n respond_to :json\n\n rescue_from Exception, with: :render_500\n rescue_from ActionController::RoutingError, with: :render_404\n ...
ruby
chosen
[ { "from": "system", "value": "Add byebug as development dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'drawing_tool/version'\n\nGem::Specification.new do |spec|\n spec.n...
ruby
chosen
[ { "from": "system", "value": "Resolve merge conflict by keeping driver tests in controller.\n" }, { "from": "human", "value": "class ResponsesController < ApplicationController\n\n before_action :set_response, only: [:edit, :update, :destroy]\n\n def new\n @response = Response.new\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Fix redirect after destroying snapshot\n\nThis was incorrectly redirecting to the Url page (which no longer\nexists).\n" }, { "from": "human", "value": "class SnapshotsController < ApplicationController\n before_filter :set_snapshot, only: %i[show destroy accept re...
ruby
chosen
[ { "from": "system", "value": "Work around sending parameters as json\n" }, { "from": "human", "value": "require 'jsonclient'\n\nclass Door::StatusManager::Pesho\n def initialize\n @base_uri = Rails.application.config.door_status_manager.url\n @client = JSONClient.new\n @client.connect_...
ruby
chosen
[ { "from": "system", "value": "Add frozen string literal comment\n" }, { "from": "human", "value": "class ChangesController < ApplicationController\n def undo\n version = PaperTrail::Version.find(params.require :id)\n unless version.whodunnit == @current_user.id.to_s\n head :unauthori...
ruby
chosen
[ { "from": "system", "value": "Remove code mistakenly checked in the repo\n" }, { "from": "human", "value": "require 'csv'\n\nclass ServersController < ResourcesController\n respond_to :html, :js, :xml, :csv, :json\n\n has_scope :by_location\n has_scope :by_maintainer\n has_scope :by_system\n...
ruby
chosen
[ { "from": "human", "value": "Disable legacy 'nil' user account.\n\nThis account has no uid, name or email address and appears to be used\nfor unassigning content. It's no longer needed but it will have\n associations in other models so disable it.\n" }, { "from": "gpt", "value": "class UpdateNi...
ruby
chosen
[ { "from": "system", "value": "Add recent and popular snippets to welcome controller\n" }, { "from": "human", "value": "class WelcomeController < ApplicationController\n def index\n end\nend\n" }, { "from": "gpt", "value": "class WelcomeController < ApplicationController\n def inde...
ruby
chosen
[ { "from": "system", "value": "Create temporal dumps folder if it does not exist\n" }, { "from": "human", "value": "require 'envelope_dump'\nrequire 'internet_archive'\n\n# Generates a dump file containing the envelope transactions in JSON format\nclass GenerateEnvelopeDump\n attr_reader :date, ...
ruby
chosen
[ { "from": "system", "value": "Load (escaped) vcap_services.json into ENV in development\n" }, { "from": "human", "value": "require \"sinatra/base\"\nrequire \"multi_json\"\nrequire \"bunny\"\n\nTilt.register Tilt::ERBTemplate, 'html.erb'\n\nclass LabRat < Sinatra::Base\n require 'sinatra/reload...
ruby
chosen
[ { "from": "system", "value": "Make the machines openly accessible\n" }, { "from": "human", "value": "class MachinesController < ThingsController\n\n before_filter :require_login, except: [:index]\n\n defaults :resource_class => Machine\n\n def show\n @machine = Machine.includes(:brand,:lin...
ruby
chosen
[ { "from": "system", "value": "Add supports :check_compliance to mixin\n" }, { "from": "human", "value": "module ComplianceMixin\n extend ActiveSupport::Concern\n\n included do\n has_many :compliances, :as => :resource, :dependent => :destroy\n has_one :last_compliance,\n -> ...
ruby
chosen
[ { "from": "system", "value": "Fix syntax error on authentication call\n" }, { "from": "human", "value": "class ServicesController < ApplicationController\n before_action :authenticate_user!, only [:new, :create, :edit, :update]\n before_action :set_service, only: [:show, :edit, :update]\n\n d...
ruby
chosen
[ { "from": "system", "value": "Delete binding.pry from sessions controller\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n def create\n user = User.find_by_provider_and_uid(auth[\"provider\"], auth[\"uid\"])\n if user\n binding.pry\n session[...
ruby
chosen
[ { "from": "system", "value": "Set return_to only in authenticate_user! method to prevent override.\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n def new\n session[\"return_to\"] = request.env['HTTP_REFERER']\n origin = { origin: session[\"return_to\...
ruby
chosen
[ { "from": "system", "value": "Change create action in sessions controller to set user by email\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def new\n\n end\n\n def create\n @user = User.find_by(username: session_params[:username])\n\n if @user ...
ruby
chosen
[ { "from": "system", "value": "Add branches method in base repository adapter\n" }, { "from": "human", "value": "module KnapsackPro\n module RepositoryAdapters\n class BaseAdapter\n def commit_hash\n raise NotImplementedError\n end\n\n def branch\n raise NotImplem...
ruby
chosen
[ { "from": "system", "value": "Make copy changes based on Vanessa feedback - and revisit tests\n" }, { "from": "human", "value": "Given(/^I have viewed the details of a specific occupation$/) do\n visit scrapbook_occupation_path(scrapbook_id: scrapbook_id,\n soc_...
ruby
chosen
[ { "from": "system", "value": "Use Faraday 1.0 exception classes\n" }, { "from": "human", "value": "require 'faraday'\n\nmodule RESTinPeace\n module Faraday\n class RaiseErrorsMiddleware < ::Faraday::Response::Middleware\n CLIENT_ERROR_STATUSES = 400...600\n\n def on_complete(env)\n...
ruby
chosen
[ { "from": "human", "value": "Add spec for auth_backend method\n" }, { "from": "gpt", "value": "require \"rails_helper\"\n\ndescribe ApplicationController do\n describe \"#auth_backend\" do\n context \"when github auth is enabled\" do\n before do\n stub_env(\"GITHUB_ORGANIZATION\"...
ruby
chosen
[ { "from": "system", "value": "Add spec for many more than one interpolation in XssLoggerCheck\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nmodule Scanny::Checks\n describe XssLoggerCheck do\n before :each do\n @runner = Scanny::Runner.new(XssLoggerCheck.new)\n @war...
ruby
chosen
[ { "from": "system", "value": "Move Bitter to upstream source\n" }, { "from": "human", "value": "class FontBitter < Cask\n url 'https://github.com/w0ng/googlefontdirectory/trunk/fonts/bitter',\n :using => :svn,\n :revision => '50',\n :trust_cert => true\n homepage 'http://...
ruby
chosen
[ { "from": "system", "value": "Update to light table 0.5.6" }, { "from": "human", "value": "class LightTable < Cask\n url 'https://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.5.4/LightTableMac.zip'\n homepage 'http://www.lighttable.com/'\n version '0.5.4'\n sha1 'dd704ed5681f9b6bdfe38f8e3...
ruby
chosen
[ { "from": "system", "value": "Update link to swift parser\n" }, { "from": "human", "value": "module Bibliothecary\n module Parsers\n class SwiftPM\n include Bibliothecary::Analyser\n\n def self.parse(filename, path)\n if filename.match(/^Package\\.swift$/i)\n file_c...
ruby
chosen
[ { "from": "system", "value": "Fix filter method to only return record\n" }, { "from": "human", "value": "class Fluent::Plugin::TimerangeFilter < Fluent::Plugin::Filter\n Fluent::Plugin.register_filter('timerange', self)\n\n config_param :starttime, :string\n config_param :endtime, :string\n\n...
ruby
chosen
[ { "from": "system", "value": "Use same source list file name as package\n" }, { "from": "human", "value": "# Cookbook Name:: google-chrome\n# Recipe:: default\n# Copyright 2011-2015, Travis CI Development Team <contact@travis-ci.org>\n#\n# Permission is hereby granted, free of charge, to any per...
ruby
chosen
[ { "from": "system", "value": "Use staging env when deploying to Vagrant.\n" }, { "from": "human", "value": "set :port, 2222\nset :git_shallow_clone, 1\n\nrole :web, 'localhost'\nrole :app, 'localhost'\nrole :db, 'localhost', :primary => true\n" }, { "from": "gpt", "value": "set :...
ruby
chosen
[ { "from": "system", "value": "Add option to generate json result from CLI\n" }, { "from": "human", "value": "require 'thor'\nrequire 'nasdaq_scraper'\n\nmodule NasdaqScraper\n\tmodule Cli\n\t\tclass Application < Thor\n\t\t\t\n\t\t\tdesc 'scrape [URL]', 'Scrape the [URL] for NASDAQ index'\n\t\t\...
ruby
chosen
[ { "from": "system", "value": "Fix `purchase_labels` option not being configurable\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule SolidusEasypost\n class Configuration\n attr_reader :purchase_labels\n\n def initialize\n @purchase_labels = true\n end\n e...
ruby
chosen
[ { "from": "system", "value": "Move failure out of the diva method\n\nparameter_failure! only has failure inside it. Move the failure out of\nthis method and into the calling line.\n" }, { "from": "human", "value": "module SuperSettings\n # RuleKeyParser parses rule keys. It takes in either a sy...
ruby
chosen
[ { "from": "system", "value": "Clean up the .gemspec a bit.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/rake/arduino/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Jacob Buys\"]\n gem.email = [\"wjbuys@g...
ruby
chosen
[ { "from": "human", "value": "Add podspec file for project\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n s.name = \"InputToolbar\"\n s.version = \"0.0.1\"\n s.summary = \"Messages style input toolbar for iOS.\"\n s.homepage = \"https://github.com/brandonhamilto...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement from ~> 0.80.0 to ~> 0.81.0\n\nUpdates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version.\n- [Release notes](https://github.com/rubocop-hq/rubocop/releases)\n- [Changelog](https://github.com/rubocop-hq/r...
ruby
chosen
[ { "from": "system", "value": "Add Debian wheezy support for default version fact\n\nDebian Wheezy has a default version of 9.1, but doesn't currently have\nan operatingsystemrelease value beyond 'wheezy'. This command searches\nfor wheezy in the operatingsystemrelease fact and sets the fact value\naccording...
ruby
chosen
[ { "from": "system", "value": "Rename \"has\" to \"has?\" method\n" }, { "from": "human", "value": "require 'sastrawi/stemmer/filter/text_normalizer'\n\nmodule Sastrawi\n module Stemmer\n class CachedStemmer\n attr_accessor :cache, :delegated_stemmer\n\n def initialize(cache, delega...
ruby
chosen
[ { "from": "system", "value": "Use the new Ruby 1.9 hash syntax\n\nChange-Id: Id850e9ccc280b7304f0b769b8ad731d73e394431\nReviewed-on: http://gerrit.causes.com/37449\nTested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com>\nReviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d...
ruby
chosen
[ { "from": "human", "value": "Add basic script to add something to iTunes and set its attributes\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\n################################################################################\nrequire('rubygems')\nrequire('appscript')\nrequire('ostruct')\...
ruby
chosen
[ { "from": "system", "value": "Update specs for Sun endpoint\n" }, { "from": "human", "value": "require_relative './spec_helper'\n\ndescribe 'Sun' do\n describe 'GET /v2/sun' do\n before { get '/v2/sun' }\n let(:body) { last_response.body }\n let(:json) { parse_json body }\n\n it 'in...
ruby
chosen
[ { "from": "system", "value": "Remove log_status method as it doesn't log\n" }, { "from": "human", "value": "require \"alephant/broker/errors/invalid_cache_key\"\nrequire \"alephant/logger\"\nrequire \"aws-sdk\"\nrequire \"ostruct\"\nrequire \"date\"\n\nmodule Alephant\n module Broker\n modul...
ruby
chosen