diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/kafka_connection.rb b/lib/kafka_connection.rb index abc1234..def5678 100644 --- a/lib/kafka_connection.rb +++ b/lib/kafka_connection.rb @@ -5,7 +5,7 @@ require "kafka_connection/pool" module KafkaConnection - def self.new(app_name:, env_name:, pool_idx:) + def self.new(app_name:, env_name:, pool_idx: 0) Connection.new(app_name: app_name, env_name: env_name, pool_idx: pool_idx) end
Fix required variable pool_idx that should not be
diff --git a/Formula/jake.rb b/Formula/jake.rb index abc1234..def5678 100644 --- a/Formula/jake.rb +++ b/Formula/jake.rb @@ -0,0 +1,14 @@+require 'formula' + +class Jake <Formula + head 'git://github.com/280north/jake.git' + homepage 'http://github.com/280north/jake' + + depends_on 'narwhal' + + def install + libexec.install Dir['*'] + bin.mkpath + Dir["#{libexec}/bin/*"].each { |d| ln_s d, bin } + end +end
Add Jake build tool formula Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/lib/pod/command/open.rb b/lib/pod/command/open.rb index abc1234..def5678 100644 --- a/lib/pod/command/open.rb +++ b/lib/pod/command/open.rb @@ -5,9 +5,14 @@ self.summary = 'Open the workspace' self.description = <<-DESC Opens the workspace in xcode. If no workspace found in the current directory, - looks up until it finds one. Pass `-a` flag if you want to open in AppCode. + looks up until it finds one. DESC - self.arguments = [['-a', :optional]] + + def self.options + [ + ['-a', 'Open in AppCode.'] + ] + end def initialize(argv) @use_appcode = (argv.shift_argument == '-a')
Use option syntax for '-a'. Fixes a warning with newer versions of CLAide.
diff --git a/lib/sfn-vault/inject.rb b/lib/sfn-vault/inject.rb index abc1234..def5678 100644 --- a/lib/sfn-vault/inject.rb +++ b/lib/sfn-vault/inject.rb @@ -2,31 +2,17 @@ module SparkleAttribute module Aws - require 'vault' - require 'securerandom' - - # Polluting SparkleFormation::SparkleAttribute::Aws namespace ? - include SfnVault::Utils - - # example usage: vault_parameter!(:masterpassword) - def _vault_parameter(*vp_args) - vp_name, vp_opts = vp_args + # A small helper method for adding the specific named + # parameter struct with the custom type + def _vault_parameter(vp_name) __t_stringish(vp_name) - if vp_opts - vp_path = vp_opts[:path] if vp_opts[:path] - end - parameters.set!("vault_parameter_#{vp_name}") do + parameters.set!(vp_name) do no_echo true - description "Automatically generated Vault param #{vp_name}" - type 'String' + description "Generated secret automatically stored in Vault" + type 'Vault::Generic::Secret' end end alias_method :vault_parameter!, :_vault_parameter end end end - -# do stuff -# save to vault cubbyhole/name, ex: cubbyhole/masterpassword -# generate parameter json with NoEcho true -# inject parameter value, see sfn-parameters
Simplify DSL helper method: vault_parameter! This simplifies the vault helper method provided to the template DSL to simply insert a named parameter with a generic description and NoEcho set. This parameter uses a custom type that is not recognized by AWS and will cause a validation error if not replaced. The template callback will handle finding all parameters of this custom type, generating values for them and saving them safely in Vault, either to an appropriate project path or to the cubbyhole for the current token. The type is then converted to 'String' and the value is filled from Vault during stack creation.
diff --git a/Formula/rats.rb b/Formula/rats.rb index abc1234..def5678 100644 --- a/Formula/rats.rb +++ b/Formula/rats.rb @@ -0,0 +1,13 @@+require 'formula' + +class Rats < Formula + url 'http://www.fortify.com/servlet/download/public/rats-2.3.tar.gz' + homepage 'http://www.fortify.com/security-resources/rats.jsp' + md5 '339ebe60fc61789808a457f6f967d226' + + def install + system "./configure", "--disable-debug", "--disable-dependency-tracking", + "--prefix=#{prefix}", "--mandir=#{man}" + system "make install" + end +end
Add a formula for RATS. RATS - Rough Auditing Tool for Security http://www.fortify.com/security-resources/rats.jsp Signed-off-by: Adam Vandenberg <flangy@gmail.com> * Tweaked mandir
diff --git a/lib/util/config_file.rb b/lib/util/config_file.rb index abc1234..def5678 100644 --- a/lib/util/config_file.rb +++ b/lib/util/config_file.rb @@ -16,10 +16,10 @@ end def get(property) - @properties[property] || raise("No #{property} property found in #{@filename}") + return @properties[property] end def port - get('port') + return @properties["port"] end -end +end
Revert "Blow up if we ask for an undefined property, stopping us interpolating madness" This reverts commit 6cc3a2a6ce96103aa857d77a2d94167059410bb6.
diff --git a/lib/web_console/repl.rb b/lib/web_console/repl.rb index abc1234..def5678 100644 --- a/lib/web_console/repl.rb +++ b/lib/web_console/repl.rb @@ -1,39 +1,41 @@ module WebConsole module REPL - class << self - # The adapters registry. - # - # Don't manually alter the registry, use +WebConsole::REPL.register_adapter+. - def adapters - @adapters ||= {} + extend self + + # Registry of REPL implementations mapped to their correspondent adapter + # classes. + # + # Don't manually alter the registry. Use WebConsole::REPL.register_adapter + # for adding entries. + def adapters + @adapters ||= {} + end + + # Register an adapter into the adapters registry. + # + # Registration maps and adapter class to an existing REPL implementation, + # that we call an adaptee constant. If the adaptee constant is not given, + # it is automatically derived from the adapter class name. + # + # For example, adapter named `WebConsole::REPL::IRB` will derive the + # adaptee constant to `::IRB`. + def register_adapter(adapter_class, adaptee_constant = nil) + adaptee_constant ||= derive_adaptee_constant_from(adapter_class) + adapters[adaptee_constant] = adapter_class + end + + # Get the default adapter for the given application. + # + # By default the application will be Rails.application and the adapter + # will be chosen from Rails.application.config.console. + def default(app = Rails.application) + adapters[app.config.console] + end + + private + def derive_adaptee_constant_from(cls, suffix = 'REPL') + "::#{cls.name.split('::').last.gsub(/#{suffix}$/i, '')}".constantize end - - # Register an adapter into the adapters registry. - # - # Registration maps and adapter class to an existing REPL implementation, - # that we call an adaptee constant. If the adaptee constant is not given, - # it is automatically derived from the adapter class name. - # - # For example, adapter named `WebConsole::REPL::IRB` will derive the - # adaptee constant to `::IRB`. - def register_adapter(adapter_class, adaptee_constant = nil) - adaptee_constant ||= derive_adaptee_constant_from(adapter_class) - adapters[adaptee_constant] = adapter_class - end - - # Get the default adapter for the given application. - # - # By default the application will be Rails.application and the adapter - # will be chosen from config.console. - def default(app = Rails.application) - adapters[app.config.console] - end - - private - def derive_adaptee_constant_from(cls, suffix = 'REPL') - "::#{cls.name.split('::').last.gsub(/#{suffix}$/i, '')}".constantize - end - end end end
Drop a level of indentation by extending self
diff --git a/app/helpers/application_helper/button/vm_snapshot_add.rb b/app/helpers/application_helper/button/vm_snapshot_add.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper/button/vm_snapshot_add.rb +++ b/app/helpers/application_helper/button/vm_snapshot_add.rb @@ -1,16 +1,10 @@ class ApplicationHelper::Button::VmSnapshotAdd < ApplicationHelper::Button::Basic def disabled? - @error_message = if records_and_role_allows? && !@active - _('Select the Active snapshot to create a new snapshot for this VM') - else + @error_message = if !role_allows?(:feature => 'vm_snapshot_add') + _('Current user lacks permissions to create a new snapshot for this VM') + elsif !@record.supports_snapshot_create? @record.unsupported_reason(:snapshot_create) end @error_message.present? end - - private - - def records_and_role_allows? - @record.supports_snapshot_create? - end end
Allow user to create snapshot without an active snapshot https://bugzilla.redhat.com/show_bug.cgi?id=1425591
diff --git a/activerecord/test/cases/adapters/sqlite3/sqlite3_create_folder_test.rb b/activerecord/test/cases/adapters/sqlite3/sqlite3_create_folder_test.rb index abc1234..def5678 100644 --- a/activerecord/test/cases/adapters/sqlite3/sqlite3_create_folder_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/sqlite3_create_folder_test.rb @@ -6,13 +6,17 @@ class SQLite3CreateFolder < ActiveRecord::SQLite3TestCase def test_sqlite_creates_directory Dir.mktmpdir do |dir| - dir = Pathname.new(dir) - @conn = Base.sqlite3_connection :database => dir.join("db/foo.sqlite3"), - :adapter => 'sqlite3', - :timeout => 100 + begin + dir = Pathname.new(dir) + @conn = Base.sqlite3_connection :database => dir.join("db/foo.sqlite3"), + :adapter => 'sqlite3', + :timeout => 100 - assert Dir.exist? dir.join('db') - assert File.exist? dir.join('db/foo.sqlite3') + assert Dir.exist? dir.join('db') + assert File.exist? dir.join('db/foo.sqlite3') + ensure + @conn.disconnect! if @conn + end end end end
Fix test failure on Windows When this test was run on Windows, the database file would still be in use, and `File.unlink` would fail. This would cause the temp directory to be unable to be removed, and error out. By disconnecting the connection when finished, we can avoid this error.
diff --git a/elements.gemspec b/elements.gemspec index abc1234..def5678 100644 --- a/elements.gemspec +++ b/elements.gemspec @@ -24,6 +24,7 @@ s.add_dependency 'awesome_nested_set' s.add_dependency 'carrierwave' s.add_dependency 'mini_magick' + s.add_dependency 'devise' s.add_development_dependency 'mysql2' s.add_development_dependency 'rspec-rails'
Add device to gem spec
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -10,6 +10,10 @@ erb :what, :body => "wat" end + get '/greeting' do + erb :what, :body => "Hello #{params["name"]}" + end + get '/' do haml :index, :body => "index" end
Add one more route taking a parameter.
diff --git a/lib/gir_ffi/builders/class_struct_builder.rb b/lib/gir_ffi/builders/class_struct_builder.rb index abc1234..def5678 100644 --- a/lib/gir_ffi/builders/class_struct_builder.rb +++ b/lib/gir_ffi/builders/class_struct_builder.rb @@ -14,16 +14,27 @@ raise "Info does not represent gtype_struct" unless info.gtype_struct? end + private + def superclass @superclass ||= begin - if info.namespace == "GObject" && info.name == "InitiallyUnownedClass" + full_name = info.full_type_name + if full_name == "GObject::InitiallyUnownedClass" GObject::ObjectClass else - parent_field = info.fields.first - parent_info = parent_field.field_type.interface + raise "Unable to calculate parent class for #{full_name}" unless parent_info + Builder.build_class parent_info end + end + end + + def parent_info + @parent_info ||= + begin + parent_field = info.fields.first + parent_field.field_type.interface if parent_field end end
Raise approppriate error when parent class info cannot be found
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index abc1234..def5678 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -0,0 +1,8 @@+Rails.application.config.assets.version = '1.0' + +# Add folder with webpack generated assets to assets.paths +Rails.application.config.assets.paths << Rails.root.join( + 'app', + 'assets', + 'webpack' +)
Make webpack folder visible to rails asset pipeline
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index abc1234..def5678 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -21,4 +21,6 @@ 'vendor' ) -Rails.application.config.assets.precompile << 'moj.slot-picker/dist/stylesheets/**/*.png' +Rails.application.config.assets.precompile << %w(moj.slot-picker/dist/stylesheets/**/*.png + moj.slot-picker/dist/stylesheets/moj.slot-picker.ap + moj.slot-picker/dist/stylesheets/moj.date-slider.ap)
Add slot picker stylesheets to precompile list
diff --git a/config/initializers/paypal.rb b/config/initializers/paypal.rb index abc1234..def5678 100644 --- a/config/initializers/paypal.rb +++ b/config/initializers/paypal.rb @@ -0,0 +1,15 @@+# Fixes the issue about some PayPal requests failing with +# OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=error: certificate verify failed) +module CAFileHack + # This overrides paypal-sdk-core default so we don't pass the cert the gem provides to the + # NET::HTTP instance. This way we rely on the default behavior of validating the server's cert + # against the CA certs of the OS (we assume), which tend to be up to date. + # + # See https://github.com/openfoodfoundation/openfoodnetwork/issues/5855 for details. + def default_ca_file + nil + end +end + +require 'paypal-sdk-merchant' +PayPal::SDK::Core::Util::HTTPHelper.prepend(CAFileHack)
Bring in Paypal certificates hack via new initializer
diff --git a/MiawKit.podspec b/MiawKit.podspec index abc1234..def5678 100644 --- a/MiawKit.podspec +++ b/MiawKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MiawKit' - s.version = 'v1.2' + s.version = '1.2' s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'A set of utilities that gives localization in Objective-C a little more miaw' s.homepage = 'https://github.com/robocat/MiawKit'
Fix that damn version number
diff --git a/specs/ishigaki-internal/controls/tidy_files.rb b/specs/ishigaki-internal/controls/tidy_files.rb index abc1234..def5678 100644 --- a/specs/ishigaki-internal/controls/tidy_files.rb +++ b/specs/ishigaki-internal/controls/tidy_files.rb @@ -45,4 +45,10 @@ end + %w[src.zip demo man sample].each do |cruft| + describe file(cruft) do + it {should_not exist} + end + end + end
Check that Java has been trimmed
diff --git a/web/app.rb b/web/app.rb index abc1234..def5678 100644 --- a/web/app.rb +++ b/web/app.rb @@ -13,10 +13,10 @@ schema_info: Domain.schema_info.first.version, schema_info_metrics: Domain.schema_info_metrics.first.version }, - counts: Domain.entities.inject({}) do |hash, entity| - hash[entity.name] = entity.count - hash - end + # counts: Domain.entities.inject({}) do |hash, entity| + # hash[entity.name] = entity.count + # hash + # end }.to_json end end
Remove the counts for now.
diff --git a/resque-priority_enqueue.gemspec b/resque-priority_enqueue.gemspec index abc1234..def5678 100644 --- a/resque-priority_enqueue.gemspec +++ b/resque-priority_enqueue.gemspec @@ -14,7 +14,6 @@ spec.license = "MIT" spec.add_runtime_dependency "resque", "~> 1.19" - spec.add_runtime_dependency "debugger" spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
Remove debugger as a dependency for this gem
diff --git a/test/server/metrics.rb b/test/server/metrics.rb index abc1234..def5678 100644 --- a/test/server/metrics.rb +++ b/test/server/metrics.rb @@ -12,5 +12,5 @@ errors:0, warnings:0, skips:0, - duration:200, + duration:2, }
Reduce server-test max duration to 2 seconds
diff --git a/ext/edn_turbo/extconf.rb b/ext/edn_turbo/extconf.rb index abc1234..def5678 100644 --- a/ext/edn_turbo/extconf.rb +++ b/ext/edn_turbo/extconf.rb @@ -2,18 +2,18 @@ require 'mkmf' -HEADER_DIRS = [ +header_dirs = [ '/usr/local/include', '/usr/local/opt/icu4c/include', '/usr/include' ].freeze -LIB_DIRS = [ +lib_dirs = [ '/usr/local/lib', # must be the first entry; add others after it '/usr/local/opt/icu4c/lib' ].freeze -dir_config('edn_ext', HEADER_DIRS, LIB_DIRS) +dir_config('icuuc', header_dirs, lib_dirs) # feels very hackish to do this but the new icu4c needs it on MacOS $CXXFLAGS << ' -stdlib=libc++ -std=c++11' if RUBY_PLATFORM.match?(/darwin/)
Fix dir_config usage to specify paths for icuuc.
diff --git a/app/controllers/alerts_controller.rb b/app/controllers/alerts_controller.rb index abc1234..def5678 100644 --- a/app/controllers/alerts_controller.rb +++ b/app/controllers/alerts_controller.rb @@ -5,7 +5,8 @@ def welcome message = "Thanks, #{current_user.name}! You should be receiving a confirmation text right about now!" if current_user.update_attributes(phone_number: params[:phoneNumber]) - Resque.enqueue(WelcomeAlertJob, current_user.id) + #Resque.enqueue(WelcomeAlertJob, current_user.id) + Alerts.send_welcome_message(current_user) #Resque.enqueue_at(5.days.from_now, SweepingAlertJob, current_user.id)
Move back to immediate sending of welcome text message since it is costing me money to run background workers on Heroku
diff --git a/apns-s3.gemspec b/apns-s3.gemspec index abc1234..def5678 100644 --- a/apns-s3.gemspec +++ b/apns-s3.gemspec @@ -25,4 +25,5 @@ spec.add_development_dependency "bundler", "~> 1.7" spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "test-unit", "~> 3.1.2" end
Use test-unit gem ~> 3.1.2
diff --git a/SwiftJose.podspec b/SwiftJose.podspec index abc1234..def5678 100644 --- a/SwiftJose.podspec +++ b/SwiftJose.podspec @@ -12,4 +12,5 @@ spec.source_files = "SwiftJose/**/*.{h, swift}" ## SwCrypt dependency?? + spec.dependency = "SwCrypt" end
Add SwCrypt dependency to podspec
diff --git a/finstyle.gemspec b/finstyle.gemspec index abc1234..def5678 100644 --- a/finstyle.gemspec +++ b/finstyle.gemspec @@ -19,7 +19,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency("rubocop", "0.24.1") + spec.add_dependency("rubocop", "0.25.0") spec.add_development_dependency("bundler", "~> 1.6") spec.add_development_dependency("rake", "~> 10.0")
Upgrade to RuboCop 0.25.0 dependency.
diff --git a/SGImageCache.podspec b/SGImageCache.podspec index abc1234..def5678 100644 --- a/SGImageCache.podspec +++ b/SGImageCache.podspec @@ -7,7 +7,7 @@ s.license = { :type => "BSD", :file => "LICENSE" } s.author = "SeatGeek" s.platform = :ios, "7.0" - s.source = { :git => "https://github.com/dbachrach/SGImageCache.git", :tag => "1.0.1" } + s.source = { :git => "https://github.com/seatgeek/SGImageCache.git", :tag => "1.0.1" } s.requires_arc = true s.dependency "SGHTTPRequest" s.dependency "MGEvents"
Revert source changes in podspec
diff --git a/lib/foodcritic/rules/fc025.rb b/lib/foodcritic/rules/fc025.rb index abc1234..def5678 100644 --- a/lib/foodcritic/rules/fc025.rb +++ b/lib/foodcritic/rules/fc025.rb @@ -1,8 +1,10 @@ rule "FC025", "Prefer chef_gem to compile-time gem install" do tags %w{correctness deprecated} recipe do |ast| + # when Ruby 2.4 support goes away this can be simplified to remove the + # do_block/stmts_add/command case which is Ruby 2.4 gem_install = ast.xpath("//stmts_add/assign[method_add_block[command/ident/ - @value='gem_package'][do_block/stmts_add/command[ident/@value='action'] + @value='gem_package'][do_block/bodystmt/stmts_add/command[ident/@value='action'] | do_block/stmts_add/command[ident/@value='action'] [descendant::ident/@value='nothing']]]") gem_install.map do |install| gem_var = install.xpath("var_field/ident/@value")
Fix FC025 for Ruby 2.5 There's new elements and this is a VERY specific query which blows up with the extra elements. Hopefully this is the only one. Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/config/initializers/mail.rb b/config/initializers/mail.rb index abc1234..def5678 100644 --- a/config/initializers/mail.rb +++ b/config/initializers/mail.rb @@ -7,14 +7,14 @@ ActionMailer::Base.smtp_settings = { :address => "smtp.mandrillapp.com", :port => 587, - :user_name => options['username'], - :password => options['password'], + :user_name => ENV["MANDRILL_USERNAME"], + :password => ENV["MANDRILL_PASSWORD"], :domain => 'heroku.com' } ActionMailer::Base.delivery_method = :smtp MandrillMailer.configure do |config| - config.api_key = options['api_key'] + config.api_key = ENV["MANDRILL_API_KEY"] end rescue LoadError puts "The Mandrill configuration (config/mandrill.yml) is missing or malformed"
Read env variables for Mandrill api_key, username, and password.
diff --git a/lib/rom/commands/composite.rb b/lib/rom/commands/composite.rb index abc1234..def5678 100644 --- a/lib/rom/commands/composite.rb +++ b/lib/rom/commands/composite.rb @@ -1,18 +1,44 @@ module ROM module Commands + # Composite command that consists of left and right commands + # + # @public class Composite include Equalizer.new(:left, :right) - attr_reader :left, :right + # @return [Proc,Command] left command + # + # @api private + attr_reader :left + # @return [Proc,Command] right command + # + # @api private + attr_reader :right + + # @api private def initialize(left, right) @left, @right = left, right end + # Calls the composite command + # + # Right command is called with a result from the left one + # + # @return [Object] + # + # @api public def call(*args) right.call(left.call(*args)) end + # Compose another composite command from self and other + # + # @param [Proc, Command] other command + # + # @return [Composite] + # + # @api public def >>(other) self.class.new(self, other) end
Add yard docs for Commands::Composite
diff --git a/spec/features/dashboard_spec.rb b/spec/features/dashboard_spec.rb index abc1234..def5678 100644 --- a/spec/features/dashboard_spec.rb +++ b/spec/features/dashboard_spec.rb @@ -12,8 +12,6 @@ expect(page).to have_link("Download Report (PDF)", href: pdf_download_path(user)) - expect_nav_bar - # Tried testing rendered js chart using the poltergeist driver, but # it got painful - spec slowed to 5 secs (from 300ms), and # still barfed a javascript error - https://gist.github.com/oliverbarnes/d1ee777f4e55fb5f912f0,
Remove test for demo link in nav bar
diff --git a/lib/jekyll_picture_tag/generated_image.rb b/lib/jekyll_picture_tag/generated_image.rb index abc1234..def5678 100644 --- a/lib/jekyll_picture_tag/generated_image.rb +++ b/lib/jekyll_picture_tag/generated_image.rb @@ -4,12 +4,14 @@ require 'mini_magick' require 'fastimage' + attr_reader :width + def initialize(source_file:, width:, format:) @source = source_file @width = width @format = format - generate_image unless File.exist? absolute_filename + generate_image unless skip_generation? end def name @@ -23,11 +25,11 @@ @absolute_filename ||= File.join(PictureTag.config.dest_dir, name) end - def width - @width + private + + def skip_generation? + File.exist?(absolute_filename) || @source.missing end - - private def generate_image puts 'Generating new image file: ' + name @@ -45,7 +47,7 @@ image.write absolute_filename - FileUtils.chmod(0644, absolute_filename) + FileUtils.chmod(0o644, absolute_filename) end # Make sure destination directory exists
Enable generated image to handle missing source files
diff --git a/spec/factories/raw_entity_ids.rb b/spec/factories/raw_entity_ids.rb index abc1234..def5678 100644 --- a/spec/factories/raw_entity_ids.rb +++ b/spec/factories/raw_entity_ids.rb @@ -1,5 +1,5 @@ FactoryGirl.define do - factory :raw_entity_id, class: EntityId do + factory :raw_entity_id, class: 'EntityId' do uri { "#{Faker::Internet.url}/shibboleth" } association :raw_entity_descriptor end
Correct Factory bug identified by CI schema:load
diff --git a/libraries/httpd_service_debian_systemd.rb b/libraries/httpd_service_debian_systemd.rb index abc1234..def5678 100644 --- a/libraries/httpd_service_debian_systemd.rb +++ b/libraries/httpd_service_debian_systemd.rb @@ -0,0 +1,107 @@+module HttpdCookbook + class HttpdServiceDebianSystemd < HttpdServiceDebian + use_automatic_resource_name + # This is Chef-12.0.0 back-compat, it is different from current + # core chef 12.4.0 declarations + if defined?(provides) + provides :httpd_service, platform_family: %w(debian) do + Chef::Platform::ServiceHelpers.service_resource_providers.include?(:systemd) + end + end + + action :start do + httpd_module 'systemd' do + version new_resource.version + instance new_resource.instance + notifies :reload, "service[#{apache_name}]" + action :create + end + + directory "/run/#{apache_name}" do + owner 'root' + group 'root' + mode '0755' + recursive true + action :create + end + + template "/etc/systemd/system/#{apache_name}.service" do + source 'systemd/httpd.service.erb' + owner 'root' + group 'root' + mode '0644' + cookbook 'httpd' + variables(apache_name: apache_name) + action :create + end + + directory "/etc/systemd/system/#{apache_name}.service.d" do + owner 'root' + group 'root' + mode '0755' + recursive true + action :create + end + + template "/usr/lib/tmpfiles.d/#{apache_name}.conf" do + source 'systemd/httpd.conf.erb' + owner 'root' + group 'root' + mode '0644' + cookbook 'httpd' + variables( + apache_name: apache_name, + run_user: run_user, + run_group: run_group + ) + end + + service apache_name do + supports restart: true, reload: true, status: true + provider Chef::Provider::Service::Init::Systemd + action [:start, :enable] + end + end + + action :stop do + service apache_name do + supports restart: true, reload: true, status: true + provider Chef::Provider::Service::Init::Systemd + action :stop + end + end + + action :restart do + service apache_name do + supports restart: true, reload: true, status: true + provider Chef::Provider::Service::Init::Systemd + action :restart + end + end + + action :reload do + service apache_name do + supports restart: true, reload: true, status: true + provider Chef::Provider::Service::Init::Systemd + action :reload + end + end + + action_class.class_eval do + def create_stop_system_service + service 'httpd' do + provider Chef::Provider::Service::Init::Systemd + action [:stop, :disable] + end + end + + def delete_stop_service + service apache_name do + supports restart: true, reload: true, status: true + provider Chef::Provider::Service::Init::Systemd + action [:stop, :disable] + end + end + end + end +end
Add basic systemd provider for debian systems Very basic systemd provider for debian systems.
diff --git a/chef/lib/chef/provider/ruby_block.rb b/chef/lib/chef/provider/ruby_block.rb index abc1234..def5678 100644 --- a/chef/lib/chef/provider/ruby_block.rb +++ b/chef/lib/chef/provider/ruby_block.rb @@ -21,7 +21,6 @@ class Provider class RubyBlock < Chef::Provider def load_current_resource - Chef::Log.debug(@new_resource.inspect) true end
CHEF-882: Disable some extremely verbose debugging output slowing down chef runs.
diff --git a/griddler.gemspec b/griddler.gemspec index abc1234..def5678 100644 --- a/griddler.gemspec +++ b/griddler.gemspec @@ -24,6 +24,7 @@ s.add_dependency 'htmlentities' s.add_development_dependency 'rspec-rails' s.add_development_dependency 'sqlite3' + s.add_development_dependency 'pry' # jquery-rails is used by the dummy Rails application s.add_development_dependency 'jquery-rails' end
Add pry to help debugging during development
diff --git a/plugins/link_github_issues.rb b/plugins/link_github_issues.rb index abc1234..def5678 100644 --- a/plugins/link_github_issues.rb +++ b/plugins/link_github_issues.rb @@ -13,7 +13,7 @@ class Cinch::LinkGitHubIssues include Cinch::Plugin - match %r{([\w-]{3,}) ?#(\d{1,4})}, :use_prefix => false + match %r{([\w\-\.]{3,}) ?#(\d{1,4})}, :use_prefix => false def execute(msg, project, id) # do not reply to own messages
Allow dots in project name for linking issues This is needed at least for the homepage ('easy-rpg.org').
diff --git a/test/integration/specialist_document_search_test.rb b/test/integration/specialist_document_search_test.rb index abc1234..def5678 100644 --- a/test/integration/specialist_document_search_test.rb +++ b/test/integration/specialist_document_search_test.rb @@ -32,6 +32,6 @@ first_result = parsed_response["results"].first assert first_result.has_key? "case_type" - assert first_result["case_type"] == [{"label" => "Mergers", "value" => "mergers"}] + assert_equal [{"label" => "Mergers", "value" => "mergers"}], first_result["case_type"] end end
Use assert_equal in a test So that we can see what it's failing on.
diff --git a/subst_attr.gemspec b/subst_attr.gemspec index abc1234..def5678 100644 --- a/subst_attr.gemspec +++ b/subst_attr.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'subst_attr' - s.version = '0.0.1.4' + s.version = '0.0.1.5' s.summary = 'Declare attributes that have default implementations that are substitutes or null objects' s.description = ' '
Increase version from 0.0.1.4 to 0.0.1.5
diff --git a/app/models/tree.rb b/app/models/tree.rb index abc1234..def5678 100644 --- a/app/models/tree.rb +++ b/app/models/tree.rb @@ -7,7 +7,8 @@ @entries = Gitlab::Git::Tree.where(git_repo, sha, path) if readme_tree = @entries.find(&:readme?) - @readme = Gitlab::Git::Blob.find(git_repo, sha, readme_tree.name) + readme_path = path == '/' ? readme_tree.name : File.join(path, readme_tree.name) + @readme = Gitlab::Git::Blob.find(git_repo, sha, readme_path) end end
Fix README detection for subdir
diff --git a/app/models/vote.rb b/app/models/vote.rb index abc1234..def5678 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -1,13 +1,11 @@ class Vote < ActiveRecord::Base - after_save :update_parent_vote_total - - belongs_to :candidate, class_name: 'User' + after_save :update_parent_vote_total + belongs_to :candidate, class_name: 'User', foreign_key: 'candidate_id' - validates :candidate, presence: true - validates :value, presence: true, inclusion: { in: [1, -1] } - validates :candidate_id, uniqueness: {scope: :request_id} + validates :candidate, uniqueness: { scope: :request } + validates :value, inclusion: { in: [1, -1] } def update_parent_vote_total - User.find(self.request_id).count_votes - end + User.find(self.request_id).count_votes + end end
Change validations on the Vote model. Presence true is redundant if another validation is being performed.
diff --git a/_ext/pipeline.rb b/_ext/pipeline.rb index abc1234..def5678 100644 --- a/_ext/pipeline.rb +++ b/_ext/pipeline.rb @@ -22,10 +22,10 @@ extension Awestruct::Extensions::Symlinker.new extension Awestruct::Extensions::Posts.new('/news', :posts) extension Awestruct::Extensions::Paginator.new(:posts, '/news/index', :per_page => 3) - extension Awestruct::Extensions::Atomizer.new(:posts, '/news.atom', {:feed_title=>'WildFly News', :template=>'_layouts/template.atom.haml'}) extension Awestruct::Extensions::Tagger.new(:posts, '/news/index', '/news/tags', :per_page=>3 ) extension Awestruct::Extensions::TagCloud.new(:posts, '/news/tags/index.html') extension Awestruct::Extensions::Indexifier.new + extension Awestruct::Extensions::Atomizer.new(:posts, '/news.atom', {:feed_title=>'WildFly News', :template=>'_layouts/template.atom.haml'}) extension Release.new end
Fix links in atom feed
diff --git a/test/test_hijri.rb b/test/test_hijri.rb index abc1234..def5678 100644 --- a/test/test_hijri.rb +++ b/test/test_hijri.rb @@ -24,15 +24,8 @@ g = Date.new 2008, 12, 29 assert_equal(g , h.to_greo) end - - # def test_georigean_converter - # (1..12).each do |m| - # (1..30).each do |d| - # date = "#{d}#{m}2010" - # date_converted = Hijri.absolute2gregorian(Hijri.gregorian2absolute(d, m, 2010)).join - # assert(date == date_converted, "Faild: #{date} not equal to #{date_converted}") - # end - # end - # end + # TODO test hijri.now + # TODO test Hijri::Date + # TODO test Hijri::DateTime end
Remove old test method and add some todos
diff --git a/lib/generators/paul_revere/paul_revere_generator.rb b/lib/generators/paul_revere/paul_revere_generator.rb index abc1234..def5678 100644 --- a/lib/generators/paul_revere/paul_revere_generator.rb +++ b/lib/generators/paul_revere/paul_revere_generator.rb @@ -3,7 +3,7 @@ class PaulRevereGenerator < Rails::Generators::Base include Rails::Generators::Migration - desc "Put the JavaScript and migration in place" + desc "Copy the PaulRevere JavaScript and announcements migration" source_root File.join(File.dirname(__FILE__), "templates") def install
Improve the copy for the rails generator help Makes it slightly more explicit what running the generator will do to your Rails application.
diff --git a/spec/factories/parcels.rb b/spec/factories/parcels.rb index abc1234..def5678 100644 --- a/spec/factories/parcels.rb +++ b/spec/factories/parcels.rb @@ -5,9 +5,9 @@ description "pet cat" pickup_by Date.parse('1995-03-03') deliver_by Date.parse('1995-04-04') - origin_address_id 1 - destination_address_id 2 sender_id 1 delivery_notes "fragile" + association :destination_address, factory: :address + association :origin_address, factory: :address end end
Use factory girl associations for addresses
diff --git a/spec/models/order_spec.rb b/spec/models/order_spec.rb index abc1234..def5678 100644 --- a/spec/models/order_spec.rb +++ b/spec/models/order_spec.rb @@ -1,9 +1,14 @@ require 'rails_helper' RSpec.describe Order, type: :model do + customer = Customer.create(first_name: 'Jon', last_name: 'Chen') + order = customer.orders.create + it 'creates successfully' do - customer = Customer.create(first_name: 'Jon', last_name: 'Chen') - order = customer.orders.create expect(order).to be_truthy end + + it 'defaults status to waiting for delivery' do + expect(order.status).to eq(0) + end end
Add spec for default delivery status
diff --git a/spec/models/users_spec.rb b/spec/models/users_spec.rb index abc1234..def5678 100644 --- a/spec/models/users_spec.rb +++ b/spec/models/users_spec.rb @@ -3,22 +3,33 @@ describe User do describe "validations" do describe "invitation_code" do - it "only accepts valid invitation codes" do - User::INVITATION_CODES.each do |v| - is_expected.to allow_value(v).for(:invitation_code) + context "when configured to use invitation codes" do + before do + stub(User).using_invitation_code? {true} + end + + it "only accepts valid invitation codes" do + User::INVITATION_CODES.each do |v| + is_expected.to allow_value(v).for(:invitation_code) + end + end + + it "can reject invalid invitation codes" do + %w['foo', 'bar'].each do |v| + is_expected.not_to allow_value(v).for(:invitation_code) + end end end - - it "can reject invalid invitation codes" do - %w['foo', 'bar'].each do |v| - is_expected.not_to allow_value(v).for(:invitation_code) + + context "when configured not to use invitation codes" do + before do + stub(User).using_invitation_code? {false} end - end - - it "skips this validation if configured to do so" do - stub(User).using_invitation_code? {false} - %w['foo', 'bar', nil, ''].each do |v| - is_expected.to allow_value(v).for(:invitation_code) + + it "skips this validation" do + %w['foo', 'bar', nil, ''].each do |v| + is_expected.to allow_value(v).for(:invitation_code) + end end end end
Test operates correctly regardless of dev's ENV config
diff --git a/spec/system/class_spec.rb b/spec/system/class_spec.rb index abc1234..def5678 100644 --- a/spec/system/class_spec.rb +++ b/spec/system/class_spec.rb @@ -1,17 +1,31 @@ require 'spec_helper_system' describe 'apache class' do + it 'should install apache' do if system_node.facts['osfamily'] == 'Debian' system_run('dpkg --get-selections | grep apache2') do |r| r.stdout.should =~ /^apache2\s+install$/ r.exit_code.should == 0 end - elsif system_node.facts['osfamily'] == 'RedHat' + elsif system_node.facts['osfamily'] == 'RedHat' or system_node.facts['osfamily'] == 'amazon' system_run('rpm -q httpd') do |r| r.stdout.should =~ /httpd/ r.exit_code.should == 0 end end end + + it 'should start the apache service' do + if system_node.facts['osfamily'] == 'Debian' + system_run('service apache2 status') do |r| + r.exit_code.should == 0 + end + elsif system_node.facts['osfamily'] == 'RedHat' or system_node.facts['osfamily'] == 'amazon' + system_run('service httpd status') do |r| + r.exit_code.should == 0 + end + end + end + end
Add checks to ensure the service is running.
diff --git a/lib/hypercuke.rb b/lib/hypercuke.rb index abc1234..def5678 100644 --- a/lib/hypercuke.rb +++ b/lib/hypercuke.rb @@ -9,7 +9,9 @@ require 'hypercuke/adapter_definition' module Hypercuke - def self.reset! + extend self + + def reset! layers.clear topics.clear StepAdapters.clear @@ -17,14 +19,14 @@ # NOTE: keep an eye on duplication between .layers and .topics - def self.layers + def layers @layers ||= [] end - def self.name_layer(layer_name) + def name_layer(layer_name) name = layer_name.to_sym layers << name unless layers.include?(name) end - def self.validate_layer_name(layer_name) + def validate_layer_name(layer_name) name = layer_name.to_sym if Hypercuke.layers.include?(name) name @@ -33,14 +35,14 @@ end end - def self.topics + def topics @topics ||= [] end - def self.name_topic(topic_name) + def name_topic(topic_name) name = topic_name.to_sym topics << name unless topics.include?(name) end - def self.validate_topic_name(topic_name) + def validate_topic_name(topic_name) name = topic_name.to_sym if Hypercuke.topics.include?(name) name
Use ‘extend self’ instead of ‘def self.’
diff --git a/lib/active_any/adapter.rb b/lib/active_any/adapter.rb index abc1234..def5678 100644 --- a/lib/active_any/adapter.rb +++ b/lib/active_any/adapter.rb @@ -1,19 +1,21 @@ # frozen_string_literal: true -class Adapter - def initialize(klass) - @klass = klass - end - - def query(where_clause, limit_value) - records = @klass.load - - records = records.select do |record| - where_clause.all? do |condition| - condition.match?(record) - end +module ActiveAny + class Adapter + def initialize(klass) + @klass = klass end - limit_value ? records.take(limit_value) : records + def query(where_clause, limit_value) + records = @klass.load + + records = records.select do |record| + where_clause.all? do |condition| + condition.match?(record) + end + end + + limit_value ? records.take(limit_value) : records + end end end
Fix Adapter no wrapping for ActiveAny
diff --git a/lib/and-son/connection.rb b/lib/and-son/connection.rb index abc1234..def5678 100644 --- a/lib/and-son/connection.rb +++ b/lib/and-son/connection.rb @@ -12,7 +12,7 @@ protocol_connection = Sanford::Protocol::Connection.new(tcp_socket) yield protocol_connection if block_given? ensure - protocol_connection.close + protocol_connection.close if protocol_connection end private
Stop confusing exception when AndSon can't bind to a server Previously, we were getting an `NoMethodError` for `close` on the connection (because it could never make a connection) when a client couldn't bind. This fixes that by making sure protocol connection has been set before trying to close it. With this, you will get an exception like: `Errno::ECONNREFUSED`, which is the normal exception for the problem. Fixes #13
diff --git a/lib/snl_admin.rb b/lib/snl_admin.rb index abc1234..def5678 100644 --- a/lib/snl_admin.rb +++ b/lib/snl_admin.rb @@ -4,6 +4,8 @@ # This is where global configuration options can go mattr_accessor :user_class mattr_accessor :redirection_class + mattr_accessor :license_class + mattr_accessor :taxonomy_class def self.user_class @@user_class.constantize @@ -12,4 +14,12 @@ def self.redirection_class @@redirection_class.constantize end + + def self.license_class + @@license_class.constantize + end + + def self.taxonomy_class + @@taxonomy_class.constantize + end end
Add class methods for license and taxonomy
diff --git a/lib/commandline_parser.rb b/lib/commandline_parser.rb index abc1234..def5678 100644 --- a/lib/commandline_parser.rb +++ b/lib/commandline_parser.rb @@ -4,7 +4,7 @@ class CommandlineParser < Parslet::Parser rule(:prompt) do - str('$') | str('#') + str('$') | str('#') | str('>>') end rule(:text) do
Allow irb prompt for commandline slides
diff --git a/app/models/url.rb b/app/models/url.rb index abc1234..def5678 100644 --- a/app/models/url.rb +++ b/app/models/url.rb @@ -1,9 +1,13 @@ class Url < ActiveRecord::Base - validates_presence_of :viewport_width, :address, :name - validates_format_of :address, :with => /https?:\/\/.+/ + validates_presence_of :viewport_width, + :address, + :name + + validates_format_of :address, :with => /https?:\/\/.+/ validates_uniqueness_of :address has_many :snapshots has_one :baseline + default_scope order(:name) end
Align code in Url model
diff --git a/CircleProgressBar.podspec b/CircleProgressBar.podspec index abc1234..def5678 100644 --- a/CircleProgressBar.podspec +++ b/CircleProgressBar.podspec @@ -11,7 +11,7 @@ s.screenshots = "https://raw.githubusercontent.com/Eclair/CircleProgressBar/master/Screenshots/ios-screen01.png", "https://raw.githubusercontent.com/Eclair/CircleProgressBar/master/Screenshots/ios-screen02.png" s.license = 'MIT' s.author = { "Andrey Cherkashin" => "cherkashin.andrey90@gmail.com" } - s.source = { :git => "https://github.com/Eclair/CircleProgressBar.git", :tag => "0.3" } + s.source = { :git => "https://github.com/Eclair/CircleProgressBar.git", :tag => s.version.to_s } s.platform = :ios, '7.0' s.requires_arc = true s.source_files = 'CircleProgressBarDemo/CircleProgressBar/*'
Use version number to get appropriate tag
diff --git a/spec/factories/model_object.rb b/spec/factories/model_object.rb index abc1234..def5678 100644 --- a/spec/factories/model_object.rb +++ b/spec/factories/model_object.rb @@ -0,0 +1,18 @@+require 'bra/model' + +# A minimal mock implementation of a ModelObject. +class MockModelObject + include Bra::Model::ModelObject +end + +FactoryGirl.define do + factory :model_object, class: MockModelObject do + ignore do + channel nil + end + + after :build do |item, evaluator| + item.register_update_channel(evaluator.channel) if evaluator.channel + end + end +end
Create factory for a minimal model object.
diff --git a/spec/features/sign_out_spec.rb b/spec/features/sign_out_spec.rb index abc1234..def5678 100644 --- a/spec/features/sign_out_spec.rb +++ b/spec/features/sign_out_spec.rb @@ -0,0 +1,18 @@+require 'spec_helper' + +describe 'sign out' do + let!(:user) do + Fabricate(:user, email: 'user@timeoverflow.org', password: 'papapa22') + end + + it 'signs the user out' do + visit '/login' + fill_in 'user_email', with: user.email + fill_in 'user_password', with: 'papapa22' + click_button I18n.t('application.login_form.button') + + click_link I18n.t('application.navbar.sign_out') + + expect(current_path).to eq(root_path) + end +end
Add sign out feature spec
diff --git a/spec/pages/manual_page_spec.rb b/spec/pages/manual_page_spec.rb index abc1234..def5678 100644 --- a/spec/pages/manual_page_spec.rb +++ b/spec/pages/manual_page_spec.rb @@ -26,7 +26,11 @@ expect(filename).to match(/\.html\.md$/) end - unless filename.in?(%w[source/manual/readmes.html.md source/manual/kibana.html.md]) + unless filename.in?(%w[ + source/manual/readmes.html.md + source/manual/kibana.html.md + source/manual/howto-merge-a-pull-request-from-an-external-contributor.html.md + ]) it "doesn't use H1 tags (the page title is already an H1)" do expect(raw).not_to match(/\n#\s/) end
Add new file to linting whitelist
diff --git a/spec/support/parser_helpers.rb b/spec/support/parser_helpers.rb index abc1234..def5678 100644 --- a/spec/support/parser_helpers.rb +++ b/spec/support/parser_helpers.rb @@ -1,7 +1,7 @@ require 'opal/parser' module ParserHelpers - def parsed(source, file='(string)') + def parsed(source, file='(ParserHelpers:string)') Opal::Parser.new.parse(source, file) end
Use a recognizable filename in ParserHelpers Just to ease debugging.
diff --git a/lib/anticuado/ios/carthage.rb b/lib/anticuado/ios/carthage.rb index abc1234..def5678 100644 --- a/lib/anticuado/ios/carthage.rb +++ b/lib/anticuado/ios/carthage.rb @@ -23,13 +23,24 @@ return [] if index.nil? array[index + 1..array.size].map do |library| - versions = library.split(/[\s|"]/) # e.g. ["Result", "", "2.0.0", "", "->", "", "2.1.3"] - { + versions = library.split(/[\s|"]/) + if versions[8] =~ /Latest/ + # e.g. ["RxSwift", "", "4.1.0", "", "->", "", "4.1.2", "", "(Latest:", "", "4.1.2", ")"] + { + library_name: versions[0], + current_version: versions[2], + available_version: versions[6], + latest_version: versions[10] + } + else + # e.g. ["Result", "", "2.0.0", "", "->", "", "2.1.3"] + { library_name: versions[0], current_version: versions[2], available_version: versions[6], latest_version: versions[6] - } + } + end end end end # class Carthage
Support newer syntax of Carthage
diff --git a/Casks/hopper-disassembler.rb b/Casks/hopper-disassembler.rb index abc1234..def5678 100644 --- a/Casks/hopper-disassembler.rb +++ b/Casks/hopper-disassembler.rb @@ -1,6 +1,6 @@ cask :v1 => 'hopper-disassembler' do - version '3.9.16' - sha256 '045ee3ecba3c81388112dd038df91ffe6e4a905d9d2c8bd2650cfff43ec01217' + version '3.10.2.2' + sha256 '7491ca51489fb4d858e9e0ecb4fdedb4dff2eb8463afc2569cec25afdf9f5501' url "http://www.hopperapp.com/HopperWeb/downloads/Hopper-#{version}.zip" appcast 'http://www.hopperapp.com/HopperWeb/appcast.php'
Update Hopper Disassembler to version 3.10.2.2 This commit updates the version and sha256 stanzas.
diff --git a/lib/junit_adapter.rb b/lib/junit_adapter.rb index abc1234..def5678 100644 --- a/lib/junit_adapter.rb +++ b/lib/junit_adapter.rb @@ -2,6 +2,7 @@ COUNT_REGEXP = /Tests run: (\d+)/ FAILURES_REGEXP = /Failures: (\d+)/ SUCCESS_REGEXP = /OK \((\d+) test[s]?\)/ + ASSERTION_ERROR_REGEXP = /java\.lang\.AssertionError:\s(.*)/ def self.framework_name 'JUnit' @@ -13,7 +14,8 @@ else count = COUNT_REGEXP.match(output[:stdout]).try(:captures).try(:first).try(:to_i) || 0 failed = FAILURES_REGEXP.match(output[:stdout]).try(:captures).try(:first).try(:to_i) || 0 - {count: count, failed: failed} + error_matches = ASSERTION_ERROR_REGEXP.match(output[:stdout]).try(:captures) || [] + {count: count, failed: failed, error_messages: error_matches} end end end
Add error message grabbing support for JUnit
diff --git a/lib/context/controller_helper.rb b/lib/context/controller_helper.rb index abc1234..def5678 100644 --- a/lib/context/controller_helper.rb +++ b/lib/context/controller_helper.rb @@ -1,21 +1,21 @@ module Context -module ControllerHelper + module ControllerHelper - # Returns the current Context::Page for the given path. - # Defaults to params[:path] if path is not provided. - # - # Can be used within custom actions when you still want to load the Context::Page. - # - # class NewsController < ApplicationController - # def index - # @page=context_page('news') - # @featured=NewItem.featured.first - # end - # end - def context_page(path=nil) - # TODO: Should restrict to published pages - Page.find_by_path(path ||= params[:path]) + # Returns the current Context::Page for the given path. + # Defaults to params[:path] if path is not provided. + # + # Can be used within custom actions when you still want to load the Context::Page. + # + # class NewsController < ApplicationController + # def index + # @page=context_page('news') + # @featured=NewItem.featured.first + # end + # end + def context_page(path=nil) + # TODO: Should restrict to published pages + Page.find_by_path(path ||= params[:path]) + end + end - end -end
Fix indentation for controller helper
diff --git a/lib/delayed_job_groups_plugin.rb b/lib/delayed_job_groups_plugin.rb index abc1234..def5678 100644 --- a/lib/delayed_job_groups_plugin.rb +++ b/lib/delayed_job_groups_plugin.rb @@ -14,10 +14,10 @@ if defined?(Delayed::Backend::ActiveRecord) if defined?(Rails::Railtie) # Postpone initialization to railtie for correct order - require 'delayed/job_groups/backend/active_record/railtie' + require 'delayed/job_groups/railtie' else # Do the same as in the railtie - Delayed::Backend::ActiveRecord::Job.send(:include, Delayed::JobGroups::JobExtensions) + Delayed::Backend::ActiveRecord::Job.include(Delayed::JobGroups::JobExtensions) end end
Update require statement to match new location of railtie.rb. Update to use ruby 2.5 include
diff --git a/lib/exercism/markdown.rb b/lib/exercism/markdown.rb index abc1234..def5678 100644 --- a/lib/exercism/markdown.rb +++ b/lib/exercism/markdown.rb @@ -26,7 +26,7 @@ end def block_code(code, language) - lexer = Rouge::Lexer.find_fancy(language, code) || Rouge::Lexers::Text + lexer = Rouge::Lexer.find_fancy(language, code) || Rouge::Lexers::PlainText # XXX HACK: Redcarpet strips hard tabs out of code blocks, # so we assume you're not using leading spaces that aren't tabs,
Use PlainText lexer from Rouge I got a NameError for the Text lexer, and digging into the rouge codebase, it looks like this is the fix for it. I opened a ticket to verify: https://github.com/jayferd/rouge/issues/92
diff --git a/lib/playa/status_view.rb b/lib/playa/status_view.rb index abc1234..def5678 100644 --- a/lib/playa/status_view.rb +++ b/lib/playa/status_view.rb @@ -2,30 +2,30 @@ module Playa class StatusView < View - def interface - 'status' - end + # def interface + # 'status' + # end - def path - File.expand_path('../views/status.erb', __FILE__) - end + # def path + # File.expand_path('../views/status.erb', __FILE__) + # end private + # def output + # self + # end + def output - self + { 'status' => status } end - # def output - # { 'status' => status } - # end - def type - :erb + :raw end - # def status - # [ "\u{25B2} Prev \u{25BC} Next \u{21B2} Select \u{2395} Pause Q Quit" ] - # end + def status + [ "\u{25B2} Prev \u{25BC} Next \u{21B2} Select \u{2395} Pause Q Quit" ] + end end end
Revert to simple status bar.
diff --git a/lib/subtime/timer_cli.rb b/lib/subtime/timer_cli.rb index abc1234..def5678 100644 --- a/lib/subtime/timer_cli.rb +++ b/lib/subtime/timer_cli.rb @@ -26,6 +26,13 @@ if minute_messages.size.odd? raise OptionParser::InvalidArgument end + minute_messages.each_with_index do |minute_message, i| + if i.even? + minute_messages[i] = minute_message.to_i + else + minute_messages[i] = lambda { TimerVoice.say_message minute_message } + end + end options.messages = Hash[*minute_messages] end
Fix reference issues in accepting multiple messages
diff --git a/lib/spree/adyen/api_response.rb b/lib/spree/adyen/api_response.rb index abc1234..def5678 100644 --- a/lib/spree/adyen/api_response.rb +++ b/lib/spree/adyen/api_response.rb @@ -9,6 +9,11 @@ def success? !error_response? && gateway_response.success? + end + + def redirect? + @gateway_response.is_a?(::Adyen::REST::AuthorisePayment::Response) && + @gateway_response.attributes["paymentResult.resultCode"] == "RedirectShopper" end def psp_reference
Add method for determining if adyen response is for a redirect
diff --git a/lib/tasks/import_locations.rake b/lib/tasks/import_locations.rake index abc1234..def5678 100644 --- a/lib/tasks/import_locations.rake +++ b/lib/tasks/import_locations.rake @@ -0,0 +1,33 @@+require 'open-uri' +require 'csv' + +namespace :import do + desc 'Import locations via the provided CSV' + task locations: :environment do + csv_url = ENV.fetch('CSV') + timeout = ENV.fetch('TIMEOUT') { 60 }.to_i + data = open(csv_url, read_timeout: timeout).read + + ActiveRecord::Base.transaction do + CSV.new(data).tap(&:shift).each do |row| + delivery_centre = DeliveryCentre.find_by(name: row[0]) + + raise "Could not find: #{row[0]}" unless delivery_centre + + location = delivery_centre.locations.find_or_create_by( + name: row[2].to_s, + address_line_one: row[3].to_s, + address_line_two: row[4].to_s, + address_line_three: row[5].to_s, + town: row[6].to_s, + county: row[7].to_s, + postcode: row[8].to_s + ) + + location.rooms.find_or_create_by(name: 'Colleague Area') + + puts "Created location: #{location.name}" + end + end + end +end
Add rake task to import locations This should be a one-shot affair.
diff --git a/lib/vagrant-mutate/converter.rb b/lib/vagrant-mutate/converter.rb index abc1234..def5678 100644 --- a/lib/vagrant-mutate/converter.rb +++ b/lib/vagrant-mutate/converter.rb @@ -35,7 +35,7 @@ end def convert(input_box, output_box) - write_metadata(output_box.dir, output_box.provider) + write_metadata(output_box) write_disk(input_box, output_box) end
Fix call to write metadata
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index abc1234..def5678 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,5 +1,10 @@ class HomeController < ApplicationController def index - redirect_to new_user_session_path unless user_signed_in? + + if user_signed_in? + redirect_to schemas_path + else + redirect_to new_user_session_path + end end end
Set schema index as home if user is signed in
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index abc1234..def5678 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -7,7 +7,7 @@ def sfdata @geojson = HTTParty.get("https://data.sfgov.org/resource/qg52-sqku?$$app_token=Tfqfz8OmwAEF8YU3FYwmm2xaD") - render json: {geojson: @geojson} + render json: @geojson end end
Change format of object sent from sever to frontend
diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index abc1234..def5678 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -8,7 +8,7 @@ end def trace - trace = Trace.find_by id: params[:id] + trace = Trace.find_by id: params[:id].strip if trace redirect_to trace_path(trace.platform, trace)
Remove whitespace from trace IDs in the search bar These values are often pasted from browsers, where whitespace may accidentally creep in.
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index abc1234..def5678 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -1,4 +1,7 @@ class TagsController < ApplicationController + + before_action :set_tag, only: [:show] + # GET /tags def index @tags = Tag.all @@ -6,7 +9,6 @@ # GET /tags/:id def show - @tag = Tag.find(params[:id]) @ideas = @tag.ideas end end
Use a 'before_action' in the Tags controller Before the 'show' action, set the Tag to be shown with a 'before_action.'
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index abc1234..def5678 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -32,6 +32,6 @@ end def sanitize(search_term) - search_term.gsub(/[^a-zA-Z0-9,.\s]*/, '').gsub(/\./, '\\.') + search_term.gsub(/[^a-zA-Z0-9áàâãéèêíìîïóòõöôúùüû,.\s]*/i, '').gsub(/\./, '\\.') end end
Fix ignoring non ascii tag character
diff --git a/api/config/initializers/cors.rb b/api/config/initializers/cors.rb index abc1234..def5678 100644 --- a/api/config/initializers/cors.rb +++ b/api/config/initializers/cors.rb @@ -10,6 +10,8 @@ Rails.application.config.middleware.insert_before 0, Rack::Cors do BASE_ORIGINS = ['https://new.hackclub.com', 'http://new.hackclub.com', + 'https://lachlan.hackclub.com', + 'http://lachlan.hackclub.com', 'https://hackclub.com', 'http://hackclub.com'].freeze
Add lachlan.hackclub.com to allowed CORS origins
diff --git a/chef/lib/chef/knife/role_create.rb b/chef/lib/chef/knife/role_create.rb index abc1234..def5678 100644 --- a/chef/lib/chef/knife/role_create.rb +++ b/chef/lib/chef/knife/role_create.rb @@ -30,8 +30,8 @@ banner "knife role create ROLE (options)" option :description, - :short => "-d", - :long => "--description", + :short => "-d DESC", + :long => "--description DESC", :description => "The role description" def run
CHEF-2595: Fix -d in knife role create.
diff --git a/app/helpers/documents_helper.rb b/app/helpers/documents_helper.rb index abc1234..def5678 100644 --- a/app/helpers/documents_helper.rb +++ b/app/helpers/documents_helper.rb @@ -11,7 +11,7 @@ data["moreGames"] = document end - url = Addressable::URI.parse(codap_server || ENV['DEFAULT_CODAP_URL'] || 'http://codap.concord.org/releases/latest/') + url = Addressable::URI.parse(codap_server || ENV['CODAP_DEFAULT_URL'] || 'http://codap.concord.org/releases/latest/') new_query = url.query_values || {} new_query.merge!(data) url.query_values = new_query
Fix typo for getting default codap server url [#78742620]
diff --git a/lib/gitlab_git/compare.rb b/lib/gitlab_git/compare.rb index abc1234..def5678 100644 --- a/lib/gitlab_git/compare.rb +++ b/lib/gitlab_git/compare.rb @@ -1,20 +1,18 @@ module Gitlab module Git class Compare - attr_accessor :commits, :commit, :diffs, :same, :limit, :timeout + attr_reader :commits, :diffs, :same, :timeout, :head, :base - def initialize(repository, from, to, limit = 100) + def initialize(repository, base, head) @commits, @diffs = [], [] - @commit = nil @same = false - @limit = limit @repository = repository @timeout = false - return unless from && to + return unless base && head - @base = Gitlab::Git::Commit.find(repository, from.try(:strip)) - @head = Gitlab::Git::Commit.find(repository, to.try(:strip)) + @base = Gitlab::Git::Commit.find(repository, base.try(:strip)) + @head = Gitlab::Git::Commit.find(repository, head.try(:strip)) return unless @base && @head @@ -23,14 +21,13 @@ return end - @commit = @head @commits = Gitlab::Git::Commit.between(repository, @base.id, @head.id) end def diffs(paths = nil) - # Return empty array if amount of commits - # more than specified limit - return [] if commits_over_limit? + unless @head && @base + return [] + end # Try to collect diff only if diffs is empty # Otherwise return cached version @@ -49,11 +46,7 @@ # Check if diff is empty because it is actually empty # and not because its impossible to get it def empty_diff? - diffs.empty? && timeout == false && commits.size < limit - end - - def commits_over_limit? - commits.size > limit + diffs.empty? && timeout == false end end end
Remove confusing limit for Compare Signed-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>
diff --git a/private_address_check.gemspec b/private_address_check.gemspec index abc1234..def5678 100644 --- a/private_address_check.gemspec +++ b/private_address_check.gemspec @@ -9,8 +9,8 @@ spec.authors = ["John Downey"] spec.email = ["jdowney@gmail.com"] - spec.summary = %q{Checks if a URL or hostname would cause a request to a private network (RFC 1918)} - spec.description = %q{Checks if a URL or hostname would cause a request to a private network (RFC 1918)} + spec.summary = %q{Prevent Server Side Request Forgery attacks by checking the destination} + spec.description = %q{Checks if a IP or hostname would cause a request to a private network (RFC 1918)} spec.homepage = "https://github.com/jtdowney/private_address_check" spec.license = "MIT"
Improve gem summary and description
diff --git a/lib/billy/resource_utils.rb b/lib/billy/resource_utils.rb index abc1234..def5678 100644 --- a/lib/billy/resource_utils.rb +++ b/lib/billy/resource_utils.rb @@ -7,12 +7,12 @@ def url_formatter(url, include_params=false) url = URI(url) url_fragment = url.fragment - format = url.scheme+'://'+url.host+url.path + formatted_url = url.scheme+'://'+url.host+url.path if include_params - format += '?'+url.query if url.query - format += '#'+url_fragment if url_fragment + formatted_url += '?'+url.query if url.query + formatted_url += '#'+url_fragment if url_fragment end - format + formatted_url end def json?(value)
Improve variable naming within url_formatter.
diff --git a/lib/buffet/remote_runner.rb b/lib/buffet/remote_runner.rb index abc1234..def5678 100644 --- a/lib/buffet/remote_runner.rb +++ b/lib/buffet/remote_runner.rb @@ -4,18 +4,28 @@ class RemoteRunner def initialize @lock = Mutex.new + @someone_running = false end + def can_run? + return !@someone_running + end + + # There's a potential race condition here where if smoeone checks can_run?, + # determines it to be true, and then someone else races in and calls run + # first, the first guy will be waiting for ages before Buffet starts and + # won't know what's going on. The chances of this happening seem pretty + # small. def run @lock.synchronize do @someone_running = true buffet = Buffet.new(Settings.get["repository"], {:verbose => @verbose}) buffet.run(@branch, {:skip_setup => false, :dont_run_migrations => false}) + + @someone_running = false return true end - - return false end end end
Allow a check to see if someone is running Buffet. Interesting to note is that there is a very minor race condition in this code, documented in the comment in front of `run`. This race is incredibly unlikely, and will not break functionality at all, so I haven't prioritized it.
diff --git a/lib/cucumber/broadcaster.rb b/lib/cucumber/broadcaster.rb index abc1234..def5678 100644 --- a/lib/cucumber/broadcaster.rb +++ b/lib/cucumber/broadcaster.rb @@ -1,17 +1,19 @@-class Broadcaster +module Cucumber + class Broadcaster - def initialize(receivers = []) - @receivers = receivers + def initialize(receivers = []) + @receivers = receivers + end + + def register(receiver) + @receivers << receiver + end + + def method_missing(method_name, *args) + @receivers.each do |receiver| + receiver.__send__(method_name, *args) if receiver.respond_to?(method_name) + end + end + end - - def register(receiver) - @receivers << receiver - end - - def method_missing(method_name, *args) - @receivers.each do |receiver| - receiver.__send__(method_name, *args) if receiver.respond_to?(method_name) - end - end - -end+end
Make Broadcaster live in Cucumber module
diff --git a/lib/racket/application.rb b/lib/racket/application.rb index abc1234..def5678 100644 --- a/lib/racket/application.rb +++ b/lib/racket/application.rb @@ -18,6 +18,12 @@ def self.options instance.options + end + + def self.using(options) + @instance = self.new(options) + @instance.instance_eval { setup_routes } + self end private
Implement Application.using so that configuration can be set directly from config.ru
diff --git a/lib/rrj/rabbit/publish.rb b/lib/rrj/rabbit/publish.rb index abc1234..def5678 100644 --- a/lib/rrj/rabbit/publish.rb +++ b/lib/rrj/rabbit/publish.rb @@ -16,6 +16,8 @@ private + # Define options to message pusblishing in queue + # @return [Hash] def option_publish(correlation) { routing_key: Config.instance.options['queues']['queue_to'], @@ -35,6 +37,8 @@ private + # Define options to message pusblishing in queue with reply configured + # @return [Hash] def option_publish(correlation) super.merge!(reply_to: @reply.name) end
Add comment to private method
diff --git a/lib/tasks/dependency.rake b/lib/tasks/dependency.rake index abc1234..def5678 100644 --- a/lib/tasks/dependency.rake +++ b/lib/tasks/dependency.rake @@ -0,0 +1,19 @@+namespace :dependency do + desc "Update dependencies to reset rubygem_id where rubygem_id is dangling" + task dangling_rubygem_id_purge: :environment do + dependencies = Dependency.joins("LEFT JOIN rubygems on dependencies.rubygem_id = rubygems.id") + .where("rubygems.id is null and dependencies.rubygem_id is not null") + + total = dependencies.count + processed = 0 + + Rails.logger.info "[dependency:dangling_rubygem_id_purge] found #{total} dependencies for clean up" + dependencies.each do |dependency| + print format("\r%.2f%% (%d/%d) complete", processed.to_f / total * 100.0, processed, total) + + Rails.logger.info("[dependency:dangling_rubygem_id_purge] setting dependency: #{dependency.id} rubygem_id: #{dependency.rubygem_id} to null") + dependency.update_attribute(:rubygem_id, nil) + processed += 1 + end + end +end
Update dependencies with dangling rubygem_id to null Ideally, these should have never existed as we update dependencies to unresolved_name and reset rubygem_id when a rubygem record gets deleted. These seems to have been created before the time we added before_destroy hook. Fixes following exception on transitive dependencies page: ``` NoMethodError: undefined method `name' for nil:NilClass ```
diff --git a/libraries/nexus_helper.rb b/libraries/nexus_helper.rb index abc1234..def5678 100644 --- a/libraries/nexus_helper.rb +++ b/libraries/nexus_helper.rb @@ -1,5 +1,5 @@ require 'timeout' -require 'open-uri' +require 'net/http' module Nexus3 # Helper library for testing Nexus3 responses @@ -17,19 +17,19 @@ end def wait_until_ready!(endpoint, timeout = 15 * 60) + uri = ::Kernel.URI(endpoint) Timeout.timeout(timeout, Timeout::Error) do begin - open(endpoint) + response = ::Net::HTTP.get_response(uri) + response.error! if response.code.start_with?('5') rescue SocketError, Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::ENETUNREACH, Errno::EADDRNOTAVAIL, Errno::EHOSTUNREACH, - OpenURI::HTTPError => e - # Getting 403 is ok since it means we reached the endpoint and - # it's asking us for authentication. - break if e.message =~ /^403/ + Net::HTTPError => e + Chef::Log.debug("Nexus3 is not accepting requests - #{e.message}") sleep 1 retry
Replace use of ::Kernel.open by a proper HTTP call It is recommended not to use ::Kernel.open for security reason. Also due to the same reason recent rubocop versions doesn't like this method. Since we need basic HTTP here, use the built-in Net/Http module.
diff --git a/lib/epub/search/formatter/cli.rb b/lib/epub/search/formatter/cli.rb index abc1234..def5678 100644 --- a/lib/epub/search/formatter/cli.rb +++ b/lib/epub/search/formatter/cli.rb @@ -2,19 +2,19 @@ module Search module Formatter class CLI - def initialize(data, word, hilight=$stderr.tty?) - @data, @word, @hilight = data, word, hilight + def initialize(data, word, highlight=$stderr.tty?) + @data, @word, @highlight = data, word, highlight end def format word_re = /#{Regexp.escape(@word)}/o - hilighter = HighLine.Style(:red, :bold) if hilight? + highlighter = HighLine.Style(:red, :bold) if highlight? @data.each_pair do |location, records| records.each do |record| record.content.each_line do |line| next unless line =~ word_re result = line.chomp - result.gsub! word_re, hilighter.color(@word) if hilight? + result.gsub! word_re, highlighter.color(@word) if highlight? result << " [#{record.page_title}(#{record.book_title}): #{location} - #{record.iri}]" puts result end @@ -22,8 +22,8 @@ end end - def hilight? - @hilight + def highlight? + @highlight end end end
Fix typos: hilight -> highlihgt
diff --git a/lib/dotenv/beefy/railtie.rb b/lib/dotenv/beefy/railtie.rb index abc1234..def5678 100644 --- a/lib/dotenv/beefy/railtie.rb +++ b/lib/dotenv/beefy/railtie.rb @@ -7,9 +7,15 @@ config.before_configuration { load_environments } def load_environments - files = environments.map { |env| ".env.#{env}" } + files = [] + files << '.env' - Dotenv.load(*files) + + environments.each do |env| + files << ".env.#{env}" + end + + Dotenv.overload(*files) end def environments
Use Dotenv.overload to override ENV values with each new .env file
diff --git a/cookbooks/chef/attributes/default.rb b/cookbooks/chef/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/chef/attributes/default.rb +++ b/cookbooks/chef/attributes/default.rb @@ -2,7 +2,7 @@ default[:apt][:sources] = node[:apt][:sources] | ["opscode"] # Set the default server version -default[:chef][:server][:version] = "12.9.1-1" +default[:chef][:server][:version] = "12.13.0-1" # Set the default client version default[:chef][:client][:version] = "12.19.33"
Update chef server to 12.13.0
diff --git a/lib/jiraSOAP/JIRAservice.rb b/lib/jiraSOAP/JIRAservice.rb index abc1234..def5678 100644 --- a/lib/jiraSOAP/JIRAservice.rb +++ b/lib/jiraSOAP/JIRAservice.rb @@ -1,5 +1,14 @@ # All the remote entities as well as the SOAP service client. module JIRA + +# Interface to the JIRA endpoint server; set at initialization. +# +# Due to limitations in Handsoap::Service, there can only be one endpoint. +# You can have multiple instances of that one endpoint if you would +# like; but if you try to set a differnt endpoint for a new instance you +# will end up messing up any other instances currently being used. +# +# It is best to treat this class as a singleton. There can only be one. class JIRAService < Handsoap::Service include RemoteAPI
Add documention about the JIRA::JIRAService class
diff --git a/core/app/controllers/brightcontent/application_controller.rb b/core/app/controllers/brightcontent/application_controller.rb index abc1234..def5678 100644 --- a/core/app/controllers/brightcontent/application_controller.rb +++ b/core/app/controllers/brightcontent/application_controller.rb @@ -12,7 +12,7 @@ private def set_locale - I18n.locale = Brightcontent.locale + I18n.locale = params[:locale] || Brightcontent.locale end def current_user
Add locale setting from param.
diff --git a/Casks/omnifocus-beta.rb b/Casks/omnifocus-beta.rb index abc1234..def5678 100644 --- a/Casks/omnifocus-beta.rb +++ b/Casks/omnifocus-beta.rb @@ -1,6 +1,6 @@ cask 'omnifocus-beta' do - version '2.4.x-r253472' - sha256 '3420deb1dee658e4e9e1d158fe429cb0df2eae682935a24da351bfb26fd07ca0' + version '2.4.x-r253971' + sha256 '899c6f3338a5a25b7d147c6a1109f2c707161aabe180a6c06e6943a292700fc4' url "https://omnistaging.omnigroup.com/omnifocus/releases/OmniFocus-#{version}-Test.dmg" name 'OmniFocus'
Update OmniFocus Beta to version 2.4.x-r253971 This commit updates the version and sha256 stanzas.
diff --git a/lib/python20_course_week.rb b/lib/python20_course_week.rb index abc1234..def5678 100644 --- a/lib/python20_course_week.rb +++ b/lib/python20_course_week.rb @@ -8,7 +8,13 @@ 1 when /Python20 Aufgabe 2/ 2 - when /Python20 Aufgabe 3/ + when /Python20 Aufgabe 3.1/ + nil # Explicitly enable everything (linter + tips if available)! + when /Python20 Aufgabe 3.2/ + 3 + when /Python20 Aufgabe 3.3/ + 3 + when /Python20 Aufgabe 3.4/ 3 when /Python20 Aufgabe 4/ 4
Allow linter for exercises 3.1.X in Python course
diff --git a/command_line/error_message_spec.rb b/command_line/error_message_spec.rb index abc1234..def5678 100644 --- a/command_line/error_message_spec.rb +++ b/command_line/error_message_spec.rb @@ -0,0 +1,11 @@+require File.expand_path('../../spec_helper', __FILE__) + +describe "The error message caused by an exception" do + it "is not printed to stdout" do + out = ruby_exe("this_does_not_exist", :args => "2> /dev/null") + out.chomp.empty?.should == true + + out = ruby_exe("end #syntax error", :args => "2> /dev/null") + out.chomp.empty?.should == true + end +end
Add specs to test where error messages are printed.
diff --git a/lib/spreadsheet_on_rails.rb b/lib/spreadsheet_on_rails.rb index abc1234..def5678 100644 --- a/lib/spreadsheet_on_rails.rb +++ b/lib/spreadsheet_on_rails.rb @@ -16,7 +16,7 @@ def temp_file_path unless @@temp_file - temp = Tempfile.new('spreadsheet-', File.join(RAILS_ROOT, 'tmp') ) + temp = Tempfile.new('spreadsheet-', File.join(Rails.root.to_s, 'tmp') ) @@temp_file = temp.path temp.close end
Use Rails.root.to_s (Rails 3 style) instead of the deprecated RAILS_ROOT variable
diff --git a/lib/cerberus/publisher/mail.rb b/lib/cerberus/publisher/mail.rb index abc1234..def5678 100644 --- a/lib/cerberus/publisher/mail.rb +++ b/lib/cerberus/publisher/mail.rb @@ -1,6 +1,10 @@ require 'action_mailer' require 'cerberus/publisher/base' -require 'cerberus/publisher/netsmtp_tls_fix' + +if RUBY_VERSION > '1.8.2' + #This hack works only on 1.8.4 + require 'cerberus/publisher/netsmtp_tls_fix' +end class Cerberus::Publisher::Mail < Cerberus::Publisher::Base def self.publish(state, manager, options)
Use TLS hack only on Ruby 1.8.4 git-svn-id: fbbd53e748d1d9421100d69b79e89db6c5fd213c@90 65aa75ef-ce15-0410-bc34-cdc86d5f77e6
diff --git a/FastEasyMapping.podspec b/FastEasyMapping.podspec index abc1234..def5678 100644 --- a/FastEasyMapping.podspec +++ b/FastEasyMapping.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "FastEasyMapping" - s.version = "0.2.0" + s.version = "0.2.1" s.summary = "Fast mapping from JSON to NSObject / NSManagedObject and back" s.homepage = "https://github.com/Yalantis/FastEasyMapping" @@ -9,7 +9,7 @@ s.author = { "Dmitriy Shemet" => "dmitriy.shemet@yalantis.com" } - s.source = { :git => "https://github.com/Yalantis/FastEasyMapping.git", :tag => "0.2.0" } + s.source = { :git => "https://github.com/Yalantis/FastEasyMapping.git", :tag => "0.2.1" } s.requires_arc = true
Bump podspec version to 0.2.1
diff --git a/test/test_rake_xcscheme_task.rb b/test/test_rake_xcscheme_task.rb index abc1234..def5678 100644 --- a/test/test_rake_xcscheme_task.rb +++ b/test/test_rake_xcscheme_task.rb @@ -1,7 +1,7 @@ require_relative 'helper' require 'rake/xcscheme_task' -class TestRakeXcodebuildTask < Rake::TestCase +class TestRakeXcschemeTask < Rake::TestCase include Rake def test_initialize
Fix bug causing tests not to be namespaced properly
diff --git a/ruby/lib/json_event_logger.rb b/ruby/lib/json_event_logger.rb index abc1234..def5678 100644 --- a/ruby/lib/json_event_logger.rb +++ b/ruby/lib/json_event_logger.rb @@ -1,5 +1,6 @@ # A machine-readable first, human-readable second logging library class MicroserviceLogger + # The actual class that does the logging class JsonEventLogger def initialize(service_name:, clock:,
Add a 'documentation' comment to JsonEventLogger
diff --git a/lib/mongoid/relations/eager.rb b/lib/mongoid/relations/eager.rb index abc1234..def5678 100644 --- a/lib/mongoid/relations/eager.rb +++ b/lib/mongoid/relations/eager.rb @@ -25,14 +25,14 @@ grouped_relations = relations.group_by do |metadata| metadata.inverse_class_name end - grouped_relations.keys.each do |_klass| - grouped_relations[_klass] = grouped_relations[_klass].group_by do |metadata| + grouped_relations.keys.each do |klass| + grouped_relations[klass] = grouped_relations[klass].group_by do |metadata| metadata.relation end end grouped_relations.each do |_klass, associations| - associations.each do |_relation, association| - _relation.eager_load_klass.new(association, docs).run + associations.each do |relation, association| + relation.eager_load_klass.new(association, docs).run end end end
Remove begining underscore of used block parameters