Skip to content

Commit

Permalink
Fix bin/console script
Browse files Browse the repository at this point in the history
- Avoid error when trying to run `binding.pry`, as `pry-byebug` is not
  part of the bundle.
- Remove code probably used for debugging at some point.
- Depend on standard `irb`.
  • Loading branch information
waiting-for-dev committed Oct 2, 2023
1 parent a3895a5 commit 1d444c9
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,5 @@ require "dry/monads/all"

M = Dry::Monads

# 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"

class Foo
include Dry::Monads[:result, :do]

def self.unwrap(method_name)
meth = instance_method(method_name)
undef_method(method_name)

define_method(method_name) do |value|
meth.bind_call(self, **value)
end
end

def first(a)
Success(x: a)
end

unwrap \
def second(x:) # rubocop:disable Lint/UnusedMethodArgument
Success(:anything)
end

def call(a)
first(a).bind(&method(:second))
end
end

obj = Foo.new

binding.pry

p
require "irb"
IRB.start(__FILE__)

0 comments on commit 1d444c9

Please sign in to comment.