havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.4, 2.5.6, 2.7.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
poontangmessiah has quit [Remote host closed the connection]
jaequery has quit [Ping timeout: 276 seconds]
banister_ has joined #ruby
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
Guest11997 has quit [Ping timeout: 240 seconds]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
banister_ has quit [Ping timeout: 276 seconds]
dasher00 has quit [Ping timeout: 245 seconds]
yqt has quit [Ping timeout: 276 seconds]
johnny56 has quit [Ping timeout: 240 seconds]
znz_jp has quit [Remote host closed the connection]
leitz has quit [Quit: Leaving]
b0nn has quit [Read error: Connection reset by peer]
r3m has quit [Quit: WeeChat 2.6-rc2]
r3m has joined #ruby
znz_jp has joined #ruby
tdy has joined #ruby
grilix has quit [Read error: Connection reset by peer]
grilix has joined #ruby
arahael2 has joined #ruby
arahael1 has quit [Ping timeout: 258 seconds]
b0nn has joined #ruby
jenrzzz has joined #ruby
<havenwood> ryouba: How about this take on refined autovivificiousness? https://gist.github.com/havenwood/926f78768e357bda470d5fe97ded5c08
<havenwood> ryouba: One nice thing about this way compared to your example is you end up creating fewer default procs (just one) in the case of multiple autovivifying Hashes.
<havenwood> ryouba: Another nice thing is you end up only polluting Hash globally with only a single private constant rather than a public method.
<havenwood> ryouba: (In your example, each new Hash also means a new Proc.)
cthulchu has quit [Ping timeout: 246 seconds]
<havenwood> Another way to achieve the same is to use Hash#fetch and create a vivifying Hash as the fallback value.
Azure has joined #ruby
<havenwood> So either have a Hash that knows its default value is a vivifying Hash or use Hash#fetch with a block for a new vivifying Hash as the default value.
ap4y has quit [Ping timeout: 264 seconds]
<havenwood> h.fetch(:foo) { Hash.new(&VIVIFIED_PROC) }
<havenwood> But nobody wants to write that, so #default and #default_proc.
<havenwood> I don't mind the #default_proc in this case. I do think it makes sense to only have a single Proc rather than creating one for each Hash.
<havenwood> VIVIFIED_PROC = ->(hash, key) { hash[key] = Hash.new &VIVIFIED_PROC }.freeze
<havenwood> h.default_proc = VIVIFIED_PROC
<baweaver> havenwood: want a challenge?
<baweaver> Make an indiscriminate vivified hash
<baweaver> i.e. if it gets an Integer it uses an Array instead
<havenwood> baweaver: Refined indiscriminate autoviviciousness?
<havenwood> baweaver: :D
<leftylink> &>> h = ->f{f[f]}[->f{Hash.new{|h,k|h[k]=f[f]}}]; h[:a][:b][:c] = 5; p h
<rubydoc> # => {:a=>{:b=>{:c=>5}}} (https://carc.in/#/r/7jao)
<adam12> O_O
DaRock has joined #ruby
<leftylink> as https://stackoverflow.com/a/17585165 says. "Obviously."
<leftylink> ... I know it's not refined
<leftylink> I had better read the context
<havenwood> baweaver: Which begs the question, what's an autovivifying Array. :P
<havenwood> ?
<leftylink> oh, hmm, I guess since the original one wasn't refined anyway then shrug. but to actually answer thee original thing... kinda sounds like this needs the Smalltalk `become:`
<baweaver> havenwood: Now that's a fun question
<baweaver> Not sure.
howdoi has joined #ruby
dviola has quit [Quit: WeeChat 2.6]
<havenwood> baweaver: Challenge accepted.
<baweaver> havenwood: a thought: Array-like methods applied to a wrapper class that intercepts and changes its render on iteration
involans has quit [Remote host closed the connection]
Fernando-Basso has quit [Remote host closed the connection]
r3m has quit [Quit: WeeChat 2.6-rc2]
ramfjord has quit [Ping timeout: 268 seconds]
greypack has quit [Ping timeout: 245 seconds]
r3m has joined #ruby
grilix has quit [Ping timeout: 276 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ap4y has joined #ruby
<teardown> i wish set math worked on hashs
greypack has joined #ruby
henninb has joined #ruby
involans has joined #ruby
<teardown> i suppose that im lazy
baojg has joined #ruby
johnny56 has joined #ruby
AJA4350 has quit [Quit: AJA4350]
<baweaver> teardown: Sets exist in Ruby
<baweaver> that, and hashes at least have some set operations
ap4y has quit [Remote host closed the connection]
ap4y has joined #ruby
<baweaver> havenwood: Is something like this in the bug tracker yet?: https://gist.github.com/baweaver/70cdeee5170f4a1b48b6b8c83858a498
<baweaver> can't find it.
esrse has joined #ruby
henninb has quit [Quit: Lost terminal]
jacksoow_ has quit [Read error: Connection reset by peer]
jacksoow has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rudd0^ has quit [Ping timeout: 245 seconds]
weilawei has joined #ruby
<weilawei> Dear rubyists, I have sinned xD I'm pretty sure that using included, include, class_exec, and Object.set_const to swap in test stubs is some violation of physics.
<weilawei> It's ugly, but reasons.
<weilawei> Out of my hands.
Exuma has joined #ruby
Rudd0 has joined #ruby
<weilawei> Don't even bring up rspec. >< The whole business is distinctly smelly. The requirement came down to: because Reasons, the test stub class must be swapped into the scope of another class just before an instance method is called on it.. that calls a class method on the class swapped in
<baweaver> weilawei: *gasps*
<baweaver> You didn't use prepend
<baweaver> that would make it more fun!
* baweaver is a known bad influence
<baweaver> just ask havenwood
<baweaver> weilawei: This might help if you want examples: https://dev.to/baweaver/decorating-ruby-part-three-prepending-decoration-1ehc
<weilawei> Thanks baweaver, I'll check that out in the morning after my brain resets.
<baweaver> There was a gem somewhere which allows for temporary inclusion / prepending
<baweaver> need to find where that was
hutch has quit [Ping timeout: 250 seconds]
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
beanie__ has joined #ruby
beanie__ has quit [Client Quit]
openCircuit__ has joined #ruby
weilawei has quit [Ping timeout: 260 seconds]
openCircuit__ has quit [Ping timeout: 268 seconds]
ap4y has quit [Ping timeout: 276 seconds]
pwnd_nsfw` has joined #ruby
elcontrastador has joined #ruby
pwnd_nsfw has quit [Ping timeout: 245 seconds]
x86sk has joined #ruby
DaRock has quit [Ping timeout: 246 seconds]
tdy has quit [Ping timeout: 268 seconds]
wilbert has joined #ruby
wilbert_ has joined #ruby
wilbert has quit [Ping timeout: 246 seconds]
schne1der has joined #ruby
wilbert_ has quit [Quit: wilbert_]
openCircuit__ has joined #ruby
openCircuit__ has quit [Ping timeout: 245 seconds]
thexa4 has joined #ruby
_whitelogger has joined #ruby
openCircuit__ has joined #ruby
Leopere has joined #ruby
openCircuit__ has quit [Ping timeout: 276 seconds]
Leopere has quit [Client Quit]
Intelo has quit [Remote host closed the connection]
openCircuit__ has joined #ruby
sauvin has joined #ruby
Inline has quit [Quit: Leaving]
schne1der has quit [Ping timeout: 246 seconds]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
openCircuit__ has quit [Ping timeout: 276 seconds]
schaerli has joined #ruby
ur5us has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
thexa4 has quit [Quit: My computer has gone to sleep. ZZZzzz…]
fphilipe has joined #ruby
absolutejam3 has joined #ruby
<al2o3-cr> morning fun, the next 10 dates are palindromes.
<al2o3-cr> &>> require 'date'; (Date.new(2019,9,10)..Date.new(2019,9,19)).map { |date| date.strftime("%-m%d%y") }
<rubydoc> # => ["91019", "91119", "91219", "91319", "91419", "91519", "91619", "91719", "91819", "91919"] (https://carc.in/#/r/7jcr)
openCircuit__ has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.6]
openCircuit__ has quit [Ping timeout: 276 seconds]
oetjenj has joined #ruby
schne1der has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> ["12021", "12121", "12221", "12321", "12421", "12521", "12621", "12721", "12821", "12921"]
oetjenj has joined #ruby
<baweaver> Welcome back havenwood \
oetjenj has quit [Client Quit]
<baweaver> Any luck with the nightmare challenge?
<havenwood> baweaver: o/
oetjenj has joined #ruby
tdy has joined #ruby
oetjenj has quit [Client Quit]
<havenwood> baweaver: I... made... something. Definitely not a working reverse dig. Then went to dinner. :)
<baweaver> Still trying to figure something out myself
<havenwood> baweaver: It turns out an autovivifying Array is pretty funny.
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
<baweaver> Oh?
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
<havenwood> baweaver: calling out of index bounds is much more odd than a missing key
oetjenj has quit [Client Quit]
<havenwood> baweaver: (for triggering a default value)
oetjenj has joined #ruby
openCircuit__ has joined #ruby
<baweaver> The only thing I can figure is wrapping it
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
cd has quit [Quit: cd]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
openCircuit__ has quit [Ping timeout: 245 seconds]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
Huck777 has quit [Ping timeout: 268 seconds]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
TomyLobo has quit [Read error: Connection reset by peer]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
Intelo has joined #ruby
<havenwood> baweaver: looks like something you'd be up to here :) https://github.com/zverok/hm/blob/master/examples/weather.rb
<baweaver> I saw Zverok
openCircuit__ has joined #ruby
fphilipe has quit [Ping timeout: 276 seconds]
openCircuit__ has quit [Ping timeout: 268 seconds]
absolutejam3 has quit [Ping timeout: 276 seconds]
dionysus69 has joined #ruby
TomyWork has joined #ruby
chalkmonster has joined #ruby
emptyflask has quit [Ping timeout: 244 seconds]
fphilipe has joined #ruby
fphilipe has quit [Read error: Connection reset by peer]
fphilipe has joined #ruby
chens has joined #ruby
chalkmonster has quit [Client Quit]
DaRock has joined #ruby
queip has joined #ruby
TomyWork has quit [Ping timeout: 246 seconds]
paraxial has quit [Quit: The Lounge - https://thelounge.chat]
paraxial has joined #ruby
paraxial has quit [Ping timeout: 246 seconds]
absolutejam3 has joined #ruby
paraxial has joined #ruby
ramfjord has joined #ruby
dbugger has joined #ruby
elcontrastador has quit [Ping timeout: 240 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 276 seconds]
Nicmavr has joined #ruby
_whitelogger has joined #ruby
lnx has joined #ruby
openCircuit__ has joined #ruby
openCircuit__ has quit [Ping timeout: 245 seconds]
nowhere_man has joined #ruby
dbugger has quit [Quit: Leaving]
nowhere_man has quit [Ping timeout: 276 seconds]
fphilipe has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
fphilipe has joined #ruby
tdy has quit [Ping timeout: 276 seconds]
planigan has quit [Ping timeout: 245 seconds]
planigan has joined #ruby
FastJack has quit [Ping timeout: 264 seconds]
Furai has quit [Quit: WeeChat 2.6]
Furai has joined #ruby
fphilipe has quit [Read error: Connection reset by peer]
fphilipe has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
x86sk has quit [Quit: Connection closed for inactivity]
cyclonis has joined #ruby
Emmanuel_Chanel_ has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 245 seconds]
ellcs has joined #ruby
cyclonis has quit [Read error: Connection reset by peer]
cyclonis has joined #ruby
nowhere_man has quit [Ping timeout: 246 seconds]
tsujp has joined #ruby
chalkmonster has joined #ruby
greypack has quit [Ping timeout: 276 seconds]
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 276 seconds]
reber has joined #ruby
DaRock has quit [Read error: Connection reset by peer]
involans has quit [Quit: involans]
involans has joined #ruby
involans has quit [Client Quit]
DaRock has joined #ruby
deathwishdave has joined #ruby
absolutejam3 has quit [Ping timeout: 246 seconds]
cgfbee has quit [Remote host closed the connection]
chens has quit [Read error: Connection reset by peer]
DaRock has quit [Read error: Connection reset by peer]
chens has joined #ruby
absolutejam3 has joined #ruby
fphilipe has quit [Read error: Connection reset by peer]
fphilipe has joined #ruby
cgfbee has joined #ruby
Skarlso has quit [Quit: The Lounge - https://thelounge.chat]
openCircuit__ has joined #ruby
chens has quit [Remote host closed the connection]
Skarlso has joined #ruby
openCircuit__ has quit [Ping timeout: 244 seconds]
Skarlso has quit [Quit: The Lounge - https://thelounge.chat]
Skarlso has joined #ruby
dasher00 has joined #ruby
TomyWork has joined #ruby
rem_ has joined #ruby
MrCrackPotBuilde has quit [Quit: Something went wrong again oh the joys]
Huck777 has joined #ruby
GodFather has quit [Ping timeout: 246 seconds]
AJA4350 has joined #ruby
dhollinger has quit [Ping timeout: 245 seconds]
dhollinger has joined #ruby
ramfjord has joined #ruby
grilix has joined #ruby
involans has joined #ruby
tobiasvl has quit [Ping timeout: 252 seconds]
ramfjord has quit [Ping timeout: 276 seconds]
involans has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
involans has joined #ruby
banisterfiend has joined #ruby
tvl has joined #ruby
tvl is now known as tobiasvl
thexa4 has joined #ruby
DaRock has joined #ruby
Fischmiep has joined #ruby
zenspider has quit [Quit: bye]
zenspider has joined #ruby
esrse has quit [Ping timeout: 268 seconds]
openCircuit__ has joined #ruby
openCircuit__ has quit [Ping timeout: 246 seconds]
GodFather has joined #ruby
grilix has quit [Read error: Connection reset by peer]
grilix has joined #ruby
ua_ has joined #ruby
ua has quit [Ping timeout: 258 seconds]
arahael3 has joined #ruby
arahael2 has quit [Ping timeout: 240 seconds]
involans has quit [Quit: involans]
involans has joined #ruby
hutch has joined #ruby
shakes has joined #ruby
involans has quit [Read error: Connection reset by peer]
hightower2 has joined #ruby
cyclonis has quit [Read error: Connection reset by peer]
lucasb has joined #ruby
poontangmessiah has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grilix has quit [Ping timeout: 246 seconds]
banisterfiend has joined #ruby
teclator has quit [Ping timeout: 245 seconds]
banisterfiend has quit [Client Quit]
teclator has joined #ruby
shakes has quit [Ping timeout: 276 seconds]
teclator has quit [Ping timeout: 268 seconds]
teclator has joined #ruby
involans has joined #ruby
involans has quit [Remote host closed the connection]
involans has joined #ruby
banisterfiend has joined #ruby
GodFather has quit [Ping timeout: 246 seconds]
markand has joined #ruby
<markand> hello there
schne1der has quit [Ping timeout: 245 seconds]
<markand> I have some troubles compiling native gems on a llvm toolchain
jud has quit [Ping timeout: 258 seconds]
<markand> mostly because ruby.h includes <cmath> in a extern "C" {} block which triggers an error in libc++
<markand> code snippet that triggers the error: https://pastebin.com/iLm7nSZt
<ruby[bot]> markand: as I told you already, please use https://gist.github.com
hightower2 has quit [Ping timeout: 244 seconds]
cycloni89 has joined #ruby
schaerli has quit [Ping timeout: 246 seconds]
john2496 has joined #ruby
cycloni89 has quit [Quit: -a- IRC for Android 2.1.54]
howdoi has quit [Quit: Connection closed for inactivity]
grilix has joined #ruby
Rapture has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leitz has joined #ruby
lefterisnik has joined #ruby
GodFather has joined #ruby
<lefterisnik> hi guys, does anybody know to stub the `define_method` only when it takes a specific argument with mocha?
leitz has left #ruby [#ruby]
FrankDW has joined #ruby
deathwishdave has joined #ruby
spacesuitdiver has joined #ruby
DaRock has quit [Ping timeout: 240 seconds]
FastJack has joined #ruby
xtolid has joined #ruby
FastJack has quit [Read error: Connection reset by peer]
openCircuit__ has joined #ruby
<adam12> lefterisnik: What have you tried? and can you share some code?
yqt has joined #ruby
<lefterisnik> adam12: I have tried this `Module.stubs(:define_method).with(:status).returns("incomplete")`
krawchyk has joined #ruby
<adam12> lefterisnik: It's an interesting stub. Why on Module?
<lefterisnik> and it seems that it works but the problem is that the define_method is called many times by different gems and I am getting `Unexpected invocation: #<Class:0x5586b13d5e90>.define_method(:default_url_options)`
openCircuit__ has quit [Ping timeout: 276 seconds]
<adam12> lefterisnik: It makes sense. And it's likely painful on purpose.
<lefterisnik> adam12 because the `define_method` is defined the `class Module`
<adam12> lefterisnik: What are you trying to do, at a higher level?
<adam12> lefterisnik: define_method is setting up a method on the singleton. Do you not have access to that singleton for stubbing directly on it?
<adam12> Actually, it's not on the singleton, but that doesn't matter I guess.
<lefterisnik> adam12: you might be right about that but again that won't fix completely the problem. It will reduce the unexpected invocations only to the singleton calls
<adam12> lefterisnik: Sure, but why can't you stub on the object/class it's defining? Why go all the way up to Module? Unless i'm missing something.
<lefterisnik> adam12 I tried on the class level but it doesn't work because the class registers its methods with the define_method
<adam12> lefterisnik: I'm not sure you'll be able to do what you want with Mocha. You could probably do it manually with some sort of monkeypatch.
<lefterisnik> `Stripe::Subscription.any_instance.stubs(:status).returns("incomplete")` doesn't work because the class `Subscription` (if I have understood right the structure of that class) doesn't have a method with name `status`. It's defined dynamically using the `define_method`
<adam12> lefterisnik: I think this is an indication that you're doing it at the wrong integration point tho.
<adam12> lefterisnik: Ah yes. I think Stripe uses method_missing a bunch.
<lefterisnik> yeap
Intelo has quit [Remote host closed the connection]
hutch has quit [Ping timeout: 264 seconds]
<adam12> lefterisnik: do you have access to the subscription somewhere? perhaps you could just `def subscription.status; "incomplete"; end`
<lefterisnik> adam12: You mentioned `You could probably do it manually with some sort of monkeypatch.` can you point me to guide?
<lefterisnik> adam12: You mentioned `You could probably do it manually with some sort of monkeypatch.` can you point me to a guide?
<lefterisnik> adam12: I don't have access to the subscription object. The subscription object is created by that function that I want to test
<adam12> lefterisnik: Not sure I have one, but there's two steps to it. You want to modify `define_method` on Module. So at test run (presuming you're doing this in tests), you safely modify the define_method method, and then on teardown, you put the define_method back the way it was.
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<adam12> lefterisnik: Possibly using prepend or alias_method. You want to be able to revert the alias/monkey patch, which is what Mocha and/or minitest/mock does.
<adam12> lefterisnik: Can you share the method you're testing that creates the subscription? Maybe there's an opportunity there.
<adam12> (or even better, the full class)
rintaun has joined #ruby
<ruby[bot]> lefterisnik: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<adam12> lefterisnik: How are you testing do_sign_up? Is this an integration test where you're making a web request to test?
<adam12> lefterisnik: And where to you care about status in here?
krawchyk has quit [Quit: krawchyk]
<lefterisnik> adam12: updated gist with the test
<rintaun> I'm trying to understand why Kernel singleton methods are available everywhere, even though Kernel's singleton class isn't in the ancestor chain anywhere... can anyone explain that for me? I also asked about this on SO: https://stackoverflow.com/q/57872724/479561
krawchyk has joined #ruby
Rapture has joined #ruby
<adam12> lefterisnik: I'd say that Integrations::Stripe.create_or_end_trial_on_subscription should be your best bet for stubbing something.
<adam12> lefterisnik: Is that class/module yours or from a gem?
<lefterisnik> my module
<lefterisnik> adam12: Also I added another comment on my gist
<lefterisnik> adam12: might help
<adam12> lefterisnik: Ah I see.
yqt has quit [Ping timeout: 246 seconds]
<adam12> lefterisnik: Does the check_sca method retrieve the sub again or use the one you passed in?
<lefterisnik> adam12: uses the passed in subscription
<adam12> lefterisnik: This is somewhat challenging because you're going through a web request to handle this. A lot of times this is more convenient in some sort of operation/transaction/whatever the cool kids are calling them now, with the Rails controller just being a dumb layer that receives data and returns data.
yqt has joined #ruby
<adam12> lefterisnik: Just for clarity, can you show me the create_or_end_trail__on_subscription method? I think that's going to be where you want to end up.
poontangmessiah has quit [Remote host closed the connection]
absolutejam3 has quit [Ping timeout: 276 seconds]
<lefterisnik> adam12: updated
MrCrackPot has joined #ruby
yqt has quit [Ping timeout: 245 seconds]
MrCrackPot has quit [Max SendQ exceeded]
MrCrackPot has joined #ruby
MrCrackPot has quit [Max SendQ exceeded]
cthulchu has joined #ruby
MrCrackPot has joined #ruby
hightower2 has joined #ruby
MrCrackPot has quit [Remote host closed the connection]
MrCrackPot has joined #ruby
banisterfiend has quit [Ping timeout: 240 seconds]
Fischmiep has quit [Ping timeout: 245 seconds]
<adam12> lefterisnik: I'm still contemplating what I might suggest, but out of curiosity, can you just try monkeypatching that method and see what happens?
<adam12> lefterisnik: Let me help you with the monkeypatch.
<adam12> I'll have to bounce soon.
banister_ has joined #ruby
involans has quit [Ping timeout: 245 seconds]
banisterfiend has joined #ruby
MrCrackPot has quit [Remote host closed the connection]
MrCrackPot has joined #ruby
banister_ has quit [Ping timeout: 244 seconds]
TomyWork has quit [Ping timeout: 246 seconds]
<lefterisnik> cool thanks adam12, let me try that out
banisterfiend has quit [Ping timeout: 276 seconds]
involans has joined #ruby
Guest11997 has joined #ruby
banisterfiend has joined #ruby
<adam12> lefterisnik: I wouldn't be surprised if other tests broke because of it. You'd need a way to clean up somehow. There's ways to do it, which might be an exercise to the reader.
hutch has joined #ruby
emptyflask has joined #ruby
<lefterisnik> adam12: I am getting an error ` module definition in method body (SyntaxError)`
<lefterisnik> when I run my test
<lefterisnik> with you code
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
banisterfiend has quit [Ping timeout: 276 seconds]
baniste__ has joined #ruby
baniste__ has quit [Read error: Connection reset by peer]
schne1der has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
krawchyk has quit [Quit: krawchyk]
krawchyk has joined #ruby
banisterfiend has joined #ruby
banisterfiend has quit [Client Quit]
dretnx has joined #ruby
banisterfiend has joined #ruby
deathwishdave has quit [Quit: Textual IRC Client: www.textualapp.com]
jinie has joined #ruby
GodFather has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
r29v has joined #ruby
fphilipe has quit [Ping timeout: 276 seconds]
hightower2 has quit [Ping timeout: 245 seconds]
r29v has quit [Quit: r29v]
lefterisnik has quit [Remote host closed the connection]
ElFerna has joined #ruby
universa1 has quit [Quit: ZNC 1.6.1+deb1~ubuntu14.04.0 - http://znc.in]
universa1 has joined #ruby
ramfjord has quit [Ping timeout: 276 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
ElFerna has quit [Quit: ElFerna]
openCircuit__ has joined #ruby
ElFerna has joined #ruby
openCircuit__ has quit [Ping timeout: 245 seconds]
kssm has joined #ruby
ramfjord has joined #ruby
greengriminal has joined #ruby
tdy has joined #ruby
oetjenj has joined #ruby
banisterfiend has quit [Ping timeout: 268 seconds]
ElFerna has quit [Quit: ElFerna]
banisterfiend has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
ElFerna has joined #ruby
banisterfiend has quit [Client Quit]
emptyflask has quit [Ping timeout: 245 seconds]
banisterfiend has joined #ruby
involans has quit [Remote host closed the connection]
ravenousmoose has joined #ruby
banister11 has joined #ruby
gix has joined #ruby
dretnx has quit [Quit: Going offline, see ya! (www.adiirc.com)]
dionysus69 has quit [Ping timeout: 240 seconds]
banister11 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
rem_ has quit [Remote host closed the connection]
ElFerna has quit [Ping timeout: 276 seconds]
ElFerna has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
greengriminal has quit [Quit: This computer has gone to sleep]
sauvin has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
greengriminal has joined #ruby
ElFerna has quit [Remote host closed the connection]
ElFerna has joined #ruby
rippa has joined #ruby
gix has quit [Quit: Client exiting]
jenrzzz has joined #ruby
gix has joined #ruby
catbusters has joined #ruby
Leopere has joined #ruby
banisterfiend has quit [Ping timeout: 246 seconds]
absolutejam3 has joined #ruby
absolutejam4 has joined #ruby
absolutejam3 has quit [Ping timeout: 276 seconds]
krawchyk has quit [Quit: krawchyk]
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sameerynho has joined #ruby
jenrzzz_ has joined #ruby
banisterfiend has joined #ruby
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz_ has quit [Ping timeout: 268 seconds]
involans has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
involans has quit [Read error: Connection reset by peer]
involans has joined #ruby
yqt has joined #ruby
Ven`` has joined #ruby
jenrzzz has joined #ruby
john2496 has quit [Remote host closed the connection]
john2496 has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
cyclonis has joined #ruby
krawchyk has joined #ruby
rsenic has quit [Remote host closed the connection]
rsenic has joined #ruby
gix has joined #ruby
ElFerna has quit [Quit: ElFerna]
gix- has quit [Ping timeout: 276 seconds]
krawchyk has quit [Quit: krawchyk]
greypack has joined #ruby
schne1der has quit [Ping timeout: 245 seconds]
yqt has quit [Ping timeout: 240 seconds]
GodFather has quit [Ping timeout: 246 seconds]
GodFather has joined #ruby
snk has joined #ruby
duckpuppy has quit [Quit: ZNC 1.7.4 - https://znc.in]
duckpuppy has joined #ruby
lypsis has quit [Quit: ZNC - https://znc.in]
lypsis has joined #ruby
banister_ has joined #ruby
banisterfiend has quit [Ping timeout: 276 seconds]
hightower2 has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
ap4y has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
iNs has quit [Ping timeout: 260 seconds]
oetjenj has quit [Client Quit]
iNs has joined #ruby
oetjenj has joined #ruby
tdy has quit [Ping timeout: 244 seconds]
oetjenj has quit [Client Quit]
ellcs1 has joined #ruby
catbusters has quit [Quit: Connection closed for inactivity]
ur5us has joined #ruby
GodFather has quit [Ping timeout: 246 seconds]
banister_ has quit [Ping timeout: 268 seconds]
Guest11997 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
<davidw> Given a module like Foo::Bar - is there a method that will return 'Bar' (besides hacking at the string name with regexp or split or something) ?
oetjenj has joined #ruby
grilix has quit [Ping timeout: 268 seconds]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
<leftylink> I am so sorry
<leftylink> &>> module Foo; module Bar; end end; Foo::Bar.methods.select { |meth| ['Bar', :Bar, 'bar', :bar].include?((Foo::Bar.send(meth) rescue :nope)) }
<rubydoc> # => Foo::Bar[] (https://carc.in/#/r/7jho)
ramfjord has quit [Ping timeout: 246 seconds]
Leopere has quit [Quit: The Lounge - https://thelounge.github.io]
john2496 has quit []
bambanx has joined #ruby
Fernando-Basso has joined #ruby
ellcs1 has quit [Ping timeout: 264 seconds]
ramfjord has joined #ruby
greengriminal has quit [Quit: Leaving]
dionysus69 has quit [Ping timeout: 276 seconds]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
poontangmessiah has joined #ruby
absolutejam4 has quit [Ping timeout: 246 seconds]
<havenwood> davidw: Assuming you're not in Rails?
<davidw> havenwood, I'd be curious to see both a Rails and non Rails solution. I ended up hacking the strings up... it works, but isn't very nice looking
<havenwood> davidw: The rails solution is: Foo::Bar.name.demodulize
<davidw> cool, thanks. Looks like it's still basically a stringy thing, but that works
<havenwood> davidw: Yeah, there's nothing other than string munging, unfortunately.
jenrzzz has joined #ruby
<havenwood> davidw: I'd suggest: Foo::Bar.name.rpartition('::').last
<davidw> that seems good
yasumi2136 has joined #ruby
absolutejam4 has joined #ruby
yasumi2136 has quit [Remote host closed the connection]
cyclonis_ has joined #ruby
cyclonis has quit [Ping timeout: 246 seconds]
duderonomy has joined #ruby
cyclonis has joined #ruby
greypack has quit [Quit: All your IRC are belong to ZNC]
cyclonis_ has quit [Ping timeout: 246 seconds]
nowhere_man has joined #ruby
thexa4 has quit [Quit: My computer has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dviola has joined #ruby
davidw has quit [Ping timeout: 276 seconds]
cyclonis has quit [Read error: Connection reset by peer]
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
absolutejam4 has quit [Ping timeout: 246 seconds]
yqt has joined #ruby
duderonomy has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Read error: Connection reset by peer]
greypack has joined #ruby
cyclonis has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fphilipe has joined #ruby
Fernando-Basso has quit [Remote host closed the connection]
davidw has joined #ruby
davidw is now known as Guest77382
thexa4 has joined #ruby
DaRock has joined #ruby
thexa4 has quit [Client Quit]
fphilipe has quit [Ping timeout: 276 seconds]
yqt has quit [Read error: Connection reset by peer]
ukd1 has joined #ruby
emptyflask has joined #ruby
sameerynho has quit [Ping timeout: 240 seconds]