diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/admin_request_controller_spec.rb +++ b/spec/controllers/admin_request_controller_spec.rb @@ -0,0 +1,17 @@+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe AdminRequestController do + + describe 'POST generate_upload_url' do + + it 'creates a user for the authority with a dummy date of birth' do + user = FactoryGirl.create(:user, :dob => '2/2/2000') + info_request = FactoryGirl.create(:info_request, :user => user) + post :generate_upload_url, :id => info_request.id + user = User.where(:email => info_request.public_body.request_email).first + expect(user.dob).to eq(Date.new(1900, 1, 1 )) + end + + end + +end
Add spec for generate_upload_url override.
diff --git a/wallpapering.gemspec b/wallpapering.gemspec index abc1234..def5678 100644 --- a/wallpapering.gemspec +++ b/wallpapering.gemspec @@ -18,4 +18,5 @@ gem.require_paths = ["lib"] gem.add_development_dependency "rspec" + gem.add_development_dependency "rake" end
Add rake to the bundle for travis
diff --git a/test/controllers/static_pages_controller_test.rb b/test/controllers/static_pages_controller_test.rb index abc1234..def5678 100644 --- a/test/controllers/static_pages_controller_test.rb +++ b/test/controllers/static_pages_controller_test.rb @@ -11,4 +11,9 @@ assert_response :success end + test "should get about" do + get static_pages_about_url + assert_response :success + end + end
Add the test for About page
diff --git a/core/features/support/paths.rb b/core/features/support/paths.rb index abc1234..def5678 100644 --- a/core/features/support/paths.rb +++ b/core/features/support/paths.rb @@ -1,11 +1,5 @@ module NavigationHelpers - class RoutesProxy - include Rails.application.routes.url_helpers - end - - def spree_core - ActionDispatch::Routing::RoutesProxy.new(Spree::Core::Engine.routes, RoutesProxy.new) - end + include Spree::Core::Engine.routes.url_helpers # Maps a name to a path. Used by the # @@ -16,13 +10,13 @@ def path_to(page_name) case page_name when /the home\s?page/ - spree_core.root_path + root_path when /the admin home page/ - spree_core.admin_path + admin_path when /the sign in page/ - spree_core.new_user_session_path + new_user_session_path when /the sign up page/ - spree_core.new_user_registration_path + new_user_registration_path when /an invalid taxon page/ "/t/totally_bogus_taxon"
[core] Include Spree::Core::Engine.routes.url_helpers rather than use custom RoutesProxy
diff --git a/backend/spec/features/admin/configuration/countries_spec.rb b/backend/spec/features/admin/configuration/countries_spec.rb index abc1234..def5678 100644 --- a/backend/spec/features/admin/configuration/countries_spec.rb +++ b/backend/spec/features/admin/configuration/countries_spec.rb @@ -1,10 +1,10 @@ require 'spec_helper' module Spree - describe "Countries", :type => :feature do + describe "Countries", type: :feature do stub_authorization! - it "deletes a state", js: true do + it "deletes a country", js: true do visit spree.admin_countries_path click_link "New Country" @@ -15,9 +15,8 @@ accept_alert do click_icon :trash end - wait_for_ajax - expect { Country.find(country.id) }.to raise_error + expect(page).to have_content 'Country "Brazil" has been successfully removed!' end end end
Fix bad admin country spec. Wasn't actually testing anything before.
diff --git a/core/app/controllers/users/setup_controller.rb b/core/app/controllers/users/setup_controller.rb index abc1234..def5678 100644 --- a/core/app/controllers/users/setup_controller.rb +++ b/core/app/controllers/users/setup_controller.rb @@ -20,11 +20,11 @@ @user = interactor(:'accounts/setup', user: current_user, attribuutjes: params[:user]) - if @user.errors.empty? + if @user.changed? + render 'users/setup/edit' + else sign_in @user, bypass: true # http://stackoverflow.com/questions/4264750/devise-logging-out-automatically-after-password-change redirect_to '/' - else - render 'users/setup/edit' end end
Check if the user still has changed records (save failed) instead of whether it has errors per @markijbema
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index abc1234..def5678 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -6,15 +6,7 @@ respond_to :html, :json, :js def index - ap @user.subscribed_channels - ap @user.subscribed_channels.to_json - - @subscribed_channels = @user.subscribed_channels.to_json - - ap @user.activity_stats - ap @user.activity_stats.to_json - @stats = @user.activity_stats.to_json end
Revert "Added debugging calls to the events controller" This reverts commit 2bb44728bb179f4f95242b01464402e10a2f2d98.
diff --git a/db/migrate/20141106195819_create_batch_jobs.rb b/db/migrate/20141106195819_create_batch_jobs.rb index abc1234..def5678 100644 --- a/db/migrate/20141106195819_create_batch_jobs.rb +++ b/db/migrate/20141106195819_create_batch_jobs.rb @@ -1,12 +1,12 @@ class CreateBatchJobs < ActiveRecord::Migration def change create_table :batch_jobs do |t| + t.references :job_type + t.references :ocr_engine t.string :parameters t.string :name t.string :notes t.references :font - t.references :ocr_engine - t.references :job_type end add_index :batch_jobs, :job_type_id
Set different order of columns created for batch_jobs to hopefully ease ability of importing data from legacy database
diff --git a/db/migrations/015_add_amount_paid_to_orders.rb b/db/migrations/015_add_amount_paid_to_orders.rb index abc1234..def5678 100644 --- a/db/migrations/015_add_amount_paid_to_orders.rb +++ b/db/migrations/015_add_amount_paid_to_orders.rb @@ -1,7 +1,7 @@ Sequel.migration do up do - add_column :orders, :amount_paid, Bignum + add_column :orders, :amount_paid, :Bignum end down do
Fix bug 'Unsupported ruby class used as database type: Bignum'
diff --git a/app/helpers/application_helper/button/cloud_volume_new.rb b/app/helpers/application_helper/button/cloud_volume_new.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper/button/cloud_volume_new.rb +++ b/app/helpers/application_helper/button/cloud_volume_new.rb @@ -13,8 +13,7 @@ # disable button if no active providers support create action def disabled? ExtManagementSystem.none? do |ems| - Module.const_defined?("#{ems.class}::CloudVolume") && - ems.class::CloudVolume.supports_create? + "#{ems.class}::CloudVolume".safe_constantize.try(:supports_create?) end end end
Fix CloudVolume constantization issues by using try/safe_constantize
diff --git a/spec/support/matchers/flash_message_matchers.rb b/spec/support/matchers/flash_message_matchers.rb index abc1234..def5678 100644 --- a/spec/support/matchers/flash_message_matchers.rb +++ b/spec/support/matchers/flash_message_matchers.rb @@ -0,0 +1,31 @@+RSpec::Matchers.define :have_flash_message do |message| + match do |node| + @message, @node = message, node + + # Ignore leading and trailing whitespace. Later versions of Capybara have :exact_text option. + # The :exact option is not supported in has_selector?. + message_substring_regex = substring_match_regex(message) + node.has_selector?(".flash", text: message_substring_regex, visible: false) + end + + failure_message do |actual| + "expected to find flash message ##{@message}" + end + + match_when_negated do |node| + @message, @node = message, node + + # Ignore leading and trailing whitespace. Later versions of Capybara have :exact_text option. + # The :exact option is not supported in has_selector?. + message_substring_regex = substring_match_regex(message) + node.has_no_selector?(".flash", text: message_substring_regex, visible: false) + end + + failure_message_when_negated do |actual| + "expected not to find flash message ##{@message}" + end + + def substring_match_regex(text) + /\A\s*#{Regexp.escape(text)}\s*\Z/ + end +end
Add RSpec matchers for flash messages
diff --git a/watirspec.rake b/watirspec.rake index abc1234..def5678 100644 --- a/watirspec.rake +++ b/watirspec.rake @@ -1,9 +1,9 @@ begin - require 'spec' + require 'rspec' rescue LoadError begin require 'rubygems' - require 'spec' + require 'rspec' rescue LoadError puts <<-EOS To use rspec for testing you must install rspec gem: @@ -13,11 +13,11 @@ end end -require 'spec/rake/spectask' +require 'rspec/core/rake_task' namespace :watirspec do desc "Run the specs under #{File.dirname(__FILE__)}" - Spec::Rake::SpecTask.new(:run) do |t| - t.spec_files = FileList["#{File.dirname(__FILE__)}/*_spec.rb"] + RSpec::Core::RakeTask.new(:run) do |t| + t.pattern = "#{File.dirname(__FILE__)}/*_spec.rb" end end @@ -44,5 +44,4 @@ end puts "\nYou're now accessing watirspec via the anonymous URL." end - end
Fix the rakefile for RSpec 2.
diff --git a/db/migrate/20220716230622_add_unique_index_to_user_email.rb b/db/migrate/20220716230622_add_unique_index_to_user_email.rb index abc1234..def5678 100644 --- a/db/migrate/20220716230622_add_unique_index_to_user_email.rb +++ b/db/migrate/20220716230622_add_unique_index_to_user_email.rb @@ -0,0 +1,12 @@+class AddUniqueIndexToUserEmail < ActiveRecord::Migration[5.2] + def change + # remove duplicate emails + query = "SELECT email, COUNT(id) FROM users WHERE email IS NOT NULL AND email != '' group by email HAVING COUNT(id) > 1" + emails = ApplicationRecord.connection.execute(query).to_a.collect{|u| u['email']} + emails.delete_if{ |e| e.blank? } + User.where(email: emails).where('last_active_at IS NULL').destroy_all + # add uniq index + remove_index :users, name: "index_users_on_email" + add_index :users, :email, unique: true, where: "email IS NOT NULL AND email != ''" + end +end
Revert "Removing migration that failed on live" This reverts commit cca0269c7bb5ebbc0122b1e0a3777d46927686f3.
diff --git a/ruby/gps2_2.rb b/ruby/gps2_2.rb index abc1234..def5678 100644 --- a/ruby/gps2_2.rb +++ b/ruby/gps2_2.rb @@ -0,0 +1,29 @@+# Method to create a list +# create an empty hash +# input: string of items separated by spaces (example: "carrots apples cereal pizza") +# steps: + # separate the string into individual items + # add each item to the hash, set default quantity + # print the list to the console using a loop +# output: (hash), could also be a string with hash data inside + +# Method to add an item to a list +# input: item name and optional quantity +# steps: add the item name and quantity as a new pair into existing hash +# output: return hash + +# Method to remove an item from the list +# input: using a pre-existing hash method, give it the input of the key of the pair I want to delete +# steps: the method deletes it +# output: the updated hash + +# Method to update the quantity of an item +# input: hash of specific item now equals new quantity +# steps: the method updates the quantity +# output: returns the updated hash + +# Method to print a list and make it look pretty +# input: using a loop to iterate through each pair in the hash +# steps: tell it what to do with each pair (i.e. print it inside of this fancy string) +# output: each string with interpolated data, return nil? +
Update gps file with pseudocode
diff --git a/lib/heroku/deploy/tasks/stash_git_changes.rb b/lib/heroku/deploy/tasks/stash_git_changes.rb index abc1234..def5678 100644 --- a/lib/heroku/deploy/tasks/stash_git_changes.rb +++ b/lib/heroku/deploy/tasks/stash_git_changes.rb @@ -25,6 +25,10 @@ matched_stash = stashes.split("\n").find { |x| x.match @stash_name } label = matched_stash.match(/^([^:]+)/) + # Make sure there are no weird local changes (think db/schema.db changing + # because we ran migrations locally, and column order changing because postgres + # is crazy like that) + git "clean -fd" git "stash apply #{label}" git "stash drop #{label}" end
Clean the checked out directory before re-applying stashed changes.
diff --git a/app/helpers/host_aggregate_helper/textual_summary.rb b/app/helpers/host_aggregate_helper/textual_summary.rb index abc1234..def5678 100644 --- a/app/helpers/host_aggregate_helper/textual_summary.rb +++ b/app/helpers/host_aggregate_helper/textual_summary.rb @@ -16,7 +16,7 @@ def textual_hosts num = @record.number_of(:hosts) h = {:label => _('Hosts'), :icon => "pficon pficon-container-node", :value => num} - if num > 0 && role_allows?(:feature => "host_show_list") + if num.positive? && role_allows?(:feature => "host_show_list") h[:link] = url_for_only_path(:action => 'show', :id => @record, :display => 'hosts') h[:title] = _("Show all Hosts") end @@ -26,7 +26,7 @@ def textual_instances num = @record.number_of(:vms) h = {:label => _('Instances'), :icon => "pficon pficon-virtual-machine", :value => num} - if num > 0 && role_allows?(:feature => "vm_show_list") + if num.positive? && role_allows?(:feature => "vm_show_list") h[:link] = url_for_only_path(:action => 'show', :id => @record, :display => 'instances') h[:title] = _("Show all Instances") end
Fix rubocop warnings in HostAggregateHelper::TextualSummary
diff --git a/db/migrate/20090721135542_update_all_stream_items.rb b/db/migrate/20090721135542_update_all_stream_items.rb index abc1234..def5678 100644 --- a/db/migrate/20090721135542_update_all_stream_items.rb +++ b/db/migrate/20090721135542_update_all_stream_items.rb @@ -6,7 +6,7 @@ if defined?(Recipe) Recipe.all.each { |o| o.create_as_stream_item } end - Publication.all.each { |o| o.create_as_stream_item } + Publication.all.each { |o| o.create_as_stream_item } if defined?(Publication) NewsItem.all.each { |o| o.create_as_stream_item } Message.all( :conditions => 'person_id is not null and to_person_id is null and (wall_id is not null or group_id is not null)'
Fix migration when Publicaiton is not defined.
diff --git a/db/migrate/20101108134714_add_generation_to_stops.rb b/db/migrate/20101108134714_add_generation_to_stops.rb index abc1234..def5678 100644 --- a/db/migrate/20101108134714_add_generation_to_stops.rb +++ b/db/migrate/20101108134714_add_generation_to_stops.rb @@ -5,6 +5,7 @@ end def self.down - remove_column :stops, :generation + remove_column :stops, :generation_low + remove_column :stops, :generation_high end end
Fix down method to match up.
diff --git a/spec/controllers/heartbeat_controller_spec.rb b/spec/controllers/heartbeat_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/heartbeat_controller_spec.rb +++ b/spec/controllers/heartbeat_controller_spec.rb @@ -2,19 +2,19 @@ RSpec.describe HeartbeatController, type: :controller do - describe 'ping and heartbeat do not force ssl' do - before do - allow(Rails).to receive(:env).and_return(double(development?: false, production?: true)) + describe '#ping' do + describe 'does not force ssl' do + before do + allow(Rails).to receive(:env).and_return(double(development?: false, production?: true)) + end + + it 'ping the endpoint' do + get :ping + expect(response.status).not_to eq(301) + end + end - it 'ping endpoint' do - get :ping - expect(response.status).not_to eq(301) - end - - end - - describe '#ping' do it 'returns JSON with app information' do get :ping
Rephrase the test description and expectations
diff --git a/spec/lib/delta_test/cli/specs_command_spec.rb b/spec/lib/delta_test/cli/specs_command_spec.rb index abc1234..def5678 100644 --- a/spec/lib/delta_test/cli/specs_command_spec.rb +++ b/spec/lib/delta_test/cli/specs_command_spec.rb @@ -1,5 +1,59 @@ require 'delta_test/cli/specs_command' +require 'delta_test/related_spec_list' +require 'delta_test/stats' describe DeltaTest::CLI::SpecsCommand do + let(:command) { DeltaTest::CLI::SpecsCommand.new([]) } + + let(:related_spec_files) do + [ + 'spec/foo_spec.rb', + ] + end + + let(:base_commit) { '1111111111111111111111111111111111111111' } + + before do + allow($stdout).to receive(:puts).and_return(nil) + allow($stderr).to receive(:puts).and_return(nil) + + allow_any_instance_of(DeltaTest::RelatedSpecList).to receive(:load_table!).and_return(nil) + allow_any_instance_of(DeltaTest::RelatedSpecList).to receive(:retrive_changed_files!).and_return(nil) + allow_any_instance_of(DeltaTest::RelatedSpecList).to receive(:related_spec_files).and_return(related_spec_files) + + allow_any_instance_of(DeltaTest::Stats).to receive(:base_commit).and_return(base_commit) + end + + describe '#invoke!' do + + it 'should raise an error if a base commit does not exist' do + allow_any_instance_of(DeltaTest::Stats).to receive(:base_commit).and_return(nil) + + expect { + command.invoke! + }.to raise_error(DeltaTest::StatsNotFoundError) + end + + it 'should load a table file and retrive changed files' do + expect_any_instance_of(DeltaTest::RelatedSpecList).to receive(:load_table!).once + expect_any_instance_of(DeltaTest::RelatedSpecList).to receive(:retrive_changed_files!).once + + expect { + command.invoke! + }.not_to raise_error + end + + it 'should show a list of related spec files' do + expect_any_instance_of(DeltaTest::RelatedSpecList).to receive(:load_table!).once + expect_any_instance_of(DeltaTest::RelatedSpecList).to receive(:retrive_changed_files!).once + expect_any_instance_of(DeltaTest::RelatedSpecList).to receive(:related_spec_files).once + + expect { + command.invoke! + }.to output(/foo_spec\.rb/).to_stdout + end + + end + end
Write specs for specs command
diff --git a/spec/dummy/db/migrate/20130430210842_create_users.rb b/spec/dummy/db/migrate/20130430210842_create_users.rb index abc1234..def5678 100644 --- a/spec/dummy/db/migrate/20130430210842_create_users.rb +++ b/spec/dummy/db/migrate/20130430210842_create_users.rb @@ -2,10 +2,11 @@ class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| - t.string :name + t.string :name, null: false t.string :email t.timestamps null: false end + DbTextSearch::CaseInsensitive.add_index connection, :users, :display_name end end
Add an index to the demo app users.name
diff --git a/spec/system/drivers/editing_incidents_spec.rb b/spec/system/drivers/editing_incidents_spec.rb index abc1234..def5678 100644 --- a/spec/system/drivers/editing_incidents_spec.rb +++ b/spec/system/drivers/editing_incidents_spec.rb @@ -3,10 +3,17 @@ require 'spec_helper' describe 'editing incidents as a driver' do - it 'allows editing reports' do - end + let(:driver) { create :user, :driver} + before(:each){ when_current_user_is driver } + let(:report) { create :incident_report, user: driver } + let(:incident) { create :incident, incident_report: report } context 'admin deletes the incident' do it 'displays a nice error message' do + visit edit_incident_url(incident) + incident.destroy + click_button 'Save report' + wait_for_ajax! + expect(response.status).to eq 500 end end end
Remove dup tests (already in create), fill out issue scenario
diff --git a/spec/builder_examples.rb b/spec/builder_examples.rb index abc1234..def5678 100644 --- a/spec/builder_examples.rb +++ b/spec/builder_examples.rb @@ -1,4 +1,5 @@ require 'spec_helper' +require 'helpers/text' require 'helpers/wordlist' shared_examples_for "a wordlist Builder" do @@ -6,7 +7,7 @@ @words = ['dog', 'cat', 'catx', 'dat', 'dog', 'cat'] @sentence = 'dog cat catx, dog dat.' @text = 'dog cat: catx. dog cat dat dog.' - @file = File.expand_path(File.join(File.dirname(__FILE__),'text','sample.txt')) + @file = SAMPLE_TEXT end it "should build a unique wordlist from words" do
Use the text/ helper constants.
diff --git a/spec/models/list_spec.rb b/spec/models/list_spec.rb index abc1234..def5678 100644 --- a/spec/models/list_spec.rb +++ b/spec/models/list_spec.rb @@ -15,4 +15,13 @@ expect(@list.tasks.size).to eq(1) end + it "defaults to incomplete" do + expect(@list.incomplete?).to eq(true) + end + + it "can be complete" do + @list.status = "complete" + expect(@list.complete?).to eq(true) + end + end
Add status to list specs.
diff --git a/app/jobs/build_part_job.rb b/app/jobs/build_part_job.rb index abc1234..def5678 100644 --- a/app/jobs/build_part_job.rb +++ b/app/jobs/build_part_job.rb @@ -1,3 +1,5 @@+require 'webrick' + class BuildPartJob < JobBase attr_reader :build_part_result, :build_part, :build @@ -11,12 +13,13 @@ build_part_result.start! build_part_result.update_attributes(:builder => hostname) GitRepo.inside_copy('web-cache', build.sha, true) do - # TODO: - # collect stdout, stderr, and any logs + start_live_artifact_server result = tests_green? ? :passed : :failed build_part_result.finish!(result) collect_artifacts(BUILD_ARTIFACTS) end + ensure + kill_live_artifact_server end def tests_green? @@ -37,4 +40,25 @@ def hostname `hostname` end + + def start_live_artifact_server + pid = fork + if pid.nil? + begin + server = WEBrick::HTTPServer.new( + :Port => 55555, + :DocumentRoot => "log", + :FancyIndexing => true) + server.start + rescue Interrupt + server.stop + end + else + @artifact_server_pid = pid + end + end + + def kill_live_artifact_server + Process.kill("KILL", @artifact_server_pid) + end end
Add some pseudo-live artifact output
diff --git a/data.thor b/data.thor index abc1234..def5678 100644 --- a/data.thor +++ b/data.thor @@ -23,10 +23,6 @@ end # Fix keys with periods; they are not valid as BSON keys. - #doc_xml = doc_xml.gsub("j:LocationStateCode.USPostalService","j:LocationStateCode_USPostalService") - #doc_xml = doc_xml.gsub("j:EmploymentEmployer.Organization","j:EmploymentEmployer_Organization") - #doc_xml = doc_xml.gsub("j:Victim.Person","j:Victim_Person") - parser = Nori.new(parser: :nokogiri, advanced_typecasting: false, :convert_tags_to => lambda { |tag| tag.gsub("\.","_") }) doc = parser.parse(doc_xml)
Use Nori's built-in key transformations.
diff --git a/java/buildJavaProject.rb b/java/buildJavaProject.rb index abc1234..def5678 100644 --- a/java/buildJavaProject.rb +++ b/java/buildJavaProject.rb @@ -5,3 +5,10 @@ system 'mkdir -p ./bin' system 'javac -cp `echo $CLASSPATH`:./bin -d bin `find . -name "*.java"`' +# Copy resource files +resource_output = `find ./src -name '*.resource'` +resources = resource_output.split(' ') +resources.each do |resource| + system "cp --parents #{resource} bin/" +end +
Copy resource files in buildjavaproject.rb
diff --git a/app/models/message_task.rb b/app/models/message_task.rb index abc1234..def5678 100644 --- a/app/models/message_task.rb +++ b/app/models/message_task.rb @@ -4,8 +4,8 @@ PERMITTED_ATTRIBUTES = [:body, {participant_ids: []}] - has_many :comments, inverse_of: :message_task, foreign_key: 'task_id' - has_many :message_participants, inverse_of: :message_task, foreign_key: 'task_id' + has_many :comments, inverse_of: :message_task, foreign_key: 'task_id', dependent: :destroy + has_many :message_participants, inverse_of: :message_task, foreign_key: 'task_id', dependent: :destroy has_many :participants, through: :message_participants validates :participants, length: {minimum: 1}
Add dependent: :destroy to message task stuff.
diff --git a/app/models/neighborhood.rb b/app/models/neighborhood.rb index abc1234..def5678 100644 --- a/app/models/neighborhood.rb +++ b/app/models/neighborhood.rb @@ -14,13 +14,14 @@ return @addresses if @addresses.present? uri = address_source_uri + puts "Querying #{uri}" @addresses = JSON.parse(HTTParty.get(uri)) rescue @addresses = {} end def address_source_uri - URI::escape("http://dev-api.codeforkc.org//address-by-neighborhood/V0/#{name}?city=&state=mo") + URI::escape("http://dev-api.codeforkc.org/address-by-neighborhood/V0/#{name}?city=Kansas City&state=MO") end def within_polygon_query(location_attribute)
Fix the Neighborhood API Service Call
diff --git a/app/controllers/index.rb b/app/controllers/index.rb index abc1234..def5678 100644 --- a/app/controllers/index.rb +++ b/app/controllers/index.rb @@ -1,5 +1,5 @@ get '/' do - p "user_id #{session[:user_id]}" + p "user_id >> #{session[:user_id]}" if !session[:user_id] erb :index else
Add user_id report at route to keep track of during build.
diff --git a/app/models/system_role.rb b/app/models/system_role.rb index abc1234..def5678 100644 --- a/app/models/system_role.rb +++ b/app/models/system_role.rb @@ -1,6 +1,8 @@ class SystemRole - BASIC = 'basic' ADMIN = 'admin' + CONVENOR = 'convenor' + TUTOR = 'tutor' + STUDENT = 'student' - ROLES = [BASIC, ADMIN] + ROLES = [ADMIN, CONVENOR, TUTOR, STUDENT] end
Replace 'BASIC' role with Convenor, Tutor, and Student system roles.
diff --git a/ext/ryeppp/extconf.rb b/ext/ryeppp/extconf.rb index abc1234..def5678 100644 --- a/ext/ryeppp/extconf.rb +++ b/ext/ryeppp/extconf.rb @@ -19,5 +19,5 @@ if have_library('yeppp') create_makefile(extension_name) else - puts 'No yeppp! support available.' + puts 'No Yeppp! support available.' end
Fix the capitalization of Yeppp./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config && make && sudo make install
diff --git a/emcee.gemspec b/emcee.gemspec index abc1234..def5678 100644 --- a/emcee.gemspec +++ b/emcee.gemspec @@ -22,5 +22,5 @@ s.add_development_dependency "coffee-rails", "~> 4.0" s.add_development_dependency "sass", "~> 3.0" - s.add_development_dependency "sqlite3" + s.add_development_dependency "sqlite3", ">= 1.3.9" end
Add version to sqlite3 dependency
diff --git a/rubygems-xcodeproj_generator.gemspec b/rubygems-xcodeproj_generator.gemspec index abc1234..def5678 100644 --- a/rubygems-xcodeproj_generator.gemspec +++ b/rubygems-xcodeproj_generator.gemspec @@ -8,10 +8,6 @@ spec.version = Rubygems::XcodeprojGenerator::VERSION spec.authors = ["Yuji Nakayama"] spec.email = ["nkymyj@gmail.com"] - - if spec.respond_to?(:metadata) - spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server." - end spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.} spec.description = %q{TODO: Write a longer description or delete this line.}
Remove allowed_push_host definition in gemspec
diff --git a/jenkins-capistrano.gemspec b/jenkins-capistrano.gemspec index abc1234..def5678 100644 --- a/jenkins-capistrano.gemspec +++ b/jenkins-capistrano.gemspec @@ -16,7 +16,7 @@ gem.version = Jenkins::Capistrano::VERSION gem.add_dependency 'capistrano' - gem.add_dependency 'httparty', '~> 0.6.1' + gem.add_dependency 'httparty', '~> 0.8.3' gem.add_dependency 'hpricot' gem.add_development_dependency 'rake'
Update httparty version to work around with Psyc
diff --git a/app/services/nomis/api.rb b/app/services/nomis/api.rb index abc1234..def5678 100644 --- a/app/services/nomis/api.rb +++ b/app/services/nomis/api.rb @@ -29,8 +29,8 @@ noms_id: noms_id, date_of_birth: date_of_birth ) - return nil unless response['found'] == 'true' - Offender.new(id: response['offender_id']) + return nil unless response['found'] == true + Offender.new(response['offender']) end end end
Update Nomis client for changed API
diff --git a/templates/project/manifest.rb b/templates/project/manifest.rb index abc1234..def5678 100644 --- a/templates/project/manifest.rb +++ b/templates/project/manifest.rb @@ -13,6 +13,6 @@ end # Javascripts -%w(alert button carousel collapse dropdown modal popover scrollspy tab tooltip transition typeahead).each do |file| +%w(affix alert button carousel collapse dropdown modal popover scrollspy tab tooltip transition typeahead).each do |file| javascript "#{basedir}/javascripts/bootstrap-#{file}.js", :to => "bootstrap-#{file}.js" -end+end
Add `affix` to the list of Javascripts
diff --git a/db/migrate/20110709211132_create_duplicate_tweets.rb b/db/migrate/20110709211132_create_duplicate_tweets.rb index abc1234..def5678 100644 --- a/db/migrate/20110709211132_create_duplicate_tweets.rb +++ b/db/migrate/20110709211132_create_duplicate_tweets.rb @@ -7,7 +7,7 @@ end add_index :duplicate_tweets, :tweetId add_index :duplicate_tweets, :orig_tweet_id - add_index :tweets, :publishedAt + add_index :duplicate_tweets, :publishedAt end def self.down
Fix typo in add_index line
diff --git a/app/helpers/vue_helper.rb b/app/helpers/vue_helper.rb index abc1234..def5678 100644 --- a/app/helpers/vue_helper.rb +++ b/app/helpers/vue_helper.rb @@ -24,7 +24,7 @@ def copy_to_clipboard_button(value) <<-EOS.html_safe -<button v-attr="disabled: !#{value}" role="button" class="btn btn-xs btn-default zeroclipboard-button" data-copied-hint="Copied!" data-clipboard-text="{{#{value}}}"> +<button :disabled="!#{value}" role="button" class="btn btn-xs btn-default zeroclipboard-button" data-copied-hint="Copied!" data-clipboard-text="{{#{value}}}"> <span class="glyphicon glyphicon-copy"></span> <span class="copied-hint-target">Copy</span> </button>
Enable to work copy button
diff --git a/puppet-lint-duplicate_class_parameters-check.gemspec b/puppet-lint-duplicate_class_parameters-check.gemspec index abc1234..def5678 100644 --- a/puppet-lint-duplicate_class_parameters-check.gemspec +++ b/puppet-lint-duplicate_class_parameters-check.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = 'puppet-lint-duplicate_class_parameters-check' - spec.version = '1.0.1' + spec.version = '1.0.2' spec.homepage = 'https://github.com/deanwilson/puppet-lint_duplicate_class_parameters-check' spec.license = 'MIT' spec.author = 'Dean Wilson' @@ -18,7 +18,7 @@ are unique. EOF - spec.add_dependency 'puppet-lint', '~> 1.1' + spec.add_dependency 'puppet-lint', '>= 1.1', '< 3.0' spec.add_development_dependency 'rspec', '~> 3.0' spec.add_development_dependency 'rspec-its', '~> 1.0' spec.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
Allow puppet-lint 2.0 as a dependency and bump check version
diff --git a/app/models/site_banner.rb b/app/models/site_banner.rb index abc1234..def5678 100644 --- a/app/models/site_banner.rb +++ b/app/models/site_banner.rb @@ -8,7 +8,7 @@ belongs_to :publisher LOGO = "logo".freeze - LOGO_DIMENSIONS = [148,148] + LOGO_DIMENSIONS = [240,240] LOGO_UNIVERSAL_FILE_SIZE = 20_000 # In bytes BACKGROUND = "background".freeze
Change resolution for publisher's logo to 240x240
diff --git a/lib/pragma/decorator/association/reflection.rb b/lib/pragma/decorator/association/reflection.rb index abc1234..def5678 100644 --- a/lib/pragma/decorator/association/reflection.rb +++ b/lib/pragma/decorator/association/reflection.rb @@ -37,18 +37,6 @@ def expandable? options[:expandable] end - - # Renders the unexpanded or expanded associations, depending on the +expand+ user option - # passed to the decorator. - # - # @param expand [Array|Hash] the associations to expand for this representation - # - # @return [Hash|Pragma::Decorator::Base] - def render(_user_options) - { - id: @decorator.decorated.send(property).id - } - end end end end
Remove legacy method from Association::Reflection
diff --git a/lib/salesforce_bulk/query_result_collection.rb b/lib/salesforce_bulk/query_result_collection.rb index abc1234..def5678 100644 --- a/lib/salesforce_bulk/query_result_collection.rb +++ b/lib/salesforce_bulk/query_result_collection.rb @@ -0,0 +1,36 @@+module SalesforceBulk + class QueryResultCollection < Array + + attr_reader :client + attr_reader :currentIndex + attr_reader :batchId + attr_reader :jobId + attr_reader :resultIds + + def initialize(client, jobId, batchId, resultIds) #previousResultId, nextResultId, currentResultId + @client = client + @jobId = jobId + @batchId = batchId + @resultIds = resultIds + @currentIndex = resultIds.first + + end + + def next? + + end + + def next + + end + + def previous? + + end + + def previous + + end + + end +end
Add QueryResultCollection class as this will have to be separate from the BatchResultCollection one since query results can be paginated (or rather in sets).
diff --git a/plugins/provisioners/docker/cap/linux/docker_installed.rb b/plugins/provisioners/docker/cap/linux/docker_installed.rb index abc1234..def5678 100644 --- a/plugins/provisioners/docker/cap/linux/docker_installed.rb +++ b/plugins/provisioners/docker/cap/linux/docker_installed.rb @@ -5,6 +5,7 @@ module DockerInstalled def self.docker_installed(machine) paths = [ + "/bin/docker", "/usr/bin/docker", "/usr/local/bin/docker", "/usr/sbin/docker",
Add /bin/docker to path list for installation verification
diff --git a/spec/dummy/app/controllers/application_controller.rb b/spec/dummy/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/spec/dummy/app/controllers/application_controller.rb +++ b/spec/dummy/app/controllers/application_controller.rb @@ -1,8 +1,14 @@ class ApplicationController < ActionController::Base - - before_filter :apipie_validations if Apipie.configuration.validate == :explicitly + before_filter :run_validations resource_description do param :oauth, String, :desc => "Authorization", :required => false end + + def run_validations + if Apipie.configuration.validate == :explicitly + apipie_validations + end + end + end
Change conditional use of before_filter to suit Rails 3.2
diff --git a/spec/ruby-progressbar/calculators/length_calculator_spec.rb b/spec/ruby-progressbar/calculators/length_calculator_spec.rb index abc1234..def5678 100644 --- a/spec/ruby-progressbar/calculators/length_calculator_spec.rb +++ b/spec/ruby-progressbar/calculators/length_calculator_spec.rb @@ -4,6 +4,7 @@ class ProgressBar module Calculators RSpec.describe Length do + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('1.9.3') it 'can properly calculate the length even if IO.console is nil' do calculator = Length.new @@ -12,6 +13,7 @@ expect(calculator.calculate_length).to eql 123_456 end + end end end end
Tests: Fix length calculator tests on < 1.9.3
diff --git a/cookbooks/duckpan/recipes/default.rb b/cookbooks/duckpan/recipes/default.rb index abc1234..def5678 100644 --- a/cookbooks/duckpan/recipes/default.rb +++ b/cookbooks/duckpan/recipes/default.rb @@ -6,6 +6,6 @@ include_recipe 'perl' include_recipe 'git' -bash 'download and install duckpan' do - code ::File.open('/vagrant/duckpan.sh').read -end +#bash 'download and install duckpan' do +# code ::File.open('/vagrant/duckpan.sh').read +#end
Remove cookbooks other than duckpan
diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb index abc1234..def5678 100644 --- a/app/controllers/calendars_controller.rb +++ b/app/controllers/calendars_controller.rb @@ -1,9 +1,8 @@ #encoding: utf-8 class CalendarsController < ApplicationController + before_action :require_region!, only: [ :show ] def show - raise ActionController::RoutingError.new('Not Found') if current_region.nil? - @start_selector = StartSelector.new(start_date) @calendar = Calendar.new(start_date, current_region, current_user) end @@ -13,4 +12,9 @@ def start_date @start_date ||= params[:start].present? ? Date.parse(params[:start]) : Date.today end + + # Raise a Not Found Routing Exception if no region was set + def require_region! + raise ActionController::RoutingError.new('Not Found') if current_region.nil? + end end
Move checking for the route to a before_filter
diff --git a/app/controllers/employees_controller.rb b/app/controllers/employees_controller.rb index abc1234..def5678 100644 --- a/app/controllers/employees_controller.rb +++ b/app/controllers/employees_controller.rb @@ -8,12 +8,17 @@ def create @employee = Employee.new(employee_params) - @employee.save + if @employee.valid? + @employee.save - redirect_to employees_path + redirect_to employees_path + else + render action: 'new' + end end private + def employee_params params.require(:employee).permit(:name, :contact, :search, :salary) end
Update create action for employee
diff --git a/lib/autotest/discover.rb b/lib/autotest/discover.rb index abc1234..def5678 100644 --- a/lib/autotest/discover.rb +++ b/lib/autotest/discover.rb @@ -1,3 +1,9 @@ Autotest.add_discovery do - "cucumber" if ENV['AUTOFEATURE'] == 'true' && File.directory?('features') + if File.directory?('features') + if ENV['AUTOFEATURE'] == 'true' + "cucumber" + else + puts "(Not running features. To run features in autotest, set AUTOFEATURE=true.)" + end + end end
Add warning when AUTOFEATURE is disabled.
diff --git a/lib/avatars_for_rails.rb b/lib/avatars_for_rails.rb index abc1234..def5678 100644 --- a/lib/avatars_for_rails.rb +++ b/lib/avatars_for_rails.rb @@ -12,7 +12,7 @@ mattr_accessor :avatarable_styles # The tmp path inside public/ mattr_accessor :tmp_path - @@tmp_path = File.join('images', 'tmp') + @@tmp_path = File.join('system', 'tmp') class << self def setup
Change default tmp file path so it is preserved through deployments
diff --git a/spec/integration/performance_spec.rb b/spec/integration/performance_spec.rb index abc1234..def5678 100644 --- a/spec/integration/performance_spec.rb +++ b/spec/integration/performance_spec.rb @@ -3,8 +3,8 @@ describe Text::Table, 'performance' do it 'is linear relative to row count' do - base = time_to_render_num_of_rows 30 - time = time_to_render_num_of_rows 300 + base = time_to_render_num_of_rows 300 + time = time_to_render_num_of_rows 3000 time.should_not > base * 15 end @@ -12,8 +12,8 @@ def time_to_render_num_of_rows(num) GC.start - Benchmark.realtime do + Benchmark.measure { Text::Table.new(:rows => Array.new(num)).to_s - end + }.total end end
Use CPU time in performance test.
diff --git a/spec/rails_app/config/application.rb b/spec/rails_app/config/application.rb index abc1234..def5678 100644 --- a/spec/rails_app/config/application.rb +++ b/spec/rails_app/config/application.rb @@ -10,6 +10,10 @@ config.eager_load = true config.root = File.expand_path('../../.', __FILE__) config.consider_all_requests_local = true + + if config.active_record.sqlite3 + config.active_record.sqlite3.represent_boolean_as_integer = true + end end end
Remove a deprecation warning on Rails 5.2
diff --git a/app/models/spree/log_entry_decorator.rb b/app/models/spree/log_entry_decorator.rb index abc1234..def5678 100644 --- a/app/models/spree/log_entry_decorator.rb +++ b/app/models/spree/log_entry_decorator.rb @@ -0,0 +1,12 @@+# workaround for issue https://github.com/spree/spree/issues/1767 +# based on http://stackoverflow.com/questions/10427365/need-to-write-to-db-from-validation +Spree::LogEntry.class_eval do + after_rollback :save_anyway + + def save_anyway + log = Spree::LogEntry.new + log.source = source + log.details = details + log.save! + end +end
Add workaround to save failed LogEntries
diff --git a/app/resources/shopping/cart_resource.rb b/app/resources/shopping/cart_resource.rb index abc1234..def5678 100644 --- a/app/resources/shopping/cart_resource.rb +++ b/app/resources/shopping/cart_resource.rb @@ -1,18 +1,18 @@ module Shopping class CartResource < JSONAPI::Resource model_name 'Shopping::Cart' - - attributes :user_id, :purchased_at, :created_at, :updated_at, :origin + + attributes :user_id, :purchased_at, :created_at, :updated_at, :origin, :meta has_many :line_items has_many :cart_purchases def self.updatable_fields(context) - super - [:user_id, :updated_at, :created_at, :purchased_at, :origin] + super - [:user_id, :updated_at, :created_at, :purchased_at, :origin, :meta] end def self.creatable_fields(context) - super - [:updated_at, :created_at, :purchased_at, :order_id, :invoice_id] + super - [:updated_at, :created_at, :purchased_at, :meta] end - + end end
Add meta to cart resource
diff --git a/week-6/nested_data_solution.rb b/week-6/nested_data_solution.rb index abc1234..def5678 100644 --- a/week-6/nested_data_solution.rb +++ b/week-6/nested_data_solution.rb @@ -0,0 +1,94 @@+# RELEASE 2: NESTED STRUCTURE GOLF +# Hole 1 +# Target element: "FORE" + +array = [[1,2], ["inner", ["eagle", "par", ["FORE", "hook"]]]] + +# attempts: +# ============================================================ + +#p array[1][2][0] +p array[1][1][2][0] + + +# ============================================================ + +# Hole 2 +# Target element: "congrats!" + +hash = {outer: {inner: {"almost" => {3 => "congrats!"}}}} + +# attempts: +# ============================================================ +p hash[:outer][:inner]["almost"][3] + + +# ============================================================ + + +# Hole 3 +# Target element: "finished" + +nested_data = {array: ["array", {hash: "finished"}]} + +# attempts: +# ============================================================ +p nested_data[:array][1][:hash] + + +# ============================================================ + +# RELEASE 3: ITERATE OVER NESTED STRUCTURES + +number_array = [5, [10, 15], [20,25,30], 35] + +number_array.map! do |x| + if x.kind_of?(Array) + x.map! {|y| y + 5} + else + x + 5 + end +end + +p number_array + +# Bonus: + +startup_names = ["bit", ["find", "fast", ["optimize", "scope"]]] + +startup_names.map! do |x| + if x.kind_of?(Array) + x.map! do |y| + if y.kind_of?(Array) + y.map! {|z| z + "ly"} + else + y + "ly" + end + end + else + x + "ly" + end +end + +p startup_names + + + +#Reflection +#What are some general rules you can apply to nested arrays? +# => I found that it was easiest to start from the outside and work my way in when counting the indices for the array. +# => Overall, just treat the nested array and one single object until you go into the nested array. + +#What are some ways you can iterate over nested arrays? +# => You can iterate over nested arrays by creating a nested loop to access the nested array. + +#Did you find any good new methods to implement or did you re-use one you were already familiar with? +#What was it and why did you decide that was a good option? +# => It was useful to use the #kind_of? method to determine if the element was an array or not before trying to access it. +# => We also got more practice using #map! because we had trouble initially in making sure the method was destructive. + + + + + +
Add solution for nested data
diff --git a/app/services/atmosphere/vmt_migrator.rb b/app/services/atmosphere/vmt_migrator.rb index abc1234..def5678 100644 --- a/app/services/atmosphere/vmt_migrator.rb +++ b/app/services/atmosphere/vmt_migrator.rb @@ -10,7 +10,7 @@ @destination_compute_site = destination_compute_site end - def select_migrator + def select_migrator_class case @destination_compute_site.technology when 'aws' Migratio::Worker::OpenstackAmazonMigrator @@ -29,9 +29,9 @@ def execute if @source_compute_site.technology == 'openstack' - migrator_class = select_migrator + migrator_class = select_migrator_class - if !migrator_class.nil? + if migrator_class enqueue_job migrator_class end end
Fix due to comments, add suffix, use if non-null
diff --git a/app/uploaders/pulitzer/base_uploader.rb b/app/uploaders/pulitzer/base_uploader.rb index abc1234..def5678 100644 --- a/app/uploaders/pulitzer/base_uploader.rb +++ b/app/uploaders/pulitzer/base_uploader.rb @@ -1,6 +1,5 @@ class Pulitzer::BaseUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick - storage :file def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
Remove local storage and inherit Carrierwave config
diff --git a/hutch.gemspec b/hutch.gemspec index abc1234..def5678 100644 --- a/hutch.gemspec +++ b/hutch.gemspec @@ -6,7 +6,7 @@ gem.add_runtime_dependency 'march_hare', '>= 3.0.0' else gem.platform = Gem::Platform::RUBY - gem.add_runtime_dependency 'bunny', '~> 2.9.0' + gem.add_runtime_dependency 'bunny', '>= 2.9', '< 2.11' end gem.add_runtime_dependency 'carrot-top', '~> 0.0.7' gem.add_runtime_dependency 'multi_json', '~> 1.12'
Update bunny requirement to >= 2.9, < 2.11 Updates the requirements on [bunny](https://github.com/ruby-amqp/bunny) to permit the latest version. - [Release notes](https://github.com/ruby-amqp/bunny/releases) - [Changelog](https://github.com/ruby-amqp/bunny/blob/master/ChangeLog.md) - [Commits](https://github.com/ruby-amqp/bunny/commits/2.10.0) Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/gluttonberg/config/init.rb b/gluttonberg/config/init.rb index abc1234..def5678 100644 --- a/gluttonberg/config/init.rb +++ b/gluttonberg/config/init.rb @@ -13,6 +13,8 @@ c[:session_store] = 'cookie' end +DataObjects::Sqlite3.logger = DataMapper::Logger.new(STDOUT, :debug) + Merb::BootLoader.before_app_loads do Merb::Controller.send(:include, Merb::AssetsMixin) end
Add debug logger for Sqlite3
diff --git a/app/controllers/ab_tests/explore_menu_ab_testable.rb b/app/controllers/ab_tests/explore_menu_ab_testable.rb index abc1234..def5678 100644 --- a/app/controllers/ab_tests/explore_menu_ab_testable.rb +++ b/app/controllers/ab_tests/explore_menu_ab_testable.rb @@ -0,0 +1,26 @@+module AbTests::ExploreMenuAbTestable + CUSTOM_DIMENSION = 47 + + ALLOWED_VARIANTS = %w[A B Z].freeze + + def explore_menu_test + @explore_menu_test ||= GovukAbTesting::AbTest.new( + "ExploreMenuAbTestable", + dimension: CUSTOM_DIMENSION, + allowed_variants: ALLOWED_VARIANTS, + control_variant: "Z", + ) + end + + def explore_menu_variant + explore_menu_test.requested_variant(request.headers) + end + + def set_explore_menu_response + explore_menu_variant.configure_response(response) if explore_menu_testable? + end + + def explore_menu_testable? + explore_menu_variant.variant?("B") + end +end
Add ExploreMenuABTestable AB Test code For the controllers choose a different template from Static that includes the new header if users are in the B variant.
diff --git a/hotch.gemspec b/hotch.gemspec index abc1234..def5678 100644 --- a/hotch.gemspec +++ b/hotch.gemspec @@ -22,5 +22,5 @@ spec.add_runtime_dependency "allocation_tracer", "~> 0.6.3" spec.add_development_dependency "bundler" - spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rake", ">= 12.3.3" end
Upgrade development dependency rake to 12.3.3
diff --git a/lib/generators/delayed_job/templates/migration.rb b/lib/generators/delayed_job/templates/migration.rb index abc1234..def5678 100644 --- a/lib/generators/delayed_job/templates/migration.rb +++ b/lib/generators/delayed_job/templates/migration.rb @@ -1,15 +1,15 @@ class CreateDelayedJobs < ActiveRecord::Migration def self.up create_table :delayed_jobs, :force => true do |table| - table.integer :priority, :default => 0 # Allows some jobs to jump to the front of the queue - table.integer :attempts, :default => 0 # Provides for retries, but still fail eventually. - table.text :handler # YAML-encoded string of the object that will do work - table.text :last_error # reason for last failure (See Note below) - table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future. - table.datetime :locked_at # Set when a client is working on this object - table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) - table.string :locked_by # Who is working on this object (if locked) - table.string :queue # The name of the queue this job is in + table.integer :priority, :default => 0, :null => false # Allows some jobs to jump to the front of the queue + table.integer :attempts, :default => 0, :null => false # Provides for retries, but still fail eventually. + table.text :handler, :null => false # YAML-encoded string of the object that will do work + table.text :last_error # reason for last failure (See Note below) + table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future. + table.datetime :locked_at # Set when a client is working on this object + table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) + table.string :locked_by # Who is working on this object (if locked) + table.string :queue # The name of the queue this job is in table.timestamps end
Improve data integrity of database table * Add `:null => false` constraint to `priority`, `attempts`, and `handler`. * Re-align comments in a column.
diff --git a/api/app/controllers/spree/api/zones_controller.rb b/api/app/controllers/spree/api/zones_controller.rb index abc1234..def5678 100644 --- a/api/app/controllers/spree/api/zones_controller.rb +++ b/api/app/controllers/spree/api/zones_controller.rb @@ -4,7 +4,7 @@ def create authorize! :create, Zone - @zone = Zone.new(map_nested_attributes_keys(Spree::Zone, zone_params)) + @zone = Zone.new(zone_params) if @zone.save respond_with(@zone, :status => 201, :default_template => :show) else @@ -29,7 +29,7 @@ def update authorize! :update, zone - if zone.update_attributes(map_nested_attributes_keys(Spree::Zone, zone_params)) + if zone.update_attributes(zone_params) respond_with(zone, :status => 200, :default_template => :show) else invalid_resource!(zone) @@ -39,7 +39,8 @@ private def zone_params - params.require(:zone).permit! + attrs = params.require(:zone).permit! + map_nested_attributes_keys(Spree::Zone, attrs) end def zone
Move nested attribute logic into zone_params
diff --git a/lib/sass/tree/if_node.rb b/lib/sass/tree/if_node.rb index abc1234..def5678 100644 --- a/lib/sass/tree/if_node.rb +++ b/lib/sass/tree/if_node.rb @@ -1,15 +1,32 @@ require 'sass/tree/node' module Sass::Tree + # A dynamic node representing a Sass `@if` statement. + # + # {IfNode}s are a little odd, in that they also represent `@else` and `@else if`s. + # This is done as a linked list: + # each {IfNode} has a link (\{#else}) to the next {IfNode}. + # + # @see Sass::Tree class IfNode < Node + # The next {IfNode} in the if-else list, or `nil`. + # + # @return [IfNode] attr_accessor :else + # @param expr [Script::Expr] The conditional expression. + # If this is nil, this is an `@else` node, not an `@else if` + # @param options [Hash<Symbol, Object>] An options hash; + # see [the Sass options documentation](../../Sass.html#sass_options) def initialize(expr, options) @expr = expr @last_else = self super(options) end + # Append an `@else` node to the end of the list. + # + # @param node [IfNode] The `@else` node to append def add_else(node) @last_else.else = node @last_else = node @@ -17,6 +34,13 @@ protected + # Runs the child nodes if the conditional expression is true; + # otherwise, tries the \{#else} nodes. + # + # @param environment [Sass::Environment] The lexical environment containing + # variable and mixin values + # @return [Array<Tree::Node>] The resulting static nodes + # @see Sass::Tree def _perform(environment) environment = Sass::Environment.new(environment) return perform_children(environment) if @expr.nil? || @expr.perform(environment).to_bool
[Sass] Convert Sass::Tree::IfNode docs to YARD.
diff --git a/Typhoon.podspec b/Typhoon.podspec index abc1234..def5678 100644 --- a/Typhoon.podspec +++ b/Typhoon.podspec @@ -5,7 +5,7 @@ spec.summary = 'A dependency injection container for Objective-C. Light-weight, yet flexible and full-featured.' spec.homepage = 'http://www.typhoonframework.org' spec.author = { 'Jasper Blues, Robert Gilliam & Contributors' => 'jasper@appsquick.ly' } - spec.source = { :git => 'https://github.com/jasperblues/Typhoon.git', :tag => '1.2.7', :submodules => true } + spec.source = { :git => 'https://github.com/jasperblues/Typhoon.git', :tag => spec.version.to_s, :submodules => true } spec.source_files = 'Source/**/*.{h,m}' spec.libraries = 'z', 'xml2' spec.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
Remove duplication of version and tag in podspec. Tag is now assumed equal to the version.
diff --git a/app/views/taverna_player/runs/new.json.jbuilder b/app/views/taverna_player/runs/new.json.jbuilder index abc1234..def5678 100644 --- a/app/views/taverna_player/runs/new.json.jbuilder +++ b/app/views/taverna_player/runs/new.json.jbuilder @@ -0,0 +1,13 @@+workflow_title = TavernaPlayer.workflow_proxy.title(@workflow) || "None" +workflow_inputs = TavernaPlayer.workflow_proxy.inputs(@workflow) + +json.run do + json.workflow_id @run.workflow_id + json.name workflow_title + json.inputs_attributes do + json.array! workflow_inputs do |input| + json.name input[:name] + json.value input[:example] + end + end +end
Improve the new run JSON document. Now gives fields to be filled in for inputs as well.
diff --git a/vmdb/spec/support/automation_example_group.rb b/vmdb/spec/support/automation_example_group.rb index abc1234..def5678 100644 --- a/vmdb/spec/support/automation_example_group.rb +++ b/vmdb/spec/support/automation_example_group.rb @@ -1,16 +1,27 @@ module AutomationExampleGroup extend ActiveSupport::Concern + + class << self + attr_accessor :fixtures_loaded + end included do metadata[:type] = :automation - before(:all) do - MiqAeDatastore.reset - MiqAeDatastore.reset_manageiq_domain - end + unless AutomationExampleGroup.fixtures_loaded + RSpec.configure do |config| + config.before(:suite) do + puts "** Resetting ManageIQ domain" + MiqAeDatastore.reset + MiqAeDatastore.reset_manageiq_domain + end - after(:all) do - MiqAeDatastore.reset + config.after(:suite) do + MiqAeDatastore.reset + end + end + + AutomationExampleGroup.fixtures_loaded = true end end end
Change automation examples to use before(:suite) instead of before(:all) The usage of :all was a bug as :suite was the intention all along. This drops the test:automation suite from 32 seconds to 14 seconds.
diff --git a/spec/factories/routes.rb b/spec/factories/routes.rb index abc1234..def5678 100644 --- a/spec/factories/routes.rb +++ b/spec/factories/routes.rb @@ -1,6 +1,6 @@ FactoryBot.define do factory :route do - sequence(:number){ |n| "Route #{n}" } + sequence :number description 'route description' end end
Remove 'route' from route number
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index abc1234..def5678 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -5,4 +5,9 @@ it { should validate_presence_of(:first_name) } it { should validate_presence_of(:last_name) } it { should validate_presence_of(:email) } + + it "has a name consisting of first name and first initial of last name" do + user = User.new(first_name: "Boy", last_name: "Scout") + expect(user.name).to eq("Boy S") + end end
Add test for user class method
diff --git a/app/scoring_classes/artistic_scoring_class_2019.rb b/app/scoring_classes/artistic_scoring_class_2019.rb index abc1234..def5678 100644 --- a/app/scoring_classes/artistic_scoring_class_2019.rb +++ b/app/scoring_classes/artistic_scoring_class_2019.rb @@ -1,4 +1,4 @@-class ArtisticScoringClass_2017 < BaseScoringClass # rubocop:disable Naming/ClassAndModuleCamelCase +class ArtisticScoringClass_2019 < BaseScoringClass # rubocop:disable Naming/ClassAndModuleCamelCase def scoring_description "Using the Freestyle scoring rules, multiple Performance, Technical, and Dismount judges will score each competitor, and then the resulting points (converted to percentages, and summed) will be used to
Fix name of scoring class
diff --git a/jobs/sendgrid-email-reputation.rb b/jobs/sendgrid-email-reputation.rb index abc1234..def5678 100644 --- a/jobs/sendgrid-email-reputation.rb +++ b/jobs/sendgrid-email-reputation.rb @@ -0,0 +1,17 @@+require 'mechanize' +current_rep = 0.0 +# :first_in sets how long it takes before the job is first run. +# In this case, it is run immediately +SCHEDULER.every '1m', :first_in => 0 do |job| + send_event('email-reputation', { current: get_email_reputation.to_f }) +end + +def get_email_reputation + sendgrid = Mechanize.new + login_page = sendgrid.get("https://sendgrid.com/marketing/login") + form = login_page.form_with(:action => "https://sendgrid.com/login") + form.fields[0].value = ENV["SENDGRID_USERNAME"] + form.fields[1].value = ENV["SENDGRID_PASSWORD"] + account_page = form.submit + account_page.search("#reputation-score").text.chop +end
Add the initial prototype code This has been split out from the code for my personal dashboard. It's still a little rough around the edges.
diff --git a/app/views/api/v1/notifications/index.json.jbuilder b/app/views/api/v1/notifications/index.json.jbuilder index abc1234..def5678 100644 --- a/app/views/api/v1/notifications/index.json.jbuilder +++ b/app/views/api/v1/notifications/index.json.jbuilder @@ -1,5 +1,4 @@ json.partial! 'api/v1/shared/page_meta', collection: @notifications - json._links do json.self url_for(notification_params.merge(only_path: true)) @@ -13,6 +12,6 @@ if notification.to_actual_model.nil? json.url notifications_path else - json.url url_for(notification.to_actual_model, only_path: true) + json.url url_for([notification.to_actual_model, only_path: true]) end end
Fix notification url not generated properly
diff --git a/spec/kepler_processor/monkey_patches_spec.rb b/spec/kepler_processor/monkey_patches_spec.rb index abc1234..def5678 100644 --- a/spec/kepler_processor/monkey_patches_spec.rb +++ b/spec/kepler_processor/monkey_patches_spec.rb @@ -1,9 +1,33 @@ require 'spec_helper' describe Array do - pending "write it" + describe "to hash" do + it "should map to correct keys and values" do + [["foo", "bar"], ["something", "nothing"]].to_hash.should == { :foo => "bar", :something => "nothing" } + end + + it "should make keys lower case" do + [["FOO", "bar"]].to_hash.should == { :foo => "bar" } + end + + it "should replace spaces in keys with underscores" do + [["FOO FOO", "bar"]].to_hash.should == { :foo_foo => "bar" } + end + end end describe Float do - pending "write it" + describe "should round to" do + it "a float" do + Math::PI.round_to.should be_instance_of(Float) + end + + it "zero decimal places by default" do + Math::PI.round_to.should == 3.0 + end + + it "a specified number of decimal places" do + Math::PI.round_to(2).should == 3.14 + end + end end
Add test coverage of monkey patches
diff --git a/app/controllers/exercise_submissions_controller.rb b/app/controllers/exercise_submissions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/exercise_submissions_controller.rb +++ b/app/controllers/exercise_submissions_controller.rb @@ -32,7 +32,7 @@ def set_previous_submission_content if @exercise.submissions - @previous_submission_content = @exercise.submissions.last.content + @previous_submission_content = @exercise.submissions.select {|s| s.submitter_id == current_user.id }.last.content else @previous_submission_content = "" end
Fix previous submission content logic
diff --git a/skin/frontend/waterlee-boilerplate/default/config.rb b/skin/frontend/waterlee-boilerplate/default/config.rb index abc1234..def5678 100644 --- a/skin/frontend/waterlee-boilerplate/default/config.rb +++ b/skin/frontend/waterlee-boilerplate/default/config.rb @@ -1,4 +1,4 @@-add_import_path "bower_components/foundation/scss"g +add_import_path "bower_components/foundation/scss" # Require any additional compass plugins here. # Set this to the root of your project when deployed:
Fix small typo causing compass to fail
diff --git a/rest-client.gemspec b/rest-client.gemspec index abc1234..def5678 100644 --- a/rest-client.gemspec +++ b/rest-client.gemspec @@ -2,8 +2,8 @@ Gem::Specification.new do |s| s.name = 'rest-client' - s.version = '1.6.7' - s.authors = ['Adam Wiggins', 'Julien Kirch'] + s.version = '1.7.0.alpha' + s.authors = ['REST Client Team'] s.description = 'A simple HTTP and REST client for Ruby, inspired by the Sinatra microframework style of specifying actions: get, put, post, delete.' s.license = 'MIT' s.email = 'rest.client@librelist.com'
Update gemspec version and author 1.7.0.alpha (for now) and "REST Client Team"
diff --git a/test/stripe/errors_test.rb b/test/stripe/errors_test.rb index abc1234..def5678 100644 --- a/test/stripe/errors_test.rb +++ b/test/stripe/errors_test.rb @@ -0,0 +1,18 @@+require File.expand_path('../../test_helper', __FILE__) + +module Stripe + class StripeErrorTest < Test::Unit::TestCase + context "#to_s" do + should "convert to string" do + e = StripeError.new("message") + assert_equal "message", e.to_s + + e = StripeError.new("message", 200) + assert_equal "(Status 200) message", e.to_s + + e = StripeError.new("message", nil, nil, nil, { :request_id => "request-id" }) + assert_equal "(Request request-id) message", e.to_s + end + end + end +end
Add basic test for errors Just adds a super simplistic test for the errors module. The win here is to (hopefully) lower the friction a little bit the next time a feature is introduced into errors because there's now suite where a new test can be written.
diff --git a/minitest-context.gemspec b/minitest-context.gemspec index abc1234..def5678 100644 --- a/minitest-context.gemspec +++ b/minitest-context.gemspec @@ -16,5 +16,6 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_runtime_dependency "minitest", "~> 2.5.1" + s.add_runtime_dependency "minitest", "~> 2.5.1" + s.add_development_dependency "rake" , "~> 0.9.2" end
Add rake as a development dependency.
diff --git a/RECurtainViewController.podspec b/RECurtainViewController.podspec index abc1234..def5678 100644 --- a/RECurtainViewController.podspec +++ b/RECurtainViewController.podspec @@ -7,8 +7,10 @@ s.source = {:git => 'https://github.com/romaonthego/RECurtainViewController.git', :tag => '1.0'} s.license = {:type => "MIT", :file => "LICENSE"} - s.platform = :ios s.requires_arc = true s.source_files = 'RECurtainViewController' s.public_header_files = 'RECurtainViewController/*.h' + + s.platform = :ios + s.ios.frameworks = 'QuartzCore' end
Add QuartzCore framework to podspec
diff --git a/config/initializers/attachment_cache.rb b/config/initializers/attachment_cache.rb index abc1234..def5678 100644 --- a/config/initializers/attachment_cache.rb +++ b/config/initializers/attachment_cache.rb @@ -1,5 +1 @@-Whitehall::Uploader::AttachmentCache.default_root_directory = if Rails.env.production? - "/mnt/apps/whitehall-admin/attachment-cache" -else - Rails.root.join("tmp", "cache", "attachment-cache") -end +Whitehall::Uploader::AttachmentCache.default_root_directory = Rails.root.join("attachment-cache")
Use same location for attachment cache on all environments. The folder /mnt/apps/whitehall-admin/attachment-cache isn't writable on staging or production, so the location needed to change. Instead of configuring this within the app, we are instead symlinking a set location (<app-root>/attachment-cache) on deployment.
diff --git a/lib/app/helpers/session_helper.rb b/lib/app/helpers/session_helper.rb index abc1234..def5678 100644 --- a/lib/app/helpers/session_helper.rb +++ b/lib/app/helpers/session_helper.rb @@ -10,7 +10,7 @@ def login_url(return_path = nil) url = Github.login_url if return_path - url << "&redirect_uri=http://#{site_root}/github/callback#{return_path}" + url << "&redirect_uri=#{site_root}/github/callback#{return_path}" end url end
Remove double-http in github login redirect
diff --git a/app_template.rb b/app_template.rb index abc1234..def5678 100644 --- a/app_template.rb +++ b/app_template.rb @@ -11,6 +11,15 @@ end +def configure_react(environment) + insert_into_file("config/environments/#{environment}.rb", + "\n" + + " config.react.variant = :#{environment}\n" + + " config.react.addons = true\n", + after: "# Settings specified here will take precedence over those in config/application.rb\n") +end + + ############## # Main script ############## @@ -18,6 +27,7 @@ gem "rglossa", github: "textlab/rglossa" gem "devise", "~> 2.2.3" gem "therubyracer" +gem "react-rails" run "bundle install" @@ -38,3 +48,6 @@ insert_into_file("app/assets/stylesheets/application.css", " *= require rglossa/application\n", after: "*= require_self\n") + +configure_react("development") +configure_react("production")
Configure react when creating new application
diff --git a/core/app/models/spree/asset/support/active_storage.rb b/core/app/models/spree/asset/support/active_storage.rb index abc1234..def5678 100644 --- a/core/app/models/spree/asset/support/active_storage.rb +++ b/core/app/models/spree/asset/support/active_storage.rb @@ -16,7 +16,7 @@ end def dimensions_for_style(style) - self.class.styles.with_indifferent_access[style] || default_style + self.class.styles.with_indifferent_access[style] || self.class.styles.with_indifferent_access[default_style] end end end
Make the generated url contain a valid resize attribute when invalid style
diff --git a/rb/spec/integration/selenium/webdriver/mouse_spec.rb b/rb/spec/integration/selenium/webdriver/mouse_spec.rb index abc1234..def5678 100644 --- a/rb/spec/integration/selenium/webdriver/mouse_spec.rb +++ b/rb/spec/integration/selenium/webdriver/mouse_spec.rb @@ -25,9 +25,7 @@ text = droppable.find_element(:tag_name => "p").text text.should == "Dropped!" end - end - compliant_on :browser => :chrome do it "double clicks an element" do driver.navigate.to url_for("javascriptPage.html") element = driver.find_element(:id, 'doubleClickField')
JariBakken: Enable double/context click specs for IE. git-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@13526 07704840-8298-11de-bf8c-fd130f914ac9
diff --git a/lib/draisine/conflict_detector.rb b/lib/draisine/conflict_detector.rb index abc1234..def5678 100644 --- a/lib/draisine/conflict_detector.rb +++ b/lib/draisine/conflict_detector.rb @@ -30,7 +30,7 @@ def diff return unless model && remote_model - @diff ||= HashDiff.diff( + @diff ||= HashDiff.sf_diff( model.attributes.slice(*attributes_list), remote_model.attributes.slice(*attributes_list)) end
Use sf_diff instead of normal diff in conflict detection routine
diff --git a/spec/models/hero_spec.rb b/spec/models/hero_spec.rb index abc1234..def5678 100644 --- a/spec/models/hero_spec.rb +++ b/spec/models/hero_spec.rb @@ -4,9 +4,7 @@ describe "Validations" do subject { Factory(:hero) } - it { should validate_uniqueness_of :email } it { should validate_uniqueness_of :login } - it { should validate_presence_of :email } it { should validate_presence_of :login } end
Remove validations from the spec
diff --git a/spec/spec_helper_spec.rb b/spec/spec_helper_spec.rb index abc1234..def5678 100644 --- a/spec/spec_helper_spec.rb +++ b/spec/spec_helper_spec.rb @@ -0,0 +1,13 @@+describe AwesomeSpawn::SpecHelper do + describe ".stub_good_run" do + it "works" do + described_class.stub_good_run + end + end + + describe ".stub_bad_run" do + it "works" do + described_class.stub_bad_run + end + end +end
Add failing spec to display issues with the spec helper methods
diff --git a/config/environments/development.rb b/config/environments/development.rb index abc1234..def5678 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -30,8 +30,9 @@ # test javascript config.assets.paths << Rails.root.join('test', 'javascripts') - # LiveReload - config.middleware.use Rack::LiveReload + # LiveReload, user localhost because livereload can't listen file changed + # event in vagrant sync folder, so run `guard start` in host machine. + config.middleware.use Rack::LiveReload, host: 'localhost' end # Slim pretty output
Add host config for LiveReload
diff --git a/shaq_overflow/app/controllers/votes_controller.rb b/shaq_overflow/app/controllers/votes_controller.rb index abc1234..def5678 100644 --- a/shaq_overflow/app/controllers/votes_controller.rb +++ b/shaq_overflow/app/controllers/votes_controller.rb @@ -2,11 +2,18 @@ def create if request.xhr? - vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: 1, votable_id: params[:answerId]) - answer = Answer.find(params[:answerId]) - votes = answer.votes.count - votes.to_json - render json: votes + if params[:direction] == "up" + vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: 1, votable_id: params[:answerId]) + @answer = Answer.find(params[:answerId]) + else + vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: -1, votable_id: params[:answerId]) + @answer = Answer.find(params[:answerId]) + end + @vote_values = [] + @answer.votes.each {|vote| @vote_values << vote.value.to_i} + @anna = @vote_values.reduce(:+) + @anna.to_json + render json: @anna end end
Add conditional logic for up and down votes
diff --git a/encrypted_strings.gemspec b/encrypted_strings.gemspec index abc1234..def5678 100644 --- a/encrypted_strings.gemspec +++ b/encrypted_strings.gemspec @@ -14,4 +14,6 @@ s.test_files = `git ls-files -- test/*`.split("\n") s.rdoc_options = %w(--line-numbers --inline-source --title encrypted_strings --main README.rdoc) s.extra_rdoc_files = %w(README.rdoc CHANGELOG.rdoc LICENSE) + + s.add_development_dependency("rake") end
Add missing dependencies to gemspec
diff --git a/lib/merb_relaxdb/connection.rb b/lib/merb_relaxdb/connection.rb index abc1234..def5678 100644 --- a/lib/merb_relaxdb/connection.rb +++ b/lib/merb_relaxdb/connection.rb @@ -7,12 +7,11 @@ class << self def connect - set_database begin + set_database ::RelaxDB.db.get Merb.logger.info "RelaxDB connected to CouchDB #{::RelaxDB.db.url}" rescue - puts "RelaxDB could not connect to CouchDB at #{::RelaxDB.db.url} Exiting..." Merb.logger.error "RelaxDB could not connect to CouchDB at #{::RelaxDB.db.url} Exiting..." exit(1) end @@ -22,6 +21,7 @@ config_file = Merb.root / "config" / "couchdb.yml" full_config = Erubis.load_yaml_file(config_file) config = full_config[Merb.environment.to_sym] + config[:logger] = Merb.logger ::RelaxDB.configure(config) end
Configure RelaxDB to use the Merb logger
diff --git a/spec/unit/memoizable/module_methods/included_spec.rb b/spec/unit/memoizable/module_methods/included_spec.rb index abc1234..def5678 100644 --- a/spec/unit/memoizable/module_methods/included_spec.rb +++ b/spec/unit/memoizable/module_methods/included_spec.rb @@ -11,7 +11,7 @@ before do # Prevent Module.included from being called through inheritance - Memoizable.stub(:included) + allow(Memoizable).to receive(:included) end it_behaves_like 'it calls super', :included
Change stub usage to allow in specs
diff --git a/lib/tasks/database_import.rake b/lib/tasks/database_import.rake index abc1234..def5678 100644 --- a/lib/tasks/database_import.rake +++ b/lib/tasks/database_import.rake @@ -3,8 +3,9 @@ task :import => [:environment, :drop, :create] do Bundler.with_clean_env do Tempfile.create('tahi-staging-import') do |f| + target_db_name = ActiveRecord::Base.connection.current_database system("curl -o #{f.path} `heroku pgbackups:url`") - system("pg_restore --clean --no-acl --no-owner -h localhost -d tahi_development #{f.path}") + system("pg_restore --clean --no-acl --no-owner -h localhost -d #{target_db_name} #{f.path}") end end end
Allow different target databases for db:import task
diff --git a/app/controllers/restful_redirect_controller.rb b/app/controllers/restful_redirect_controller.rb index abc1234..def5678 100644 --- a/app/controllers/restful_redirect_controller.rb +++ b/app/controllers/restful_redirect_controller.rb @@ -1,4 +1,6 @@ class RestfulRedirectController < ApplicationController + before_action :check_privileges + def index case params[:model] when 'MiqRequest' @@ -12,8 +14,8 @@ end redirect_to :controller => controller, :action => 'show', :id => params[:id] else - flash_to_session(_("Could not find %{model}[id=%{id}]") % {:model => params[:model], :id => params[:id]}) - redirect_to(:controller => 'dashboard') + flash_to_session(_("Could not find the given \"%{model}\" record.") % {:model => ui_lookup(:model => params[:model])}, :error) + redirect_to(:controller => 'dashboard', :action => 'show') end end end
Fix flash message generation on restful redirect controller errors
diff --git a/omnibus-software.gemspec b/omnibus-software.gemspec index abc1234..def5678 100644 --- a/omnibus-software.gemspec +++ b/omnibus-software.gemspec @@ -6,8 +6,8 @@ s.name = "omnibus-software" s.version = OmnibusSoftware::VERSION s.authors = ["Chef Software, Inc."] - s.email = ["legal@getchef.com"] - s.homepage = "http://github.com/opscode/omnibus-software" + s.email = ["legal@chef.io"] + s.homepage = "https://github.com/chef/omnibus-software" s.summary = %q{Open Source software for use with Omnibus} s.description = %q{Open Source software build descriptions for use with Omnibus} @@ -18,7 +18,7 @@ s.add_dependency "omnibus", ">= 5.5.0" s.add_dependency "chef-sugar", ">= 3.4.0" - s.add_development_dependency "chefstyle", "~> 0.3" + s.add_development_dependency "chefstyle" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
Remove version pin on chefstyle We've moved away from pinning chefstyle in chef projects and instead realized that we should cleanup things as we break them. Update URLs while I'm in here. Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/lib/overcommit/hook/commit_msg/capitalized_subject.rb b/lib/overcommit/hook/commit_msg/capitalized_subject.rb index abc1234..def5678 100644 --- a/lib/overcommit/hook/commit_msg/capitalized_subject.rb +++ b/lib/overcommit/hook/commit_msg/capitalized_subject.rb @@ -1,5 +1,5 @@ module Overcommit::Hook::CommitMsg - # Ensures commit message subject lines are followed by a blank line. + # Ensures commit message subject lines start with a capital letter. class CapitalizedSubject < Base def run first_letter = commit_message_lines[0].to_s.match(/^[[:punct:]]*(.)/)[1]
Fix comment in CapitalizedSubject hook This was leftover from the hook I copied when creating it. Change-Id: I3be089503b7eaf90f256d2ce03a10bf8fec7b1f4 Reviewed-on: http://gerrit.causes.com/47740 Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@brigade.com> Reviewed-by: Joe Lencioni <1dd72cf724deaab5db236f616560fc7067b734e1@brigade.com>
diff --git a/features/support/sauce.rb b/features/support/sauce.rb index abc1234..def5678 100644 --- a/features/support/sauce.rb +++ b/features/support/sauce.rb @@ -8,8 +8,7 @@ Sauce.config do |c| c[:start_tunnel] = true - #c[:browsers] = [["Windows 8", "Internet Explorer", "10"]] - c[:browsers] = [ ["Linux", "Chrome", nil] ] + c[:browsers] = [["Linux", "Chrome", nil]] end Before do
Remove IE support for now
diff --git a/lib/capybara/rspec.rb b/lib/capybara/rspec.rb index abc1234..def5678 100644 --- a/lib/capybara/rspec.rb +++ b/lib/capybara/rspec.rb @@ -17,8 +17,8 @@ end config.before do |example| if self.class.include?(Capybara::DSL) - Capybara.current_driver = Capybara.javascript_driver if ex.metadata[:js] - ampleCapybara.current_driver = ex.metadata[:driver] if ex.metadata[:driver] + Capybara.current_driver = Capybara.javascript_driver if example.metadata[:js] + ampleCapybara.current_driver = example.metadata[:driver] if example.metadata[:driver] end end end
Correct reference to wrong block variable name
diff --git a/lib/sync_checker/formats/document_collection_check.rb b/lib/sync_checker/formats/document_collection_check.rb index abc1234..def5678 100644 --- a/lib/sync_checker/formats/document_collection_check.rb +++ b/lib/sync_checker/formats/document_collection_check.rb @@ -10,7 +10,12 @@ end def checks_for_live(locale) - super + super << Checks::LinksCheck.new( + "topical_events", + TopicalEvent + .for_edition(edition_expected_in_live.id) + .pluck(:content_id) + ) end def expected_details_hash(edition)
Add TopicalEvents to DocumentCollection sync check