conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update Home Spec for Learn More Buttons\n\nUpdate the Home page spec to ensure it corresponds to the new Learn More\nbuttons.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"home/learn_more.html.erb\" do\n include Warden::Test::Helpers\n War...
ruby
chosen
[ { "from": "system", "value": "Update AdminUsersPage::UserFragment for table changes\n" }, { "from": "human", "value": "class AdminUsersPage < Page\n path :admin_users\n\n class UserFragment\n def initialize element\n @element = element\n end\n\n def id\n @element.all('td')[0...
ruby
chosen
[ { "from": "human", "value": "Add Capybara Spec for Home Index View\n\nAdd a view spec test for the home view to ensure that user logged\nin/logged out functions as expected.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe \"home/index.html.erb\" do\n include Warden::Test::Hel...
ruby
chosen
[ { "from": "system", "value": "Remove old SVN-based Cap tasks\n" }, { "from": "human", "value": "require 'mongrel_cluster/recipes'\nload \"config/db\"\nload \"local/config/deploy.rb\" if File.exists?(\"local/config/deploy.rb\")\n\nset :repository, \"git://github.com/scottwillson/racing_on_rails.g...
ruby
chosen
[ { "from": "system", "value": "Remove destroy action from all resources\n" }, { "from": "human", "value": "ActionController::Routing::Routes.draw do |map|\n map.resources :db_instances\n\n map.resources :apps do |apps|\n apps.resources :activities do |activities|\n activities.resources ...
ruby
chosen
[ { "from": "system", "value": "Use ~> for Fech version dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/fech-search/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Aaron Bycoffe\"]\n gem.email = [\"...
ruby
chosen
[ { "from": "system", "value": "Use `model_name.name` for event class namespacing\n\nPin the namespacing for events to the model name, not the Ruby class name. In\nmost cases (excepting adopters who have specificially overridden ActiveModel\nnaming behavior) this should have no impact, but loosens the depende...
ruby
chosen
[ { "from": "system", "value": "Add published flag to assessment serializer.\n" }, { "from": "human", "value": "class AssessmentSerializer < ActiveModel::Serializer\n embed :ids, include: true\n attributes :id, :score, :notes, :created_at\n has_one :submission\n has_one :assessor\nend" }, ...
ruby
chosen
[ { "from": "system", "value": "Use square brackets with `%w` to appease rubocop.\n" }, { "from": "human", "value": "# Generated by jeweler\n# DO NOT EDIT THIS FILE DIRECTLY\n# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'\n# -*- encoding: utf-8 -*-\n\nGem::Specification.new do ...
ruby
chosen
[ { "from": "system", "value": "Use description in RSS as description\n\nBody has too much html that could be invalid (ie Images JS etc)\n" }, { "from": "human", "value": "xml.instruct! :xml, :version=>\"1.0\"\nxml.rss(:version=>\"2.0\") do\n xml.channel do\n xml.title(@node.title)\n xml.de...
ruby
chosen
[ { "from": "system", "value": "Change path to own executables\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'panda_doc/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Set I18n.enforce_available_locales = false when running specs.\n" }, { "from": "human", "value": "require 'simplecov'\nrequire 'coveralls'\n\nSimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n SimpleCov::Formatter::HTMLFormatter,\n Coveralls::SimpleCov:...
ruby
chosen
[ { "from": "system", "value": "Add proper filter for coveralls, use spec not lib\n" }, { "from": "human", "value": "require 'simplecov'\nrequire 'coveralls'\n\nSimpleCov.formatter = Coveralls::SimpleCov::Formatter\nSimpleCov.start do\n add_filter 'lib'\nend\n\nrequire 'pry'\nrequire 'webmock/rsp...
ruby
chosen
[ { "from": "system", "value": "Add extension group at simplecov.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nunless ENV['CI']\n require 'simplecov'\n SimpleCov.start do\n add_filter 'spec'\n add_group 'Agharta' do |source|\n source.filename =~ /lib\\/agharta(|\\/[^\...
ruby
chosen
[ { "from": "system", "value": "[dm-more] Remove rubygems usage from libraries\n\n* No longer require dm-core inside the plugins. Expected usage is to\n require dm-core prior to requiring the plugin.\n* Updated pathname creation to using Pathname#/ where possible\n" }, { "from": "human", "value"...
ruby
chosen
[ { "from": "system", "value": "Update spec helper to get angry if you aren't using rspec 3 syntax\n" }, { "from": "human", "value": "# This file was generated by the `rspec --init` command. Conventionally, all\n# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.\n# Requir...
ruby
chosen
[ { "from": "system", "value": "Use doc output in our specs\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "require 'chefspec'\nrequire 'chefspec/berkshelf'\n\nRSpec.configure do |config|\n config.color = true\n config.log_level =...
ruby
chosen
[ { "from": "human", "value": "Move VCR to spec support\n" }, { "from": "gpt", "value": "# VCR config\nrequire 'vcr'\n\nVCR.configure do |c|\n c.configure_rspec_metadata!\n c.hook_into :faraday\n c.default_cassette_options = {\n record: ENV['TRAVIS'] ? :none : :once\n }\n c.cassette_libr...
ruby
chosen
[ { "from": "system", "value": "Update gem dependencies in gemspec\n" }, { "from": "human", "value": "#encoding: utf-8\n\nGem::Specification.new do |gem|\n gem.name = 'devtools'\n gem.version = '0.0.1'\n gem.authors = [ 'Markus Schirp' ]\n gem.email = [ 'mbj@seonic.net' ]\...
ruby
chosen
[ { "from": "system", "value": "Replace `owner` with `user` in bash resource\n" }, { "from": "human", "value": "include_recipe 'phpenv'\ninclude_recipe 'phpbuild'\n\nnode['php']['multi']['extensions'].each do |php_extension, options|\n php_pecl php_extension do\n channel options['chann...
ruby
chosen
[ { "from": "system", "value": "Add support for Jekyll 3.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'jekyll-redirect-from/version'\n\nGem::Specification.new do |spec|\n spec.name...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in Picturelife Smartloader 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 => 'picturelife' do\n version...
ruby
chosen
[ { "from": "human", "value": "Add VLC.app 3.0.0-git (nightly build)\n" }, { "from": "gpt", "value": "class VlcNightly < Cask\n version 'latest'\n sha256 :no_check\n\n url 'http://nightlies.videolan.org/build/macosx-intel/last'\n homepage 'http://www.videolan.org/vlc/'\n\n link 'vlc-3.0.0-git...
ruby
chosen
[ { "from": "human", "value": "Add podspec for development version\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n s.name = \"iOS-FakeWeb\"\n s.version = \"0.1.1\"\n s.summary = \"Simple HTTP request mocking/interception for testing module.\"\n s.homepage = \"http...
ruby
chosen
[ { "from": "system", "value": "Remove course params from resource controller.\n" }, { "from": "human", "value": "class ResourcesController < ApplicationController\n before_action :set_resource, only: [:show, :edit, :update, :destroy]\n\n def index\n end\n\n def new\n params[:course_id] ? @...
ruby
chosen
[ { "from": "system", "value": "Convert to ampersand only if it is before whitespace.\n" }, { "from": "human", "value": "class DescriptionFormatter\n def self.format(opts = {})\n raise ArgumentError.new(\"DescriptionFormatter expects :using arg to be a single value\") if opts.keys.many?\n\n ...
ruby
chosen
[ { "from": "system", "value": "Allow google drive to be enabled along with either s3 or filesystem\n" }, { "from": "human", "value": "Rails.application.config.to_prepare do\n settings = if Settings.dropbox.google_drive\n { 'google_drive' => { client_id: Settings.dropbox.google_drive.client_id...
ruby
chosen
[ { "from": "system", "value": "Resolve a Cognitive Complexity of 12\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Releases\n class CreateService < BaseService\n include Releases::Concerns\n\n def execute\n return error('Access Denied', 403) unless allowed?...
ruby
chosen
[ { "from": "system", "value": "Set VERSION_BAND back to 2.0.0 otherwise install fails because e.g. refinerycms-i18n has no version 2.0.2 available.\n" }, { "from": "human", "value": "require 'rbconfig'\nVERSION_BAND = '2.0.2'\n\n# We want to ensure that you have an ExecJS runtime available!\nbegi...
ruby
chosen
[ { "from": "system", "value": "Use `cf-bosh-local` instead of `cf-stackato-local` for Cloud Foundry tests (--> faster!)\n" }, { "from": "human", "value": "require 'spec/adapter/adapter_spec_helper'\n\ndescribe Paasal::Adapters::V1::CloudFoundryAdapter do\n before do\n @endpoint = 'cf-stackato...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary subject on spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Neighborly::Balanced::Bankaccount::Interface do\n subject { Neighborly::Balanced::Bankaccount::Interface.new }\n let(:contribution) { double('Contribution', id:...
ruby
chosen
[ { "from": "system", "value": "Set custom TTL in Cache\n\nCloses #24\n" }, { "from": "human", "value": "require 'dalli-elasticache'\nrequire 'alephant/logger'\n\nmodule Alephant\n module Broker\n module Cache\n\n class Client\n include Logger\n\n DEFAULT_TTL = 2592000\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add the test for Variant\n" }, { "from": "gpt", "value": "describe Comable::Variant do\n it { is_expected.to belong_to(:product).class_name(Comable::Product.name).inverse_of(:variants) }\n it { is_expected.to have_one(:stock).class_name(Comable::Stock.name).inverse...
ruby
chosen
[ { "from": "system", "value": "Add `:id` and `:description_details` to `to_a` method for `Bankscrap::Transaction`\n" }, { "from": "human", "value": "module Bankscrap\n class Transaction\n include Utils::Inspectable\n\n attr_accessor :id, :amount, :description, :description_detail, :effecti...
ruby
chosen
[ { "from": "system", "value": "Allow inline CSS, for now.\n\nThe form_for helper in the picture upload form generates a\n<div style=\"display:none\"> tag around the utf8 and authenticity_token input\nfields.\n" }, { "from": "human", "value": "::SecureHeaders::Configuration.configure do |config|\n...
ruby
chosen
[ { "from": "system", "value": "Add strong params for areas\n" }, { "from": "human", "value": "class AreasController < ApplicationController\n filter_access_to :all\n\n has_control_panel_applet :edit_opening_hours_applet,\n if: -> { permitted_to? :manage, :areas }\n\n ...
ruby
chosen
[ { "from": "system", "value": "Change testset migration to alter table not create it\n\nThe testset migration should not create the lone testset table, but it\nshould alter the one created by resultsdb.sql, at least until all of\nresultsdb.sql is included in the migrations.\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Remove string field for maps table\n" }, { "from": "human", "value": "class CreateMaps < ActiveRecord::Migration\n def change\n create_table :maps do |t|\n t.string :name\n t.string :string\n\n t.timestamps null: false\n end\n end\nend\n" },...
ruby
chosen
[ { "from": "system", "value": "Add source_repo to dependency builder object\n\n[#164880949]\n\nCo-authored-by: Daniel Thornton <5874b3971aa460e96f75d4dbef8f6aadb66f1697@pivotal.io>\n" }, { "from": "human", "value": "class SourceInput\n attr_reader :url, :md5, :git_commit_sha\n attr_accessor :na...
ruby
chosen
[ { "from": "system", "value": "Document public actions of ThemeController\n\nIncludes an explanation why the actions for the individual themes (e.g., `theme/Agaricus`) are not defined in the controller.\n" }, { "from": "human", "value": "# Theme controller\nclass ThemeController < ApplicationCont...
ruby
chosen
[ { "from": "system", "value": "Fix bug in checking exitstatus\n\nWhen fdesetup returns with exit code 2, $? is actually 512 (512 >> 8 == 2). Need to check for $?.exitstatus" }, { "from": "human", "value": "require \"boxen/config\"\n\nFacter.add(\"root_encrypted\") do\n config = Boxen::Config.loa...
ruby
chosen
[ { "from": "system", "value": "Refactor user create/update params to different methods\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n respond_to :json\n before_filter :find_user, only: [:show, :update]\n before_filter :authenticate_admin!, only: :create\n b...
ruby
chosen
[ { "from": "system", "value": "FIX: Check that `Rails.env` is defined as well.\n" }, { "from": "human", "value": "module Logster\n class Configuration\n attr_accessor :current_context, :allow_grouping, :environments,\n :application_version, :web_title\n\n attr_writer :subdirectory\n\n...
ruby
chosen
[ { "from": "human", "value": "Add a tool to analyze memory usage from memory debug log\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nclass Memory < Struct.new(:size, :file, :line, :function)\n def location\n \"#{file}:#{line}\"\n end\nend\n\nclass LocationGroup\n attr_reader :loca...
ruby
chosen
[ { "from": "system", "value": "Add an actual FFI interface for the library\n" }, { "from": "human", "value": "module Cdistance\n extend FFI::Library\n ffi_lib FFI::Library::LIBC\n attach_function :puts, [ :string ], :int\nend\n" }, { "from": "gpt", "value": "require 'bundler/setup'...
ruby
chosen
[ { "from": "system", "value": "Raise exception if runtime or devicetype lookup failed\n" }, { "from": "human", "value": "require 'shellwords'\n\nmodule SimCtl\n class Command\n module Create\n COMMAND = %w[xcrun simctl create]\n\n # Creates a device\n #\n # @param name [St...
ruby
chosen
[ { "from": "system", "value": "Add i18n load path to the beginning to allow values to be overridden\n" }, { "from": "human", "value": "require \"simple_authentication/authenticator\"\nrequire \"simple_authentication/controller_methods\"\nrequire \"simple_authentication/model_methods\"\n\nApplicat...
ruby
chosen
[ { "from": "system", "value": "Fix column width on short_list\n" }, { "from": "human", "value": "module Taskmeister\n class TaskList\n def initialize(tasks)\n @hash = {}\n\n tasks.each do |t|\n add(t)\n end\n end\n\n def to_short_list\n longest_id = @hash.keys...
ruby
chosen
[ { "from": "system", "value": "Clean PRs with empty link\n\n[fixes #388]\n" }, { "from": "human", "value": "def load_user\n u = User.order('created_at desc').limit(50).sample(1).first\n if u.github_client.rate_limit.remaining < 4000\n load_user\n else\n u\n end\nend\n\ndesc \"Download n...
ruby
chosen
[ { "from": "system", "value": "Revert \"Remove AC singleton_class polyfil.\"\n\nThis reverts commit c05840f7f00d676f00e0971f828faa09f2d76e8b.\n" }, { "from": "human", "value": "require 'active_support/core_ext/hash/keys'\n\nrequire 'multi_dir/version'\nrequire 'multi_dir/paths'\nrequire 'multi_di...
ruby
chosen
[ { "from": "system", "value": "Reset color after outputting color message\n" }, { "from": "human", "value": "module Rubbr\n\n # Handles command line output and input.\n module Cli\n def notice(message)\n puts color?(message, \"\\e[32m\") if Rubbr.options[:verbose]\n end\n\n def wa...
ruby
chosen
[ { "from": "system", "value": "Use ActiveSupport lazy load hook to initialize ActiveRecord\n\nFix breaking `active_record.belongs_to_required_by_default` configuration.\n" }, { "from": "human", "value": "require \"active_record\"\nrequire \"shibaraku/active_record_ext\"\n\nmodule Shibaraku\nend\n...
ruby
chosen
[ { "from": "system", "value": "Add documentation for the Notification API\n" }, { "from": "human", "value": "module BacklogKit\n class Client\n module Notification\n def get_notifications(params = {})\n get('notifications', params)\n end\n\n def get_notification_count(pa...
ruby
chosen
[ { "from": "system", "value": "Fix regexp for cache without expiry\n" }, { "from": "human", "value": "module CacheComment\n class CommentFormatter\n\n def initialize key, options\n @key = key\n @options = (options || {}).symbolize_keys\n @time = Time.now\n end\n\n def...
ruby
chosen
[ { "from": "system", "value": "Add feedback after user enters yes, no or timesout\n" }, { "from": "human", "value": "require 'timeout'\n\nmodule KumoDockerCloud\n class ConsoleJockey\n\n def self.flash_message(message)\n puts \"\\n\"\n puts \"###################=====================...
ruby
chosen
[ { "from": "human", "value": "Add very simple Gitorious repo resolver\n" }, { "from": "gpt", "value": "# encoding: utf-8\n#--\n# Copyright (C) 2012 Gitorious AS\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public ...
ruby
chosen
[ { "from": "system", "value": "Use sublist for pricing matrix\n\nIf pricing matrix was nil in the XML response, a corrupted pricing matrix item\nwould be contained in `prices`\n" }, { "from": "human", "value": "module NetSuite\n module Records\n class PricingMatrix\n include Namespaces::...
ruby
chosen
[ { "from": "system", "value": "Style/AlignParameters: Align the parameters of a method call if they span more than one line.\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire \"i18n/tasks\"\n\nRSpec.describe \"I18n\" do\n let(:i18n) { I18n::Tasks::BaseTask.new }\n let(:m...
ruby
chosen
[ { "from": "system", "value": "Update project homepage in gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'skroutz_api/version'\n\nGem::Specification.new do |spec|\n spec.name...
ruby
chosen
[ { "from": "human", "value": "Add another benchmark that side by sides clients. UTF8 ruby odbc is so buggy it can not even run the test.\n" }, { "from": "gpt", "value": "$:.unshift File.expand_path('../../../lib',__FILE__)\nrequire 'rubygems'\nrequire 'bench_press'\nrequire 'tiny_tds'\nrequire 'o...
ruby
chosen
[ { "from": "system", "value": "Update fog & gem summary/description\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"pairhost/version\"\n\nGem::Specification.new do |s|\n s.name = \"pairhost\"\n s.version = Pairho...
ruby
chosen
[ { "from": "system", "value": "Configure Rspec to use color\n" }, { "from": "human", "value": "module Embryo\n class Rspec\n def initialize(filesystem)\n @filesystem = filesystem\n end\n\n def install\n @filesystem.require_gem \"rspec-rails\", \"~> 3.0\", group: :test\n @...
ruby
chosen
[ { "from": "system", "value": "[spec] Make default container class name configurable.\n" }, { "from": "human", "value": "$:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))\n\nrequire 'cucumber/salad'\nrequire 'rspec/given'\nrequire 'sinatra/base'\nrequire 'capybara/rspec'...
ruby
chosen
[ { "from": "system", "value": "Use absolute syntax on filters to avoid matching parent directories:\ne.g. /home/spec/rails_core_extensions/lib accidently matches spec when only intending to match spec within rails_core_extensions directory\n" }, { "from": "human", "value": "# This file was genera...
ruby
chosen
[ { "from": "system", "value": "Add title to test app.\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.dirname(__FILE__))\nrequire 'rspec'\nrequire 'rack/test'\nrequire 'capybara'\nrequire './lib/dolphy'\n\nENV['RACK_ENV'] = 'test'\n\napp = DolphyApp.app do\n DolphyApp.router do\n g...
ruby
chosen
[ { "from": "system", "value": "Use require instead of require_relative\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire File.join(File.dirname(__FILE__), '..', 'init.rb')\n\nrequire 'rubygems'\nrequire 'sinatra'\nrequire 'rack/test'\nrequire 'rspec'\nrequire 'factory_girl'\n\nrequire...
ruby
chosen
[ { "from": "system", "value": "Add database cleanup to suite\n" }, { "from": "human", "value": "ENV['RAILS_ENV'] = 'test'\n\nrequire 'database_cleaner'\nrequire 'combustion'\n\nrequire 'simplecov'\nSimpleCov.start do\n add_filter 'spec'\nend\n\nCombustion.path = 'spec/support/rails'\nCombustion....
ruby
chosen
[ { "from": "system", "value": "Add notes for the configure block\n" }, { "from": "human", "value": "require \"active_support/core_ext\"\nrequire 'plugins'\nrequire 'caller'\nrequire 'exceptions'\n\n#\n# This middleware is the basis of all tracking via rack middleware.\n#\n# It allows you to easil...
ruby
chosen
[ { "from": "human", "value": "Add code for baking up the saves\n" }, { "from": "gpt", "value": "require 'zlib'\nrequire 'archive/tar/minitar'\n\nmodule Saves\n class Backup\n attr_reader :game, :backup\n\n def initialize(game)\n @game = game\n end\n\n def execute\n # We can...
ruby
chosen
[ { "from": "system", "value": "Fix broken Twitter::Client by requiring client.rb\n" }, { "from": "human", "value": "require 'twitter-vine/version'\nrequire 'twitter'\nrequire 'nokogiri'\n\nmodule TwitterVine\n DEBUG = false\n\n def self.parse(vine_url)\n vine_url.gsub!(\"http://\", \"https:/...
ruby
chosen
[ { "from": "system", "value": "Use fail instead of raise\n" }, { "from": "human", "value": "# Sysctl\nmodule Sysctl\n class << self\n def config_file(node)\n return node['sysctl']['conf_file'] if node['sysctl']['conf_dir'] || node['sysctl']['allow_sysctl_conf']\n nil\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update gemspec dev_dependency for new versions of rspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'link_shrink/version'\n\nGem::Specification.new d...
ruby
chosen
[ { "from": "system", "value": "Change podspec version to 0.0.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'AvitoMediaPicker'\n s.module_name = 'AvitoMediaPicker'\n s.version = '0.0.8'\n s.summary = 'Avito Media...
ruby
chosen
[ { "from": "system", "value": "Fix for deprecation in Rails 3.2\n" }, { "from": "human", "value": "# this little innocent class here makes 0.0.9 test fail\nclass Translation < ActiveRecord::Base\nend\n\nclass Post < ActiveRecord::Base\n translates :title, :content, :published, :published_at, :ve...
ruby
chosen
[ { "from": "system", "value": "Add pry to test helper\n" }, { "from": "human", "value": "$:.unshift File.expand_path(\"../../lib\", __FILE__)\n\nENV['RACK_ENV'] = 'test'\nrequire 'simplecov' if ENV['COVERAGE']\n\ngem 'minitest'\nrequire 'minitest/autorun'\nrequire 'minitest/pride'\n\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Add support for Rubymine test/unit reporter\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\"\nrequire 'database_clea...
ruby
chosen
[ { "from": "system", "value": "Remove some unecessary test setup\n\nclearance/test_unit , should take care of the clearance session setup\ncapybara/rails , should take care of the capybara app setup\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] = \"test\"\n\nrequire File.expand_path('../....
ruby
chosen
[ { "from": "system", "value": "Add route for editing question\n" }, { "from": "human", "value": "get '/questions' do\n @questions = Question.all\n erb :'/questions/index'\nend\n\nget '/questions/new' do\n erb :'/questions/new'\n # <input type=\"hidden\" name=\"question[user_id]\" value=\"<%= ...
ruby
chosen
[ { "from": "system", "value": "Add some info to dashbard\n" }, { "from": "human", "value": "ActiveAdmin.register_page \"Dashboard\" do\n\n menu :priority => 0, :label => proc{ I18n.t(\"active_admin.dashboard\") }\n\n content :title => proc{ I18n.t(\"active_admin.dashboard\") } do\n columns d...
ruby
chosen
[ { "from": "system", "value": "Disable typo protection for now\n\nThis is a good idea, but it's blocking a lot of legitimate gems, and\nit's too hard for our limited support time to go to manually allowing\ngems through.\n\nA Slack feed of gems that look like they might be typos to allow humans\nto review wo...
ruby
chosen
[ { "from": "system", "value": "Enforce PEM format when generating private key\n" }, { "from": "human", "value": "# RSA key pair used for server-side signing\nclass KeyPair < ActiveRecord::Base\n SECRET_KEY = [ENV.fetch('ENCRYPTED_PRIVATE_KEY_SECRET')].pack('H*')\n\n enum statuses: { active: 1 }...
ruby
chosen
[ { "from": "system", "value": "Make the calendars controller a little easier to understand\n\nThis shows some points for future extractions\n" }, { "from": "human", "value": "#encoding: utf-8\nclass CalendarsController < ApplicationController\n\n def show\n @categories = Category.all\n\n #...
ruby
chosen
[ { "from": "human", "value": "Test added for calculating header node total\n" }, { "from": "gpt", "value": "require 'minitest/autorun'\nrequire 'node'\nrequire 'header'\n\nclass TestHeader < MiniTest::Test\n\n def setup\n # Initialize nodes\n @header = Header.new\n @node_1 = Node.new\n ...
ruby
chosen
[ { "from": "system", "value": "Return of the verbosity of Shut Up 'n Play Yer Migrations\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# Configure Rails Environment\nENV[\"RAILS_ENV\"] = \"test\"\n\nrequire File.expand_path(\"../../test/dummy/config/environment.rb\", __FILE_...
ruby
chosen
[ { "from": "system", "value": "Add quiz attr to accessible list.\n" }, { "from": "human", "value": "require 'friendly_id'\nrequire 'sanitize'\n\nmodule Coursewareable\n # Coursewareable [Classroom] assignment\n class Assignment < ActiveRecord::Base\n extend FriendlyId\n include PublicActi...
ruby
chosen
[ { "from": "system", "value": "Add method to NotificationSubscription that allows overriding the last_email_sent_at attribute\n" }, { "from": "human", "value": "class NotificationSubscription < ActiveRecord::Base\n\n attr_protected\n belongs_to :property\n # validations (email)\n validates_fo...
ruby
chosen
[ { "from": "system", "value": "Add custom find query for option set options\n" }, { "from": "human", "value": "module BigcommerceAPI\n class OptionSetOption < Resource\n attr_accessor :id,\n :display_name,\n :is_required,\n :option_id,\n ...
ruby
chosen
[ { "from": "system", "value": "Allow pre-release Rails versions in Gemfile.lock\n" }, { "from": "human", "value": "require 'brakeman/processors/base_processor'\n\n#Processes Gemfile and Gemfile.lock\nclass Brakeman::GemProcessor < Brakeman::BaseProcessor\n\n def initialize *args\n super\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix raise error which github url is redirect one\n\nEx. https://rubygems.org/gems/chef\n" }, { "from": "human", "value": "require \"json\"\nrequire \"httpclient\"\n\nclass CompareLinker\n class GithubLinkFinder\n attr_reader :octokit, :repo_owner, :repo_name, :h...
ruby
chosen
[ { "from": "system", "value": "Fix handling events on super classes\n\nUse a class hierarchy variable to track event message handlers so that a\nsuper class can handle certain events.\n\nSpecifically this is necessary to handle `SnapshotEvent` in `AggregateRoot`.\n" }, { "from": "human", "value":...
ruby
chosen
[ { "from": "system", "value": "Add uniqueness validation to Source\n" }, { "from": "human", "value": "class Source < ApplicationRecord\n class UnknownRankable < StandardError; end\n has_many :imports\n validates :name, presence: true\n\n validates :email_rank, presence: true, uniqueness: true...
ruby
chosen
[ { "from": "system", "value": "Add a to_s method to the Status model\n\nBefore this method was defined, just doing a <%= status %> showed\na #<Status::x123...> because that was the default Ruby inspection!\n" }, { "from": "human", "value": "class Status < ActiveRecord::Base\n belongs_to :user\ne...
ruby
chosen
[ { "from": "system", "value": "Support nil description of user.\n" }, { "from": "human", "value": "module ApplicationHelper\n def br(text)\n return text if text.nil?\n text = h text\n text.gsub(/\\r\\n|\\r|\\n/, '<br/>').html_safe\n end\n\n require \"uri\"\n\n def description_text(te...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.2 to 0.1.3\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'telemetry'\n s.version = '0.1.2'\n s.summary = 'In-process telemetry based on observers'\n s.description = ' ...
ruby
chosen
[ { "from": "system", "value": "Update Silverlight to version 5.1.30317" }, { "from": "human", "value": "class Silverlight < Cask\n url 'http://silverlight.dlservice.microsoft.com/download/B/A/9/BA94BEC9-5DBC-4B50-BC2B-046A42399067/30214.00/Silverlight.dmg'\n homepage 'http://www.microsoft.com/s...
ruby
chosen
[ { "from": "system", "value": "Use the actual `name` from the superclass, else we get caught in a loop\n" }, { "from": "human", "value": "require 'chef/provisioning/managed_entry'\n\nclass Chef\nmodule Provisioning\n #\n # Specification for a machine. Sufficient information to find and contact ...
ruby
chosen
[ { "from": "system", "value": "Add require set to namespace.\n" }, { "from": "human", "value": "module FeideeUtils\n class Record\n module Namespaced\n module ClassMethods\n attr_reader :child_classes\n\n # Must be invoked by Record.inherited\n def collect_subclass(c...
ruby
chosen
[ { "from": "system", "value": "Rename the config object to match the gem conventions.\n" }, { "from": "human", "value": "module Protobuf\n module ActiveRecord\n class Railtie < Rails::Railtie\n config.protobuf_activerecord = Protobuf::ActiveRecord.config\n\n ActiveSupport.on_load(:a...
ruby
chosen
[ { "from": "system", "value": "Use a non-blocking entropy source to prevent insanely slow startups in Tomcat.\n" }, { "from": "human", "value": "# Copyright 2015 Martijn van der Woud - The Crimson Cricket Internet Services\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#...
ruby
chosen
[ { "from": "system", "value": "Use new hash syntax and fix spaces\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe GraphUser do\n def self.others(opinion)\n others = [:believes, :doubts, :disbelieves]\n others.delete(opinion)\n others\n end\n\n subject {create :gra...
ruby
chosen