diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,8 @@ # coding: utf-8 +if RUBY_VERSION.split('.')[1].to_i > 8 + Encoding.default_external = 'UTF-8' +end + require 'rubygems' require 'rack' require 'lib/jibjob'
Handle external encoding default for Ruby 1.9
diff --git a/week-8/ruby/ruby-review.rb b/week-8/ruby/ruby-review.rb index abc1234..def5678 100644 --- a/week-8/ruby/ruby-review.rb +++ b/week-8/ruby/ruby-review.rb @@ -36,4 +36,10 @@ # Reflection # I am happy I did my cheat sheet code first! -# It was easier than I thought? +# # It was easier than I thought? +# What concepts did you review or learn in this challenge? +# I reviewed the iteration +# What is still confusing to you about Ruby? +# I am Ok with this exercise +# What are you going to study to get more prepared for Phase 1? +# I will do at least one other Ruby exercise
Update ruby challenge week-8 with reflection
diff --git a/TEQuickPageViewController.podspec b/TEQuickPageViewController.podspec index abc1234..def5678 100644 --- a/TEQuickPageViewController.podspec +++ b/TEQuickPageViewController.podspec @@ -0,0 +1,41 @@+Pod::Spec.new do |s| + + # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # These will help people to find your library, and whilst it + # can feel like a chore to fill in it's definitely to your advantage. The + # summary should be tweet-length, and the description more in depth. + # + + s.name = "TEQuickPageViewController" + s.version = "1.0.0" + s.summary = "Add pages to a PageViewController directly in Storyboard." + + s.description = <<-DESC + TEQuickPageViewController is an extension of UIPageViewController to allow adding Views to a Page View directly in your Storyboard, without any additional code. + + Just add your Page View Controller and View Controllers to your Storyboard, then set a few attributes to add your View Controllers to the sequence of pages. + DESC + + s.homepage = "http://EXAMPLE/TEQuickPageViewController" + # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" + s.license = "MIT" + s.author = { "Tom Elliott" => "tom.w.elliott@gmail.com" } + s.platform = :ios + # s.platform = :ios, "5.0" + s.source = { :git => "https://github.com/theothertomelliott/TEQuickPageViewController.git", :tag => "1.0.0" } + s.source_files = "TEQuickPageViewController/Library", "TEQuickPageViewController/Library/**/*.{h,m}" + s.exclude_files = "TEQuickPageViewController/Library/Exclude" + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # s.framework = "SomeFramework" + # s.frameworks = "SomeFramework", "AnotherFramework" + + # s.library = "iconv" + # s.libraries = "iconv", "xml2" + +end
Add podspec (not linted, need to branch first).
diff --git a/actionpack/lib/action_dispatch/journey/nfa/simulator.rb b/actionpack/lib/action_dispatch/journey/nfa/simulator.rb index abc1234..def5678 100644 --- a/actionpack/lib/action_dispatch/journey/nfa/simulator.rb +++ b/actionpack/lib/action_dispatch/journey/nfa/simulator.rb @@ -25,8 +25,6 @@ state = tt.eclosure(0) until input.eos? sym = input.scan(%r([/.?]|[^/.?]+)) - - # FIXME: tt.eclosure is not needed for the GTG state = tt.eclosure(tt.move(state, sym)) end
Remove 7 years old note-to-self by tenderlove Introduced in rails/journey@a806beb [ci skip]
diff --git a/wkhtmltopdf-heroku.gemspec b/wkhtmltopdf-heroku.gemspec index abc1234..def5678 100644 --- a/wkhtmltopdf-heroku.gemspec +++ b/wkhtmltopdf-heroku.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "wkhtmltopdf-heroku" - s.version = "2.12.2.1" + s.version = "2.12.2.4" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.required_ruby_version = '>= 1.8.7'
Update gemspec with new version number
diff --git a/spec/support/examples_group/shared_examples_for_new_or_discover_button.rb b/spec/support/examples_group/shared_examples_for_new_or_discover_button.rb index abc1234..def5678 100644 --- a/spec/support/examples_group/shared_examples_for_new_or_discover_button.rb +++ b/spec/support/examples_group/shared_examples_for_new_or_discover_button.rb @@ -0,0 +1,16 @@+shared_examples_for 'a _new or _discover button' do + describe '#visible?' do + context 'when button present on a sublist view screen of a CI' do + let(:lastaction) { 'show' } + %w(main vms instances all_vms).each do |display| + context "and display == #{display}" do + let(:display) { display } + it { expect(subject.visible?).to be_truthy } + end + context 'and display is sublist-like' do + it { expect(subject.visible?).to be_falsey } + end + end + end + end +end
Create shared_examples for *_new and *_discover buttons
diff --git a/core/spec/models/spree/calculator_spec.rb b/core/spec/models/spree/calculator_spec.rb index abc1234..def5678 100644 --- a/core/spec/models/spree/calculator_spec.rb +++ b/core/spec/models/spree/calculator_spec.rb @@ -1,69 +1,36 @@ require 'spec_helper' + describe Spree::Calculator, :type => :model do - let(:order) { create(:order) } - let!(:line_item) { create(:line_item, :order => order) } - let(:shipment) { create(:shipment, :order => order, :stock_location => create(:stock_location_with_items)) } + class SimpleCalculator < Spree::Calculator + def compute_simple_computable line_item + 'computed' + end + end + + class SimpleComputable + end + context "with computable" do - context "and compute methods stubbed out" do - context "with a Spree::LineItem" do - it "calls compute_line_item" do - expect(subject).to receive(:compute_line_item).with(line_item) - subject.compute(line_item) - end - end - context "with a Spree::Order" do - it "calls compute_order" do - expect(subject).to receive(:compute_order).with(order) - subject.compute(order) - end - end + let(:calculator) { SimpleCalculator.new } + let(:computable) { SimpleComputable.new } - context "with a Spree::Shipment" do - it "calls compute_shipment" do - expect(subject).to receive(:compute_shipment).with(shipment) - subject.compute(shipment) - end - end + subject { SimpleCalculator.new.compute computable } - context "with a arbitray object" do - it "calls the correct compute" do - s = "Calculator can all" - expect(subject).to receive(:compute_string).with(s) - subject.compute(s) - end + it 'calls compute method of class type' do + expect(subject).to eq ( 'computed' ) + end + + context 'computable does not implement right function name' do + let(:computable) { Spree::LineItem.new } + + it 'raises an error' do + expect { subject }.to raise_error NotImplementedError, /Please implement \'compute_line_item\(line_item\)\' in your calculator/ end end - context "with no stubbing" do - context "with a Spree::LineItem" do - it "raises NotImplementedError" do - expect{subject.compute(line_item)}.to raise_error NotImplementedError, /Please implement \'compute_line_item\(line_item\)\' in your calculator/ - end - end - - context "with a Spree::Order" do - it "raises NotImplementedError" do - expect{subject.compute(order)}.to raise_error NotImplementedError, /Please implement \'compute_order\(order\)\' in your calculator/ - end - end - - context "with a Spree::Shipment" do - it "raises NotImplementedError" do - expect{subject.compute(shipment)}.to raise_error NotImplementedError, /Please implement \'compute_shipment\(shipment\)\' in your calculator/ - end - end - - context "with a arbitray object" do - it "raises NotImplementedError" do - s = "Calculator can all" - expect{subject.compute(s)}.to raise_error NotImplementedError, /Please implement \'compute_string\(string\)\' in your calculator/ - end - end - end end - end
Remove all the stubbing in the calculator spec From the previous spec it was very unclear how a calculator should work. By providing simple classes to do the calc/calculable job it removes the stubs while being more clear what is happening. Kills all db access as well.
diff --git a/UPnAtom.podspec b/UPnAtom.podspec index abc1234..def5678 100644 --- a/UPnAtom.podspec +++ b/UPnAtom.podspec @@ -9,7 +9,6 @@ s.source_files = 'Source/**/*.{swift}' s.exclude_files = 'Source/CocoaSSDP Support/CocoaSSDPDiscoveryAdapter.swift' # Available in case CocoaSSDP library is preferred for UPnP discovery using SSDP s.requires_arc = true - s.platform = :ios s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.9' s.dependency 'CocoaAsyncSocket', '~> 7.4.1' # UPnP object discovery using SSDP
Update pod spec to show availability on all platforms.
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 @@ -9,6 +9,13 @@ Aruba.configure do |config| config.before_cmd do |cmd| set_env('JRUBY_OPTS', "-X-C #{ENV['JRUBY_OPTS']}") # disable JIT since these processes are so short lived - set_env('JAVA_OPTS', "-d32 #{ENV['JAVA_OPTS']}") # force jRuby to use client JVM for faster startup times + + java_options = ENV['JAVA_OPTS'] + + if 1.size == 4 # 4 for 32 bit java, 8 for 64 bit java. + set_env('JAVA_OPTS', "-d32 #{java_options}") + else + set_env('JAVA_OPTS', "-XX:+TieredCompilation -XX:TieredStopAtLevel=1 #{java_options}") + end end end if RUBY_PLATFORM == 'java'
Optimize for JRuby 32/64 bit differences
diff --git a/app/mailers/newsletter_mailer.rb b/app/mailers/newsletter_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/newsletter_mailer.rb +++ b/app/mailers/newsletter_mailer.rb @@ -1,9 +1,11 @@-class NewsletterMailer +class NewsletterMailer < ActionMailer::Base default :from => "noresponder@dealhunter.com" + default :to => "laura_lopez_bukovac@hotmail.com" - def newsletter_email(client) + def newsletter_email() @offers = Offer.actual.take(6) - mail(:to => client.user.email, :subject => "Newsletter Dealhunter") + mail(:subject => "Newsletter Dealhunter") + #mail(:to => client.user.email, :subject => "Newsletter Dealhunter") end end
Set newsletter mailer as action mailer
diff --git a/app/overrides/admin_decorator.rb b/app/overrides/admin_decorator.rb index abc1234..def5678 100644 --- a/app/overrides/admin_decorator.rb +++ b/app/overrides/admin_decorator.rb @@ -1,4 +1,5 @@ Deface::Override.new( + original: "0faac568db7e03f5705d3f86553d21a58bda03aa", virtual_path: "spree/admin/shared/sub_menu/_configuration", name: "add_sisow_settings", insert_bottom: "[data-hook='admin_configurations_sidebar_menu']",
Fix deprecation warning by specifying the hash of the parent
diff --git a/db/migrate/20140428132137_delete_rpa_specialist_sector.rb b/db/migrate/20140428132137_delete_rpa_specialist_sector.rb index abc1234..def5678 100644 --- a/db/migrate/20140428132137_delete_rpa_specialist_sector.rb +++ b/db/migrate/20140428132137_delete_rpa_specialist_sector.rb @@ -0,0 +1,32 @@+class DeleteRpaSpecialistSector < Mongoid::Migration + def self.up + parent = Tag.by_tag_id('farming-food-inspections', 'specialist_sector') + children = Tag.where(tag_type: 'specialist_sector', parent_id: parent.tag_id) + + ([parent] + children).each do |tag| + tag.destroy + puts "Deleted #{tag.tag_id}" + end + end + + def self.down + @parent = Tag.create!(tag_id: 'farming-food-inspections', title: 'Farming and food inspections', tag_type: 'specialist_sector') + puts "Re-created #{@parent.tag_id}" + + children_to_recreate.each do |(title,slug)| + Tag.create!(tag_id: "#{@parent.tag_id}/#{slug}", title: title, tag_type: 'specialist_sector', parent_id: @parent.tag_id) + puts "Re-created #{@parent.tag_id}/#{slug}" + end + end + + private + + def self.children_to_recreate + [ + ["Fresh produce", "fresh-produce"], + ["Livestock identification", "livestock-identification"], + ["Meat labelling and traceability", "meat-labelling-traceability"], + ["Sugar", "sugar"], + ] + end +end
Delete the 'Farming and food inspections' sector The 'Farming and food inspections' specialist sector tags was created for the Rural Payments Agency, but it's no longer needed. This deletes the parent tag and its children. The 'down' method creates the tags again. It never went live and nothing was ever tagged with it, so this is safe to delete without any further migrations elsewhere.
diff --git a/Casks/devonthink-pro-office.rb b/Casks/devonthink-pro-office.rb index abc1234..def5678 100644 --- a/Casks/devonthink-pro-office.rb +++ b/Casks/devonthink-pro-office.rb @@ -0,0 +1,8 @@+class DevonthinkProOffice < Cask + url 'https://s3.amazonaws.com/DTWebsiteSupport/download/devonthink/2.7.4/DEVONthink_Pro_Office.dmg.zip' + homepage 'http://www.devontechnologies.com/products/devonthink/devonthink-pro-office.html' + version '2.7.4' + sha256 'fab41794b3739d28ac936caef8d2c921105604f959a37c4e19a16b3ac9481e59' + nested_container 'DEVONthink_Pro_Office.dmg' + link 'DEVONthink Pro.app', :target => 'DEVONthink Pro Office.app' +end
Add Devonthink Pro Office v2.7.4
diff --git a/code_climate_check.gemspec b/code_climate_check.gemspec index abc1234..def5678 100644 --- a/code_climate_check.gemspec +++ b/code_climate_check.gemspec @@ -11,7 +11,7 @@ spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0") - spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } + spec.executables = ['code_climate_check'] spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"]
Fix endless cycle problem when using script
diff --git a/app/controllers/kuhsaft/pages_controller.rb b/app/controllers/kuhsaft/pages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/kuhsaft/pages_controller.rb +++ b/app/controllers/kuhsaft/pages_controller.rb @@ -2,7 +2,6 @@ class PagesController < ::ApplicationController respond_to :html before_action :find_page_by_url, only: :show - helper_method :is_kuhsaft_page? def index @search = params[:search] @@ -35,9 +34,5 @@ url += "/#{params[:url]}" if params[:url].present? @page = Kuhsaft::Page.find_by_url(url) end - - def is_kuhsaft_page? - is_a? Kuhsaft::PagesController - end end end
Revert "add helper method to check if on a kuhsaft cotnrolled page"
diff --git a/app/controllers/presentations_controller.rb b/app/controllers/presentations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/presentations_controller.rb +++ b/app/controllers/presentations_controller.rb @@ -2,7 +2,7 @@ before_action :login!, :except => [:index] def index - @presentations = Presentation.all + @presentations = Presentation.order("RANDOM()") end def new
Return presentations in a random order
diff --git a/lib/carrierwave/base64/mounting_helper.rb b/lib/carrierwave/base64/mounting_helper.rb index abc1234..def5678 100644 --- a/lib/carrierwave/base64/mounting_helper.rb +++ b/lib/carrierwave/base64/mounting_helper.rb @@ -22,8 +22,10 @@ end def define_writer(klass, attr, options) - klass.define_method "#{attr}=" do |data| + klass.send(:define_method, "#{attr}=") do |data| + # rubocop:disable Lint/NonLocalExitFromIterator return if data.to_s.empty? || data == send(attr).to_s + # rubocop:enable Lint/NonLocalExitFromIterator send("#{attr}_will_change!") if respond_to?("#{attr}_will_change!")
Fix writer definition for older ruby versions
diff --git a/lib/search_and_resque/chewy_extensions.rb b/lib/search_and_resque/chewy_extensions.rb index abc1234..def5678 100644 --- a/lib/search_and_resque/chewy_extensions.rb +++ b/lib/search_and_resque/chewy_extensions.rb @@ -5,7 +5,7 @@ module ClassMethods def delete!(ids) - filter(:term => {:_id => ids}).delete_all + filter(:ids => {:values => ids}).delete_all end end end
Use ids filter instead of :term => {:_id =>
diff --git a/lib/shrine/plugins/metadata_attributes.rb b/lib/shrine/plugins/metadata_attributes.rb index abc1234..def5678 100644 --- a/lib/shrine/plugins/metadata_attributes.rb +++ b/lib/shrine/plugins/metadata_attributes.rb @@ -10,14 +10,18 @@ uploader.plugin :entity end - def self.configure(uploader, mappings = {}) - uploader.opts[:metadata_attributes] ||= { mappings: {} } - uploader.opts[:metadata_attributes][:mappings].merge!(mappings) + def self.configure(uploader, **opts) + uploader.opts[:metadata_attributes] ||= {} + uploader.opts[:metadata_attributes].merge!(opts) end module AttacherClassMethods - def metadata_attributes(mappings) - shrine_class.opts[:metadata_attributes][:mappings].merge!(mappings) + def metadata_attributes(mappings = nil) + if mappings + shrine_class.opts[:metadata_attributes].merge!(mappings) + else + shrine_class.opts[:metadata_attributes] + end end end @@ -31,7 +35,7 @@ def metadata_attributes values = {} - shrine_class.opts[:metadata_attributes][:mappings].each do |source, destination| + self.class.metadata_attributes.each do |source, destination| metadata_attribute = destination.is_a?(Symbol) ? :"#{name}_#{destination}" : :"#{destination}" next unless record.respond_to?(metadata_attribute)
Move retrieving metadata attributes to Attacher class
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -13,6 +13,6 @@ end def external_resource_linked_image(asset) - link_to image_tag('/image-service' + asset.id + '/full/540,/0/default.jpg', alt: asset.alt_text), asset.ext_url_doi_or_handle.first, target: "_blank" + link_to image_tag('/image-service/' + asset.id + '/full/540,/0/default.jpg', alt: asset.alt_text), asset.ext_url_doi_or_handle.first, target: "_blank" end end
Add slash, though it does route without
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,6 +5,8 @@ "progress-danger" elsif percentage.to_i > 10 && percentage.to_i < 40 "progress-warning" + elsif percentage.to_i > 100 + "progress-success" else "progress-info" end
Add a progress for 100 percent
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -3,7 +3,7 @@ class ApplicationMailer < ActionMailer::Base include MailgunHeaders - default from: 'appointments@pensionwise.gov.uk' + default from: 'Pension Wise Appointments <appointments@pensionwise.gov.uk>' layout 'mailer' end
Include the sender's name in mailings
diff --git a/examples/echo.rb b/examples/echo.rb index abc1234..def5678 100644 --- a/examples/echo.rb +++ b/examples/echo.rb @@ -8,4 +8,4 @@ q.validate(/^[^\.]+\.[^\.]+/) end -#puts answer +puts "Password: #{answer}"
Change to show returend value
diff --git a/solidus_cmd.gemspec b/solidus_cmd.gemspec index abc1234..def5678 100644 --- a/solidus_cmd.gemspec +++ b/solidus_cmd.gemspec @@ -1,10 +1,10 @@ # -*- encoding: utf-8 -*- -# $:.push File.expand_path("../lib", __FILE__) -# require "solidus_cmd/version" +$:.push File.expand_path("../lib", __FILE__) +require 'solidus_cmd/version' Gem::Specification.new do |s| s.name = "solidus_cmd" - s.version = '1.0.0' + s.version = SolidusCmd::VERSION s.authors = 'Solidus Team' s.email = 'contact@solidus.io' s.homepage = 'http://solidus.io'
Revert hardcoding of version number
diff --git a/app/helpers/uploads_helper.rb b/app/helpers/uploads_helper.rb index abc1234..def5678 100644 --- a/app/helpers/uploads_helper.rb +++ b/app/helpers/uploads_helper.rb @@ -5,7 +5,7 @@ end def link_to_upload(upload, text, attributes = {}) - link_to(h(text), upload.url, {:rel => (upload.image? ? 'facebox' : '_blank')}.merge(attributes)) + link_to(h(text), upload.url, {:rel => (upload.image? ? 'facebox' : nil)}.merge(attributes)) end def upload_link_with_thumbnail(upload)
Revert "Open upload that are not an image in a new window" This reverts commit a0648eb99f22df49c2219f2a2468083a39c4c921.
diff --git a/app/models/retirement_plan.rb b/app/models/retirement_plan.rb index abc1234..def5678 100644 --- a/app/models/retirement_plan.rb +++ b/app/models/retirement_plan.rb @@ -18,7 +18,7 @@ allow_existing :company belongs_to :periodic_payment - accepts_nested_attributes_for :periodic_payment, reject_if: :all_blank + accepts_nested_attributes_for :periodic_payment, reject_if: proc { |attributes| PeriodicPaymentsController.reject_if_blank(attributes) } allow_existing :periodic_payment belongs_to :password
Fix retirement plan bug creating a plan without a payment
diff --git a/ruby-gem/lib/crudecumber/support/crudecumber_formatter.rb b/ruby-gem/lib/crudecumber/support/crudecumber_formatter.rb index abc1234..def5678 100644 --- a/ruby-gem/lib/crudecumber/support/crudecumber_formatter.rb +++ b/ruby-gem/lib/crudecumber/support/crudecumber_formatter.rb @@ -10,7 +10,7 @@ # SlowHandCuke formatter) and stops irrelevant Ruby errors being displayed. class Formatter < Cucumber::Formatter::Pretty def before_step(step) - @io.printf "... #{step.name}" + @io.printf "#{step.keyword}#{step.name}".indent(@scenario_indent + 2) @io.flush end
Fix step indentation when step is first displayed for testing
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,7 +11,7 @@ RSpec.configure do |config| config.before(:suite) do - Authy.api_key = 'bf12974d70818a08199d17d5e2bae630' + Authy.api_key = 'valid_api_key' end def generate_email
Use a dummy API key in the test suite
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -18,8 +18,8 @@ Docker.url = docker_host end -# Workaround needed for Travis -if ENV['TRAVIS'] +# Workaround needed for Circle CI. +if ENV['CIRCLECI'] class Docker::Container def remove(options={}); end alias_method :delete, :remove
Adjust for switch to Circle CI.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,7 @@-require "coveralls" -Coveralls.wear! +if ENV["TRAVIS"] + require "coveralls" + Coveralls.wear! +end require "interactor"
Make sure only Travis wears Coveralls [ci skip]
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,3 +9,10 @@ add_filter "/vendor/" add_filter "/spec/" end + +# テスト用にロガーを差し込む +module Chatwork + class Base + self.logger = Logger.new(STDERR) + end +end
chore: Add logger only while test
diff --git a/app/models/sku.rb b/app/models/sku.rb index abc1234..def5678 100644 --- a/app/models/sku.rb +++ b/app/models/sku.rb @@ -3,8 +3,8 @@ include IslayShop::Statuses belongs_to :product - has_many :sku_assets, :order => 'position ASC' - has_many :assets, :through => :sku_assets, :order => 'sku_assets.position ASC' + has_many :sku_assets, :order => 'position ASC' + has_many :assets, :through => :sku_assets, :order => 'sku_assets.position ASC' has_many :stock_logs, :class_name => 'SkuStockLog', :order => 'created_at DESC' has_many :price_logs, :class_name => 'SkuPriceLog', :order => 'created_at DESC' @@ -15,10 +15,6 @@ attr_accessor :template - metadata(:metadata) do - enum :color, :values => %w(red green blue yellow), :kind => :short - end - # Summary of this SKU, which includes it's product name, data cols, sizing, # price etc. #
Remove the test meta-data from the SKU model.
diff --git a/jobs_view.gemspec b/jobs_view.gemspec index abc1234..def5678 100644 --- a/jobs_view.gemspec +++ b/jobs_view.gemspec @@ -9,7 +9,7 @@ s.version = JobsView::VERSION s.authors = ["Guille Carlos"] s.email = ["guille@bitpop.in"] - s.homepage = "A lot" + s.homepage = "https://github.com/guillec/jobs_view" s.summary = "Show your DelayedJobs jobs." s.description = "A rails engine that you include to see your DelayedJobs"
Add url to github page Other apps complaining about configuration
diff --git a/db/migrate/20140602152302_remove_rpa_specialist_sectors.rb b/db/migrate/20140602152302_remove_rpa_specialist_sectors.rb index abc1234..def5678 100644 --- a/db/migrate/20140602152302_remove_rpa_specialist_sectors.rb +++ b/db/migrate/20140602152302_remove_rpa_specialist_sectors.rb @@ -1,5 +1,5 @@ class RemoveRpaSpecialistSectors < Mongoid::Migration - TAG_TYPE = "specialist-sector" + TAG_TYPE = "specialist_sector" def self.up tags_to_remove.each do |tag_id, _, _| @@ -33,7 +33,7 @@ private def self.tags_to_remove [ - ["working-at-sea/fishing", "Fishing", "working-at-sea"], + ["working-sea/fishing", "Fishing", "working-sea"], ["producing-distributing-food/inspections", "Inspections", "producing-distributing-food"], ["keeping-farmed-animals/inspections", "Inspections", "keeping-farmed-animals"], ]
Correct the slugs and type in the RPA migration The migration was intended to remove some unused tags, but had an incorrect tag type and an incorrect slug, so failed to work in production. This migration was run on staging, but not on production, and the database has been synced from production to staging since then. Therefore, we're just leaving the migration date as it is.
diff --git a/db/migrate/20160421084217_add_output_elements_for_merit.rb b/db/migrate/20160421084217_add_output_elements_for_merit.rb index abc1234..def5678 100644 --- a/db/migrate/20160421084217_add_output_elements_for_merit.rb +++ b/db/migrate/20160421084217_add_output_elements_for_merit.rb @@ -4,15 +4,15 @@ group: 'Merit', key: 'merit_order_price_curve', requires_merit_order: true, - output_element_type_id: 16 + output_element_type_id: 16, + unit: "EUR/MWh" ) OutputElementSerie.create!( label: 'merit_price', color: '#5D7929', gquery: 'merit_order_price_curve', - output_element: merit_order_price_curve, - unit: "EUR/MWh" + output_element: merit_order_price_curve ) end end
Fix M/O price chart migration to set unit
diff --git a/scraper.rb b/scraper.rb index abc1234..def5678 100644 --- a/scraper.rb +++ b/scraper.rb @@ -6,7 +6,7 @@ Turbotlib.log("Starting run...") -if ENV['COMPLETE_RUN'] +if ENV['COMPLETE_RUN'] == "true" last_run = DateTime.parse("2014-01-01") elsif ENV['FIRST_RUN'] last_run = (Time.now - 259200)
Check if complete run is true
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 @@ -3,6 +3,10 @@ CodeClimate::TestReporter.start ENV['RACK_ENV'] = 'test' +ENV['CHRUBY_VERSION'] = '0.3.9' +ENV['RUBY_INSTALL_VERSION'] = '0.5.0' +ENV['RBENV_VERSION'] = '5b9e4f05846f6bd03b09b8572142f53fd7a46e62' +ENV['RUBY_BUILD_VERSION'] = 'e932d47195d76d6be9635a012056069e794039e0' require File.join(File.dirname(__FILE__), '..', '..', 'app/rvm_fw.rb')
Add expected versions as ENV params to cucumber specs
diff --git a/features/support/ssh.rb b/features/support/ssh.rb index abc1234..def5678 100644 --- a/features/support/ssh.rb +++ b/features/support/ssh.rb @@ -15,9 +15,10 @@ # smdba print this warning on stderr. Ignore it. It is not an error errstring = err.string.gsub("WARNING: Reserved space for the backup is smaller than available disk space. Adjusting.", "") errstring.chomp! - if errstring.empty? || ignore_err - results = { stdout: out.string, stderr: err.string } - else + + if !errstring.empty? && !ignore_err raise "Execute command failed #{command}: #{err.string}" end + + { stdout: out.string, stderr: err.string } end
C: Use a guard clause instead of wrapping the code inside a conditional expression
diff --git a/lib/fog/hp/models/storage/shared_files.rb b/lib/fog/hp/models/storage/shared_files.rb index abc1234..def5678 100644 --- a/lib/fog/hp/models/storage/shared_files.rb +++ b/lib/fog/hp/models/storage/shared_files.rb @@ -41,6 +41,7 @@ shared_object_url = "#{shared_directory.url}/#{key}" data = connection.head_shared_object(shared_object_url) file_data = data.headers.merge({ + :body => '', :key => key }) new(file_data)
Fix head call to return an empty body.
diff --git a/lib/generators/errdo/install_generator.rb b/lib/generators/errdo/install_generator.rb index abc1234..def5678 100644 --- a/lib/generators/errdo/install_generator.rb +++ b/lib/generators/errdo/install_generator.rb @@ -0,0 +1,21 @@+require 'rails/generators/base' + +module Errdo + + module Generators + + class InstallGenerator < Rails::Generators::Base + + desc "Creates an errdo initializer and sets the exceptions_app to errdo's" + + def set_exceptions_app + inject_into_file 'config/application.rb', before: " end" do + "\n config.exceptions_app = Errdo::ExceptionsApp\n\n" + end + end + + end + + end + +end
Add command to inject changing the exception app
diff --git a/capistrano-ext-puppetize.gemspec b/capistrano-ext-puppetize.gemspec index abc1234..def5678 100644 --- a/capistrano-ext-puppetize.gemspec +++ b/capistrano-ext-puppetize.gemspec @@ -10,13 +10,11 @@ spec.email = ['daniel.barlow@simplybusiness.co.uk'] spec.summary = 'Run Puppet manifests in a Capistrano deployment' spec.description = 'Capistrano extension to run Puppet manifests contained in the application to be deployed' - spec.license = 'Simplified BSD' + spec.license = 'MIT' spec.add_dependency 'capistrano', '3.1' - spec.add_development_dependency 'rspec' spec.require_path = 'lib' - spec.license = 'MIT' end
Remove additioanl licence in gemspec
diff --git a/spec/views/assets/_transit_facility_fta.html.haml_spec.rb b/spec/views/assets/_transit_facility_fta.html.haml_spec.rb index abc1234..def5678 100644 --- a/spec/views/assets/_transit_facility_fta.html.haml_spec.rb +++ b/spec/views/assets/_transit_facility_fta.html.haml_spec.rb @@ -5,7 +5,6 @@ it 'fta info' do test_asset = create(:bus_shelter, :fta_funding_type_id => 1, :pcnt_capital_responsibility =>22, :fta_facility_type_id => 1) test_asset.fta_mode_types << FtaModeType.first - test_asset.fta_service_types << FtaServiceType.first test_asset.save! assign(:asset, test_asset) render @@ -13,7 +12,6 @@ expect(rendered).to have_content(FtaFundingType.first.to_s) expect(rendered).to have_content('22%') expect(rendered).to have_content(FtaModeType.first.to_s) - expect(rendered).to have_content(FtaServiceType.first.to_s) expect(rendered).to have_content(FtaFacilityType.first.to_s) end end
Update transit_facility_fta tests because of changes in e4fadaf
diff --git a/app/models/components/course/conditions_ability_component.rb b/app/models/components/course/conditions_ability_component.rb index abc1234..def5678 100644 --- a/app/models/components/course/conditions_ability_component.rb +++ b/app/models/components/course/conditions_ability_component.rb @@ -15,5 +15,6 @@ can :manage, Course::Condition::Achievement, condition: course_teaching_staff_hash can :manage, Course::Condition::Assessment, condition: course_teaching_staff_hash can :manage, Course::Condition::Level, condition: course_teaching_staff_hash + can :manage, Course::Condition::Survey, condition: course_teaching_staff_hash end end
Allow teaching staff to manage survey conditions
diff --git a/BSSegmentPagingView.podspec b/BSSegmentPagingView.podspec index abc1234..def5678 100644 --- a/BSSegmentPagingView.podspec +++ b/BSSegmentPagingView.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BSSegmentPagingView' - s.version = '0.0.2' + s.version = '0.0.3' s.summary = 'An paging view for iOS' s.license = { :type => 'MIT', :file => 'LICENCE' } s.homepage = 'https://github.com/juxingzhutou/BSSegmentPagingView' @@ -10,7 +10,7 @@ s.ios.deployment_target = '7.0' s.requires_arc = true - s.source = { :git => "https://github.com/juxingzhutou/BSSegmentPagingView.git", :tag => 'v0.0.2' } + s.source = { :git => "https://github.com/juxingzhutou/BSSegmentPagingView.git", :tag => 'v0.0.3' } s.source_files = "BSSegmentPagingView/*.{h,m}" s.public_header_files = "BSSegmentPagingView/BSSegmentPagingView.h"
Update spec file for version 0.0.3
diff --git a/spec/support/examples_group/shared_examples_for_generic_feature_buttons.rb b/spec/support/examples_group/shared_examples_for_generic_feature_buttons.rb index abc1234..def5678 100644 --- a/spec/support/examples_group/shared_examples_for_generic_feature_buttons.rb +++ b/spec/support/examples_group/shared_examples_for_generic_feature_buttons.rb @@ -22,3 +22,42 @@ it { expect(subject).to eq(feature) } end end + +shared_examples_for 'a generic feature button with disabled' do + include_examples 'a generic feature button' + include_examples 'GenericFeatureButtonWithDisabled#calculate_properties' +end + +shared_examples_for 'GenericFeatureButtonWithDisabled#calculate_properties' do + describe '#calculate_properties' do + let(:available) { true } + before do + allow(record).to receive(:is_available?).with(feature).and_return(available) + allow(record).to receive(:is_available_now_error_message).and_return('unavailable') + allow(record).to receive(:supports?).with(feature).and_return(support) if defined? support + button.calculate_properties + end + + context 'when feature exists' do + let(:feature) { :evacuate } + context 'and feature is supported' do + let(:support) { true } + it_behaves_like 'an enabled button' + end + context 'and feature is not supported' do + let(:support) { false } + it_behaves_like 'a disabled button', 'Feature not available/supported' + end + end + context 'when feature is unknown' do + let(:feature) { :non_existent_feature } + context 'and feature is not available' do + let(:available) { false } + it_behaves_like 'a disabled button', 'unavailable' + end + context 'but feature is available' do + it_behaves_like 'an enabled button' + end + end + end +end
Create shared examples for generic feature buttons with disabled
diff --git a/example/example.rb b/example/example.rb index abc1234..def5678 100644 --- a/example/example.rb +++ b/example/example.rb @@ -0,0 +1,62 @@+#Album class +class Album # Albums have an artist, title and tracks + attr_reader :artist, :title + attr_accessor :tracks + + @@collection = [] + + def initialize(artist:, title:) + @artist = artist + @title = title + @tracks = [] + + @@collection << self + end + + def self.all + @@collection + end + + def self.find_by_title(query) + @@collection.select { |album| album.title == query } + end +end + +class Song + attr_reader :title + attr_accessor :rating + + def initialize(title:) + @title = title + @rating + end +end + + +Adele = Album.new(title: '21', artist: 'Adele') +Thriller = Album.new(title: 'Thriller', artist: 'Michael Jackson') +T_Swift = Album.new(title: '1989', artist: 'Taylor Swift') +USA = Album.new(title: 'Born in the U.S.A.', artist: 'Bruce Springsteen') +Gaga = Album.new(title: 'The Fame', artist: 'Lady Gaga') +Frozen = Album.new(title: 'Frozen', artist: 'The Frozen Soundtrack') +Def = Album.new(title: 'Hysteria', artist: 'Def Leppard') + + +# { title: 'Hello', length: 216, rating: 4 }, +# { title: 'Thriller', length: 238, rating: 5 }, +# { title: 'Bad Blood', length: 205, rating: 4 }, +# { title: 'Born in the U.S.A.', length: 227, rating: 5 }, +# { title: 'Poker Face', length: 256, rating: 3 }, +# { title: 'Let it go', length: 199, rating: 11 }, +# { title: 'Hello', length: 234, rating: 4 }, +# { title: 'Hysteria', length: 301, rating: 5 } + + +# t_swift = Album.new(artist: 'Taylor Swift', title: '1989') +# t_swift.tracks << Song.new(title: 'Shake It Off') +# t_swift.tracks << Song.new(title: 'Bad Blood') +# +# nevermind = Album.new(artist: 'Nirvana', title: 'Nevermind') +# nevermind.tracks << Song.new(title: 'Smells Like Teen Spirit') + +# brians_favorite = Album.find_by_title('1989')
Add ruby object code for albums and songs
diff --git a/cookbooks/travis_build_environment/recipes/neo4j.rb b/cookbooks/travis_build_environment/recipes/neo4j.rb index abc1234..def5678 100644 --- a/cookbooks/travis_build_environment/recipes/neo4j.rb +++ b/cookbooks/travis_build_environment/recipes/neo4j.rb @@ -1,10 +1,11 @@ ark 'neo4j' do url node['travis_build_environment']['neo4j_url'] + version node['travis_build_environment']['neo4j_version'] checksum node['travis_build_environment']['neo4j_checksum'] - version node['travis_build_environment']['neo4j_version'] - binaries node['travis_build_environment']['neo4j_binaries'] + has_binaries node['travis_build_environment']['neo4j_binaries'] retries 2 retry_delay 30 + strip_components 1 end template '/etc/neo4j/neo4j.conf' do
Use correct resource attributes for ark
diff --git a/gitlab-runner.rb b/gitlab-runner.rb index abc1234..def5678 100644 --- a/gitlab-runner.rb +++ b/gitlab-runner.rb @@ -1,7 +1,9 @@ class GitlabRunner < Formula desc "The official GitLab CI runner written in Go" homepage "https://gitlab.com/gitlab-org/gitlab-ci-multi-runner" - url "https://gitlab.com/gitlab-org/gitlab-ci-multi-runner.git", :tag => "v0.6.2", :revision => "3227f0aa5be1d64d2ec694bd3758e0d43e92b36b" + url "https://gitlab.com/gitlab-org/gitlab-ci-multi-runner.git", + :tag => "v0.6.2", + :revision => "3227f0aa5be1d64d2ec694bd3758e0d43e92b36b" head "https://gitlab.com/gitlab-org/gitlab-ci-multi-runner.git"
Break the `tag` and `revision` onto their own lines
diff --git a/db/migrate/20210929220050_create_github_integrations.rb b/db/migrate/20210929220050_create_github_integrations.rb index abc1234..def5678 100644 --- a/db/migrate/20210929220050_create_github_integrations.rb +++ b/db/migrate/20210929220050_create_github_integrations.rb @@ -1,12 +1,16 @@-class CreateGithubIntegrations < ActiveRecord::Migration[5.2] +class CreateGithubIntegrations < ActiveRecord::Migration[5.0] def change create_table :github_integrations do |t| t.string :oauth_state t.text :access_token_ciphertext - t.references :user, foreign_key: true, type: :integer, index: { unique: true } - + t.references :user, index: { unique: true } t.timestamps end add_index :github_integrations, :oauth_state, unique: true + add_foreign_key( + :github_integrations, + :users, + column: :user_id + ) end end
Use an oldstyle migration so integer keys work Change the version of the github_integrations migration to 5.0 so that the users_id column is an int and is compatible with extant user tables
diff --git a/config/software/loom-ui.rb b/config/software/loom-ui.rb index abc1234..def5678 100644 --- a/config/software/loom-ui.rb +++ b/config/software/loom-ui.rb @@ -7,15 +7,15 @@ relative_path 'ui' build do - command "mkdir -p #{install_dir}/ui/bin" + mkdir "#{install_dir}/ui/bin" command "sed -e 's:ui/embedded/bin:embedded/bin:g' bin/loom-ui.sh > #{install_dir}/ui/bin/loom-ui.sh" - command "mkdir -p #{install_dir}/ui/etc/logrotate.d" - command "cp -f /var/cache/omnibus/src/node-v0.10.26/LICENSE #{install_dir}/ui/LICENSE.node" - command "cp -f ui/distribution/etc/logrotate.d/loom-ui #{install_dir}/ui/etc/logrotate.d" + mkdir "#{install_dir}/ui/etc/logrotate.d" + copy "/var/cache/omnibus/src/node-v0.10.26/LICENSE #{install_dir}/ui/LICENSE.node" + copy "ui/distribution/etc/logrotate.d/loom-ui #{install_dir}/ui/etc/logrotate.d" command "sed -e 's/APP_NAME/loom-ui/g' -e 's/SVC_NAME/ui/g' bin/loom-service > #{install_dir}/ui/bin/init-loom-ui" command "chmod +x #{install_dir}/ui/bin/*" command "cd ui && #{install_dir}/embedded/bin/node tools/r.js -o tools/build.js" - command 'rm -rf ui/omnibus ui/build*' + delete 'ui/omnibus ui/build*' command "cp -fpPR ui #{install_dir}" command "find #{install_dir} -type f -name .gitkeep | xargs rm -f" end
Use copy/delete/mkdir builtin Builder methods
diff --git a/db/migrate/20130802012458_add_slug_to_photos.rb b/db/migrate/20130802012458_add_slug_to_photos.rb index abc1234..def5678 100644 --- a/db/migrate/20130802012458_add_slug_to_photos.rb +++ b/db/migrate/20130802012458_add_slug_to_photos.rb @@ -2,7 +2,5 @@ def change add_column :photos, :slug, :string add_index :photos, :slug - - Photo.initialize_urls end end
Fix db:migrate after removing photo slugs
diff --git a/app/mutations/users/create.rb b/app/mutations/users/create.rb index abc1234..def5678 100644 --- a/app/mutations/users/create.rb +++ b/app/mutations/users/create.rb @@ -8,6 +8,7 @@ end def validate + add_error :email, :*, 'Already registered' if User.find_by(email: email) if password != password_confirmation add_error :password, :*, 'Password and confirmation do not match.' end
Fix 500 error when registering pre-existing accounts on accident
diff --git a/lib/generators/templates/app/initializers/link_renderer.rb b/lib/generators/templates/app/initializers/link_renderer.rb index abc1234..def5678 100644 --- a/lib/generators/templates/app/initializers/link_renderer.rb +++ b/lib/generators/templates/app/initializers/link_renderer.rb @@ -1,3 +1,5 @@+require 'will_paginate/view_helpers/link_renderer_base' + module WillPaginate module ViewHelpers # This class does the heavy lifting of actually building the pagination
Fix for latest WillPaginate version.
diff --git a/lib/authem/base_user.rb b/lib/authem/base_user.rb index abc1234..def5678 100644 --- a/lib/authem/base_user.rb +++ b/lib/authem/base_user.rb @@ -5,7 +5,7 @@ included do validates_uniqueness_of :email - validates_format_of :email, with: /^\S+@\S+$/ + validates_format_of :email, with: /\A\S+@\S+\z/ validates_presence_of :password, on: :create validates_confirmation_of :password end
Change email format regex anchors
diff --git a/benchmarks/parameter_calls.rb b/benchmarks/parameter_calls.rb index abc1234..def5678 100644 --- a/benchmarks/parameter_calls.rb +++ b/benchmarks/parameter_calls.rb @@ -4,16 +4,16 @@ include Typedeaf def method_with_params(buffer) - buffer.size + buffer.size + rand + rand end define :typedeaf_with_params, buffer: String do - buffer.size + buffer.size + rand + rand end end blk = Proc.new do |buffer| - buffer.size + buffer.size + rand + rand end p = Parametered.new
Make the parameter call benchmark more computationally intensive Still kind of lame though
diff --git a/features/step_definitions/knife_encryption_steps.rb b/features/step_definitions/knife_encryption_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/knife_encryption_steps.rb +++ b/features/step_definitions/knife_encryption_steps.rb @@ -1,10 +1,10 @@ Then(/^the stdout should be one of:$/) do |table| - LATEST_CHEF = "11.12.4" + latest_chef = "11.12.4" # table is a Cucumber::Ast::Table data = table.rows_hash begin - puts "unknown Chef version, attempting #{LATEST_CHEF} encrypted string" - data[Chef::VERSION] = data[LATEST_CHEF] + puts "unknown Chef version, attempting #{latest_chef} encrypted string" + data[Chef::VERSION] = data[latest_chef] end unless data[Chef::VERSION] step("the stdout should contain exactly:", data[Chef::VERSION] ? data[Chef::VERSION] : data["11.12.4"])
Fix warnings from redefined constant in tests
diff --git a/lib/buoys/link.rb b/lib/buoys/link.rb index abc1234..def5678 100644 --- a/lib/buoys/link.rb +++ b/lib/buoys/link.rb @@ -5,7 +5,7 @@ CONFIG = { current_class: (Buoys::Config.current_class || 'active'), - link_current: (Buoys::Config.link_current || false), + link_current: (Buoys::Config.link_current || false) }.with_indifferent_access def initialize(text, url, options)
Fix ` Avoid comma after the last item of a hash.`
diff --git a/docs/cleanup_scripts/fix_crosswiki_revisions.rb b/docs/cleanup_scripts/fix_crosswiki_revisions.rb index abc1234..def5678 100644 --- a/docs/cleanup_scripts/fix_crosswiki_revisions.rb +++ b/docs/cleanup_scripts/fix_crosswiki_revisions.rb @@ -0,0 +1,12 @@+course = Course.find(18956) + +course.revisions.includes(:article).each do |rev| + next if rev.wiki_id == rev.article.wiki_id + correct_article = Article.find_by(mw_page_id: rev.mw_page_id, wiki_id: rev.wiki_id) + if correct_article + puts "fixing rev: #{rev.id}" + rev.update(article: correct_article) + else + puts "very bad rev: #{rev.id}" + end +end; nil
Add cleanup script for fixing revisions that point to wrong wiki I've run this for the two courses that reported problems with revisions pointing to the wrong wiki.
diff --git a/lib/mournmail/config.rb b/lib/mournmail/config.rb index abc1234..def5678 100644 --- a/lib/mournmail/config.rb +++ b/lib/mournmail/config.rb @@ -18,7 +18,16 @@ ] CONFIG[:mournmail_imap_connect_timeout] = 10 CONFIG[:mournmail_keep_alive_interval] = 60 - CONFIG[:mournmail_file_open_comamnd] = "xdg-open" - CONFIG[:mournmail_link_open_comamnd] = "xdg-open" + case RUBY_PLATFORM + when /mswin|mingw/ + CONFIG[:mournmail_file_open_comamnd] = "start" + CONFIG[:mournmail_link_open_comamnd] = "start" + when /darwin/ + CONFIG[:mournmail_file_open_comamnd] = "open" + CONFIG[:mournmail_link_open_comamnd] = "open" + else + CONFIG[:mournmail_file_open_comamnd] = "xdg-open" + CONFIG[:mournmail_link_open_comamnd] = "xdg-open" + end CONFIG[:mournmail_addresses_path] = File.expand_path("~/.addresses") end
Change default commands for Windows and macOS
diff --git a/lib/cuke_salad.rb b/lib/cuke_salad.rb index abc1234..def5678 100644 --- a/lib/cuke_salad.rb +++ b/lib/cuke_salad.rb @@ -10,7 +10,7 @@ define_method :perform_task, &block end - Kernel.const_get(name) = m + Kernel.const_set(name, m) end
Allow tasks to be defined dynamically in 1.8 and 1.9
diff --git a/lib/henson/cli.rb b/lib/henson/cli.rb index abc1234..def5678 100644 --- a/lib/henson/cli.rb +++ b/lib/henson/cli.rb @@ -6,5 +6,24 @@ include Thor::Actions check_unknown_options! + + default_task :install + + desc "install", "Install the current Puppet module environment" + long_desc <<-D + Install will install all of the Puppet modules in the current + configuration, making them available for use as long as your modulepath + is configured correctly. + D + method_option "quiet", :type => :boolean, :banner => + "Only output warnings and errors." + method_option "local", :type => :boolean, :banner => + "Only check local cache source for modules." + method_option "no-cache", :type => :boolean, :banner => + "Don't update the existing Puppet module cache." + method_option "clean", :type => :boolean, :banner => + "Run henson clean automatically after install." + def install + end end end
Add skeleton henson install command Currently just contains docs on expected behavior, doesn't include any implementation of that behavior.
diff --git a/ddplugin.gemspec b/ddplugin.gemspec index abc1234..def5678 100644 --- a/ddplugin.gemspec +++ b/ddplugin.gemspec @@ -23,5 +23,5 @@ s.rdoc_options = [ '--main', 'README.md' ] s.extra_rdoc_files = [ 'LICENSE', 'README.md', 'NEWS.md' ] - s.add_development_dependency('bundler') + s.add_development_dependency('bundler', '~> 1.13') end
Add version to Bundler dependency
diff --git a/config/environments/production.rb b/config/environments/production.rb index abc1234..def5678 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -25,4 +25,4 @@ # Enable threaded mode # config.threadsafe! -config.cache_store = :compressed_mem_cache_store, [ ENV['MEMCACHE_SERVERS'].split(","), { :namespace => ENV['MEMCACHE_NAMESPACE'] } ]+# config.cache_store = :compressed_mem_cache_store, [ ENV['MEMCACHE_SERVERS'].split(","), { :namespace => ENV['MEMCACHE_NAMESPACE'] } ]
Remove Memcached setting until it is enabled in Heroku admin.
diff --git a/config/initializers/rails_zero.rb b/config/initializers/rails_zero.rb index abc1234..def5678 100644 --- a/config/initializers/rails_zero.rb +++ b/config/initializers/rails_zero.rb @@ -1,7 +1,8 @@ require 'rails_zero/drivers/poltergeist' RailsZero.configure do |c| + c.backend.url = 'http://cocoa-tree.herokuapp.com' if Rails.env.production? c.site.add_path '/' c.deployment.url = 'git@github.com:cocoa-tree/cocoa-tree.github.io.git' - c.deployment.git_binary = 'git' + c.deployment.git_binary = 'git' unless Rails.env.production? end
Fix rails zero config for heroku.
diff --git a/config/initializers/udp_logger.rb b/config/initializers/udp_logger.rb index abc1234..def5678 100644 --- a/config/initializers/udp_logger.rb +++ b/config/initializers/udp_logger.rb @@ -1,5 +1,5 @@ if Rails.env.test? && Rails.logger.level == 0 - ActiveSupport::Notifications.subscribe(/fragment|process_action.action_controller|racing_on_rails/) do |name, start, finish, id, payload| + ActiveSupport::Notifications.subscribe(/process_action.action_controller|racing_on_rails/) do |name, start, finish, id, payload| Rails.logger.debug "#{name} #{payload}" end end @@ -8,7 +8,7 @@ udp_logger = ::LogStashLogger.new(port: 5228) parameter_filter = ActionDispatch::Http::ParameterFilter.new(Rails.application.config.filter_parameters) - ActiveSupport::Notifications.subscribe(/fragment|process_action.action_controller|racing_on_rails/) do |name, start, finish, id, payload| + ActiveSupport::Notifications.subscribe(/process_action.action_controller|racing_on_rails/) do |name, start, finish, id, payload| if payload[:status] && payload[:status].is_a?(Fixnum) payload[:status] = payload[:status].to_s end @@ -20,7 +20,8 @@ id: id, message: name, racing_association: RacingAssociation.current.short_name, - start: start + start: start, + _ttl: { enabled: true, default: "7d" } }.merge( parameter_filter.filter payload )
Add TTL to logged events so that (hopefully) Elasticsearch will auto-delete them. Stop logging caching events as that has never been useful.
diff --git a/lib/subjoin/linkable.rb b/lib/subjoin/linkable.rb index abc1234..def5678 100644 --- a/lib/subjoin/linkable.rb +++ b/lib/subjoin/linkable.rb @@ -1,16 +1,16 @@ module Subjoin # Generically construct and handle {Links} objects module Linkable - @links = nil - - def links - @links ||= {} - end - + attr_reader :links + # Load the object's links # @param data [Hash] The object's parsed JSON `links` member def load_links(data) - @links = Links.new(data) + if data.nil? + @links = nil if data.nil? + else + @links = Links.new(data) + end end end end
Allow for nil links attribute
diff --git a/lib/turbo_dev_assets.rb b/lib/turbo_dev_assets.rb index abc1234..def5678 100644 --- a/lib/turbo_dev_assets.rb +++ b/lib/turbo_dev_assets.rb @@ -7,8 +7,11 @@ @app = app end def call(env) + + is_asset = (env['REQUEST_PATH'] =~ /^\/assets\//) + # hack to bypass all middleware if serving assets, a lot faster 4.5 seconds -> 1.5 seconds - if (etag = env['HTTP_IF_NONE_MATCH']) && env['REQUEST_PATH'] =~ /^\/assets\// + if (etag = env['HTTP_IF_NONE_MATCH']) && is_asset name = $' etag = etag.gsub "\"", "" asset = Rails.application.assets.find_asset(name) @@ -17,6 +20,8 @@ end end - @app.call(env) + status, headers, response = @app.call(env) + headers['Cache-Control'] = 'no-cache' if is_asset + [status, headers, response] end end
Use `no-cache` in development mode for assets. Using `must-revalidate`, which is Rails' default, seems to have Chrome sometimes not request assets in development mode even though it's supposed to revalidate every time.
diff --git a/lib/preparermd.rb b/lib/preparermd.rb index abc1234..def5678 100644 --- a/lib/preparermd.rb +++ b/lib/preparermd.rb @@ -17,8 +17,9 @@ def self.build(source = Dir.pwd, destination = File.join(Dir.pwd, '_site')) @config = Config.new - if File.exist?("_deconst.json") - File.open("_deconst.json", "r") { |cf| @config.load_from(cf.read) } + config_path = File.join(source, "_deconst.json") + if File.exist?(config_path) + File.open(config_path, "r") { |cf| @config.load_from(cf.read) } end @config.validate
Read _deconst.json from source, not always pwd
diff --git a/lib/rjiffy/cli.rb b/lib/rjiffy/cli.rb index abc1234..def5678 100644 --- a/lib/rjiffy/cli.rb +++ b/lib/rjiffy/cli.rb @@ -8,11 +8,43 @@ module Rjiffy module CLI + SPINNER_CHARS = [].tap do |chars| + chars << '⠈⠑' + chars << ' ⠱' + chars << ' ⡰' + chars << '⢀⡠' + chars << '⢄⡀' + chars << '⢆ ' + chars << '⠎ ' + chars << '⠊⠁' + end.freeze + def self.start(*args) Base.start(*args) end + # http://stackoverflow.com/a/10263337/1113440 + def self.show_wait_spinner(fps=8, &block) + delay = 1.0/fps + iter = 0 + + spinner = Thread.new do + while iter do # Keep spinning until told otherwise + str = " #{SPINNER_CHARS[(iter+=1) % SPINNER_CHARS.length]} " + print str + sleep delay + print "\b" * str.length + end + end + + yield.tap do # After yielding to the block, save the return value + iter = false # Tell the thread to exit, cleaning up after itself… + spinner.join # …and wait for it to do so. + end + end + def self.wait_for(status, &block) + start = Time.now box = yield if box.status == status.to_s @@ -22,13 +54,16 @@ transition_status = box.reload.status # wait till status changes while box.status == transition_status - sleep(5) - box.reload - puts "Box status: #{box.status}" + print "\rBox status: #{box.status}" + show_wait_spinner do + sleep(5) + box.reload + end end + print "\r" # is result status expected status? if box.status == status.to_s - puts "Transition complete, box is now #{box.status}" + puts "Transition complete, box is now #{box.status}. Took: #{Time.now - start}s" else puts "Transition failed, box is now #{box.status}" end
Implement a cute spinner to enhance your patience while waiting for box transitions. Show how much time it really took afterwards.
diff --git a/libraries/chef-sugar.rb b/libraries/chef-sugar.rb index abc1234..def5678 100644 --- a/libraries/chef-sugar.rb +++ b/libraries/chef-sugar.rb @@ -1 +1 @@-require "chef-sugar" if Gem::Requirement.new(">= 12.10.48").satisfied_by?(Gem::Version.new(Chef::VERSION)) +require "chef/sugar" if Gem::Requirement.new(">= 12.10.48").satisfied_by?(Gem::Version.new(Chef::VERSION))
Fix bad require in the recipe Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index abc1234..def5678 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -1,8 +1,18 @@ require 'fileutils' -desc "Clear all magazines from resource db/magazines" namespace :db do - task :clear do - FileUtils.rm Dir['db/magazines/*.yml'] + + desc "Clear all products from resource db/folder" + task :clear, [:folder] do |task, args| + FileUtils.rm Dir["db/#{args.folder}/*.yml"] + end + + desc "Seed products in resource db/folder" + task :seed, [:folder] do + seed_file = File.expand_path "db/#{args.folder}/seeds.rb" + load(seed_file) if File.exists?(seed_file) + + desc "Reseed products in resource db/folder" + task :reseed, [:folder] => ["db:clear", "db:seed"] do end end
Add rake seed and ressed methods.
diff --git a/db/data_migration/20130510134629_add_summary_to_doc_series.rb b/db/data_migration/20130510134629_add_summary_to_doc_series.rb index abc1234..def5678 100644 --- a/db/data_migration/20130510134629_add_summary_to_doc_series.rb +++ b/db/data_migration/20130510134629_add_summary_to_doc_series.rb @@ -0,0 +1,11 @@+puts "Updating document series: " +count = 0 +DocumentSeries.find_each do |ds| + if ds.summary.blank? + puts "Fixing: #{ds.name}" + ds.update_column(:summary, "This series brings together all documents relating to #{ds.name}") + count += 1 + end +end + +puts " #{count} document series updated."
Add in data migration to populate doc series summary Expect ~ 986 to be updated https://www.pivotaltracker.com/story/show/49582421 https://www.pivotaltracker.com/story/show/49119183
diff --git a/lib/rails_email_preview/main_app_route_delegator.rb b/lib/rails_email_preview/main_app_route_delegator.rb index abc1234..def5678 100644 --- a/lib/rails_email_preview/main_app_route_delegator.rb +++ b/lib/rails_email_preview/main_app_route_delegator.rb @@ -8,7 +8,7 @@ end end - def respond_to?(method) + def respond_to_missing?(method) super || main_app_route_method?(method) end
Rename respond_to? method to respond_to_missing? to fix warning
diff --git a/lib/ruby_installer/build/components/03_dev_tools.rb b/lib/ruby_installer/build/components/03_dev_tools.rb index abc1234..def5678 100644 --- a/lib/ruby_installer/build/components/03_dev_tools.rb +++ b/lib/ruby_installer/build/components/03_dev_tools.rb @@ -22,7 +22,7 @@ m4 make patch - pkg-config + pkgconf sed texinfo texinfo-tex @@ -35,7 +35,7 @@ mingw-w64-libmangle-git mingw-w64-libwinpthread-git mingw-w64-make - mingw-w64-pkg-config + mingw-w64-pkgconf mingw-w64-tools-git mingw-w64-winpthreads-git ]
Install pkgconf instead of pkg-config MSYS2 replaced pkg-config by pkgconf in https://github.com/msys2/MINGW-packages/issues/7263 . We follow this move. Fixes #222
diff --git a/lib/smartsheet/endpoints/server_info/server_info.rb b/lib/smartsheet/endpoints/server_info/server_info.rb index abc1234..def5678 100644 --- a/lib/smartsheet/endpoints/server_info/server_info.rb +++ b/lib/smartsheet/endpoints/server_info/server_info.rb @@ -7,9 +7,8 @@ @client = client end - # TODO: Should be able to run this unauthenticated def get(params: {}, header_overrides: {}) - endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['serverinfo']) + endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['serverinfo'], no_auth: true) request_spec = Smartsheet::API::RequestSpec.new( params: params, header_overrides: header_overrides,
Allow server info without auth
diff --git a/core/db/migrate/20150216173445_add_index_to_spree_stock_items_variant_id.rb b/core/db/migrate/20150216173445_add_index_to_spree_stock_items_variant_id.rb index abc1234..def5678 100644 --- a/core/db/migrate/20150216173445_add_index_to_spree_stock_items_variant_id.rb +++ b/core/db/migrate/20150216173445_add_index_to_spree_stock_items_variant_id.rb @@ -0,0 +1,13 @@+class AddIndexToSpreeStockItemsVariantId < ActiveRecord::Migration + def up + unless index_exists? :spree_stock_items, :variant_id + add_index :spree_stock_items, :variant_id + end + end + + def down + if index_exists? :spree_stock_items, :variant_id + remove_index :spree_stock_items, :variant_id + end + end +end
Add index to SpreeStockItem variant_id Fixes #6050
diff --git a/config/initializers/rp_config.rb b/config/initializers/rp_config.rb index abc1234..def5678 100644 --- a/config/initializers/rp_config.rb +++ b/config/initializers/rp_config.rb @@ -1 +1 @@-CONTINUE_ON_FAILED_REGISTRATION_RPS = RP_CONFIG.fetch('allow_continue_on_failed_registration') +CONTINUE_ON_FAILED_REGISTRATION_RPS = RP_CONFIG.fetch('allow_continue_on_failed_registration', ifnone: [])
3712: Allow flag to not be in config Build is failing because 'allow_continue_on_failed_registration' is not set in the verify-frontend-federation-config configuration. This change allows for the flag not being set, returning empty array instead of nil.
diff --git a/config/deploy.rb b/config/deploy.rb index abc1234..def5678 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,6 +1,6 @@ set :application, "omnominator" set :repository, "git@github.com:railsrumble/rr09-team-174.git" -set :branch, "release" +set :branch, "railsrumble09" set :scm, :git set :git_enable_submodules, true set :deploy_via, :remote_cache
Deploy from the final tag.
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ KomachiHeartbeat::Engine.routes.draw do - get "heartbeat", :to => "heartbeat#index" + get "heartbeat", :to => "heartbeat#index", defaults: { format: "txt" } get "version", :to => "heartbeat#version" get "stats/worker", :to => "stats#worker"
Fix /ops/heartbeat returns svg format with curl
diff --git a/lib/ember_secure_builder/workers/cross_browser_test_batch_results_worker.rb b/lib/ember_secure_builder/workers/cross_browser_test_batch_results_worker.rb index abc1234..def5678 100644 --- a/lib/ember_secure_builder/workers/cross_browser_test_batch_results_worker.rb +++ b/lib/ember_secure_builder/workers/cross_browser_test_batch_results_worker.rb @@ -8,8 +8,8 @@ batch_results = CrossBrowserTestBatchResults.upload! build if batch_results.completed? - elsif times_requeued < 30 - CrossBrowserTestBatchResultsWorker.perform_in 120, build, times_requeued + 1 + elsif times_requeued < 150 + CrossBrowserTestBatchResultsWorker.perform_in 300, build, times_requeued + 1 end end end
Add more retries for collecting test results.
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,6 @@ Rails.application.routes.draw do get '/items', to: 'items#index' + get '/items/new', to: 'items#new' get '/items/:id', to: 'items#show', as: 'item' # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end
Create new route for new items
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,6 +4,10 @@ end else Rails.application.routes.draw do - match 'window_rails/open_window' => 'window_rails#open_window', :as => :open_window + if(Rails.version.split('.').first.to_i < 4) + match 'window_rails/open_window' => 'window_rails#open_window', :as => :open_window + else + get 'window_rails/open_window', to: 'window_rails#open_window', :as => :open_window + end end end
Update routing so rails 4 doesn't get crabby
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,7 +8,9 @@ match '/about' => 'home#about', via: 'get', :as => :home_about match '/contact' => 'home#contact', via: 'get', :as => :home_contact - resources :ideas + resources :ideas do + resources :comments + end # Example resource route with options: # resources :products do
Add comments as a child resource of ideas.
diff --git a/features/steps/reporting/display_run_summary.rb b/features/steps/reporting/display_run_summary.rb index abc1234..def5678 100644 --- a/features/steps/reporting/display_run_summary.rb +++ b/features/steps/reporting/display_run_summary.rb @@ -11,6 +11,17 @@ Given I am a fool When I jump from Codegrams roof Then I must be pwned by floor + + # Scenario: Failed scenario + # Given I love risk + # When I jump from Codegrams roof + # Then my parachute must open + # Then I must not pwned by floor + + # Scenario: Error scenario + # Given I am not a fool + # When I go downstairs + # Then I must succeed ') write_file('features/steps/test_feature.rb', 'Feature "A test feature" do @@ -18,11 +29,21 @@ end When "I jump from Codegrams roof" do end - Given "I love risk" do - end - And "my parachute must open" do - false - end + # Given "I love risk" do + # end + # And "my parachute must open" do + # false + # end + # Given I am a fool + # djkadlaksaldkajd + # end + # Given I am not a fool + # end + # When I go downstairs + # end + # Then I must succeed + # true + # end end') @feature = "features/test_feature.feature" end
Update spinach to take care of some other edge cases. Finalize when undefined step bug is solved
diff --git a/spec/views/layouts/listnav/_cloud_tenant.html.haml_spec.rb b/spec/views/layouts/listnav/_cloud_tenant.html.haml_spec.rb index abc1234..def5678 100644 --- a/spec/views/layouts/listnav/_cloud_tenant.html.haml_spec.rb +++ b/spec/views/layouts/listnav/_cloud_tenant.html.haml_spec.rb @@ -1,4 +1,6 @@ describe "layouts/listnav/_cloud_tenant.html.haml" do + helper(QuadiconHelper) + before :each do set_controller_for_view("cloud_tenant") assign(:panels, "ems_prop" => true, "ems_rel" => true)
Fix test that used to pass due to test contamination Failure: 1) layouts/listnav/_cloud_tenant.html.haml link to parent cloud provider uses restful path Failure/Error: = render_quadicon(@record, :mode => :icon, :size => 72, :typ => :listnav) ActionView::Template::Error: undefined method `render_quadicon' for #<#<Class:0x005616be8f3c18>:0x005616c2b4d280> Did you mean? render_with_update # ./app/views/layouts/listnav/_cloud_tenant.html.haml:4:in `block in _app_views_layouts_listnav__cloud_tenant_html_haml__954280025865702846_47327903420340' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/capture_helper.rb:39:in `block in capture' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/capture_helper.rb:203:in `with_output_buffer' # /home/bdunne/.gem/ruby/2.3.1/gems/haml-4.0.7/lib/haml/helpers/action_view_xss_mods.rb:5:in `with_output_buffer_with_haml_xss' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/capture_helper.rb:39:in `capture' # /home/bdunne/.gem/ruby/2.3.1/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:52:in `capture_with_haml' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/tag_helper.rb:107:in `content_tag' # /home/bdunne/.gem/ruby/2.3.1/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:61:in `content_tag_with_haml' # ./app/helpers/application_helper.rb:49:in `block (2 levels) in miq_accordion_panel' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/capture_helper.rb:39:in `block in capture' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/capture_helper.rb:203:in `with_output_buffer' # /home/bdunne/.gem/ruby/2.3.1/gems/haml-4.0.7/lib/haml/helpers/action_view_xss_mods.rb:5:in `with_output_buffer_with_haml_xss' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/capture_helper.rb:39:in `capture' # /home/bdunne/.gem/ruby/2.3.1/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:52:in `capture_with_haml' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/tag_helper.rb:107:in `content_tag' # /home/bdunne/.gem/ruby/2.3.1/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:61:in `content_tag_with_haml' # ./app/helpers/application_helper.rb:48:in `block in miq_accordion_panel' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/capture_helper.rb:39:in `block in capture' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/capture_helper.rb:203:in `with_output_buffer' # /home/bdunne/.gem/ruby/2.3.1/gems/haml-4.0.7/lib/haml/helpers/action_view_xss_mods.rb:5:in `with_output_buffer_with_haml_xss' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/capture_helper.rb:39:in `capture' # /home/bdunne/.gem/ruby/2.3.1/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:52:in `capture_with_haml' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/tag_helper.rb:107:in `content_tag' # /home/bdunne/.gem/ruby/2.3.1/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:61:in `content_tag_with_haml' # ./app/helpers/application_helper.rb:39:in `miq_accordion_panel' # ./app/views/layouts/listnav/_cloud_tenant.html.haml:3:in `_app_views_layouts_listnav__cloud_tenant_html_haml__954280025865702846_47327903420340' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/template.rb:158:in `block in render' # /home/bdunne/.gem/ruby/2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `block in instrument' # /home/bdunne/.gem/ruby/2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument' # /home/bdunne/.gem/ruby/2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `instrument' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/template.rb:348:in `instrument' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/template.rb:156:in `render' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/renderer/abstract_renderer.rb:42:in `block in instrument' # /home/bdunne/.gem/ruby/2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `block in instrument' # /home/bdunne/.gem/ruby/2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument' # /home/bdunne/.gem/ruby/2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `instrument' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/renderer/abstract_renderer.rb:41:in `instrument' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/renderer/template_renderer.rb:53:in `block in render_template' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/renderer/template_renderer.rb:52:in `render_template' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/renderer/template_renderer.rb:14:in `render' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/renderer/renderer.rb:42:in `render_template' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/renderer/renderer.rb:23:in `render' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/helpers/rendering_helper.rb:32:in `render' # /home/bdunne/.gem/ruby/2.3.1/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:12:in `render_with_haml' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/test_case.rb:199:in `render' # /home/bdunne/.gem/ruby/2.3.1/gems/actionview-5.0.0.1/lib/action_view/test_case.rb:120:in `render' # ./spec/views/layouts/listnav/_cloud_tenant.html.haml_spec.rb:16:in `block (2 levels) in <top (required)>' # ------------------ # --- Caused by: --- # NoMethodError: # undefined method `render_quadicon' for #<#<Class:0x005616be8f3c18>:0x005616c2b4d280> # Did you mean? render_with_update # ./app/views/layouts/listnav/_cloud_tenant.html.haml:4:in `block in _app_views_layouts_listnav__cloud_tenant_html_haml__954280025865702846_47327903420340'
diff --git a/core/exception/interrupt_spec.rb b/core/exception/interrupt_spec.rb index abc1234..def5678 100644 --- a/core/exception/interrupt_spec.rb +++ b/core/exception/interrupt_spec.rb @@ -1,4 +1,10 @@ require File.expand_path('../../../spec_helper', __FILE__) + +describe "Interrupt" do + it "is a subclass of SignalException" do + Interrupt.superclass.should == SignalException + end +end describe "Interrupt.new" do it "returns an instance of interrupt with no message given" do
Add spec for inheritance of Interrupt See also https://github.com/ruby/spec/pull/298#discussion_r81414942
diff --git a/gui/event_queue.rb b/gui/event_queue.rb index abc1234..def5678 100644 --- a/gui/event_queue.rb +++ b/gui/event_queue.rb @@ -14,7 +14,10 @@ else Timer.new(seconds * 1000, lambda { |e| yield - }).start() + }).tap do |timer| + timer.setRepeats(false) + timer.start() + end end end end
Fix bug - Swing Timer defaults to repeating.
diff --git a/itamae-node_env.gemspec b/itamae-node_env.gemspec index abc1234..def5678 100644 --- a/itamae-node_env.gemspec +++ b/itamae-node_env.gemspec @@ -20,5 +20,5 @@ spec.add_dependency "itamae", '>= 1.1.1' spec.add_development_dependency "bundler", "~> 1.7" - spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rake", "~> 13.0" end
Update rake requirement from ~> 10.0 to ~> 13.0 Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version. - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/rake-10.0.0...v13.0.1) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/Casks/better-window-manager.rb b/Casks/better-window-manager.rb index abc1234..def5678 100644 --- a/Casks/better-window-manager.rb +++ b/Casks/better-window-manager.rb @@ -1,11 +1,11 @@ cask :v1 => 'better-window-manager' do - version '1.11.12' - sha256 '6cf65ca37259a3702001b62e677052c2f69b0a35ebfb50d2157891df14ff3bfe' + version '1.13.14' + sha256 '2d3e802c4317c0d9995cd42378d1a317fb9049086c7aafe9fece66970b81b6b1' url "http://gngrwzrd.com/BetterWindowManager-#{version}.zip" name 'Better Window Manager' appcast 'https://www.gngrwzrd.com/betterwindowmanager-appcast.xml', - :sha256 => '321b6bbe7df6f95f49b0c855748d4da1cee655e0ce252988686825068b02f6d9' + :sha256 => 'db3d611bb08871b390bd7d609db9e2d62ef23c22fd9906dfa1368138196aceec' homepage 'https://www.gngrwzrd.com/better-window-manager/' license :commercial
Update Better Window Manager to 1.11.12
diff --git a/Casks/little-snitch-nightly.rb b/Casks/little-snitch-nightly.rb index abc1234..def5678 100644 --- a/Casks/little-snitch-nightly.rb +++ b/Casks/little-snitch-nightly.rb @@ -1,6 +1,6 @@ class LittleSnitchNightly < Cask - version '3.4-nightly-(4205)' - sha256 '2ee5eb87cdb548d4dce67c27dcc03e3560e2efc67210d1cdb6813119311e5e22' + version '3.4-nightly-(4208)' + sha256 'e3b91297945dcaaf7707f8f81301635012d56ea5342d817e21239d9b3f0945e7' url "http://www.obdev.at/downloads/littlesnitch/nightly/LittleSnitch-#{version}.dmg" homepage 'http://www.obdev.at/products/littlesnitch/index.html'
Upgrade Little Snitch Nightly to 3.4 4208
diff --git a/app/helpers/geocoder_helper.rb b/app/helpers/geocoder_helper.rb index abc1234..def5678 100644 --- a/app/helpers/geocoder_helper.rb +++ b/app/helpers/geocoder_helper.rb @@ -2,7 +2,7 @@ def result_to_html(result) html_options = {} #html_options[:title] = strip_tags(result[:description]) if result[:description] - html_options[:href] = "?lat=#{result[:lat]}&lon=#{result[:lon]}&zoom=#{result[:zoom]}" + html_options[:href] = "?mlat=#{result[:lat]}&mlon=#{result[:lon]}&zoom=#{result[:zoom]}" html = "" html << result[:prefix] if result[:prefix] html << link_to_function(result[:name],"setPosition(#{result[:lat]}, #{result[:lon]}, #{result[:zoom]})", html_options) if result[:name]
Make the search URLs include a marker.
diff --git a/app/mailers/pay/user_mailer.rb b/app/mailers/pay/user_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/pay/user_mailer.rb +++ b/app/mailers/pay/user_mailer.rb @@ -3,7 +3,10 @@ def receipt(user, charge) @user, @charge = user, charge - attachments[charge.filename] = charge.receipt.render + if charge.receipt + attachments[charge.filename] = charge.receipt.render + end + mail( to: "#{user.name} <#{user.email}>", from: "Payment receipt"
Check for charge.receipt in mailer
diff --git a/app/models/path_reservation.rb b/app/models/path_reservation.rb index abc1234..def5678 100644 --- a/app/models/path_reservation.rb +++ b/app/models/path_reservation.rb @@ -12,7 +12,7 @@ end def self.create_path_reservation(base_path, publishing_app) - ActiveRecord::Base.transaction do + ActiveRecord::Base.transaction(requires_new: true) do create!(base_path: base_path, publishing_app: publishing_app) end rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation
Add requires_new to ActiveRecord to use savepoints
diff --git a/app/models/permitted_params.rb b/app/models/permitted_params.rb index abc1234..def5678 100644 --- a/app/models/permitted_params.rb +++ b/app/models/permitted_params.rb @@ -4,6 +4,12 @@ # Returns an instance of strong parameters. def session PermittedSessionParams.new(self.params, self.user) + end + + # Public: Permitted Application parameters. + # Returns an instance of strong parameters + def application + PermittedApplicationParams.new(self.params, self.user) end class PermittedSessionParams < Struct.new(:params, :user) @@ -18,4 +24,20 @@ end + class PermittedApplicationParams < Struct.new(:params, :user) + + def create + self.permitted([:name, :redirect_uri]) + end + + def update + self.permitted([:name, :redirect_uri, :website, :description]) + end + + def permitted(attributes) + params.require(:application).permit(*attributes) + end + + end + end
Add Permitted params for Doorkeeper::Application
diff --git a/lib/chronicle/resource_controller_extensions.rb b/lib/chronicle/resource_controller_extensions.rb index abc1234..def5678 100644 --- a/lib/chronicle/resource_controller_extensions.rb +++ b/lib/chronicle/resource_controller_extensions.rb @@ -24,7 +24,7 @@ def clear_model_cache_with_draft_awareness # Don't clear the cache if it's unpublished - unless model.status_id < Status[:published].id + if model.respond_to?(:status_id) && model.status_id >= Status[:published].id clear_model_cache_without_draft_awareness end end
Fix an error when adding page parts.
diff --git a/roles/ucl.rb b/roles/ucl.rb index abc1234..def5678 100644 --- a/roles/ucl.rb +++ b/roles/ucl.rb @@ -19,15 +19,6 @@ } } } - }, - :sysctl => { - :blackhole => { - :comment => "Force TCP level MTU probing because of known ICMP blackhole at UCL", - :parameters => { - "net.ipv4.tcp_mtu_probing" => "2", - "net.ipv4.tcp_base_mss" => "1024" - } - } } )
Revert "Force Enable TCP MTU probing @ UCL" This reverts commit b1ced9fbdbe88a53f3b96236ea82cb85f85262cc.
diff --git a/lib/travis/build/appliances/fix_hhvm_source.rb b/lib/travis/build/appliances/fix_hhvm_source.rb index abc1234..def5678 100644 --- a/lib/travis/build/appliances/fix_hhvm_source.rb +++ b/lib/travis/build/appliances/fix_hhvm_source.rb @@ -1,4 +1,3 @@- require 'travis/build/appliances/base' module Travis @@ -6,16 +5,17 @@ module Appliances class FixHhvmSource < Base def apply - sh.if "$(command -v lsb_release) && $(lsb_release -cs) != precise" do - command = <<-EOF - if [[ -d /var/lib/apt/lists && -n $(command -v apt-get) ]]; then - grep -l -i -r hhvm /etc/apt/sources.list.d | xargs sudo rm -vf - fi - EOF - sh.cmd command, echo: false - sh.cmd "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94", echo: false, assert: false, sudo: true - sh.cmd 'add-apt-repository "deb [ arch=amd64 ] https://dl.hhvm.com/ubuntu $(lsb_release -sc) main"', echo: false, assert: false, sudo: true - end + command = <<-EOF + if command -v lsb_release; then + grep -l -i -r hhvm /etc/apt/sources.list.d | xargs sudo rm -f + sudo sed -i /hhvm/d /etc/apt/sources.list + if [[ $(lsb_release -cs) = trusty ]]; then + sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 + sudo add-apt-repository "deb [arch=amd64] https://dl.hhvm.com/ubuntu $(lsb_release -sc) main" + fi + fi &>/dev/null + EOF + sh.cmd command, assert: false end end end
Remove hhvm repo for images used by enterprise
diff --git a/ruby/main.rb b/ruby/main.rb index abc1234..def5678 100644 --- a/ruby/main.rb +++ b/ruby/main.rb @@ -1,3 +1,5 @@+# encoding: utf-8 +# require 'ffi' module StringTools
Add encoding comment for Ruby.
diff --git a/lib/likes/set.rb b/lib/likes/set.rb index abc1234..def5678 100644 --- a/lib/likes/set.rb +++ b/lib/likes/set.rb @@ -3,8 +3,8 @@ class Set # Default engine - simplest one # - # @see Engines::BestIntersectionSize - DEFAULT_ENGINE = Engines::BestIntersectionSize + # @see Engines::FastJaccardSimilarity + DEFAULT_ENGINE = Engines::FastJaccardSimilarity # Creates new instance of Set #
Make Engines::FastJaccardSimilarity a default engine
diff --git a/lib/priceable.rb b/lib/priceable.rb index abc1234..def5678 100644 --- a/lib/priceable.rb +++ b/lib/priceable.rb @@ -17,9 +17,13 @@ send("#{price_field}#{suffix}=".to_sym, (new_price.to_f * 100).round) end end - if self._accessible_attributes? - attr_accessible *price_fields + + unless Rails::VERSION::MAJOR == 4 + if self._accessible_attributes? + attr_accessible *price_fields + end end + end end
Make compatible with Rails 4