conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add specs for Player model.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Player do\nend\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe Player do\n describe 'create' do\n before do\n Player.create(\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Return all metrics as graph data.\n"
},
{
"from": "human",
"value": "class AudiencesController < ApplicationController\n def breakdown\n @audience = Audience.find(params[:id])\n end\n\n def show\n audience = Audience.find(params[:id])\n area = Area.find(... | ruby | chosen |
[
{
"from": "system",
"value": "Add user validation for question creation\n"
},
{
"from": "human",
"value": "class QuestionsController < ApplicationController\n def index\n end\n\n def new\n @question = Question.new\n end\n\n def create\n @question = Question.new(params[:question].permi... | ruby | chosen |
[
{
"from": "system",
"value": "Increment times_viewed attribute when question is viewed\n"
},
{
"from": "human",
"value": "class QuestionsController < ApplicationController\n before_action :authenticate_user!\n before_action :set_user\n\n def index\n @questions = @user.questions\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add ANDROID_SDK_ROOT to Android's caveats.\n"
},
{
"from": "human",
"value": "require 'formula'\n\nclass AndroidSdk <Formula\n url 'http://dl.google.com/android/android-sdk_r04-mac_86.zip'\n homepage 'http://developer.android.com/index.html'\n md5 'b08512765aa9b0... | ruby | chosen |
[
{
"from": "system",
"value": "Use class attribute to store list of transactions in memory\n"
},
{
"from": "human",
"value": "class TransactionPresenter\n\n def initialize(transaction)\n @transaction = transaction\n end\n\n def multiple_more_information_sections?\n num_sections = [:befor... | ruby | chosen |
[
{
"from": "system",
"value": "Make the copy from params to object dynamic\n\n- using a Ruby oneliner with `each`\n\nSigned-off-by: Siddharth Kannan <7a804f1d08bac02a84ba1822c22c8bf38be68ecc@tutanota.com>\n"
},
{
"from": "human",
"value": "class ArticleController < ApplicationController\n\tdef in... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug al preguntar srid en el decorador\n"
},
{
"from": "human",
"value": "# encoding: utf-8\nclass UbicacionDecorator < ApplicationDecorator\n # Transforma del srid real al preferido por el usuario\n def transformar\n @coordenadas ||= Ubicacion.transformar(s... | ruby | chosen |
[
{
"from": "system",
"value": "Use both name and presentation fields to locate option values\n"
},
{
"from": "human",
"value": "Spree::Product.class_eval do\n def get_option_values(option_name)\n sql = <<-eos\n SELECT DISTINCT ov.id, ov.presentation\n FROM spree_option_values AS ov\... | ruby | chosen |
[
{
"from": "system",
"value": "Add resource_id and user to Comments Serializer.:\n"
},
{
"from": "human",
"value": "class CommentSerializer < ActiveModel::Serializer\n attributes :id, :content\nend\n"
},
{
"from": "gpt",
"value": "class CommentSerializer < ActiveModel::Serializer\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor holiday serializer to use built in aliasing\n"
},
{
"from": "human",
"value": "class HolidaySerializer < ActiveModel::Serializer\n attribute :title\n attribute :start do\n object.start_at\n end\n attribute :end do\n object.end_at\n end\nend\n"
... | ruby | chosen |
[
{
"from": "human",
"value": "Add a failing feature spec\n"
},
{
"from": "gpt",
"value": "require \"spec_helper\"\n\ndescribe \"Parse a pidgin log file\" do\n include FakeFS::SpecHelpers\n\n it \"outputs the correct data\" do\n runner = Pidgin2Adium::Runner.new(\"./in-logs\", [\"gabe\"])\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix changed behavior of legacy course end dates\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nrequire \"#{Rails.root}/lib/legacy_courses/legacy_course_importer\"\nrequire \"#{Rails.root}/lib/legacy_courses/legacy_course_user_importer\"\n\nclass L... | ruby | chosen |
[
{
"from": "system",
"value": "Use more explicit dependencies for Rails helper\n\nThis doesn't require all of Rails, only ActionView & Railties. Reduce\nthe dependencies here means that it enables folks to use only parts of\nRails and to slim down their applications by removing unused components\nof Rails.\n... | ruby | chosen |
[
{
"from": "system",
"value": "Implement RobotController complaint with RobotControllerTest\n"
},
{
"from": "human",
"value": "class RobotController\n def initialize(_)\n end\n\n def execute(_)\n end\nend\n"
},
{
"from": "gpt",
"value": "require './lib/toy_robot_simulator/command/... | ruby | chosen |
[
{
"from": "system",
"value": "Add create action to plays controller\n"
},
{
"from": "human",
"value": "class Api::V1::PlaysController < ApplicationController\n def index\n @plays = Play.page(params[:page]).order(played_at: :desc, id: :desc)\n\n @object = {\n result_count: @plays.tota... | ruby | chosen |
[
{
"from": "system",
"value": "Add an index for full text search\n"
},
{
"from": "human",
"value": "class AddFullTextSearchIndexToDocuments < ActiveRecord::Migration\n def change\n end\nend\n"
},
{
"from": "gpt",
"value": "class AddFullTextSearchIndexToDocuments < ActiveRecord::Migr... | ruby | chosen |
[
{
"from": "human",
"value": "Add a test for the find_work_widget partial\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\nRSpec.describe 'curation_concerns/base/_find_work_widget.html.erb', type: :view do\n let(:work) { stub_model(GenericWork) }\n let(:form) do\n view.simple_form_f... | ruby | chosen |
[
{
"from": "system",
"value": "Fix - Ashok - Fixed the specs\n"
},
{
"from": "human",
"value": "module LoadsSession\n\n def logged_in?\n !get_session.nil?\n end\n\n private\n\n def get_session\n token = token_from_request\n return nil if token.nil?\n Session.get(token_from_request... | ruby | chosen |
[
{
"from": "system",
"value": "Add TODO for validating appropriate_adults\n"
},
{
"from": "human",
"value": "class StandardInterview < Interview\n include Virtus.model\n include ActiveModel::Validations\n\n attribute :type, String, writer: :private, default: 'StandardInterview'\n\n attribute ... | ruby | chosen |
[
{
"from": "system",
"value": "Use view helpers for content and excerpt\n"
},
{
"from": "human",
"value": "cache @item\nobject @item => :items\n\nattributes :id, :guid, :title, :channel_type, :tags, :description, :content, :link, :published_at\nnode(:href) { |i| item_url(i) }\nnode(:excerpt) { |i... | ruby | chosen |
[
{
"from": "human",
"value": "Write step definitions to support “add an event” scenario\n\nI’m conscious that these are duplicating work from other step\ndefinitions, and that more generally we’re already suffering from the\n“feature-coupled step definitions” antipattern [1], but for now I’m\nconcentrating o... | ruby | chosen |
[
{
"from": "system",
"value": "Remove debug messages from the Exlibris::Aleph initializer\n"
},
{
"from": "human",
"value": "begin\n # Load all the sub libraries when the application starts\n Exlibris::Aleph::TablesManager.instance.sub_libraries.all\n # Load all the item circulation policies w... | ruby | chosen |
[
{
"from": "system",
"value": "Add SplitTimesController with related serializers, policy, and routes; remove unused parameter from StagingController.\n"
},
{
"from": "human",
"value": "class Api::V1::StagingController < ApiController\n before_action :set_event\n\n # GET /api/vi/staging/:uuid/ge... | ruby | chosen |
[
{
"from": "system",
"value": "Increase max run time to 6 hours\n\n+ https://github.com/studentinsights/studentinsights/issues/1023#issuecomment-330038945\n"
},
{
"from": "human",
"value": "class ImportJob\n def perform\n load File.expand_path(\"#{Rails.root}/lib/tasks/import.thor\", __FILE__... | ruby | chosen |
[
{
"from": "system",
"value": "Add local testenv2 to available providers\n"
},
{
"from": "human",
"value": "module Spid\n\n class Idp\n\n def self.metadata_urls\n {\n 'agid_test' => 'http://localhost:3000/metadata-idp-gov.xml',\n 'aruba' => 'https://loginspid.aruba.it... | ruby | chosen |
[
{
"from": "system",
"value": "Add Validation to Question for Specs Testing\n"
},
{
"from": "human",
"value": "class Question < ActiveRecord::Base\n belongs_to :user\n has_many :responses\n\nend\n"
},
{
"from": "gpt",
"value": "class Question < ActiveRecord::Base\n belongs_to :user... | ruby | chosen |
[
{
"from": "system",
"value": "Fix typo in setup env docs\n"
},
{
"from": "human",
"value": "module Flipper\n module Middleware\n class SetupEnv\n # Public: Initializes an instance of the SetEnv middleware. Allows for\n # lazy initialization of the flipper instance being set in the ... | ruby | chosen |
[
{
"from": "system",
"value": "Use Ruby's built-in default param support\n\nThis is terser.\n"
},
{
"from": "human",
"value": "module JSONApi\n module Response\n class Middleware < Faraday::Middleware\n\n def initialize(app, directory:)\n super(app)\n @directory = directory... | ruby | chosen |
[
{
"from": "human",
"value": "Add specs for limit operation\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe Veritas::Adapter::Arango::Visitor::Wrappable::Limit, '#root' do\n subject { object.root }\n\n let(:node) { base.sort_by { |r| [r.foo.asc, r.bar.asc] }.take(5) }\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for applications using the MethodOverride middleware\n"
},
{
"from": "human",
"value": "require 'oauth/request_proxy/base'\nrequire 'uri'\nrequire 'rack'\n\nmodule OAuth::RequestProxy\n class RackRequest < OAuth::RequestProxy::Base\n proxies Rack::Request\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Test cutom method from Her\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule BoletoSimples\n class BankBillet < BaseModel\n def cancel\n self.class.request(_method: :put, _path: self.class.build_request_path('bank_billets/:id/cancel... | ruby | chosen |
[
{
"from": "system",
"value": "Add Comment.find for v1 of api\n"
},
{
"from": "human",
"value": "module BugherdClient\n module Resources\n module V1\n \n class Comment < Base\n\n #\n # Get a paginated list of comments for a task.\n #\n def all(project_id,... | ruby | chosen |
[
{
"from": "system",
"value": "Correct error handling for duplicates.\n"
},
{
"from": "human",
"value": "require 'csv'\n\ntask :default => :load_additional_data\n\ndesc \"Load barcodes and other additional data from text files\"\ntask :load_additional_data => :environment do\n file_name = ENV[\"... | ruby | chosen |
[
{
"from": "human",
"value": "Fix bug with some special chars being escaped in page title\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\n# Module contains helpers that normalize text meta tag values.\nmodule MetaTags\n module TextNormalizer\n def self.strip_tags(string)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove us-west-1 from the S3 bucket\n"
},
{
"from": "human",
"value": "if %w(development test cucumber performance).include?(Rails.env)\n s3_decision = {}\nelse\n s3_decision = {\n storage: :fog,\n path: \":class/:attachment/:id/:style/:fi... | ruby | chosen |
[
{
"from": "system",
"value": "Cover more cases for ObjectSpace._id2ref\n"
},
{
"from": "human",
"value": "require_relative '../../spec_helper'\n\ndescribe \"ObjectSpace._id2ref\" do\n it \"converts an object id to a reference to the object\" do\n s = \"I am a string\"\n r = ObjectSpace._i... | ruby | chosen |
[
{
"from": "system",
"value": "Build taskwarrior with a bash block.\n"
},
{
"from": "human",
"value": "git \"#{Chef::Config[:file_cache_path]}/task.git\" do\n repository node[\"taskwarrior\"][\"source\"][\"git_repository\"]\n reference node[\"taskwarrior\"][\"source\"][\"git_revision\"]\n acti... | ruby | chosen |
[
{
"from": "system",
"value": "Change from error to warning for blank amount\n\n- probably a warning and not an alert (fatal error)"
},
{
"from": "human",
"value": "require 'sinatra/base'\nrequire 'sinatra/assetpack'\nrequire 'coin'\nrequire 'sinatra/flash'\n\nmodule CoinCalculator\n class Main ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove attachment styles and unnecessary content type\n"
},
{
"from": "human",
"value": "class Document < ActiveRecord::Base\n belongs_to :user\n has_attached_file :doc_pdf, styles: {:thumb => \"100x100#\",\n :small => \"150x150>\",\n :medium => \"200x2... | ruby | chosen |
[
{
"from": "system",
"value": "Include the error id in the mail title\n"
},
{
"from": "human",
"value": "class Notifier < ActionMailer::Base\n \n def invitation(invitation, sent_at = Time.now)\n subject 'You received a Failtale invitation!'\n recipients invitation.email\n from ... | ruby | chosen |
[
{
"from": "system",
"value": "Add Sorting filter in question controller\n"
},
{
"from": "human",
"value": "class QuestionsController < ApplicationController\n\n # before_filter\n\n def index\n @questions = Question.all\n if params[:sort] == \"trending\"\n\n elsif params[:sort] == \"mo... | ruby | chosen |
[
{
"from": "system",
"value": "Add source code URI to gemspec\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'holiday_japan'\n\nGem::Specification.new do |gem|\n gem.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Use it instead of its, fails on Travis for some reason\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe NYNY do\n its 'root points to pwd' do\n NYNY.root.should == Pathname.pwd\n end\n\n it 'has the correct env' do\n NYNY.env.should be_t... | ruby | chosen |
[
{
"from": "system",
"value": "Remove nonsense from XMPP tests\n"
},
{
"from": "human",
"value": "require File.dirname(__FILE__) + \"/test_helper\"\n\ncontext \"Connecting to an XMPP Server\" do\n\n include XMPPTestHelper\n\n before(:all) { require '' }\n\n before :each do\n\n end\n\n after ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for Model.all.page in DataMapper\n"
},
{
"from": "human",
"value": "require 'kaminari/models/data_mapper_collection_methods'\n\nmodule Kaminari\n module DataMapperExtension\n module Paginatable\n class_eval <<-RUBY, __FILE__, __LINE__ + 1\n def #... | ruby | chosen |
[
{
"from": "human",
"value": "Add simple form adapt implementation\n"
},
{
"from": "gpt",
"value": "module ParsleySimpleForm\n class SimpleFormAdapt < SimpleForm::FormBuilder\n\n def input(attribute_name, options = {}, &block)\n options[:input_html] ||= {}\n parsley_validations = va... | ruby | chosen |
[
{
"from": "system",
"value": "Downgrade chrome driver for jasmine\n\nInline with feature test chromedirver version\nand version 79 may not work for some local test envs.\n"
},
{
"from": "human",
"value": "#Use this file to set/override Jasmine configuration options\n#You can remove it if you don... | ruby | chosen |
[
{
"from": "human",
"value": "Add Bluemix deploy provider test coverage\n\nAdd spec class to test Bluemix deploy provider\n\nSigned-off-by: Adam King <a74e182e49abf6252c9b13e1b94c4c5a47f8da9a@us.ibm.com>\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\nrequire 'dpl/provider/bluemix_cloudfo... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.3.3 to 0.3.4\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-entity_store'\n s.version = '0.3.3'\n s.summary = 'Store of entities that are projected from Event... | ruby | chosen |
[
{
"from": "system",
"value": "Update gemspec to work with higher versions of rails\n"
},
{
"from": "human",
"value": "$:.push File.expand_path('../lib', __FILE__)\n\n# Maintain your gem's version:\nrequire 'auto_time_zone/version'\n\n# Describe your gem and declare its dependencies:\nGem::Specif... | ruby | chosen |
[
{
"from": "system",
"value": "[FIX] Fix up build failure in pear installer spec\n"
},
{
"from": "human",
"value": "require File.expand_path(\"../../spec_helper\", File.dirname(__FILE__))\n\ndescribe Sprinkle::Installers::Pear do\n\n before do\n @package = mock(Sprinkle::Package, :name => 'sp... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug in logging of screenshots of failed tests\n\nPresumably this was a typo.\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nRSpec.configure do |config|\n config.after(:each, type: :feature) do\n example_filename = RSpec.current_example.f... | ruby | chosen |
[
{
"from": "human",
"value": "Add integration spec to test use with an ActiveRecord still interface\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\nrequire 'ldap-relations'\n\n# Example ActiveRecord style usage for LRel\n#\n# eg. Directory.where(sAMAccountName: 'test').all\nclass Director... | ruby | chosen |
[
{
"from": "human",
"value": "Add market price route specs.\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe \"routing to market_prices\" do\n it { {:get, \"/game/1/market_prices\"}.should route_to(:action => :index,\n :game => 1, :controller => \"market_prices\") }\n\n i... | ruby | chosen |
[
{
"from": "system",
"value": "Add LIKE To API Committee Name Search\n\nAdd LIKE instead of API Committee name search because the user should\nnot type in the whole name of what they are looking for.\n"
},
{
"from": "human",
"value": "class Api::CommitteesController < ApiController\n\tdef index\n... | ruby | chosen |
[
{
"from": "system",
"value": "Remove problematic authorize! & redirect to slug instead of product id\n"
},
{
"from": "human",
"value": "module Spree\n class CommentsController < Spree::StoreController\n def create\n # Spree::StoreController already has authenticaiton methods\n # li... | ruby | chosen |
[
{
"from": "system",
"value": "Bump working version to 2.1.0.0\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = \"bootstrap-sass\"\n s.version = '2.0.4.1'\n s.authors = [\"Thomas McDonald\"]\n s.email = 'tom@conceptcoding.co.uk'\n s.summary = \"Twitter's Bootstrap,... | ruby | chosen |
[
{
"from": "system",
"value": "Add authors and bump version to 0.0.2.\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"FTWebViewController\"\n s.version = \"0.0.1\"\n s.summary = \"A paginated iOS UIWebView controller with simple interactivity support.\"\n... | ruby | chosen |
[
{
"from": "human",
"value": "Add BMFF::Box::Track class which represents Track Box.\n"
},
{
"from": "gpt",
"value": "# coding: utf-8\n# vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:\n\nclass BMFF::Box::Track < BMFF::Box::Base\n register_box \"trak\"\n include(BMFF::Box::C... | ruby | chosen |
[
{
"from": "system",
"value": "plugins/guest: Fix a few typos for Haiku\n"
},
{
"from": "human",
"value": "module VagrantPlugins\n module GuestHaiku\n module Cap\n class ChangeHostName\n def self.change_host_name(machine, name)\n comm = machine.communicate\n\n if... | ruby | chosen |
[
{
"from": "system",
"value": "Remove uneeded provider option ref.\n"
},
{
"from": "human",
"value": "# Cookbook Name:: rs_utils\n# Recipe:: setup_hostname\n#\n# Copyright (c) 2011 RightScale Inc\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this softwar... | ruby | chosen |
[
{
"from": "human",
"value": "Add temporary Rake task to migrate hmrc_manuals rendering to goverment-frontend\n"
},
{
"from": "gpt",
"value": "# As part of decommissioning manuals-frontend we are moving all previously published\n# manuals to government-frontend as the rendering app. As hnmrc-manu... | ruby | chosen |
[
{
"from": "system",
"value": "Delete to check `String` in validation for mid\n"
},
{
"from": "human",
"value": "module Line\n module Bot\n module Utils\n\n # @return [Boolean]\n def validate_mids(mids)\n return false unless mids.is_a?(String) || mids.is_a?(Array)\n mi... | ruby | chosen |
[
{
"from": "system",
"value": "Move error classes definitions into separate file\n"
},
{
"from": "human",
"value": "require 'magnum/payload/version'\n\nmodule Magnum\n module Payload\n SOURCES = %w(custom github gitlab gitslice bitbucket beanstalk)\n\n class ParseError < StandardError ; ... | ruby | chosen |
[
{
"from": "system",
"value": "Move profils controller spec to factory_girl.\n"
},
{
"from": "human",
"value": "# -*- encoding : utf-8 -*-\nrequire 'rails_helper'\n\ndescribe ProfilesController do\n\n setup(:activate_authlogic)\n\n context \"an user logged in station in demo mode\" do\n\n be... | ruby | chosen |
[
{
"from": "system",
"value": "Test for session controller pass, 100% coverage\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\ndescribe SessionsController do\n\n it 'renders the login page' do\n get :new\n expect(response).to have_http_status(:ok)\n expect(response).to rend... | ruby | chosen |
[
{
"from": "human",
"value": "Add spec to make sure method precedence works correctly in Fortitude."
},
{
"from": "gpt",
"value": "describe \"Fortitude method precedence\", :type => :system do\n it \"should have widget methods > need methods > helper methods > tag methods\" do\n helpers_class... | ruby | chosen |
[
{
"from": "system",
"value": "Add late_cancelled field to Visit model\n"
},
{
"from": "human",
"value": "module MindBody\n module Models\n class Visit < Base\n attribute :id, Integer\n attribute :class_id, Integer\n attribute :start_date_time, DateTime\n attribute :end_da... | ruby | chosen |
[
{
"from": "system",
"value": "Make web_service_protocols an class attribute\n"
},
{
"from": "human",
"value": "module ActionWebService # :nodoc:\n module Protocol # :nodoc:\n module Discovery # :nodoc:\n def self.included(base)\n base.extend(ClassMethods)\n base.send(:incl... | ruby | chosen |
[
{
"from": "system",
"value": "Use the hanna rdoc template\n"
},
{
"from": "human",
"value": "require 'fileutils'\ninclude FileUtils\n\nrequire 'rubygems'\n%w[rake hoe newgem rubigen].each do |req_gem|\n begin\n require req_gem\n rescue LoadError\n puts \"This Rakefile requires the '#{req... | ruby | chosen |
[
{
"from": "system",
"value": "Format tweak on Debug logging\n"
},
{
"from": "human",
"value": "require 'puppet/util/network_device/pure'\nrequire 'puppet/purestorage_api'\n\nclass Puppet::Util::NetworkDevice::Pure::Facts\n attr_reader :transport, :facts\n\n def initialize(transport)\n @tran... | ruby | chosen |
[
{
"from": "system",
"value": "Remove application.html.erb, we use slim\n"
},
{
"from": "human",
"value": "require \"rails/generators\"\n\nmodule Suspenders\n class ViewsGenerator < Rails::Generators::Base\n source_root File.expand_path(\n File.join(\"..\", \"..\", \"..\", \"templates\")... | ruby | chosen |
[
{
"from": "system",
"value": "Set the content type and ACL\n"
},
{
"from": "human",
"value": "require 'aws'\n\nclass PhotoRequest\n def self.configure(config)\n @config = config\n end\n\n def self.aws_config\n AWS.config.with(\n access_key_id: @config[:access_key_id],\n se... | ruby | chosen |
[
{
"from": "system",
"value": "Update translation for enabled/disabled OptionalModules\n"
},
{
"from": "human",
"value": "#\n# == OptionalModuleDecorator\n#\nclass OptionalModuleDecorator < ApplicationDecorator\n include Draper::LazyHelpers\n include ApplicationHelper\n delegate_all\n\n def s... | ruby | chosen |
[
{
"from": "system",
"value": "Watermark applyes only if watermark file presents\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nclass Shoppe::AttachmentUploader < CarrierWave::Uploader::Base\n include CarrierWave::MiniMagick\n\n # Where should files be stored?\n def store_dir\n \"a... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests for OBIX module"
},
{
"from": "gpt",
"value": "require \"obix\"\nrequire \"minitest/unit\"\nrequire \"minitest/autorun\"\nrequire \"active_support/all\"\n\nrequire \"test_helper\"\n\nclass OBIXTest < MiniTest::Unit::TestCase\n def test_parses_from_string\n... | ruby | chosen |
[
{
"from": "system",
"value": "Reset Time.zone to avoid leaking into other tests\n\nhttps://buildkite.com/rails/rails/builds/72478#93358e11-6e26-4588-a791-26f9512157c2/1074-1087\nhttps://buildkite.com/rails/rails/builds/72747#10657eba-2359-47ca-9914-49a48b3f2d3c/967-976\nhttps://buildkite.com/rails/rails/bui... | ruby | chosen |
[
{
"from": "human",
"value": "Add ContactsController spec - 05_controller_basics\n\nRspec tests outlined for ContactsController but not yet implemented.\nSpecs organized to flesh out the expectation for happy path and unhappy path.\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescrib... | ruby | chosen |
[
{
"from": "system",
"value": "Allow HR to change name, fix user authorisation\n"
},
{
"from": "human",
"value": "class Hr::UsersController < ApplicationController\n\n before_action :authenticate_user!\n\n before_action :get_user, only: [:edit, :update]\n\n def index\n @users = User.all\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure we have a valid session before trying to log the user out.\n"
},
{
"from": "human",
"value": "class SessionsController < Devise::SessionsController\n\n def destroy\n current_user.is_logged_in = false\n super\n end\nend"
},
{
"from": "gpt",
... | ruby | chosen |
[
{
"from": "system",
"value": "Change the image upload symlinking behavior.\n"
},
{
"from": "human",
"value": "\nset :application, \"dreamcatcher\"\n\nset :rails_env, 'production'\nset :branch, 'production-rackspace'\n\nset :deploy_to, \"/var/www/#{application}\"\n\n# server \"dreamcatcher.net\",... | ruby | chosen |
[
{
"from": "system",
"value": "Change Google and Facebook registration mailer subject\n"
},
{
"from": "human",
"value": "class WoodlockWelcomeMailer < ApplicationMailer\n def omniauth_welcome(user, provider)\n case provider\n when 'google_oauth2' then provider_name = 'Google'\n when 'fa... | ruby | chosen |
[
{
"from": "system",
"value": "Add gem dependencies and meta info to gemspec\n\nThis commit adds semantic versions to the rails-spec\nand sqlite3 gems. Also added was a home page pointed to the\ngem source code hosted at Github.com. Lastly, the description and\nsummary was improved to be more descriptive o... | ruby | chosen |
[
{
"from": "system",
"value": "[BRAIN] Fix a bug in assertions"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nrequire_relative '../../lib/humanity_neuron'\n\ndescribe HumanityNeuron do\n include NeuronMatchers\n\n context \"greetings\" do\n [\n ['Hello', 'Why hello there!'],\... | ruby | chosen |
[
{
"from": "human",
"value": "Implement base API error formatter\n"
},
{
"from": "gpt",
"value": "module BetterDoctor\n module ErrorFormatter\n\n # ----------------------------------------------------------------------- #\n # Error Formatter ... | ruby | chosen |
[
{
"from": "system",
"value": "Use admin policy class on admin\n"
},
{
"from": "human",
"value": "class Admin::BaseController < ApplicationController\n inherit_resources\n before_filter do\n authorize! :access, :admin\n end\n\n def update\n update! do |format|\n if resource.errors.... | ruby | chosen |
[
{
"from": "system",
"value": "Return at most 100 items in the actions\n\nThis is to prevent super-large payloads.\n"
},
{
"from": "human",
"value": "module V2\n class ActionsController < ApplicationController\n def index\n TimedFeature.check!(owner: \"Tijmen\", expires: \"2017-04-22\")\... | ruby | chosen |
[
{
"from": "system",
"value": "Fix N+1 queries on campaign alerts\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\njson.alerts @campaign.public_alerts do |alert|\n json.id alert.id\n json.type alert.type\n json.created_at alert.created_at\n json.user alert.user&.username\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix \"framworks\" typo in Carthage copy phase.\n"
},
{
"from": "human",
"value": "module Liftoff\n class Carthage < DependencyManager\n def setup\n if carthage_installed?\n move_cartfile\n else\n puts 'Please install Carthage or disable c... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure to not create a response wrapepr object if not present\n\nIf the exception is a conneciton error (e.g. Timeout, SSL error), the response object ends up being nil and it doesn't make sense to wrap a nil object. In case of network/connection error, just skip wrapping it... | ruby | chosen |
[
{
"from": "system",
"value": "Add tags stanza to Earlybird"
},
{
"from": "human",
"value": "cask :v1 => 'earlybird' do\n version '42.0a2'\n sha256 :no_check # required as upstream package is updated in-placea\n\n url \"https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-earlyb... | ruby | chosen |
[
{
"from": "system",
"value": "Update available profile modes for current ruby-prof\n"
},
{
"from": "human",
"value": "require 'ruby-prof'\nrequire 'set'\n\nmodule ActionController\n module ActionProfiler\n MODES = Set.new(%w(process_time wall_time cpu_time allocated_objects memory))\n\n #... | ruby | chosen |
[
{
"from": "system",
"value": "Reconnect to the database server if the connection goes away.\n"
},
{
"from": "human",
"value": "require 'yaml'\n\nclass DatabaseConfig\n class NoConfigFound < StandardError ; end\n\n def self.for(environment)\n config = YAML.load(File.read(\"database.yml\"))[e... | ruby | chosen |
[
{
"from": "system",
"value": "Raise exception if HTTP status is not successful\n"
},
{
"from": "human",
"value": "module Dawanda\n \n # = Request\n # \n # A basic wrapper around GET requests to the Dawanda JSON API\n #\n class Request\n \n # The base URL for API requests\n def sel... | ruby | chosen |
[
{
"from": "system",
"value": "Add message to indicate polling has begun\n"
},
{
"from": "human",
"value": "module Helios\n class Listener\n def initialize(aws = nil)\n @aws ||= (aws || AWS::SQS.new)\n end\n\n def listen!\n @aws.queues.named('helios').poll do |message|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Change snippet max_results: 3 -> 10\n"
},
{
"from": "human",
"value": "require 'haml'\nrequire 'honyomi/database'\nrequire 'sinatra'\nrequire 'sinatra/reloader' if ENV['SINATRA_RELOADER']\n\ninclude Honyomi\n\nset :haml, :format => :html5\n\nconfigure do\n $databas... | ruby | chosen |
[
{
"from": "system",
"value": "Update Logger mixin to add a log_key method\n"
},
{
"from": "human",
"value": "#\n# Copyright 2013-2014 Chef Software, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n#... | ruby | chosen |
[
{
"from": "system",
"value": "Fix incorrect usage of block_given?"
},
{
"from": "human",
"value": "module TableFor\n class Table < Struct.new(:template, :model_class, :records, :html, :block)\n attr_accessor :columns, :rows\n delegate :capture, :content_tag, :to => :template\n\n def hu... | ruby | chosen |
[
{
"from": "system",
"value": "Add code to find the files that need to be compiled\n\nThe trick now is going to be getting the correct path."
},
{
"from": "human",
"value": "require 'rubygems'\n\nGem.post_install do\n puts 'this is a test'\nend\n"
},
{
"from": "gpt",
"value": "Gem.po... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.