conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Remove deprecation warning for .find_all_by_content_type\n"
},
{
"from": "human",
"value": "class TreeBuilderReportWidgets < TreeBuilder\n private\n\n def tree_init_options(tree_name)\n {\n :leaf => 'Widgets',\n :full_ids => true\n }\n end\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix average calculation in ruby 2.6\n\nRuby 2.6 added `to_d` to BigDecimal and it was causing some tests\nto fail because of that.\n\nSee https://github.com/rails/rails/pull/34858\n"
},
{
"from": "human",
"value": "require 'active_record/relation'\nrequire 'active_r... | ruby | chosen |
[
{
"from": "system",
"value": "Fix json_response in update method\n"
},
{
"from": "human",
"value": "class Api::MaterialsController < Api::ApiController\n before_action :set_material, only: [:show, :update, :destroy]\n \n def index\n @materials = Material.all\n json_response(@materials)\... | ruby | chosen |
[
{
"from": "system",
"value": "Update controller to match removed templates\n"
},
{
"from": "human",
"value": "class ConfirmationsController < Devise::ConfirmationsController\n\n def show\n self.resource = resource_class.confirm_by_token(params[:confirmation_token])\n\n if resource.errors.... | ruby | chosen |
[
{
"from": "system",
"value": "Adjust Discourse login for user confirmations\n"
},
{
"from": "human",
"value": "require 'discourse/single_sign_on'\n\nclass DiscourseSsoController < ApplicationController\n include SharedHelper\n include DiscourseHelper\n\n before_filter :require_config\n\n def... | ruby | chosen |
[
{
"from": "system",
"value": "Update pod spec file for future use\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"RSBarcodes_Swift\"\n s.version = \"0.0.3\"\n s.summary = \"1D and 2D barcodes reader and generators for iOS 7 with delightful controls. Now ... | ruby | chosen |
[
{
"from": "human",
"value": "Extend Formtastic with custom input :pwdcalc (form.input .., :as => :pwdcalc)\n"
},
{
"from": "gpt",
"value": "module Formtastic\n module Inputs\n class PwdcalcInput\n\n include Base\n include Base::Stringish\n\n def to_html\n input_wrapping... | ruby | chosen |
[
{
"from": "system",
"value": "Switch to requiring the new API classes\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\n$LOAD_PATH.unshift(__dir__)\n\nrequire 'rubygems'\nrequire 'bundler/setup'\n\nrequire 'dimples'\nrequire 'json'\nrequire 'redcarpet'\n\nrequire 'usesthis/api'... | ruby | chosen |
[
{
"from": "system",
"value": "Reset scheduler attribute information after changing it.\n"
},
{
"from": "human",
"value": "require 'scheduler'\nrequire 'setting'\nclass SchedulerUpdate < ActiveRecord::Migration\n def up\n add_column :schedulers, :prio, :integer, :null => true\n Schedu... | ruby | chosen |
[
{
"from": "human",
"value": "Add embryon of fake mongo\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\nmodule Mushroom\n class Collection\n def initialize(documents)\n @documents = documents\n end\n\n def find\n @documents\n end\n end\n\n class Client\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add super method in inherited method\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::API\n include DeviseTokenAuth::Concerns::SetUserByToken\n include Pundit\n\n rescue_from ActiveRecord::RecordNotFound, with: :not_found\n resc... | ruby | chosen |
[
{
"from": "system",
"value": "Allow json to pass by rails security, protect from forgery method, if the request is in json\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to us... | ruby | chosen |
[
{
"from": "system",
"value": "Add more flexibility to null session permit\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_forgery w... | ruby | chosen |
[
{
"from": "system",
"value": "Fix Page raising error when auto-decorating `children` association\n"
},
{
"from": "human",
"value": "module Caffeine\n class PageDecorator < Draper::Decorator\n delegate_all\n decorates_association :children\n\n TEMPLATE_FILE_NAME = 'template'\n DEFAUL... | ruby | chosen |
[
{
"from": "system",
"value": "Remove check for RDF.rb version < 2.0.0\n\nThe version of RDF.rb checked in this conditional is no longer an allowed\ndependency. ActiveTriples 11.0.0 and up require RDF.rb >= 2.0.0.\n"
},
{
"from": "human",
"value": "module Hyrax\n # A work should be able to be fi... | ruby | chosen |
[
{
"from": "system",
"value": "Remove trailing whitespace in description"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\n$:.unshift File.expand_path('../lib', __FILE__)\nrequire 'deep_cloneable/version'\n\nGem::Specification.new do |s|\n s.name = 'deep_cloneable'\n s.version =... | ruby | chosen |
[
{
"from": "system",
"value": "Disable CORS in API requests\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass ApiBaseController < ActionController::API\n include SubmodulesHelper\n include ::GobiertoCommon::ModuleHelper\n include ApplicationConcern\n\n def preferred_lo... | ruby | chosen |
[
{
"from": "system",
"value": "Implement search feature in controller (incomplete - failing tests)\n"
},
{
"from": "human",
"value": "class SearchesController < ApplicationController\n def search\n end\nend\n"
},
{
"from": "gpt",
"value": "class SearchesController < ApplicationContr... | ruby | chosen |
[
{
"from": "system",
"value": "Allow login page to render in iframe.\n\nWe should consider some custom messaging when the page is rendered in\nthis manner, but this is a good first step.\n"
},
{
"from": "human",
"value": "class SessionsController < ApplicationController\n def new\n end\n\n def... | ruby | chosen |
[
{
"from": "human",
"value": "Add session_controller.rb and add necessayr controller methods.\n"
},
{
"from": "gpt",
"value": "class SessionsController < ApplicationController\n def create\n user = User.find_by(email: params[:session][:email])\n if user && user.authenticate(params[:session... | ruby | chosen |
[
{
"from": "system",
"value": "Add call back to configure user session after sucessful login\n"
},
{
"from": "human",
"value": "class SessionsController < Devise::SessionsController\n after_filter :log_failed_login, :only => :new\n after_filter :clear_flash_messages, :only => [:create, :destr... | ruby | chosen |
[
{
"from": "system",
"value": "Update StarValuePresenter to use our handle_* flow\n"
},
{
"from": "human",
"value": "class StarValuePresenter < Struct.new :star_student_assessment\n\n def percentile_rank\n return '–' if star_student_assessment.blank?\n return '–' if star_student_assessment... | ruby | chosen |
[
{
"from": "system",
"value": "Update manifest.json for new Web Share Target API.\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass ManifestSerializer < ActiveModel::Serializer\n include RoutingHelper\n include ActionView::Helpers::TextHelper\n\n attributes :name, :shor... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up additional files introduced by rebasing\n"
},
{
"from": "human",
"value": "When /^I click on next button on pagination$/ do\n search_results_page.pagination.click_on_next_button\nend\n\nWhen /^I click on previous button on pagination$/ do\n search_results... | ruby | chosen |
[
{
"from": "system",
"value": "Switch condition from unless to if\n"
},
{
"from": "human",
"value": "class API::V1::RegisterController < Grape::API\n resource :register do\n before do\n redirect '/' unless authenticated?\n end\n \n desc 'GET /api/v1/register/new'\n params do\... | ruby | chosen |
[
{
"from": "human",
"value": "Complete all Name query classes and subclasses\nAdd NameByUser\n"
},
{
"from": "gpt",
"value": "class Query::NameByUser < Query::Name\n def parameter_declarations\n super.merge(\n user: User\n )\n end\n\n def initialize_flavor\n user = find_cached_pa... | ruby | chosen |
[
{
"from": "system",
"value": "Add Timeslot model methods for cancellation email\n\nAdd methods to Timeslot model to issue emails to the affected student\nand tutor when a tutoring session is cnceled by either fo them.\n"
},
{
"from": "human",
"value": "class Timeslot < ActiveRecord::Base\n belo... | ruby | chosen |
[
{
"from": "system",
"value": "Fix rubocop offense in auto devops predefined variables\n"
},
{
"from": "human",
"value": "class ProjectAutoDevops < ActiveRecord::Base\n belongs_to :project\n\n scope :enabled, -> { where(enabled: true) }\n scope :disabled, -> { where(enabled: false) }\n\n vali... | ruby | chosen |
[
{
"from": "system",
"value": "Add CorpusText.by_tid to easily find a text by its text id\n"
},
{
"from": "human",
"value": "module Rglossa\n class CorpusText < ActiveRecord::Base\n has_and_belongs_to_many :metadata_values, join_table: 'rglossa_corpus_texts_metadata_values',\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add Omise gateway model template class\n"
},
{
"from": "gpt",
"value": "module Spree\n class Gateway::OmiseGateway < Gateway\n preference :public_key, :string\n preference :secret_key, :string\n\n def provider_class\n ::ActiveMerchant::Billing::OmiseGa... | ruby | chosen |
[
{
"from": "system",
"value": "Fix missing fav icon for staging environment\n"
},
{
"from": "human",
"value": "GovukAdminTemplate.environment_style = ENV['RAILS_ENV']\n\nGovukAdminTemplate.configure do |c|\n c.app_title = 'Telephone Appointment Planner'\n c.show_flash = true\n c.show_signout =... | ruby | chosen |
[
{
"from": "human",
"value": "Disable logging for successfully fetching assets.\n"
},
{
"from": "gpt",
"value": "# From http://stackoverflow.com/questions/6312448/how-to-disable-logging-of-asset-pipeline-sprockets-messages-in-rails-3-1\nRails.application.assets.logger = Logger.new('/dev/null')\nR... | ruby | chosen |
[
{
"from": "human",
"value": "Create folder for code challenges.\n"
},
{
"from": "gpt",
"value": "# A zero-indexed array A consisting of N integers is given. An equilibrium index of this array is any integer P such that 0 ≤ P < N and the sum of elements of lower indices is equal to the sum of ele... | ruby | chosen |
[
{
"from": "system",
"value": "Add configurable namespace for memcached client\n"
},
{
"from": "human",
"value": "\nDB = Sequel.connect(\"postgres://antifa:antifa@127.0.0.1/antifa\")\nCACHE_CLIENT = Dalli::Client.new( '127.0.0.1:11211', :value_max_bytes => 5242880 )\nSPHINX = Sequel.connect(\"mys... | ruby | chosen |
[
{
"from": "human",
"value": "Add initializer with basic checks for the LDAP config setup\n"
},
{
"from": "gpt",
"value": "should_use_mock_ldap = ::EnvironmentVariable.is_true('USE_TEST_PALS_LDAP')\n\nenv_is_production = Rails.env.production?\n\ndistrict_is_demo = (ENV.fetch('DISTRICT_KEY') == 'd... | ruby | chosen |
[
{
"from": "system",
"value": "Remove no longer used shared describe\n"
},
{
"from": "human",
"value": "require_relative '../fixtures/classes'\n\ndescribe :integer_comparison_coerce_rescue, shared: true do\n it \"rescues exception (StandardError and subclasses) raised in other#coerce and raises ... | ruby | chosen |
[
{
"from": "system",
"value": "Change YamlSyntax hook to use hook messages\n\nSimilar to JsonSyntax, simplify this hook to return hook messages,\nallowing the framework to determine if a run passed or failed.\n\nChange-Id: Ia3c2cdc569752b0ec6edf8f4c81d4a5ef07be9d1\nReviewed-on: http://gerrit.causes.com/47213... | ruby | chosen |
[
{
"from": "human",
"value": "Add test for global mass assignment disable\n\nfor Rails 2\n"
},
{
"from": "gpt",
"value": "class MassAssignDisableTest < Test::Unit::TestCase\n include BrakemanTester::RescanTestHelper\n\n def mass_assign_disable content\n init = \"config/initializers/mass_assi... | ruby | chosen |
[
{
"from": "system",
"value": "Enable console logging for testing\n"
},
{
"from": "human",
"value": "require 'rollbar/rails'\nRollbar.configure do |config|\n config.access_token = Cartodb.config[:rollbar_api_key]\n config.enabled = Rails.env.production? || Rails.env.staging?\n # Add exception ... | ruby | chosen |
[
{
"from": "human",
"value": "Read Affy CEL file and write to disk\n"
},
{
"from": "gpt",
"value": "#! /usr/bin/ruby\n#\n# Read an Affymetrix CEL file and write all CEL values to a tab delimited\n# file (using the Biolib Affyio module).\n#\n# By Pjotr Prins (c) 2009\n#\n# See http://github.co... | ruby | chosen |
[
{
"from": "system",
"value": "Add the integration test for linking signup page\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass SiteLayoutTest < ActionDispatch::IntegrationTest\n test \"layout links\" do\n get root_path\n assert_template 'static_pages/home'\n assert_se... | ruby | chosen |
[
{
"from": "system",
"value": "Fix error comparison Float with NaN\n"
},
{
"from": "human",
"value": "module ProfilesHelper\n def is_owner\n current_user && current_user.profile == @profile\n end\n\n def profile_name\n unless @profile.name.blank?\n @profile.name\n else\n 'Na... | ruby | chosen |
[
{
"from": "system",
"value": "Change email destination for security reasons\n"
},
{
"from": "human",
"value": "class FeedbackMailer < ActionMailer::Base\n # layout \"feedback_mail\"\n default to: \"guillermo.guerrero@kelisto.es\"\n\n def feed_us(data = {})\n @message = data[:message]\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix error when search query is blank\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass SearchService\n attr_reader :q\n\n def initialize(q, scope: :published)\n @q = q\n @scope = scope\n end\n\n def series_list\n collection(Serie... | ruby | chosen |
[
{
"from": "system",
"value": "Fix test to be correct\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass FutureTest < Test::Unit::TestCase\n def test_future\n promise = Dharma.future() { true }\n \n assert promise.completed?\n assert promise.result\n end\nend\n"
},
... | ruby | chosen |
[
{
"from": "system",
"value": "Disable parallel testing for Rubinius\n"
},
{
"from": "human",
"value": "require 'coveralls'\nrequire 'simplecov'\n\nSimpleCov.adapters.define 'sodium' do\n add_filter '/test/'\n add_filter '/vendor/'\nend\n\nCoveralls.wear!('sodium')\n\nrequire 'minitest/spec'\nr... | ruby | chosen |
[
{
"from": "system",
"value": "Add fallback for minitest < 5.0\n"
},
{
"from": "human",
"value": "ENV[\"RAILS_ENV\"] ||= 'test'\n\nrequire File.expand_path('../dummy/config/environment.rb', __FILE__)\n\nrequire 'test/unit'\nrequire 'minitest/autorun'\nrequire 'rubygems'\nrequire 'bundler'\nBundle... | ruby | chosen |
[
{
"from": "system",
"value": "[FIX] Test start - sidekiq needs require of celluloid"
},
{
"from": "human",
"value": "require 'rubygems'\nrequire 'bundler'\nbegin\n Bundler.setup(:default, :development)\nrescue Bundler::BundlerError => e\n $stderr.puts e.message\n $stderr.puts \"Run `bundle in... | ruby | chosen |
[
{
"from": "system",
"value": "Set hostname in tests to fix failing example\n"
},
{
"from": "human",
"value": "ENV['RACK_ENV'] = 'test'\n\nrequire 'bundler'\nBundler.require :default, :test\n\nrequire 'rack/test'\n\nWebrat.configure do |config|\n config.mode = :rack\nend\n\nMail.defaults do\n d... | ruby | chosen |
[
{
"from": "system",
"value": "Fix stupid typo in migration.\n"
},
{
"from": "human",
"value": "class AddDefaultToScore < ActiveRecord::Migration\n def up\n change_column_default :players, :score, 0\n Player.find_each do |p|\n p.update(score: 0) if p.score.nil?\n end\n end\n\n de... | ruby | chosen |
[
{
"from": "system",
"value": "Use github homepage in readme.\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'analytics-ruby-mock'\n s.version = '0.0.1'\n s.date = '2013-09-20'\n s.summary = \"A mock for segment.io calls\"\n s.description = ... | ruby | chosen |
[
{
"from": "system",
"value": "Add ffi-rzmq to runtime dependency in gemspec\n"
},
{
"from": "human",
"value": "require_relative 'lib/iruby/version'\n\nGem::Specification.new do |s|\n s.name = 'iruby'\n s.version = IRuby::VERSION\n s.authors = ['Daniel Mendler', 'The SciRu... | ruby | chosen |
[
{
"from": "system",
"value": "Update Gemspec, adding an actual description\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'kant/version'\n\nGem::Specification.new do |spec|\n spec.n... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure build the stats\n"
},
{
"from": "human",
"value": "def derive_versions\n changelog = IO.read('CHANGELOG.md')\n ENV['PREVIOUS_PRODUCT_VERSION'] ||= changelog[/^### \\[v(\\d+\\.\\d+)\\]/, 1]\n\n next_version = ENV['PRODUCT_VERSION']\n unless next_version... | ruby | chosen |
[
{
"from": "system",
"value": "Add gems required for examples as dev dependencies to 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 'blinken_window/version'\n\nGem::Specificat... | ruby | chosen |
[
{
"from": "system",
"value": "QUALITY: Remove debugging message from test\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass TicketsTest < ActiveSupport::TestCase\n include Rack::Test::Methods\n include TestHelpers::AuthHelper\n include TestHelpers::JsonHelper\n\n def app\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Format XML and JSON response for Tag\n"
},
{
"from": "human",
"value": "class TagsController < ApplicationController\n \n def index\n\t@tags = Tag.asc(:created_at).distinct(:tag)\n\t\n\trespond_to do |format|\n\t\tformat.html\n\t\tformat.xml {render :xml => @tags.... | ruby | chosen |
[
{
"from": "system",
"value": "Remove old grouping code in favor of hardcoded description\n"
},
{
"from": "human",
"value": "class TagsController < ContentController\n before_action :auto_discovery_feed, only: [:show, :index]\n layout :theme_layout\n\n def index\n @tags = Tag.page(params[:p... | ruby | chosen |
[
{
"from": "system",
"value": "Add test for existing behaviour\n"
},
{
"from": "human",
"value": "require \"test_helper\"\n\nclass CuratedListTest < ActiveSupport::TestCase\n test \"should validate format of slug\" do\n cl = CuratedList.new(slug: 'I am not a valid slug')\n assert !cl.valid... | ruby | chosen |
[
{
"from": "system",
"value": "Add type to goals json response.\n"
},
{
"from": "human",
"value": "class GoalSerializer < ActiveModel::Serializer\n attributes :id, :amount, :period, :category_id, :category_name, :category_type,\n :month_amount\nend\n"
},
{
"from": "gpt",
... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for sprockets deprecated method 'find_assets'\n"
},
{
"from": "human",
"value": "class License < ActiveRecord::Base\n has_many :artifacts\n\n def self.license_types\n License.all.pluck(:license_type).uniq\n end\n\n # TODO: Maybe move this whole code to at... | ruby | chosen |
[
{
"from": "system",
"value": "Include all of lib in the gem\n"
},
{
"from": "human",
"value": "require './lib/brakeman/version'\n\nGem::Specification.new do |s|\n s.name = %q{brakeman}\n s.version = Brakeman::Version\n s.authors = [\"Justin Collins\"]\n s.summary = \"Security vulnerability s... | ruby | chosen |
[
{
"from": "system",
"value": "Fix error when querying itemprop option.\n"
},
{
"from": "human",
"value": "module NodesHelper\n\n def link_to_landing_page(link_name, region, status, type, options = {})\n link_to(link_name, url_for(:controller => 'landing_pages', :wheelchair => status, :node_t... | ruby | chosen |
[
{
"from": "human",
"value": "Add helper for posts to display dates nicely\n"
},
{
"from": "gpt",
"value": "module PostsHelper\n def last_reply_at(post)\n date = post.last_reply_at || post.date\n if date.year == Time.zone.today.year\n date.to_s(:short_month_date)\n else\n date... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug where user can't claim profile\n"
},
{
"from": "human",
"value": "class Authorization < ActiveRecord::Base\n belongs_to :user\n\n def self.user_from_omniauth(auth)\n authorization = self.find_or_initialize_by(github_uid: auth.uid)\n if auth.provider ... | ruby | chosen |
[
{
"from": "system",
"value": "Move the constant inside of the page feedback to_csv\n\n* Motivation: GO CI will run the test and the build loading the class\nand the migration will be running on post install on rpm package.\n"
},
{
"from": "human",
"value": "class PageFeedback < ActiveRecord::Bas... | ruby | chosen |
[
{
"from": "system",
"value": "Remove check for explict access/secret key in env\n\nThis allows using an EC2 instance role if configured and fails with a permission error if not configured."
},
{
"from": "human",
"value": "require 'logger'\nrequire 'rack'\nrequire 'thin'\nrequire_relative 'reaper... | ruby | chosen |
[
{
"from": "system",
"value": "Add Ropian module docs, make use of autoload\n"
},
{
"from": "human",
"value": "require 'snmp'\n\nrequire 'ropian/control/generic'\nrequire 'ropian/control/raritan'\nrequire 'ropian/control/apc'\n\nrequire 'ropian/meter/generic'\nrequire 'ropian/meter/raritan'\nrequ... | ruby | chosen |
[
{
"from": "system",
"value": "Use 10 loops instead of 25 by default.\n"
},
{
"from": "human",
"value": "require 'colorize'\nrequire 'json'\nrequire 'net/http'\nrequire 'uri'\nrequire 'capybara'\n\nrequire 'wbench/version'\nrequire 'wbench/benchmark'\nrequire 'wbench/results'\nrequire 'wbench/tim... | ruby | chosen |
[
{
"from": "system",
"value": "Add missing autoload :Instance for Payload::Unhandled\n\nMSP-13201\n"
},
{
"from": "human",
"value": "# Namespace for {Metasploit::Cache::Payload::Unhandled::Class class metadata} that is generated from one payload\n# {Metasploit::Cache::Direct::Class#ancestor ances... | ruby | chosen |
[
{
"from": "system",
"value": "Add test for Attachment inheritance\n"
},
{
"from": "human",
"value": "require \"test_helper\"\n\nclass AttachmentTest < Minitest::Test\n def setup\n @uploadie = uploader(:bare).class\n user_class = Struct.new(:avatar_data)\n user_class.include @uploadie[:... | ruby | chosen |
[
{
"from": "system",
"value": "Test the odd chance that returns nil\n"
},
{
"from": "human",
"value": "require './test/helper'\n\nclass ContentTypeDetectorTest < Test::Unit::TestCase\n context 'given a name' do\n should 'return a content type based on that name' do\n @filename = \"/path... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug in test database preparation\n\nPresumably the intent of this was to clear the database and repopulate\nit with seed data. `transaction` isn't the right strategy for this; it\njust rolls back any existing transactions.\n"
},
{
"from": "human",
"value": "# fr... | ruby | chosen |
[
{
"from": "system",
"value": "Increase capybara wait time to 10s for locating .chat-input.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe \"Login\" do\n before do\n @user = FactoryGirl.create(:user, :password => \"mypassword\")\n @channel = FactoryGirl.create(:channe... | ruby | chosen |
[
{
"from": "system",
"value": "Update Mongoid to version 2.0"
},
{
"from": "human",
"value": "say(\"\\nReplacing ActiveRecord with Mongoid\\n\", Thor::Shell::Color::YELLOW )\n\ngem 'mongoid', '2.0.0.rc.7'\ngem 'bson_ext', '~> 1.2'\n\ngsub_file 'config/application.rb', 'require \"active_record/rai... | ruby | chosen |
[
{
"from": "human",
"value": "Add Spec for Ability Model\n\nAdd spec tests for the Ability model.\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\nrequire 'cancan'\nrequire 'cancan/matchers'\nrequire_relative '../../app/models/ability.rb'\n\ndescribe Ability do\n let(:user) { FactoryGi... | ruby | chosen |
[
{
"from": "system",
"value": "Configure Airbrake via ENV vars\n"
},
{
"from": "human",
"value": "# This file is overwritten on deploy\n#\nAirbrake.configure do |config|\n # Adding production to the development environments causes Airbrake not\n # to attempt to send notifications.\n config.dev... | ruby | chosen |
[
{
"from": "system",
"value": "Load huginn_scheduler first before each thread starts to auto-load files.\n\nThis should fix #501.\n"
},
{
"from": "human",
"value": "require 'thread'\n\ndef stop\n puts 'Exiting...'\n @scheduler.stop\n @dj.stop\n @stream.stop\nend\n\ndef safely(&block)\n begin... | ruby | chosen |
[
{
"from": "human",
"value": "Create a JSON example (doesn't work yet).\n"
},
{
"from": "gpt",
"value": "$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n\nrequire \"rubygems\"\nrequire \"representative/json\"\nrequire \"ostruct\"\n\nbooks = [\n OpenStruct.new(\n :title => ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix webmock version to 1.8.0 to avoid problems with vcr and remove annoying warning\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'braspag/ve... | ruby | chosen |
[
{
"from": "system",
"value": "Use new framework defaults for rails 5\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n#\n# This file contains migration options to ease your Rails 5.0 upgrade.\n#\n# Once upgraded flip defaults one by one to migrate t... | ruby | chosen |
[
{
"from": "system",
"value": "Rewrite a step to delete a lockfile\n"
},
{
"from": "human",
"value": "Given 'a lockfile with:' do |content|\n steps %Q{\n Given a file named \"#{'.'.to_lockfile_path}\" with:\n \"\"\"\n #{expand(content)}\n \"\"\"\n }\nend\n\nGiven /^I delete lo... | ruby | chosen |
[
{
"from": "system",
"value": "Write specs for content method\n\nThese specs ensure that the sponsors and the callout section exists.\n"
},
{
"from": "human",
"value": "require \"nokogiri\"\nrequire \"spec_helper\"\n\ndescribe \"html output\" do \n before :all do\n newsletter = TrelloNewslett... | ruby | chosen |
[
{
"from": "system",
"value": "Order the hosts API output based on the hostname, A-Z\n"
},
{
"from": "human",
"value": "class HostsController < ActionController::Base\n def index\n @hosts = Host.all\n\n render json: HostsPresenter.new(@hosts).as_hash.to_json\n end\nend\n"
},
{
"fr... | ruby | chosen |
[
{
"from": "system",
"value": "Add share for leaderboard page\n"
},
{
"from": "human",
"value": "class PagesController < ApplicationController\n before_action :authenticate_user!, except: [:index, :help, :leaderboard]\n def index\n @has_share = @has_footer_share = true\n @latest_battles =... | ruby | chosen |
[
{
"from": "system",
"value": "Modify gemspec 'authors' to sing. 'author'\n"
},
{
"from": "human",
"value": "require File.expand_path('../lib/kbam/version', __FILE__)\n\nGem::Specification.new do |spec|\n spec.name = 'kbam'\n spec.version = Kbam::VERSION\n spec.date = Date.to... | ruby | chosen |
[
{
"from": "system",
"value": "Add OS X requirements to Audio Hijack cask\n"
},
{
"from": "human",
"value": "cask :v1 => 'audio-hijack' do\n version :latest\n sha256 :no_check\n\n url 'https://rogueamoeba.com/audiohijack/download/AudioHijack.zip'\n name 'Audio Hijack'\n homepage 'http://www.... | ruby | chosen |
[
{
"from": "system",
"value": "Drop ActiveSupport as a dependency.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"mingo/version\"\n\nGem::Specification.new do |s|\n s.name = \"mingo\"\n s.version = Mingo::VERSIO... | ruby | chosen |
[
{
"from": "system",
"value": "Add licenses declaration to gemspec.\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"rticles/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\... | ruby | chosen |
[
{
"from": "system",
"value": "Remove `depends_on macos: '>= :tiger'`."
},
{
"from": "human",
"value": "cask 'fujitsu-scansnap-manager-s1300' do\n version '3.2L31'\n sha256 '4bdc782e7b2d86c1a3c7e55ae6753440f208a9c92ac1c4290bc17e40ba2f5513'\n\n url 'https://www.fujitsu.com/downloads/IMAGE/drive... | ruby | chosen |
[
{
"from": "system",
"value": "Add minitest & shoulda to the 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 'runtest/version'\n\nGem::Specification.new do |spec|\n spec.name... | ruby | chosen |
[
{
"from": "system",
"value": "Use a single server by default\n\nCapistrano configuration is prepared to deploy to multiple servers\n\nFor now assuming that we are going to use a single server for everthing (app, db, cron jobs, queue system, etc)\n"
},
{
"from": "human",
"value": "set :deploy_to,... | ruby | chosen |
[
{
"from": "system",
"value": "Make dep on docker-api more pessimistic\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'spoon/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Update test to for waiver/trade dealine...need to fix in the future\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n sequence :name do |n|\n \"name #{n}\"\n end\n \n factory :fantasy_league do\n division \"A\"\n year 2016\n end\n\n factory :... | ruby | chosen |
[
{
"from": "system",
"value": "Call Rails.application instead of Rails::Application.\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nRails::Application.routes.draw do\n\n\n if BluePages.route_prefix.present?\n\n match \"#{BluePages.route_prefix}/*path\" => \"blue_pages/pages#show\"\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Handle missing user for a crew owner.\n"
},
{
"from": "human",
"value": "require \"minitest/autorun\"\n\nclass OptionalTests < MiniTest::Unit::TestCase\n \n def test_env\n assert true\n end\n \n def test_working_chain\n user_name = 'Bob'\n user = User.... | ruby | chosen |
[
{
"from": "system",
"value": "Use the newer expect syntax to prevent deprecation warnings with RSpec\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'elementary/future'\n\ndescribe Elementary::Future do\n let(:future) { described_class.new do 1 end }\n\n describe '#method_mis... | ruby | chosen |
[
{
"from": "system",
"value": "Fix broken paperclip setup in testing model\n"
},
{
"from": "human",
"value": "require 'paperclip'\nrequire 'paperclip/railtie'\nrequire 'filemagic'\nrequire 'paperclip_optimizer'\n\nrequire 'rspec'\nrequire 'rspec/autorun'\n\nrequire \"active_record\"\n\n# taken fr... | ruby | chosen |
[
{
"from": "system",
"value": "Use Output.messages rather than two calls to Output\n"
},
{
"from": "human",
"value": "if ENV['TRAVIS']\n require \"codeclimate-test-reporter\"\n CodeClimate::TestReporter.start\nelse\n require 'simplecov'\nend\n\nrequire 'rspec'\nrequire 'open-uri'\nrequire 'res... | ruby | chosen |
[
{
"from": "system",
"value": "Remove deprecation warning when running spec tests\n\nSee https://tickets.puppetlabs.com/browse/PDK-916\n"
},
{
"from": "human",
"value": "require 'puppetlabs_spec_helper/module_spec_helper'\n"
},
{
"from": "gpt",
"value": "RSpec.configure do |config|\n ... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.