conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Change the start of `future` scope\n"
},
{
"from": "human",
"value": "class Live < ApplicationRecord\n has_many :songs, dependent: :restrict_with_exception\n\n scope :order_by_date, -> { order(date: :desc) }\n scope :future, -> { where('date > ?', Date.today) }\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix issue when setting certain sources."
},
{
"from": "human",
"value": "class Image < ActiveRecord::Base\n attr_accessible :image, :sources_attributes, :uploader\n\n belongs_to :album, counter_cache: true\n belongs_to :uploader, class_name: 'User', inverse_of: :... | ruby | chosen |
[
{
"from": "system",
"value": "Include lincense file in the package"
},
{
"from": "human",
"value": "$LOAD_PATH.push File.expand_path(\"../lib\", __FILE__)\nrequire 'active_resource/version'\n\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'activeresource... | ruby | chosen |
[
{
"from": "system",
"value": "Add has_many comments to Round model\n"
},
{
"from": "human",
"value": "class Round < ActiveRecord::Base\n attr_accessible :charity, :closed, :expire_time, :failed, :max_amount, :secret_token, :url, :winning_address1, :winning_address2\n after_initialize do |round... | ruby | chosen |
[
{
"from": "system",
"value": "Use Pacto::Response instead of Faraday::Response for instantiate\n"
},
{
"from": "human",
"value": "module Pacto\n class Response\n attr_reader :status, :headers, :schema\n\n def initialize(definition)\n @definition = definition\n @status = @definit... | ruby | chosen |
[
{
"from": "system",
"value": "Use CI and auto deploy to demo environment\n"
},
{
"from": "human",
"value": "class HouseholdExpenses\n def call(env)\n [200, {}, ['Hello World']]\n end\nend\n"
},
{
"from": "gpt",
"value": "class HouseholdExpenses\n def call(env)\n [200, {}, ['... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up TeX support installation, add caveat.\n\nCloses #42110.\n\nSigned-off-by: Alex Dunn <46952c1342d5ce1a4f5689855eda3c9064bca8f6@gmail.com>\n"
},
{
"from": "human",
"value": "require 'formula'\n\nclass Noweb < Formula\n desc \"WEB-like literate-programming to... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure base catalog also matches\n"
},
{
"from": "human",
"value": "#\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# You may obtain a copy of the License at\n#\n# htt... | ruby | chosen |
[
{
"from": "system",
"value": "Set exception message when user failed to login\n"
},
{
"from": "human",
"value": "require 'capybara'\nrequire 'capybara/poltergeist'\n\nmodule Valanga\n class Client\n LOGIN_PAGE = \"https://p.eagate.573.jp/gate/p/login.html\"\n MUSIC_INDEX = \"https://p.ea... | ruby | chosen |
[
{
"from": "system",
"value": "Fix compus beats phase rate"
},
{
"from": "human",
"value": "sd = sample_duration :loop_compus\n\ndefine :loopr do\n sample :loop_compus, rate: [0.5, 1, 1, 1, 1, 2].choose if rand < 0.9\n sleep sd\nend\n\ndefine :bass do\n sample :bass_voxy_c, amp: rrand(0.1, 0.2... | ruby | chosen |
[
{
"from": "system",
"value": "Fix test failures caused by secure cookie changes\n\n#178193849\nhttps://www.pivotaltracker.com/story/show/178193849\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\n# the key used to be _bort_session in the rails2 ve... | ruby | chosen |
[
{
"from": "system",
"value": "Document behaviour of doubling setter methods.\n"
},
{
"from": "human",
"value": "require \"spec_helper\"\n\ndescribe \"double\" do\n it \"is an alias for stub and mock\" do\n expect(double()).to be_a(RSpec::Mocks::Mock)\n end\n\n it \"uses 'Double' in failure... | ruby | chosen |
[
{
"from": "system",
"value": "Use root domain as session cookie domain\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\nCartoDB::Application.config.session_store :cookie_store, :key => '_cartodb_session', :domain => CartoDB.domain\n"
},
{
... | ruby | chosen |
[
{
"from": "system",
"value": "Fix cookie store in locahost domain cannot login\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nunless Rails.env.test?\n Rails.application.config.session_store(\n :cookie_store,\n key: Settings.site.session_key,\n domain: %W[.#{Setting... | ruby | chosen |
[
{
"from": "system",
"value": "Update chef client to 11.10.0\n"
},
{
"from": "human",
"value": "# Add the opscode APT source for chef\ndefault[:apt][:sources] = node[:apt][:sources] | [ \"opscode\" ]\n\n# Set the default client version\ndefault[:chef][:client][:version] = \"11.8.2-1\"\n\n# A list... | ruby | chosen |
[
{
"from": "system",
"value": "Update udevadm path for Ubuntu 20.04 compatibility\n"
},
{
"from": "human",
"value": "#\n# Cookbook:: devices\n# Recipe:: default\n#\n# Copyright:: 2012, OpenStreetMap Foundation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not ... | ruby | chosen |
[
{
"from": "system",
"value": "Move away from deprecated exists?\n"
},
{
"from": "human",
"value": "require 'tilt'\nrequire 'flatrack/template/erubis'\nrequire 'flatrack/template/rb'\nrequire 'flatrack/template/html'\n\nclass Flatrack\n module Template\n\n def find(type, file)\n template... | ruby | chosen |
[
{
"from": "system",
"value": "Improve the ArgumentError exception message in inherit_context.\n"
},
{
"from": "human",
"value": "class MiniTest::Spec\n \n class << self \n\n #\n # Evaluates a context by name.\n #\n # @example \n # describe ExampleClass do\n # inherit_c... | ruby | chosen |
[
{
"from": "system",
"value": "Add the jython libexec/Lib to PYTHONPATH\n"
},
{
"from": "human",
"value": "module Plugin::Python\n module Use include Plugin::Use\n def __use!(var)\n super\n __if(cmp(raw(\"$UID\"), Fixnum).gt(0)) do |c|\n c.then do\n __case(args[1]) d... | ruby | chosen |
[
{
"from": "system",
"value": "Add :merger attr for testing\n"
},
{
"from": "human",
"value": "# Factorial Delegator for Item Merger Class\nclass Poloxy::ItemMerge\n def initialize config: nil\n @config = config || Poloxy::Config.new\n merger = config.deliver['item']['merger']\n merg... | ruby | chosen |
[
{
"from": "human",
"value": "Add specs for translation controller\n"
},
{
"from": "gpt",
"value": "require 'rails_helper'\n\ndescribe API::TranslationsController do\n\n let(:user) { create(:user) }\n let(:another_user) { create(:user) }\n let(:discussion) { create(:discussion, author: user) }... | ruby | chosen |
[
{
"from": "human",
"value": "Add integration test for creating a bosh dev release\n\nSo that we can catch missing / extra files in job spec files within the\nbosh release.\n\n[Finish #101552268](https://www.pivotaltracker.com/story/show/101552268)\n\nSigned-off-by: Tushar Dadlani <30e3adf538ecf64bd912d5b2c6... | ruby | chosen |
[
{
"from": "system",
"value": "Include gemspec and Gemfiles in distributed gem for ease of working with / running tests\n"
},
{
"from": "human",
"value": "lib = File.expand_path('../lib/', __FILE__)\n$:.unshift lib unless $:.include?(lib)\nrequire 'foodcritic/version'\nGem::Specification.new do |... | ruby | chosen |
[
{
"from": "system",
"value": "Fix a test bug when not run in guard\n"
},
{
"from": "human",
"value": "describe ScitesController do\n\n let(:user) { FactoryGirl.create(:user) }\n let(:paper) { FactoryGirl.create(:paper) }\n\n before { sign_in user }\n\n describe \"creating a scite with Ajax\... | ruby | chosen |
[
{
"from": "system",
"value": "Improve spec for Lint/EmptyEnsure with comments\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nRSpec.describe RuboCop::Cop::Lint::EmptyEnsure do\n subject(:cop) { described_class.new }\n\n it 'registers an offense and corrects empty ensure' do... | ruby | chosen |
[
{
"from": "system",
"value": "Rename dalli test to correct redis cache test\n"
},
{
"from": "human",
"value": "require 'test_helper'\nrequire 'flipper/adapters/redis_cache'\n\nclass DalliTest < MiniTest::Test\n prepend Flipper::Test::SharedAdapterTests\n\n def setup\n url = ENV.fetch('REDIS... | ruby | chosen |
[
{
"from": "system",
"value": "Add class to represent Discord channels\n"
},
{
"from": "human",
"value": "# These classes hold relevant Discord data, such as messages or channels.\n\nmodule Discordrb\n class User\n attr_reader :username, :id, :discriminator, :avatar\n alias_method :name, :... | ruby | chosen |
[
{
"from": "system",
"value": "Access the schemaβs rules via `.rule_ast`"
},
{
"from": "human",
"value": "require \"dry-configurable\"\nrequire \"formalist/elements\"\nrequire \"formalist/form/definition_context\"\nrequire \"formalist/element/permitted_children\"\nrequire \"formalist/form/result\... | ruby | chosen |
[
{
"from": "system",
"value": "Trim down some more code\n"
},
{
"from": "human",
"value": "module Gas\n\n # Class that class that interacts with the git config\n module GitConfig\n\n # Parse out the current user from the gitconfig\n # @param [String] gitconfig The git configuration\n #... | ruby | chosen |
[
{
"from": "system",
"value": "Remove pry for debugging the tests\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'browserify-rails/version'\n\nGem::Specification.new do |spec|\n spec... | ruby | chosen |
[
{
"from": "human",
"value": "Add test for GIT SCM\n"
},
{
"from": "gpt",
"value": "require \"test_helper\"\nrequire \"mocha/test_unit\"\nrequire \"test_construct\"\n\nmodule Roger\n # Test for Roger Zip finalizer\n class GitScmTest < ::Test::Unit::TestCase\n include TestConstruct::Helpers\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add converting to array stuff to Vector2 so it's nicer with Rubygame\n"
},
{
"from": "human",
"value": "module Jiggle\n \n class Vector2\n def to_s\n \"(#{x}, #{y})\"\n end\n \n def inspect\n \"#<Vector2 x=#{x} y=#{y}>\"\n end\n\n alias... | ruby | chosen |
[
{
"from": "system",
"value": "Move configuration loading to initializer\n"
},
{
"from": "human",
"value": "module Kuroko2\n class Engine < ::Rails::Engine\n isolate_namespace Kuroko2\n\n config.before_configuration do\n require 'kaminari'\n require 'chrono'\n end\n\n confi... | ruby | chosen |
[
{
"from": "system",
"value": "Allow optimized_operators parser option to be configured\n"
},
{
"from": "human",
"value": "require 'opal'\nrequire 'sprockets'\n\nmodule Opal\n class Processor < Tilt::Template\n self.default_mime_type = 'application/javascript'\n\n def self.engine_initializ... | ruby | chosen |
[
{
"from": "system",
"value": "Use 'activesupport/all' to avoid problem used as a gem\n"
},
{
"from": "human",
"value": "require 'active_support/core_ext/string'\n\nrequire \"rails_launcher/version\"\nrequire \"rails_launcher/dsl\"\nrequire \"rails_launcher/file_constructor\"\nrequire \"rails_lau... | ruby | chosen |
[
{
"from": "system",
"value": "Fix date in gemspec file\n"
},
{
"from": "human",
"value": "require './lib/circuit_breaker-ruby/version'\n\nGem::Specification.new do |gem|\n gem.name = 'circuit_breaker-ruby'\n gem.version = CircuitBreaker::VERSION\n gem.date = '2016-10-09'\... | ruby | chosen |
[
{
"from": "system",
"value": "Switch to using password_required? to check if password is changing\n\nThis is more idiomatic - it's what devise uses internally.\n"
},
{
"from": "human",
"value": "module Devise\n module Models\n # The UncommonPassword module adds a new validation for Devise Mo... | ruby | chosen |
[
{
"from": "system",
"value": "Add env check convenience method\n"
},
{
"from": "human",
"value": "require 'securerandom'\nrequire 'core_ext/securerandom'\n\nmodule Travis\n require 'travis/support/assertions'\n require 'travis/support/async'\n require 'travis/support/chunkifier'\n require 't... | ruby | chosen |
[
{
"from": "system",
"value": "Update code to latest RSpec configs\n"
},
{
"from": "human",
"value": "require 'simplecov'\nSimpleCov.start 'rails'\n\nENV['RAILS_ENV'] = 'test'\n\nrequire File.expand_path('../../config/environment', __FILE__)\n\nrequire 'rspec/rails'\nrequire 'rspec/autorun'\nrequ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix revert action for update event.\n"
},
{
"from": "human",
"value": "module RevertiblePaperTrail\n module Version\n extend ActiveSupport::Concern\n \n included do\n end\n\n module InstanceMethods\n def revert\n case event\n whe... | ruby | chosen |
[
{
"from": "system",
"value": "Return `DB_TRUE_VALUE` instead of \"t\" to avoid multiple memory allocations and to ensure consistency."
},
{
"from": "human",
"value": "require_relative \"base\"\n\nclass StoreSchema::Converter::Boolean < StoreSchema::Converter::Base\n\n # @return [String] the dat... | ruby | chosen |
[
{
"from": "human",
"value": "Add Rake task to cleanup dupes\n"
},
{
"from": "gpt",
"value": "task :cleanup_dupes => :environment do\n vals = []\n\n validations = Validation.where(:url.ne => nil).order_by(:created_at.desc)\n\n validations.each do |v|\n if vals.include?(v.url)\n v.delet... | ruby | chosen |
[
{
"from": "system",
"value": "Fix reference to old constant\n"
},
{
"from": "human",
"value": "task :reprocess_tweet_images => :environment do\n RUBYFRIENDS_APP.tweets.each do |tweet|\n tweet.image.recreate_versions!\n end\nend"
},
{
"from": "gpt",
"value": "task :reprocess_twee... | ruby | chosen |
[
{
"from": "system",
"value": "Change checkout zone so that Austrlia is the default country selected in checkout.\n"
},
{
"from": "human",
"value": "# Configure Spree Preferences\n# \n# Note: Initializing preferences available within the Admin will overwrite any changes that were made through the... | ruby | chosen |
[
{
"from": "system",
"value": "Switch back to chef-sugar from chef-sugar-ng\n\nNo need to use the ng here\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nre... | ruby | chosen |
[
{
"from": "system",
"value": "Address warning from gem build about being overly pessimistic.\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'msfl_visitors'\n s.version = '0.0.1'\n s.date = '2015-05-01'\n s.summary = \"Convert MSFL to other f... | ruby | chosen |
[
{
"from": "system",
"value": "Improve output from script to update API\n"
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\n\n# Grabs the current version of the API, downloads the latest and if\n# there is a difference commits the new version. Used by our release\n# script to document in the ... | ruby | chosen |
[
{
"from": "system",
"value": "Test won at different place sets\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nclass MockDisplay\nend\n\ndescribe TicTacToe do\n\n it 'has a version number' do\n expect(TicTacToe::VERSION).not_to be nil\n end\n\n describe TicTacToe::Game do\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add convenience methods for generating eighth, quarter, and dotted-quarter notes\n"
},
{
"from": "human",
"value": "module Musicality\n\ndef make_note dur, pitch_group\n if dur > 0\n Musicality::Note.new(dur,pitch_group)\n else\n Musicality::Note.new(-dur)\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix to avoid warning about space before parentheses.\n"
},
{
"from": "human",
"value": "$:.unshift (File.dirname(__FILE__) + '/lib')\nrequire 'ole/storage/version'\n\nPKG_NAME = 'ruby-ole'\nPKG_VERSION = Ole::Storage::VERSION\n\nGem::Specification.new do |s|\n\ts.na... | ruby | chosen |
[
{
"from": "system",
"value": "Fix routing error for the campaign\n"
},
{
"from": "human",
"value": "RSpec.describe CampaignsController, :type => :controller do\n describe 'GET show' do\n let(:id) { 'revealed-the-true-cost-of-buying-a-car' }\n let(:template) { double }\n\n context 'if t... | ruby | chosen |
[
{
"from": "system",
"value": "Update wording to \"uses\" in vote spec\n"
},
{
"from": "human",
"value": "require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')\n\ndescribe \"Package voting\" do\n\n include WebratHelpers\n include AuthHelper\n\n setup do\n Version.make\n Us... | ruby | chosen |
[
{
"from": "system",
"value": "Add zero exit code test case\n"
},
{
"from": "human",
"value": "describe \"Test remote WQL features via WinRM\", :integration => true do\n before(:all) do\n @winrm = winrm_connection\n end\n\n it 'should run a CMD command string' do\n output = @winrm.run_cm... | ruby | chosen |
[
{
"from": "system",
"value": "Test both lexical and object translation to SSE. Lexical tests that fail are made pending.\n"
},
{
"from": "human",
"value": "$:.unshift \".\"\nrequire File.join(File.dirname(__FILE__), 'spec_helper')\nrequire 'sparql/spec'\n\ndescribe SPARQL::Grammar::Parser do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update P4V to latest version (2015.2-1312139).\n"
},
{
"from": "human",
"value": "cask :v1 => 'p4v' do\n version '2014.3-1007540'\n sha256 '07eac08f6bfb32e4a79bf47582116de8532fe0b18d91a014e1cd80861d6f0909'\n\n url \"http://filehost.perforce.com/perforce/r#{versio... | ruby | chosen |
[
{
"from": "system",
"value": "Update IdeaController spec pending test messages\n\nAdd messages for each individual test that can be added.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe IdeasController do\n before do\n @idea = create(:idea)\n end\n\n describe \"GET 'i... | ruby | chosen |
[
{
"from": "human",
"value": "Define initial spec tests for upvoting.\n"
},
{
"from": "gpt",
"value": "require 'rails_helper'\n\ndescribe VotesController do\n describe '#create' do\n context 'on the welcome#index page'\n it 'creates a vote record with the correct user_id'\n it 'crea... | ruby | chosen |
[
{
"from": "human",
"value": "Test to make sure we don't get contributions smaller than $10\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\nfeature 'Create contribution' do\n background do\n @project = create(:project, state: 'online', online_date: -1.seconds.from_now)\n @user = ... | ruby | chosen |
[
{
"from": "system",
"value": "Add minor fixes in note polling specs\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nfeature 'Issue notes polling' do\n let!(:project) { create(:project, :public) }\n let!(:issue) { create(:issue, project: project) }\n\n background do\n visit name... | ruby | chosen |
[
{
"from": "system",
"value": "Use Rack::Lint to test the rack session\n"
},
{
"from": "human",
"value": "require \"rubygems\"\nrequire \"test/unit\"\nrequire \"rack/test\"\n# require \"redgreen\"\n\nrequire File.dirname(__FILE__) + \"/../../../../lib/webrat\"\n\nWebrat.configure do |config|\n c... | ruby | chosen |
[
{
"from": "system",
"value": "Remove the dependency on activesupport.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/ontrac/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Brian Abreu\"]\n gem.email = [\"br... | ruby | chosen |
[
{
"from": "system",
"value": "Replace shutdown should-receive from Celluloid test\n\nInstead, use the mock (verb) to set an instance variable we can later read to\nsee if the method was at least called.\n"
},
{
"from": "human",
"value": "describe Appsignal::Hooks::CelluloidHook do\n context \"w... | ruby | chosen |
[
{
"from": "system",
"value": "Modify API application controller to skip csrf protection when requesting JSON\n"
},
{
"from": "human",
"value": "class Api::V1::ApplicationController < ActionController::Base\n include ApiDefaults\n # Prevent CSRF attacks by raising an exception.\n # For APIs, y... | ruby | chosen |
[
{
"from": "human",
"value": "Fix init for heroku deployement\n"
},
{
"from": "gpt",
"value": "# encoding: UTF-8\n# This file is auto-generated from the current state of the database. Instead\n# of editing this file, please use the migrations feature of Active Record to\n# incrementally modify yo... | ruby | chosen |
[
{
"from": "system",
"value": "Check SAM is installed before running\n"
},
{
"from": "human",
"value": "success = system(File.realpath(\"#{__dir__}/../scripts/build-fixtures\"))\n\nraise \"Unable to build fixtures!\" unless success\n"
},
{
"from": "gpt",
"value": "`command -v sam`\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add version.rb to template Cenit Collection Gem\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = '<%= file_name %>'\n s.version = '0.0.1'\n s.summary = 'TODO: Add ... | ruby | chosen |
[
{
"from": "system",
"value": "Put job on a queue\n"
},
{
"from": "human",
"value": "class RemoveFactRelationCredibility\n def self.perform\n FactRelation.all.ids.each do |id|\n fact_relation = FactRelation[id]\n keys = Authority.all_on(fact_relation).map(&:key)\n Redis.current... | ruby | chosen |
[
{
"from": "human",
"value": "Add back ID to shared_entitites join table\n"
},
{
"from": "gpt",
"value": "Sequel.migration do\n up do\n Rails::Sequel.connection.run(%{\n ALTER TABLE shared_entities DROP CONSTRAINT shared_entities_pkey;\n })\n Rails::Sequel.connection.run(%{\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Update dataset_id primary and foreign keys to bigint\n"
},
{
"from": "gpt",
"value": "class ChangeDatasetIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :datasets, :id, :bigint\n\n change_column :agreement_event_datasets, :dataset_id, :bigin... | ruby | chosen |
[
{
"from": "system",
"value": "Enable case insensitive admin search\n"
},
{
"from": "human",
"value": "class Admin::PublishersController < AdminController\n def index\n @publishers = Publisher\n if params[:q].present?\n # Returns an ActiveRecord::Relation of publishers for pagination\... | ruby | chosen |
[
{
"from": "human",
"value": "Add simple string ruby file\n"
},
{
"from": "gpt",
"value": "# Solution Below\n\nold_string = \"Ruby is cool\"\n\nnew_string = old_string.reverse.upcase\n\n\n\n# RSpec Tests. They are included in this file because the local variables you are creating are not accessib... | ruby | chosen |
[
{
"from": "system",
"value": "Use OrganizationIndexPresenter instead of OrganizationDetailPresenter\n"
},
{
"from": "human",
"value": "class CommunityController < ApplicationController\n actions_without_auth :user_leaderboards, :organization_leaderboards\n\n def user_leaderboards\n data = R... | ruby | chosen |
[
{
"from": "system",
"value": "Allow managers to manage countries\n"
},
{
"from": "human",
"value": "class CountriesController < ApplicationController\n before_filter :admin_required\n before_filter :find_country, :only => [:edit, :update, :destroy]\n \n def index\n @countries = @w.countri... | ruby | chosen |
[
{
"from": "system",
"value": "Change new question controller to redirect to show instead of rendering\n"
},
{
"from": "human",
"value": "class QuestionsController < ApplicationController\n\n def show\n @question = Question.find(params[:id])\n @answer = Answer.new\n @commentable = @ques... | ruby | chosen |
[
{
"from": "system",
"value": "Fix coverage template to filter the methods.\n\n"
},
{
"from": "human",
"value": "require 'fileutils'\nrequire 'set'\n\ninclude Helpers::ModuleHelper\n\nMANIFEST_FILENAME = 'coverage.manifest'.freeze\n\ndef init\n generate_manifest\nend\n\n\ndef namespace_objects\n... | ruby | chosen |
[
{
"from": "system",
"value": "Remove defaults from user creds\n"
},
{
"from": "human",
"value": "Sequel.migration do\n up do\n create_table :'pw-users' do\n column :id, :uuid, default: Sequel.function(:uuid_generate_v4), primary_key: true\n String :email\n String... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests for WePay authorization methods.\n"
},
{
"from": "gpt",
"value": "require File.expand_path(File.dirname(__FILE__) + '/helper')\n\nclass TestWepayRailsAuthorize < ActiveSupport::TestCase\n def setup\n create_wepay_config_file(false, true)\n initialize... | ruby | chosen |
[
{
"from": "system",
"value": "Store credentials in a different file than flickr_airlift does - Use Ruby 1.9's Dir.home function for cross-platformitude\n"
},
{
"from": "human",
"value": "module FlickrCli\n module Authentication\n def self.establish_session\n auth_file = Fi... | ruby | chosen |
[
{
"from": "system",
"value": "Make i.v. temp variable instead.\n"
},
{
"from": "human",
"value": "$:.unshift 'lib'\n\nrequire \"test/unit\"\nrequire 'caruby/util/partial_order'\n\nclass Queued\n include PartialOrder\n\n attr_reader :value, :queue\n\n def initialize(value, on)\n @value = va... | ruby | chosen |
[
{
"from": "system",
"value": "Destroy the existing .git folder and make a new one (so the user has a clean history)\n"
},
{
"from": "human",
"value": "require \"proteus/version\"\nrequire \"thor\"\n\nmodule Proteus\n class Kit < Thor\n include Thor::Actions\n\n desc \"url\", \"gets the gi... | ruby | chosen |
[
{
"from": "system",
"value": "Fix loading of the compiled library\n"
},
{
"from": "human",
"value": "require 'fiddle'\nrequire 'rbconfig'\n\nlibrary = Fiddle.dlopen(\"librusty_blank.#{RbConfig::CONFIG['DLEXT']}\")\nfunc = Fiddle::Function.new(library['init_rusty_blank'],\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix failure on handling the path containing non-uri chars\n\nIn `DraftArticle#path_part`, `Addressable::Template#extract`\nreturns `nil` when `path` has characters not allowed for\nURI (RFC3986) so that `DraftArticle#slug` fails for undefined `[]`.\nNormalizing (percent-encodin... | ruby | chosen |
[
{
"from": "system",
"value": "Use :swallow_stderr instead of not thread safe silence_stream(STDERR)\n"
},
{
"from": "human",
"value": "module Paperclip\n class GeometryDetector\n def initialize(file)\n @file = file\n raise_if_blank_file\n end\n\n def make\n geometry = Ge... | ruby | chosen |
[
{
"from": "system",
"value": "Allow you to set Rake ENV options as part of the call (still missing a way to set rake options like --trace)\n"
},
{
"from": "human",
"value": "require 'rake'\n\nmodule Commands\n class Raker\n include Rake::DSL\n\n def initialize\n load_rake_tasks\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add votes schema for migration\n"
},
{
"from": "gpt",
"value": "class CreateVotes < ActiveRecord::Migration\n def change\n create_table :votes do |t|\n t.integer :value\n t.integer :voter_id\n t.integer :voteable_id\n t.string :voteable_type\... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unused exact position method call\n\nRemove unused call and place in another separate example\n"
},
{
"from": "human",
"value": "# We have to import the minecraft api module to do anything in the minecraft world\nrequire_relative 'mcpi/minecraft'\n\n=begin\nF... | ruby | chosen |
[
{
"from": "system",
"value": "Add description to fields option.\n"
},
{
"from": "human",
"value": "\ncommand :query do |c|\n c.syntax = 'jm query [options] query'\n c.summary = 'Get the keys from a jira query'\n c.description = 'Run a query. '\n\tc.example 'Get Open issues and dump everything... | ruby | chosen |
[
{
"from": "human",
"value": "Add GHC for Mac OS X\n"
},
{
"from": "gpt",
"value": "class Ghc < Cask\n url 'https://github.com/ghcformacosx/ghc-dot-app/releases/download/v7.8.2-r2/ghc-7.8.2-r2.zip'\n homepage 'http://ghcformacosx.github.io/'\n version '7.8.2-r2'\n sha256 '7e9de6d9d772f42ab0b3... | ruby | chosen |
[
{
"from": "system",
"value": "Reduce Fog expiration period to 17 years\n"
},
{
"from": "human",
"value": "CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\\.\\-\\+]/\n\naws_file = Rails.root.join('config', 'aws.yml')\n\nif File.exists?(aws_file)\n AWS_CONFIG = YAML.load(File.read(aws_fi... | ruby | chosen |
[
{
"from": "human",
"value": "Store flash messages in a different session variable\n\nAvoids conflict with how Rails 3/public_website deals with flash messages\n"
},
{
"from": "gpt",
"value": "module ActionDispatch\n class Request\n class Session\n alias_method :original_accessor, :[]\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Print name of file instead of assuming TAGS.\n"
},
{
"from": "human",
"value": "module Mactag\n ##\n #\n # Tag builder.\n #\n class Builder\n def initialize\n @tags = []\n end\n\n def <<(tags)\n @tags += Array(tags)\n end\n\n def files\... | ruby | chosen |
[
{
"from": "system",
"value": "Add an identifier index for anonymous lookups\n"
},
{
"from": "human",
"value": "require 'ohm'\nrequire 'securerandom'\n\nmodule Minuteman\n class User < ::Ohm::Model\n attribute :uid\n attribute :identifier\n\n unique :uid\n unique :identifier\n\n d... | ruby | chosen |
[
{
"from": "system",
"value": "Reduce size of the gem by only including the necessary files via gemspec\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$LOAD_PATH.push File.expand_path('../lib', __FILE__)\n\nrequire 'pronto/jshint/version'\n\nGem::Specification.new do |s|\n s.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Use tour layout for create_your_first_factlink.\n"
},
{
"from": "human",
"value": "class TourController < ApplicationController\n before_filter :common_tour\n\n # first step is account, and this is in other controllers\n # search for @step_in_signup_process = :ac... | ruby | chosen |
[
{
"from": "system",
"value": "Allow running the gem from source\n"
},
{
"from": "human",
"value": "require 'vagrant'\nrequire 'socket'\nrequire 'erb'\nrequire 'ostruct'\n\nrequire 'vagrant-notify/middleware'\nrequire 'vagrant-notify/server'\nrequire \"vagrant-notify/version\"\n\nmodule Vagrant\n... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unnecessary `old_method_missing` method after crawled\n"
},
{
"from": "human",
"value": "#coding: utf-8\nrequire 'wombat/dsl/metadata'\nrequire 'wombat/dsl/property'\nrequire 'wombat/processing/parser'\nrequire 'active_support'\nrequire 'date'\n\nmodule Womba... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up better when switching cores\n"
},
{
"from": "human",
"value": "require \"rbconfig.rb\"\ninclude Config\nrequire \"fileutils\"\ninclude FileUtils::Verbose\n\nloop do\n\tputs \"Do you want to install the binary (b) or pure-ruby (r) core? (b/r)?\"\n\n\tanswer=... | ruby | chosen |
[
{
"from": "system",
"value": "Remove Dwifft from podspec dependencies\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"StateView\"\n s.version = \"0.1\"\n s.summary = \"Automatically-updating views you can actually understand.\"\n s.descripti... | ruby | chosen |
[
{
"from": "system",
"value": "Update yajl gemspec to >= 1.0\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"bldr/version\"\n\nGem::Specification.new do |s|\n s.name = \"bldr\"\n s.version = Bldr::VERSION\n s.pl... | ruby | chosen |
[
{
"from": "system",
"value": "Update to follow Rails convention\n\nCall send name message to contact instead of searching by contact-id\n"
},
{
"from": "human",
"value": "# A local church\nclass Locality < ActiveRecord::Base\n has_many :users\n has_many :lodgings\n belongs_to :contact, class_... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.