diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
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 @@ -6,6 +6,9 @@ belongs_to :organisation + validates :first_name, :last_name, :email, presence: true + validates_format_of :email,:with => /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/ + def send_welcome_email UserMailer.welcome_email(self).deliver_now end
Add presence validations and email format 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 @@ -8,7 +8,7 @@ has_many :received_messages, class_name: "Message", foreign_key: :receiver_id def messages - Message.where("sender_id = ? OR receiver_id = ?", self, self) + Message.where("sender_id = ? OR receiver_id = ?", self, self).order("id DESC") end end
Order messages by id DESC
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 @@ -3,7 +3,7 @@ has_many :tokens - after_save :create_a_token + after_create :create_a_token def self.find_for_github_oauth(user_hash) data = user_hash['extra']['user_hash'] @@ -20,7 +20,7 @@ private def create_a_token - self.tokens.create! if self.tokens.empty? + self.tokens.create! end end
Use after_create callback for creating tokens
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,4 +1,4 @@-if ENV['TRAVIS'] && RUBY_VERSION == '2.1.2' +if ENV['TRAVIS'] && RUBY_VERSION.match('2.1.') require 'coveralls' Coveralls.wear! end
Fix coveralls ruby version check
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,8 @@+unless ENV['SECRET_KEY_BASE'] + STDERR.puts "\e[31m => Please load the environment secrets before running the test suite\e[0m" + exit 1 +end + ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help'
Add warning when running the test suite
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -4,7 +4,7 @@ ENV["RAILS_ENV"] = "test" require File.expand_path("../dummy/config/environment.rb", __FILE__) require "rails/test_help" -ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) +ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) Rails.backtrace_cleaner.remove_silencers! # Complete stack trace with deprecation warnings from rails ActiveSupport::Deprecation.debug = true @@ -26,3 +26,6 @@ c.filter_sensitive_data("primo.library.edu") { "bobcat.library.nyu.edu" } c.filter_sensitive_data("LIB01") { "NYU01" } end + +# Use pry for debugging +require 'pry'
Use pry for debugging in tests
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,4 +1,9 @@-require 'test/unit' +if RUBY_VERSION < '1.9' + require 'test/unit' +else + require 'minitest/autorun' +end + require 'rubygems' require 'logger' require 'active_record'
Make tests work with latest Minitest
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -4,6 +4,13 @@ require File.expand_path("../dummy/config/environment.rb", __FILE__) require "rails/test_help" +#Run any available migration +ActiveRecord::Migrator.migrate 'up' + +# Set fixtures root +ActiveSupport::TestCase.fixture_path=(File.expand_path("../dummy/test/fixtures", __FILE__)) +ActiveSupport::TestCase.fixtures :all + Rails.backtrace_cleaner.remove_silencers! # Load support files
Make dummy app tests run properly
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -7,4 +7,8 @@ # CodeClimate::TestReporter.start require 'minitest/autorun' -require_relative '../lib/rhex'+require_relative '../lib/rhex' + +# Ensure the image output directory exists +IMAGE_OUTPUT_DIRECTORY = 'tmp' +Dir.mkdir(IMAGE_OUTPUT_DIRECTORY) unless Dir.exist?(IMAGE_OUTPUT_DIRECTORY)
Create the tmp directory if it does not exist. On a fresh git checkout the 'tmp' directory used for storing test output images does not exist. This adds a line to the test_helper to create the directory if necessary.
diff --git a/Folklore.podspec b/Folklore.podspec index abc1234..def5678 100644 --- a/Folklore.podspec +++ b/Folklore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Folklore' - s.version = '0.2.2' + s.version = '0.3.0' s.license = 'MIT' s.summary = 'League of Legends chat service library for iOS and OS X.' s.homepage = 'https://github.com/jcouture/Folklore'
Set the version number to 0.3.0.
diff --git a/cookbooks/sysctl/recipes/default.rb b/cookbooks/sysctl/recipes/default.rb index abc1234..def5678 100644 --- a/cookbooks/sysctl/recipes/default.rb +++ b/cookbooks/sysctl/recipes/default.rb @@ -23,7 +23,8 @@ if node[:virtualization][:role] != "guest" || (node[:virtualization][:system] != "lxc" && - node[:virtualization][:system] != "lxd") + node[:virtualization][:system] != "lxd" && + node[:virtualization][:system] != "openvz") keys = [] Dir.new("/etc/sysctl.d").each_entry do |file|
Disable sysctl tuning on openvz systems
diff --git a/installers/brew/skaffold.rb b/installers/brew/skaffold.rb index abc1234..def5678 100644 --- a/installers/brew/skaffold.rb +++ b/installers/brew/skaffold.rb @@ -1,7 +1,7 @@ class Skaffold < Formula desc "A tool that facilitates continuous development for Kubernetes applications." url "https://github.com/GoogleContainerTools/skaffold.git" - version "v0.3.0" + version "v0.5.0" depends_on "go" => :build
Update the brew formula to 0.5.0 Update the brew formula to 0.5.0
diff --git a/Popsicle.podspec b/Popsicle.podspec index abc1234..def5678 100644 --- a/Popsicle.podspec +++ b/Popsicle.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Popsicle" - s.version = "2.0.0" + s.version = "2.0.1" s.summary = "Delightful, extensible Swift value interpolation framework" s.homepage = "https://github.com/DavdRoman/Popsicle" s.author = { "David Román" => "d@vidroman.me" }
Update Podspec for version 2.0.1
diff --git a/react-native-video.podspec b/react-native-video.podspec index abc1234..def5678 100644 --- a/react-native-video.podspec +++ b/react-native-video.podspec @@ -3,12 +3,12 @@ s.version = "0.7.1" s.summary = "A <Video /> element for react-native" - s.homepage = "https://github.com:brentvatne/react-native-video" + s.homepage = "https://github.com/brentvatne/react-native-video" s.license = "MIT" s.platform = :ios, "8.0" - s.source = { :git => "https://github.com:brentvatne/react-native-video" } + s.source = { :git => "https://github.com/brentvatne/react-native-video" } s.source_files = "*.{h,m}"
[Podspec] Fix the git source link in the podspec
diff --git a/integration-tests/apps/alacarte/job-timeout/long_running_job.rb b/integration-tests/apps/alacarte/job-timeout/long_running_job.rb index abc1234..def5678 100644 --- a/integration-tests/apps/alacarte/job-timeout/long_running_job.rb +++ b/integration-tests/apps/alacarte/job-timeout/long_running_job.rb @@ -10,7 +10,7 @@ def run() $stderr.puts "Job executing! " + @queue_name @response_queue.publish( 'started' ) - sleep( 3 ) + sleep( 5 ) @response_queue.publish( @interrupted ? 'interrupted' : 'done', :properties => { 'completion' => 'true' } ) end
Apply the McWhirter Sleep Principle (MSP) to try and make this integ more reliable
diff --git a/lib/generators/spree_pro_connector/install/install_generator.rb b/lib/generators/spree_pro_connector/install/install_generator.rb index abc1234..def5678 100644 --- a/lib/generators/spree_pro_connector/install/install_generator.rb +++ b/lib/generators/spree_pro_connector/install/install_generator.rb @@ -1,28 +1,8 @@ module SpreeProConnector module Generators class InstallGenerator < Rails::Generators::Base - - def add_javascripts - append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_pro_connector\n" - append_file 'app/assets/javascripts/admin/all.js', "//= require admin/spree_pro_connector\n" - end - def add_stylesheets - inject_into_file 'app/assets/stylesheets/store/all.css', " *= require store/spree_pro_connector\n", :before => /\*\//, :verbose => true inject_into_file 'app/assets/stylesheets/admin/all.css', " *= require admin/spree_pro_connector\n", :before => /\*\//, :verbose => true - end - - def add_migrations - run 'bundle exec rake railties:install:migrations FROM=spree_pro_connector' - end - - def run_migrations - res = ask 'Would you like to run the migrations now? [Y/n]' - if res == '' || res.downcase == 'y' - run 'bundle exec rake db:migrate' - else - puts 'Skipping rake db:migrate, don\'t forget to run it!' - end end end end
Install generator only needs to require css
diff --git a/sdk-remote/vcs/local.rb b/sdk-remote/vcs/local.rb index abc1234..def5678 100644 --- a/sdk-remote/vcs/local.rb +++ b/sdk-remote/vcs/local.rb @@ -7,7 +7,7 @@ def local_commit! ( *args ) common_commit!("urbi-sdk <%= rev %>: <%= title %>", *args) do |subject| - mail!(:to => %w[liburbi-cpp@gostai.com], + mail!(:to => %w[liburbi-cpp-patches@lists.gostai.com], :subject => subject) end end
Use the proper mailing lists to send commit messages. git-svn-id: f9eea80707c1c784c23b043bfa7e6685413e3a67@487 b8db33d8-8104-0410-b827-8403f563b8eb
diff --git a/test/unit/tracker_sparql_cursor_test.rb b/test/unit/tracker_sparql_cursor_test.rb index abc1234..def5678 100644 --- a/test/unit/tracker_sparql_cursor_test.rb +++ b/test/unit/tracker_sparql_cursor_test.rb @@ -3,7 +3,7 @@ describe Tracker::SparqlCursor do describe "#get_string" do before do - conn = Tracker::SparqlConnection.get_direct nil + conn = Tracker::SparqlConnection.get @cursor = conn.query "SELECT 'Foo' { }", nil @cursor.next nil
Update test to fetch connection the Tracker 2.0 way
diff --git a/lib/cocoapods/search/pod.rb b/lib/cocoapods/search/pod.rb index abc1234..def5678 100644 --- a/lib/cocoapods/search/pod.rb +++ b/lib/cocoapods/search/pod.rb @@ -3,7 +3,8 @@ attr_accessor :name, :star_count, :fork_count def initialize - @star_count, @fork_count = nil, nil + @star_count = nil + @fork_count = nil end def score
Remove warning: `Do not use parallel assignment`
diff --git a/spec/kit_loader_spec.rb b/spec/kit_loader_spec.rb index abc1234..def5678 100644 --- a/spec/kit_loader_spec.rb +++ b/spec/kit_loader_spec.rb @@ -23,4 +23,13 @@ "subset"=>"all" } end + + context "no created kits" do + before(:all) do + Typedeploy::Config.directory = "/" + end + it "can still return .kits" do + Typedeploy::Config.kits.should == {} + end + end end
Make sure that Config.kits will work when no kits have been created.
diff --git a/geo_pattern.gemspec b/geo_pattern.gemspec index abc1234..def5678 100644 --- a/geo_pattern.gemspec +++ b/geo_pattern.gemspec @@ -18,6 +18,8 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] + spec.required_ruby_version = '~>2' + spec.add_dependency 'color', '~> 1.5' spec.add_development_dependency 'bundler', '~> 1.5'
Add ruby version requirement because there are some classes which make use of named parameters
diff --git a/lib/github/user_importer.rb b/lib/github/user_importer.rb index abc1234..def5678 100644 --- a/lib/github/user_importer.rb +++ b/lib/github/user_importer.rb @@ -1,7 +1,7 @@ module Github class UserImporter - API_REQUEST_INTERVAL = 0.02 - MAX_IMPORT_COUNT = 30 + API_REQUEST_INTERVAL = 1 + MAX_IMPORT_COUNT = 10 FETCH_ATTRIBUTES = %i[ id login
Decrease API request interval because all users had been fetched
diff --git a/lib/attrs.rb b/lib/attrs.rb index abc1234..def5678 100644 --- a/lib/attrs.rb +++ b/lib/attrs.rb @@ -26,7 +26,7 @@ if respond_to?("default_#{name}", true) send "default_#{name}" else - raise KeyError, "key not found: :age. Define :default_#{name} for a default value" + raise KeyError, "key not found: #{name.inspect}. Define :default_#{name} for a default value" end }) end
Fix error message raised when attribute is not found
diff --git a/lib/robot.rb b/lib/robot.rb index abc1234..def5678 100644 --- a/lib/robot.rb +++ b/lib/robot.rb @@ -14,10 +14,10 @@ def hear(raw_message) message = Message.new(raw_message) - @listeners.each do |listener| - if listener.hears?(message) - listener.hear!(message) - end + @listeners.select do |listener| + listener.hears?(message) + end.each do |listener| + listener.hear!(message) end message
Improve filtering for matching listeners
diff --git a/lib/rename_params/macros.rb b/lib/rename_params/macros.rb index abc1234..def5678 100644 --- a/lib/rename_params/macros.rb +++ b/lib/rename_params/macros.rb @@ -6,9 +6,8 @@ def rename(*args) current_param = args.shift options = build_options(*args) - before_filter "rename_param_#{current_param}".to_sym, options[:filters] - define_method("rename_param_#{current_param}") do + before_filter options[:filters] do new_params = RenameParams::Params.new(params, self) new_params.convert(current_param, options[:convert], options[:namespace]) new_params.rename(current_param, options[:to], options[:namespace])
Use anonymous function on before_action call to avoid naming conflicts
diff --git a/mollie.gemspec b/mollie.gemspec index abc1234..def5678 100644 --- a/mollie.gemspec +++ b/mollie.gemspec @@ -11,9 +11,9 @@ s.email = ['info@mollie.nl'] s.homepage = 'https://github.com/mollie/mollie-api-ruby' s.license = 'BSD' - s.required_ruby_version = '>= 1.9.2' + s.required_ruby_version = '>= 1.9.3' - s.add_dependency('rest-client', '~> 1.6') + s.add_dependency('rest-client', '~> 1.8') s.add_dependency('json', '~> 1.8') s.files = `git ls-files`.split("\n")
Update rest-client to a recent version
diff --git a/mcpi/util.rb b/mcpi/util.rb index abc1234..def5678 100644 --- a/mcpi/util.rb +++ b/mcpi/util.rb @@ -1,7 +1,10 @@ def flatten_parameters_to_string(l) + #flatten is recursive in ruby if l.respond_to? :each val = l.flatten.join(",") + return val + else + return l; end - #puts "val", val - return val end +
Fix for return of function Make it so function would return value if passed non-iterable Add comment to explain flatten in ruby is recursive
diff --git a/manageiq-ui-classic.gemspec b/manageiq-ui-classic.gemspec index abc1234..def5678 100644 --- a/manageiq-ui-classic.gemspec +++ b/manageiq-ui-classic.gemspec @@ -13,7 +13,7 @@ s.description = "Classic UI of ManageIQ" s.license = "Apache 2.0" - s.files = Dir["{app,config,db,lib}/**/*", "LICENSE.txt", "Rakefile", "README.md"] + s.files = Dir["{app,config,lib,locale,spec}/**/*", "LICENSE.txt", "Rakefile", "README.md"] s.add_dependency "rails", "~> 5.0.0", ">= 5.0.0.1" end
Add missing files to the gem.
diff --git a/api-spec.gemspec b/api-spec.gemspec index abc1234..def5678 100644 --- a/api-spec.gemspec +++ b/api-spec.gemspec @@ -8,4 +8,11 @@ s.files = [ 'lib/api-spec.rb' ] s.homepage = 'https://github.com/nutshellcrm/api-spec' s.license = 'MIT' + + s.add_runtime_dependency 'cucumber', '~> 1.3.2' + s.add_runtime_dependency 'rspec', '~> 2.13.0' + s.add_runtime_dependency 'faraday', '~> 0.8.7' + + s.add_runtime_dependency 'json_spec', '~> 1.1.1' + s.add_runtime_dependency 'json', '~> 1.8.0' end
Add gem dependencies from our previous bundler setup I haven't recently thought about the rationale for any of these dependencies. I'm just copying our previous setup in an attempt to get a working gem.
diff --git a/app/models/key_pair.rb b/app/models/key_pair.rb index abc1234..def5678 100644 --- a/app/models/key_pair.rb +++ b/app/models/key_pair.rb @@ -4,23 +4,27 @@ project = Project.find(project_id) key_pairs = [] + threads = [] + AWS::Regions.each do |region| + threads << Thread.new(key_pairs, region) { + ec2 = Aws::EC2::Client.new( + access_key_id: project.access_key, + secret_access_key: project.secret_access_key, + region: region + ) + response = ec2.describe_instances + using_keys = response.reservations.map { |e| e.instances[0].key_name } - AWS::Regions.each do |region| - ec2 = Aws::EC2::Client.new( - access_key_id: project.access_key, - secret_access_key: project.secret_access_key, - region: region - ) - response = ec2.describe_instances - using_keys = response.reservations.map { |e| e.instances[0].key_name } + response = ec2.describe_key_pairs + response.key_pairs.each do |key_pair| + using = using_keys.include?(key_pair.key_name) + key_pairs << KeyPair.new(key_pair.key_name, key_pair.key_fingerprint, region, using) + end + } + end + threads.each(&:join) - response = ec2.describe_key_pairs - response.key_pairs.each do |key_pair| - using = using_keys.include?(key_pair.key_name) - key_pairs << KeyPair.new(key_pair.key_name, key_pair.key_fingerprint, region, using) - end - end - key_pairs + key_pairs.sort_by(&:region) end end end
Use thread while retrieving key pairs
diff --git a/lib/multi_logger.rb b/lib/multi_logger.rb index abc1234..def5678 100644 --- a/lib/multi_logger.rb +++ b/lib/multi_logger.rb @@ -2,7 +2,7 @@ module MultiLogger class << self - def add_logger(name, path=nil) + def add_logger(name, path=nil, options={}) name = name.to_s rails_logger_class = get_rails_logger_class() @@ -14,6 +14,9 @@ define_method name.to_sym do logger end + end + if options[:formatter] + logger.formatter = options[:formatter] end logger end
Allow setting formatter to log
diff --git a/lib/mutant/color.rb b/lib/mutant/color.rb index abc1234..def5678 100644 --- a/lib/mutant/color.rb +++ b/lib/mutant/color.rb @@ -3,19 +3,7 @@ module Mutant # Class to colorize strings class Color - include Adamantium::Flat - - # Initialize color object - # - # @param [Fixnum] code - # - # @return [undefined] - # - # @api private - # - def initialize(code) - @code = code - end + include Adamantium::Flat, Concord.new(:color) # Format text with color #
Use concord to simplify Mutant::Color class
diff --git a/lib/qblox/dialog.rb b/lib/qblox/dialog.rb index abc1234..def5678 100644 --- a/lib/qblox/dialog.rb +++ b/lib/qblox/dialog.rb @@ -1,9 +1,11 @@ module Qblox class Dialog < Qblox::Base - attr_accessor(:_id, :accessible_for_ids, :created_at, :last_message, + ATTRIBUTES = [:_id, :accessible_for_ids, :created_at, :last_message, :last_message_date_sent, :last_message_user_id, :name, :occupants_ids, :photo, :type, :updated_at, :user_id, - :xmpp_room_jid, :unread_messages_count) + :xmpp_room_jid, :unread_messages_count] + + attr_accessor(*ATTRIBUTES) def messages(token: nil, options: {}) return @messages unless @messages.nil? || options != {} @@ -11,6 +13,12 @@ messages = Qblox::Message::Collection.new(messages, token: token || @token) @messages = messages unless options != {} messages + end + + def attributes + ATTRIBUTES.each_with_object({}) do |key, hash| + hash[key] = send(key) + end end class Collection < Array
Enable to export to hash object attributes
diff --git a/lib/serf/message.rb b/lib/serf/message.rb index abc1234..def5678 100644 --- a/lib/serf/message.rb +++ b/lib/serf/message.rb @@ -45,8 +45,12 @@ module ClassMethods - def parse(*args) - self.new *args + def parse(*args, &block) + self.new *args, &block + end + + def build(*args, &block) + self.new *args, &block end end
Add 'build' method to be equivilant to 'parse' to Messages. Details: * Currently, some places we want to 'parse' a message, and it makes more sense (sugar) to 'build' a message. They currently do the same thing. * In the future, maybe figure out a semantic difference between building a message and parsing a message in the Serf case. * Fixed to also pass a block to the initialize.
diff --git a/bankscrap-bbva.gemspec b/bankscrap-bbva.gemspec index abc1234..def5678 100644 --- a/bankscrap-bbva.gemspec +++ b/bankscrap-bbva.gemspec @@ -17,7 +17,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "bankscrap", "0.0.17" + spec.add_dependency "bankscrap", "~> 1.0" spec.add_development_dependency "bundler", "~> 1.7" spec.add_development_dependency "rake", "~> 10.0" end
Update bankscrap gem dependency version
diff --git a/db/migrate/20100530205942_update_link_url_on_pages_from_inquiries_new_to_contact.rb b/db/migrate/20100530205942_update_link_url_on_pages_from_inquiries_new_to_contact.rb index abc1234..def5678 100644 --- a/db/migrate/20100530205942_update_link_url_on_pages_from_inquiries_new_to_contact.rb +++ b/db/migrate/20100530205942_update_link_url_on_pages_from_inquiries_new_to_contact.rb @@ -6,7 +6,7 @@ :menu_match => "^/(inquiries|contact).*$" }) end - Page.find_all_by_menu_match('^/inquiries/thank_you$') do |page| + Page.find_all_by_menu_match('^/inquiries/thank_you$').each do |page| page.update_attributes({ :link_url => '/contact/thank_you', :menu_match => '^/(inquiries|contact)/thank_you$' @@ -15,7 +15,7 @@ end def self.down - Page.find_all_by_link_url('/contact/thank_you') do |page| + Page.find_all_by_link_url('/contact/thank_you').each do |page| page.update_attributes({ :link_url => nil, :menu_match => '^/inquiries/thank_you$'
Update thank_you page attributes correctly
diff --git a/Inline.podspec b/Inline.podspec index abc1234..def5678 100644 --- a/Inline.podspec +++ b/Inline.podspec @@ -2,7 +2,7 @@ s.name = 'Inline' s.version = '0.1.0' s.license = 'MIT' - s.platform = :ios, '4.3' + s.platform = :ios, '5.0' s.summary = "Extends SenTestCase to allow for easier implementation of alternative DSLs." s.homepage = 'https://github.com/rdavies/Inline' s.author = { 'Ryan Davies' => 'ryan@ryandavies.net' }
Set minimum deployment target to 5.0. This is in order to use automated __weak references. This would be an issue, but as a testing library there is little reason to support specific iOS versions.
diff --git a/valorebooks.gemspec b/valorebooks.gemspec index abc1234..def5678 100644 --- a/valorebooks.gemspec +++ b/valorebooks.gemspec @@ -19,6 +19,7 @@ spec.require_paths = ["lib"] spec.add_dependency "rest-client" + spec.add_dependency "multi_xml" spec.add_development_dependency "bundler", "~> 1.7" spec.add_development_dependency "rake", "~> 10.0"
Add multi_xml to gem dep in gemspec
diff --git a/lib/console.rb b/lib/console.rb index abc1234..def5678 100644 --- a/lib/console.rb +++ b/lib/console.rb @@ -27,14 +27,18 @@ puts "Invalid input try again" end - def display_winner_message(rules, game_being_played) - if rules.winning_indices(game_being_played, "X") - puts "X won!" - elsif rules.winning_indices(game_being_played, "O") - puts "O won!" - elsif rules.draw?(game_being_played, game_being_played.turn) - puts "It's a draw!" - end + # def display_winner_message(rules, game_being_played) + # if rules.winning_indices(game_being_played, "X") + # puts "X won!" + # elsif rules.winning_indices(game_being_played, "O") + # puts "O won!" + # elsif rules.draw?(game_being_played, game_being_played.turn) + # puts "It's a draw!" + # end + # end + + def display_results(message) + puts "#{message}" end end
Refactor to only display message and not calculate who won
diff --git a/test/fixtures/cookbooks/newrelic_lwrp_test/recipes/agent_php.rb b/test/fixtures/cookbooks/newrelic_lwrp_test/recipes/agent_php.rb index abc1234..def5678 100644 --- a/test/fixtures/cookbooks/newrelic_lwrp_test/recipes/agent_php.rb +++ b/test/fixtures/cookbooks/newrelic_lwrp_test/recipes/agent_php.rb @@ -6,6 +6,8 @@ # include_recipe 'apache2' + +node.set['php']['pear'] = 'pear' include_recipe 'php' newrelic_agent_php 'Install' do
Fix CI build by putting a temporary workaround in place for the PHP cookbook
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,5 @@+# Encoding: utf-8 +# Application controller class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead.
Clean up application controller script
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -13,7 +13,7 @@ auth_token = request.headers['Authorization'] if auth_token - authenticate_with_auth_token auth_token + authenticate_with_auth_token(auth_token) else authentication_error end @@ -21,11 +21,11 @@ private - def authenticate_with_auth_token auth_token + def authenticate_with_auth_token(auth_token) user = User.find_by(access_token: auth_token) if user && Devise.secure_compare(user.access_token, auth_token) - sign_in user, store: false + sign_in(user, store: false) else authentication_error end
CR: Add parens to auth methods
diff --git a/app/controllers/memberships_controller.rb b/app/controllers/memberships_controller.rb index abc1234..def5678 100644 --- a/app/controllers/memberships_controller.rb +++ b/app/controllers/memberships_controller.rb @@ -8,8 +8,10 @@ end def create - group_id = JSON.parse(params["groupId"]) - username = JSON.parse(params["username"]) + puts params + # Parameters: {"{\"username\":\"paul\",\"groupId\":4}"=>nil} + group_id = JSON.parse(params.keys[0]["groupId"]) + username = JSON.parse(params.keys[0]["username"]) @user = User.find_by(username: username) if @membership.save render json: @user
Fix json parse in memberships controller
diff --git a/app/controllers/setup/seeds_controller.rb b/app/controllers/setup/seeds_controller.rb index abc1234..def5678 100644 --- a/app/controllers/setup/seeds_controller.rb +++ b/app/controllers/setup/seeds_controller.rb @@ -4,7 +4,7 @@ project_anchor = current_user.program.project_anchor project_factory = ProjectFactory.new suffix = Time.now.to_s[0..15] + " - " - project = ProjectFactory.new.build( + project = project_factory.build( dhis2_url: params[:local] ? "http://127.0.0.1:8085/" : "https://play.dhis2.org/demo", user: "admin", password: "district", @@ -23,17 +23,4 @@ flash[:notice] = " created package and rules for #{suffix} : #{project.packages.map(&:name).join(', ')}" redirect_to root_path end - - def update_package_with_dhis2(package, suffix, states, groups, acitivity_ids) - package.name += suffix - package.states = states - groups.each_with_index do |group, index| - peg = package.package_entity_groups[index] - group.each do |k, v| - peg[k] = v - end - end - created_ged = package.create_data_element_group(acitivity_ids) - package.data_element_group_ext_ref = created_ged.id - end end
Remove unused method and don't re-instantiate project_factory object
diff --git a/lib/ive/xcode.rb b/lib/ive/xcode.rb index abc1234..def5678 100644 --- a/lib/ive/xcode.rb +++ b/lib/ive/xcode.rb @@ -12,14 +12,20 @@ end def initial_config - if project.targets.count > 0 && (target = project.targets.first) - if target.configs.count > 0 && (config = target.configs.first) - { target: target.name, configuration: config.name } + config_hash = {} + project.targets.each do |target| + if target.configs.count > 0 + config_hash[target.name] = target.configs.map(&:name) else puts "-- No configurations found for target '#{target.name}' in the current project" end + end + + if config_hash.empty? + puts "-- No targets found in the current project" + nil else - puts "-- No targets found in the current project" + config_hash end end
Refactor the initial configuration generation with multiple targets.
diff --git a/lib/sg_mailer.rb b/lib/sg_mailer.rb index abc1234..def5678 100644 --- a/lib/sg_mailer.rb +++ b/lib/sg_mailer.rb @@ -8,14 +8,12 @@ module SGMailer extend self attr_accessor :client + attr_accessor :delivery_processor - def configure(test_client: false, **options) - self.client = - if test_client - TestClient.new - else - Client.new(**options) - end + def configure(delivery_processor: MessageDelivery, + test_client: false, **client_options) + self.client = test_client ? TestClient.new : Client.new(**options) + self.delivery_processor = delivery_processor || MessageDelivery end def send(mail)
Add an option to configure the delivery processor
diff --git a/lib/rodt/image.rb b/lib/rodt/image.rb index abc1234..def5678 100644 --- a/lib/rodt/image.rb +++ b/lib/rodt/image.rb @@ -9,11 +9,15 @@ def valid? if @valid.nil? File.open(source, "rb") do |io| - dim = Dimensions(io) + Dimensions(io) - dim.send :peek + # Interacting with Dimensions::Reader directly to + # + # a) avoid reading the file multiple times + # b) get type info - reader = dim.instance_variable_get :@reader + io.send :peek + reader = io.instance_variable_get :@reader if reader.type @type = reader.type
Fix usage of Dimension API Dimensions() extends parameter, so there’s no need to assign another local var. Adding comment on why we’re messing with Dimensions’ internals
diff --git a/solr_wrapper.gemspec b/solr_wrapper.gemspec index abc1234..def5678 100644 --- a/solr_wrapper.gemspec +++ b/solr_wrapper.gemspec @@ -13,6 +13,7 @@ spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0") + spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"]
Set the bindir to exe
diff --git a/lib/tasks/ip.rake b/lib/tasks/ip.rake index abc1234..def5678 100644 --- a/lib/tasks/ip.rake +++ b/lib/tasks/ip.rake @@ -0,0 +1,14 @@+# frozen_string_literal: true + +namespace :ip do + desc 'Validates all IPs in DB' + task validate: :environment do + Ad.find_each do |ad| + ip = ad.ip + next if ip.nil? || IPAddress.valid?(ip) + + valid_ip = ip.split(',').map(&:strip).find { |s| IPAddress.valid?(s) } + ad.update!(ip: valid_ip) + end + end +end
Add a rake task to fix most invalid IPs in DBs It looks like previously if one of the headers of the request had comma separated values, the field would be incorrectly parsed and invalid data would be stored in DB. Fix those values.
diff --git a/spec/default_spec.rb b/spec/default_spec.rb index abc1234..def5678 100644 --- a/spec/default_spec.rb +++ b/spec/default_spec.rb @@ -18,5 +18,12 @@ it 'creates /etc/security/keytabs directory' do expect(chef_run).to create_directory('/etc/security/keytabs') end + + %w(kdestroy kinit-as-admin-user).each do |exec| + it "executes #{exec} resource" do + expect(chef_run).to run_execute(exec) + end + end + end end
Add tests for execute resources
diff --git a/lib/fivemat/spec.rb b/lib/fivemat/spec.rb index abc1234..def5678 100644 --- a/lib/fivemat/spec.rb +++ b/lib/fivemat/spec.rb @@ -2,6 +2,8 @@ module Fivemat class Spec < ::Spec::Runner::Formatter::ProgressBarFormatter + include ElapsedTime + def initialize(*) super @dumping = false @@ -20,12 +22,14 @@ @last_root_example_group = example_group_proxy example_group_finished(example_group_proxy) unless @example_group_number == 1 output.print "#{example_group_proxy.nested_descriptions.first} " + @start_time = Time.now end @last_nested_descriptions = example_group_proxy.nested_descriptions end def example_group_finished(example_group_proxy) + print_elapsed_time output, @start_time puts @failed_examples.each_with_index do |example, index|
Support elapsed time in RSpec 1 formatter.
diff --git a/spec/mactag/config_spec.rb b/spec/mactag/config_spec.rb index abc1234..def5678 100644 --- a/spec/mactag/config_spec.rb +++ b/spec/mactag/config_spec.rb @@ -26,7 +26,17 @@ it 'should be configurable' do Mactag.configure do |config| config.should == Mactag::Config + + config.binary = 'binary {INPUT} {OUTPUT}' + config.tags_file = 'tags_file' + config.rvm = false + config.gem_home = 'gem_home' end + + Mactag::Config.binary.should == 'binary {INPUT} {OUTPUT}' + Mactag::Config.tags_file.should == 'tags_file' + Mactag::Config.rvm.should == false + Mactag::Config.gem_home.should == 'gem_home' end it "requires '{INPUT}' and '{OUTPUT}' in binary string" do
Make sure config can be changed.
diff --git a/_ext/featured_posts.rb b/_ext/featured_posts.rb index abc1234..def5678 100644 --- a/_ext/featured_posts.rb +++ b/_ext/featured_posts.rb @@ -32,9 +32,22 @@ end end + # Guarantee that each page has a date value for sorting purposes + featured.each do |p| + if p.date.nil? + if ( p.relative_source_path =~ /^#{@path_prefix}\/(20[01][0-9])-([01][0-9])-([0123][0-9])-([^.]+)\..*$/ ) + year = $1 + month = $2 + day = $3 + slug = $4 + puts p.relative_source_path, p.date, year, month, day, slug, p.sequence, File.mtime( p.source_path ) + p.date = DateTime.new( year.to_i, month.to_i, day.to_i ) + end + end + end + # Sort the blog posts most recent to oldest - featured = featured.sort_by{|each| [each.date, each.sequence || 0, File.mtime( each.source_path ), each.slug ]} - + featured = featured.sort_by{|each| [each.date, each.sequence || 0, File.mtime( each.source_path ), each.slug ]}.reverse site[:featured_posts] = featured end
Fix ordering of the featured blog posts
diff --git a/src/bin/word-diff.rb b/src/bin/word-diff.rb index abc1234..def5678 100644 --- a/src/bin/word-diff.rb +++ b/src/bin/word-diff.rb @@ -0,0 +1,54 @@+#! /usr/bin/env ruby + +require 'optparse' + +opts = ARGV.getopts('lh', 'list', 'list1', 'list2', 'help') +opts[:list] = opts['l'] || opts['list'] +opts[:list1] = opts['list1'] +opts[:list2] = opts['list2'] + +opts[:help] = opts['h'] || opts['help'] + +if opts[:help] + puts <<'EOT' +Find words only exists in file1. + + word-diff.rb [--list|--list1|--list2] file1 file2 +EOT + exit +end + +file1 = ARGV[0] +file2 = ARGV[1] + +words1 = File.readlines(file1).map { |line| line.chomp } +words2 = File.readlines(file2).map { |line| line.chomp } + +map1 = Hash[words1.map { |line| [line.chomp.downcase, 1] }] +map2 = Hash[words2.map { |line| [line.chomp.downcase, 1] }] + +count1 = 0 +words1.each do |word| + unless map2[word.downcase] + puts word if opts[:list] or opts[:list1] + count1 += 1 + end +end + +count2 = 0 +words2.each do |word| + unless map1[word.downcase] + puts word if opts[:list] or opts[:list2] + count2 += 1 + end +end + +unless opts[:list] or opts[:list1] or opts[:list2] + puts "File1: #{words1.length}" + puts "File2: #{words2.length}" + percent1 = count1.to_f / words1.length * 100 + percent2 = count2.to_f / words2.length * 100 + + printf("Only in file1: %d (%.2f%%)\n", count1, percent1) + printf("Only in file2: %d (%.2f%%)\n", count2, percent2) +end
Add word list diff command
diff --git a/abstract_class.gemspec b/abstract_class.gemspec index abc1234..def5678 100644 --- a/abstract_class.gemspec +++ b/abstract_class.gemspec @@ -1,4 +1,4 @@-require_relative 'lib/abstract_class/version' +require File.expand_path("../lib/abstract_class/version", __FILE__) Gem::Specification.new do |s| s.name = 'abstract_class'
Use require with expand_path instead of require_relative There was a LoadError while loading abstract_class.gemspec: cannot infer basepath from /home/travis/build/shuber/abstract_class/abstract_class.gemspec:3:in `require_relative'
diff --git a/macos.rb b/macos.rb index abc1234..def5678 100644 --- a/macos.rb +++ b/macos.rb @@ -10,9 +10,21 @@ dep "macos dock configured", :template => "plist" do domain "com.apple.dock" - values "orientation" => "left", "autohide" => true - checks "orientation" => "left", "autohide" => "1" - types Hash.new("string").update("autohide" => "bool") + + values \ + "orientation" => "left", + "autohide" => true, + "show-process-indicators" => false + + checks \ + "orientation" => "left", + "autohide" => "1", + "show-process-indicators" => "0" + + types Hash.new("string").update( + "autohide" => "bool", + "show-process-indicators" => "bool", + ) after { log_shell "Restarting Dock", %{osascript -e 'quit application "Dock"'}
Configure dock’s display of process indicators
diff --git a/lib/kuroko2.rb b/lib/kuroko2.rb index abc1234..def5678 100644 --- a/lib/kuroko2.rb +++ b/lib/kuroko2.rb @@ -7,6 +7,7 @@ require "kuroko2/engine" require "kuroko2/configuration" +require "kuroko2/util/logger" module Kuroko2 class << self
Fix bug: uninitialized constant Util (NameError)
diff --git a/base/app/controllers/groups_controller.rb b/base/app/controllers/groups_controller.rb index abc1234..def5678 100644 --- a/base/app/controllers/groups_controller.rb +++ b/base/app/controllers/groups_controller.rb @@ -18,7 +18,7 @@ def create create! do |success, failure| success.html { - self.current_subject = @group + self.current_subject = resource redirect_to :home } end @@ -37,15 +37,14 @@ # Overwrite resource method to support slug # See InheritedResources::BaseHelpers#resource - def resource - @group ||= end_of_association_chain.find_by_slug!(params[:id]) + def method_for_find + :find_by_slug! end private def set_founder - params[:group] ||= {} - params[:group][:author_id] ||= current_subject.try(:actor_id) - params[:group][:user_author_id] ||= current_user.try(:actor_id) + resource_params.first[:author_id] ||= current_subject.try(:actor_id) + resource_params.first[:user_author_id] ||= current_user.try(:actor_id) end end
Remove references to @group in GroupsController So inherit from the controller is possible
diff --git a/lib/search_index.rb b/lib/search_index.rb index abc1234..def5678 100644 --- a/lib/search_index.rb +++ b/lib/search_index.rb @@ -4,6 +4,6 @@ end def self.rummager_host - Plek.current.find('search') + ENV["RUMMAGER_HOST"] || Plek.current.find('search') end end
Allow rummager host to be set via env
diff --git a/lib/sorted_array.rb b/lib/sorted_array.rb index abc1234..def5678 100644 --- a/lib/sorted_array.rb +++ b/lib/sorted_array.rb @@ -1,6 +1,3 @@- -# TODO: reimplement insert and delete with bsearch - class SortedArray < Array def initialize(*args, &sort_by) @sort_by = sort_by || Proc.new { |x, y| x <=> y } @@ -9,7 +6,7 @@ end def insert(i, v) - insert_before = index(find { |x| @sort_by.call(x, v) == 1 }) + insert_before = bsearch_index { |x| @sort_by.call(x, v) == 1 } super(insert_before ? insert_before : -1, v) end @@ -18,7 +15,6 @@ end alias push << - alias unshift << ["delete_at", "delete"].each do |method_name| module_eval %{ @@ -29,9 +25,6 @@ } end - def reverse! - end - def delete_first delete_at(0) end
Use bsearch to find element's index
diff --git a/pronto-flay.gemspec b/pronto-flay.gemspec index abc1234..def5678 100644 --- a/pronto-flay.gemspec +++ b/pronto-flay.gemspec @@ -23,5 +23,5 @@ s.add_dependency 'pronto', '~> 0.0.3' s.add_dependency 'flay', '~> 2.4.0' s.add_development_dependency 'rake', '~> 10.1.0' - s.add_development_dependency 'rspec', '~> 2.13.0' + s.add_development_dependency 'rspec', '~> 2.14.0' end
Update rspec version to 2.14.0
diff --git a/lib/domgen/auto_bean/model.rb b/lib/domgen/auto_bean/model.rb index abc1234..def5678 100644 --- a/lib/domgen/auto_bean/model.rb +++ b/lib/domgen/auto_bean/model.rb @@ -13,7 +13,7 @@ # module Domgen - FacetManager.facet(:auto_bean => [:jackson, :imit]) do |facet| + FacetManager.facet(:auto_bean => [:gwt]) do |facet| facet.enhance(Repository) do include Domgen::Java::JavaClientServerApplication include Domgen::Java::BaseJavaGenerator
Rework auto_bean to avoid requirement of using imit facet
diff --git a/lib/airports/airport.rb b/lib/airports/airport.rb index abc1234..def5678 100644 --- a/lib/airports/airport.rb +++ b/lib/airports/airport.rb @@ -3,6 +3,7 @@ attr_reader :name, :city, :country, :iata, :icao, :latitude, :longitude, :altitude, :timezone, :dst, :tz_name + # rubocop:disable Metrics/MethodLength def initialize(name:, city:, country:, iata:, icao:, latitude:, longitude:, altitude:, timezone:, dst:, tz_name:) @name = name @@ -17,5 +18,6 @@ @dst = dst @tz_name = tz_name end + # rubocop:enable Metrics/MethodLength end end
Disable Metrics/MethodLength cop for Airport initializer
diff --git a/lib/aruba/in_process.rb b/lib/aruba/in_process.rb index abc1234..def5678 100644 --- a/lib/aruba/in_process.rb +++ b/lib/aruba/in_process.rb @@ -1,11 +1,18 @@ require 'aruba/processes/in_process' +require 'aruba/platform' module Aruba class InProcess < Aruba::Processes::InProcess def initialize(*args) - warn('The use of "Aruba::InProcess" is deprecated. Use "Aruba::Processes::InProcess" instead.') + Aruba::Platform.deprecated('The use of "Aruba::InProcess" is deprecated. Use "Aruba::Processes::InProcess" instead.') super end + + def self.main_class(*args) + Aruba::Platform.deprecated('The use of "Aruba::InProcess" is deprecated. Use "Aruba::Processes::InProcess" instead.') + + Aruba::Processes::InProcess.main_class(*args) + end end end
Make it possible to use oldstyle main_class
diff --git a/lib/active_job/queue_adapters/queue_classic_adapter.rb b/lib/active_job/queue_adapters/queue_classic_adapter.rb index abc1234..def5678 100644 --- a/lib/active_job/queue_adapters/queue_classic_adapter.rb +++ b/lib/active_job/queue_adapters/queue_classic_adapter.rb @@ -5,8 +5,7 @@ class QueueClassicAdapter class << self def queue(job, *args) - qc_queue = QC::Queue.new(job.queue_name) - qc_queue.enqueue("ActiveJob::QueueAdapters::QueueClassicAdapter::JobWrapper.perform", job, *args) + QC::Queue.new(job.queue_name).enqueue("#{JobWrapper.name}.perform", job, *args) end end
Determine full class name dynamically in QC adapter.
diff --git a/lib/tasks/taxonomy/promote_taxon_to_taxonomy_root.rake b/lib/tasks/taxonomy/promote_taxon_to_taxonomy_root.rake index abc1234..def5678 100644 --- a/lib/tasks/taxonomy/promote_taxon_to_taxonomy_root.rake +++ b/lib/tasks/taxonomy/promote_taxon_to_taxonomy_root.rake @@ -0,0 +1,28 @@+namespace :taxonomy do + desc "Promote a taxon to become a taxonomy root" + task :promote_taxon_to_taxonomy_root, [:taxon_id] => :environment do |_, args| + taxon_id = args.fetch(:taxon_id) + homepage_content_id = "f3bbdec2-0e62-4520-a7fd-6ffd5d36e03a" + + puts "Promoting content with ID: #{taxon_id} to a taxonomic root node." + + begin + homepage_links = Services.publishing_api.get_links( + homepage_content_id + ) + + root_taxons = homepage_links['links'].fetch('root_taxons', []) + root_taxons << taxon_id + + Services.publishing_api.patch_links( + homepage_content_id, + links: { root_taxons: root_taxons.uniq }, + ) + + puts '✅ OK' + rescue GdsApi::BaseError => e + puts "❌ FAILURE #{e.code}" + exit(1) + end + end +end
Add task to create a new taxonomy tree Run this `rake` task with the content_id of a taxon node as an argument. It will patch this content_item, setting the Homepage `/` as it's parent taxon. Causing the chosen taxon to become the root node of a top level taxonomy tree.
diff --git a/config/initializers/delayed_job_config.rb b/config/initializers/delayed_job_config.rb index abc1234..def5678 100644 --- a/config/initializers/delayed_job_config.rb +++ b/config/initializers/delayed_job_config.rb @@ -6,7 +6,7 @@ Delayed::Worker.destroy_failed_jobs = false Delayed::Worker.sleep_delay = 2 Delayed::Worker.max_attempts = 3 -Delayed::Worker.max_run_time = 30.minutes +Delayed::Worker.max_run_time = 1500.minutes Delayed::Worker.read_ahead = 10 Delayed::Worker.default_queue_name = 'default' Delayed::Worker.raise_signal_exceptions = :term
Increase delayed jobs max run time
diff --git a/Casks/apm-planner.rb b/Casks/apm-planner.rb index abc1234..def5678 100644 --- a/Casks/apm-planner.rb +++ b/Casks/apm-planner.rb @@ -2,6 +2,7 @@ version '2.0.20' sha256 '2635f4d66dc4290a0f816bad7e6a029ab453385710fff428128f4bbf6926ced8' + # diydrones.com was verified as official when first introduced to the cask url "http://firmware.diydrones.com/Tools/APMPlanner/apm_planner_#{version}_osx.dmg" appcast 'http://firmware.diydrones.com/Tools/APMPlanner/apm_planner_version.json', checkpoint: '3abbf4b7115646de8e41d974731c2697b59c34c0a6761de7220aaaa3c82d2d73'
Fix `url` stanza comment for APM Planner.
diff --git a/Casks/mattr-slate.rb b/Casks/mattr-slate.rb index abc1234..def5678 100644 --- a/Casks/mattr-slate.rb +++ b/Casks/mattr-slate.rb @@ -1,6 +1,6 @@ cask :v1 => 'mattr-slate' do version '1.2.0' - sha256 '8d5405e9469ac7d1bfd8defe1e8661dedea50e6a' + sha256 'd409ccda9ed09f5647175f8834650e141a7375ced9665bf6af237525665d4966' # github.com is the official download host for this fork # see https://github.com/mattr-/slate/commit/148a51e50174c946c07c801a9f2b92222a4c0276
Fix checksum in mattr-/Slate.app Cask I've used `shasum` instead `shasum -a 256` when I did #9756 This time it should be good. Sorry for that !
diff --git a/cookbooks/oozie/attributes/default.rb b/cookbooks/oozie/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/oozie/attributes/default.rb +++ b/cookbooks/oozie/attributes/default.rb @@ -8,9 +8,9 @@ # hive cluster attributes -default[:oozie][:default][:path] = '/usr/share/oozie' -default[:oozie[:default][:version] = '3.2.0' -default[:oozie][:default][:download_url] = 'http://repo.staging.dmz/repo/linux/oozie/oozie-3.2.0-incubating.tar.gz' +default['oozie']['default']['path'] = '/usr/share/oozie' +default['oozie']['default']['version'] = '3.2.0' +default['oozie']['default']['download_url'] = 'http://repo.staging.dmz/repo/linux/oozie/oozie-3.2.0-incubating.tar.gz' # oozie-site.xml
Add missing bracket in the oozie cookbook that failed the ruby check and switch to strings
diff --git a/config/initializers/0_settings.rb b/config/initializers/0_settings.rb index abc1234..def5678 100644 --- a/config/initializers/0_settings.rb +++ b/config/initializers/0_settings.rb @@ -1,7 +1,7 @@ filename = File.join(Rails.root, "config/settings.yml") if File.exist?(filename) - Rails.configuration.settings = YAML.load(File.read(filename))[Rails.env] + Rails.configuration.settings = YAML.load(File.read(filename))[Rails.env].with_indifferent_access else Rails.logger.fatal "Could not find config/settings.yml." Rails.configuration.settings = {}
Access settings with indifferent access.
diff --git a/config/initializers/dev_server.rb b/config/initializers/dev_server.rb index abc1234..def5678 100644 --- a/config/initializers/dev_server.rb +++ b/config/initializers/dev_server.rb @@ -1,6 +1,6 @@-require_dependency "#{Rails.root}/lib/development/dev_server_proxy" host = Features.hot_loading? && Rails.env.development? ? "localhost:8080" : "localhost:3000" if not Rails.env.production? + require_dependency "#{Rails.root}/lib/development/dev_server_proxy" Rails.application.config.middleware.use WebpackDevServerProxy, dev_server_host: host end
Fix dev proxy server initializer In production, Rack::Proxy is not available, so requiring it will cause an error. I hit an error while trying to do a Capistrano deployment. Doing the require only in non-production environments should fix it.
diff --git a/lib/minitest/context.rb b/lib/minitest/context.rb index abc1234..def5678 100644 --- a/lib/minitest/context.rb +++ b/lib/minitest/context.rb @@ -3,7 +3,7 @@ module MiniTest::Context class << self - attr_accessor :list + attr_reader :list def define name, &block (@list ||= {})[name] = block @@ -11,4 +11,3 @@ end end -
Replace attr_accessor :list with attr_reader :list
diff --git a/lib/mytime/timesheet.rb b/lib/mytime/timesheet.rb index abc1234..def5678 100644 --- a/lib/mytime/timesheet.rb +++ b/lib/mytime/timesheet.rb @@ -1,5 +1,10 @@ module Mytime extend self + + def status + user = `git config --get user.name` + system("git log --oneline --author='#{user}' --since='6am'") + end def commit(message = "") puts "added: #{message.to_s}"
Add status command that returns formatted log of commits from today
diff --git a/lib/project-honeypot.rb b/lib/project-honeypot.rb index abc1234..def5678 100644 --- a/lib/project-honeypot.rb +++ b/lib/project-honeypot.rb @@ -3,8 +3,25 @@ require File.dirname(__FILE__) + "/project_honeypot/base.rb" module ProjectHoneypot - def self.lookup(api_key, url) - searcher = Base.new(api_key) + class << self + attr_accessor :api_key + + def api_key + raise "ProjectHoneypot really needs its api_key set to work" unless @api_key + @api_key + end + + def configure(&block) + class_eval(&block) + end + end + + def self.lookup(api_key_or_url, url=nil) + if url.nil? + url = api_key_or_url + api_key_or_url = ProjectHoneypot.api_key + end + searcher = Base.new(api_key_or_url) searcher.lookup(url) end end
Add configuration class and modify lookup to use this configuration To configure the module, you can use : ProjectHoneypot.configure do @api_key = 'API_KEY' end To access, the variable, use : ProjectHoneypot.api_key The lookup method has been modified to be backward compatible and use the defined api_key if available.
diff --git a/examples/multi/main_bar.rb b/examples/multi/main_bar.rb index abc1234..def5678 100644 --- a/examples/multi/main_bar.rb +++ b/examples/multi/main_bar.rb @@ -8,8 +8,6 @@ bar2 = bars.register "bar [:bar] :percent", total: 15 bar3 = bars.register "baz [:bar] :percent", total: 45 -bars.start - th1 = Thread.new { 15.times { sleep(0.1); bar1.advance } } th2 = Thread.new { 15.times { sleep(0.1); bar2.advance } } th3 = Thread.new { 45.times { sleep(0.1); bar3.advance } }
Change to remove no longer needed start
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,6 @@ Qunit::Rails::Engine.routes.draw do root to: 'test#index' + match ':action', controller: 'test' end Rails.application.routes.draw do
Allow for arbitrary test suites
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,6 +9,7 @@ get 'users/:user_id/questions/:id', :to => 'questions#destroy' + post '/users', :to => 'users#edit' resources :users, only: [:index, :new, :show, :create, :edit] do resources :questions, only: [:index, :show, :new, :create, :destroy, :edit] do
Add custom route for user registration
diff --git a/Formula/s3-backer.rb b/Formula/s3-backer.rb index abc1234..def5678 100644 --- a/Formula/s3-backer.rb +++ b/Formula/s3-backer.rb @@ -6,16 +6,18 @@ sha1 'badc003ffb0830a3fa59c9f39f13ad94729cbcf1' depends_on 'pkg-config' => :build + depends_on 'fuse4x' def install + inreplace "configure", "-lfuse", "-lfuse4x" system "./configure", "--prefix=#{prefix}" system "make install" end def caveats <<-EOS.undent - This depends on the MacFUSE installation from http://code.google.com/p/macfuse/ - MacFUSE must be installed prior to installing this formula. + Make sure to follow the directions given by `brew info fuse4x-kext` + before trying to use a FUSE-based filesystem. EOS end end
s3backer: Use fuse4x as a default FUSE provider Closes Homebrew/homebrew#6079. Closes Homebrew/homebrew#7712. Signed-off-by: Charlie Sharpsteen <828d338a9b04221c9cbe286f50cd389f68de4ecf@sharpsteen.net>
diff --git a/activerecord/lib/active_record/type/integer.rb b/activerecord/lib/active_record/type/integer.rb index abc1234..def5678 100644 --- a/activerecord/lib/active_record/type/integer.rb +++ b/activerecord/lib/active_record/type/integer.rb @@ -13,7 +13,8 @@ end def type_cast_from_database(value) - value.to_i unless value.nil? + return if value.nil? + value.to_i end protected
:nail_care: Put escape clause first, keeps @sgrif happy :grin: See comment on 6f7910a
diff --git a/limit_detectors.gemspec b/limit_detectors.gemspec index abc1234..def5678 100644 --- a/limit_detectors.gemspec +++ b/limit_detectors.gemspec @@ -19,8 +19,8 @@ spec.require_paths = ["lib"] spec.add_development_dependency 'bundler' - spec.add_development_dependency 'rake', '~> 11.2' - spec.add_development_dependency 'rspec', '~> 3.5' + spec.add_development_dependency 'rake', '~> 12.0' + spec.add_development_dependency 'rspec', '~> 3.6' spec.add_development_dependency 'pry', '~> 0.10' spec.add_development_dependency 'pry-doc' end
Bump Rake & RSpec versions
diff --git a/app/controllers/api/github_users_controller.rb b/app/controllers/api/github_users_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/github_users_controller.rb +++ b/app/controllers/api/github_users_controller.rb @@ -12,7 +12,9 @@ end def projects - @projects = @github_user.projects.joins(:github_repository).includes(:versions).order('projects.rank DESC, projects.created_at DESC').paginate(page: page_number) + scope = @github_user.projects.joins(:github_repository).includes(:versions).order('projects.rank DESC, projects.created_at DESC') + scope = scope.keyword(params[:keyword]) if params[:keyword].present? + @projects = scope.paginate(page: page_number) render json: @projects.paginate(page: page_number, per_page: per_page_number) end
Add keyword filter parameter to user projects api
diff --git a/validate_as_email.gemspec b/validate_as_email.gemspec index abc1234..def5678 100644 --- a/validate_as_email.gemspec +++ b/validate_as_email.gemspec @@ -8,8 +8,9 @@ gem.summary = %q{The ultimate Rails 3 email validator. Powered by the Mail gem.} gem.homepage = 'https://github.com/evently/mail_validator' - gem.files = Dir['lib/**/*.rb'] << 'README.md' - gem.test_files = Dir['spec/**/*_spec.rb'] + gem.files = Dir['lib/**/*'] + ['README.md', 'LICENSE'] + gem.test_files = Dir['{features,spec}/**/*'] + gem.name = 'validate_as_email' gem.require_paths = ['lib'] gem.version = ValidateAsEmail::VERSION
Add license, and all of features and spec to manifest
diff --git a/Framer.podspec b/Framer.podspec index abc1234..def5678 100644 --- a/Framer.podspec +++ b/Framer.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Framer' - s.version = '1.5.0' + s.version = '1.5.1' s.summary = 'Comfortable syntax for working with frames' s.description = <<-DESC Framer is a good framework which wraps working with frames with a nice chaining syntax.
Change podspec version -> 1.5.1
diff --git a/activestorage/lib/active_storage/downloading.rb b/activestorage/lib/active_storage/downloading.rb index abc1234..def5678 100644 --- a/activestorage/lib/active_storage/downloading.rb +++ b/activestorage/lib/active_storage/downloading.rb @@ -11,7 +11,7 @@ end end - # Efficiently download blob data into the given file. + # Efficiently downloads blob data into the given file. def download_blob_to(file) # :doc: file.binmode blob.download { |chunk| file.write(chunk) }
Use the indicative mood consistently [ci skip]
diff --git a/ParallaxView.podspec b/ParallaxView.podspec index abc1234..def5678 100644 --- a/ParallaxView.podspec +++ b/ParallaxView.podspec @@ -6,7 +6,7 @@ s.summary = "Add parallax effect like in tvOS applications to any view." s.requires_arc = true s.license = "MIT" - s.version = "2.0.2" + s.version = "2.0.3" s.license = { :type => "MIT", :file => "LICENSE" } s.author = { "[Łukasz Śliwiński]" => "[lsliwinski@pgs-soft.com]" } s.homepage = "https://github.com/PGSSoft/ParallaxView"
Update podspec to the new version.
diff --git a/app/controllers/kuhsaft/cms/admin_controller.rb b/app/controllers/kuhsaft/cms/admin_controller.rb index abc1234..def5678 100644 --- a/app/controllers/kuhsaft/cms/admin_controller.rb +++ b/app/controllers/kuhsaft/cms/admin_controller.rb @@ -10,13 +10,6 @@ I18n.locale = params[:content_locale] end end - - def current_admin - dummy = "" - def dummy.cms_locale - :de - end - end end end end
Revert "add dummy stub to access cms_locale" This reverts commit ee992332193e994c1afc716e46d3aba3c1bcc320.
diff --git a/app/workers/check_gcp_project_billing_worker.rb b/app/workers/check_gcp_project_billing_worker.rb index abc1234..def5678 100644 --- a/app/workers/check_gcp_project_billing_worker.rb +++ b/app/workers/check_gcp_project_billing_worker.rb @@ -1,7 +1,7 @@ class CheckGcpProjectBillingWorker include ApplicationWorker - LEASE_TIMEOUT = 1.minute.to_i + LEASE_TIMEOUT = 15.seconds.to_i def self.redis_shared_state_key_for(token) "gitlab:gcp:#{token}:billing_enabled"
Change CheckGcpProjectBillingWorker lease to 15s
diff --git a/mixlib-shellout.gemspec b/mixlib-shellout.gemspec index abc1234..def5678 100644 --- a/mixlib-shellout.gemspec +++ b/mixlib-shellout.gemspec @@ -5,7 +5,6 @@ s.name = 'mixlib-shellout' s.version = Mixlib::ShellOut::VERSION s.platform = Gem::Platform::RUBY - s.has_rdoc = true s.extra_rdoc_files = ["README.md", "LICENSE" ] s.summary = "Run external commands on Unix or Windows" s.description = s.summary
Remove call to deprecated has_rdoc.
diff --git a/cogi_phony.gemspec b/cogi_phony.gemspec index abc1234..def5678 100644 --- a/cogi_phony.gemspec +++ b/cogi_phony.gemspec @@ -20,6 +20,6 @@ spec.required_ruby_version = '>= 2.0.0' spec.add_development_dependency 'bundler', '~> 1.3' - spec.add_development_dependency 'rake' - spec.add_development_dependency 'rspec' + spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rspec', '~> 2.0' end
Update dependency versions for rake and rspec
diff --git a/computable.gemspec b/computable.gemspec index abc1234..def5678 100644 --- a/computable.gemspec +++ b/computable.gemspec @@ -20,4 +20,5 @@ spec.add_development_dependency "bundler", "~> 1.4" spec.add_development_dependency "rake" + spec.add_development_dependency "minitest", "~> 5.5.1" end
Add minitest as development dependency.
diff --git a/octopi.gemspec b/octopi.gemspec index abc1234..def5678 100644 --- a/octopi.gemspec +++ b/octopi.gemspec @@ -2,8 +2,9 @@ Gem::Specification.new do |s| s.name = %q{octopi} - s.version = "0.0.1" + s.version = "0.0.2" + s.add_dependency 'httparty', '>=0.4.2' s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Felipe Coury"] s.date = %q{2009-04-19}
Add 'httparty' as a dependency in the gemspec. The 'httparty' gem is required by this library but not in the gemspec. Fixed this by adding an explicit dependency for the current version. If prior versions will also work, this version number requirement can be relaxed. Bumped the version number to force rebuilding of the gem.
diff --git a/tafinder/db/seeds.rb b/tafinder/db/seeds.rb index abc1234..def5678 100644 --- a/tafinder/db/seeds.rb +++ b/tafinder/db/seeds.rb @@ -5,3 +5,10 @@ # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) + +users = User.create([ + { + email: "admin@admin.com", + password: "password" + } +])
Create admin user during seed process
diff --git a/init.rb b/init.rb index abc1234..def5678 100644 --- a/init.rb +++ b/init.rb @@ -5,7 +5,7 @@ Tog::Plugins.settings :tog_vault, :public_prefix => "cms" Dir[File.dirname(__FILE__) + '/locale/**/*.yml'].each do |file| - I18n.load_translations file + I18n.load_path << file end Tog::Plugins.helpers Vault::PageHelper
Introduce I18n.load_path in favor of I18n.load_translations
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -17,6 +17,13 @@ post "/update_public" do if params[:token] == ENV["token"] + payload = params[:payload] + + unless master_branch?(payload) + Rails.logger.info "WEBHOOK: Payload was not for master, aborting." + return + end + "Hey, you did it!" else "Tokens didn't match!" @@ -25,9 +32,24 @@ post "/update_private" do if params[:token] == ENV["token"] + payload = params[:payload] + + unless master_branch?(payload) + Rails.logger.info "WEBHOOK: Payload was not for master, aborting." + return + end + "Hey, you did it, privately!" else "Tokens didn't match!" end end + + helpers do + + master_branch?(payload) + payload["ref"] == "refs/heads/master" + end + + end end
Check (and process) against the master branch only
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -6,11 +6,21 @@ base_url = '' get '/' do - Net::HTTP.post_form(URI.parse( + + # do a YoAll + status = Net::HTTP.post_form(URI.parse( 'https://api.justyo.co/yoall/'), { 'api_token' => ENV['YO_KEY'], 'link' => 'http://yotext.co/show/?text=COFFEE TIME?' } ) + + # terse status response + if status + 'success' + else + 'failed to YoAll' + end + end
Hide inner workings from output, just in case
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -5,6 +5,8 @@ require 'rubygems' require 'ramaze' +require 'digest/sha1' +require 'cgi' require 'json' # Make sure that Ramaze knows where you are
Add SHA1 and CGI libs.
diff --git a/cookbooks/lib/features/xserver_spec.rb b/cookbooks/lib/features/xserver_spec.rb index abc1234..def5678 100644 --- a/cookbooks/lib/features/xserver_spec.rb +++ b/cookbooks/lib/features/xserver_spec.rb @@ -8,8 +8,9 @@ its(:exit_status) { should eq 0 } end - describe command('DISPLAY=:99.0 xvfb-run xdpyinfo'), dev: true do + describe command('DISPLAY=:98.0 xvfb-run xdpyinfo'), dev: true do its(:stdout) { should match(/^\s+GLX$/) } + its(:stderr) { should be_empty } its(:exit_status) { should eq 0 } end end
Use separate DISPLAY for xvfb-run
diff --git a/gem/lib/rubygems_plugin.rb b/gem/lib/rubygems_plugin.rb index abc1234..def5678 100644 --- a/gem/lib/rubygems_plugin.rb +++ b/gem/lib/rubygems_plugin.rb @@ -2,8 +2,6 @@ require 'rubygems/command_manager' require 'commands/abstract_command' -require 'net/http' -require 'net/https' %w[migrate owner push tumble].each do |command| require "commands/#{command}"
Remove requires for Net libraries from plugin
diff --git a/pieces.rb b/pieces.rb index abc1234..def5678 100644 --- a/pieces.rb +++ b/pieces.rb @@ -1,4 +1,19 @@ class Piece + DELTAS = { + diagonals: [ + [-1, -1], + [ 1, 1], + [ 1, -1], + [-1, 1] + ], + cardinals: [ + [ 1, 0], + [ 0, 1], + [-1, 0], + [ 0, -1] + ] + } + attr_accessor :pos def initialize(starting_pos, board)
Add diagonal and cardinal deltas