diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/addresses.gemspec b/addresses.gemspec index abc1234..def5678 100644 --- a/addresses.gemspec +++ b/addresses.gemspec @@ -12,6 +12,7 @@ s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] s.test_files = Dir["spec/**/*"] s.licenses = ['MIT'] + s.required_ruby_version = '~> 2.2' s.add_dependency "rails", '~> 5.0'
Add required ruby version to gem
diff --git a/no-style-please.gemspec b/no-style-please.gemspec index abc1234..def5678 100644 --- a/no-style-please.gemspec +++ b/no-style-please.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "no-style-please" - spec.version = "0.2.0" + spec.version = "0.3.0" spec.authors = ["Riccardo Graziosi"] spec.email = ["riccardo.graziosi97@gmail.com"]
Update gem version to 0.3.0
diff --git a/fauxhai.gemspec b/fauxhai.gemspec index abc1234..def5678 100644 --- a/fauxhai.gemspec +++ b/fauxhai.gemspec @@ -12,7 +12,7 @@ spec.homepage = 'https://github.com/customink/fauxhai' spec.license = 'MIT' - spec.required_ruby_version = '>= 1.9' + spec.required_ruby_version = '>= 2.0' spec.files = `git ls-files`.split($\) spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) }
Remove support for Ruby 1.9 It's been EoL for over a year now
diff --git a/optbind.gemspec b/optbind.gemspec index abc1234..def5678 100644 --- a/optbind.gemspec +++ b/optbind.gemspec @@ -6,8 +6,8 @@ s.authors = ['Pavol Zbell'] s.email = ['pavol.zbell@gmail.com'] - s.summary = 'TODO' - s.description = 'TODO' + s.summary = 'Binds command-line options to variables.' + s.description = 'Binds command-line options to variables. Supports binding of options and arguments, default values, and partial argument analysis.' s.homepage = 'https://github.com/pavolzbell/optbind' s.license = 'MIT'
Add gem summary and description
diff --git a/lib/jquery-rails-cdn.rb b/lib/jquery-rails-cdn.rb index abc1234..def5678 100644 --- a/lib/jquery-rails-cdn.rb +++ b/lib/jquery-rails-cdn.rb @@ -9,7 +9,7 @@ :google => "//ajax.googleapis.com/ajax/libs/jquery/#{JQUERY_VERSION}/jquery.min.js", :microsoft => "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-#{JQUERY_VERSION}.min.js", :jquery => "http://code.jquery.com/jquery-#{JQUERY_VERSION}.min.js", - :yandex => "http://yandex.st/jquery/#{JQUERY_VERSION}/jquery.js" + :yandex => "http://yandex.st/jquery/#{JQUERY_VERSION}/jquery.min.js" } def jquery_url(name, options = {})
Use minified version of jQuery for Yandex CDN
diff --git a/DTStorage.podspec b/DTStorage.podspec index abc1234..def5678 100644 --- a/DTStorage.podspec +++ b/DTStorage.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "DTStorage" - s.version = "0.0.3" - s.summary = "A simple storage layer over SQLite for iOS." + s.version = "0.1.0" + s.summary = "A library for data persistence on iOS that uses SQLite (with FMDB)." s.homepage = "https://github.com/diogot/DTStorage" s.license = { :type => "MIT", :file => "LICENSE" } s.author = { "Diogo Tridapalli" => "diogo@diogot.com" }
Update podspec to version 0.1.0
diff --git a/lib/motion-giphy/gif.rb b/lib/motion-giphy/gif.rb index abc1234..def5678 100644 --- a/lib/motion-giphy/gif.rb +++ b/lib/motion-giphy/gif.rb @@ -30,6 +30,10 @@ image.new(images["fixed_height"]) end + def fixed_width_still + image.new(images["fixed_width_still"]) + end + def fixed_height_still image.new(images["fixed_height_still"]) end
Add fixed width still image.
diff --git a/lib/rom/http/gateway.rb b/lib/rom/http/gateway.rb index abc1234..def5678 100644 --- a/lib/rom/http/gateway.rb +++ b/lib/rom/http/gateway.rb @@ -8,7 +8,7 @@ private :datasets, :config def initialize(config) - missing_keys = %i(uri request_handler response_handler) - config.keys + missing_keys = [:uri, :request_handler, :response_handler] - config.keys fail GatewayConfigurationError, missing_keys unless missing_keys.empty? @datasets = ThreadSafe::Cache.new
Remove %i for rubinius support
diff --git a/lib/tasks/database.rake b/lib/tasks/database.rake index abc1234..def5678 100644 --- a/lib/tasks/database.rake +++ b/lib/tasks/database.rake @@ -8,7 +8,8 @@ require 'active_road' require 'postgis_adapter' - ActiveRecord::Base.establish_connection ActiveRoad.database_configuration["default"] + env = (ENV['RAILS_ENV'] or "default") + ActiveRecord::Base.establish_connection ActiveRoad.database_configuration[env] ActiveRecord::Migration.verbose = (ENV["VERBOSE"] == "true") ActiveRecord::Migrator.migrate(%w{db/migrate}, ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
Support RAILS_ENV to migrate test db
diff --git a/application.rb b/application.rb index abc1234..def5678 100644 --- a/application.rb +++ b/application.rb @@ -4,7 +4,7 @@ require 'sinatra' require 'redis' -redis = Redis.new(:url => ENV["REDISTOGO_URL"]) +redis = Redis.new(:url => ENV["REDIS_URL"]) configure do set :views, File.join(File.dirname(__FILE__), "views")
Change environment variable for redis
diff --git a/lib/bourbon.rb b/lib/bourbon.rb index abc1234..def5678 100644 --- a/lib/bourbon.rb +++ b/lib/bourbon.rb @@ -1,7 +1,4 @@+require "sass" require "bourbon/generator" -bourbon_path = File.expand_path("../../core", __FILE__) -ENV["SASS_PATH"] = [ - ENV["SASS_PATH"], - bourbon_path, -].compact.join(File::PATH_SEPARATOR) +Sass.load_paths << File.expand_path("../../core", __FILE__)
Use Sass.load_paths instead of SASS_PATH env The SASS_PATH environment variable is not intended to be set by another library but rather by consumers of Sass. Since the environment variable is only read in once at the first time `load_paths` is called. This was causing an error where, if a user had another gem such as `bootstrap-sass` and it was being loaded before `bourbon` was, the modifications to `SASS_PATH` we were making were never read in, so the bourbon files would never be found. See https://github.com/sass/sass/blob/1b628f03b9361fa6047097c9fd0d01b21247b8f3/lib/sass.rb#L20-L43
diff --git a/stripe_event.gemspec b/stripe_event.gemspec index abc1234..def5678 100644 --- a/stripe_event.gemspec +++ b/stripe_event.gemspec @@ -18,7 +18,7 @@ s.test_files = `git ls-files -- Appraisals {spec,gemfiles}/*`.split("\n") s.add_dependency "activesupport", ">= 3.1" - s.add_dependency "stripe", [">= 2.8", "< 4.0"] + s.add_dependency "stripe", [">= 2.8", "< 5.0"] s.add_development_dependency "rails", [">= 3.1"] s.add_development_dependency "rake", "< 11.0"
Add support for Stripe v4.x
diff --git a/Library/Formula/riak.rb b/Library/Formula/riak.rb index abc1234..def5678 100644 --- a/Library/Formula/riak.rb +++ b/Library/Formula/riak.rb @@ -29,5 +29,8 @@ (prefix + 'data/ring').mkpath (prefix + 'data/dets').mkpath + + # Install man pages + man1.install Dir["doc/man/man1/*"] end -end+end
Add man pages for Riak. Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/gitable.gemspec b/gitable.gemspec index abc1234..def5678 100644 --- a/gitable.gemspec +++ b/gitable.gemspec @@ -10,7 +10,7 @@ s.license = 'MIT' s.add_dependency "addressable", ">= 2.2.7" - s.add_development_dependency "rspec", "~>2.11" + s.add_development_dependency "rspec", "~> 3.0" s.add_development_dependency "rake" s.add_development_dependency "simplecov"
Upgrade RSpec to ~> 3.0 to solve rake last_comment issue
diff --git a/lib/hdo/stats/rebels.rb b/lib/hdo/stats/rebels.rb index abc1234..def5678 100644 --- a/lib/hdo/stats/rebels.rb +++ b/lib/hdo/stats/rebels.rb @@ -0,0 +1,45 @@+module Hdo + module Stats + class Rebels + include Enumerable + + def initialize(votes) + @votes = votes + end + + def each(&each) + @votes.each do |vote| + rebels = rebels_for(vote) + + yield [vote, rebels] if rebels.any? + end + end + + private + + def rebels_for(vote) + rebels = [] + by_party = vote. + vote_results. + includes(:representative => {:party_memberships => :party}). + reject(&:absent?). + group_by { |vr| vr.representative.party_at(vote.time) } + + by_party.each do |party, vote_results| + counts = Hash.new(0) + vote_results.each { |vr| counts[vr.state] += 1 } + + if counts.values.sum > 3 && counts[:for] != counts[:against] + majority_state = counts[:for] > counts[:against] ? :for : :against + + vote_results.each do |vr| + rebels << vr if !vr.absent? && vr.state != majority_state + end + end + end + + rebels + end + end + end +end
Add code for faster rebel vote caculation.
diff --git a/lib/models/team/team.rb b/lib/models/team/team.rb index abc1234..def5678 100644 --- a/lib/models/team/team.rb +++ b/lib/models/team/team.rb @@ -17,7 +17,7 @@ def characters(characters) characters.each_with_index do |character, index| - character.realm_slug = Realm.to_slug(REALMS[character.realm_id || guild.realm_id]) + character.realm_slug = REALMS[character.realm_id || guild.realm_id].blizzard_name character.details = character_details(characters)[character.key].to_h character.verify_details end
Use stored realm name for API connections.
diff --git a/lib/vhdl_doctest/dut.rb b/lib/vhdl_doctest/dut.rb index abc1234..def5678 100644 --- a/lib/vhdl_doctest/dut.rb +++ b/lib/vhdl_doctest/dut.rb @@ -31,7 +31,7 @@ def extract_ports return @ports if @ports @ports = [] - definitions = @vhdl.match(/entity.*is\s+port\s*\((.*?)\);\s*end/m)[1] + definitions = @vhdl.match(/entity\s*(?<entity_name>[a-zA-Z_0-9]*)\s*is\s+port\s*\((?<ports>.*?)\);\s*end\s+\k<entity_name>\s*;/m)[:ports] definitions.split("\n").each do |l| names, attributes = l.strip.gsub(/;.*$/, '').split(":") next unless attributes
Update regexp to handle entity contains other components
diff --git a/examples/callbacks.rb b/examples/callbacks.rb index abc1234..def5678 100644 --- a/examples/callbacks.rb +++ b/examples/callbacks.rb @@ -9,12 +9,13 @@ require 'rubygems' require 'pdf/reader' -receiver = PDF::Reader::RegisterReceiver.new filename = File.expand_path(File.dirname(__FILE__)) + "/../spec/data/cairo-basic.pdf" PDF::Reader.open(filename) do |reader| reader.pages.each do |page| + receiver = PDF::Reader::RegisterReceiver.new page.walk(receiver) + receiver.callbacks.each do |cb| puts cb end
Fix bug that accumulate pages data
diff --git a/broach.gemspec b/broach.gemspec index abc1234..def5678 100644 --- a/broach.gemspec +++ b/broach.gemspec @@ -13,6 +13,7 @@ EOF spec.add_dependency('nap', '>= 0.3') + spec.add_dependency('json', '~> 1.4.6') spec.files = [ 'LICENSE',
Add dependency on JSON gem to gemspec.
diff --git a/app/models/dojo.rb b/app/models/dojo.rb index abc1234..def5678 100644 --- a/app/models/dojo.rb +++ b/app/models/dojo.rb @@ -1,4 +1,3 @@-# -*- coding: utf-8 -*- class Dojo < ApplicationRecord NUM_OF_COUNTRIES = "70" NUM_OF_WHOLE_DOJOS = "1,200" @@ -7,4 +6,14 @@ serialize :tags default_scope -> { order(order: :asc) } + before_save { self.email = self.email.downcase } + + validates :name, presence: true, length: { maximum: 50 } + validates :email, presence: false + validates :order, presence: false + validates :description, presence: true, length: { maximum: 50 } + validates :logo, presence: false + validates :tags, presence: true + validates :url, presence: true + end
Add validations to Dojo model
diff --git a/app/models/item.rb b/app/models/item.rb index abc1234..def5678 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -1,3 +1,3 @@ class Item < ApplicationRecord - validates_presence_of :name, :description, :quantity, :price + validates :name, presence: { message: "Name field can't be left blank"}, length: { in: 3..64, message: "Name must be between 3 and 64 characters in length" } end
Update Item name validation with multiple keys
diff --git a/app/models/plot.rb b/app/models/plot.rb index abc1234..def5678 100644 --- a/app/models/plot.rb +++ b/app/models/plot.rb @@ -1,9 +1,9 @@ class Plot < ApplicationRecord validates :plot_id, presence: true - validates :latitude, presence: true, numericality: { greater_than: 0 } - validates :longitude, presence: true, numericality: { greater_than: 0 } - validates :elevation, numericality: { greater_than: 0, allow_nil: true } - validates :area, numericality: { greater_than: 0, allow_nil: true } + validates_numericality_of :latitude, greater_than: 0, allow_nil: true + validates_numericality_of :longitude, greater_than: 0, allow_nil: true + validates_numericality_of :elevation, greater_than: 0, allow_nil: true + validates_numericality_of :area, greater_than: 0, allow_nil: true validates :location_description, presence: true validates :aspect, presence: true validates :origin, presence: true
Undo validation changes, it broke too many tests and should be a different issue at this point
diff --git a/app/models/post.rb b/app/models/post.rb index abc1234..def5678 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -1,3 +1,8 @@ class Post < ActiveRecord::Base belongs_to :category + + def self.search(search) + where("name LIKE ?", "%#{search}%") + where("content LIKE ?", "%#{search}%") + end end
Add search method to Post model
diff --git a/app/models/favourite.rb b/app/models/favourite.rb index abc1234..def5678 100644 --- a/app/models/favourite.rb +++ b/app/models/favourite.rb @@ -1,6 +1,9 @@ class Favourite < ApplicationRecord + validates_uniqueness_of :login, { scope: :employer_id } + after_create :cache_favorited_login before_destroy :delete_cached_favorited_login + belongs_to :employer belongs_to :developer
Add scoped uniqueness at model level
diff --git a/app/models/gift_form.rb b/app/models/gift_form.rb index abc1234..def5678 100644 --- a/app/models/gift_form.rb +++ b/app/models/gift_form.rb @@ -10,7 +10,7 @@ def pull_requests_for_select @pull_requests.sort{ |pr1, pr2| pr2.gifted_state <=> pr1.gifted_state }.map{ |pr| - ["#{pr.gifted_state.to_s.humanize}: #{pr.title}", pr.to_param] + ["#{pr.gifted_state.to_s.humanize}: #{pr.repo_name} - #{pr.title}", pr.to_param] } end
Add repo name to select gift
diff --git a/app/models/recipient.rb b/app/models/recipient.rb index abc1234..def5678 100644 --- a/app/models/recipient.rb +++ b/app/models/recipient.rb @@ -1,4 +1,8 @@ class Recipient < ApplicationRecord belongs_to :invoice, optional: true - validates_presence_of :name, :surname, :address, :phone + validates_presence_of :name, :surname, :address + + validates :phone, presence: true, + numericality: true, + length: { maximum: 15 } end
Add extra phone number validation
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,9 +2,11 @@ include ActiveModel::Validations validates :name, :city, :email, presence: true validates :name, length: { minimum: 2 } - validates :email, uniqueness: { case_sensitive: false }, on: :create - validates :email, uniqueness: { case_sensitive: false }, on: :update + validates :email, uniqueness: { case_sensitive: false }, on: [:create, :update] # customized validity check in app/validators/email_validator.rb validates :email, email: true + + # customized validity check in app/validators/website_validator.rb + validates :website, website: true end
Refactor uniqueness validation for emails
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -33,7 +33,7 @@ def gravatar_url(size = 48) gravatar_id = Digest::MD5.hexdigest(email || '') - "https://secure.gravatar.com/avatar/#{gravatar_id}.png?s=#{size}" + "https://secure.gravatar.com/avatar/#{gravatar_id}.png?s=#{size}&d=mm" end def role_symbols
Use mystery man as default gravatar image
diff --git a/minerva_fetcher.gemspec b/minerva_fetcher.gemspec index abc1234..def5678 100644 --- a/minerva_fetcher.gemspec +++ b/minerva_fetcher.gemspec @@ -17,4 +17,6 @@ s.require_paths = ['lib'] s.rubyforge_project = '[none]' s.add_dependency 'activesupport' + s.add_dependency 'faraday' + s.add_dependency 'faraday_middleware' end
Add faraday and faraday_middleware dependencies
diff --git a/tools/run_cmd_per_experiment.rb b/tools/run_cmd_per_experiment.rb index abc1234..def5678 100644 --- a/tools/run_cmd_per_experiment.rb +++ b/tools/run_cmd_per_experiment.rb @@ -0,0 +1,75 @@+#!/usr/bin/ruby +# Requires ruby2.0+ + +require 'optparse' + +class Experiment + attr_reader :dir, :name, :branch + def initialize(dir, name, branch: "master") + @dir = dir + @name = name + @branch = branch + end +end + +real_bugs = [ + Experiment.new("new_pyretic_loop_mcs/", "Pyretic loop"), + Experiment.new("pox_early_packetin", "POX premature PacketIn"), + Experiment.new("updated_debug_branch_loop_v3_mcs", "POX migration blackhole"), + Experiment.new("fuzz_pox_4mesh_blackhole_mcs", "POX migration blackhole", branch: "pox_blackhole"), + Experiment.new("nox_mesh_4_loop_repro_verbose", "NOX discovery loop"), + Experiment.new("zeta_final", "Floodlight loop", branch: "floodlight") + # ONOS.. +] + +synthetic_bugs = [ + Experiment.new("pox_null_pointer_mcs", "Null pointer on rarely used codepath"), + Experiment.new("trigger_priority_mismatch_small_mcs", "Overlapping flow entries"), + Experiment.new("snapshot_demo_synthetic_link_failure", "Delicate timer interleaving"), + Experiment.new("pox_broken_floyd_mcs", "Algorithm misimplementation"), + Experiment.new("trigger_multithreading_bug_mcs", "Multithreaded race condition"), + Experiment.new("trigger_memory_leak3_mcs", "Memory leak"), + Experiment.new("syn_mem_corruption_3switch_fuzzer_mcs", "Memory corruption") +] + +def walk_directories(experiments, command_path) + Dir.chdir("experiments/") do + current_branch = `git rev-parse --abbrev-ref HEAD 1>&2` + original_branch = current_branch + experiments.each do |experiment| + if experiment.branch != current_branch + system "git checkout #{experiment.branch} 1>&2" + end + Dir.chdir(experiment.dir) do + puts "==================== #{experiment.name} ======================" + puts `#{command_path}` + end + end + if original_branch != current_branch + system "git checkout #{original_branch} 1>&2" + end + end +end + +if __FILE__ == $0 + options = {} + OptionParser.new do |opts| + options[:command_path] = "/bin/ls" + opts.on("-c", "--command-path", "Path to command to run within each directory") do |c| + options[:command_path] = c + end + + options[:exclude_synthetic] = false + opts.on("-e", "--exclude-synthetic", "Whether to exclude synthetic bug experiments") do + options[:exclude_synthetic] = true + end + end.parse! + + if options[:exclude_synthetic] + experiments = real_bugs + else + experiments = real_bugs + synthetic_bugs + end + + walk_directories(experiments, options[:command_path]) +end
Add a tool for iterating through all experiments
diff --git a/app/models/configuration_item.rb b/app/models/configuration_item.rb index abc1234..def5678 100644 --- a/app/models/configuration_item.rb +++ b/app/models/configuration_item.rb @@ -22,6 +22,8 @@ def self.real_object_classes @@real_object_classes ||= ActiveRecord::Base.subclasses.select do |klass| klass != ConfigurationItem && klass.instance_methods.include?(:configuration_item) + end.sort_by do |klass| + klass.to_s end end end
Sort ConfigurationItem.real_object_classes by class names
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index abc1234..def5678 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -1,4 +1,8 @@-class EventsController < InheritedResources::Base +class EventsController < ApplicationController before_filter :authenticate_ngo!, only: :new + def new + @event = Event.new + #@event.shifts.build(volunteers_needed: 1, starts_at: Time.now, ends_at: 2.hours.from_now) + end end
Add a shift to our soon-to-be-created event
diff --git a/app/controllers/status_controller.rb b/app/controllers/status_controller.rb index abc1234..def5678 100644 --- a/app/controllers/status_controller.rb +++ b/app/controllers/status_controller.rb @@ -23,7 +23,7 @@ @smoke_detector.update(:is_standby => false, :force_failover => false) render :status => 200, :json => { 'failover': true } else - render :status => 200, :json => { 'failover': false } + head 200, content_type: "text/html" end end end
Save a few bytes on every ping
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index abc1234..def5678 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -9,6 +9,7 @@ Sidekiq.configure_server do |config| config.redis = { url: REDIS_URL, namespace: 'sidekiq' } config.poll_interval = 1 + config.error_handlers << -> (exception, context) { Airbrake.notify_or_ignore(exception, parameters: context) } end Sidekiq.configure_client do |config|
Set Airbrake as error handler for Sidekiq
diff --git a/config/software/loom-server.rb b/config/software/loom-server.rb index abc1234..def5678 100644 --- a/config/software/loom-server.rb +++ b/config/software/loom-server.rb @@ -5,17 +5,18 @@ relative_path 'server' build do - command "mkdir -p #{install_dir}/server/bin" - command "cp -fpPR bin/loom-server.sh #{install_dir}/server/bin" - command "cp -fpPR bin/loom-0.9.7-upgrade.rb #{install_dir}/server/bin" + mkdir "#{install_dir}/server/bin" + copy "bin/loom-server.sh #{install_dir}/server/bin" + copy "bin/loom-0.9.7-upgrade.rb #{install_dir}/server/bin" command "cp -fpPR docs/licenses config #{install_dir}/server" - command "mkdir -p #{install_dir}/server/conf #{install_dir}/server/etc/logrotate.d" - command "cp -f server/distribution/etc/logrotate.d/loom-server #{install_dir}/server/etc/logrotate.d" - command "cp -f server/distribution/etc/loom/conf.dist/* #{install_dir}/server/conf" + mkdir "#{install_dir}/server/etc/logrotate.d" + copy "server/distribution/etc/logrotate.d/loom-server #{install_dir}/server/etc/logrotate.d" + mkdir "#{install_dir}/server/conf" + copy "server/distribution/etc/loom/conf.dist/* #{install_dir}/server/conf" command "sed -e 's/APP_NAME/loom-server/g' -e 's/SVC_NAME/server/g' bin/loom-service > #{install_dir}/server/bin/init-loom-server" command "chmod +x #{install_dir}/server/bin/*" - command "mkdir -p #{install_dir}/server/lib" + mkdir "#{install_dir}/server/lib" command 'cd server && PATH=/usr/local/maven-3.1.1/bin:$PATH mvn clean package assembly:single -DskipTests=true' - command "cp -fpPR server/target/loom-*jar-with-dependencies.jar #{install_dir}/server/lib" + copy "server/target/loom-*jar-with-dependencies.jar #{install_dir}/server/lib" command "find #{install_dir} -type f -name .gitkeep | xargs rm -f" end
Use copy/mkdir builtin Builder methods
diff --git a/builder/test-integration/spec/hypriotos-image/base/release_spec.rb b/builder/test-integration/spec/hypriotos-image/base/release_spec.rb index abc1234..def5678 100644 --- a/builder/test-integration/spec/hypriotos-image/base/release_spec.rb +++ b/builder/test-integration/spec/hypriotos-image/base/release_spec.rb @@ -5,19 +5,19 @@ describe file('/etc/os-release') do it { should be_file } it { should be_owned_by 'root' } - its(:content) { should contain /ID=raspbian/ } - its(:content) { should match /HYPRIOT_OS="HypriotOS\/armhf"/ } - its(:content) { should match /HYPRIOT_OS_VERSION="v1.0.0"/ } - its(:content) { should match /HYPRIOT_DEVICE="Raspberry Pi"/ } + its(:content) { should contain /ID=debian/ } + its(:content) { should match /HYPRIOT_OS="HypriotOS\/arm64"/ } + its(:content) { should match /HYPRIOT_OS_VERSION="v1.1.1"/ } + its(:content) { should match /HYPRIOT_DEVICE="Raspberry Pi 3 64bit"/ } its(:content) { should match /HYPRIOT_IMAGE_VERSION=/ } end describe file('/boot/os-release') do it { should be_file } it { should be_owned_by 'root' } - its(:content) { should contain /ID=raspbian/ } - its(:content) { should match /HYPRIOT_OS="HypriotOS\/armhf"/ } - its(:content) { should match /HYPRIOT_OS_VERSION="v1.0.0"/ } - its(:content) { should match /HYPRIOT_DEVICE="Raspberry Pi"/ } + its(:content) { should contain /ID=debian/ } + its(:content) { should match /HYPRIOT_OS="HypriotOS\/arm64"/ } + its(:content) { should match /HYPRIOT_OS_VERSION="v1.1.1"/ } + its(:content) { should match /HYPRIOT_DEVICE="Raspberry Pi 3 64bit"/ } its(:content) { should match /HYPRIOT_IMAGE_VERSION=/ } end
Fix integrations tests for release infos Signed-off-by: Dieter Reuter <554783fc552b5b2a46dd3d7d7b9b2cce9a82c122@me.com>
diff --git a/spec/controllers/tags_controller_spec.rb b/spec/controllers/tags_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/tags_controller_spec.rb +++ b/spec/controllers/tags_controller_spec.rb @@ -11,5 +11,10 @@ get :index expect(response.status).to eq(200) end + + it "renders index template" do + get :index + expect(response).to render_template("index") + end end end
Add test for render index template
diff --git a/spec/omniauth/strategies/ravelry_spec.rb b/spec/omniauth/strategies/ravelry_spec.rb index abc1234..def5678 100644 --- a/spec/omniauth/strategies/ravelry_spec.rb +++ b/spec/omniauth/strategies/ravelry_spec.rb @@ -0,0 +1,22 @@+require 'spec_helper' + +describe OmniAuth::Strategies::Ravelry do + subject :ravelry do + OmniAuth::Strategies::Ravelry.new nil, @options || { } + end + + describe '#options' do + subject(:options) { ravelry.options } + describe '#name' do + subject { options.name } + it { should eq 'ravelry' } + end + describe '#client_options' do + subject(:client_options) { options.client_options } + describe '#site' do + subject { client_options.site } + it { should eq 'https://api.ravelry.com' } + end + end + end +end
Add specs for existing options
diff --git a/core/lib/spree/testing_support/factories/stock_location_factory.rb b/core/lib/spree/testing_support/factories/stock_location_factory.rb index abc1234..def5678 100644 --- a/core/lib/spree/testing_support/factories/stock_location_factory.rb +++ b/core/lib/spree/testing_support/factories/stock_location_factory.rb @@ -7,8 +7,8 @@ phone '(202) 456-1111' active true - state { |stock_location| stock_location.association(:state) } country { |stock_location| stock_location.association(:country) } + state { |stock_location| stock_location.association(:state, :country => stock_location.country) } factory :stock_location_with_items do after(:create) do |stock_location, evaluator|
Use stock_location's country for stock_location's state in stock_location factory This is so that it doesn't create a new country and associate the state with that.
diff --git a/services/QuillLMS/lib/tasks/cron.rake b/services/QuillLMS/lib/tasks/cron.rake index abc1234..def5678 100644 --- a/services/QuillLMS/lib/tasks/cron.rake +++ b/services/QuillLMS/lib/tasks/cron.rake @@ -1,7 +1,7 @@ namespace :cron do desc "Process Cron's 10 minute interval logic" task interval_10_minutes: :environment do - Cron.interval_10_minutes + Cron.interval_10_min end desc "Process Cron's 1 hour interval logic"
Fix bad reference in rake task
diff --git a/recipes/ruby.rb b/recipes/ruby.rb index abc1234..def5678 100644 --- a/recipes/ruby.rb +++ b/recipes/ruby.rb @@ -18,10 +18,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +include_recipe 'chef-sugar' + +execute 'apt-get update' do + ignore_failure true + action :nothing +end.run_action(:run) if 'debian' == node['platform_family'] + node.default['build-essential']['compile_time'] = true node.default['xml']['compiletime'] = true - -include_recipe 'chef-sugar' include_recipe 'build-essential::default' include_recipe 'xml::default'
Revert "Apt should not be the concern of the xml cookbook" This reverts commit 1ced9bb6d8b53ad13d66d1ea74573d1ed942d91d.
diff --git a/app/workers/ci/rescue_stale_live_trace_worker.rb b/app/workers/ci/rescue_stale_live_trace_worker.rb index abc1234..def5678 100644 --- a/app/workers/ci/rescue_stale_live_trace_worker.rb +++ b/app/workers/ci/rescue_stale_live_trace_worker.rb @@ -7,10 +7,13 @@ # Archive stale live traces which still resides in redis or database # This could happen when ArchiveTraceWorker sidekiq jobs were lost by receiving SIGKILL # More details in https://gitlab.com/gitlab-org/gitlab-ce/issues/36791 + failed_archive_counter = Gitlab::Metrics.counter(:job_stale_live_trace_failed_archive_total, "Counter of failed archiving with stale live trace") + Ci::Build.finished.with_live_trace.find_each(batch_size: 100) do |build| begin build.trace.archive! rescue => e + failed_archive_counter.increment Rails.logger.error "Failed to archive stale live trace. id: #{build.id} message: #{e.message}" end end
Add metric for failed archiving with stale live trace
diff --git a/lib/hacker_news_ranking/configuration.rb b/lib/hacker_news_ranking/configuration.rb index abc1234..def5678 100644 --- a/lib/hacker_news_ranking/configuration.rb +++ b/lib/hacker_news_ranking/configuration.rb @@ -3,6 +3,8 @@ @@configuration = { timestamp: :created_at, gravity: 1.8, + points_offset: -1, + timestamp_offset: 2, scope_method: :trending, current_rank_method: :rank } @@ -33,6 +35,14 @@ configuration[:gravity] = gravity end + def points_offset(points_offset) + configuration[:points_offset] = points_offset + end + + def timestamp_offset(timestamp_offset) + configuration[:timestamp_offset] = timestamp_offset + end + def scope_method(scope_method) configuration[:scope_method] = scope_method end
Add points and timestamp offset
diff --git a/lib/tasks/check_content_consistency.rake b/lib/tasks/check_content_consistency.rake index abc1234..def5678 100644 --- a/lib/tasks/check_content_consistency.rake +++ b/lib/tasks/check_content_consistency.rake @@ -1,7 +1,7 @@ require "data_hygiene/content_consistency_checker" def report_errors(errors, content_store) - Airbrake.notify( + Airbrake.notify_sync( "Documents inconsistent with the #{content_store} content store", parameters: { errors: errors,
Use Airbrake.notify_sync instead of Airbrake.notify When running in a rake task, Airbrake.notify doesn't properly finish triggering before the rake task ends and therefore the message never makes it to Airbrake.
diff --git a/spec/dummy/app/forms/update_user_form.rb b/spec/dummy/app/forms/update_user_form.rb index abc1234..def5678 100644 --- a/spec/dummy/app/forms/update_user_form.rb +++ b/spec/dummy/app/forms/update_user_form.rb @@ -6,6 +6,6 @@ end def commit! - users.try { users.update.by_id(id).set(attributes) } + users.try { users.update.by_id(id).call(attributes) } end end
Fix deprecation warning from rom-sql
diff --git a/spree-refinerycms-authentication.gemspec b/spree-refinerycms-authentication.gemspec index abc1234..def5678 100644 --- a/spree-refinerycms-authentication.gemspec +++ b/spree-refinerycms-authentication.gemspec @@ -13,6 +13,6 @@ gem.test_files = gem.files.grep(%r{^spec/}) gem.require_paths = ["lib"] - gem.add_runtime_dependency 'spree', '~> 2.2.2' - gem.add_runtime_dependency 'refinerycms', '~> 3.0.0.dev' + gem.add_runtime_dependency 'spree' + gem.add_runtime_dependency 'refinerycms' end
Change deps to use masters
diff --git a/spec/services/payment_gateway_spec.rb b/spec/services/payment_gateway_spec.rb index abc1234..def5678 100644 --- a/spec/services/payment_gateway_spec.rb +++ b/spec/services/payment_gateway_spec.rb @@ -7,7 +7,8 @@ around(:example) do |example| pdq_stub subject.run - WebMock.after_request { example.run } + sleep 1 # Allow thread to start - we were getting flickering failures + example.run subject.stop WebMock.reset_callbacks end
Add sleep to allow threrad to start up - we were getting flickering tests
diff --git a/recipes/tokutek_repo.rb b/recipes/tokutek_repo.rb index abc1234..def5678 100644 --- a/recipes/tokutek_repo.rb +++ b/recipes/tokutek_repo.rb @@ -0,0 +1,35 @@+# +# Cookbook Name:: tokumx +# Recipe:: tokutek_repo +# +# Copyright 2014, Tokutek +# Authors: +# John Esmet <john.esmest@gmail.com> +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +case node['platform_family'] +when "debian" + apt_repository "tokutek" do + uri "http://s3.amazonaws.com/tokumx-debs" + arch "amd64" + distribution "precise" + components ["main"] + keyserver "hkp://keyserver.ubuntu.com:80" + key "505A7412" + action :add + end +else + Chef::Log.warn("Only debian/ubuntu is supported for now") +end
Add a recipe for the Tokutek package repo
diff --git a/spec/requests/api/config_spec.rb b/spec/requests/api/config_spec.rb index abc1234..def5678 100644 --- a/spec/requests/api/config_spec.rb +++ b/spec/requests/api/config_spec.rb @@ -15,8 +15,9 @@ let(:api_feature_identifiers) do collection_settings.each_with_object(Set.new) do |(_, cfg), set| set.add(cfg[:identifier]) if cfg[:identifier] + keys = [:collection_actions, :resource_actions] subcollections = Array(cfg[:subcollections]).collect { |s| "#{s}_subcollection_actions" } - (subcollections + [:collection_actions, :resource_actions]).each do |action_type| + (subcollections + keys).each do |action_type| next unless cfg[action_type] cfg[action_type].each do |_, method_cfg| method_cfg.each do |action_cfg|
Refactor - extract temp `keys`
diff --git a/spec/unit/classes/server_spec.rb b/spec/unit/classes/server_spec.rb index abc1234..def5678 100644 --- a/spec/unit/classes/server_spec.rb +++ b/spec/unit/classes/server_spec.rb @@ -0,0 +1,65 @@+require 'spec_helper' + +describe 'puppetdb::server', :type => :class do + basefacts = + { + :osfamily => 'RedHat', + :operatingsystem => 'RedHat', + :operatingsystemrelease => '6.5', + :fqdn => 'test.domain.local' + } + + context 'on a supported platform' do + let(:facts) do + basefacts + end + + it { should contain_class('puppetdb::server') } + + describe 'when not specifying JAVA_ARGS' do + it { should_not contain_ini_subsetting('Xms') } + end + + describe 'when specifying JAVA_ARGS' do + let(:params) do + { + 'java_args' => { + '-Xms' => '2g', + } + } + end + + context 'on standard PuppetDB' do + it { should contain_ini_subsetting("'-Xms'"). + with( + 'ensure' => 'present', + 'path' => '/etc/sysconfig/puppetdb', + 'section' => '', + 'key_val_separator' => '=', + 'setting' => 'JAVA_ARGS', + 'subsetting' => '-Xms', + 'value' => '2g' + )} + end + + context 'on PE PuppetDB' do + let(:facts) do + basefacts.merge({ + :is_pe => 'true', + }) + end + it { should contain_ini_subsetting("'-Xms'"). + with( + 'ensure' => 'present', + 'path' => '/etc/sysconfig/pe-puppetdb', + 'section' => '', + 'key_val_separator' => '=', + 'setting' => 'JAVA_ARGS', + 'subsetting' => '-Xms', + 'value' => '2g' + )} + end + + end + end +end
Add spec test showing is_pe detection failure Add a new spec test providing some initial coverage of puppetdb::server demontrating the failure to correctly detect a PE environment.
diff --git a/lib/bandicoot/processor.rb b/lib/bandicoot/processor.rb index abc1234..def5678 100644 --- a/lib/bandicoot/processor.rb +++ b/lib/bandicoot/processor.rb @@ -3,10 +3,11 @@ module Bandicoot module Processor + attr_accessor : def crawl - # browser = Watir::Browser.new :firefox - # browser.goto - # Nokogiri::HTML.parse browser.html + self.browser = Watir::Browser.new :firefox + browser.goto 'http://google.com' + Nokogiri::HTML.parse browser.html end end end
Move attr_accessor inside dsl file
diff --git a/Casks/world-of-tanks.rb b/Casks/world-of-tanks.rb index abc1234..def5678 100644 --- a/Casks/world-of-tanks.rb +++ b/Casks/world-of-tanks.rb @@ -0,0 +1,20 @@+cask :v1 => 'world-of-tanks' do + version :latest + sha256 :no_check + + # wargaming.net is the official download host per the vendor homepage + url 'http://redirect.wargaming.net/WoT/latest_mac_install_na' + name 'World Of Tanks' + homepage 'http://worldoftanks.com/' + license :gratis + + app 'World of Tanks.app' + + zap :delete => '~/Documents/World_of_Tanks' + + caveats <<-EOS.undent + #{token} is specific to North America; if you're in a different region, you'll need to find your version in caskroom/versions + brew tap caskroom/versions + brew search #{token} + EOS +end
Add World of Tanks Latest Closes #8358.
diff --git a/omniauth-oauth2.gemspec b/omniauth-oauth2.gemspec index abc1234..def5678 100644 --- a/omniauth-oauth2.gemspec +++ b/omniauth-oauth2.gemspec @@ -6,7 +6,7 @@ gem.add_dependency "oauth2", "~> 1.1" gem.add_dependency "omniauth", "~> 1.2" - gem.add_development_dependency "bundler", "~> 1.0" + gem.add_development_dependency "bundler", "1.10.4" gem.authors = ["Michael Bleigh", "Erik Michaels-Ober"] gem.email = ["michael@intridea.com", "sferik@gmail.com"]
Fix version of bundler for JRuby 1.8
diff --git a/lib/datainsight_logging.rb b/lib/datainsight_logging.rb index abc1234..def5678 100644 --- a/lib/datainsight_logging.rb +++ b/lib/datainsight_logging.rb @@ -5,21 +5,23 @@ module Logging - def self.configure(env=ENV["RACK_ENV"]) + def self.configure(params={}) + env = params[:env] || ENV["RACK_ENV"] + type = params[:type] case (env or "default").to_sym when :test configure_test when :production - configure_production + configure_production(type) else - configure_development + configure_development(type) end end private - def self.configure_development + def self.configure_development type ::Logging.appenders.stdout(:stdout) - ::Logging.appenders.rolling_file(:file, :filename => 'log/development.log', + ::Logging.appenders.rolling_file(:file, :filename => log_file_location(type, :development), :age => 'daily') ::Logging.appenders.growl(:growl, :level => :error, :layout => ::Logging::Layouts.pattern(:pattern => '%-5l: %m\n')) @@ -28,8 +30,8 @@ ::Logging.logger.root.level = :debug end - def self.configure_production - ::Logging.appenders.rolling_file(:file, :filename => 'log/production.log', + def self.configure_production type + ::Logging.appenders.rolling_file(:file, :filename => log_file_location(type, :production), :age => 'daily', :layout => ::Logging::Layouts.json) ::Logging.logger.root.appenders = [:file] @@ -43,6 +45,10 @@ ::Logging.logger.root.level = :info end + def self.log_file_location type, env + type ? "log/#{type}-#{env}.log" : "log/#{env}.log" + end + module Helpers def logger @_logger_ ||= ::Logging::Logger[self]
Add support for multiple log files per project. author: da39a3ee5e6b4b0d3255bfef95601890afd80709@jthoenes author: da39a3ee5e6b4b0d3255bfef95601890afd80709@pbadenski
diff --git a/spec/grocer/newsstand_notification_spec.rb b/spec/grocer/newsstand_notification_spec.rb index abc1234..def5678 100644 --- a/spec/grocer/newsstand_notification_spec.rb +++ b/spec/grocer/newsstand_notification_spec.rb @@ -11,12 +11,11 @@ include_examples 'a notification' it 'does require a payload' do - puts payload_dictionary_from_bytes.inspect expect(payload_dictionary_from_bytes[:'content-available']).to_not be_nil end it 'has a content-available hash' do - expect(payload_dictionary_from_bytes[:'content-available']).should be 1 + expect(payload_dictionary_from_bytes[:'content-available']).to eq(1) end end
Remove debugging line, change .should_be to a .to
diff --git a/spec/pre_commit/fear_of_commitment_test.rb b/spec/pre_commit/fear_of_commitment_test.rb index abc1234..def5678 100644 --- a/spec/pre_commit/fear_of_commitment_test.rb +++ b/spec/pre_commit/fear_of_commitment_test.rb @@ -0,0 +1,10 @@+require 'minitest/autorun' +require 'overcommit' +require 'overcommit/hook/pre_commit/base' +require './hooks/pre_commit/fear_of_commitment' + +class TestFearOfCommitment < Minitest::Test + def test_placeholder + skip "TODO" + end +end
Add a single skipped test As a reminder/placeholder
diff --git a/spec/unit/mutant/reporter/cli/tput_spec.rb b/spec/unit/mutant/reporter/cli/tput_spec.rb index abc1234..def5678 100644 --- a/spec/unit/mutant/reporter/cli/tput_spec.rb +++ b/spec/unit/mutant/reporter/cli/tput_spec.rb @@ -3,7 +3,7 @@ subject { described_class.detect } def expect_command(command, stdout, success) - allow(Open3).to receive(:capture3).with(command).ordered.and_return( + allow(Open3).to receive(:capture3).with(command).and_return( [ stdout, instance_double(IO),
Fix rspec warning about ordered stubs
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,19 +1,15 @@ app = search(:aws_opsworks_app).first -execute "ssh-keyscan -H github.com >> /root/.ssh/known_hosts" - -application "/srv/#{app['shortname']}" do +app_path = "/srv/#{app['shortname']}" +application app_path do javascript "4" - file "/root/.ssh/id_rsa" do - content app["app_source"]["ssh_key"] - mode 0600 + app_tarball_path = ::File.join(Chef::Config[:file_cache_path], "#{app['shortname']}.tar.gz") + remote_file app_tarball_path do + source app["app_source"]["url"] end - git "/srv/#{app['shortname']}" do - repository app["app_source"]["url"] - revision app["app_source"]["revision"] - end + execute "tar xfz #{app_tarball_path} -C #{app_path} --strip-components=1" npm_install npm_start
Switch deployment from Git repo to tarball on S3
diff --git a/core/integer/constants_spec.rb b/core/integer/constants_spec.rb index abc1234..def5678 100644 --- a/core/integer/constants_spec.rb +++ b/core/integer/constants_spec.rb @@ -1,25 +1,27 @@ require_relative '../../spec_helper' -describe "Fixnum" do - it "is unified into Integer" do - suppress_warning do - Fixnum.should equal(Integer) +ruby_version_is ""..."3.1" do + describe "Fixnum" do + it "is unified into Integer" do + suppress_warning do + Fixnum.should equal(Integer) + end + end + + it "is deprecated" do + -> { Fixnum }.should complain(/constant ::Fixnum is deprecated/) end end - it "is deprecated" do - -> { Fixnum }.should complain(/constant ::Fixnum is deprecated/) + describe "Bignum" do + it "is unified into Integer" do + suppress_warning do + Bignum.should equal(Integer) + end + end + + it "is deprecated" do + -> { Bignum }.should complain(/constant ::Bignum is deprecated/) + end end end - -describe "Bignum" do - it "is unified into Integer" do - suppress_warning do - Bignum.should equal(Integer) - end - end - - it "is deprecated" do - -> { Bignum }.should complain(/constant ::Bignum is deprecated/) - end -end
Remove obsolete Fixnum and Bignum
diff --git a/lib/river_notifications.rb b/lib/river_notifications.rb index abc1234..def5678 100644 --- a/lib/river_notifications.rb +++ b/lib/river_notifications.rb @@ -13,6 +13,7 @@ if should_publish?(object) prepare_for_publish(object, :create) end + nil end def after_update(object) @@ -23,12 +24,14 @@ prepare_for_publish(object, :update) end end + nil end def after_destroy(object) if should_publish?(object) prepare_for_publish(object, :delete) end + nil end def publish!(params)
Make sure river notification observer doesn't cancel anything.
diff --git a/lib/sidekiq-unique-jobs.rb b/lib/sidekiq-unique-jobs.rb index abc1234..def5678 100644 --- a/lib/sidekiq-unique-jobs.rb +++ b/lib/sidekiq-unique-jobs.rb @@ -17,7 +17,7 @@ unique_args_enabled: false, default_expiration: 30 * 60, default_unlock_order: :after_yield, - unique_storage_method: :old + unique_storage_method: :new ) end
Make new unique storage method the default
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index abc1234..def5678 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -1,7 +1,9 @@+Paperclip::Attachment.default_options[:s3_host_name] = ENV.fetch("S3_HOST_NAME") + module Paperclip class MediaTypeSpoofDetector def spoofed? false end end -end+end
Set Paperclip S3 host based on ENV
diff --git a/inwx-domrobot.gemspec b/inwx-domrobot.gemspec index abc1234..def5678 100644 --- a/inwx-domrobot.gemspec +++ b/inwx-domrobot.gemspec @@ -1,13 +1,15 @@ Gem::Specification.new do |s| s.name = 'inwx-domrobot' - s.version = '3.0' + s.version = '3.1' s.date = '2019-09-12' s.summary = "INWX Domrobot" s.description = "Ruby Client to easily use the Domrobot API of INWX" s.authors = ["INWX"] s.email = 'support@inwx.de' s.files = ["lib/inwx-domrobot.rb"] - s.homepage = - 'https://rubygems.org/gems/inwx-domrobot' + s.homepage = 'https://rubygems.org/gems/inwx-domrobot' + s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' + s.add_runtime_dependency 'xmlrpc', '~> 0.3', '>= 0.3.0' + s.add_runtime_dependency 'rotp', '~> 5.1', '>= 5.1.0' s.license = 'MIT' end
Fix dependencies of ruby gem
diff --git a/FastEasyMapping.podspec b/FastEasyMapping.podspec index abc1234..def5678 100644 --- a/FastEasyMapping.podspec +++ b/FastEasyMapping.podspec @@ -10,7 +10,7 @@ spec.requires_arc = true spec.ios.deployment_target = '7.0' spec.osx.deployment_target = '10.9' - spec.tvos.deployment_target = '9.1' + spec.tvos.deployment_target = '9.0' spec.frameworks = 'CoreData' spec.source_files = 'FastEasyMapping/Source/**/*.{h,m}'
Fix deployment target for tvos
diff --git a/profile/benchmark_21.rb b/profile/benchmark_21.rb index abc1234..def5678 100644 --- a/profile/benchmark_21.rb +++ b/profile/benchmark_21.rb @@ -14,7 +14,7 @@ collection = client[:test] documents = 50000.times.map do |i| - { name: 'user', index: i } + { name: 'user', index: i, embedded: [{ n: i }] } end Benchmark.bm do |bm|
RUBY-839: Add embedded array to test doc
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -25,5 +25,8 @@ # Configure the asset pipeline to include Bower components. config.assets.paths << Rails.root.join('vendor', 'assets', 'bower_components') + # Configure Google Tag Manager ID + config.google_tag_manager_id = 'GTM-WVFLH9' + end end
Add Google Tag Manager ID configuration
diff --git a/config/delayed_job.rb b/config/delayed_job.rb index abc1234..def5678 100644 --- a/config/delayed_job.rb +++ b/config/delayed_job.rb @@ -0,0 +1,2 @@+# See https://github.com/collectiveidea/delayed_job/commit/90579c3047099b6a58595d4025ab0f4b7f0aa67a. +Delayed::Worker.raise_signal_exceptions = :term
Exit jobs immediately on Heroku restart. See https://github.com/collectiveidea/delayed_job/commit/90579c3047099b6a58595d4025ab0f4b7f0aa67a
diff --git a/test/fragment_helper_test.rb b/test/fragment_helper_test.rb index abc1234..def5678 100644 --- a/test/fragment_helper_test.rb +++ b/test/fragment_helper_test.rb @@ -1,4 +1,53 @@ require 'cache_digests/test_helper' +class Fragmenter + include CacheDigests::FragmentHelper + attr_accessor :virtual_path, :formats, :lookup_context + def initialize + @virtual_path = '' + @formats = [:html] + end +end + class FragmentHelperTest < MiniTest::Unit::TestCase + def setup + # would love some mocha here + @old_digest = CacheDigests::TemplateDigestor.method(:digest) + CacheDigests::TemplateDigestor.send(:define_singleton_method, :digest) do |p,f,lc| + "digest" + end + end + def teardown + CacheDigests::TemplateDigestor.send(:define_singleton_method, :digest, &@old_digest) + @fragmenter = nil + end + + def test_passes_correct_parameters_to_digestor + CacheDigests::TemplateDigestor.send(:define_singleton_method, :digest) do |p,f,lc| + extend MiniTest::Assertions + assert_equal 'path', p + assert_equal :formats, f + assert_equal 'lookup context', lc + end + fragmenter.virtual_path = 'path' + fragmenter.formats = ['formats'] + fragmenter.lookup_context = 'lookup context' + + fragmenter.fragment_name_with_digest("key") + end + + def test_appends_the_key_with_digest + key_with_digest = fragmenter.fragment_name_with_digest("key") + assert_equal ['key', 'digest'], key_with_digest + end + + def test_appends_the_array_key_with_digest + key_with_digest = fragmenter.fragment_name_with_digest(["key1", "key2"]) + assert_equal ['key1', 'key2', 'digest'], key_with_digest + end + + private + def fragmenter + @fragmenter ||= Fragmenter.new + end end
Add some simple tests around the CacheDigests::FragmentHelper.fragment_name_with_digest
diff --git a/lib/git_repo.rb b/lib/git_repo.rb index abc1234..def5678 100644 --- a/lib/git_repo.rb +++ b/lib/git_repo.rb @@ -3,17 +3,26 @@ class << self def inside_copy(cached_repo_name, ref = "master", submodules = false) + cached_repo_path = File.join(WORKING_DIR, cached_repo_name) # update local repo - run! "cd #{WORKING_DIR}/#{cached_repo_name} && git fetch" + run! "cd #{cached_repo_path} && git fetch && git submodule update --init" Dir.mktmpdir(nil, WORKING_DIR) do |dir| Dir.chdir(dir) do # clone local repo (fast!) - run! "git clone #{WORKING_DIR}/web-cache ." + run! "git clone #{cached_repo_path} ." - # checkout run! "git checkout #{ref}" - run! "git submodule update --init" if submodules + + run! "git submodule init" + # redirect the submodules to the cached_repo + submodules = `git config --get-regexp "^submodule\\..*\\.url$"` + submodules.each_line do |config_line| + submodule_path = config_line.match(/submodule\.(.*?)\.url/)[1] + `git config --replace-all submodule.#{submodule_path}.url "#{cached_repo_path}/#{submodule_path}"` + end + + run! "git submodule update" yield end
Make the submodule support for inside_copy efficient
diff --git a/drs-auth_client/spec/lib/drs/auth_client_spec.rb b/drs-auth_client/spec/lib/drs/auth_client_spec.rb index abc1234..def5678 100644 --- a/drs-auth_client/spec/lib/drs/auth_client_spec.rb +++ b/drs-auth_client/spec/lib/drs/auth_client_spec.rb @@ -3,5 +3,9 @@ it 'true is true' do expect(true).to be true end + + it 'should fail the ci build' do + expect(false).to be true + end end end
Add failing spec to test CircleCI
diff --git a/lib/new_card.rb b/lib/new_card.rb index abc1234..def5678 100644 --- a/lib/new_card.rb +++ b/lib/new_card.rb @@ -24,7 +24,7 @@ 'idList'=>"#{@list_id}", 'due'=>nil, 'desc'=>"#{@build_url}", - 'idLabels'=>["#{@id_labels}"] + 'idLabels'=>@id_labels } @trello_client.create(:card, data) end
Fix idLabels to string instead of array
diff --git a/app/admin/farm.rb b/app/admin/farm.rb index abc1234..def5678 100644 --- a/app/admin/farm.rb +++ b/app/admin/farm.rb @@ -5,7 +5,7 @@ f.input :founded_at_year f.input :founded_at_month f.input :maximum_members - f.input :accepts_new_members + f.input :accepts_new_members, as: :select, collection: ['yes', 'no', 'waitlist'] f.input :products, as: :select, collection: Farm.products.values f.input :participation f.input :acts_ecological
Add drop down menu for accepts_new_members.
diff --git a/lib/chaindrive/web.rb b/lib/chaindrive/web.rb index abc1234..def5678 100644 --- a/lib/chaindrive/web.rb +++ b/lib/chaindrive/web.rb @@ -1,6 +1,4 @@-require 'sinatra' require 'chaindrive/database' -require 'chaindrive/gear' module Chaindrive class Web < Sinatra::Application
Remove requires that are no longer required. Mainly due to refactoring and autoloading.
diff --git a/week-8/fibonacci_sequence.rb b/week-8/fibonacci_sequence.rb index abc1234..def5678 100644 --- a/week-8/fibonacci_sequence.rb +++ b/week-8/fibonacci_sequence.rb @@ -20,7 +20,7 @@ next_num = fibonacci[-1]+fibonacci[-2] fibonacci << next_num end - fibonacci.include?(num) + num == next_num end
Make final check a comparison
diff --git a/lib/dest/evaluator.rb b/lib/dest/evaluator.rb index abc1234..def5678 100644 --- a/lib/dest/evaluator.rb +++ b/lib/dest/evaluator.rb @@ -0,0 +1,22 @@+module Dest + + class Evaluator + + def initialize(parsed_attributes) + @parsed_attributes = parsed_attributes + end + + def evaluate + expr_result = eval(parsed_attributes[1]) + + if expr_result == eval(parsed_attributes[2]) + [true] + else + [false, parsed_attributes[0], parsed_attributes[1], parsed_attributes[2], expr_result] + # false, line number, expression, expected_result, actual_result + end + end + + end + +end
Add Evaluator, which given a parsed doctest. Evaluates the test and constructs a result for the Formatter
diff --git a/lib/ferrety_ferret.rb b/lib/ferrety_ferret.rb index abc1234..def5678 100644 --- a/lib/ferrety_ferret.rb +++ b/lib/ferrety_ferret.rb @@ -1,17 +1,22 @@ require "ferrety_ferret/version" require "httparty" module Ferrety - + class Ferret attr_accessor :alerts - def initialize - @alerts = [] + + def initialize(params) + clear_alerts end private def add_alert(alert_text) @alerts << alert_text + end + + def clear_alerts + @alerts = [] end end
Add global initialize template & clear alerts function
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index abc1234..def5678 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file. -Rails.application.config.session_store :cookie_store, key: '_epets_session' +Rails.application.config.session_store :cookie_store, key: '_epets_session', expire_after: 2.weeks
Make session cookie last for two weeks to work around iOS bug Mobile Safari has a tendency to use cached form values even when the cache control headers tell it otherwise. However the session cookie has expired so when the form is submitted the CSRF token is invalid. See rails/rails#21948 for further details. Fixes #451.
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index abc1234..def5678 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,6 +1,6 @@ # Be sure to restart your server when you modify this file. -Rails.application.config.session_store :cookie_store, :key => '_kassi_session', :domain => APP_CONFIG.domain +Rails.application.config.session_store :cookie_store, :key => '_kassi_session', :domain => APP_CONFIG.domain, :expire_after => 20.days # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information
Set session to be alive 20 days by default
diff --git a/config/initializers/working_hours.rb b/config/initializers/working_hours.rb index abc1234..def5678 100644 --- a/config/initializers/working_hours.rb +++ b/config/initializers/working_hours.rb @@ -2,4 +2,5 @@ 2021-12-27 2021-12-28 2022-01-03 + 2022-09-19 ).map(&:to_date)
Configure the new bank holiday exclusion
diff --git a/app/models/arp.rb b/app/models/arp.rb index abc1234..def5678 100644 --- a/app/models/arp.rb +++ b/app/models/arp.rb @@ -1,6 +1,10 @@ class Arp def self.all - `ip neigh show nud reachable`.split(/\n/).map do |entry| + # Make sure you set the following sysctl knobs to something sane or else + # your users will stay present forever: + # net.ipv4.neigh.default.gc_thresh1 = 10 + # net.ipv6.neigh.default.gc_thresh1 = 20 + `ip neigh show nud reachable nud stale`.split(/\n/).map do |entry| addresses = *entry.scan(/\A([0-9a-f:.]*?) dev ([a-z0-9.]*?) lladdr ([0-9a-f:].*?) .*\z/i).first Arp.new(*addresses) end.compact
Add stale neighbour monitoring in the Arp presence detection
diff --git a/app/models/arp.rb b/app/models/arp.rb index abc1234..def5678 100644 --- a/app/models/arp.rb +++ b/app/models/arp.rb @@ -1,8 +1,9 @@ class Arp def self.all `ip neigh show`.split(/\n/).map do |entry| - Arp.new *entry.scan(/\A([0-9a-f:.]*?) dev ([a-z0-9.]*?) lladdr ([0-9a-f:].*?) .*\z/i).first - end + addresses = *entry.scan(/\A([0-9a-f:.]*?) dev ([a-z0-9.]*?) lladdr ([0-9a-f:].*?) .*\z/i).first + Arp.new(*addresses) if addresses.count == 3 + end.compact end def self.present_users
Fix issue with missing mac addresses
diff --git a/lib/license_finder.rb b/lib/license_finder.rb index abc1234..def5678 100644 --- a/lib/license_finder.rb +++ b/lib/license_finder.rb @@ -21,11 +21,11 @@ end def dependencies_yaml - "#{dependencies_dir}/dependencies.yml" + File.join(dependencies_dir, "dependencies.yml") end def dependencies_text - "#{dependencies_dir}/dependencies.txt" + File.join(dependencies_dir, "dependencies.txt") end end
Use File.join for great justice
diff --git a/test/app/controllers/posts_controller.rb b/test/app/controllers/posts_controller.rb index abc1234..def5678 100644 --- a/test/app/controllers/posts_controller.rb +++ b/test/app/controllers/posts_controller.rb @@ -1,12 +1,11 @@ class PostsController < ActionController::Base include CancanStrongParameters::Controller - permit_params :title, :content, + permit_params :title, :content, :label_ids, :comments => [ :body, { :tags => [ :name ] } # This is fugly, use 1.9! - ], - :label_ids => Array + ] def create @post = Post.new(params[:post])
Use correct format so tests will pass.
diff --git a/test/models/kiitos/administrator_test.rb b/test/models/kiitos/administrator_test.rb index abc1234..def5678 100644 --- a/test/models/kiitos/administrator_test.rb +++ b/test/models/kiitos/administrator_test.rb @@ -0,0 +1,17 @@+require 'test_helper' + +describe Kiitos::Administrator do + before do + @user = User.create name: 'Test User', email: 'test@example.com' + @admin = Kiitos::Administrator.create user_id: @user.id + end + + describe 'validations' do + it 'is invalid if the user is already taken' do + @admin2 = Kiitos::Administrator.create user_id: @user.id + + @admin2.errors.any?.must_equal true + @admin2.errors.full_messages.include?('User has already been taken').must_equal true + end + end +end
Add test file for administrator model class
diff --git a/lib/sneakers/queue.rb b/lib/sneakers/queue.rb index abc1234..def5678 100644 --- a/lib/sneakers/queue.rb +++ b/lib/sneakers/queue.rb @@ -29,9 +29,13 @@ handler = @handler_klass.new(@channel) routing_key = @opts[:routing_key] || @name + routing_keys = routing_key.respond_to?(:each) ? routing_key : [routing_key] queue = @channel.queue(@name, :durable => @opts[:durable]) - queue.bind(@exchange, :routing_key => routing_key) + + routing_keys.each do |key| + queue.bind(@exchange, :routing_key => key) + end @consumer = queue.subscribe(:block => false, :ack => @opts[:ack]) do | hdr, props, msg | worker.do_work(hdr, props, msg, handler)
Allow binding to multiple routing keys.
diff --git a/lib/swallow/resque.rb b/lib/swallow/resque.rb index abc1234..def5678 100644 --- a/lib/swallow/resque.rb +++ b/lib/swallow/resque.rb @@ -3,9 +3,11 @@ desc "Restart Resque Workers" task :restart_workers, :roles => :resque do find_servers_for_task(current_task).each do |current_server| - puts "starting workers on #{current_server.host}" - cmd = "cd #{release_path} && RAILS_ENV=#{rails_env} bundle exec rake resque:restart_workers[#{current_server.host}]" - run(cmd, :hosts => current_server.host) if use_resque + if use_resque + puts " * starting workers on #{current_server.host}" + cmd = "cd #{release_path} && RAILS_ENV=#{rails_env} bundle exec rake resque:restart_workers[#{current_server.host}]" + run(cmd, :hosts => current_server.host) + end end end end
Use cap convention of prefixing console info with ' * '
diff --git a/lib/tasks/emails.rake b/lib/tasks/emails.rake index abc1234..def5678 100644 --- a/lib/tasks/emails.rake +++ b/lib/tasks/emails.rake @@ -2,6 +2,7 @@ namespace :emails do task :send_notifications_digest => :environment do User.with_state(:visible).find_each do |user| + require 'notification/mailer' next unless user.notifications.unread.count > 0 notifications = user.notifications.unread.by_most_recent.limit(25)
Load mailer in email task
diff --git a/lib/tasks/stream.rake b/lib/tasks/stream.rake index abc1234..def5678 100644 --- a/lib/tasks/stream.rake +++ b/lib/tasks/stream.rake @@ -19,4 +19,9 @@ Rails.cache.write('cache', Cache.new) system('bundle exec rails runner script/tweetstream.rb start') end + + desc "Find daemon pid" + task :pid => :environment do + exec('cat tracker.pid') + end end
Add rake task to view daemon's pid
diff --git a/data-aggregation-accumulator.gemspec b/data-aggregation-accumulator.gemspec index abc1234..def5678 100644 --- a/data-aggregation-accumulator.gemspec +++ b/data-aggregation-accumulator.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'data_aggregation-accumulator' - s.version = '0.1.1.1' + s.version = '0.1.1.2' s.summary = 'Data aggregation accumulator library' s.description = ' '
Package version is increased from 0.1.1.1 to 0.1.1.2
diff --git a/bin/benizi-uri.rb b/bin/benizi-uri.rb index abc1234..def5678 100644 --- a/bin/benizi-uri.rb +++ b/bin/benizi-uri.rb @@ -21,6 +21,7 @@ end end + add_scheme :postgresql add_scheme :ssh def fields
Add handling for `postgresql://` in `benizi-urb`
diff --git a/tools/generate-long-posting-list-data.rb b/tools/generate-long-posting-list-data.rb index abc1234..def5678 100644 --- a/tools/generate-long-posting-list-data.rb +++ b/tools/generate-long-posting-list-data.rb @@ -0,0 +1,24 @@+#!/usr/bin/env ruby + +require "json" + +puts(<<-COMMANDS) +table_create Data TABLE_NO_KEY +column_create Data value COLUMN_SCALAR Text + +table_create Terms TABLE_PAT_KEY ShortText \ + --normalizer NormalizerNFKC100 \ + --default_tokenizer TokenRegexp +column_create Terms index COLUMN_INDEX|WITH_POSITION Data value +COMMANDS + +puts(<<-LOAD) +load --table Data +[ +LOAD +100000.times do + puts({"value" => "X"}.to_json) +end +puts(<<-LOAD) +] +LAOD
Add a tool that generate data for long posting list
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -1,4 +1,5 @@ require 'open-uri' +require 'json' get '/' do redirect '/index.html' @@ -10,3 +11,13 @@ content_type file.content_type file end + +get '/config.json' do + content_type 'application/json' + path = 'public/config.json' + if File.exist?(path) + File.read(path) + else + {rssServiceUrl: ENV['RSS_SERVICE_URL']}.to_json + end +end
Read RSS service URI from env var
diff --git a/spec/factories/clubs.rb b/spec/factories/clubs.rb index abc1234..def5678 100644 --- a/spec/factories/clubs.rb +++ b/spec/factories/clubs.rb @@ -5,6 +5,5 @@ name { Faker::Lorem.words(rand(3) + 1).join " " } description { Faker::Lorem.sentence } price_cents { rand(9000) + 1000 } - logo { "public/isDefault.jpg" } end end
Update Club Factory to Remove Logo Remove the logo attribute from the Club factory since it is no longer a required attribute for a Club to be valid.
diff --git a/spec/factories/votes.rb b/spec/factories/votes.rb index abc1234..def5678 100644 --- a/spec/factories/votes.rb +++ b/spec/factories/votes.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :vote do - up: { [true, false].sample } + up { [true, false].sample } end end
Add up field to vote factory
diff --git a/call_sign.gemspec b/call_sign.gemspec index abc1234..def5678 100644 --- a/call_sign.gemspec +++ b/call_sign.gemspec @@ -20,6 +20,6 @@ spec.add_dependency 'countries' - spec.add_development_dependency 'bundler', '~> 1.5' + spec.add_development_dependency 'bundler', '~> 2.0' spec.add_development_dependency 'rake' end
Update bundler requirement from ~> 1.5 to ~> 2.0 Updates the requirements on [bundler](https://github.com/bundler/bundler) to permit the latest version. - [Release notes](https://github.com/bundler/bundler/releases) - [Changelog](https://github.com/bundler/bundler/blob/master/CHANGELOG.md) - [Commits](https://github.com/bundler/bundler/commits/v2.0.0) Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/lib/break_dance/security_scoping.rb b/lib/break_dance/security_scoping.rb index abc1234..def5678 100644 --- a/lib/break_dance/security_scoping.rb +++ b/lib/break_dance/security_scoping.rb @@ -3,7 +3,7 @@ extend ActiveSupport::Concern module ClassMethods - def scoped(options = nil) + def where(options = nil) scope = super(options) return ActiveRecord::Relation.new(self, Arel::Table.new(table_name)) unless scope @@ -23,7 +23,7 @@ def unsecured if RequestStore.store[:security_policy_holder] RequestStore.store[:security_policy_holder].suppress_security_for = self.name - scoped + where else self end
Upgrade to Rails 4.2. Still just console and Messages/Index working.
diff --git a/lib/landrush/action/redirect_dns.rb b/lib/landrush/action/redirect_dns.rb index abc1234..def5678 100644 --- a/lib/landrush/action/redirect_dns.rb +++ b/lib/landrush/action/redirect_dns.rb @@ -24,7 +24,7 @@ def _target_host case provider when :virtualbox then - '10.0.2.3' + '10.0.2.2' when :vmware_fusion, :libvirt then _gateway_for_ip(machine.guest.capability(:configured_dns_servers).first) when :parallels then
Revert "Change virtualbox DNS address to 10.0.2.3" This reverts commit 1df24371fc98f69f045d054a692be38d2330b32e. Reverting as @hferentschik would like to discuss this further.
diff --git a/lib/netsuite/records/custom_list.rb b/lib/netsuite/records/custom_list.rb index abc1234..def5678 100644 --- a/lib/netsuite/records/custom_list.rb +++ b/lib/netsuite/records/custom_list.rb @@ -14,12 +14,14 @@ field :custom_value_list, NetSuite::Support::GenericList + attr_reader :internal_id + attr_accessor :external_id + def initialize(attributes = {}) @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id) @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id) initialize_from_attributes_hash(attributes) end - end end end
Add reader method for internal_id
diff --git a/lib/sequent/core/event_publisher.rb b/lib/sequent/core/event_publisher.rb index abc1234..def5678 100644 --- a/lib/sequent/core/event_publisher.rb +++ b/lib/sequent/core/event_publisher.rb @@ -1,6 +1,13 @@ module Sequent module Core class EventPublisher + # + # EventPublisher ensures that, for every thread, events will be published in the order in which they are meant to be published. + # + # This potentially introduces a wrinkle into your plans: You therefore should not split a "unit of work" across multiple threads. + # + # If you do not want this, you are free to implement your own version of EventPublisher and configure sequent to use it. + # class PublishEventError < RuntimeError attr_reader :event_handler_class, :event @@ -14,26 +21,34 @@ end end - def initialize - @events_queue = Queue.new - @mutex = Mutex.new - end - def publish_events(events) return if configuration.disable_event_handlers - events.each { |event| @events_queue.push(event) } + events.each { |event| events_queue.push(event) } process_events end private + def events_queue + Thread.current[:events_queue] ||= Queue.new + end + + def skip_if_locked(&block) + Thread.current[:events_queue_locked] = false if Thread.current[:events_queue_locked].nil? + + return if Thread.current[:events_queue_locked] + + Thread.current[:events_queue_locked] = true + + block.yield + ensure + Thread.current[:events_queue_locked] = false + end + def process_events - # only process events at the highest level - return if @mutex.locked? - - @mutex.synchronize do - while(!@events_queue.empty?) do - event = @events_queue.pop + skip_if_locked do + while(!events_queue.empty?) do + event = events_queue.pop configuration.event_handlers.each do |handler| begin handler.handle_message event
Synchronize events within a single thread
diff --git a/lib/tasks/populate_app_content.rake b/lib/tasks/populate_app_content.rake index abc1234..def5678 100644 --- a/lib/tasks/populate_app_content.rake +++ b/lib/tasks/populate_app_content.rake @@ -16,6 +16,7 @@ desc "Loads default front page content" task :default => :environment do + # Pending default content end end
Add comment to rake task that defaults are yet to come