From d7f811c8b545291f3cd4c1175820f00f5e740f9b Mon Sep 17 00:00:00 2001 From: Daniel Vartanov Date: Sat, 7 Nov 2015 10:35:45 +0000 Subject: [PATCH 1/5] Fix "undefined method `join' for String" in Errorifier#error_messages_for --- merb-helpers/lib/merb-helpers/form/builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/merb-helpers/lib/merb-helpers/form/builder.rb b/merb-helpers/lib/merb-helpers/form/builder.rb index 1f63c0e4..c2412077 100644 --- a/merb-helpers/lib/merb-helpers/form/builder.rb +++ b/merb-helpers/lib/merb-helpers/form/builder.rb @@ -411,7 +411,7 @@ def error_messages_for(obj, error_class, build_li, header, before) header_message = header % [errors.size, errors.size == 1 ? "" : "s"] markup = %Q{
#{header_message}
} end From 1fa59751326e821fa1ebc40a1bdd058b41c4f133 Mon Sep 17 00:00:00 2001 From: Daniel Vartanov Date: Mon, 16 Nov 2015 07:14:32 +0000 Subject: [PATCH 2/5] Make merb-helpers compatible with ActiveRecord 3+ --- merb-helpers/lib/merb-helpers/form/builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/merb-helpers/lib/merb-helpers/form/builder.rb b/merb-helpers/lib/merb-helpers/form/builder.rb index c2412077..e5f3f067 100644 --- a/merb-helpers/lib/merb-helpers/form/builder.rb +++ b/merb-helpers/lib/merb-helpers/form/builder.rb @@ -411,7 +411,7 @@ def error_messages_for(obj, error_class, build_li, header, before) header_message = header % [errors.size, errors.size == 1 ? "" : "s"] markup = %Q{
#{header_message}
    } - errors.each_full {|err| markup << (build_li % err)} + errors.full_messages.each { |err| markup << (build_li % err) } markup << %Q{
} end From b8825e0b370b78e113df3077907bb0a1104f1794 Mon Sep 17 00:00:00 2001 From: Daniel Vartanov Date: Sat, 29 Feb 2020 16:57:57 +0000 Subject: [PATCH 3/5] Make Merb compatible with Ruby 2.4+ --- merb-core/lib/merb-core/config.rb | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/merb-core/lib/merb-core/config.rb b/merb-core/lib/merb-core/config.rb index 77f9ad81..8b52264c 100644 --- a/merb-core/lib/merb-core/config.rb +++ b/merb-core/lib/merb-core/config.rb @@ -1,5 +1,14 @@ require "optparse" +# fix issue with Templater and Ruby >= 2.5 +# issue produced by extlib gem required by templater +# extlib add to_hash method to Array class +# Ruby >= 2.5 use it by unrecognized cause and destroy parameter when OptionParser.parse!() called +# so, solution is remove to_hash from Array because no code from Templater use this method +class Array + remove_method :to_hash +end + module Merb class Config @@ -56,7 +65,7 @@ def use yield @configuration nil end - + # Detects whether the provided key is in the config. # # ==== Parameters @@ -156,10 +165,10 @@ def to_yaml def setup(settings = {}) # Merge new settings with any existing configuration settings settings = @configuration.merge(settings) unless @configuration.nil? - + # Merge new settings with default settings config = defaults.merge(settings) - + unless config[:reload_classes] config[:fork_for_class_load] = false end @@ -168,11 +177,11 @@ def setup(settings = {}) unless config.key?(:reap_workers_quickly) config[:reap_workers_quickly] = dev_mode & !config[:cluster] end - + unless config.key?(:bind_fail_fatal) config[:bind_fail_fatal] = dev_mode end - + # Set mutex to dispatcher ::Merb::Dispatcher.use_mutex = config[:use_mutex] @@ -195,7 +204,7 @@ def parse_args(argv = ARGV) # Environment variables always win options[:environment] = ENV["MERB_ENV"] if ENV["MERB_ENV"] - + # Build a parser for the command line arguments opts = OptionParser.new do |opts| opts.version = Merb::VERSION @@ -225,13 +234,13 @@ def parse_args(argv = ARGV) "background.") do |daemon| options[:daemonize] = true end - + opts.on("-N", "--no-daemonize", "This will allow you to run a " \ "cluster in console mode") do |no_daemon| options[:daemonize] = false end - opts.on("-c", "--cluster-nodes NUM_MERBS", Integer, + opts.on("-c", "--cluster-nodes NUM_MERBS", Integer, "Number of merb daemons to run.") do |nodes| options[:daemonize] = true unless options.key?(:daemonize) options[:cluster] = nodes @@ -352,7 +361,7 @@ def parse_args(argv = ARGV) port = "main" if port == "all" options[:port] = port end - + opts.on("--fast-deploy", "Reload the code, but not your" \ "init.rb or gems") do options[:action] = :fast_deploy From beca49640c43fd6eb9dba030d3d1e003481b4e21 Mon Sep 17 00:00:00 2001 From: Daniel Vartanov Date: Sat, 29 Feb 2020 16:58:12 +0000 Subject: [PATCH 4/5] Check in an often happening change --- merb-slices/bin/slice | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 merb-slices/bin/slice diff --git a/merb-slices/bin/slice b/merb-slices/bin/slice old mode 100644 new mode 100755 From 34f817dd81f284f50ac87f1c48d30ab7f0d054bb Mon Sep 17 00:00:00 2001 From: Daniel Vartanov Date: Sat, 29 Feb 2020 17:59:40 +0000 Subject: [PATCH 5/5] Make Merb work with Ruby 2.7.0 --- merb-core/lib/merb-core/gem_ext/erubis.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/merb-core/lib/merb-core/gem_ext/erubis.rb b/merb-core/lib/merb-core/gem_ext/erubis.rb index eb92107a..096e419f 100644 --- a/merb-core/lib/merb-core/gem_ext/erubis.rb +++ b/merb-core/lib/merb-core/gem_ext/erubis.rb @@ -61,9 +61,9 @@ def convert_input(src, input) rest = pos == 0 ? input : input[pos..-1] # ruby1.9 add_text(src, rest) end - + end - + class MEruby < Erubis::Eruby include PercentLineEnhancer include StringBufferEnhancer @@ -78,7 +78,7 @@ class MEruby < Erubis::Eruby # binding. # # :api: private - def self.load_yaml_file(file, binding = binding) + def self.load_yaml_file(file, binding = binding()) YAML::load(Erubis::MEruby.new(IO.read(File.expand_path(file))).result(binding)) end end