docile 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7dae1c209d04576cf98b4d080a44f659eaf7ed41dccf942bec2ff95c44db5e8
4
- data.tar.gz: 3209a17a2588ba8c873fddd9b5c219ea6e7b73d3fcb3575997b347480abc622a
3
+ metadata.gz: 2ec44492080efa6904814a34b09c7a93752906ba4070beea5d45c3d76ac18389
4
+ data.tar.gz: 9808b41d9302b87b12a1e12c4d54f7868bf36729d4926060428f150bf21c40e3
5
5
  SHA512:
6
- metadata.gz: 714bafc9545d9ccc0037fdb5c9fa8ff016a6f5f3df3c758ca16b225e371758cb3b00f2afb85763eef87576686192b129a53f1b21e2ee4f34089bdd6ad58ffd54
7
- data.tar.gz: bb82951b411c16cd720bdf9c359f43f4e38c9fa71815d336ee45bc240eeb7d9e2de1922dacdaad84ebfffdfdb54a25bf023302a0fe487a1507d102d9e59dfcae
6
+ metadata.gz: 1e7b588573947c3589f24d4f14d6506a44bc96f5000c94d9d1746f59c5d79259fafa4b7bc706a5718fe7bf27fa7233b2568bae51a0721954b1592739d178bc85
7
+ data.tar.gz: 84b7e888d30614ef00e123615fbcb4edd2147147eb1e1a0222cf333cb85c74a7ce38e7a1076bd2f33c81f94a0d6f4b9c4342e62f2682cd2a20be016a033274ef
@@ -1,14 +1,9 @@
1
1
  language: ruby
2
2
 
3
- # Apparently sudo is required to test on Rubinius and JRuby-head
4
- sudo: required
5
-
6
- # See https://docs.travis-ci.com/user/languages/ruby/#Rubinius
7
- dist: trusty
8
-
9
3
  rvm:
10
4
  # MRI
11
5
  - ruby-head
6
+ - 2.7
12
7
  - 2.6
13
8
  - 2.5
14
9
  - 2.4
@@ -16,18 +11,27 @@ rvm:
16
11
  - 2.2
17
12
  - 2.1
18
13
  - 1.9.3
19
- - 1.8.7
20
- - ree
21
14
  # JRuby
22
15
  - jruby-head
23
- - jruby-9.1
24
- - jruby-9.0
25
- # Rubinius
26
- - rubinius-3
16
+ - jruby-9.2
17
+ # Truffleruby
18
+ - truffleruby-head
19
+ - truffleruby-20.3.0
27
20
 
28
- matrix:
21
+ jobs:
29
22
  allow_failures:
30
23
  - rvm: ruby-head
31
24
  - rvm: jruby-head
32
- - rvm: rubinius-3
25
+ - rvm: truffleruby-head
26
+ # NOTE (2020-12-18): Failing access to Rubygems with following error:
27
+ # Unable to download data from https://rubygems.org/ - hostname was not
28
+ # match with the server certificate (https://rubygems.org/specs.4.8.gz)
29
+ #
30
+ # See Travis CI topic here:
31
+ # https://travis-ci.community/t/ruby-1-8-7-and-ree-builds-broken-by-ssl-certificate-failure/10866
32
+ #
33
+ # TODO (2020-12-18): Either find a fix or remove testing of 1.8 versions
34
+ - rvm: 1.8.7
35
+ - rvm: ree
36
+
33
37
  fast_finish: true
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ require File.expand_path("on_what", File.dirname(__FILE__))
2
2
  source "https://rubygems.org"
3
3
 
4
4
  # Travis-only dependencies go here
5
- if on_travis? && !on_1_8? && !on_rubinius?
5
+ if on_travis? && !on_less_than_2_3? && !on_rubinius?
6
6
  group :test do
7
7
  gem "codecov", ">= 0.0.9", :require => false
8
8
  end
data/HISTORY.md CHANGED
@@ -1,9 +1,15 @@
1
1
  # HISTORY
2
2
 
3
- ## [Unreleased changes](http://github.com/ms-ati/docile/compare/v1.3.2...master)
3
+ ## [Unreleased changes](http://github.com/ms-ati/docile/compare/v1.3.3...master)
4
4
 
5
5
  - ...
6
6
 
7
+ ## [v1.3.3 (Dec 18, 2020)](http://github.com/ms-ati/docile/compare/v1.3.2...v1.3.3)
8
+
9
+ - Special thanks (again!) to Taichi Ishitani (@taichi-ishitani):
10
+ - Fix keyword arg warnings on Ruby 2.7 (issue #44, PR #45)
11
+ - Filter Docile's source files from backtrace (issue #35, PR #36)
12
+
7
13
  ## [v1.3.2 (Jun 12, 2019)](http://github.com/ms-ati/docile/compare/v1.3.1...v1.3.2)
8
14
 
9
15
  - Special thanks (again!) to Taichi Ishitani (@taichi-ishitani):
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2012-2019 Marc Siegel
3
+ Copyright (c) 2012-2021 Marc Siegel
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -374,7 +374,7 @@ Docile releases follow [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.
374
374
 
375
375
  ## Copyright & License
376
376
 
377
- Copyright (c) 2012-2019 Marc Siegel.
377
+ Copyright (c) 2012-2021 Marc Siegel.
378
378
 
379
379
  Licensed under the [MIT License](http://choosealicense.com/licenses/mit/), see [LICENSE](LICENSE) for details.
380
380
 
@@ -2,6 +2,7 @@ require "docile/version"
2
2
  require "docile/execution"
3
3
  require "docile/fallback_context_proxy"
4
4
  require "docile/chaining_fallback_context_proxy"
5
+ require "docile/backtrace_filter"
5
6
 
6
7
  # Docile keeps your Ruby DSLs tame and well-behaved.
7
8
  module Docile
@@ -0,0 +1,22 @@
1
+ module Docile
2
+ # @api private
3
+ #
4
+ # This is used to remove entries pointing to Docile's source files
5
+ # from {Exception#backtrace} and {Exception#backtrace_locations}.
6
+ #
7
+ # If {NoMethodError} is caught then the exception object will be extended
8
+ # by this module to add filter functionalities.
9
+ module BacktraceFilter
10
+ FILTER_PATTERN = /lib\/docile/
11
+
12
+ def backtrace
13
+ super.select { |trace| trace !~ FILTER_PATTERN }
14
+ end
15
+
16
+ if ::Exception.public_method_defined?(:backtrace_locations)
17
+ def backtrace_locations
18
+ super.select { |location| location.absolute_path !~ FILTER_PATTERN }
19
+ end
20
+ end
21
+ end
22
+ end
@@ -82,12 +82,25 @@ module Docile
82
82
 
83
83
  # Proxy all methods, excluding {NON_PROXIED_METHODS}, first to `receiver`
84
84
  # and then to `fallback` if not found.
85
- def method_missing(method, *args, &block)
86
- if @__receiver__.respond_to?(method.to_sym)
87
- @__receiver__.__send__(method.to_sym, *args, &block)
85
+ args_string =
86
+ if RUBY_VERSION >= "2.7.0"
87
+ "*args, **kwargs, &block"
88
88
  else
89
- @__fallback__.__send__(method.to_sym, *args, &block)
89
+ "*args, &block"
90
90
  end
91
- end
91
+ class_eval(<<-METHOD)
92
+ def method_missing(method, #{args_string})
93
+ if @__receiver__.respond_to?(method.to_sym)
94
+ @__receiver__.__send__(method.to_sym, #{args_string})
95
+ else
96
+ begin
97
+ @__fallback__.__send__(method.to_sym, #{args_string})
98
+ rescue NoMethodError => e
99
+ e.extend(BacktraceFilter)
100
+ raise e
101
+ end
102
+ end
103
+ end
104
+ METHOD
92
105
  end
93
106
  end
@@ -1,4 +1,4 @@
1
1
  module Docile
2
2
  # The current version of this library
3
- VERSION = "1.3.2"
3
+ VERSION = "1.3.3"
4
4
  end
data/on_what.rb CHANGED
@@ -24,3 +24,7 @@ end
24
24
  def on_less_than_2_0?
25
25
  RUBY_VERSION < "2.0.0"
26
26
  end
27
+
28
+ def on_less_than_2_3?
29
+ RUBY_VERSION < "2.3.0"
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Siegel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-12 00:00:00.000000000 Z
11
+ date: 2020-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -114,6 +114,7 @@ files:
114
114
  - Rakefile
115
115
  - docile.gemspec
116
116
  - lib/docile.rb
117
+ - lib/docile/backtrace_filter.rb
117
118
  - lib/docile/chaining_fallback_context_proxy.rb
118
119
  - lib/docile/execution.rb
119
120
  - lib/docile/fallback_context_proxy.rb
@@ -123,7 +124,7 @@ homepage: https://ms-ati.github.io/docile/
123
124
  licenses:
124
125
  - MIT
125
126
  metadata: {}
126
- post_install_message:
127
+ post_install_message:
127
128
  rdoc_options: []
128
129
  require_paths:
129
130
  - lib
@@ -138,9 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
139
  - !ruby/object:Gem::Version
139
140
  version: '0'
140
141
  requirements: []
141
- rubyforge_project:
142
- rubygems_version: 2.7.9
143
- signing_key:
142
+ rubygems_version: 3.0.8
143
+ signing_key:
144
144
  specification_version: 4
145
145
  summary: Docile keeps your Ruby DSLs tame and well-behaved.
146
146
  test_files: []