diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/controllers/concerns/update_orcid_behavior.rb b/app/controllers/concerns/update_orcid_behavior.rb index abc1234..def5678 100644 --- a/app/controllers/concerns/update_orcid_behavior.rb +++ b/app/controllers/concerns/update_orcid_behavior.rb @@ -21,8 +21,8 @@ update_orcid_service( User.cid_from_email( current_user.email ), params[:generic_work][:my_orcid] ) end - params[:generic_work].delete( :my_orcid ) end + params[:generic_work].delete( :my_orcid ) if params[:generic_work][:my_orcid] end #
Remove the my_orcid attribute if it is present
diff --git a/backend/spec/features/admin/style_guide_spec.rb b/backend/spec/features/admin/style_guide_spec.rb index abc1234..def5678 100644 --- a/backend/spec/features/admin/style_guide_spec.rb +++ b/backend/spec/features/admin/style_guide_spec.rb @@ -0,0 +1,12 @@+require 'spec_helper' + +describe "Style guide", type: :feature do + stub_authorization! + + it "should render successfully" do + visit "/admin/style_guide" + + # Somewhere in a style guide you'd expect to talk about colors + expect(page).to have_text "Colors" + end +end
Add spec for style guide This would catch if the page fails to render
diff --git a/attributes/pagespeed.rb b/attributes/pagespeed.rb index abc1234..def5678 100644 --- a/attributes/pagespeed.rb +++ b/attributes/pagespeed.rb @@ -2,7 +2,7 @@ # Cookbook Name:: nginx # Recipe:: pagespeed_module # -default['nginx']['pagespeed']['version'] = '1.8.31.4' +default['nginx']['pagespeed']['version'] = '1.11.33.2' default['nginx']['pagespeed']['url'] = "https://github.com/pagespeed/ngx_pagespeed/archive/release-#{node['nginx']['pagespeed']['version']}-beta.tar.gz" default['nginx']['psol']['url'] = "https://dl.google.com/dl/page-speed/psol/#{node['nginx']['pagespeed']['version']}.tar.gz" default['nginx']['pagespeed']['packages']['rhel'] = %w(gcc-c++ pcre-dev pcre-devel zlib-devel make)
Use the latest page speed module Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/capissh.gemspec b/capissh.gemspec index abc1234..def5678 100644 --- a/capissh.gemspec +++ b/capissh.gemspec @@ -13,7 +13,7 @@ s.summary = "Extraction of Capistrano's parallel SSH command execution" s.description = s.summary - s.files = Dir.glob("{bin,lib}/**/*") + %w(LICENSE README.rdoc) + s.files = Dir.glob("{bin,lib}/**/*") + %w(LICENSE README.md) s.require_path = 'lib' s.test_files = Dir.glob("spec/**/*")
Use README.md instead of .rdoc
diff --git a/app/helpers/team_helper.rb b/app/helpers/team_helper.rb index abc1234..def5678 100644 --- a/app/helpers/team_helper.rb +++ b/app/helpers/team_helper.rb @@ -1,6 +1,6 @@ module TeamHelper def team_photo_tag photo, name, factlink_profile - html = link_to "https://factlink.com/#{factlink_profile}", title: "#{name}'s #{I18n.t(:app_name)} Profile" do + html = link_to "https://factlink.com/user/#{factlink_profile}", title: "#{name}'s #{I18n.t(:app_name)} Profile" do html = image_tag "team/#{photo}.jpg", alt: name, class: "team-photo", rel: "tooltip", title: name end html += content_tag "div", name, class: "team-member-name"
Fix link to profile page of team member
diff --git a/Watches.podspec b/Watches.podspec index abc1234..def5678 100644 --- a/Watches.podspec +++ b/Watches.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Watches" - s.version = "0.3" + s.version = "0.3.1" s.summary = "A Simple Stopwatches written in Swift help you easily measure the execution time of function, block of code or async callback." s.description = <<-DESC A Simple swift stopwatches helps you easily logging out the elapsed time between 2 timestamps , find out execution time of function, a block of code or async callback.
Update podspec version to 0.3.1
diff --git a/models/pull_request.rb b/models/pull_request.rb index abc1234..def5678 100644 --- a/models/pull_request.rb +++ b/models/pull_request.rb @@ -29,18 +29,24 @@ def initialize(number) @number = number - @state = redis.get(db_key) + data = JSON.parse(redis.get(db_key)) + @state = data['state'] end def update_from_github! @state = "passed" - redis.set(db_key, @state) + save! end def db_key [self.class.name, number.to_s].join(':') end + def save! + redis.set(db_key, { + 'state' => @state, + }.to_json) + end private
Store data in JSON blob
diff --git a/actionpack/lib/action_dispatch/middleware/body_proxy.rb b/actionpack/lib/action_dispatch/middleware/body_proxy.rb index abc1234..def5678 100644 --- a/actionpack/lib/action_dispatch/middleware/body_proxy.rb +++ b/actionpack/lib/action_dispatch/middleware/body_proxy.rb @@ -12,9 +12,11 @@ def close return if @closed @closed = true - @body.close if @body.respond_to? :close - ensure - @block.call + begin + @body.close if @body.respond_to? :close + ensure + @block.call + end end def closed?
Add begin/ensure block since we are returning.
diff --git a/lib/formalist/elements/standard/rich_text_area.rb b/lib/formalist/elements/standard/rich_text_area.rb index abc1234..def5678 100644 --- a/lib/formalist/elements/standard/rich_text_area.rb +++ b/lib/formalist/elements/standard/rich_text_area.rb @@ -7,6 +7,8 @@ class RichTextArea < Field attribute :box_size, Types::String.enum("single", "small", "normal", "large", "xlarge"), default: "normal" attribute :inline_formatters, Types::Array + attribute :block_formatters, Types::Array + attribute :embeddable_forms, Types::Hash end register :rich_text_area, RichTextArea
Allow additional attribute for the rte field.
diff --git a/GroundControl.podspec b/GroundControl.podspec index abc1234..def5678 100644 --- a/GroundControl.podspec +++ b/GroundControl.podspec @@ -7,5 +7,6 @@ s.authors = { 'Mattt Thompson' => 'm@mattt.me' } s.source = { :git => 'https://github.com/mattt/GroundControl.git', :tag => '0.0.1' } s.source_files = 'GroundControl' - s.dependency 'AFNetworking', '>= 0.9' + s.requires_arc = true + s.dependency 'AFNetworking', '>= 0.9' end
Add requires_arc flag to podspec
diff --git a/lib/bible_ref/languages/base.rb b/lib/bible_ref/languages/base.rb index abc1234..def5678 100644 --- a/lib/bible_ref/languages/base.rb +++ b/lib/bible_ref/languages/base.rb @@ -6,7 +6,7 @@ end def book_id(book_name, canon) - book_name = replace_roman_numerals(book_name.downcase) + book_name = replace_roman_numerals(book_name) return book_name.upcase if books[book_name.upcase] # already normalized canon.books.each do |book| details = books[book] @@ -26,9 +26,9 @@ end def replace_roman_numerals(book) - book.sub!(/^iii /i, '3 ') - book.sub!(/^ii /i, '2 ') - book.sub!(/^i /i, '1 ') + book.sub!(/^iii |^III /i, '3 ') + book.sub!(/^ii |^II /i, '2 ') + book.sub!(/^i |^I /i, '1 ') book end end
Fix issue with cherokee in certain locales On my server, the locale was slightly different and the downcase was messing things up.
diff --git a/sidekiq-status.gemspec b/sidekiq-status.gemspec index abc1234..def5678 100644 --- a/sidekiq-status.gemspec +++ b/sidekiq-status.gemspec @@ -14,7 +14,7 @@ gem.require_paths = ['lib'] gem.version = Sidekiq::Status::VERSION - gem.add_dependency 'sidekiq', '>= 2.7', '< 3.4' + gem.add_dependency 'sidekiq', '>= 2.7' gem.add_development_dependency 'rack-test' gem.add_development_dependency 'rake' gem.add_development_dependency 'rspec'
Remove version limitation on sidekiq
diff --git a/i18n.gemspec b/i18n.gemspec index abc1234..def5678 100644 --- a/i18n.gemspec +++ b/i18n.gemspec @@ -18,4 +18,5 @@ s.require_path = 'lib' s.rubyforge_project = '[none]' s.required_rubygems_version = '>= 1.3.5' + s.required_ruby_version = '>= 1.9.3' end
Add required ruby version to the gemspec
diff --git a/common/model.rb b/common/model.rb index abc1234..def5678 100644 --- a/common/model.rb +++ b/common/model.rb @@ -1,3 +1,5 @@+require 'base64' + module Ldash # Discord user class User @@ -42,6 +44,22 @@ @messages = [] @roles = [] @tokens = [] + + @token_num = 0 + end + + def create_token(user) + # The first part of a token is the bot user ID, base 64 encoded. + first_part = Base64.encode64(user.id.to_s).strip + + # Then comes a string that's counted up globally. + @token_num += 1 + second_part = Base64.encode64([@token_num].pack('Q>').sub(/^\x00+/, '')).strip + + # The third part is probably randomly generated + third_part = Base64.encode64([*0..17].map(rand(0..255)).pack('C*')).strip + + "#{first_part}.#{second_part}.#{third_part}" end end end
Add Session method for token creation
diff --git a/finite_machine.gemspec b/finite_machine.gemspec index abc1234..def5678 100644 --- a/finite_machine.gemspec +++ b/finite_machine.gemspec @@ -19,5 +19,7 @@ spec.require_paths = ["lib"] spec.add_development_dependency 'bundler', '>= 1.5.0', '< 2.0' + spec.add_development_dependency 'rspec', '~> 3.1' + spec.add_development_dependency 'rspec-benchmark', '~> 0.3.0' spec.add_development_dependency 'rake' end
Change to be specific about dev dependencies
diff --git a/app/controllers/mixins/actions/vm_actions/right_size.rb b/app/controllers/mixins/actions/vm_actions/right_size.rb index abc1234..def5678 100644 --- a/app/controllers/mixins/actions/vm_actions/right_size.rb +++ b/app/controllers/mixins/actions/vm_actions/right_size.rb @@ -22,12 +22,11 @@ @refresh_partial = "vm_common/right_size" right_size(record) replace_right_cell if @orig_action == "x_history" + elsif role_allows?(:feature => "vm_right_size") + # redirect to build the ownership screen + javascript_redirect(:controller => rec_cls.to_s, :action => 'right_size', :id => record.id, :escape => false) else - if role_allows?(:feature => "vm_right_size") - javascript_redirect :controller => rec_cls.to_s, :action => 'right_size', :id => record.id, :escape => false # redirect to build the ownership screen - else - head :ok - end + head :ok end end
Fix rubocop warnings in VmActions::RightSize
diff --git a/lib/outpost/secretary/engine.rb b/lib/outpost/secretary/engine.rb index abc1234..def5678 100644 --- a/lib/outpost/secretary/engine.rb +++ b/lib/outpost/secretary/engine.rb @@ -1,6 +1,9 @@ module Outpost module Secretary class Engine < ::Rails::Engine + # This is necessary to support rails 3, which doesn't autoload + # the concerns directory + config.autoload_paths << File.expand_path("../../../../app/controllers/concerns", __FILE__) end end end
Add autoload path for rails 3
diff --git a/lib/s3gallery/s3_gallery_api.rb b/lib/s3gallery/s3_gallery_api.rb index abc1234..def5678 100644 --- a/lib/s3gallery/s3_gallery_api.rb +++ b/lib/s3gallery/s3_gallery_api.rb @@ -21,5 +21,16 @@ @last_recv = nil end + def enumerate_bucket + Enumerator.new do |g| + page = AWS::S3::Bucket.objects(@gallery_bucket, :marker => @last_recv, :max_keys => 1000) + until page.empty? + page.each do |i| + g.yield i + end + page = AWS::S3::Bucket.objects(@gallery_bucket, :marker => page[-1].key, :max_keys => 1000) + end + end + end end
Make an enumerable for aws entries
diff --git a/lib/specinfra/command/debian.rb b/lib/specinfra/command/debian.rb index abc1234..def5678 100644 --- a/lib/specinfra/command/debian.rb +++ b/lib/specinfra/command/debian.rb @@ -14,11 +14,6 @@ end cmd end - - def check_running(service) - # This is compatible with Debian >Jaunty and Ubuntu derivatives - "service #{escape(service)} status | grep 'running'" - end end end end
Fix checking for service started status on Debian `service SERVICE_NAME status` should return a 0 exit code when running, or non-zero when not running. Piping into grep swallows this, and serves no apparent purpose. This results in services *always* appearing running as long as the command outputs something including 'running' to stdout, including strings like 'SERVICE_NAME is not running'.
diff --git a/lib/web_console/view_helpers.rb b/lib/web_console/view_helpers.rb index abc1234..def5678 100644 --- a/lib/web_console/view_helpers.rb +++ b/lib/web_console/view_helpers.rb @@ -1,11 +1,12 @@ module WebConsole module ViewHelpers def console + p binding.callers @should_render = true if @should_render.nil? if @should_render @console_session = WebConsole::REPLSession.create( - binding: binding.callers[0] + binding: binding.callers[1] ) @should_render = false
Change the console binding to the correct view binding
diff --git a/ikku.gemspec b/ikku.gemspec index abc1234..def5678 100644 --- a/ikku.gemspec +++ b/ikku.gemspec @@ -19,5 +19,6 @@ spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.7" + spec.add_development_dependency "pry" spec.add_development_dependency "rake", "~> 10.0" end
Add pry gem for development
diff --git a/app/controllers/api/v1/api_application_controller.rb b/app/controllers/api/v1/api_application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/api_application_controller.rb +++ b/app/controllers/api/v1/api_application_controller.rb @@ -11,19 +11,21 @@ end def check_customer_access_token! - customer = Customer.find_by_access_token(request.headers['Token']) - if customer != nil - return true + token = request.headers['Token'] + if token.blank? + return false end - return false + customer = Customer.find_by_access_token(token) + customer.present? end def check_technician_access_token! + token = request.headers['Token'] + if token.blank? + return false + end technician = Technician.find_by_access_token(request.headers['Token']) - if technician != nil - return true - end - return false + technician.present? end end end
Fix authentication bug when token is empty
diff --git a/lib/boot.rb b/lib/boot.rb index abc1234..def5678 100644 --- a/lib/boot.rb +++ b/lib/boot.rb @@ -1,5 +1,5 @@ require 'config' -app_env = ENV['AWS_ENV'] || 'development' +app_env = ENV['AWS_ENV'] || 'test' Config.load_and_set_settings( Config.setting_files('config', app_env) )
Make the "test" stage the default
diff --git a/spec/sprockets_spec.rb b/spec/sprockets_spec.rb index abc1234..def5678 100644 --- a/spec/sprockets_spec.rb +++ b/spec/sprockets_spec.rb @@ -18,9 +18,9 @@ Stylus.setup(env) end - it "copies the 'stylesheets' paths" do + it "copies the asset paths" do Stylus.setup(env) - Stylus.paths.should include fixture_root + Stylus.paths.should == env.paths end it "configure the debug and compress flags" do
Tweak another example to check all paths.
diff --git a/rubyswig.gemspec b/rubyswig.gemspec index abc1234..def5678 100644 --- a/rubyswig.gemspec +++ b/rubyswig.gemspec @@ -15,7 +15,7 @@ gem.extensions << "ext/Rakefile" gem.files = `git ls-files`.split($\) #gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } - gem.executables = ["swig"] + gem.executables = ['swig', 'ccache-swig'] gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.name = "rubyswig" gem.require_paths = ["lib"]
Add ccache-swig as an executable
diff --git a/cookbooks/wt_streamingapi/attributes/default.rb b/cookbooks/wt_streamingapi/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/wt_streamingapi/attributes/default.rb +++ b/cookbooks/wt_streamingapi/attributes/default.rb @@ -14,17 +14,9 @@ default['wt_streamingapi']['java_opts'] = "-Xms2048m -XX:+UseG1GC -Djava.net.preferIPv4Stack=true" default['wt_streamingapi']['jmx_port'] = 9999 default['wt_streamingapi']['writeBufferHighWaterMark'] = 1048576 -<<<<<<< HEAD -default['wt_streamingapi']['usagedbserver'] = "" -default['wt_streamingapi']['usagedbname'] = "Streaming" -default['wt_streamingapi']['usagedbuser'] = "" -default['wt_streamingapi']['usagedbpwd'] = "" -default['wt_streamingapi']['log_dir'] = "/var/log/webtrends/streamingapi" -======= default['wt_streamingapi']['usagedbserver'] = "" default['wt_streamingapi']['usagedbname'] = "Streaming" default['wt_streamingapi']['usagedbuser'] = "" default['wt_streamingapi']['usagedbpwd'] = "" default['wt_streamingapi']['log_dir'] = "/var/log/webtrends/streamingapi" -default['wt_streamingapi']['proxy_host'] = "" ->>>>>>> streaming_1.1 +default['wt_streamingapi']['proxy_host'] = ""
Fix bad merge of sapi Former-commit-id: 09615e6e525b81d244771f3e0cce31d731cfa6fe [formerly 07b2280091ce2dc69748756780cbfa33d4e81f40] [formerly 3d95da274aabf5c6098c0edf0e639b738d8d7c84 [formerly 3421654b91a899d39c9795c620b85bbc66671499 [formerly 90ea9cb816c6be3b3837778a4ce8b47e2491b651]]] Former-commit-id: f0189059365b3e38f4fa2110b3de50e8285d57c8 [formerly b200872bee583fa1074db7af5f9707054cefd7a8] Former-commit-id: 3eb8b6d234bf555690b568d3b78f7f83ce7f62f7 Former-commit-id: 4eeb8210eb6145be605d01f147bfdb668f2b700c
diff --git a/j7w1.gemspec b/j7w1.gemspec index abc1234..def5678 100644 --- a/j7w1.gemspec +++ b/j7w1.gemspec @@ -23,4 +23,5 @@ spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" + spec.add_development_dependency "activerecord", ">= 4.0" end
Add dependency on AR 4.x
diff --git a/sloc.gemspec b/sloc.gemspec index abc1234..def5678 100644 --- a/sloc.gemspec +++ b/sloc.gemspec @@ -23,6 +23,7 @@ spec.add_development_dependency 'bundler', '>= 1.7' spec.add_development_dependency 'coveralls' + spec.add_development_dependency 'guard-rspec' spec.add_development_dependency 'pry' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec'
Add guard-rspec as development dependency
diff --git a/test/test_from_hash.rb b/test/test_from_hash.rb index abc1234..def5678 100644 --- a/test/test_from_hash.rb +++ b/test/test_from_hash.rb @@ -5,7 +5,7 @@ def setup @data_dir = File.dirname(__FILE__) + '/data' hash_data = JSON.parse(File.read( @data_dir + '/test.jpg.json')).first - @mini_exiftool = MiniExifTool.from_hash hash_data + @mini_exiftool = MiniExiftool.from_hash hash_data end def test_conversion
Fix typo to make TestFromHash work.
diff --git a/test/unit/font_test.rb b/test/unit/font_test.rb index abc1234..def5678 100644 --- a/test/unit/font_test.rb +++ b/test/unit/font_test.rb @@ -16,8 +16,8 @@ @cov = @fnt.get_coverage lang end - it "returns an instance of Pango::Coverage" do - _(@cov).must_be_instance_of Pango::Coverage + it "returns a Pango::Coverage" do + _(@cov).must_be_kind_of Pango::Coverage end it "returns valid coverage info" do @@ -29,8 +29,8 @@ let(:lang) { Pango::Language.from_string "en" } let(:cov) { @fnt.coverage lang } - it "returns an instance of Pango::Coverage" do - _(cov).must_be_instance_of Pango::Coverage + it "returns a Pango::Coverage" do + _(cov).must_be_kind_of Pango::Coverage end it "returns valid coverage info" do
Fix test to allow subclass of Pango::Coverage to be found
diff --git a/spina-template.gemspec b/spina-template.gemspec index abc1234..def5678 100644 --- a/spina-template.gemspec +++ b/spina-template.gemspec @@ -19,7 +19,7 @@ spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" - spec.add_dependency "bourbon", "~> 3.2" + spec.add_dependency "bourbon", "~> 4.2" spec.add_dependency "neat", "~> 1.5" spec.add_dependency "coffee-rails" spec.add_dependency 'jquery-fileupload-rails'
Update bourbon dependency to allow compatibility with administrate gem
diff --git a/whatlanguage.gemspec b/whatlanguage.gemspec index abc1234..def5678 100644 --- a/whatlanguage.gemspec +++ b/whatlanguage.gemspec @@ -11,9 +11,10 @@ gem.description = %q{WhatLanguage rapidly detects the language of a sample of text} gem.summary = %q{Natural language detection for text samples} gem.homepage = "https://github.com/peterc/whatlanguage" + gem.license = "MIT" gem.files = `git ls-files`.split($/).reject { |f| f.start_with?("wordlists") } gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] -end+end
Add license to gemspec, is MIT Fixes https://github.com/peterc/whatlanguage/issues/19
diff --git a/update_slugs_on_staging.rb b/update_slugs_on_staging.rb index abc1234..def5678 100644 --- a/update_slugs_on_staging.rb +++ b/update_slugs_on_staging.rb @@ -0,0 +1,21 @@+require File.expand_path('../config/environment', __FILE__) + +[Organisation, Role, SupportingDocument, Topic].each do |klass| + # We need to temporarily override #should_generate_new_friendly_id? so that we can generate slugs for existing objects + klass.class_eval do + def should_generate_new_friendly_id? + super + end + end + + # Re-save each of the objects to force slug creation + puts "Updating #{klass.to_s.tableize}" + klass.all.each { |object| object.save } +end + +puts "Updating documents" +Document.all.each do |document| + identity = document.document_identity + identity.sluggable_string = document.title + identity.save +end
Revert "Removed the temporary script to update slugs on staging." This reverts commit d6bbd8d0d3ceb800825efff6e8196709ff266488. I've made a change to the slug generation (to ignore apostrophes) so want to re-generate the slugs on staging.
diff --git a/week-4/add-it-up/my_solution.rb b/week-4/add-it-up/my_solution.rb index abc1234..def5678 100644 --- a/week-4/add-it-up/my_solution.rb +++ b/week-4/add-it-up/my_solution.rb @@ -4,34 +4,84 @@ # include it in this file. Also make sure everything that isn't code # is commented in the file. -# I worked on this challenge [by myself, with: ]. +# I worked on this challenge [by myself, with: Regina Compton]. # 0. total Pseudocode # make sure all pseudocode is commented out! -# Input: -# Output: +# Input: collection of numbers +# Output: sum of numbers # Steps to solve the problem. +# create a loop +# create counter for index starting at zero +# set intial sum equal to the first number +# increment counter by one +# close loop after iterating through entire collection # 1. total initial solution - +# def total (array) +# len = array.length +# index = 0 +# sum = 0 +# until index == len +# sum += array[index] +# index += 1 +# end +# return sum +# end # 3. total refactored solution - +def total (array) + index = 0 + sum = 0 + until index == array.length + sum += array[index] + index += 1 + end +return sum +end # 4. sentence_maker pseudocode # make sure all pseudocode is commented out! -# Input: -# Output: +# Input: list of strings +# Output: capitalized sentence # Steps to solve the problem. +# create a loop +# create counter for index starting at zero +# set intial sentence equal to the first string +# increment counter by one +# close loop after iterating through entire list +# capitalize sentence # 5. sentence_maker initial solution - +# def sentence_maker (array) +# index = 0 +# sentence = '' +# until index == array.length +# sentence += array[index] + ' ' +# index += 1 +# end +# return sentence.capitalize +# end # 6. sentence_maker refactored solution +def sentence_maker (array) + index = 0 + sentence = "" + array = array.map {|x| x.to_s} + +until index == array.length-1 + sentence += array[index] + " " + index += 1 +end + +sentence += array[-1] + "." +return sentence.capitalize + +end
Add 4.7.2 Add it Up Challenge
diff --git a/everything-core.gemspec b/everything-core.gemspec index abc1234..def5678 100644 --- a/everything-core.gemspec +++ b/everything-core.gemspec @@ -4,25 +4,25 @@ require 'everything/version' Gem::Specification.new do |spec| - spec.name = "everything-core" + spec.name = 'everything-core' spec.version = Everything::VERSION - spec.authors = ["Kyle Tolle"] - spec.email = ["kyle@nullsix.com"] + spec.authors = ['Kyle Tolle'] + spec.email = ['kyle@nullsix.com'] spec.summary = %q{Library for working with your `everything` repository.} spec.description = %q{Gives you access to pieces within your everything repo.} - spec.homepage = "https://github.com/kyletolle/everything-core" - spec.license = "MIT" + spec.homepage = 'https://github.com/kyletolle/everything-core' + spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) - spec.require_paths = ["lib"] + spec.require_paths = ['lib'] - spec.add_runtime_dependency "dotenv", "= 2.0.2" - spec.add_runtime_dependency "fastenv", "= 0.0.2" + spec.add_runtime_dependency 'dotenv', '= 2.0.2' + spec.add_runtime_dependency 'fastenv', '= 0.0.2' - spec.add_development_dependency "bundler", "~> 1.11" - spec.add_development_dependency "rake", "~> 10.4" - spec.add_development_dependency "rspec" + spec.add_development_dependency 'bundler', '~> 1.11' + spec.add_development_dependency 'rake', '~> 10.5' + spec.add_development_dependency 'rspec', '~> 3.4.0' end
Add rspec version; use single quoted strings in the gemspec
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -37,6 +37,6 @@ # config.i18n.default_locale = :de # For Foundation 5 - config.assets.precompile += %w( vendor/modernizr ) + config.assets.precompile += %w( vendor/modernizr facebook_login.js ) end end
Add facebook_login.js to asset pipeline precompile
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -11,5 +11,7 @@ # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. + config.time_zone = 'Eastern Time (US & Canada)' + config.active_record.default_timezone = :utc end end
Set default timezone as UTC and EST
diff --git a/app/controllers/api/webhooks_controller.rb b/app/controllers/api/webhooks_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/webhooks_controller.rb +++ b/app/controllers/api/webhooks_controller.rb @@ -1,4 +1,6 @@ class Api::WebhooksController < Api::ApplicationController + before_action :authenticate + def github_callback event_name = request.headers.fetch('X-GitHub-Event') payload = JSON.parse(request.body.read) @@ -15,4 +17,18 @@ head :ok end + + private + + def authenticate + head :unauthorized unless verify_signature + end + + def verify_signature + github_signature = request.headers.fetch('X-Hub-Signature') + return false unless github_signature + + signature = "sha1=#{OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), Settings.github.webhook_secret, request.body.read)}" + Rack::Utils.secure_compare(signature, github_signature) + end end
Add signature authentication to webhook
diff --git a/app/controllers/kuroko2/logs_controller.rb b/app/controllers/kuroko2/logs_controller.rb index abc1234..def5678 100644 --- a/app/controllers/kuroko2/logs_controller.rb +++ b/app/controllers/kuroko2/logs_controller.rb @@ -2,7 +2,7 @@ def index @definition = Kuroko2::JobDefinition.find(logs_params[:job_definition_id]) @instance = Kuroko2::JobInstance.find(logs_params[:job_instance_id]) - @logs = @instance.logs + @logs = @instance.logs.order(:id) render layout: false end
Order job instance logs returned by XHR
diff --git a/sherlock.gemspec b/sherlock.gemspec index abc1234..def5678 100644 --- a/sherlock.gemspec +++ b/sherlock.gemspec @@ -16,5 +16,6 @@ s.require_path = 'lib' s.requirements << 'none' + s.add_development_dependency 'rake' s.add_development_dependency 'rspec' end
Update gemspec to include Rake
diff --git a/Spec/SCPullRefresh.podspec b/Spec/SCPullRefresh.podspec index abc1234..def5678 100644 --- a/Spec/SCPullRefresh.podspec +++ b/Spec/SCPullRefresh.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SCPullRefresh" - s.version = "0.1" + s.version = "0.0.1" s.summary = "A pull refresh for easily customize refresh animation" s.homepage = "https://github.com/singro/SCPullRefresh" s.license = { :type => 'MIT', :file => 'LICENSE' }
Fix pod spec source tag There are other methods of specifying the location of source code instead of tags, but you should really be using tags to mark your code commit for your spec. If you are not the owner of the repository you are creating a spec for, file an issue with the repository to request that a tag be made. If this doesn’t work, then you should specify the version of your podspec to begin at 0.0.1 to indicate that this pod’s spec is unmanaged. Should the owner finally get a tag, then you can update the podspec with the correct version with little fear of conflicting with your previously unmanaged podspec’s version.
diff --git a/sudokusolver.gemspec b/sudokusolver.gemspec index abc1234..def5678 100644 --- a/sudokusolver.gemspec +++ b/sudokusolver.gemspec @@ -17,7 +17,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_development_dependency "bundler", "~> 1.7" + spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rspec", "~> 3.1" end
Allow for bundler 1.6.9 which is what comes with Ruby 2.0.0
diff --git a/api/ruby/enterprise/list_all_ssh_keys.rb b/api/ruby/enterprise/list_all_ssh_keys.rb index abc1234..def5678 100644 --- a/api/ruby/enterprise/list_all_ssh_keys.rb +++ b/api/ruby/enterprise/list_all_ssh_keys.rb @@ -0,0 +1,43 @@+require 'octokit' + +Octokit.configure do |c| + c.api_endpoint = 'http(s)://HOSTNAME/api/v3' + c.login = 'USERNAME' + c.password = 'PASSWORD' +end + +Octokit.auto_paginate = true + +users = Octokit.all_users + +total = users.length +puts "Found #{total} users." +puts + +count = 1 + +users.each do |user| + if user.type == 'Organization' + puts "No keys for #{user.login} (user ##{count} of #{total})." + count += 1 + next + end + + keys = Octokit.user_keys(user.login) + + if keys.empty? + puts "No keys for #{user.login} (user ##{count} of #{total})." + else + puts + puts "==================================================" + puts "Keys for #{user.login} (user ##{count} of #{total}):" + keys.each do |key| + puts + puts key.key + end + puts "==================================================" + puts + end + + count += 1 +end
Add a script to list all SSH keys on an appliance
diff --git a/app/controllers/taxonomies_controller.rb b/app/controllers/taxonomies_controller.rb index abc1234..def5678 100644 --- a/app/controllers/taxonomies_controller.rb +++ b/app/controllers/taxonomies_controller.rb @@ -1,13 +1,13 @@ class TaxonomiesController < ApplicationController def show taxon_content_id = params[:content_id] - @taxonomy = Taxonomy::ExpandedTaxonomy.new(taxon_content_id).build + taxonomy = Taxonomy::ExpandedTaxonomy.new(taxon_content_id).build respond_to do |format| format.csv do send_data( - Taxonomy::CsvTreePresenter.new(@taxonomy.child_expansion).present, - filename: @taxonomy.root_node.content_item.title + ".csv" + Taxonomy::CsvTreePresenter.new(taxonomy.child_expansion).present, + filename: taxonomy.root_node.content_item.title + ".csv" ) end end
Remove unnecessary instance var from controller
diff --git a/app/helpers/quick_jump_targets_helper.rb b/app/helpers/quick_jump_targets_helper.rb index abc1234..def5678 100644 --- a/app/helpers/quick_jump_targets_helper.rb +++ b/app/helpers/quick_jump_targets_helper.rb @@ -15,7 +15,7 @@ chain = chain.where("verb <> 'read'").order("created_at DESC") offset = 0 contents = [] - while contents.length < limit do + while contents.length < limit && offset < chain.count do activity = chain.offset(offset).first content = activity.try(:content).presence if content.present? && !contents.include?(content)
Fix infinite loop bug in helper method
diff --git a/spec/bwt_spec.rb b/spec/bwt_spec.rb index abc1234..def5678 100644 --- a/spec/bwt_spec.rb +++ b/spec/bwt_spec.rb @@ -14,6 +14,10 @@ it "encodes 'banana'" do expect(subject.encode('banana')).to eq('annb$aa') end + + it "encodes a longer string" do + expect(subject.encode("Isn't the Burrows-Wheeler Transform neat?")).to eq("ermt?nst $ -rehnhelstWers afreToruwnI'a Bo") + end end describe '#decode' do @@ -28,5 +32,9 @@ it "decodes 'banana'" do expect(subject.decode('annb$aa')).to eq('banana') end + + it "decodes a longer string" do + expect(subject.decode("ermt?nst $ -rehnhelstWers afreToruwnI'a Bo")).to eq("Isn't the Burrows-Wheeler Transform neat?") + end end end
Add a test for a longer string
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 @@ -1,2 +1,6 @@ $: << File.join(File.dirname(__FILE__), "..", "..", "lib") + +require 'rubygems' +require 'spec/expectations' + require 'solitaire_cipher'
Allow the stories to get access to RSpec expectations.
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 @@ -33,5 +33,5 @@ set_environment_variable "HOME", home FileUtils.mkdir(home) - @aruba_timeout_seconds = Cucumber::JRUBY ? 35 : 15 + @aruba_timeout_seconds = Cucumber::JRUBY ? 45 : 15 end
Fix: Increase aruba timeout for Jruby on CI
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 @@ -14,8 +14,8 @@ Capybara.run_server = false Capybara.default_wait_time = 60 -Capybara.default_driver = :webkit -Capybara.javascript_driver = :selenium +Capybara.default_driver = :selenium +# Capybara.javascript_driver = :selenium # A bad, bad place to put this. But breaking it out into it's own file seems
Use Selenium for all tests.
diff --git a/db/migrate/20090820185410_drop_requirements_table.rb b/db/migrate/20090820185410_drop_requirements_table.rb index abc1234..def5678 100644 --- a/db/migrate/20090820185410_drop_requirements_table.rb +++ b/db/migrate/20090820185410_drop_requirements_table.rb @@ -35,7 +35,7 @@ dependencies }.squish - rename_column :dependencies, :requirement, :name + rename_column :dependencies, :requirements, :name remove_column :dependencies, :version_id end end
Fix rename_column to use the correct column name
diff --git a/core/gc/stat_spec.rb b/core/gc/stat_spec.rb index abc1234..def5678 100644 --- a/core/gc/stat_spec.rb +++ b/core/gc/stat_spec.rb @@ -17,12 +17,12 @@ it "increases count after GC is run" do count = GC.stat(:count) GC.start - (GC.stat(:count) > count).should be_true + GC.stat(:count).should > count end it "increases major_gc_count after GC is run" do count = GC.stat(:major_gc_count) GC.start - (GC.stat(:major_gc_count) > count).should be_true + GC.stat(:major_gc_count).should > count end end
Use should > in GC specs
diff --git a/Casks/omnioutliner.rb b/Casks/omnioutliner.rb index abc1234..def5678 100644 --- a/Casks/omnioutliner.rb +++ b/Casks/omnioutliner.rb @@ -1,6 +1,6 @@ cask :v1 => 'omnioutliner' do - version '4.2.3' - sha256 '023ee03e68a1e9ee64dd6f6548ab6164e0a6ad82c205de5c4c02c56da40d019c' + version '4.3' + sha256 '8941d9738c3377f4f57f097ff5bf24faa133bd0bf25498d919db751487153357' url "http://downloads2.omnigroup.com/software/MacOSX/10.10/OmniOutliner-#{version}.dmg" name 'OmniOutliner'
Update Omnioutliner to version 4.3 This commit updates the version and sha256 stanzas
diff --git a/Casks/phpstorm-eap.rb b/Casks/phpstorm-eap.rb index abc1234..def5678 100644 --- a/Casks/phpstorm-eap.rb +++ b/Casks/phpstorm-eap.rb @@ -1,6 +1,6 @@ cask 'phpstorm-eap' do - version '144.3168' - sha256 '5b9a0b1584badbf155c627a2ff6c8c9dfcad3e907e4b127c41fc1ed3a9d41bec' + version '145.61.14' + sha256 '116f645202fdb702903e99e2c848cffa741074ef37701596d290695b2c2ec801' url "https://download.jetbrains.com/webide/PhpStorm-EAP-#{version}.dmg" name 'PhpStorm EAP'
Update PhpStorm EAP to 145.61.14
diff --git a/app/controllers/avatars_controller.rb b/app/controllers/avatars_controller.rb index abc1234..def5678 100644 --- a/app/controllers/avatars_controller.rb +++ b/app/controllers/avatars_controller.rb @@ -27,7 +27,7 @@ user.avatar.destroy user.save user.expire_avatar_email_caches - flash[:success] = "You profile image was deleted" - redirect_to(user_path(user)) + flash[:success] = "You avatar was deleted" + redirect_to(user_edit_my_details_path(user)) end end
Change redirect url after deleting an avatar
diff --git a/webapp/ruby/unicorn_config.rb b/webapp/ruby/unicorn_config.rb index abc1234..def5678 100644 --- a/webapp/ruby/unicorn_config.rb +++ b/webapp/ruby/unicorn_config.rb @@ -1,3 +1,3 @@ worker_processes 1 preload_app true -listen "127.0.0.1:8080" +listen "127.0.0.1:8081"
Change unicorn port (for development)
diff --git a/spec/elements/even_and_odd_headers_spec.rb b/spec/elements/even_and_odd_headers_spec.rb index abc1234..def5678 100644 --- a/spec/elements/even_and_odd_headers_spec.rb +++ b/spec/elements/even_and_odd_headers_spec.rb @@ -0,0 +1,23 @@+require "spec_helper" + +describe OpenXml::Docx::Elements::EvenAndOddHeaders do + include ElementTestMacros + + it_should_use tag: :evenAndOddHeaders, name: "even_and_odd_headers" + + with_no_attributes_set do + it_should_output "<w:evenAndOddHeaders/>", assign: false + end + + for_attribute(:value) do + with_value(true) do + it_should_assign_successfully + it_should_output "<w:evenAndOddHeaders w:val=\"true\"/>" + end + + with_value(:somethingElse) do + it_should_raise_an_exception + end + end + +end
[skip] Add spec for evenAndOddHeaders tag (2m)
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 @@ -1,3 +1,5 @@ class Conversation < ApplicationRecord - + belongs_to :sender, class_name: 'User', foreign_key: :sender_id + belongs_to :recipient, class_name: 'User', foreign_key: :recipient_id + belongs_to :conversation_variety end
Add associations to Conversation model, as yet untested
diff --git a/app/models/news_article.rb b/app/models/news_article.rb index abc1234..def5678 100644 --- a/app/models/news_article.rb +++ b/app/models/news_article.rb @@ -9,7 +9,7 @@ attr_accessible :title, :source, :pubdate, :gnews_url, :url, :moderation, :rejection, :politician_ids def pretty_date - self.pubdate.strftime("%A, %d %B %Y") + self.pubdate.blank? ? '' : self.pubdate.strftime("%A, %d %B %Y") end def fixed_url
Fix for Admin 'show' for news articles. Related to the pretty_date method of the associated model.
diff --git a/app/models/offsite_link.rb b/app/models/offsite_link.rb index abc1234..def5678 100644 --- a/app/models/offsite_link.rb +++ b/app/models/offsite_link.rb @@ -40,6 +40,7 @@ whitelisted_hosts = [ "flu-lab-net.eu", "tse-lab-net.eu", + "beisgovuk.citizenspace.com" ] whitelisted_hosts.any? { |whitelisted_host| host =~ /#{whitelisted_host}$/}
Whitelist custom offsite link domain
diff --git a/lib/attask/api/task.rb b/lib/attask/api/task.rb index abc1234..def5678 100644 --- a/lib/attask/api/task.rb +++ b/lib/attask/api/task.rb @@ -18,9 +18,17 @@ # For some reasons api is not returning this values fields.delete("auditUserIDs") fields.delete("auditNote") + fields.delete("predecessorExpression") fields.join(',') end + def metadata + output = @metadata ||= request(:get, credentials, api_model.api_path + "/metadata") + output["data"]["fields"].delete("predecessorExpression") + output["data"]["fields"].delete("auditNote") + output["data"]["fields"].delete("auditUserIDs") + output + end end end
Remove of the non-downloadable entities
diff --git a/lib/buckaruby/ideal.rb b/lib/buckaruby/ideal.rb index abc1234..def5678 100644 --- a/lib/buckaruby/ideal.rb +++ b/lib/buckaruby/ideal.rb @@ -12,6 +12,7 @@ "MOYONL21" => "Moneyou", "RABONL2U" => "Rabobank", "RBRBNL21" => "RegioBank", + "REVOLT21" => "Revolut", "SNSBNL2A" => "SNS Bank", "TRIONL2U" => "Triodos Bank", "FVLBNL22" => "Van Lanschot"
Add Revolut to the list of iDEAL issuers.
diff --git a/lib/cb/Utils/string.rb b/lib/cb/Utils/string.rb index abc1234..def5678 100644 --- a/lib/cb/Utils/string.rb +++ b/lib/cb/Utils/string.rb @@ -7,4 +7,4 @@ self.sub!(/^[a-z\d]*/) { $&.capitalize } self.gsub(/(?:_|(\/))([a-z\d]*)/) { "#{$2.capitalize}" }.gsub('/', '::') end -end+end
Add newline to file (shouldn't make a difference)
diff --git a/src/dot.rb b/src/dot.rb index abc1234..def5678 100644 --- a/src/dot.rb +++ b/src/dot.rb @@ -16,6 +16,7 @@ DevEnv.yarn_install CFG_PATH, v Linker.link_all config['links'], CFG_PATH, v unless options[:commit_message].nil? + puts "[INFO] Saving the new changes to the repository" if v system 'git', 'commit', '-a', '-m', options[:commit_message] puts "[DONE] Commited changes with message: #{options[:commit_message]}" if v system 'git', 'push', options[:upstream]
Add intro message bbefore sending to git
diff --git a/apps/rails_turbo_assets.rb b/apps/rails_turbo_assets.rb index abc1234..def5678 100644 --- a/apps/rails_turbo_assets.rb +++ b/apps/rails_turbo_assets.rb @@ -7,7 +7,7 @@ set(:skip_assets_precompile) do cached_copy = File.join(shared_path, fetch(:repository_cache, "cached-copy")) - run("cd #{cached_copy} && #{source.log(current_revision, real_revision)} --oneline vendor/assets/ app/assets/ | wc -l").to_i == 0 + capture("cd #{cached_copy} && #{source.log(current_revision, real_revision)} --oneline vendor/assets/ app/assets/ | wc -l").to_i == 0 end namespace :deploy do
Fix test command, must use capture instead of run
diff --git a/lib/glipper/helpers.rb b/lib/glipper/helpers.rb index abc1234..def5678 100644 --- a/lib/glipper/helpers.rb +++ b/lib/glipper/helpers.rb @@ -5,12 +5,16 @@ end alias_method :h, :helpers - def method_missing(name, *args, &block) + def method_missing(name, *args, **options, &block) if h.respond_to?(name) - h.public_send(name, *args, &block) + h.public_send(name, *args, **options, &block) else super end end + + def respond_to_missing?(name, include_private = false) + h.respond_to?(name) || super + end end end
Update arguments forwarding for ruby 3.0
diff --git a/lib/hanami/fumikiri.rb b/lib/hanami/fumikiri.rb index abc1234..def5678 100644 --- a/lib/hanami/fumikiri.rb +++ b/lib/hanami/fumikiri.rb @@ -3,7 +3,7 @@ module Skip private def authenticate! - # no-op implementation + # no-op end end @@ -26,12 +26,18 @@ end end + private def current_user - validate_jwt - @current_user = UserRepository.find(@decoded_token['sub']) + if !user_token.empty? + validate_jwt + @current_user = UserRepository.find(@decoded_token['sub']) + elsif user_id + @current_user = UserRepository.find(user_id) + else + raise MissingTokenError # or redirect_to '/some_url' + end end - private def authenticate! redirect_to '/login' unless authenticated? end @@ -40,15 +46,21 @@ ! current_user.nil? end + def user_id + sessions['user_id'] + end + + def user_token + request.env['Authentication'] + end + def validate_jwt begin - auth = request.env['Authorisation'] - raise MissingTokenError if auth.nil? - - token = auth.split(' ').last + token = user_token.sub(/Bearer\s/, '') @decoded_token = JWT.decode(token, ENV['JWT_SECRET']) # make better errors - raise InvalidTokenError if @decoded_token['sub'].empty? + # we should let this error bubble-up + # raise InvalidTokenError if @decoded_token['sub'].empty? rescue JWT::DecodeError # make better errors
Refactor and add user_token and user_id for jwt and sessions support
diff --git a/lib/psd/nodes/group.rb b/lib/psd/nodes/group.rb index abc1234..def5678 100644 --- a/lib/psd/nodes/group.rb +++ b/lib/psd/nodes/group.rb @@ -21,6 +21,7 @@ def to_hash super.merge({ type: :group, + open: section_divider ? section_divider.layer_type == 'open folder' : false, children: children.map(&:to_hash) }) end
Add indication of whether folder is open or closed to tree export
diff --git a/lib/readthis/entity.rb b/lib/readthis/entity.rb index abc1234..def5678 100644 --- a/lib/readthis/entity.rb +++ b/lib/readthis/entity.rb @@ -42,7 +42,7 @@ end def inflate(value, decompress) - if decompress && value[0, 2].unpack('CC'.freeze) == MAGIC_BYTES + if decompress && value[0, 2].bytes == MAGIC_BYTES Zlib::Inflate.inflate(value) else value
Use bytes insead of unpack
diff --git a/bosh_openstack_cpi.gemspec b/bosh_openstack_cpi.gemspec index abc1234..def5678 100644 --- a/bosh_openstack_cpi.gemspec +++ b/bosh_openstack_cpi.gemspec @@ -20,7 +20,7 @@ s.bindir = "bin" s.executables = %w(bosh_openstack_console) - s.add_dependency "fog", "~>1.10.0" + s.add_dependency "fog", "~>1.10.1" s.add_dependency "bosh_common", "~>#{version}" s.add_dependency "bosh_cpi", "~>#{version}" s.add_dependency "httpclient", "=2.2.4"
Upgrade fog gem to 1.10.1 Required to support OpenStack Quantum (manual networks). Fixes #46997903
diff --git a/spec/helpers/application_helper/buttons/ems_storage_timeline_spec.rb b/spec/helpers/application_helper/buttons/ems_storage_timeline_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/application_helper/buttons/ems_storage_timeline_spec.rb +++ b/spec/helpers/application_helper/buttons/ems_storage_timeline_spec.rb @@ -0,0 +1,8 @@+describe ApplicationHelper::Button::EmsStorageTimeline do + let(:view_context) { setup_view_context_with_sandbox({}) } + let(:record) { FactoryGirl.create(:ext_management_system) } + let(:props) { {:options => {:feature => :timeline}} } + let(:button) { described_class.new(view_context, {}, {'record' => record}, props) } + + it_behaves_like 'a timeline button', :entity => 'Storage Manager' +end
Create spec examples for EmsStorageTimeline button class
diff --git a/AAChartKit/AAChartKit/AAChartKit.podspec b/AAChartKit/AAChartKit/AAChartKit.podspec index abc1234..def5678 100644 --- a/AAChartKit/AAChartKit/AAChartKit.podspec +++ b/AAChartKit/AAChartKit/AAChartKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'AAChartKit' - s.version = '2.0.0' + s.version = '2.0.1' s.summary = 'An elegant and friendly chart library for iOS developer' s.homepage = 'https://github.com/AAChartModel/AAChartKit' s.license = 'MIT'
Change the released version tag
diff --git a/react-native-nordic-dfu.podspec b/react-native-nordic-dfu.podspec index abc1234..def5678 100644 --- a/react-native-nordic-dfu.podspec +++ b/react-native-nordic-dfu.podspec @@ -16,5 +16,5 @@ s.source_files = "ios/**/*.{h,m}" s.dependency 'React' - s.dependency 'iOSDFULibrary', '~> 4.7.1' + s.dependency 'iOSDFULibrary', '~> 4.11.1' end
Update iOSDFULibrary to fix compilation errors on XCode 13
diff --git a/definitions/apache_site.rb b/definitions/apache_site.rb index abc1234..def5678 100644 --- a/definitions/apache_site.rb +++ b/definitions/apache_site.rb @@ -24,7 +24,10 @@ execute "a2ensite #{params[:name]}" do command "/usr/sbin/a2ensite #{params[:name]}" notifies :restart, resources(:service => "apache2") - not_if do File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") end + not_if do + File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") or + File.symlink?("#{node[:apache][:dir]}/sites-enabled/000-#{params[:name]}") + end end else execute "a2dissite #{params[:name]}" do
Fix needless extra restarts by picking up 000 priority symlinks.
diff --git a/app/controllers/sprangular/products_controller.rb b/app/controllers/sprangular/products_controller.rb index abc1234..def5678 100644 --- a/app/controllers/sprangular/products_controller.rb +++ b/app/controllers/sprangular/products_controller.rb @@ -19,7 +19,7 @@ end def show - @product = product_scope.where(slug: params[:id]).first! + @product = product_scope.find_by!(slug: params[:id]) render json: @product, root: false, serializer: Sprangular::ProductSerializer
Use `Product.find_by!` instead of `.where`
diff --git a/app/helpers/textual_mixins/textual_filesystems.rb b/app/helpers/textual_mixins/textual_filesystems.rb index abc1234..def5678 100644 --- a/app/helpers/textual_mixins/textual_filesystems.rb +++ b/app/helpers/textual_mixins/textual_filesystems.rb @@ -2,7 +2,7 @@ def textual_filesystems num = @record.number_of(:filesystems) h = {:label => _("Files"), :icon => "fa fa-file-o", :value => num} - if num > 0 + if num.positive? h[:title] = n_("Show the File installed on this VM", "Show the Files installed on this VM", num) h[:explorer] = true h[:link] = url_for_only_path(:controller => controller.controller_name, :action => 'filesystems', :id => @record)
Fix rubocop warning in TextualMixins::TextualFilesystems
diff --git a/example/zoo-app/lib/zoo_app/animal_service_client.rb b/example/zoo-app/lib/zoo_app/animal_service_client.rb index abc1234..def5678 100644 --- a/example/zoo-app/lib/zoo_app/animal_service_client.rb +++ b/example/zoo-app/lib/zoo_app/animal_service_client.rb @@ -40,4 +40,4 @@ JSON.parse(response.body, {:symbolize_names => true}) end end -end+end
Add new line to trigger TravisCI.
diff --git a/test/smartsheet/endpoints/url_validator.rb b/test/smartsheet/endpoints/url_validator.rb index abc1234..def5678 100644 --- a/test/smartsheet/endpoints/url_validator.rb +++ b/test/smartsheet/endpoints/url_validator.rb @@ -22,18 +22,12 @@ def validate_args_present(segment_vars, arg_keys) missing_args = segment_vars - arg_keys - return if missing_args.empty? - - missing_args_string = missing_args.join(', ') - raise "Missing request parameters [#{missing_args_string}]" + raise "Missing request parameters [#{missing_args}]" unless missing_args.empty? end def validate_args_match(segment_vars, arg_keys) extra_args = arg_keys - segment_vars - return if extra_args.empty? - - extra_args_string = extra_args.join(', ') - raise "Unexpected request parameters [#{extra_args_string}]" + raise "Unexpected request parameters [#{extra_args}]" unless extra_args.empty? end end end
Change url validation to make coveralls happy
diff --git a/fluent-plugin-midi.gemspec b/fluent-plugin-midi.gemspec index abc1234..def5678 100644 --- a/fluent-plugin-midi.gemspec +++ b/fluent-plugin-midi.gemspec @@ -21,4 +21,5 @@ spec.add_runtime_dependency "rtmidi" spec.add_development_dependency "bundler", "~> 1.5" spec.add_development_dependency "rake" + spec.add_development_dependency "pry" end
Add pry as development dependency
diff --git a/chef-utils/lib/chef-utils/dsl/platform_version.rb b/chef-utils/lib/chef-utils/dsl/platform_version.rb index abc1234..def5678 100644 --- a/chef-utils/lib/chef-utils/dsl/platform_version.rb +++ b/chef-utils/lib/chef-utils/dsl/platform_version.rb @@ -25,7 +25,8 @@ # Return the platform_version for the node. Acts like a String # but also provides a mechanism for checking version constraints. # - # @param [Chef::Node] node + # @param [Chef::Node] node the node to check + # @since 15.8 # # @return [ChefUtils::VersionString] #
Add @since to the latest helper Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/src/app.rb b/src/app.rb index abc1234..def5678 100644 --- a/src/app.rb +++ b/src/app.rb @@ -10,10 +10,12 @@ set :port, '8080' config = ENV.select { |k,v| k.start_with?("RANCHER_") } - +token = ENV['TOKEN'] redis_host = ENV['REDIS_HOST'] || 'localhost' redis_port = ENV['REDIS_PORT'] || '6379' Resque.redis = "#{redis_host}:#{redis_port}" + +raise "TOKEN required" if !token puts '---' for key,val in config @@ -21,7 +23,11 @@ end puts '---' -post '/hook' do +get "/check/#{token}" do + 'OK' +end + +post "/hook/#{token}" do content_type :json request.body.rewind
Add TOKEN env var for security
diff --git a/lib/database_cleaner/cleaners.rb b/lib/database_cleaner/cleaners.rb index abc1234..def5678 100644 --- a/lib/database_cleaner/cleaners.rb +++ b/lib/database_cleaner/cleaners.rb @@ -7,9 +7,9 @@ end # FIXME this method conflates creation with lookup... both a command and a query. yuck. - def [](orm, opts = {}) + def [](orm, **opts) raise ArgumentError if orm.nil? - fetch([orm, opts]) { add_cleaner(orm, opts) } + fetch([orm, opts]) { add_cleaner(orm, **opts) } end def strategy=(strategy) @@ -37,8 +37,8 @@ private - def add_cleaner(orm, opts = {}) - self[[orm, opts]] = Cleaner.new(orm, opts) + def add_cleaner(orm, **opts) + self[[orm, opts]] = Cleaner.new(orm, **opts) end def remove_duplicates
Fix Ruby 2.7 deprecation warnings
diff --git a/discovery_mission.rb b/discovery_mission.rb index abc1234..def5678 100644 --- a/discovery_mission.rb +++ b/discovery_mission.rb @@ -3,11 +3,17 @@ class DiscoveryMission - def initialize(url) - @domain = URI.parse(url) + def self.for(domain, verbose=false, &block) + journey = new(domain, verbose) + journey.launch(&block) + end + + def initialize(domain, verbose=false) + @domain = URI.parse(domain) @domain.path = "/" if @domain.path == "" + @verbose = verbose reset - puts "Discovery Mission Planned for #{@domain}" + puts "Discovery Mission Planned for #{@domain}" if @verbose end def launch @@ -18,7 +24,7 @@ explore(response.body) @visited[url] = true end - all_paths = @visited.keys.map {|k| k.to_s} + all_paths = @visited.keys.map {|k| @domain + k.to_s} reset all_paths end @@ -39,7 +45,7 @@ begin url = @domain.clone url.path = url.path + path unless path == "/" - puts "Landing on #{url}" + puts "Landing on #{url}" if @verbose response = Net::HTTP.get_response(url) rescue Exception puts "Error: #{$!}"
Implement a global launcher DiscoveryMission::for
diff --git a/app/models/sidekiq/superworker/subjob.rb b/app/models/sidekiq/superworker/subjob.rb index abc1234..def5678 100644 --- a/app/models/sidekiq/superworker/subjob.rb +++ b/app/models/sidekiq/superworker/subjob.rb @@ -3,7 +3,7 @@ class Subjob < ActiveRecord::Base attr_accessible :jid, :subjob_id, :superjob_id, :parent_id, :children_ids, :next_id, :subworker_class, :superworker_class, :arg_keys, :arg_values, :status, :descendants_are_complete, - :meta if ActiveRecord::VERSION::MAJOR < 4 + :meta if ActiveRecord::VERSION::MAJOR < 4 || ActiveRecord.constants.include?(:MassAssignmentSecurity) serialize :arg_keys serialize :arg_values
Check for MassAssignmentSecurity when determining whether to call attr_accessible AR 4 may require attr_accessible if the protected_attributes gem is installed
diff --git a/config/initializers/devise_token_auth.rb b/config/initializers/devise_token_auth.rb index abc1234..def5678 100644 --- a/config/initializers/devise_token_auth.rb +++ b/config/initializers/devise_token_auth.rb @@ -3,7 +3,7 @@ # client is responsible for keeping track of the changing tokens. Change # this to false to prevent the Authorization header from changing after # each request. - #config.change_headers_on_each_request = true + config.change_headers_on_each_request = false # By default, users will need to re-authenticate after 2 weeks. This setting # determines how long tokens will remain valid after they are issued.
Disable changing the token every time
diff --git a/activerecord-safer_migrations.gemspec b/activerecord-safer_migrations.gemspec index abc1234..def5678 100644 --- a/activerecord-safer_migrations.gemspec +++ b/activerecord-safer_migrations.gemspec @@ -20,5 +20,5 @@ gem.add_development_dependency "pg", "~> 0.21.0" gem.add_development_dependency "rspec", "~> 3.6.0" - gem.add_development_dependency "rubocop", "~> 0.49.1" + gem.add_development_dependency "rubocop", "~> 0.50.0" end
Update rubocop requirement to ~> 0.50.0 Updates the requirements on [rubocop](https://github.com/bbatsov/rubocop) to permit the latest version. - [Release notes](https://github.com/bbatsov/rubocop/releases) - [Changelog](https://github.com/bbatsov/rubocop/blob/master/CHANGELOG.md)
diff --git a/app/services/milestone_status_watcher.rb b/app/services/milestone_status_watcher.rb index abc1234..def5678 100644 --- a/app/services/milestone_status_watcher.rb +++ b/app/services/milestone_status_watcher.rb @@ -1,7 +1,12 @@ class MilestoneStatusWatcher def self.update_status - Milestone.must_started_today.update_all(status: Milestone::STATUSES.index(:open)) + Rails.logger.tagged('SCHEDULER TEST') do |logger| + logger.error 'Service is working.' + logger.error "#{Milestone.must_started_today.count} milestones are waiting update." + Milestone.must_started_today.update_all(status: Milestone::STATUSES.index(:open)) + logger.error "#{Milestone.must_started_today.count} milestones are not updated." + end end end
Add log to define problem with updating milestone status.
diff --git a/lib/semantics/content_project.rb b/lib/semantics/content_project.rb index abc1234..def5678 100644 --- a/lib/semantics/content_project.rb +++ b/lib/semantics/content_project.rb @@ -2,11 +2,17 @@ class ContentProject include HTTParty - attr_reader :id, :name + attr_reader :id, :name, :axcompany_name, :engine_configuration, :count_things, + :count_generated_texts, :thing_type def initialize(attributes) @id = attributes["id"] @name = attributes["name"] + @axcompany_name = attributes["axcompany_name"] + @engine_configuration = attributes["engine_configuration"] + @count_things = attributes["count_things"] + @count_generated_texts = attributes["count_generated_texts"] + @thing_type = attributes["thing_type"] end def self.find(cp_id)
Add more content project attributes
diff --git a/lib/tasks/one_sheet/generator.rb b/lib/tasks/one_sheet/generator.rb index abc1234..def5678 100644 --- a/lib/tasks/one_sheet/generator.rb +++ b/lib/tasks/one_sheet/generator.rb @@ -40,7 +40,7 @@ def run_specs Resume::Output.raw_warning("Running specs...") - system("rspec", "resume.rb") + system("bin/rspec", "resume.rb") end private_class_method :run_specs end
Change rake task to use binstub
diff --git a/lib/transpec/conversion_error.rb b/lib/transpec/conversion_error.rb index abc1234..def5678 100644 --- a/lib/transpec/conversion_error.rb +++ b/lib/transpec/conversion_error.rb @@ -8,16 +8,16 @@ end class ContextError < ConversionError - def initialize(original_syntax, target_syntax, source_range) - message = build_message(original_syntax, target_syntax) + def initialize(old_syntax, new_syntax, source_range) + message = build_message(old_syntax, new_syntax) super(message, source_range) end private - def build_message(original_syntax, target_syntax) - "Cannot convert #{original_syntax} into #{target_syntax} " \ - "since #{target_syntax} is not available in the context." + def build_message(old_syntax, new_syntax) + "Cannot convert #{old_syntax} into #{new_syntax} " \ + "since #{new_syntax} is not available in the context." end end end
Rename argument names in ConversionError
diff --git a/config/software/libffi.rb b/config/software/libffi.rb index abc1234..def5678 100644 --- a/config/software/libffi.rb +++ b/config/software/libffi.rb @@ -29,4 +29,5 @@ command "./configure --prefix=#{install_dir}/embedded" command "make", :env => env command "make install" + command "mv #{install_dir}/embedded/lib/libffi-#{version}/include/* #{install_dir}/include/" end
Move ffi includes to the to include dir Not sure why libffi wants to install its heaaders to the lib directory but we really prefer them to be in the standard include directory. Move them there.
diff --git a/test/haml/spec_test.rb b/test/haml/spec_test.rb index abc1234..def5678 100644 --- a/test/haml/spec_test.rb +++ b/test/haml/spec_test.rb @@ -9,12 +9,16 @@ class SpecTest < Test::Unit::TestCase spec_file = File.dirname(__FILE__) + '/spec/tests.json' if !File.exists?(spec_file) - warn <<MSG + error = <<MSG.rstrip Couldn't load haml-spec, skipping some tests. To use haml-spec, run `git submodule update --init` MSG elsif !defined?(JSON) - warn "Couldn't load json, skipping some tests." + error = "Couldn't load json, skipping some tests." + end + + if error + define_method(:test_fake_couldnt_load_spec) {warn("\n" + error)} else JSON.parse(File.read(spec_file)).each do |name, tests| tests.each do |subname, test|
[Haml] Improve the error when haml-spec can't be loaded.
diff --git a/app/models/product.rb b/app/models/product.rb index abc1234..def5678 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -36,7 +36,7 @@ def tag_contexts context = product_type.name.parameterize.underscore.downcase.to_sym - set_tag_list_on(context, taggable_tags) unless taggable_tags.nil? + self.set_tag_list_on(context, taggable_tags) unless taggable_tags.nil? end def product_type
Revert "Added pagination for listing of all tags." This reverts commit 25952b34490c54360ac24bb5553bd74b1f1d7a34.
diff --git a/doc/ex/opacity.rb b/doc/ex/opacity.rb index abc1234..def5678 100644 --- a/doc/ex/opacity.rb +++ b/doc/ex/opacity.rb @@ -33,6 +33,6 @@ gc.text( 90,15, '"100%"') gc.draw(canvas) - +canvas.matte = false canvas.write("opacity.gif") exit
Reset matte channel for better rendering
diff --git a/lib/crawlable_js/engine.rb b/lib/crawlable_js/engine.rb index abc1234..def5678 100644 --- a/lib/crawlable_js/engine.rb +++ b/lib/crawlable_js/engine.rb @@ -5,5 +5,6 @@ config.crawlable_js = ActiveSupport::OrderedOptions.new config.crawlable_js.phantomjs_path = File.join gem_root, 'bin/phantomjs' config.crawlable_js.phantomjs_script = File.join gem_root, 'bin/phantomjs_script.js' + config.crawlable_js.cache_expires_in = 5.minutes end end
Set default cache expires in to 5 minutes
diff --git a/test/unit/scss_test.rb b/test/unit/scss_test.rb index abc1234..def5678 100644 --- a/test/unit/scss_test.rb +++ b/test/unit/scss_test.rb @@ -4,9 +4,9 @@ should 'calculate the coordinating edgevalue for a color' do result = render_css("#test { color: edgevalue(#fec) }") - assert_equal "#test{color:black}", result + assert_equal "#test{color:#000}", result result = render_css("#test { color: edgevalue(#333) }") - assert_equal "#test{color:white}", result + assert_equal "#test{color:#fff}", result end should 'calculate the coordinating edgevalue for a color with an offset' do
Fix broken test by change in Sass color values.
diff --git a/spec/inspect_spec.rb b/spec/inspect_spec.rb index abc1234..def5678 100644 --- a/spec/inspect_spec.rb +++ b/spec/inspect_spec.rb @@ -3,7 +3,7 @@ describe "An unbound variable" do it "should be inspectable for debugging purposes" do local do |unbound| - unbound.inspect.should =~ /#<Dataflow::Variable:[0-9]+ unbound>/ + unbound.inspect.should =~ /#<Dataflow::Variable:-?\d+ unbound>/ end end end
Handle negative __id__'s in specs for platforms that use it
diff --git a/split_tester.gemspec b/split_tester.gemspec index abc1234..def5678 100644 --- a/split_tester.gemspec +++ b/split_tester.gemspec @@ -1,6 +1,6 @@ # -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) -require "acts_as_keyed/version" +require "split_tester/version" Gem::Specification.new do |s| s.name = "split_tester"
Load the version file to get the build version
diff --git a/em-midori.gemspec b/em-midori.gemspec index abc1234..def5678 100644 --- a/em-midori.gemspec +++ b/em-midori.gemspec @@ -11,7 +11,7 @@ s.email = 'business@heckpsi.com' s.require_paths = ['lib'] s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|.resources)/}) } \ - - %w(README.md CONTRIBUTE_CODE_OF_CONDUCT.md Gemfile Rakefile em-midori.gemspec .gitignore .rspec .codeclimate.yml .rubocop.yml .travis.yml logo.png Rakefile Gemfile Gemfile.lock) + - %w(README.md CONTRIBUTOR_COVENANT_CODE_OF_CONDUCT.md Gemfile Rakefile em-midori.gemspec .gitignore .rspec .codeclimate.yml .rubocop.yml .travis.yml logo.png Rakefile Gemfile) s.homepage = 'https://github.com/heckpsi-lab/em-midori' s.license = 'MIT' s.add_runtime_dependency 'eventmachine', '~> 1.2'
Clean up file in gem
diff --git a/lib/uncomtrade/response.rb b/lib/uncomtrade/response.rb index abc1234..def5678 100644 --- a/lib/uncomtrade/response.rb +++ b/lib/uncomtrade/response.rb @@ -21,7 +21,7 @@ iterator.cherry_pick(selectors) end - def to_csv(file:, selectors:) + def to_csv(file:, selectors: {}) iterator.to_csv(file, selectors) end
Fix so that a user doesn't have specify selectors.
diff --git a/config/initializers/show_constants.rb b/config/initializers/show_constants.rb index abc1234..def5678 100644 --- a/config/initializers/show_constants.rb +++ b/config/initializers/show_constants.rb @@ -1,8 +1,8 @@ CURRENT_TOP_ROW_VALUES = [200, 400].freeze PLAY_TYPES = { + "regular" => "regular play", "teen" => "Teen Tournament", - "regular" => "regular play", "power" => "Power Players Week", "teachers" => "Teachers Tournament", "college" => "College Championship",
Reorder play types list for return to regular play