Skip to content

Commit

Permalink
removed workaround for rubyworks/facets#286
Browse files Browse the repository at this point in the history
  • Loading branch information
taichi-ishitani committed Mar 5, 2019
1 parent 89366c0 commit 6dff795
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ matrix:
- rvm: 2.3.3
- rvm: 2.3.8
- rvm: 2.4.5
env: RUBYOPT=--enable-frozen-string-literal
env: RUBYOPT=--enable-frozen-string-literal USE_FIXED_GEMS=yes USE_GITHUB_REPOSITORY=yes
- rvm: 2.5.3
env: RUBYOPT=--enable-frozen-string-literal
env: RUBYOPT=--enable-frozen-string-literal USE_FIXED_GEMS=yes USE_GITHUB_REPOSITORY=yes
- rvm: 2.6.1
env: RUBYOPT=--enable-frozen-string-literal
env: RUBYOPT=--enable-frozen-string-literal USE_FIXED_GEMS=yes USE_GITHUB_REPOSITORY=yes

before_install:
- "env -u RUBYOPT gem update --system"
Expand Down
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in rggen-core.gemspec
gemspec

if ENV['USE_FIXED_GEMS']
['facets'].each do |library|
library_path = File.expand_path("../#{library}", __dir__)
if Dir.exist?(library_path) && !ENV['USE_GITHUB_REPOSITORY']
gem library, path: library_path
else
gem library, path: "https://github.com/taichi-ishitani/#{library}.git"
end
end
end

group :develop do
gem 'rake'
gem 'rspec', '>= 3.3'
Expand Down
13 changes: 0 additions & 13 deletions lib/rggen/core/core_extensions/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,4 @@ 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)
args.map do |a|
module_eval(<<~CODE, __FILE__, __LINE__ + 1)
def #{a}(*args)
args.size > 0 ? ( @#{a}=args[0] ; self ) : @#{a}
end
CODE
a.to_s.to_sym
end
end
end
1 change: 1 addition & 0 deletions lib/rggen/core/facets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
require 'facets/file/ext'
require 'facets/hash/symbolize_keys'
require 'facets/pathname/to_path'
require 'facets/module/attr_setter'
require 'facets/string/variablize'
require 'facets/symbol/variablize'

0 comments on commit 6dff795

Please sign in to comment.