conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add helper for rails 4+\n"
},
{
"from": "human",
"value": "module AlertifyHelper\n ALERT_TYPES = [:error, :info, :success, :warning] unless const_defined?(:ALERT_TYPES)\n\n def alertify_flash\n jsReturn = javascript_tag()\n flash.each do |type, message|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add tag_list attribute to permitted attrs on project policy\n"
},
{
"from": "human",
"value": "class ProjectPolicy < ApplicationPolicy\n def create?\n done_by_owner_or_admin? || is_channel_admin?\n end\n\n def update?\n create?\n end\n\n def show?\n if... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for empty attribute but\n"
},
{
"from": "human",
"value": "object @need\nattribute :title, :status, :url, :description, :notes, :tag_list\n \ncode(:kind){|n| n.kind.name rescue \"none\" } \n\nchild :wr... | ruby | chosen |
[
{
"from": "system",
"value": "Update spec.source_files after folder rename\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |spec|\n spec.name = 'Fetchable'\n spec.version = '0.0.1'\n spec.summary = 'Coming soon to a table (or collection) view near you.'\n spec.descripti... | ruby | chosen |
[
{
"from": "system",
"value": "Create development version of Parity forumla\n\nThis change adds a `devel` version of the Parity forumla that can be\nused to test the packaged executables without pushing a new version\nprematurely to users.\n\nDocumentation:\nhttps://github.com/Homebrew/homebrew/blob/master/s... | ruby | chosen |
[
{
"from": "system",
"value": "Fix Sphinx formula to pass --without-mysql if which fails to find mysqld\n\nSigned-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>\n"
},
{
"from": "human",
"value": "require 'formula'\n\nclass Sphinx <Formula\n url 'http://www.sphinxsea... | ruby | chosen |
[
{
"from": "system",
"value": "Change back 'Post' to 'Multipost' in TomDoc\n"
},
{
"from": "human",
"value": "module Jekyll\n class MultiPost < Post\n\n # Initialize this Post instance.\n #\n # site - The Site.\n # base - The String path to the dir containing the post fil... | ruby | chosen |
[
{
"from": "system",
"value": "Configure apt before moving on\n"
},
{
"from": "human",
"value": "#\n# Cookbook Name:: desktop\n# Recipe:: default\n#\n# Copyright 2015, Andrew Jones\n#\n# All rights reserved - Do Not Redistribute\n#\n\n# apt\ninclude_recipe 'apt'\n\n# Hardware.\ninclude_recipe 'de... | ruby | chosen |
[
{
"from": "system",
"value": "Add Showcaser processor jobs onto a queue\n"
},
{
"from": "human",
"value": "# \n# SHOWCASER\n#\n# Make a large photo\n# Watermark it\n# \nmodule Processors\n class Showcaser\n extend Resque::Plugins::HerokuAutoscaler\n \n class << self\n def perform ... | ruby | chosen |
[
{
"from": "system",
"value": "Sort photos on index in reverse order\n"
},
{
"from": "human",
"value": "class PhotosController < ApplicationController\n def index\n @photos = Photo.all\n end\n\n def new\n @photo = Photo.new\n end\n\n def create\n @grad_years = params[:photo][:grad_y... | ruby | chosen |
[
{
"from": "system",
"value": "Add a comment for future reference\n"
},
{
"from": "human",
"value": "class SearchController < ApplicationController\n before_action :beautify_url, only: [:show]\n layout \"simple\"\n\n def show\n @posts = Post.search(params[:q]).records.to_a\n @users = Use... | ruby | chosen |
[
{
"from": "system",
"value": "Add `**/*` only for the path which has one or more children of directory\n"
},
{
"from": "human",
"value": "module Compath\n class Guide\n extend Forwardable\n\n def_delegators :@pathname, :directory?, :executable?, :to_path\n attr_reader :pathname, :scan_... | ruby | chosen |
[
{
"from": "system",
"value": "Allow the user to specify a directory for the list command\n"
},
{
"from": "human",
"value": "require 'thor'\nrequire 'pathname'\n\nmodule Findrepos\n class CLI < Thor\n desc 'list', 'lists all Git repositories in the current directory'\n option :recursive,\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add Google Calendar API Errors\n\nSigned-off-by: Bonghyun Kim <fbc2a31a9a8531983f3717da27fe00fe3b544a20@gmail.com>\n"
},
{
"from": "human",
"value": "module Google\n class HTTPRequestFailed < StandardError; end\n class HTTPAuthorizationFailed < StandardError; end\... | ruby | chosen |
[
{
"from": "system",
"value": "Use the new help@rubygems.org address instead of donotreply\n"
},
{
"from": "human",
"value": "Clearance.configure do |config|\n config.mailer_sender = \"donotreply@rubygems.org\"\n config.secure_cookie = true unless Rails.env.test? || Rails.env.development?\n co... | ruby | chosen |
[
{
"from": "human",
"value": "Patch Sidekiq adapter to Rails 5 behavior\n"
},
{
"from": "gpt",
"value": "# Patch ActiveJob Sidekiq adapter to Rails 5 behavior\n# THIS IS BAD. REMOVE WHEN UPDATING TO RAILS 5!\n\nActiveJob::QueueAdapters::SidekiqAdapter.class_eval do\n class << self\n\n def enq... | ruby | chosen |
[
{
"from": "system",
"value": "Allow asset CORS from all origins.\n"
},
{
"from": "human",
"value": "if defined? Rack::Cors\n Rails.configuration.middleware.insert_before 0, Rack::Cors do\n allow do\n origins Rails.application.secrets.host\n resource '/assets/*'\n end\n end\... | ruby | chosen |
[
{
"from": "system",
"value": "Allow .yml as an extension for YAML files.\n\nWithout this patch, only files ending in .yaml will be checked. This\nallows files to also end with .yml.\n"
},
{
"from": "human",
"value": "require \"puppet-syntax/version\"\nrequire \"puppet-syntax/manifests\"\nrequire... | ruby | chosen |
[
{
"from": "human",
"value": "Add a task to change email-like usernames\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\nnamespace :users do\n desc 'Renames users with email-like usernames'\n task remove_email_like_usernames: :environment do\n target = User.where(\"username ... | ruby | chosen |
[
{
"from": "system",
"value": "Support to show Atom feed\n"
},
{
"from": "human",
"value": "module Yomou\n module Atomapi\n\n class Atom < Thor\n\n desc \"allnovel\", \"\"\n def allnovel\n end\n\n desc \"user USER_ID\", \"\"\n def user(user_id)\n end\n\n end\n... | ruby | chosen |
[
{
"from": "system",
"value": "Use next instead of return\n"
},
{
"from": "human",
"value": "require 'sinatra/base'\nrequire 'json'\n\nrequire_relative './logging.rb'\nrequire_relative './error.rb'\n\nrequire_relative './calculatorrouter.rb'\nrequire_relative './calculatorloader.rb'\n\nclass Calc... | ruby | chosen |
[
{
"from": "system",
"value": "Include into AR outside of mixin file so it can be tested"
},
{
"from": "human",
"value": "require \"dirty_history/version\"\nrequire \"active_record\"\n\n$LOAD_PATH.unshift(File.dirname(__FILE__))\n\nautoload :DirtyHistoryRecord, \"dirty_history/dirty_history_recor... | ruby | chosen |
[
{
"from": "system",
"value": "Create an empty Server.setup! method.\n\nThis method will hold the business logic for bootstrapping within Sinatra.\n"
},
{
"from": "human",
"value": "# lib/frecon/server.rb\n#\n# Copyright (C) 2014 Christopher Cooper, Sam Craig, Tiger Huang, Vincent Mai, Sam Mercie... | ruby | chosen |
[
{
"from": "system",
"value": "Correct URL for cancelling order\n"
},
{
"from": "human",
"value": "module Gemini\n module Orders\n def self.create(options = {})\n Gemini.sanity_check!\n result = Gemini::Net.post(\"/v1/order/new\", options)\n Gemini::Order.new(JSON.parse(result)... | ruby | chosen |
[
{
"from": "system",
"value": "Fix environment in cron tab.\n"
},
{
"from": "human",
"value": "# Use this file to easily define all of your cron jobs.\n\nset :output, File.join(File.expand_path(File.dirname(__FILE__)),\"..\", \"log\", \"cron_log.log\")\n\njob_type :rake, \"cd :path && RAI... | ruby | chosen |
[
{
"from": "human",
"value": "Add basic authentication information in order to be able to interact with the Github API\n"
},
{
"from": "gpt",
"value": "#This uses the Github API wrapped in the github_api gem.\n#Authentication data has been figured out and is the basic stuff below.\n#For more info... | ruby | chosen |
[
{
"from": "system",
"value": "Call the right Process class.\n"
},
{
"from": "human",
"value": "module ChildProcess\n module Unix\n class Process < AbstractProcess\n\n def stop(timeout = 3)\n assert_started\n send_term\n\n begin\n return poll_for_exit(timeou... | ruby | chosen |
[
{
"from": "system",
"value": "Remove uneeded links method from Craigslister\n"
},
{
"from": "human",
"value": "# Thrown when low price is higher than high price\nclass InvalidRangeError < StandardError\nend\n\n# Creates url from arguments and scrapes\nclass Craigslister\n attr_reader :area, :it... | ruby | chosen |
[
{
"from": "system",
"value": "Add \"rdf\" and \"linkeddata\" as dependencies\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'semantology'\n s.version = '0.0.0'\n s.platform = Gem::Platform::RUBY\n s.date = '2014-07-20'\n s.summary = 'Tur... | ruby | chosen |
[
{
"from": "system",
"value": "Replace command references to account for deprecation warnings\n"
},
{
"from": "human",
"value": "describe 'Chaning validations into a commad' do\n include_context 'database'\n\n subject(:validator) { user_validator.new(attributes) }\n\n let(:user_attrs) do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Improve Feedback request mailer spec\n"
},
{
"from": "human",
"value": "require \"spec_helper\"\n\ndescribe FeedbackRequestMailer do\n\n let(:email) { ActionMailer::Base.deliveries.last }\n let(:session) { Fabricate(:sessions, title: \"HTML & CSS\") }\n let(:memb... | ruby | chosen |
[
{
"from": "system",
"value": "Test to make sure the generated file is not empty\n"
},
{
"from": "human",
"value": "require 'spec_helper'\ndescribe Species::DocumentsExport do\n describe :path do\n subject {\n Species::DocumentsExport.new({})\n }\n specify { subject.path.should == ... | ruby | chosen |
[
{
"from": "human",
"value": "Create a spec for Nymphia::DSL::Context::UseGateway\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe Nymphia::DSL::Context::UseGateway do\n subject(:use_gateway) { Nymphia::DSL::Context::UseGateway.new('context', 'name') }\n\n describe '.new' do\n... | ruby | chosen |
[
{
"from": "system",
"value": "Correct tabs to spaces in podspec.\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"RZPoseurWebView\"\n s.version = \"1.0\"\n s.summary = \"RZPoseurWebView is a library to simplify migrating from UIWebView to WKWebview.\"\n\n... | ruby | chosen |
[
{
"from": "human",
"value": "Test to see if QuickBackup works\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\n# Check to see if QuickBackup works\n# see http://wiki.joyent.com/jpc2/Joyent+Quickbackup+for+Percona+MySQL+Server\ndescribe command(\"quickbackup-percona backup\") do\n it {... | ruby | chosen |
[
{
"from": "system",
"value": "Remove autoload and require directly\n"
},
{
"from": "human",
"value": "require \"smbglobal_sms/version\"\nrequire \"smbglobal_sms/config\"\n\nautoload :Request, 'smbglobal_sms/request'\nautoload :Response, 'smbglobal_sms/response'\n\nSmbglobalSms.configure do |conf... | ruby | chosen |
[
{
"from": "human",
"value": "Add a simple script that can be used as an XMLRPC server for testing"
},
{
"from": "gpt",
"value": "require 'xmlrpc/server'\nrequire 'pp'\n\nserver = XMLRPC::Server.new(8080)\n\nserver.add_handler('postTopic') do |options|\n puts '-' * 50\n puts 'postTopic received... | ruby | chosen |
[
{
"from": "system",
"value": "Test helper to set a project\n"
},
{
"from": "human",
"value": "require 'coveralls'\nCoveralls.wear!\nENV[\"RAILS_ENV\"] = \"test\"\nrequire File.expand_path('../../config/environment', __FILE__)\nrequire 'rails/test_help'\nrequire 'capybara/rails'\nrequire 'capybar... | ruby | chosen |
[
{
"from": "system",
"value": "Use bundler to load things for test helper.\n"
},
{
"from": "human",
"value": "require 'bundler'\nBundler.require\n\n$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\nrequire 'secondbase'\n\nrequire 'minitest/autorun'\n"
},
{
"from": "gpt",
"... | ruby | chosen |
[
{
"from": "system",
"value": "Add method comment to true() method\n"
},
{
"from": "human",
"value": "module Sisimai\n module Reason\n # Sisimai::Reason::SystemFull checks the bounce reason is \"systemfull\" or\n # not. This class is called only Sisimai::Reason class.\n #\n # This is... | ruby | chosen |
[
{
"from": "system",
"value": "Make this a non-primary command.\n\nThis mirrors the other rsync commands.\n"
},
{
"from": "human",
"value": "begin\n require \"vagrant\"\nrescue LoadError\n raise \"The Vagrant gatling rsync plugin must be run within Vagrant.\"\nend\n\n# This is a sanity check to... | ruby | chosen |
[
{
"from": "system",
"value": "Create contrib dir if does not exist.\n"
},
{
"from": "human",
"value": "# Rake tasks for Core DB\n#\n# include in Rakefile via:\n#\n# require 'vault-tools/core_db_tasks'\n\ndesc \"Pull db/structure.sql from api HEAD\"\ntask :pull_core do\n steps = []\n steps << '... | ruby | chosen |
[
{
"from": "system",
"value": "Change owner of persistent storage dir\n"
},
{
"from": "human",
"value": "node ||= {\n \"rbenv\" => {\n \"versions\" => [ \"2.2.1\", \"2.2.2\" ],\n \"local\" => \"2.2.2\",\n \"gems\" => [ \"bundler\", \"rake\" ],\n \"user\" => \"vagrant\",\n \"rbenv_... | ruby | chosen |
[
{
"from": "system",
"value": "Add plugin type metadata and bump version to 0.0.3.\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |spec|\n spec.name = \"lita-youtube\"\n spec.version = \"0.0.2\"\n spec.authors = [\"Jimmy Cuadra\"]\n spec.email = [\"j... | ruby | chosen |
[
{
"from": "system",
"value": "Fix the .episode() method too.\n"
},
{
"from": "human",
"value": "module Imdb\n class Season\n attr_accessor :id, :url, :season_number, :episodes\n\n def initialize(url)\n @url = url\n @season_number = @url.scan(/episodes\\?season=(\\d+)/).flatten.f... | ruby | chosen |
[
{
"from": "system",
"value": "Fix code with new arg names\n"
},
{
"from": "human",
"value": "module Lexhub\n class Base\n private\n def _collect(collection_method, api_method)\n results = []\n\n response(api_method).each_page do |page|\n results += page.collect(&collectio... | ruby | chosen |
[
{
"from": "system",
"value": "Add documentation to the Show model.\n"
},
{
"from": "human",
"value": "# A class to hold the data for a Show, woah\n\nclass Show\n attr_reader :title, :url, :rss, :aliases\n\n def initialize(json_hash)\n @title = json_hash[\"title\"]\n @url = json_hash[\"ur... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"removed the accessors for ReUser::Role\"\n\nThis reverts commit 81c81ae7741e48cf4f49676dabc3d9e2175f2f62.\n"
},
{
"from": "human",
"value": "module ReUser\n class Role\n def initialize name, permissions=[]\n @name = name\n @permissions = {}\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update development dependencies and load entire lib file\n\nChanges:\n- Remove version requirements for old versions of bundler and rake\n- Target Rails 4.2 (for now)\n- Remove rcov because of build error (see\nhttps://github.com/relevance/rcov/issues/99)\n"
},
{
"from"... | ruby | chosen |
[
{
"from": "system",
"value": "[SPEC] Fix code coverage reporting: Re-enable Coveralls\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n# frozen_string_literal: true\n\n%w{\n simplecov\n coveralls\n}.each { |f| require f }\n\nSimpleCov.formatters << SimpleCov::Formatter::HTMLFormatter\nSim... | ruby | chosen |
[
{
"from": "system",
"value": "Automate const removal in specs\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nrequire 'rom'\nrequire 'rom/adapter/memory'\nrequire 'rom/adapter/sequel'\nrequire 'rom/adapter/mongo'\n\ninclude ROM\n\nif defined? JRUBY_VERSION\n USING_JRUBY = true\nelse\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix issues with running tests locally\n\nBecause spree_social is an engine, before you run tests, you need to run\n`rake test_app`. This will generate a dummy Rails app located in\n`spec/dummy` that is used to initialize the engine. The problem is, this\napp doesn't seem to be ... | ruby | chosen |
[
{
"from": "system",
"value": "Clear out all timestamps before running tests\n"
},
{
"from": "human",
"value": "require 'rails/all'\n\nrequire 'shoulda/matchers'\nrequire 'rspec/rails'\nrequire 'faker'\nrequire 'pry'\n\nrequire 'netsuite_rails'\n\nDir[File.join(File.dirname(__FILE__), \"support/*... | ruby | chosen |
[
{
"from": "system",
"value": "Remove pry require from spec helper.\n"
},
{
"from": "human",
"value": "$LOAD_PATH.unshift(File.dirname(__FILE__))\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'support'))\n\nrequire 'rubyg... | ruby | chosen |
[
{
"from": "system",
"value": "Add lib to spec load path\n"
},
{
"from": "human",
"value": "# This file was generated by the `rspec --init` command. Conventionally, all\n# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.\n# Require this file using `require \"spec_helper\... | ruby | chosen |
[
{
"from": "system",
"value": "Change the approach of Myaso loading because of SimpleCov nuances [ci skip]\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nrequire 'rubygems'\n\nrequire 'tokyocabinet'\nrequire 'active_record'\n\n$:.unshift File.expand_path('../../lib', __FILE__)\n\nrequire... | ruby | chosen |
[
{
"from": "system",
"value": "Use our standard spec helper\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n"
},
{
"from": "human",
"value": "require 'chefspec'\nrequire 'chefspec/berkshelf'\n\nRSpec.configure do |config|\n config.color = true\n config.log_level ... | ruby | chosen |
[
{
"from": "system",
"value": "Use a default middleman application"
},
{
"from": "human",
"value": "require 'rspec'\n\nRSpec.configure do |config|\n config.expect_with :rspec do |c|\n c.syntax = :expect\n end\n\n config.filter_run focus: true\n config.run_all_when_everything_filtered = tru... | ruby | chosen |
[
{
"from": "system",
"value": "Add actionview-encoded_mail_to dependency for email :encode option drop from Rails 4.0+\n"
},
{
"from": "human",
"value": "# Encoding: UTF-8\n\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'refinerycms-retailers... | ruby | chosen |
[
{
"from": "system",
"value": "Add fallback OAuth ID and secret\n\nThis commit adds a fallback OAuth ID and secret. This will allow the signon-munging script for development to configure signon for this app locally."
},
{
"from": "human",
"value": "GDS::SSO.config do |config|\n config.user_model... | ruby | chosen |
[
{
"from": "system",
"value": "Change polling interval 5sec -> 1sec\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nnamespace = ENV.fetch('REDIS_NAMESPACE') { nil }\nredis_params = { url: ENV['REDIS_URL'] }\n\nif namespace\n redis_params [:namespace] = namespace\nend\n\nSidek... | ruby | chosen |
[
{
"from": "system",
"value": "Decrease Unicorn workers from 5 to 4\n\n...because we got some out of memory errors in production:\n\n E, [2014-12-23T07:41:25.036177 #28797] ERROR -- : Cannot allocate memory\n - fork(2) (Errno::ENOMEM)\n"
},
{
"from": "human",
"value": "set :stage, :production... | ruby | chosen |
[
{
"from": "system",
"value": "Remove puts. Use new .nick accessor\n"
},
{
"from": "human",
"value": "module DrugBot\n module Plugin\n module Helpers\n DEFAULT_MATCH_OPTIONS = { :position => 1 }\n\n def on_channel?(message)\n message[:channel]\n end\n\n def match?(m... | ruby | chosen |
[
{
"from": "system",
"value": "Allow to update player's name.\n"
},
{
"from": "human",
"value": "class Players::RegistrationsController < Devise::RegistrationsController\n def new\n @page_id = :sign_up\n super\n end\n\n def create\n param = sign_up_params\n team_id = param.delete(:... | ruby | chosen |
[
{
"from": "system",
"value": "Fix ActiveModel::ForbiddenAttributesError in dummy app\n"
},
{
"from": "human",
"value": "class EntriesController < ApplicationController\n unit_action :entry_deletion, :destroy\n\n def index\n invoke(:entry_deletion, :index) do\n @entries = Entry.all\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update summary and homepage in gemspec\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'govuk/client/url_arbiter/version'\n\nGem::Specification.new do |s... | ruby | chosen |
[
{
"from": "system",
"value": "Fix test suite for robot-name excercise\n"
},
{
"from": "human",
"value": "require 'minitest/autorun'\nrequire_relative 'robot'\n\nclass RobotTest < Minitest::Test\n def test_has_name\n # rubocop:disable Lint/AmbiguousRegexpLiteral\n assert_match /^[A-Z]{2}\\... | ruby | chosen |
[
{
"from": "system",
"value": "Add gem info and dependencies\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rack/attack/recaptcha/version'\n\nGem::Specification.new do |spec|\n spec... | ruby | chosen |
[
{
"from": "system",
"value": "Comment bodies should be text, not varchar"
},
{
"from": "human",
"value": "class AddQuestionComments < ActiveRecord::Migration\n def up\n create_table :question_comments do |t|\n t.integer :id\n t.integer :question_id\n t.integer :creator_i... | ruby | chosen |
[
{
"from": "system",
"value": "Make PromotionItemHandler have pluggable behaviour\n"
},
{
"from": "human",
"value": "module Spree\n class PromotionItemHandlers\n attr_reader :line_item, :order\n\n def initialize(line_item)\n @line_item, @order = line_item, line_item.order\n end\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Use include to make the functions available in rails apps by default\n"
},
{
"from": "human",
"value": "# db access is cached <-> only first lookup hits the db\nrequire \"fast_gettext\"\nrequire \"fast_gettext/translation_repository/db\"\nFastGettext.default_text_do... | ruby | chosen |
[
{
"from": "system",
"value": "Make use of secure session cookies\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.session_store :cookie_store, key: '_openpprn-backend_session'\n"
},
{
"from": "gpt",
"value": "#... | ruby | chosen |
[
{
"from": "system",
"value": "Make skipped specs fail if aliases are broken\n\nPreviously, skip aliases would error if they were not defined. This\nchange ensures that skipped specs will fail if, for some reason,\nskip aliases are overwritten but not undefined.\n"
},
{
"from": "human",
"value": ... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure to use the right connection string in case of JRuby.\n"
},
{
"from": "human",
"value": "describe Metacrunch::Db::Reader do\n\n DB_URL = \"sqlite://#{File.join(asset_dir, \"dummy.sqlite\")}\"\n\n describe \"#each\" do\n subject { Metacrunch::Db::Reader... | ruby | chosen |
[
{
"from": "system",
"value": "Add validation to require password and email. Add method to return average grade as 2 decimal places\n"
},
{
"from": "human",
"value": "class User < ApplicationRecord\n\thas_secure_password\n\n\thas_many :searches\n\thas_many :products, through: :searches\n\thas_man... | ruby | chosen |
[
{
"from": "system",
"value": "Add callbacks to invalidate cache and set premium\n"
},
{
"from": "human",
"value": "class Developer < ApplicationRecord\n devise :database_authenticatable, :trackable, :validatable, :omniauthable\n store_accessor :data, :html_url, :avatar_url, :company, :blog,\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use ruby conventions on param name\n"
},
{
"from": "human",
"value": "require 'open3'\nrequire 'thread'\nrequire 'httparty'\nrequire 'appium_lib'\nrequire 'yaml'\nrequire_relative 'mock_backend/mock_backend'\nrequire_relative '../step_definitions/screen_factory'\n\n... | ruby | chosen |
[
{
"from": "human",
"value": "Add checksums and sandbox_checksums tables\n"
},
{
"from": "gpt",
"value": "require File.expand_path('../settings', __FILE__)\n\nSequel.migration do\n up do\n create_table(:checksums) do\n String(:org_id, :null => false, :fixed => true, :size => 32)\n S... | ruby | chosen |
[
{
"from": "system",
"value": "Fix compilation to have a universal lib\n"
},
{
"from": "human",
"value": "package :yaml_cpp do |yaml|\n yaml.download = \"http://yaml-cpp.googlecode.com/files/yaml-cpp-0.2.6.tar.gz\"\n yaml.download_to = \"yaml-cpp-0.2.6.tar.gz\"\n\n yaml.unpack = \"tar jxvf\"\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add dev dependency 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 'github_lda/version'\n\nGem::Specification.new do |gem|\n gem.na... | ruby | chosen |
[
{
"from": "system",
"value": "Use config.gem to depend on factory_girl.\n"
},
{
"from": "human",
"value": "require 'factory_girl'\n\n%w(test spec).each do |dir|\n factories = File.join(RAILS_ROOT, dir, 'factories.rb')\n require factories if File.exists?(factories)\n Dir[File.join(RAILS_ROOT, ... | ruby | chosen |
[
{
"from": "system",
"value": "Update HandBrakeCLI Nightly to v6430svn\n\nHandBrakeCLI Nightly Build 6430svn released 2014-10-02.\n"
},
{
"from": "human",
"value": "class HandbrakecliNightly < Cask\n version '6419svn'\n sha256 '3fcd67ddda23ba406789f0f00c9d501fd85a6c6348385ba6da8550db0fcfefb2'\n... | ruby | chosen |
[
{
"from": "system",
"value": "Update HandbrakeCLI Nightly to v6897svn\n\nHandBrakeCLI Nightly v6897svn built 2015-02-13.\n"
},
{
"from": "human",
"value": "cask :v1 => 'handbrakecli-nightly' do\n version '6859svn'\n sha256 '656a716c4c75d325cdfda874db4215ba280355b672c6f19ae5dd01325955d5af'\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Set source as queue name."
},
{
"from": "human",
"value": "module Collective::Collectors\n class RabbitMQ < Collective::Collector\n requires :faraday\n requires :faraday_middleware\n requires :json\n\n collect do\n instrument_overview\n instru... | ruby | chosen |
[
{
"from": "system",
"value": "Reduce carto db uploader instance number\n"
},
{
"from": "human",
"value": "class Wdpa::CartoDbImporter\n def self.import wdpa_release\n importer = new(wdpa_release)\n importer.import\n end\n\n def initialize wdpa_release\n @wdpa_release = wdpa_release\n... | ruby | chosen |
[
{
"from": "system",
"value": "Remove boxen-latest and boxen-install in favour of Homebrew\n"
},
{
"from": "human",
"value": "require \"spec_helper\"\n\ndescribe \"homebrew\" do\n let(:facts) { default_test_facts }\n\n let(:dir) { facts[:homebrew_root] }\n let(:cmddir) { \"#{dir}/Library/Taps/... | ruby | chosen |
[
{
"from": "system",
"value": "Use bosh ssh wrapper in nginx deployment test\n\n- This spec file is not included in any rake task, is it an orphan?\n\n[#145917557]\n"
},
{
"from": "human",
"value": "require 'system_spec_helper'\n\ndescribe 'nginx' do\n describe 'configuration' do\n let(:bucke... | ruby | chosen |
[
{
"from": "system",
"value": "Refresh user's model in variables migration [SCI-2864]\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass AddVariablesToUsers < ActiveRecord::Migration[5.1]\n VARIABLES = {\n export_vars: {\n num_of_export_all_last_24_hours: 0\n }... | ruby | chosen |
[
{
"from": "system",
"value": "Add search class method for Question.\n"
},
{
"from": "human",
"value": "class Question < ActiveRecord::Base\n belongs_to :user\n has_many :answers\n\n validates_presence_of :body\n validates_presence_of :title\nend"
},
{
"from": "gpt",
"value": "cla... | ruby | chosen |
[
{
"from": "system",
"value": "Add extra spaces in DirectionMatrix spec\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'direction_matrix'\n\ndescribe DirectionMatrix do\n it 'provides a method for each direction' do\n expect(described_class.north).to eq [0,1]\n expect(de... | ruby | chosen |
[
{
"from": "system",
"value": "Fix test destroy and replace methods with aliases\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire 'spec_helper'\n\ndescribe 'RRJ::RRJ' do\n describe '.message_template_ask' do\n let(:transaction) { RRJ::RRJ.new }\n\n let(:request_i... | ruby | chosen |
[
{
"from": "system",
"value": "Fix another small bug in friendly_id for Tips\n\nApparently the condition for generating new slugs was reversed.\n"
},
{
"from": "human",
"value": "class Tip < ActiveRecord::Base\n extend FriendlyId\n friendly_id :title_and_username, use: :slugged\n\n belongs_to ... | ruby | chosen |
[
{
"from": "human",
"value": "Add script to generate a TOC based for markdown files\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\n\n# Source: https://gist.github.com/albertodebortoli/9310424\n# Via: http://stackoverflow.com/a/22131019/873282\n\nFile.open(\"Code-Howtos.md\", 'r') do |f|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use older `rake` version for Travis tests.\n"
},
{
"from": "human",
"value": "source \"https://rubygems.org\".freeze\n\ngem \"codeclimate-test-reporter\".freeze\ngem \"json\".freeze, \"~> 1.8.3\".freeze\ngem \"rake\".freeze\ngem \"rspec\".freeze\ngem \"simplecov\".f... | ruby | chosen |
[
{
"from": "system",
"value": "Remove allowed_push_host definition in gemspec\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'gemologist/version'\n\nGem::Specification.new do |spec|\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix migration to run when no tax category set on product.\n"
},
{
"from": "human",
"value": "class MigrateTaxCategoriesToLineItems < ActiveRecord::Migration\n def change\n \tSpree::LineItem.includes(:variant => { :product => :tax_category }).find_in_batches do |li... | ruby | chosen |
[
{
"from": "system",
"value": "Upgrade to latest version of instrumental_agent.\n"
},
{
"from": "human",
"value": "$: << \"./lib\"\nrequire 'instrumental_tools/version'\n\nGem::Specification.new do |s|\n s.name = \"instrumental_tools\"\n s.version = Instrumental::Tools::VERSION\n s.... | ruby | chosen |
[
{
"from": "human",
"value": "Update all pa-ur locales to pa-pk, and republish\n"
},
{
"from": "gpt",
"value": "translations = Edition::Translation.where(locale: \"pa-ur\")\n\ndocument_ids = Edition.distinct.where(id: translations.select(:edition_id)).pluck(:document_id)\n\ntranslations.update_al... | ruby | chosen |
[
{
"from": "system",
"value": "Change to allow for default value, add docs.\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nmodule FiniteMachine\n\n # A mixin to allow instance methods to be synchronized\n module Threadable\n module InstanceMethods\n @@sync = Sync.new\n\n d... | ruby | chosen |
[
{
"from": "system",
"value": "Update output compiler to match AST output"
},
{
"from": "human",
"value": "require \"dry-data\"\n\nmodule Formalist\n class OutputCompiler\n FORM_TYPES = %w[\n bool\n date\n date_time\n decimal\n float\n int\n time\n ].free... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.