-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f49634e
commit d051849
Showing
13 changed files
with
43 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ group :test do | |
end | ||
|
||
group :tools do | ||
gem "yard" | ||
gem "byebug", platform: :mri | ||
gem "pry" | ||
gem "yard" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
require 'bundler/setup' | ||
require 'dry-matcher' | ||
require "bundler/setup" | ||
require "dry-matcher" | ||
|
||
# You can add fixtures and/or initialization code here to make experimenting | ||
# with your gem easier. You can also use a different console, if you like. | ||
|
||
# (If you use this, don't forget to add pry to your Gemfile!) | ||
require 'pry' | ||
require "pry" | ||
|
||
binding.pry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'dry/core/deprecations' | ||
require 'dry/matcher/result_matcher' | ||
require "dry/core/deprecations" | ||
require "dry/matcher/result_matcher" | ||
|
||
module Dry | ||
class Matcher | ||
extend Dry::Core::Deprecations[:'dry-matcher'] | ||
extend Dry::Core::Deprecations[:"dry-matcher"] | ||
|
||
EitherMatcher = ResultMatcher | ||
|
||
deprecate_constant(:EitherMatcher, message: 'Dry::Matcher::ResultMatcher') | ||
deprecate_constant(:EitherMatcher, message: "Dry::Matcher::ResultMatcher") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'dry/matcher' | ||
require "dry/matcher" | ||
|
||
# rubocop:disable Style/CaseEquality | ||
module Dry | ||
class Matcher | ||
PatternMatch = ::Proc.new do |value, patterns| | ||
PatternMatch = proc do |value, patterns| | ||
if patterns.empty? | ||
value | ||
# rubocop:disable Lint/DuplicateBranch | ||
elsif value.is_a?(::Array) && patterns.any? { |p| p === value[0] } | ||
value | ||
elsif patterns.any? { |p| p === value } | ||
# rubocop:enable Lint/DuplicateBranch | ||
value | ||
else | ||
Undefined | ||
end | ||
end | ||
end | ||
end | ||
# rubocop:enable Style/CaseEquality |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
|
||
module Dry | ||
class Matcher | ||
VERSION = '0.10.0' | ||
VERSION = "0.10.0" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters