diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/tasks/mnemosyne/consume.rake b/lib/tasks/mnemosyne/consume.rake index abc1234..def5678 100644 --- a/lib/tasks/mnemosyne/consume.rake +++ b/lib/tasks/mnemosyne/consume.rake @@ -13,6 +13,8 @@ Rails.application.eager_load! + Hutch::Logging.logger = Rails.logger + Hutch::Config.set :mq_exchange, 'mnemosyne' Hutch::Config.set :channel_prefetch, 25 Hutch::Config.set :consumer_pool_size, 25
Configure hutch to use rails logger
diff --git a/spec/scanny/checks/sql_injection/sanitize_sql_check_spec.rb b/spec/scanny/checks/sql_injection/sanitize_sql_check_spec.rb index abc1234..def5678 100644 --- a/spec/scanny/checks/sql_injection/sanitize_sql_check_spec.rb +++ b/spec/scanny/checks/sql_injection/sanitize_sql_check_spec.rb @@ -10,7 +10,7 @@ end it "reports \"sanitize_sql\" calls correctly" do - @runner.should check("'mysql_query'.sanitize_sql").with_issue(@issue_info) + @runner.should check("sanitize_sql('mysql_query')").with_issue(@issue_info) end end end
Use sanitize_sql according to the documentation
diff --git a/capistrano-hipchat.gemspec b/capistrano-hipchat.gemspec index abc1234..def5678 100644 --- a/capistrano-hipchat.gemspec +++ b/capistrano-hipchat.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "capistrano", "~> 3.1" + spec.add_dependency "capistrano", "~> 3.2" spec.add_dependency "hipchat" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake"
Upgrade cap dependency (required for previous_revision variable)
diff --git a/spec/views/devise/mailer/unlock_instructions_spec.rb b/spec/views/devise/mailer/unlock_instructions_spec.rb index abc1234..def5678 100644 --- a/spec/views/devise/mailer/unlock_instructions_spec.rb +++ b/spec/views/devise/mailer/unlock_instructions_spec.rb @@ -2,10 +2,7 @@ describe 'devise/mailer/unlock_instructions.html.haml', :type => "view" do context "logged in" do before(:each) do -#@resource = mock_model(Member) @resource = FactoryGirl.create(:member) - @resource.should_receive(:email).and_return("example@example.com") - @resource.should_receive(:unlock_token).and_return("fred") render end
Fix broken test for unlock instructions There were some extra assertions left over from Devise's use of mocks that no longer make sense.
diff --git a/Foursquare-API-v2.podspec b/Foursquare-API-v2.podspec index abc1234..def5678 100644 --- a/Foursquare-API-v2.podspec +++ b/Foursquare-API-v2.podspec @@ -11,4 +11,5 @@ s.source_files = 'Classes', 'Foursquare2/**/*.{h,m}' s.resources = 'Foursquare2/*.png', 'Foursquare2/**/*.{xib}' s.requires_arc = true + s.frameworks = 'Secturity', 'Foundation', 'UIKit' end
Add required frameworks in podspec
diff --git a/lib/article_repository.rb b/lib/article_repository.rb index abc1234..def5678 100644 --- a/lib/article_repository.rb +++ b/lib/article_repository.rb @@ -16,7 +16,7 @@ end def self.find(id) - self.new.find(id) + (new).find(id) end private
Remove redundant `self.` from article repository
diff --git a/lib/codeclimate_ci/cli.rb b/lib/codeclimate_ci/cli.rb index abc1234..def5678 100644 --- a/lib/codeclimate_ci/cli.rb +++ b/lib/codeclimate_ci/cli.rb @@ -14,10 +14,10 @@ CodeclimateCi.configuration.load_from_options(options) if compare_gpa.worse?(branch_name) - report_about_worse_code + Report.worse_code(diff) exit(1) else - report_about_good_code + Report.good_code(diff) end end @@ -25,12 +25,8 @@ private - def report_about_worse_code - Report.worse_code(compare_gpa.diff(branch_name)) - end - - def report_about_good_code - Report.good_code(compare_gpa.diff(branch_name)) + def diff + compare_gpa.diff(branch_name) end def compare_gpa
Refactor code quality reporting logic in CLI class
diff --git a/lib/core_charges_hooks.rb b/lib/core_charges_hooks.rb index abc1234..def5678 100644 --- a/lib/core_charges_hooks.rb +++ b/lib/core_charges_hooks.rb @@ -1,6 +1,6 @@ class CoreChargesHooks < Spree::ThemeSupport::HookListener - insert_bottom :admin_product_form_right do + insert_after :admin_product_form_right do '<%= f.label :core_amount, t("core_amount") %> <br /> <%= f.select :core_amount, [nil, 25.0, 50.0, 75.0, 100.0, 150.0, 200.0], :class => "text " %> <%= f.error_message_on :core_amount %>'
Revert "Typo in hook declaration" This reverts commit a41d3a1723ccfbdff1a485dea394affe25df7039.
diff --git a/Casks/tg-pro.rb b/Casks/tg-pro.rb index abc1234..def5678 100644 --- a/Casks/tg-pro.rb +++ b/Casks/tg-pro.rb @@ -1,6 +1,6 @@ cask :v1 => 'tg-pro' do - version '2.8.4' - sha256 'e574e92e411b694f19c9a1ac0583361187f428524987d6a220ea82d39d64ac46' + version '2.8.5' + sha256 'ddffad55f0c8998323d270649f22f3e7a63ed45f867ba141a4b6df2b76bca6fc' url "http://www.tunabellysoftware.com/resources/TGPro_#{version.gsub('.','_')}.zip" name 'TG Pro'
Update TG Pro.app to v2.8.5
diff --git a/gemgen.gemspec b/gemgen.gemspec index abc1234..def5678 100644 --- a/gemgen.gemspec +++ b/gemgen.gemspec @@ -1,5 +1,6 @@ # -*- encoding: utf-8 -*- -require File.expand_path('../lib/gemgen/version', __FILE__) +$:.unshift File.expand_path('../lib', __FILE__) +require 'gemgen/version' Gem::Specification.new do |gem| gem.authors = ["Martin Chabot"]
Fix already initialized constant VERSION warning
diff --git a/app/overrides/add_bulk_edit_tab_to_products_admin_sub_menu.rb b/app/overrides/add_bulk_edit_tab_to_products_admin_sub_menu.rb index abc1234..def5678 100644 --- a/app/overrides/add_bulk_edit_tab_to_products_admin_sub_menu.rb +++ b/app/overrides/add_bulk_edit_tab_to_products_admin_sub_menu.rb @@ -1,4 +1,4 @@ Deface::Override.new(:virtual_path => "spree/admin/shared/_product_sub_menu", :name => "add_bulk_edit_tab_to_products_admin_sub_menu", :insert_bottom => "[data-hook='admin_product_sub_tabs']", - :text => "<%= tab :bulk_product_edit, :url => bulk_edit_admin_products_path %>") + :text => "<%= tab :bulk_product_edit, :url => bulk_edit_admin_products_path, :match_path => '/products/bulk_edit' %>")
Make BPE menu tab selected
diff --git a/app/models/conversation.rb b/app/models/conversation.rb index abc1234..def5678 100644 --- a/app/models/conversation.rb +++ b/app/models/conversation.rb @@ -2,5 +2,13 @@ belongs_to :sender, class_name: 'User', foreign_key: :sender_id belongs_to :recipient, class_name: 'User', foreign_key: :recipient_id belongs_to :variety, class_name: 'ConversationVariety', foreign_key: :conversation_variety_id - has_many :messages + has_many :messages, dependent: :destroy + + validates_presence_of :sender_id, :recipient_id, :conversation_variety_id + validates_uniqueness_of :sender_id, scope: :recipient_id + + scope :between, -> (sender_id,recipient_id) do + where('(conversations.sender_id = ? AND conversations.recipient_id =?) OR (conversations.sender_id = ? AND conversations.recipient_id =?)', sender_id,recipient_id, recipient_id, sender_id) + end + end
Add validations to Conversation model
diff --git a/csv2avro.gemspec b/csv2avro.gemspec index abc1234..def5678 100644 --- a/csv2avro.gemspec +++ b/csv2avro.gemspec @@ -20,4 +20,6 @@ spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rspec" + spec.add_development_dependency "pry" end
Add development dependencies to gemspec
diff --git a/activemodel/lib/active_model/mass_assignment_security/permission_set.rb b/activemodel/lib/active_model/mass_assignment_security/permission_set.rb index abc1234..def5678 100644 --- a/activemodel/lib/active_model/mass_assignment_security/permission_set.rb +++ b/activemodel/lib/active_model/mass_assignment_security/permission_set.rb @@ -1,3 +1,4 @@+require 'set' require 'active_model/mass_assignment_security/sanitizer' module ActiveModel @@ -36,4 +37,4 @@ end end end -end+end
Add missing require to use Set
diff --git a/Expecta.podspec b/Expecta.podspec index abc1234..def5678 100644 --- a/Expecta.podspec +++ b/Expecta.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| s.name = 'Expecta' s.version = '0.2.4' - s.license = 'MIT' + s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'A matcher framework for Objective-C & Cocoa.' s.homepage = 'http://github.com/petejkim/expecta' s.author = { 'Peter Jihoon Kim' => 'raingrove@gmail.com' } - s.source = { :git => 'https://github.com/specta/expecta.git', :tag => "#{s.version}" } + s.source = { :git => 'https://github.com/specta/expecta.git', :tag => "v#{s.version}" } s.description = %{ Expecta is a matcher framework for Objective-C and Cocoa. The main @@ -18,5 +18,9 @@ s.source_files = 'src/**/*.{h,m}' + s.requires_arc = false + s.ios.deployment_target = '4.0' + s.osx.deployment_target = '10.6' + s.frameworks = 'Foundation' end
Add license format, disable ARC and add deployment targets to podspec Also fixes format of tag version string. Passes `pod spec lint` validation.
diff --git a/tests.rb b/tests.rb index abc1234..def5678 100644 --- a/tests.rb +++ b/tests.rb @@ -10,7 +10,7 @@ end def test_money_initialization - assert_equal @money.value, 10 - assert_equal @money.currency, 'USD' + assert_equal 10, @money.value + assert_equal 'USD', @money.currency end end
Fix class init test - `expected` was mixed with `actual`
diff --git a/0_code_wars/doggy_daycare.rb b/0_code_wars/doggy_daycare.rb index abc1234..def5678 100644 --- a/0_code_wars/doggy_daycare.rb +++ b/0_code_wars/doggy_daycare.rb @@ -0,0 +1,11 @@+# http://www.codewars.com/kata/56951add53eccacf44000030/ +# --- iteration 1 --- +class Dog + def check_dog + case [vaccinated, wormed].count(true) + when 1 then "#{name} can only be accepted by itself" + when 2 then "#{name} can be accepted" + else "#{name} can not be accepted" + end + end +end
Add code wars (7) - doggy daycare
diff --git a/MHVideoPhotoGallery.podspec b/MHVideoPhotoGallery.podspec index abc1234..def5678 100644 --- a/MHVideoPhotoGallery.podspec +++ b/MHVideoPhotoGallery.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MHVideoPhotoGallery' - s.version = '1.6' + s.version = '1.6.1' s.license = 'MIT' s.homepage = 'https://github.com/mariohahn/MHVideoPhotoGallery' s.author = { @@ -10,10 +10,10 @@ s.platform = :ios s.source = { :git => 'https://github.com/mariohahn/MHVideoPhotoGallery.git', - :tag => 'v1.6' + :tag => 'v1.6.1' } - - s.dependency "SDWebImage", "~> 3.5.2" + + s.dependency "SDWebImage", "~> 3.6" s.frameworks = 'MessageUI','Social', 'ImageIO', 'QuartzCore', 'Accelerate','CoreMedia', 'AVFoundation','MediaPlayer'
Update SDWebImage to Version 3.6 from 3.5.2
diff --git a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb index abc1234..def5678 100644 --- a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb +++ b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb @@ -19,6 +19,11 @@ end end +easy_install_package "compare-locales" do + options "-U" + action :install +end + execute "add-bsenv" do user user command "echo \". ./.bsenv \" >> /home/#{user}/.bashrc"
Add compare-locales via easy_install for Firefox
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -13,3 +13,7 @@ # Add more helper methods to be used by all tests here... end + +class ActionController::TestCase + include Devise::TestHelpers +end
Add devise helpers to tests
diff --git a/Casks/adobe-creative-cloud-cleaner-tool.rb b/Casks/adobe-creative-cloud-cleaner-tool.rb index abc1234..def5678 100644 --- a/Casks/adobe-creative-cloud-cleaner-tool.rb +++ b/Casks/adobe-creative-cloud-cleaner-tool.rb @@ -0,0 +1,12 @@+cask :v1 => 'adobe-creative-cloud-cleaner-tool' do + version :latest + sha256 :no_check + + # macromedia.com is the official download host per the vendor homepage + url 'https://download.macromedia.com/SupportTools/Cleaner/mac/AdobeCreativeCloudCleanerTool.dmg' + name 'Adobe Creative Cloud Cleaner Tool' + homepage 'https://helpx.adobe.com/creative-cloud/kb/cc-cleaner-tool-installation-problems.html' + license :gratis + + app 'Adobe Creative Cloud Cleaner Tool.app' +end
Add Adobe CC Cleaner Tool
diff --git a/Casks/air-video-server-hd.rb b/Casks/air-video-server-hd.rb index abc1234..def5678 100644 --- a/Casks/air-video-server-hd.rb +++ b/Casks/air-video-server-hd.rb @@ -0,0 +1,9 @@+class AirVideoServerHd < Cask + version '1.0.15' + sha256 '06fa8089a3cc7ba7e6386aff9bab5f5827fc4add47ff4021e00d82b1d7a432b8' + + url "https://s3.amazonaws.com/AirVideoHD/Download/Air+Video+Server+HD+#{version}.dmg" + homepage 'http://www.inmethod.com/airvideohd' + + link 'Air Video Server HD.app' +end
Add "Air Video Server HD" 1.0.15
diff --git a/Casks/yubikey-neo-manager.rb b/Casks/yubikey-neo-manager.rb index abc1234..def5678 100644 --- a/Casks/yubikey-neo-manager.rb +++ b/Casks/yubikey-neo-manager.rb @@ -1,6 +1,6 @@ cask :v1 => 'yubikey-neo-manager' do - version '1.1.0' - sha256 '3af16efa1ac02ea4244cf906d8d63d98e4b867b3f4ceaed668d405bd6d2b809e' + version '1.3.0' + sha256 '9b28bc6350a7afe2e7e3e4397423359487de876ee67aafeca7902f9aaa5f1756' url "https://developers.yubico.com/yubikey-neo-manager/Releases/yubikey-neo-manager-#{version}-mac.pkg" name 'YubiKey NEO Manager'
Upgrade YubiKey NEO Manager.app to v1.3.0
diff --git a/Hydrant.podspec b/Hydrant.podspec index abc1234..def5678 100644 --- a/Hydrant.podspec +++ b/Hydrant.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Hydrant" - s.version = "2.0.0-alpha" + s.version = "2.0.0-alpha.2" s.summary = "A simple data mapper / object serializer for objective-c" s.description = <<-DESC
Bump podspec version to 2.0.0-alpha.2
diff --git a/examples/redirect_stdin.rb b/examples/redirect_stdin.rb index abc1234..def5678 100644 --- a/examples/redirect_stdin.rb +++ b/examples/redirect_stdin.rb @@ -1,7 +1,9 @@ # encoding: utf-8 require 'tty-command' +require 'pathname' +cli = Pathname.new('examples/cli.rb') cmd = TTY::Command.new stdin = StringIO.new @@ -9,6 +11,6 @@ stdin.puts "world" stdin.rewind -out, _ = cmd.run(:cat, :in => stdin) +out, _ = cmd.run(cli, :in => stdin) puts "#{out}"
Change example to use cli exec
diff --git a/app/controllers/users/email_preferences_controller.rb b/app/controllers/users/email_preferences_controller.rb index abc1234..def5678 100644 --- a/app/controllers/users/email_preferences_controller.rb +++ b/app/controllers/users/email_preferences_controller.rb @@ -1,6 +1,6 @@ class Users::EmailPreferencesController < AuthenticateByUnsubscribeTokenController helper_method :any_memberships_have_volume_email? - skip_before_filter :boot_angular_ui, only: :edit + skip_before_filter :boot_angular_ui def edit boot_angular_ui unless restricted_user.present? @@ -8,6 +8,7 @@ end def update + boot_angular_ui unless restricted_user.present? if user.update_attributes(permitted_params.user) if %w[loud normal quiet].include? params[:set_group_volume] user.memberships.update_all(volume: Membership.volumes[params[:set_group_volume]])
Fix cukes, allow email pref update
diff --git a/Library/Formula/wakeonlan.rb b/Library/Formula/wakeonlan.rb index abc1234..def5678 100644 --- a/Library/Formula/wakeonlan.rb +++ b/Library/Formula/wakeonlan.rb @@ -7,6 +7,11 @@ def install system "perl", "Makefile.PL" + # Make sure script and manual get installed in Cellar properly + inreplace "Makefile" do |s| + s.change_make_var! "INSTALLSITESCRIPT", bin + s.change_make_var! "INSTALLSITEMAN1DIR", man1 + end system "make" system "make install" end
Fix to install in Cellar as it should The current wakeonlan formula causes the script and man page to get installed directly into /usr/local instead of into the Cellar like it should, this patch fixes that. Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/ferrety_ferret.gemspec b/ferrety_ferret.gemspec index abc1234..def5678 100644 --- a/ferrety_ferret.gemspec +++ b/ferrety_ferret.gemspec @@ -1,5 +1,4 @@ # -*- encoding: utf-8 -*- -require File.expand_path('../lib/ferrety_ferret/version', __FILE__) Gem::Specification.new do |gem| gem.authors = ["Mark Tabler\n"] @@ -13,5 +12,5 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.name = "ferrety_ferret" gem.require_paths = ["lib"] - gem.version = FerretyFerret::VERSION + gem.version = "0.0.3" end
Remove version library from gemspec
diff --git a/0_code_wars/share_prices.rb b/0_code_wars/share_prices.rb index abc1234..def5678 100644 --- a/0_code_wars/share_prices.rb +++ b/0_code_wars/share_prices.rb @@ -0,0 +1,5 @@+# http://www.codewars.com/kata/5603a4dd3d96ef798f000068/ +# --- iteration 1 --- +def share_price(invested, changes) + "%.2f" % changes.reduce(invested) { |acc, el| acc += (acc * el.fdiv(100)) } +end
Add code wars (7) - share prices
diff --git a/app/api/pushificator/v1.rb b/app/api/pushificator/v1.rb index abc1234..def5678 100644 --- a/app/api/pushificator/v1.rb +++ b/app/api/pushificator/v1.rb @@ -12,6 +12,7 @@ end helpers do + def api_response response case response when Integer @@ -35,6 +36,17 @@ ActionController::Parameters.new(params) end + def current_user + # Find token. Check if valid. + token = ::ApiKey.where(access_token: params[:token]).first + if token && !token.expired? + @current_user = ::User.find(token.user_id) + else + false + end + end + + end mount Device
Add current_user to API finded by token
diff --git a/feedmodifier.rb b/feedmodifier.rb index abc1234..def5678 100644 --- a/feedmodifier.rb +++ b/feedmodifier.rb @@ -2,6 +2,13 @@ def feed(input) doc = Nokogiri::XML(input){|x| x.noblanks } + doc.xpath("//item").each do |item_node| + if item_node.xpath("guid").empty? + guid_node = Nokogiri::XML::Node.new("guid", doc) + guid_node.content = item_node.at_xpath("comments").content + item_node.add_child(guid_node) + end + end doc.to_xml(:indent => 2) end
Add guid if none using link content.
diff --git a/twingly-url.gemspec b/twingly-url.gemspec index abc1234..def5678 100644 --- a/twingly-url.gemspec +++ b/twingly-url.gemspec @@ -1,5 +1,3 @@-# encoding: utf-8 - require File.expand_path('../lib/version', __FILE__) Gem::Specification.new do |s|
Remove unnecessary magic encoding comment
diff --git a/lib/generators/scripturable/templates/scripture_reference.rb b/lib/generators/scripturable/templates/scripture_reference.rb index abc1234..def5678 100644 --- a/lib/generators/scripturable/templates/scripture_reference.rb +++ b/lib/generators/scripturable/templates/scripture_reference.rb @@ -39,6 +39,10 @@ self.end_at = @end_verse.to_i end + def include?(verse) + start_at < verse && verse < end_at + end + end
Check to see if scripture reference includes the passed verse
diff --git a/db/migrate/20090203101718_add_hashed_path_to_repositories.rb b/db/migrate/20090203101718_add_hashed_path_to_repositories.rb index abc1234..def5678 100644 --- a/db/migrate/20090203101718_add_hashed_path_to_repositories.rb +++ b/db/migrate/20090203101718_add_hashed_path_to_repositories.rb @@ -3,9 +3,11 @@ transaction do add_column :repositories, :hashed_path, :string add_index :repositories, :hashed_path - Repository.find(:all).each do |repo| - repo.send(:set_repository_hash) - repo.save! + + Repository.reset_column_information + + Repository.all.each do |repo| + repo.update_attribute(:hashed_path, repo.send(:set_repository_hash)) end say "\e[1;31m===> Now go and run script/shard_git_repositories_by_hash as the #{GitoriousConfig['gitorious_user'].inspect} user <===\e[0m" end
Make sure the hashed_path is set in the migration
diff --git a/core/db/migrate/20160608180751_ensure_store_on_orders.rb b/core/db/migrate/20160608180751_ensure_store_on_orders.rb index abc1234..def5678 100644 --- a/core/db/migrate/20160608180751_ensure_store_on_orders.rb +++ b/core/db/migrate/20160608180751_ensure_store_on_orders.rb @@ -0,0 +1,12 @@+class EnsureStoreOnOrders < ActiveRecord::Migration + class Store < ActiveRecord::Base + self.table_name = 'spree_stores' + end + class Order < ActiveRecord::Base + self.table_name = 'spree_orders' + end + def up + default_store = Store.find_by(default: true) + Order.where(store_id: nil).update_all(store_id: default_store.id) + end +end
Add migration to associate stores with orders. This does the same job as the existing solidus:migrations:ensure_store_on_orders:up rake task, but is a migration so that it is easier to run.
diff --git a/spec/system/basic_spec.rb b/spec/system/basic_spec.rb index abc1234..def5678 100644 --- a/spec/system/basic_spec.rb +++ b/spec/system/basic_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper_system' describe 'basic tests' do - it 'class should work without errors' do + it 'class should work without errors and be idempotent' do pp = <<-EOS class { 'gds_accounts': purge_ignore => ['vagrant', 'vboxadd'], @@ -10,6 +10,8 @@ puppet_apply(pp) do |r| r.exit_code.should == 2 + r.refresh + r.exit_code.should be_zero end end end
Test for idempotency in spec:system.
diff --git a/website-docs/payments/create.rb b/website-docs/payments/create.rb index abc1234..def5678 100644 --- a/website-docs/payments/create.rb +++ b/website-docs/payments/create.rb @@ -4,8 +4,8 @@ payment = Mollie::Payment.create( amount: { value: '10.0', currency: 'EUR' }, description: 'My first payment', - redirectUrl: 'https://webshop.example.org/order/12345/', - webhookUrl: 'https://webshop.example.org/payments/webhook/', + redirect_url: 'https://webshop.example.org/order/12345/', + webhook_url: 'https://webshop.example.org/payments/webhook/', metadata: { order_id: '12345' },
Use snake_case for key names
diff --git a/db/migrate/20140610165551_migrate_data_person_to_user.rb b/db/migrate/20140610165551_migrate_data_person_to_user.rb index abc1234..def5678 100644 --- a/db/migrate/20140610165551_migrate_data_person_to_user.rb +++ b/db/migrate/20140610165551_migrate_data_person_to_user.rb @@ -9,7 +9,8 @@ def change TempPerson.all.each do |p| - user = TempUser.find(p.user_id) + user = TempUser.find_by(id: p.user_id) + next unless user if p.public_name.empty? user.name = p.email else
Fix migration for person to user migration
diff --git a/Support/flog.rb b/Support/flog.rb index abc1234..def5678 100644 --- a/Support/flog.rb +++ b/Support/flog.rb @@ -18,6 +18,8 @@ begin flog = Flog.new(quiet: true, continue: true) flog.flog ENV['TM_FILEPATH'] + + system ENV['TM_MATE'], "--clear-mark=warning" flog.each_by_score Flog::THRESHOLD do |class_method, score, call_list| next unless score >= COMPLEXITY_WARNING_THRESHOLD
Clear out marks before running
diff --git a/TTGTagCollectionView.podspec b/TTGTagCollectionView.podspec index abc1234..def5678 100644 --- a/TTGTagCollectionView.podspec +++ b/TTGTagCollectionView.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TTGTagCollectionView" - s.version = "2.0.0" + s.version = "2.0.1" s.summary = "Show rich style text tags or custom tag views in a vertical or horizontal scrollable view." s.description = <<-DESC @@ -17,6 +17,6 @@ s.platform = :ios, '9.0' s.requires_arc = true - s.source_files = 'Sources/**/*' - s.public_header_files = 'Sources/**/*.h' + s.source_files = 'Sources/{BaseTag,TextTag}/**/*.{h,m}', 'Sources/TTGTagCollectionView-Bridging-Header.h' + s.public_header_files = 'Sources/{BaseTag,TextTag}/**/*.h', 'Sources/TTGTagCollectionView-Bridging-Header.h' end
Fix podspec source_files & headers config; Bump version to 2.0.1
diff --git a/db/migrate/20170106122600_populate_editions_part_1.rb b/db/migrate/20170106122600_populate_editions_part_1.rb index abc1234..def5678 100644 --- a/db/migrate/20170106122600_populate_editions_part_1.rb +++ b/db/migrate/20170106122600_populate_editions_part_1.rb @@ -1,4 +1,6 @@ class PopulateEditionsPart1 < ActiveRecord::Migration[5.0] + disable_ddl_transaction! + def up execute "UPDATE content_items SET document_id = ( SELECT id FROM documents
Change query to not use a transaction
diff --git a/lib/deployml/rake/tasks.rb b/lib/deployml/rake/tasks.rb index abc1234..def5678 100644 --- a/lib/deployml/rake/tasks.rb +++ b/lib/deployml/rake/tasks.rb @@ -15,10 +15,10 @@ @project.upload! end - desc 'Deploys the project' task :deploy => :project do @project.deploy! end end +desc 'Deploys the project' task :deploy => 'deploy:deploy'
Add a description to the 'deploy' task.
diff --git a/lib/devise_zxcvbn/model.rb b/lib/devise_zxcvbn/model.rb index abc1234..def5678 100644 --- a/lib/devise_zxcvbn/model.rb +++ b/lib/devise_zxcvbn/model.rb @@ -14,7 +14,12 @@ private def not_weak_password - weak_words = [self.email] + DeviseZxcvbn::EmailTokeniser.split(self.email) + weak_words = if self.email + [self.email, *DeviseZxcvbn::EmailTokeniser.split(self.email)] + else + [] + end + password_score = ::Zxcvbn.test(password, weak_words).score if password_score < min_password_score self.errors.add :password, :weak_password, score: password_score, min_password_score: min_password_score @@ -27,4 +32,4 @@ end end end -end+end
Add email (and tokenized email parts) to dictionary only when non-nil
diff --git a/db/news_seeds.rb b/db/news_seeds.rb index abc1234..def5678 100644 --- a/db/news_seeds.rb +++ b/db/news_seeds.rb @@ -0,0 +1,12 @@+topic = Topic.create!(topic: "News") + +# Real / verified accounts +cnn = TwitterHandle.create!(topic: topic, twitter_handle: "cnnbrk") +bbc = TwitterHandle.create!(topic: topic, twitter_handle: "bbcsport") +onion = TwitterHandle.create!(topic: topic, twitter_handle: "theonion") + + +# Parody accounts +TwitterHandle.create!(topic: topic, twitter_handle: "thefakecnn", real_twitter_handle_id: cnn.id) +TwitterHandle.create!(topic: topic, twitter_handle: "bbcsporf", real_twitter_handle_id: bbc.id) +TwitterHandle.create!(topic: topic, twitter_handle: "theon1on", real_twitter_handle_id: onion.id)
Add real account and parody account for News topic listings - Create one Topic "News" - Add real and fake accounts for CNN, BBC Sports, and The Onion - Each account listing is linked to the "News" topic
diff --git a/src/spec/gocli/integration/nats/nats_server_ca_issues_spec.rb b/src/spec/gocli/integration/nats/nats_server_ca_issues_spec.rb index abc1234..def5678 100644 --- a/src/spec/gocli/integration/nats/nats_server_ca_issues_spec.rb +++ b/src/spec/gocli/integration/nats/nats_server_ca_issues_spec.rb @@ -1,18 +1,18 @@ require_relative '../../spec_helper' describe 'using director with nats server', type: :integration do - # context 'when NATS ca cert provided does not verify the NATS server certificates' do - # with_reset_sandbox_before_each(with_incorrect_nats_server_ca: true) - # - # it 'throws certificate validator error' do - # manifest_hash = Bosh::Spec::Deployments.simple_manifest - # - # _, exit_code = deploy_from_scratch(manifest_hash: manifest_hash, failure_expected: true, return_exit_code: true) - # expect(exit_code).to_not eq(0) - # - # task_id = bosh_runner.get_most_recent_task_id - # debug_output = bosh_runner.run("task #{task_id} --debug", failure_expected: true) - # expect(debug_output).to include('NATS client error: TLS Verification failed checking issuer based on CA') - # end - # end + context 'when NATS ca cert provided does not verify the NATS server certificates' do + with_reset_sandbox_before_each(with_incorrect_nats_server_ca: true) + + it 'throws certificate validator error' do + manifest_hash = Bosh::Spec::Deployments.simple_manifest + + _, exit_code = deploy_from_scratch(manifest_hash: manifest_hash, failure_expected: true, return_exit_code: true) + expect(exit_code).to_not eq(0) + + task_id = bosh_runner.get_most_recent_task_id + debug_output = bosh_runner.run("task #{task_id} --debug", failure_expected: true) + expect(debug_output).to include('NATS client error: TLS Verification failed checking issuer based on CA') + end + end end
Revert "A temp commit to test random failures" This reverts commit 0331336e77a919cfd6c45826eab143a80fa1e2c3. Signed-off-by: Andrew Su <6d7ded18778d8f6854a418786d073050217e1502@pivotal.io>
diff --git a/spec/components/renalware/problems/summary_component_spec.rb b/spec/components/renalware/problems/summary_component_spec.rb index abc1234..def5678 100644 --- a/spec/components/renalware/problems/summary_component_spec.rb +++ b/spec/components/renalware/problems/summary_component_spec.rb @@ -0,0 +1,83 @@+# frozen_string_literal: true + +require "rails_helper" + +describe Renalware::Problems::SummaryComponent, type: :component do + let(:user) { create(:user) } + let(:patient) { create(:patient, by: user) } + + describe "#cache_key" do + let(:component) { described_class.new(patient: patient, current_user: user) } + + it "has a useful value that references the patient and problems in some way" do + expect(component.cache_key).to match("/patients/") + expect(component.cache_key).to match("/problems/") + end + + it "does not change when the patient is reloaded" do + expect { + patient.reload + }.not_to change(component, :cache_key) + end + + it "changes when the patient is touched" do + expect { + patient.touch + }.to change(component, :cache_key) + end + + it "changes when a problem is touched" do + create(:problem, patient: patient, by: user) + + expect { + patient.problems.first.touch + patient.reload + }.to change(component, :cache_key) + end + + it "changes when a problem is added" do + expect { + create(:problem, patient: patient, by: user) + }.to change(component, :cache_key) + end + + it "changes when a problem is removed" do + create(:problem, patient: patient, by: user) + + expect { + patient.problems.first.destroy! + patient.reload + }.to change(component, :cache_key) + end + + it "changes when a note is added to a problem" do + create(:problem, patient: patient, by: user) + + expect { + patient.problems.first.notes.create!(description: "123", by: user) + patient.reload + }.to change(component, :cache_key) + end + + it "changes when a note is removed from a problem" do + create(:problem, patient: patient, by: user) + patient.problems.first.notes.create!(description: "123", by: user) + + expect { + patient.problems.first.notes.first.destroy! + patient.reload + }.to change(component, :cache_key) + end + + it "changes when a problem note is touched" do + create(:problem, patient: patient, by: user) + patient.problems.first.notes.create!(description: "123", by: user) + patient.reload + + expect { + patient.problems.first.notes.first.touch + patient.reload + }.to change(component, :cache_key) + end + end +end
Add caching specs for Problems::SummaryComponent
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index abc1234..def5678 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -4,7 +4,7 @@ if person == nil true else - Membership.pluck(:group_id).include?(group.id) == false + !person.member_of?(group) end end @@ -12,7 +12,7 @@ if person == nil false else - Membership.pluck(:group_id).include?(group.id) == true + person.member_of?(group) end end end
Use member_of for helper methods
diff --git a/Whisper.podspec b/Whisper.podspec index abc1234..def5678 100644 --- a/Whisper.podspec +++ b/Whisper.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Whisper" s.summary = "Whisper is a component that will make the task of display messages and in-app notifications simple." - s.version = "1.1.0" + s.version = "2.0.0" s.homepage = "https://github.com/hyperoslo/Whisper" s.license = 'MIT' s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" }
Update podspec with new version
diff --git a/services/build_runner_service.rb b/services/build_runner_service.rb index abc1234..def5678 100644 --- a/services/build_runner_service.rb +++ b/services/build_runner_service.rb @@ -16,6 +16,7 @@ self.build_runners = [] end + # @return TaskQueue::Task def add_build_runner(build_runner: nil) raise "No build runner provided" unless build_runner.kind_of?(BuildRunner) @@ -25,6 +26,8 @@ build_runner.start end) self.build_runner_task_queue.add_task_async(task: task) + + return task end def build_runner_task_queue
Return the raw TaskQueue::Task when using `add_build_runner`
diff --git a/app/models/token_issuance.rb b/app/models/token_issuance.rb index abc1234..def5678 100644 --- a/app/models/token_issuance.rb +++ b/app/models/token_issuance.rb @@ -20,8 +20,12 @@ # Kick _everyone_ off the broker. The clients with the revoked token will # not be able to reconnect. def maybe_evict_clients - Transport::Mgmt.try(:close_connections_for_username, "device_#{device_id}") + Timeout::timeout(2.5) do + id = "device_#{device_id}" + Transport::Mgmt.try(:close_connections_for_username, id) + end rescue Faraday::ConnectionFailed + rescue Timeout::Error Rollbar.error("Failed to evict clients on token revocation") end
Add timeout to eviction code
diff --git a/gem_config.rb b/gem_config.rb index abc1234..def5678 100644 --- a/gem_config.rb +++ b/gem_config.rb @@ -3,8 +3,13 @@ # The gem command calls us with some extra arguments we don't use. # Filter out anything that doesn't look like a configure option. +OPTIONS = %w{ bindir sbindir libexecdir datadir sysconfdir sharedstatedir + localstatedir libdir includedir oldincludedir infodir mandir + disable enable with without help version quiet silent cache-file + config-cache no-create srcdir prefix exec-prefix}.join('|') + args = [] -ARGV.each { |arg| args << arg if arg =~ /\A--/ } +ARGV.each { |arg| args << arg if arg =~ /\A--(#{OPTIONS})/ } cmd = "sh configure #{args.join(' ')}" puts "\n#{cmd}\n\n"
Discard options that are not valid for the configure script
diff --git a/lib/tasks/effective_email_templates/import_default_views.rake b/lib/tasks/effective_email_templates/import_default_views.rake index abc1234..def5678 100644 --- a/lib/tasks/effective_email_templates/import_default_views.rake +++ b/lib/tasks/effective_email_templates/import_default_views.rake @@ -6,6 +6,14 @@ desc 'Overwrite existing default database email templates from the filesystem.' task regenerate_default_views: :environment do - EffectiveEmailTemplates::TemplateImporter.invoke(overwrite: true) + puts 'By running this task, all email templates that exist in the database will be overwritten by the templates in the filesystem. Do you still want to run this task? (Y/n): ' + answer = $stdin.gets.chomp + + if answer.downcase == 'y' + EffectiveEmailTemplates::TemplateImporter.invoke(overwrite: true) + puts 'Default email templates have been overwritten successfully!' + else + puts 'Cancelled!' + end end end
Add prompt to effective_email_templates:regenerate_default_views rake task
diff --git a/lib/generators/minitest/feature/feature_generator.rb b/lib/generators/minitest/feature/feature_generator.rb index abc1234..def5678 100644 --- a/lib/generators/minitest/feature/feature_generator.rb +++ b/lib/generators/minitest/feature/feature_generator.rb @@ -9,7 +9,7 @@ @_minitest_capybara_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), "templates")) end - class_option :spec, type: :boolean, default: false, desc: "Use Minitest::Spec DSL" + class_option :spec, type: :boolean, default: true, desc: "Use Minitest::Spec DSL" check_class_collision suffix: "Test"
Fix bug in spec configuration The spec flag should have been switched to true. Oops.
diff --git a/lib/vagrant-snap/providers/virtualbox/driver/base.rb b/lib/vagrant-snap/providers/virtualbox/driver/base.rb index abc1234..def5678 100644 --- a/lib/vagrant-snap/providers/virtualbox/driver/base.rb +++ b/lib/vagrant-snap/providers/virtualbox/driver/base.rb @@ -7,7 +7,7 @@ class Base def snapshot_take - execute("snapshot", @uuid, "take", "vagrant-snap", "--pause") + execute("snapshot", @uuid, "take", "vagrant-snap-#{Time.now.to_i}", "--pause") end def snapshot_rollback(bootmode)
Make snapshot name more unique
diff --git a/jobs/nagios.rb b/jobs/nagios.rb index abc1234..def5678 100644 --- a/jobs/nagios.rb +++ b/jobs/nagios.rb @@ -28,11 +28,17 @@ end def criticals - api.service_status(service_status_types: :critical).reject{ |s| s.acknowledged } + services(:critical) end def warnings - api.service_status(service_status_types: :warning) + services(:warning) + end + + def services(type, opts = { include_acknowledged: false }) + services = api.service_status(service_status_types: type) + services.reject!{ |s| s.acknowledged } unless opts[:include_acknowledged] + services end end end
Hide acknowledged Nagios warnings by default
diff --git a/app/models/proposition.rb b/app/models/proposition.rb index abc1234..def5678 100644 --- a/app/models/proposition.rb +++ b/app/models/proposition.rb @@ -7,7 +7,7 @@ alias_method :delivered_by, :representative validates_presence_of :body - validates_uniqueness_of :external_id + validates_uniqueness_of :external_id, allow_nil: true # https://github.com/holderdeord/hdo-site/issues/138 def plain_body Nokogiri::HTML.parse(body).inner_text.strip
Allow nil external_id on Proposition.
diff --git a/lib/promise.rb b/lib/promise.rb index abc1234..def5678 100644 --- a/lib/promise.rb +++ b/lib/promise.rb @@ -18,15 +18,15 @@ end def pending? - @state == :pending + @state.equal?(:pending) end def fulfilled? - @state == :fulfilled + @state.equal?(:fulfilled) end def rejected? - @state == :rejected + @state.equal?(:rejected) end def then(on_fulfill = nil, on_reject = nil, &block)
Kill mutations in state methods
diff --git a/lib/rubulex.rb b/lib/rubulex.rb index abc1234..def5678 100644 --- a/lib/rubulex.rb +++ b/lib/rubulex.rb @@ -2,7 +2,7 @@ require "sinatra" require "sinatra/json" require "slim" -require "sass" +require "sassc" require "rubulex/version" require "rubulex/app"
Use sassc instead of sass
diff --git a/app/controllers/api/articles_controller.rb b/app/controllers/api/articles_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/articles_controller.rb +++ b/app/controllers/api/articles_controller.rb @@ -9,7 +9,7 @@ article = Article.new(article_params) if article.valid? article.save - render plain: 'article successfuly created. Congratulations!', status: :success + render plain: 'article successfuly created. Congratulations!', status: :ok else message = article.errors.messages.map do |key, value| "#{key} #{value.join(',')}" @@ -21,7 +21,7 @@ private def article_params - params.permit(:address, :title, :tag, :recommender, :recorder) + params.require(:article).permit(:address, :title, :tag, :recommender, :recorder) end def token_param
Use article in the params again and fix the status response
diff --git a/lib/generators/templates/migrations/create_mtg_cards.rb b/lib/generators/templates/migrations/create_mtg_cards.rb index abc1234..def5678 100644 --- a/lib/generators/templates/migrations/create_mtg_cards.rb +++ b/lib/generators/templates/migrations/create_mtg_cards.rb @@ -7,8 +7,8 @@ t.string :gatherer_image_url t.string :mana_cost t.string :converted_cost - t.string :oracle_text - t.string :flavor_text + t.text :oracle_text + t.text :flavor_text t.string :mark t.string :power t.string :toughness
Change oracle_text and flavor_text to be db column type 'text' instead of 'string'
diff --git a/spec/controllers/lottery_spec.rb b/spec/controllers/lottery_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/lottery_spec.rb +++ b/spec/controllers/lottery_spec.rb @@ -2,12 +2,14 @@ require 'rails_helper' include AssignmentHelper -describe LotteryController do - describe "#run_intelligent_bid" do - it "the assignment is intelligent" do - assignment = double("Assignment") - allow(assignment).to receive(:is_intelligent) { 1 } - expect(assignment.is_intelligent).to eq(1) - end +describe LotteryController do + describe "#run_intelligent_assignmnent" do + it "webservice call should be successful" do + dat=double("data") + rest=double("RestClient") + result = RestClient.get 'http://www.google.com', :content_type => :json, :accept => :json + expect(result.code).to eq(200) + + end end end
Test for succesful webservice call added
diff --git a/app/jobs/generate_registrations_xls_job.rb b/app/jobs/generate_registrations_xls_job.rb index abc1234..def5678 100644 --- a/app/jobs/generate_registrations_xls_job.rb +++ b/app/jobs/generate_registrations_xls_job.rb @@ -11,9 +11,9 @@ xls = Spreadsheet::Workbook.new sheet = xls.create_worksheet - sheet.update_row 0, "Naam", "Email", "Studentnummer", "Ticket", "Comment", "Te betalen" + sheet.update_row 0, "Datum", "Naam", "Email", "Studentnummer", "Ticket", "Comment", "Te betalen" event.registrations.each.with_index do |reg, i| - sheet.update_row i + 1, reg.name, reg.email, reg.student_number, reg.access_level.name, reg.comment, reg.to_pay + sheet.update_row i + 1, reg.created_at, reg.name, reg.email, reg.student_number, reg.access_level.name, reg.comment, reg.to_pay end file = Tempfile.new
Add created_at to xls export
diff --git a/hutch.gemspec b/hutch.gemspec index abc1234..def5678 100644 --- a/hutch.gemspec +++ b/hutch.gemspec @@ -10,7 +10,7 @@ end gem.add_runtime_dependency 'carrot-top', '~> 0.0.7' gem.add_runtime_dependency 'multi_json', '~> 1.12' - gem.add_runtime_dependency 'activesupport', '>= 4.2', '< 6' + gem.add_runtime_dependency 'activesupport', '>= 4.2', '< 7' gem.name = 'hutch' gem.summary = 'Easy inter-service communication using RabbitMQ.'
Update activesupport requirement from >= 4.2, < 6 to >= 4.2, < 7 Updates the requirements on [activesupport](https://github.com/rails/rails) to permit the latest version. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v6.0.0/activesupport/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v4.2.0...v5.2.3) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/app/helpers/stacks_helper.rb b/app/helpers/stacks_helper.rb index abc1234..def5678 100644 --- a/app/helpers/stacks_helper.rb +++ b/app/helpers/stacks_helper.rb @@ -2,10 +2,12 @@ def render_commit_message(commit) url = commit.pull_request_url || github_commit_url(commit.stack.repo_owner, commit.stack.repo_name, commit.sha) - message = commit.pull_request_title || commit.message + message = content_tag(:span, commit.pull_request_title || commit.message, class: 'event-message') + github_id = commit.pull_request? ? "##{commit.pull_request_id}" : commit.short_sha - message += ' ' + content_tag(:span, "(#{github_id})", class: 'event-number') - link_to(message.html_safe, url, target: '_blank') + identifier = content_tag(:span, "(#{github_id})", class: 'event-number').to_s.html_safe + + link_to(message + identifier, url, target: '_blank') end end
Fix commit message HTML escaping Fixes #76
diff --git a/app/views/destinations/_show.json.jbuilder b/app/views/destinations/_show.json.jbuilder index abc1234..def5678 100644 --- a/app/views/destinations/_show.json.jbuilder +++ b/app/views/destinations/_show.json.jbuilder @@ -1,4 +1,6 @@-json.extract! destination, :id, :name, :street, :postalcode, :city, :lat, :lng, :quantity, :open, :close +json.extract! destination, :id, :name, :street, :postalcode, :city, :lat, :lng, :quantity +json.open destination.open && destination.open.strftime('%H:%M') +json.close destination.close && destination.close.strftime('%H:%M') json.tags do json.array! destination.tags.collect{ |t| t.id } end
Fix display window format on destination list
diff --git a/app/policies/place_policy.rb b/app/policies/place_policy.rb index abc1234..def5678 100644 --- a/app/policies/place_policy.rb +++ b/app/policies/place_policy.rb @@ -1,7 +1,7 @@ class PlacePolicy < ApplicationPolicy class Scope < Scope def resolve - if user.admin? + if user&.admin? scope.all else scope.approved
Check if user is signed
diff --git a/app/queries/get_linkables.rb b/app/queries/get_linkables.rb index abc1234..def5678 100644 --- a/app/queries/get_linkables.rb +++ b/app/queries/get_linkables.rb @@ -7,14 +7,7 @@ end def call - latest_updated_at = Edition - .where(document_type: [document_type, "placeholder_#{document_type}"]) - .order('updated_at DESC') - .limit(1) - .pluck(:updated_at) - .last - - Rails.cache.fetch ["linkables", document_type, latest_updated_at] do + Rails.cache.fetch ["linkables", document_type, latest_updated_at(document_type)] do linkables_query(document_type) .map { |result| LinkablePresenter.new(*result) } end @@ -23,6 +16,14 @@ private attr_reader :document_type + + def latest_updated_at(document_type) + non_placeholder = Edition.where(document_type: document_type) + .maximum("updated_at") + placeholder = Edition.where(document_type: "placeholder_#{document_type}") + .maximum("updated_at") + [non_placeholder, placeholder].compact.max + end def linkables_query(document_type) Edition.with_document
Use two queries to get latest_updated_at for linkables Querying on a single document_type yields a significantly faster result than two, so two queries beat one.
diff --git a/libsyn.gemspec b/libsyn.gemspec index abc1234..def5678 100644 --- a/libsyn.gemspec +++ b/libsyn.gemspec @@ -21,4 +21,5 @@ spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "vcr", "~> 2.9.2" + spec.add_development_dependency "pry", "~> 0.10.0" end
Add pry as development dependency
diff --git a/app/workers/entry_deleter.rb b/app/workers/entry_deleter.rb index abc1234..def5678 100644 --- a/app/workers/entry_deleter.rb +++ b/app/workers/entry_deleter.rb @@ -7,12 +7,22 @@ entry_count = Entry.where(feed_id: feed_id).count if entry_count > entry_limit entries_to_keep = Entry.where(feed_id: feed_id).order('published DESC').limit(entry_limit).pluck('entries.id') - entries_to_delete = Entry.select(:id).where(feed_id: feed_id, starred_entries_count: 0).where.not(id: entries_to_keep) + entries_to_delete = Entry.select(:id, :public_id).where(feed_id: feed_id, starred_entries_count: 0).where.not(id: entries_to_keep) entries_to_delete_ids = entries_to_delete.map {|entry| entry.id } + entries_to_delete_public_ids = entries_to_delete.map {|entry| entry.public_id } # Delete records UnreadEntry.where(entry_id: entries_to_delete_ids).delete_all entries_to_delete.delete_all + + Sidekiq.redis do |conn| + conn.pipelined do + entries_to_delete_public_ids.each do |public_id| + conn.hdel("entry:public_ids:#{public_id[0..4]}", public_id) + end + end + end + end end
Remove old public_ids from redis.
diff --git a/lib/helios/cylon_effect.rb b/lib/helios/cylon_effect.rb index abc1234..def5678 100644 --- a/lib/helios/cylon_effect.rb +++ b/lib/helios/cylon_effect.rb @@ -27,7 +27,6 @@ end def pause - sleep 0.1 end def set_light(index, value)
Remove sleep to speed up effect
diff --git a/lib/ice_cube/deprecated.rb b/lib/ice_cube/deprecated.rb index abc1234..def5678 100644 --- a/lib/ice_cube/deprecated.rb +++ b/lib/ice_cube/deprecated.rb @@ -7,7 +7,7 @@ def deprecated_alias(name, replacement) # Create a wrapped version define_method(name) do |*args, &block| - warn "IceCube: #{self.class}##{name} is deprecated, please use ##{replacement} at: #{ caller[0] }" + warn "IceCube: #{self.class}##{name} is deprecated (use #{replacement})", caller[0] send replacement, *args, &block end end @@ -21,14 +21,15 @@ alias_method old_name, name # And replace it with a wrapped version define_method(name) do |*args, &block| - warn "IceCube: #{self.class}##{name} is deprecated, please use ##{replacement} at: #{ caller[0] }" + warn "IceCube: #{self.class}##{name} is deprecated (use #{replacement})", caller[0] send old_name, *args, &block end end def self.schedule_options(schedule, options) if options[:start_date_override] - warn "IceCube: :start_date_override option is deprecated, please use a block {|s| s.start_time = override }. at: #{ caller[0] }" + warn "IceCube: :start_date_override option is deprecated " \ + "(use a block: `{|s| s.start_time = override }`)", caller[0] schedule.start_time = options[:start_date_override] end end
Update deprecation messages to print caller on own line
diff --git a/bbq-rspec/lib/bbq/rspec.rb b/bbq-rspec/lib/bbq/rspec.rb index abc1234..def5678 100644 --- a/bbq-rspec/lib/bbq/rspec.rb +++ b/bbq-rspec/lib/bbq/rspec.rb @@ -27,7 +27,11 @@ end ::RSpec.configure do |config| - config.include Feature, :type => :acceptance, :example_group => {:file_path => %r{spec/acceptance}} + if Gem::Version.new(::RSpec::Core::Version::STRING) >= Gem::Version.new('2.99') + config.include Feature, :type => :acceptance, :file_path => %r{spec/acceptance} + else + config.include Feature, :type => :acceptance, :example_group => {:file_path => %r{spec/acceptance}} + end config.include Matchers config.after :each, :type => :acceptance do ::Bbq::Session.pool.release
Fix deprecation warning for RSpec 3
diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index abc1234..def5678 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -2,7 +2,7 @@ skip_before_action :authenticate_user!, raise: false def show - render status: status, template: "errors/#{status_code}" + render status: status, template: "errors/#{status_code}", formats: [:html] end protected
Fix dynamic error rendering for production * Explicitly specify to render html template
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index abc1234..def5678 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -5,7 +5,7 @@ page = params.fetch(:page, 1) query = params[:query] - @results = DocumentcloudSearcherService.new("Mujica", page).call + @results = DocumentcloudSearcherService.new(query, page).call respond_to do |format| format.html # show.html.erb
Make the actual search qith the query
diff --git a/opsworks_custom_env/recipes/write_config_from_opsworks_env.rb b/opsworks_custom_env/recipes/write_config_from_opsworks_env.rb index abc1234..def5678 100644 --- a/opsworks_custom_env/recipes/write_config_from_opsworks_env.rb +++ b/opsworks_custom_env/recipes/write_config_from_opsworks_env.rb @@ -0,0 +1,13 @@+# Set up app's stack environment variables in the environment. +node[:deploy].each do |application, deploy| + custom_env_template do + application application + deploy deploy + env node[:deploy][application][:environment_variables] + + if node[:opsworks][:instance][:layers].include?('rails-app') + notifies :run, resources(:execute => "restart Rails app #{application} for custom env") + end + end + +end
Set up configuration file from opsworks env variables
diff --git a/lib/magnum/payload/base.rb b/lib/magnum/payload/base.rb index abc1234..def5678 100644 --- a/lib/magnum/payload/base.rb +++ b/lib/magnum/payload/base.rb @@ -47,12 +47,16 @@ private def parse_payload(payload) - if payload.kind_of?(String) - Hashr.new(MultiJson.decode(payload)) - elsif payload.kind_of?(Hash) - Hashr.new(payload) - else - raise ArgumentError, "String or Hash required" + begin + if payload.kind_of?(String) + Hashr.new(MultiJson.decode(payload)) + elsif payload.kind_of?(Hash) + Hashr.new(payload) + else + raise ArgumentError, "String or Hash required" + end + rescue MultiJson::LoadError + raise Magnum::Payload::ParseError, "Valid JSON required" end end end
Raise ParseError on invalid json
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -2,11 +2,9 @@ ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') require 'cucumber/rails/world' -require 'cucumber/formatters/unicode' # Comment out this line if you don't want Cucumber Unicode support +require 'webrat/rails' +require 'cucumber/rails/rspec' Cucumber::Rails.use_transactional_fixtures -require 'cucumber/rails/rspec' -require 'webrat/rspec-rails' -require 'webrat' module HumanMethods def dehumanize(string) @@ -29,10 +27,6 @@ world.extend(HelperMethods) end -Webrat.configure do |config| - config.mode = :rails -end - module HelperMethods def set_instance_variable(name, value) instance_variable_name = "@#{name}" @@ -42,4 +36,4 @@ instance_variable_name = "@#{name}" instance_variable_get(instance_variable_name) end -end+end
Fix cucumber configuration for integrity
diff --git a/rack-authenticate.gemspec b/rack-authenticate.gemspec index abc1234..def5678 100644 --- a/rack-authenticate.gemspec +++ b/rack-authenticate.gemspec @@ -21,5 +21,5 @@ s.add_dependency 'ruby-hmac', '~> 0.4.0' s.add_dependency 'rack', '~> 1.3.5' s.add_development_dependency 'rspec', '~> 2.8.0.rc1' - s.add_development_dependency 'sinatra', '~> 1.3.1' + s.add_development_dependency 'rack-test', '~> 0.6.1' end
Use rack-test instead of sinatra.
diff --git a/routes/stars/get_images.rb b/routes/stars/get_images.rb index abc1234..def5678 100644 --- a/routes/stars/get_images.rb +++ b/routes/stars/get_images.rb @@ -27,6 +27,10 @@ images = Starsgcsimage.all(limit: 10, order: [:created_at.desc]) - Starsgcsimage.all(Starsgcsimage.starsimagevote.starsupvotes + .starsvote.fbstarsprofile.id => id) - + Starsgcsimage.all(Starsgcsimage.starsimagevote.starsdownvotes + .starsvote.fbstarsprofile.id => id) - + Starsgcsimage.all(Starsgcsimage.starsimagevote.starsgreatvotes .starsvote.fbstarsprofile.id => id) images_hash = []
Remove downvotes and greatvotes for next images
diff --git a/lib/clipboard/cygwin.rb b/lib/clipboard/cygwin.rb index abc1234..def5678 100644 --- a/lib/clipboard/cygwin.rb +++ b/lib/clipboard/cygwin.rb @@ -5,11 +5,11 @@ extend self def paste(_ = nil) - File.read("/dev/clipboard") + ::File.read("/dev/clipboard") end def copy(data) - File.open("/dev/clipboard", "w"){ |f| f.write(data) } + ::File.open("/dev/clipboard", "w"){ |f| f.write(data) } paste end
Use system File class instead of Clipboard::File.
diff --git a/app/models/concerns/with_language.rb b/app/models/concerns/with_language.rb index abc1234..def5678 100644 --- a/app/models/concerns/with_language.rb +++ b/app/models/concerns/with_language.rb @@ -7,7 +7,7 @@ scope :with_language, -> (language) { if language where( - "languages @> ARRAY[:language] AND language = :language + "languages @> ARRAY[:language] AND #{self.table_name}.language = :language OR NOT languages @> ARRAY[:language] AND is_default_language", language: language ) @@ -16,4 +16,4 @@ end } end -end+end
Fix issue with referencing correct language column
diff --git a/app/serializers/author_serializer.rb b/app/serializers/author_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/author_serializer.rb +++ b/app/serializers/author_serializer.rb @@ -1,9 +1,3 @@ class AuthorSerializer < ActiveModel::Serializer - attributes :id, :name, :avatar_url, :description - - - def avatar_url - object.avatar.url(:thumb) - end - + attributes :id, :name, :avatar_url end
Update author serializer to reflect removal of Paperclip
diff --git a/lib/rtorctl.rb b/lib/rtorctl.rb index abc1234..def5678 100644 --- a/lib/rtorctl.rb +++ b/lib/rtorctl.rb @@ -0,0 +1,52 @@+#!/usr/bin/env ruby +require 'bundler/setup' +require 'citrus' +require 'socket' + +# Load all of our grammars. +def load_grammars() + # This is a really long way of saying ../grammars/. + dot_dot = File.dirname(File.absolute_path(File.dirname(__FILE__))) + grammar_dir = File.join(dot_dot, 'grammars') + + Dir.entries(grammar_dir).grep(/\.citrus$/) do |grammar| + Citrus.load( File.join(grammar_dir, grammar) ) + end +end +load_grammars() + +module RTorCtl + class RTorCtl + def initialize() + @connection = TCPSocket.new('127.0.0.1', 9051) + end + + def write(str) + @connection.write(str + "\r\n") + end + + # Block until we get a single response from the controller, then return it. + def get_response() + data = "" + + while true + data += @connection.read(4) + + case data[-1] + when ' ' + data += @connection.gets("\r\n") + return data + + when '-' + data += @connection.gets("\r\n") + + when '+' + data += @connection.gets("\r\n.\r\n") + end + end + + data + end + end +end +
Add an empty shell of an RTorCtl::RTorCtl.
diff --git a/import_o_matic.gemspec b/import_o_matic.gemspec index abc1234..def5678 100644 --- a/import_o_matic.gemspec +++ b/import_o_matic.gemspec @@ -15,7 +15,7 @@ s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] s.test_files = Dir["test/**/*"] - s.add_dependency "rails", "~> 4" + s.add_dependency "rails", ">= 4" s.add_development_dependency "sqlite3" s.add_development_dependency "globalize", "~> 5.0.0"
Allow usage with Rails 4.x and 5.x
diff --git a/core/process/abort_spec.rb b/core/process/abort_spec.rb index abc1234..def5678 100644 --- a/core/process/abort_spec.rb +++ b/core/process/abort_spec.rb @@ -8,6 +8,16 @@ after :each do rm_r @name + end + + it "raises a SystemExit with the given message" do + lambda do + begin + abort "message" + rescue SystemExit => e + e.message.should == "message" + end + end.should complain(/message/) end platform_is_not :windows do
Add spec for abort setting the message of the SystemExit exception
diff --git a/recipes/amqp-publisher.rb b/recipes/amqp-publisher.rb index abc1234..def5678 100644 --- a/recipes/amqp-publisher.rb +++ b/recipes/amqp-publisher.rb @@ -1,5 +1,7 @@ remote_file "#{node['gerrit']['install_dir']}/plugins/rabbitmq.jar" do - source "https://github.com/TYPO3-infrastructure/gerrit-rabbitmq-plugin/releases/download/rabbitmq-1.5-SNAPSHOT-20150203154700/rabbitmq-1.5-SNAPSHOT-20150203154700.jar" + source "http://st-g.de/fileadmin/downloads/2015-10/rabbitmq-1.5-SNAPSHOT-20150203154700.jar" + # this should be the following URL, but somehow this doesn't work today (see http://stackoverflow.com/questions/33223904/chef-remote-file-download-from-github-fails) + # source "https://github.com/TYPO3-infrastructure/gerrit-rabbitmq-plugin/releases/download/rabbitmq-1.5-SNAPSHOT-20150203154700/rabbitmq-1.5-SNAPSHOT-20150203154700.jar" owner node['gerrit']['user'] group node['gerrit']['group'] end
Use temporary URL for rabbitmq plugin download
diff --git a/pakyow-presenter/spec/unit/app/resource_bindings_spec.rb b/pakyow-presenter/spec/unit/app/resource_bindings_spec.rb index abc1234..def5678 100644 --- a/pakyow-presenter/spec/unit/app/resource_bindings_spec.rb +++ b/pakyow-presenter/spec/unit/app/resource_bindings_spec.rb @@ -0,0 +1,76 @@+require_relative '../../integration/support/int_helper' +#require 'core/app' + +describe Pakyow::App, '#resource' do + include ReqResHelpers + + before do + Pakyow::App.stage(:test) + Pakyow.app.context = Pakyow::AppContext.new(mock_request, mock_response) + end + + context 'called with a resource name, path, and block' do + before do + Pakyow.app.resource :test, "tests" do + list do + end + end + + Pakyow.app.presenter.load + end + + it 'creates a binding set for the resource name' do + scope = Pakyow::Presenter::Binder.instance.sets[:main].scopes[:test] + expect(scope).not_to be_nil + end + + describe 'the binding set block' do + let(:binding_set_block) { Pakyow.app.bindings[:main] } + + it 'exists' do + expect(binding_set_block).to be_kind_of Proc + end + + context 'when evaluated' do + let(:set) { Pakyow::Presenter::BinderSet.new(&binding_set_block) } + + it 'creates restful bindings with with scope for resource name' do + expect(set.has_prop?(:test, :_root, {})).to be true + end + end + end + end + + context 'called without a block' do + before do + Pakyow::App.routes :test do + restful :test, "tests" do + list do + end + end + end + end + + it 'presenter does not override core method' do + expect(Pakyow.app.resource(:test)).to eq Pakyow::App.routes[:test] + end + end + + context 'called without a path' do + it 'presenter does not override core method' do + no_path_passed = Proc.new { Pakyow.app.resource(:test) {} } + nil_path_passed = Proc.new { Pakyow.app.resource(:test, nil) {} } + expect(no_path_passed).to raise_error ArgumentError + expect(nil_path_passed).to raise_error ArgumentError + end + end + + context 'called without a resource name' do + it 'presenter does not override core method' do + no_name_passed = Proc.new { Pakyow.app.resource() {} } + nil_name_passed = Proc.new { Pakyow.app.resource(nil, "tests") {} } + expect(no_name_passed).to raise_error ArgumentError + expect(nil_name_passed).to raise_error ArgumentError + end + end +end
Add test for resource bindings
diff --git a/spec/dummy/spec/features/middleware_integration_spec.rb b/spec/dummy/spec/features/middleware_integration_spec.rb index abc1234..def5678 100644 --- a/spec/dummy/spec/features/middleware_integration_spec.rb +++ b/spec/dummy/spec/features/middleware_integration_spec.rb @@ -3,6 +3,7 @@ feature 'Middleware integration' do scenario "Integrating the middleware into the Rack stack" do pending "The expectation doesn't work, see http://stackoverflow.com/questions/21940082" + # More (possibly) related infos here: http://shift.mirego.com/post/68808986788/how-to-write-tests-for-rack-middleware and http://www.sinatrarb.com/testing.html Headhunter::Rack::CapturingMiddleware.any_instance.should_receive(:call) visit posts_path end
Add links to possibly related stuff
diff --git a/spec/unit/data_mapper/mapper/class_methods/from_spec.rb b/spec/unit/data_mapper/mapper/class_methods/from_spec.rb index abc1234..def5678 100644 --- a/spec/unit/data_mapper/mapper/class_methods/from_spec.rb +++ b/spec/unit/data_mapper/mapper/class_methods/from_spec.rb @@ -4,17 +4,15 @@ subject { described_class.from(other, name) } let(:model) { - mock_model(:TestModel) + mock_model('TestModel') } let(:other) { - model_class = model - address_model = mock_model('Address') - - Class.new(described_class) { - model model_class + klass = Class.new(described_class) { map :id, Integer } + klass.model(model) + klass } context "with another mapper" do @@ -30,6 +28,10 @@ its(:model) { should be(model) } its(:name) { should eql(name) } + + it "copies attributes" do + subject.attributes[:id].should be_instance_of(Mapper::Attribute::Primitive) + end end end end
Clean up spec for Mapper.from
diff --git a/lib/twat/endpoints/base.rb b/lib/twat/endpoints/base.rb index abc1234..def5678 100644 --- a/lib/twat/endpoints/base.rb +++ b/lib/twat/endpoints/base.rb @@ -6,7 +6,7 @@ def authorize_account(name) oauth_conf = oauth_options.merge ({ :site => url }) - oauth = OAuth::Consumer.new( *[*consumer_info.values, oauth_conf] ) + oauth = OAuth::Consumer.new(consumer_info[:consumer_key], consumer_info[:consumer_secret] oauth_conf]) token_request = oauth.get_request_token() puts "Please authenticate the application at #{token_request.authorize_url}, then enter pin" pin = STDIN.gets.chomp
Remove potentially broken implementation dependant ordering
diff --git a/example/foobar.rb b/example/foobar.rb index abc1234..def5678 100644 --- a/example/foobar.rb +++ b/example/foobar.rb @@ -17,6 +17,77 @@ tag 'Service', 'foobar' tag 'Stack', stack.cloud end + + # + # Create an instance with encrypted EBS mount point + # and an ephemeral volume + # + + # Create a KMS encryption key to encrypt the volume + kms_key 'FoobarKmsKey' do + description 'Used to encrypt volumes' + + # don't delete the key when this stack is deleted + deletion_policy 'Retain' + + policy do + allow do + sid 'Enable IAM User Permissions' + principal :AWS => ["arn:aws:iam::#{MY_AWS_ACCOUNT_NUMBER}:root"] + action 'kms:*' + resource '*' + end + end + end + + ec2_volume 'FoobarEncryptedVol' do + availability_zone 'us-east-1a' + size 20 + volume_type :gp2 + + # encrypt with the key from this stack + encrypted true + kms_key fn_ref('FoobarKmsKey') + + # don't delete the volume when this stack is deleted + deletion_policy 'Retain' + + tag 'Name', 'Foobar Encrypted Volume' + tag 'Service', 'foobar' + tag 'Stack', stack.cloud + end + + ec2_instance 'FoobarWithEncryptedVol' do + image_id stack['foobar-image'] + instance_type 'm3.medium' + key_name 'production' + availability_zone 'us-east-1a' + + # give the instance a static private IP and ensure + # it has a public ip regardless of subnet default setting + network_interface do + private_ip_address '10.1.2.3' + associate_public_ip_address true + security_group stack.get('security-groups', 'Foobar') + subnet stack.get('vpc', 'TargetVPCSubnetPublic3') + end + + # mount the encrypted volume at /dev/xvdf + volume do + device '/dev/sdf' + volume_id fn_ref('FoobarEncryptedVol') + end + + # mount an ephemeral drive at /dev/xvdc + block_device do + device '/dev/sdc' + virtual_name 'ephemeral0' + end + + tag 'Name', 'Foobar Encrypted' + tag 'Service', 'foobar' + tag 'Stack', stack.cloud + end end end end
Add more documentation for ec2_instance
diff --git a/breadcrumbs_on_rails.gemspec b/breadcrumbs_on_rails.gemspec index abc1234..def5678 100644 --- a/breadcrumbs_on_rails.gemspec +++ b/breadcrumbs_on_rails.gemspec @@ -18,4 +18,6 @@ spec.files = `git ls-files`.split("\n") spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") spec.extra_rdoc_files = %w( LICENSE.txt ) + + spec.add_dependency "rails", ">= 5.0" end
Add Rails as explicit dependency Closed GH-109
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -21,3 +21,7 @@ end end +Before do + @aruba_timeout_seconds = 10 +end +
Increase aruba timeout from default of 3 seconds to 10. cucumber.feature takes longer than 3 seconds.
diff --git a/lib/krikri.rb b/lib/krikri.rb index abc1234..def5678 100644 --- a/lib/krikri.rb +++ b/lib/krikri.rb @@ -19,27 +19,5 @@ 'krikri/entity_behaviors/aggregation_entity_behavior' autoload :OriginalRecordEntityBehavior, 'krikri/entity_behaviors/original_record_entity_behavior' + end - -## -# Monkey-patch the EBNF Scanner to catch larger terminals. -# -# @see https://github.com/gkellogg/ebnf/issues/5 -module EBNF::LL1 - class Scanner - def initialize(input, options = {}) - # use an arbitrarily large low/high water mark. We want to make sure we're - # feeding in the entire terminal - @options = options.merge(:high_water => 1_048_576, - :low_water => 1_048_576) - - if input.respond_to?(:read) - @input = input - super("") - feed_me - else - super(input.to_s) - end - end - end -end
Revert "Monkeypatch parser Scanner to catch long terminals" This reverts commit cd2caaa294643b2684ae3cb67b19f147de0b41e1.
diff --git a/lib/thinking_sphinx/active_record/callbacks/delta_callbacks.rb b/lib/thinking_sphinx/active_record/callbacks/delta_callbacks.rb index abc1234..def5678 100644 --- a/lib/thinking_sphinx/active_record/callbacks/delta_callbacks.rb +++ b/lib/thinking_sphinx/active_record/callbacks/delta_callbacks.rb @@ -16,9 +16,8 @@ end def before_save - return unless new_or_changed? && - !ThinkingSphinx::Callbacks.suspended? && - delta_indices? + return unless !ThinkingSphinx::Callbacks.suspended? && delta_indices? && + new_or_changed? processors.each { |processor| processor.toggle instance } end
Check for deltas at a higher level first. Only if deltas are enabled and exist for this model do we actually care if there are changes. This does mean things will be slightly slower on the first call (as indices are loaded to the point of knowing if deltas are in play), but that’ll be cached for future calls.
diff --git a/app/controllers/admin/process_version_jobs_controller.rb b/app/controllers/admin/process_version_jobs_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/process_version_jobs_controller.rb +++ b/app/controllers/admin/process_version_jobs_controller.rb @@ -31,7 +31,7 @@ end def album_contains_all_photos - album_photos = Album.find_by_slug(album).photos.pluck(:filename) + album_photos = Album.find_by_slug(album_slug).photos.pluck(:filename) photo_filenames.all? { |filename| album_photos.include?(filename) } end
Fix individual photo version processing
diff --git a/db/migrate/20190221195501_change_notification_id_to_bigint.rb b/db/migrate/20190221195501_change_notification_id_to_bigint.rb index abc1234..def5678 100644 --- a/db/migrate/20190221195501_change_notification_id_to_bigint.rb +++ b/db/migrate/20190221195501_change_notification_id_to_bigint.rb @@ -0,0 +1,9 @@+class ChangeNotificationIdToBigint < ActiveRecord::Migration[6.0] + def up + change_column :notifications, :id, :bigint + end + + def down + change_column :notifications, :id, :integer + end +end
Update notification_id primary key to bigint
diff --git a/lib/strenv.rb b/lib/strenv.rb index abc1234..def5678 100644 --- a/lib/strenv.rb +++ b/lib/strenv.rb @@ -25,6 +25,10 @@ # STRICT_ENV.with_protected_env { example.run } # end # end + # + # Note that this may play up with your editor features if it mutates environment variables + # based on the position in the script and it runs in the same environment as your objects + # under test (TextMate does this). def with_protected_env(&blk) preserved = ENV.to_h.dup yield
Add a note on TM_ envvars
diff --git a/app/jobs/list_cleanup_job.rb b/app/jobs/list_cleanup_job.rb index abc1234..def5678 100644 --- a/app/jobs/list_cleanup_job.rb +++ b/app/jobs/list_cleanup_job.rb @@ -4,9 +4,9 @@ # rescue_from(Gibbon::MailChimpError) do |exception| # end - def perform(lists) + def perform(list_uids = []) gibbon_service = GibbonService.new - contacts_data = gibbon_service.delete_lists(lists.pluck(:uid)) - lists.destroy_all + contacts_data = gibbon_service.delete_lists(list_uids) + Spree::Marketing::List.where(uid: list_uids).destroy_all end end
Modify list clean up job
diff --git a/chef/roles/flyway-mysql.rb b/chef/roles/flyway-mysql.rb index abc1234..def5678 100644 --- a/chef/roles/flyway-mysql.rb +++ b/chef/roles/flyway-mysql.rb @@ -1,17 +1,19 @@ name "flyway-mysql" description "flyway mysql demo" +override_attributes( + :mysql => { + :server_root_password => "password", + :server_debian_password => "password", + :server_repl_password => "password", + :root_network_acl => ['0.0.0.0'], + :allow_remote_root => true + }, + :java => { + :install_flavor => "oracle", + :jdk_version => "7", + :oracle => { "accept_oracle_download_terms" => true } + } +) + +# todo Need to look into why putting run list after attribute overrides successfully applies the overrides, but not vice versa, was recommended, I assume this role file is imperatively executed env_run_lists "_default" => %w[ apt openssl build-essential mysql::server java vagrant ] -override_attributes \ - :mysql => { - :server_root_password => "password", - :server_debian_password => "password", - :server_repl_password => "password", - :root_network_acl => ['0.0.0.0'], - :allow_remote_root => true - } -override_attributes \ - :java => { - :install_flavor => "oracle", - :jdk_version => "7", - :oracle => { "accept_oracle_download_terms" => true } - }
Call override attributes before setting run list, attributes for mysql weren't taking precedence