diff --git a/lib/rggen/core/core_extensions/module.rb b/lib/rggen/core/core_extensions/module.rb index a9c8179..d708d83 100644 --- a/lib/rggen/core/core_extensions/module.rb +++ b/lib/rggen/core/core_extensions/module.rb @@ -9,4 +9,20 @@ def define_private_method(name, body = nil) body ||= proc if block_given? define_method(name, body).tap { private(name) } end + + # workaround for following issue + # https://github.com/rubyworks/facets/issues/286 + def attr_setter(*args) + code, made = +'', [] + args.each do |a| + code << %{ + def #{a}(*args) + args.size > 0 ? ( @#{a}=args[0] ; self ) : @#{a} + end + } + made << "#{a}".to_sym + end + module_eval code + made + end end diff --git a/lib/rggen/core/facets.rb b/lib/rggen/core/facets.rb index 5f49bc6..760a141 100644 --- a/lib/rggen/core/facets.rb +++ b/lib/rggen/core/facets.rb @@ -1,7 +1,6 @@ require 'facets/array/merge' require 'facets/file/ext' require 'facets/hash/symbolize_keys' -require 'facets/module/attr_setter' require 'facets/pathname/to_path' require 'facets/string/variablize' require 'facets/symbol/variablize'