havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
mooser has quit [Ping timeout: 240 seconds]
Guest96 has joined #ruby
Snickers has quit [Quit: Snickers]
Guest16109 has quit [Quit: I have to log off.]
plujon has quit [Remote host closed the connection]
hutch34_ has quit [Ping timeout: 240 seconds]
Channel6 has joined #ruby
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Remote host closed the connection]
BadAtom has quit [Quit: leaving]
GodFather has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mooser has joined #ruby
xenops has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cyphase has quit [Ping timeout: 258 seconds]
DLSteve has joined #ruby
petruff has joined #ruby
petruff has quit [Client Quit]
petruff has joined #ruby
nitric has quit [Ping timeout: 255 seconds]
bmurt has joined #ruby
houhoulis has joined #ruby
charliesome has joined #ruby
millerti has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
Cohedrin has quit [Read error: Connection reset by peer]
HoierM has joined #ruby
Cohedrin has joined #ruby
hinbody has joined #ruby
duderonomy has joined #ruby
Cohedri__ has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ElDoggo has quit [Remote host closed the connection]
Cohedrin has quit [Ping timeout: 255 seconds]
solocshaw has joined #ruby
Vile` has joined #ruby
solocshaw has quit [Client Quit]
jgt1 has joined #ruby
username1 has quit [Ping timeout: 260 seconds]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
jgt has quit [Ping timeout: 240 seconds]
MrBusiness3 has joined #ruby
charliesome has joined #ruby
HoierM_ has joined #ruby
MrBismuth has quit [Ping timeout: 252 seconds]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
HoierM has quit [Ping timeout: 260 seconds]
__Yiota has joined #ruby
amclain has quit [Quit: Leaving]
GodFather has quit [Remote host closed the connection]
GodFather has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ElDoggo has joined #ruby
GodFather has quit [Remote host closed the connection]
_bet0n has left #ruby [#ruby]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rakm has joined #ruby
rakm has quit [Client Quit]
rakm has joined #ruby
GodFather has joined #ruby
rakm has quit [Client Quit]
rgtk has quit [Ping timeout: 240 seconds]
rakm has joined #ruby
phoo1234567 has quit [Quit: Gotta go]
rakm has quit [Client Quit]
GodFather has quit [Remote host closed the connection]
rakm has joined #ruby
rakm has quit [Client Quit]
rakm has joined #ruby
Cohedri__ has quit [Read error: Connection reset by peer]
rakm has quit [Client Quit]
pwnd_nsfw` has joined #ruby
pwnd_nsfw has quit [Ping timeout: 240 seconds]
rakm has joined #ruby
rakm has quit [Client Quit]
Cohedrin has joined #ruby
rakm has joined #ruby
rakm has quit [Client Quit]
rakm has joined #ruby
jrafanie has joined #ruby
rakm has quit [Client Quit]
GodFather has joined #ruby
mim1k has joined #ruby
jdawgaz has joined #ruby
sumobob has quit [Ping timeout: 255 seconds]
rgtk has joined #ruby
mim1k has quit [Ping timeout: 252 seconds]
boombox_ has joined #ruby
sumobob has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
t-recx has quit [Quit: t-recx]
Channel6 has quit [Quit: Leaving]
sumobob has quit [Ping timeout: 258 seconds]
Cohedrin has joined #ruby
negatifze has joined #ruby
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
boombox_ has quit [Remote host closed the connection]
Liothen has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
nerglish has joined #ruby
marcdel has joined #ruby
rakm has joined #ruby
rakm has quit [Client Quit]
rakm has joined #ruby
rakm has quit [Client Quit]
rakm has joined #ruby
rakm has quit [Client Quit]
GodFather has quit [Remote host closed the connection]
rakm has joined #ruby
rakm has quit [Client Quit]
esObe has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rakm has joined #ruby
<nerglish> hi, I'm new to ruby but have done a bunch of python and java. I'm a little confused how modules work. If you have a module whose contents are split across multiple files, then how does ruby know about all the files?
rakm has quit [Client Quit]
cyphase has joined #ruby
rakm has joined #ruby
rakm has quit [Client Quit]
rakm has joined #ruby
rakm has quit [Client Quit]
GodFather has joined #ruby
esObe has quit [Ping timeout: 240 seconds]
LastWhisper____ has joined #ruby
<elomatreb> nerglish: Ruby only knows about the files you explicitely required, there is (usually) not auto loading or file discovery
Fasort has quit [Quit: Leaving]
<Radar> nerglish: any particular context for that? modules within which project?
rgtk has quit [Ping timeout: 252 seconds]
GodFather has quit [Remote host closed the connection]
<nerglish> I have some company code that I'm trying to do some refactoring on, and there's a bunch of files that define classes in a shared module and submodule, and one of them is giving me a NameError: uninitialized constant, and I'm not sure why. Just trying to understand how Ruby handles modules and namespaces.
<Radar> nerglish: is it a rails project?
<nerglish> it might be. I think part of it has a rails front end. It has gem 'rails' in the Gemfile.
skweek has quit [Ping timeout: 268 seconds]
Rodya_ has joined #ruby
GodFather has joined #ruby
ElDoggo has quit [Remote host closed the connection]
sumobob has joined #ruby
petruff has quit [Ping timeout: 240 seconds]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Radar> nerglish: Ok. Rails has some autoloading which might be being depended on here. What's the name of this uninitialized constant and the file it's defined in?
negatifze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
libastral has quit [Ping timeout: 240 seconds]
Fasort has joined #ruby
<nerglish> There's a file lib/agent/request.rb with module Agent class Request. Then there's a file lib/agent/api/extractor.rb with module Agent module Api class Extractor. And the Extractor creates an instance of Request, but is failing to find the Request class
slash_nick has quit [Remote host closed the connection]
libastral has joined #ruby
negatifze has joined #ruby
<nerglish> extractor.rb doesn't explicitly require or require_relative the request.rb, so I'm not sure how it's supposed to figure out about the request.rb file.
mooser has quit [Remote host closed the connection]
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
<Radar> nerglish: Ah. In that case then it should be required. You can stick a `require 'agent/request'` at the top of the extractor file and it should work OK.
Vivekananda has joined #ruby
houhoulis has quit [Remote host closed the connection]
pytuger has quit [Quit: bbs]
shady0wl has joined #ruby
pytuger has joined #ruby
pytuger has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
<wkoszek> I'm looking for a nice Ruby framework for DNS configuration. Something like this: https://github.com/AnalogJ/lexicon but in Ruby
<wkoszek> Any hints?
lmc has quit [Remote host closed the connection]
marcdel has quit [Ping timeout: 240 seconds]
elifoster has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
genpaku has quit [Remote host closed the connection]
ColeHub has quit [Quit: Bye.]
nadir has quit [Quit: Connection closed for inactivity]
genpaku has joined #ruby
dar123 has joined #ruby
iMadper is now known as Madper|SaltedFis
outreachdan has joined #ruby
Madper|SaltedFis is now known as SlatedFishMadper
jdawgaz has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
oz has quit [Ping timeout: 255 seconds]
aurelien` has joined #ruby
daveyboi[m] has quit [Ping timeout: 255 seconds]
travisr has quit [Ping timeout: 255 seconds]
Lord_of_Life has quit [Ping timeout: 240 seconds]
GGMethos has quit [Ping timeout: 240 seconds]
aurelien has quit [Ping timeout: 255 seconds]
mooser has joined #ruby
zack6849 has quit [Ping timeout: 240 seconds]
swills has quit [Ping timeout: 240 seconds]
ixti has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Ping timeout: 245 seconds]
swills has joined #ruby
zack6849 has joined #ruby
zack6849 has joined #ruby
zack6849 has quit [Changing host]
SuperLag has quit [Quit: leaving]
oz has joined #ruby
dar123 has quit [Ping timeout: 245 seconds]
boombox_ has joined #ruby
HoierM_ has quit [Ping timeout: 258 seconds]
GGMethos has joined #ruby
Lord_of_Life has joined #ruby
sumobob has quit [Ping timeout: 252 seconds]
boombox_ has quit [Ping timeout: 255 seconds]
Eiam has quit [Ping timeout: 240 seconds]
esObe has joined #ruby
daveyboi[m] has joined #ruby
evie_hammond has quit [Quit: WeeChat 1.7]
travisr has joined #ruby
esObe has quit [Ping timeout: 255 seconds]
PorcoRex has joined #ruby
<PorcoRex> Hello Ruby!
dasher^0_o has quit [Ping timeout: 240 seconds]
pwnd_nsfw` is now known as pwnd_nsfw
volty has joined #ruby
pilne has quit [Quit: Quitting!]
domgetter has joined #ruby
<PorcoRex> I've just released a gem for implementing the multiton pattern in Ruby. I would love any and all feedback on it if you feel like reviewing some code here: https://github.com/gdeoliveira/ruby_multiton
wnd has quit [Excess Flood]
wnd has joined #ruby
outreachdan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
swills has quit [Ping timeout: 258 seconds]
rhyselsmore has joined #ruby
swills has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jamesaxl has joined #ruby
br0d1n has quit [Remote host closed the connection]
username_ has joined #ruby
marcdel has joined #ruby
mim1k has joined #ruby
username_ has quit [Ping timeout: 252 seconds]
Blacink has joined #ruby
Blacink has quit [Client Quit]
elifoster has joined #ruby
lmc has joined #ruby
<volty> isn't a simple hash sufficient for the purpose of having unique-by-name instances ?
<cerulean> do you guys prefer easy programming or uneasy programming
mim1k has quit [Ping timeout: 240 seconds]
<volty> easy for working, uneasy for playing
<cerulean> #uniq! might do what you want
<cerulean> actually yes because the keys are unique
lmc has quit [Ping timeout: 268 seconds]
<PorcoRex> volty, hashes doesn't offer semantics on the objects they contain. Granted singleton/multiton objects aren't best suited for most problems, but they may come in handy for some.
<volty> PorcoRex: I didn't read your code. How do you access your instances?
<volty> myself would do something like
<volty> >> class MyObj;end; h = {}; h ||= MyObj.new
<ruby[bot]> volty: # => {} (https://eval.in/778086)
<volty> ops
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<volty> >> class MyObj;end; h = {}; h[:ref_A] ||= MyObj.new
<ruby[bot]> volty: # => #<MyObj:0x40905a34> (https://eval.in/778087)
Rodya_ has joined #ruby
<volty> and if that is enough, we can hide the hash inside a class or module
<PorcoRex> That's one way of going about it, sure. But that's not a multiton, that's just an instance inside a hash.
jdawgaz has joined #ruby
<volty> What is the difference if the instance is inside a hash or elsewhere ?
<PorcoRex> That you have to define the hash as part of your class.
<volty> anyway those instances will be somewhere
<PorcoRex> Plus your implementation isn't thread safe.
<volty> I think it can be made thread safe too.
__Yiota has joined #ruby
<PorcoRex> Of course it could. I'm not following though.
jgt1 has quit [Ping timeout: 252 seconds]
Rodya_ has quit [Ping timeout: 258 seconds]
mooser has quit [Remote host closed the connection]
hndk has joined #ruby
username_ has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Trynemjoel has quit [Ping timeout: 245 seconds]
<volty> PorcoRex: imho you are polluting classes' initializers with the key
<volty> far from clean and transparent
Trynemjoel has joined #ruby
<volty> One has to (re)implement his classes to take into account the 'key'. No way - for me.
username_ has quit [Ping timeout: 240 seconds]
<PorcoRex> volty, I'm not sure I follow. You mean one would have to re-implement their already multiton-like classes to take into account the `initialize` method?
<volty> no, let's say I have already a class that I want to use with multiton
CloCkWeRX has quit [Ping timeout: 260 seconds]
<volty> or let's say I have something complex classes and I don't want to bother thining about 'arg' in my initializers
<volty> the idea could be good, but should be implemented by other means - imho
<PorcoRex> volty, could you elaborate on an example?
<volty> for example hiding out 'new' and creating instances by means of module method
negatifze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<volty> take mine just as hints: e.g. class Mine; extend Multiton; end; end; mine_1 = Mine[:first] // or something like that
jameser_ has joined #ruby
<volty> the name should be given as arg in initialize
<volty> ops, shouldn't
negatifze has joined #ruby
jameser has quit [Ping timeout: 240 seconds]
<PorcoRex> In that case I think you would implement the key as Mine[:first], etc.
<PorcoRex> If I understand correctly.
<volty> I mean define [] on module (if possibile, can't remember now), or something similar, alias new, hide it, and call it from the module method that takes arg as name
<volty> yes
<volty> imho it is going to be more clean
<PorcoRex> Well, it's definitely an option, but I still think the approach of keying directly through #instance is the cleanest approach. There aren't many modules in Ruby that respond to :[] as far as I know.
<volty> you can then implement it as hash or use the (almost) very same code of yours
<volty> nop, named instances are special case, and should be obtained by special means, without polluting initializers
<volty> you'll realize that as soon as you'll need real class cases
<PorcoRex> volty, but don't forget, we're talking about the initializer of a multiton object. Take the Singleton module from the standard lib. for instance: it can't receive any parameters. Ergo, a singleton object can not receive parameters in its initialize method.
Vile` has quit [Ping timeout: 260 seconds]
<PorcoRex> This is the same, except a multiton object can receive parameters in its initialize method. It can either use them, store them or discard them.
<Radar> oh neat you invented genservers in Ruby
<Radar> I kid, I kid.
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<PorcoRex> I'm pretty sure that's a knuckle in my head. But no worries, it's good to talk about approach. Definitely open to make a better implementation.
<PorcoRex> :P
CloCkWeRX has joined #ruby
gix has quit [Ping timeout: 252 seconds]
jdawgaz has joined #ruby
parantapVikram has joined #ruby
<volty> sorry, forgot the limits of default singletons, but anyway for myself I do not care whether ruby's default singletons have params or not. If I was to implement this, I would go for singletons with params. and with whatever else possible
username_ has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Vivekananda has quit [Ping timeout: 260 seconds]
gix has joined #ruby
s2013 has joined #ruby
nerglish has quit [Quit: nerglish]
username_ has quit [Ping timeout: 260 seconds]
<PorcoRex> volty, singletons with parameters would be a bit of a mess because, what would happen when you call an instance with different parameters?
skweek has joined #ruby
astrobunny has joined #ruby
<volty> just one instance -- the 'different parameters' get ignored if already initialized (with initial parameters)
enterprisey has joined #ruby
<PorcoRex> volty, seems a bit arbitrary and error prone for a singleton. It should, in that case, better raise an error.
enterprisey has quit [Remote host closed the connection]
<PorcoRex> Or, alternatively, create a different instance.
pickle_ has joined #ruby
<volty> it all depends on what you need
<PorcoRex> I can agree on that.
<volty> can't we reimplement Singleton.instance, aka SingletonParam < Singleton; and there allow params to be passed to aliased new ? why not
<PorcoRex> volty, that's basically what my gem does.
<PorcoRex> volty, it allows the user to define the construction parameters and create unique instances if the parameters are the same. However I think you mean something a bit different.
<volty> Yes. I like it simple outside and complicated inside (the libs).
marxarelli is now known as marxarelli|afk
<PorcoRex> I do have a use case for this gem. I want to implement something that targets a remote system. I thought about using Singleton, but this external system is not unique (can exist at different URLs). Basically I needed a way to (possibly) leave an open connection to them. I'm not sure, but multiton may help there.
<volty> PorcoRex: I see the multiton as a factory. So I prefer to create those objects calling a class method (as factory)
mooser has joined #ruby
<PorcoRex> volty, it's definitely an alternative, and not a bad one. In case you use a factory you need to keep track of the product, and pass it where you need it.
<volty> But I do not understand your 'remote system' case.
<PorcoRex> In case of a multiton you just ask for it at the "multiton factory". From a programmatic point of view, the factory pattern is definitely cleaner, but I think there are places where something like multiton is better.
negatifze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<PorcoRex> volty, so I want (I think, I need to re-check) to open a connection to a remote system with a particular protocol. I'm not sure, but I might want to keep an open connection with it, hence I need a single instance of the connection object throughout my app.
<volty> writing good libraries is an art, writing abstract libraries is an abstract art :)
<PorcoRex> In any case, it's an approach.
<PorcoRex> Hehe, definitely.
Cohedrin has quit [Read error: Connection reset by peer]
mooser has quit [Ping timeout: 240 seconds]
<volty> you can use class variables and constants
<volty> for that purpose
<PorcoRex> So, the story is, I get distracted thinking about multiton, and then I start working on that instead.
<PorcoRex> volty, class variables in Ruby are the enemy. Just say no. :/
<volty> better streamlined than singletons
Cohedrin has joined #ruby
boombox_ has joined #ruby
username_ has joined #ruby
<volty> you have hashes, structs and openstructs
<volty> more than enough. leave the patterners pattern about their patterns
arquebus has joined #ruby
<PorcoRex> I still think it's a neat way of modularizing behavior. Of course it's not something hard to implement ad-hoc if you need it, but it's pretty transparent to use the gem instead I think.
<PorcoRex> You can just forget about the hashes and the instances and define your multiton class like any other class.
boombox_ has quit [Ping timeout: 258 seconds]
<volty> I do not question your code. The code is nice. What I question is the purpose.
username_ has quit [Ping timeout: 258 seconds]
<PorcoRex> volty, that's fair. I think I did it to use myself, on that other thing I was working on. Hopefully I'll end up using it. :)
Davey has left #ruby ["Textual IRC Client: www.textualapp.com"]
<volty> Think about a concrete case. When are you going to need multiple parameter-less instances of a class ?
Rodya_ has joined #ruby
<volty> No, you are not going to use it, ever ! :)
<PorcoRex> volty, they aren't necessarily parameterless. I mean, you can pass an URL for instance, and use that.
<volty> that doesn't make sense. We have arrays and hashes for that purpose
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<volty> you were talking about classes shutting an 'arg'. Are you going to subclass URL for the sole purpose of extending it with a multiton? Take a sleep, dream about it for a while, and you'll realize it's a nightmare
pickle__ has joined #ruby
<PorcoRex> No, I wasn't talking about URL, or HTTP, I was talking about a different protocol.
Rodya_ has quit [Ping timeout: 258 seconds]
<PorcoRex> Now, as I've said earlier singleton/multiton patterns aren't the best fit for all problems, just for some. I still don't know if it's the best fit for mine.
<volty> Whatever. Whatever they are, they have to be different, and to be different, you have to initialize them differently (by means of parameters of course, otherwise it gets too messy)
pwnd_nsfw has quit [Ping timeout: 240 seconds]
pickle_ has quit [Ping timeout: 252 seconds]
<PorcoRex> In any case, the multiton pattern exists, and I implemented a solution in Ruby. For what it's worth, I think it's a pretty solid implementation.
<volty> Sorry PorcoRex, but the question isn't if it is best for you. The question imho is if there's a case in the whole universe
arquebus has quit [Quit: Leaving]
parantapVikram has quit [Quit: Leaving]
renchan has joined #ruby
Lucky_ABA has quit [Read error: Connection reset by peer]
LastWhisper____ has joined #ruby
<volty> Look. Apart my innate allergy to 'patterns', if left free to pattern, the patterners will pattern the 'spiting behind' too.
<PorcoRex> volty, well, certainly there is. Not to be mean, but solving everything with hashes seems a bit sloppy. The multiton pattern exists, and it has been used. It's not just a theoretical construct.
<volty> Used where?
anisha has joined #ruby
pwnd_nsfw has joined #ruby
<volty> It says: Implementations - In Java, the multiton pattern can be implemented using an enumerated type.
<volty> I say: What a pattern! : )
mzo has joined #ruby
<PorcoRex> volty, haha. Alright, you win.
<PorcoRex> It's probably never useful, but pretty interesting though.
<volty> I used code similar to yours to fake new & initialize on modules. But there it was interesting and useful - for the qt gui
<PorcoRex> I never loved qt.
<volty> qt with ruby is wonderful
<volty> ruby's risking to fall behind python in that respect
<PorcoRex> And qt gui is risking to fall behing web ui nowadays. Far few people use native apps anymore.
<volty> yap, that must be true, but when googling I see pythoners quite active on qt
mooser has joined #ruby
username_ has joined #ruby
<volty> anyway I am studying scala
<volty> now
<PorcoRex> I've heard good things about Scala.
<volty> oood vs worth vs complexity etc etc
Arpanet69 has joined #ruby
<volty> s/oood/good/
<volty> how's ruby on android ?
<PorcoRex> Beats me. No idea really... Maybe once webassembly becomes a thing it can become a think there?
pwnd_nsfw` has joined #ruby
<PorcoRex> thing*
<volty> was nice talking, going to take a rest, bye
volty has quit [Quit: Konversation terminated!]
username_ has quit [Ping timeout: 240 seconds]
mooser has quit [Ping timeout: 258 seconds]
pwnd_nsfw has quit [Ping timeout: 252 seconds]
marcdel has quit [Ping timeout: 252 seconds]
mooser has joined #ruby
bronson has quit [Remote host closed the connection]
bronson has joined #ruby
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cohedrin has joined #ruby
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
username_ has joined #ruby
mim1k has joined #ruby
pickle__ has quit [Remote host closed the connection]
username_ has quit [Ping timeout: 252 seconds]
pickle__ has joined #ruby
lmc has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
Bock has joined #ruby
lmc has quit [Ping timeout: 268 seconds]
nerglish has joined #ruby
bronson has quit [Remote host closed the connection]
patarr has joined #ruby
SuperLag has joined #ruby
hekz has joined #ruby
Rodya_ has joined #ruby
pickle__ has quit [Read error: Connection reset by peer]
patarr has quit [Ping timeout: 258 seconds]
pickle__ has joined #ruby
pickle__ has quit [Remote host closed the connection]
Rodya_ has quit [Ping timeout: 258 seconds]
username_ has joined #ruby
username_ has quit [Ping timeout: 255 seconds]
ElDoggo has joined #ruby
Guest96 has quit [Remote host closed the connection]
Guest96 has joined #ruby
ElDoggo has quit [Ping timeout: 240 seconds]
jusa has joined #ruby
anisha_ has joined #ruby
anisha has quit [Ping timeout: 240 seconds]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Cohedrin has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
elifoster has quit [Quit: zzz]
hndk has quit [Quit: Leaving]
cfec0b8d has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
username_ has joined #ruby
hekz has quit [Quit: quit]
cfec0b8d has quit [Quit: Leaving.]
username_ has quit [Ping timeout: 255 seconds]
CloCkWeRX has quit [Ping timeout: 260 seconds]
cfec0b8d has joined #ruby
<foxmask> bonjello
cfec0b8d has quit [Quit: Leaving.]
alazred has joined #ruby
alazred has joined #ruby
alazred has quit [Changing host]
username_ has joined #ruby
mzo has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
CloCkWeRX has joined #ruby
cfec0b8d has joined #ruby
username_ has quit [Ping timeout: 255 seconds]
Burgestrand has joined #ruby
Rodya_ has joined #ruby
Guest96 has quit [Remote host closed the connection]
Mortomes|Work has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 260 seconds]
Guest96 has joined #ruby
pwnd_nsfw has joined #ruby
Rodya_ has quit [Ping timeout: 240 seconds]
nerglish has quit [Quit: nerglish]
Cohedrin has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bronson has quit [Remote host closed the connection]
Cohedrin has joined #ruby
bronson has joined #ruby
Cohedrin has quit [Client Quit]
pytuger has quit [Quit: "There is no System but GNU and Linux is one of its Kernals"]
Burgestrand has quit [Quit: Good bye and have a nice day!]
shady0wl has quit [Quit: "There is no System but GNU and Linux is one of its Kernals"]
Burgestrand has joined #ruby
shady0wl has joined #ruby
pytuger has joined #ruby
pytuger has joined #ruby
pytuger has quit [Changing host]
default has joined #ruby
nerglish has joined #ruby
shady0wl has quit [Client Quit]
default has left #ruby [#ruby]
yeticry has quit [Ping timeout: 240 seconds]
yeticry has joined #ruby
alazred has quit [Ping timeout: 240 seconds]
username_ has joined #ruby
mooser has quit [Remote host closed the connection]
Cohedrin has joined #ruby
username_ has quit [Ping timeout: 260 seconds]
vali has joined #ruby
binaryplease has joined #ruby
antgel has joined #ruby
meinside has joined #ruby
aurelien` is now known as aurelien
aurelien has quit [Changing host]
aurelien has joined #ruby
PorcoRex has quit [Quit: Leaving]
hutch34_ has joined #ruby
alazred has joined #ruby
alazred has joined #ruby
alazred has quit [Changing host]
jgnagy_ has quit [Remote host closed the connection]
jgnagy has joined #ruby
hutch34_ has quit [Ping timeout: 255 seconds]
charliesome has joined #ruby
sxm has joined #ruby
<sxm> hello!
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sxm> ruby ruby ruby
<sxm> alibaba
dasher^0_o has joined #ruby
mim1k has joined #ruby
<sxm> alibaba
mark_66 has joined #ruby
flying has joined #ruby
lmc has joined #ruby
<sxm> where is here!
mim1k has quit [Ping timeout: 260 seconds]
sxm has quit [Quit: WeeChat 1.7]
lmc has quit [Ping timeout: 240 seconds]
<cerulean> SHOUTS OF ALIBABA
<cerulean> I ALSO BOY YOUR SHOT
<cerulean> o///
cerulean has left #ruby [#ruby]
harfangk has joined #ruby
username_ has joined #ruby
jcao219 has quit [Ping timeout: 252 seconds]
aufi has joined #ruby
patarr has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
nerglish has quit [Quit: nerglish]
username_ has quit [Ping timeout: 252 seconds]
patarr has quit [Ping timeout: 240 seconds]
haraoka has joined #ruby
Rodya_ has joined #ruby
Snickers has joined #ruby
ElDoggo has joined #ruby
rafadc has joined #ruby
esObe has joined #ruby
Rodya_ has quit [Ping timeout: 255 seconds]
ElDoggo has quit [Ping timeout: 255 seconds]
bronson has quit [Remote host closed the connection]
jgt1 has joined #ruby
mim1k has joined #ruby
rhyselsmore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
andikr has joined #ruby
rafadc has quit [Ping timeout: 240 seconds]
mim1k has quit [Ping timeout: 258 seconds]
DARPA has joined #ruby
username_ has joined #ruby
Silthias has joined #ruby
mooser has joined #ruby
Arpanet69 has quit [Ping timeout: 255 seconds]
username_ has quit [Ping timeout: 245 seconds]
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 260 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mooser has quit [Ping timeout: 258 seconds]
Tohuw_ has joined #ruby
Tohuw_ has quit [Client Quit]
jcao219 has joined #ruby
pwnd_nsfw has quit [Ping timeout: 255 seconds]
yqt has joined #ruby
pwnd_nsfw has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
muelleme_ has joined #ruby
jamesaxl has joined #ruby
muelleme_ has quit [Ping timeout: 252 seconds]
Paraxial has joined #ruby
al2o3-cr has quit [Quit: WeeChat 1.7]
username_ has joined #ruby
postmodern has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
username_ has quit [Ping timeout: 260 seconds]
nhhc has joined #ruby
rafadc has joined #ruby
nofxxxx has joined #ruby
Qchmqs has joined #ruby
nofxxx has quit [Ping timeout: 260 seconds]
tvw has joined #ruby
ElDoggo has joined #ruby
Rodya_ has joined #ruby
NL3limin4t0r has joined #ruby
ElDoggo has quit [Ping timeout: 255 seconds]
Rodya_ has quit [Ping timeout: 260 seconds]
Qchmqs has quit [Quit: Konversation terminated!]
mikecmpbll has quit [Ping timeout: 240 seconds]
cyphase has quit [Ping timeout: 252 seconds]
Qchmqs has joined #ruby
unshadow has joined #ruby
username_ has joined #ruby
pppktz has joined #ruby
mikecmpbll has joined #ruby
jsrn_ has joined #ruby
bronson has joined #ruby
cyphase has joined #ruby
username_ has quit [Ping timeout: 258 seconds]
<arne_> can i do something clever
<arne_> to have time/datetime/dates converted automagicially to iso8601 when using to_json/to_s
govg has quit [Ping timeout: 240 seconds]
gnufied has quit [Ping timeout: 255 seconds]
ddrmanxbxfr has joined #ruby
oded has quit [Quit: Konversation terminated!]
mikecmpbll has quit [Ping timeout: 252 seconds]
thebigj has left #ruby [#ruby]
mikecmpbll has joined #ruby
jusa has quit [Ping timeout: 260 seconds]
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Burgestrand> >> require "time"; require "json"; DateTime.now.to_json
<ruby[bot]> Burgestrand: # => "\"2017-04-18T08:50:54+00:00\"" (https://eval.in/778296)
<Burgestrand> Ah, but Time is not so friendly.
<arne_> Burgestrand: the web framework i use has a serializing function for json
<arne_> so i will just do it by hand
<arne_> why is there datetime and time at all?
<dminuoso> arne_: Historical reasons.
<dminuoso> arne_: They are mostly the same but they have some subtle difference in their behavior.
<dminuoso> arne_: Basically two separate groups of people ended up implementing the same stuff under different names.
Beams has joined #ruby
<dminuoso> arne_: And because Ruby rarely introduces breaking changes they couldn't just remove one because both ended up being used by folks.
<dminuoso> So now we end up with this strange scenario of having both around.
lxsameer has joined #ruby
<arne_> dminuoso: makes sense, thanks
<dminuoso> arne_: Overall "Time" should be the preferred choice because they are a little more correct in a few spots (they use leap seconds, implemented in C so slightly faster)
<arne_> im doing that, because the name is better
<arne_> :o
<arne_> start_at
<arne_> :
<arne_> "2017-04-13 13:09:01 +0200"
<arne_> getting this in my json api though :(
marr has joined #ruby
<dminuoso> arne_: And this is bad because?
<dminuoso> It's ISO 8601. Be happy.
<arne_> well firefox doesn't like to parse it this way
<arne_> 2017-04-18T10:40:41+02:00 <= isn't this iso8601?
rafadc has joined #ruby
<dminuoso> Mmm.
<dminuoso> arne_: You are right. You can use Time#iso8601
xall has joined #ruby
pwnd_nsfw` has joined #ruby
pwnd_nsfw has quit [Ping timeout: 240 seconds]
Beams has quit [Quit: .]
Beams has joined #ruby
jcao219 has quit [Ping timeout: 252 seconds]
<arne_> dminuoso: yeah will do that
<arne_> dminuoso: NoMethodError: undefined method `iso8601' for 2017-04-18 11:06:51 +0200:Time
<arne_> oh i need require 'time' sorry
Guest96 has quit [Remote host closed the connection]
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest96 has joined #ruby
rhyselsmore has joined #ruby
username_ has joined #ruby
jcao219 has joined #ruby
username_ has quit [Ping timeout: 240 seconds]
lmc has joined #ruby
xall_ has joined #ruby
xall has quit [Ping timeout: 245 seconds]
hutch34_ has joined #ruby
lmc has quit [Ping timeout: 240 seconds]
patarr has joined #ruby
Robtop__ has joined #ruby
minimalism has joined #ruby
patarr has quit [Ping timeout: 252 seconds]
SHyx0rmZ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
SHyx0rmZ has joined #ruby
rickenharp has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 245 seconds]
Rodya_ has quit [Ping timeout: 255 seconds]
username_ has joined #ruby
bruce_lee has joined #ruby
glcx has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
glcx has quit [Changing host]
glcx has joined #ruby
kiltzman has quit [Ping timeout: 246 seconds]
glcx has quit [Client Quit]
sepp2k has joined #ruby
workmad3 has joined #ruby
username_ has quit [Ping timeout: 255 seconds]
kiltzman has joined #ruby
kiltzman has quit [Max SendQ exceeded]
workmad3 has quit [Client Quit]
kiltzman has joined #ruby
kiltzman has quit [Max SendQ exceeded]
glcx has joined #ruby
glcx has joined #ruby
glcx has quit [Changing host]
kiltzman has joined #ruby
kiltzman has quit [Max SendQ exceeded]
jcao219 has quit [Ping timeout: 258 seconds]
glcx has quit [Remote host closed the connection]
glcx_ has joined #ruby
glcx_ has quit [Client Quit]
workmad3 has joined #ruby
haraoka has quit [Ping timeout: 252 seconds]
kiltzman has joined #ruby
kiltzman has quit [Max SendQ exceeded]
astrobunny has quit [Remote host closed the connection]
kiltzman has joined #ruby
kiltzman has quit [Max SendQ exceeded]
rgtk has joined #ruby
kiltzman has joined #ruby
kiltzman has quit [Max SendQ exceeded]
domgetter has quit [Ping timeout: 240 seconds]
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rickenharp has quit [Quit: Leaving...]
rafadc has joined #ruby
Beams has quit [Quit: .]
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
Beams has joined #ruby
gregf_ has joined #ruby
username_ has joined #ruby
universa1 has joined #ruby
username_ has quit [Ping timeout: 260 seconds]
Fasort has quit [Quit: Leaving]
rgtk has quit [Ping timeout: 255 seconds]
govg has joined #ruby
postmodern has joined #ruby
Beams has quit [Quit: .]
rgtk has joined #ruby
Silthias1 has quit [Ping timeout: 252 seconds]
alazred has quit [Ping timeout: 255 seconds]
pulkit4tech has joined #ruby
Beams has joined #ruby
rhyselsmore has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest88__ has joined #ruby
xall_ has quit [Ping timeout: 268 seconds]
username_ has joined #ruby
xenops has joined #ruby
GodFather has joined #ruby
username_ has quit [Ping timeout: 255 seconds]
Silthias has joined #ruby
Silthias1 has joined #ruby
Rodya_ has joined #ruby
skweek has quit [Ping timeout: 240 seconds]
Silthias has quit [Ping timeout: 268 seconds]
Rodya_ has quit [Ping timeout: 258 seconds]
jameser_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nadir has joined #ruby
NL3limin4t0r has quit [Ping timeout: 260 seconds]
pandaant has joined #ruby
etehtsea has joined #ruby
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
etehtsea has quit [Client Quit]
t-recx has joined #ruby
mikecmpb_ has joined #ruby
millerti has joined #ruby
jusa has joined #ruby
rafadc has joined #ruby
unshadow has quit [Quit: leaving]
mikecmpbll has quit [Ping timeout: 268 seconds]
rafadc has quit [Client Quit]
Arpanet69 has joined #ruby
jusa has quit [Ping timeout: 240 seconds]
NL3limin4t0r has joined #ruby
rafadc has joined #ruby
username_ has joined #ruby
ghornet has joined #ruby
DARPA has quit [Ping timeout: 258 seconds]
ghornet has left #ruby [#ruby]
username_ has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
Fasort has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
skweek has joined #ruby
txdv has joined #ruby
<txdv> hello younglings
username_ has joined #ruby
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<arne_> txdv: how you dare
jusa has joined #ruby
<txdv> arne_: hey grandpa
username_ has quit [Ping timeout: 268 seconds]
DARPA has joined #ruby
jameser has joined #ruby
Arpanet69 has quit [Ping timeout: 258 seconds]
d10n-work has joined #ruby
pwnd_nsfw` has joined #ruby
kiltzman has joined #ruby
Sammichmaker has quit [Read error: Connection reset by peer]
patarr has joined #ruby
TinkerTyper has quit [Ping timeout: 240 seconds]
Fysicus has quit [Quit: The Truth Is Just An Excuse For A Lack Of Imagination]
Robtop__ has quit [Ping timeout: 240 seconds]
pytuger has quit [Ping timeout: 252 seconds]
fmartingr has joined #ruby
TinkerTyper has joined #ruby
anisha_ has quit [Quit: This computer has gone to sleep]
petruff has joined #ruby
jrafanie has joined #ruby
anisha_ has joined #ruby
patarr has quit [Ping timeout: 258 seconds]
Rodya_ has joined #ruby
Arpanet69 has joined #ruby
Guest96 has quit [Remote host closed the connection]
Guest96 has joined #ruby
Rodya_ has quit [Ping timeout: 255 seconds]
DARPA has quit [Ping timeout: 258 seconds]
username_ has joined #ruby
jusa has quit [Ping timeout: 268 seconds]
siovene has joined #ruby
Mortomes|Work has quit [Ping timeout: 260 seconds]
pytuger has joined #ruby
username_ has quit [Ping timeout: 255 seconds]
tlaxkit has joined #ruby
Guest96 has quit [Remote host closed the connection]
nowhere_man has quit [Ping timeout: 260 seconds]
ldnunes has joined #ruby
rgtk has quit [Ping timeout: 240 seconds]
Guest96 has joined #ruby
TreyG has joined #ruby
petruff has quit [Quit: WeeChat 1.7]
petruff has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
anisha_ has quit [Quit: This computer has gone to sleep]
anisha_ has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has quit [Ping timeout: 258 seconds]
jdawgaz has joined #ruby
jgt1 has quit [Quit: WeeChat 1.4]
jdawgaz has quit [Client Quit]
synthroid has joined #ruby
Guest96 has quit [Remote host closed the connection]
jrafanie has joined #ruby
aep has joined #ruby
lmc has joined #ruby
Guest96 has joined #ruby
username_ has joined #ruby
biberu has joined #ruby
pppktz has left #ruby [#ruby]
username_ has quit [Ping timeout: 268 seconds]
lmc has quit [Ping timeout: 268 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
j2k has joined #ruby
quoboo has joined #ruby
quoboo is now known as quobo
hinbody_ has joined #ruby
hinbody has quit [Disconnected by services]
hinbody_ has quit [Client Quit]
hinbody has joined #ruby
houhoulis has joined #ruby
quobo has quit [Client Quit]
Guest96 has quit [Remote host closed the connection]
Guest96 has joined #ruby
CloCkWeRX has joined #ruby
nerglish has joined #ruby
nerglish has quit [Client Quit]
patarr has joined #ruby
nerglish has joined #ruby
username_ has joined #ruby
jdawgaz has joined #ruby
negatifze has joined #ruby
nerglish has quit [Client Quit]
anisha_ has quit [Ping timeout: 240 seconds]
patarr has quit [Ping timeout: 260 seconds]
anisha_ has joined #ruby
mim1k has joined #ruby
username_ has quit [Ping timeout: 255 seconds]
Rodya_ has joined #ruby
rgtk has joined #ruby
bkxd has joined #ruby
Rodya_ has quit [Ping timeout: 258 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgr has joined #ruby
jameser has joined #ruby
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<arne_> how would i make a deep-map?
<arne_> create a proc and give it as a proc over and over?
pupsicle has joined #ruby
<toretore> elaborate
<arne_> i have objects like {:time=>Time.now,...,:something_else=>{:time=>Time.now}}
<arne_> and i want all the times mapped to iso8601
<arne_> .map { |k,v| [k,v.is_a?(Time)?v.iso8601:v] }.to_h does the trick but isn't deep
<toretore> you need recursion
<arne_> i guess so.. and as i need recursion i need a name for my recursion, right
<toretore> yes
skweek has quit [Ping timeout: 258 seconds]
<ccooke_> There is almost certainly a way to make it work without recursion, but it would require the sort of code that would be shared around the internet as an example to others
ccooke_ is now known as ccooke
<ccooke> (Well, no. You can always implement it without recursion as a simple loop. I meant without a named function. Bah.)
CloCkWeRX has quit [Quit: Leaving.]
petruff has quit [Quit: WeeChat 1.7]
petruff has joined #ruby
rafadc has joined #ruby
enterprisey has joined #ruby
vizay has joined #ruby
etehtsea has joined #ruby
esObe has quit [Remote host closed the connection]
esObe has joined #ruby
harfangk has joined #ruby
ramortegui has joined #ruby
esObe has quit [Remote host closed the connection]
esObe has joined #ruby
esObe has quit [Remote host closed the connection]
esObe has joined #ruby
vizay has quit [Read error: Connection reset by peer]
_br__ has quit [Ping timeout: 240 seconds]
esObe has quit [Ping timeout: 260 seconds]
_br__ has joined #ruby
lmc has joined #ruby
millerti has joined #ruby
petruff has quit [Quit: WeeChat 1.7]
petruff has joined #ruby
andikr has quit [Remote host closed the connection]
houhoulis has quit [Remote host closed the connection]
Burgestrand has quit [Quit: Closing time!]
etehtsea has quit [Ping timeout: 268 seconds]
Burgestrand has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd_ has joined #ruby
bkxd has quit [Ping timeout: 258 seconds]
jameser has joined #ruby
rgtk has quit [Ping timeout: 240 seconds]
Fasort has quit [Quit: Leaving]
Rodya_ has joined #ruby
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest45097 has quit [Remote host closed the connection]
xenops has quit [Quit: Textual IRC Client: www.textualapp.com]
<NL3limin4t0r> @arne_ Here's a simple example of a deep_map that only yields the value (key cannot be changed)
<NL3limin4t0r> def deep_map(h, &blk); h.map { |k, v| [k, v.is_a?(Hash) ? deep_map(v, &blk) : yield(v)] }.to_h; end
[74]HELLth has joined #ruby
xenops has joined #ruby
Rodya_ has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
Arpanet69 has quit [Ping timeout: 240 seconds]
dasher^0_o has quit [Ping timeout: 240 seconds]
<NL3limin4t0r> example usage: deep_map({a: 2, b: {c: 4}}) { |v| v * 2 } #=> {:a => 4, :b => {:c => 8}}
jakub_ has joined #ruby
jakub_ has quit [Client Quit]
anisha_ has quit [Read error: Connection reset by peer]
jakub_ has joined #ruby
jakub_ has quit [Client Quit]
DLSteve has joined #ruby
5EXAAUTGL has joined #ruby
anisha_ has joined #ruby
gnufied has joined #ruby
5EXAAUTGL is now known as johnny
johnny is now known as Guest32442
vali has quit [Quit: vali]
<Guest32442> Hi, is it good place to ask some beginners questions?
jusa has joined #ruby
<NL3limin4t0r> I don't see why not. ;-)
Guest14 has joined #ruby
domgetter has joined #ruby
bkxd_ has quit [Ping timeout: 260 seconds]
fmartingr has quit [Quit: Connection closed for inactivity]
millerti has joined #ruby
<Guest32442> Sorry, first time here :). I was wondering - I want to process somewhat big json file in Ruby, and I'm worried about memory. If I'm assigning some thing like `foo = File.read`, I'm saving the file into the memory. Right?
jusa has quit [Ping timeout: 240 seconds]
Guest14 is now known as y0ung00
<toretore> yes
<NL3limin4t0r> Yes, when you read the whole json file to a variable it will get loaded in memory
NL3limin4t0r is now known as NL3limin4t0r_afk
anisha_ has quit [Quit: This computer has gone to sleep]
<Guest32442> OK, so another question if you don't mind. I have two scripts. In first script I want to append multiple json objects to single file (maybe using array?), then read them from that file and parse them one by one in another script. How I can achieve that? Because I have many objects, I can't really generate whole file from array (memory issues)
negatifze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
negatifze has joined #ruby
negatifze has quit [Client Quit]
LastWhisper____ has joined #ruby
nowhere_man has joined #ruby
alazred has joined #ruby
houhoulis has joined #ruby
<toretore> seems to be only for reading, you could try using https://github.com/dgraham/json-stream directly for writing. or you could just do `File.open(filename){|f| f.write '['; objects.each{|o| f.write JSON.generate(o) }; f.write ']' }`
pabloh has joined #ruby
pabloh_ has joined #ruby
andikr has joined #ruby
<toretore> maybe add some commas
pabloh has quit [Client Quit]
GodFather has quit [Ping timeout: 260 seconds]
<ytti> how is Class Foo < Bar; something; end differnt to self.class.const_set :Foo, Class.new(Bar) { something; }
<ytti> if i subclass Sequel::Model in 1st way, DB table is mapped to the class
patarr has joined #ruby
<ytti> if i do the 1nd way, DB table is not mapped to the class
<Guest32442> Thanks toretore, will check that
<ytti> i.e. how to make this work - http://p.ip.fi/uymh
enterprisey has quit [Remote host closed the connection]
mooser has joined #ruby
bronson has quit [Remote host closed the connection]
bronson has joined #ruby
mooser has quit [Ping timeout: 240 seconds]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
ElDoggo has joined #ruby
y0ung00 has quit [Read error: Connection timed out]
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
txdv has quit [Quit: WeeChat 0.4.2]
jdawgaz has quit [Client Quit]
sirecote has joined #ruby
ElDoggo has quit [Read error: Connection reset by peer]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
ElDoggo has joined #ruby
etehtsea has joined #ruby
GodFather has joined #ruby
Guest14 has joined #ruby
millerti has joined #ruby
<ljarvis> ytti: what do you mean make it work? Why are you trying to redefine the constant?
bronson has quit [Remote host closed the connection]
mikecmpb_ has quit [Quit: inabit.]
esObe has joined #ruby
ResidentBiscuit has joined #ruby
mikecmpbll has joined #ruby
__Yiota has joined #ruby
jamesaxl has quit [Quit: WeeChat 1.7]
polishdub has joined #ruby
jusa has joined #ruby
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
agent_white has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
Pumukel has joined #ruby
guardian has joined #ruby
<ytti> ljarvis, i'm not redefining it, i'm defining it
bronson has joined #ruby
<ljarvis> ytti: it's defined on line 8, you're redefining it on line 17
<ytti> ljarvis, i mean whene i do that normally, sequel will pick it up as existing in DB, and the class will have DBs data
<ljarvis> when you do it normally? so this code isn't relevant?
etehtsea has quit [Ping timeout: 252 seconds]
<ytti> ljarvis, sorry, poor paste, that's actually from two different attempts
<ytti> ljarvis, ignore line 8
Guest14 is now known as y0ung00
jrafanie has joined #ruby
<ytti> ljarvis, well i'd like to define the the class only after making sure DB exists
<ytti> ljarvis, i usually in the method require the file with the class defintion
<ytti> ljarvis, but i'd like to do it somehow in-place
<ytti> ljarvis, sequel has magic pixie dust, if the db is loaded, and there is is table for your class in plural, then it assumes your class refers to it (if it's subclassed from Sequel::Model)
<ytti> ljarvis, but it seems like that magic doesn't work, when i do const_set
jdawgaz has joined #ruby
<ljarvis> ytti: I guess I don't understand why you want to try and define the constant dynamically instead of predefing it
<ljarvis> also, if you code is this simple, just nuke the Hei model and run queries directly against @db[:hei]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ytti> ljarvis, like this example works: http://p.ip.fi/yD50
<ytti> ljarvis, if i define it, before making the DB, the class won't be populated with the DB stuff
<ytti> ljarvis, so i must make the DB first
<ytti> ljarvis, no this code is just for example
y0ung00 has quit [Read error: Connection timed out]
ltem has joined #ruby
__Yiota has joined #ruby
<ytti> ljarvis, i'm surprised the const_set does not work, i assumed it to be analogous to the line in require
<ytti> ljarvis, i don't know what is the idiomatic way to do this, build DB, then model
<ytti> there used to be 'set_schame' you could use inside the class to define the DB, but that has been deprecated
ferr has quit [Quit: WeeChat 1.7]
<ljarvis> ytti: right, ok. Yeah I don't really think that was a good design decision personally, but I'm sure there's good reason for it. TBH I don't really see why you want to define @db. Just do `Sequel.connect` at the entrypoint of your program
jgnagy has quit [Remote host closed the connection]
<ytti> ljarvis, i need >1 DB connection
s2013 has joined #ruby
jgnagy has joined #ruby
<ljarvis> huh?
<ytti> need to connect to >1 databases
<ljarvis> why?
<ytti> becase i need data from >1 databases
mim1k has joined #ruby
vuoto has joined #ruby
hutch34_ has quit [Read error: Connection reset by peer]
<ljarvis> after const_get, can you just do `Hei.db = @db`?
<ljarvis> const_set*
hutch34_ has joined #ruby
<ytti> nope
<ljarvis> try #sequel then
bronson has quit [Remote host closed the connection]
pulkit4tech has quit [Quit: Connection closed for inactivity]
<ytti> (content= does nto exist, i.e. it didn't inspect into the DB)
<agent_white> Mornin'
mooser has joined #ruby
bronson has joined #ruby
eclm has joined #ruby
etehtsea has joined #ruby
mikecmpb_ has joined #ruby
moei has joined #ruby
cdg has joined #ruby
narval has joined #ruby
Guest82161 has quit [Changing host]
Guest82161 has joined #ruby
Guest82161 is now known as Nicmavr
negatifze has joined #ruby
mikecmpbll has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 260 seconds]
rafadc has joined #ruby
houhoulis has quit [Remote host closed the connection]
stupidsenpai has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Snickers has quit [Ping timeout: 268 seconds]
Arpanet69 has joined #ruby
rgtk has joined #ruby
upen15 has joined #ruby
stupidsenpai has quit [Client Quit]
<upen15> hello
<upen15> what kind of address is that?
<ytti> ljarvis, i got it working, i don't know why - http://p.ip.fi/6sep
<ytti> ljarvis, line 17 is the key, but i don't know why
<ljarvis> right, that makes sense
<ljarvis> set_dataset will obviously sync the model and schema
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
mooser has quit [Remote host closed the connection]
NL3limin4t0r_afk has quit [Ping timeout: 240 seconds]
kyle__ has joined #ruby
ElDoggo has quit [Ping timeout: 258 seconds]
aufi has quit [Ping timeout: 252 seconds]
<kyle__> is there a better/cleaner way of loading a library in a one liner? Rather than ruby -e "require 'yaml';blah.blah.bitty.blah()"
<ljarvis> kyle__: ruby -ryaml -e "blah"
<kyle__> ljarvis: Thank you! I so rarely do one liners, Id idn't know that flag.
alan_w_ has joined #ruby
Snickers has joined #ruby
bronson has quit [Remote host closed the connection]
mikecmpb_ has quit [Quit: inabit. zz.]
Arpanet69 has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
mikecmpbll has joined #ruby
eclm has quit [Ping timeout: 260 seconds]
flying has quit []
mooser has joined #ruby
mooser has quit [Remote host closed the connection]
jusa has quit [Ping timeout: 258 seconds]
mooser has joined #ruby
chouhoulis has joined #ruby
Pumukel has quit [Remote host closed the connection]
nhhc has quit [Remote host closed the connection]
mooser has quit [Ping timeout: 260 seconds]
bronson has quit [Remote host closed the connection]
ResidentBiscuit has quit [Ping timeout: 240 seconds]
skweek has joined #ruby
ResidentBiscuit has joined #ruby
antoniobeyah has joined #ruby
gottcha has joined #ruby
armando1 has quit [Remote host closed the connection]
Rodya_ has joined #ruby
rippa has joined #ruby
nahra has quit [Remote host closed the connection]
nahra has joined #ruby
Silthias has joined #ruby
Silthias1 has quit [Ping timeout: 252 seconds]
ElDoggo has joined #ruby
nahra has quit [Remote host closed the connection]
nahra has joined #ruby
haylon has joined #ruby
<haylon> Hello everyone! I just generated a file using aws ec2 run-instances > artifactory.json and I'm trying to read that JSON to get a value out of it. However, when Ruby attempt to read it, I get a parse error, and two <?><?> looking symbols. When ran through a Linter, it says that the JSON is valid, but Ruby does'nt seem to like it.
<haylon> JSON::ParserError: 743: unexpected token at '��{'
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vuoto has quit [Remote host closed the connection]
<balo> haylon: you can check the file with the `od` unix command if there is some weirdness with it
<balo> are you trying to read the file from a local file system?
<balo> maybe it's worth checking your environment's encoding too
petruff has quit [Ping timeout: 260 seconds]
<haylon> let me check the file with that od command balo
<haylon> one sec
<balo> just ideas, never saw this issue. maybe once when i was trying to read from a host with SSL with net/http but with plain connection :D
hays has joined #ruby
nahra has quit [Remote host closed the connection]
nerglish has joined #ruby
bronson has joined #ruby
nahra has joined #ruby
petruff has joined #ruby
<haylon> when I ran `od artifactory.json` it looked like a bunch of binary, or ascii codes
<haylon> with a bunch of *'s inbetween each block
<balo> trye the -c option
alan_w_ has quit [Ping timeout: 260 seconds]
nerglish has quit [Client Quit]
<balo> you should see if there is any weirdness but yeah maybe there is a more friendlier tool for this
<balo> i would bet for the environment where you are running the script, would check the file's encoding and making sure it's UTF-8
nahra has quit [Remote host closed the connection]
<balo> and also maybe you can paste it somewhere how you are trying to read and parse the file. maybe the problem lies in the code
<haylon> I can't share the JSON since its got sensative data about my aws tenant
<haylon> but give me a sec
synthroi_ has joined #ruby
cfec0b8d has quit [Ping timeout: 255 seconds]
<Burgestrand> I wonder if there's a BOM in it…
<haylon> This is teh code that we're using so far, haven't got much further
<haylon> Burgestrand, I'm not sure what a BOM is
<haylon> but it probably has something to do with the use of >
<herwin> byte order mark
<Burgestrand> haylon essentially a few bytes that are sometimes prepended to UTF-8 files, which can cause havoc sometimes
<herwin> `file blah.json` should show it
bronson has quit [Remote host closed the connection]
synthroid has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
<haylon> Ah, yes, for some reason the `aws ec2 run-instances > artifactory.json` command prepended two ?'s to the front of the file
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Burgestrand> haylon you could check by printing the result of `json_file.bytes.take(5)` and looking at the numbers
mark_66 has left #ruby ["PART #elixir-lang :PART #crystal-lang :PONG :cherryh.freenode.net"]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has quit [Remote host closed the connection]
<haylon> [255, 254, 123, 0, 13]
cdg has joined #ruby
<Burgestrand> hehe, yes, looks like a BOM
<Burgestrand> hm, then again, it's in the wrong order
<Burgestrand> It ought to have been FEFF but it's FFFE
vuoto has quit [Remote host closed the connection]
<Burgestrand> I wonder if it could be UTF-16LE and not UTF-8
<Burgestrand> Ah yes, it looks like it, given the 123,0 pair there.
<haylon> yes, UTF-16LE did show up in a file of hte file
<haylon> one sec
<haylon> artifactory.json: Little-endian UTF-16 Unicode text, with CRLF, CR line terminators
amclain has joined #ruby
<Burgestrand> haylon I think you can do `File.read("…", encoding: Encoding::UTF_16LE)` for for your read operation
<haylon> woof. Is this because I did htis on OSX and redirected the output?
<haylon> because other JSON files I have are just plain UTF-8
<Burgestrand> haylon I can't tell you why, but whatever bytes you received were encoded as UTF-16LE and not UTF-8
<haylon> Interesting
<Burgestrand> haylon supported by 1) the 0xFFFE in the start of the file and 2) the encoding of 0x7B00 for your {
millerti has joined #ruby
<Burgestrand> >> "{".encode("UTF-16LE").bytes
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ruby[bot]> Burgestrand: # => [123, 0] (https://eval.in/778635)
username1 has joined #ruby
<Burgestrand> haylon It's not *entirely* strange given that AFAIK JavaScript uses that encoding internally for strings
<Burgestrand> … I think, it's some kind of double-length encoding anyway :)
cseder has joined #ruby
etehtsea has quit [Ping timeout: 260 seconds]
juggler has joined #ruby
etehtsea has joined #ruby
shinnya has joined #ruby
<haylon> I get this error when trying to load the file
<haylon> ASCII incompatible encoding needs binmode (ArgumentError)
electrostat has quit [Quit: uwotm8]
<haylon> using the suggested method
electrostat has joined #ruby
<Burgestrand> haylon Ah, sorry, you probably need `File.read("…", mode: "rb", encoding: Encoding::UTF_16LE)` (mode-parameter)
acalycine has joined #ruby
mooser has joined #ruby
loy_aqua has joined #ruby
<Burgestrand> … then again, that nasty BOM is still going to trip you up.
vuoto has joined #ruby
<haylon> I'm going to try a different method
vuoto has quit [Remote host closed the connection]
jaruga has joined #ruby
<haylon> Instead of reading a file, I'm going to see if I can have my ruby script execute the aws command, and take that output
Qchmqs has quit [Ping timeout: 255 seconds]
mooser has quit [Ping timeout: 240 seconds]
govg has joined #ruby
pandaant has quit [Remote host closed the connection]
Guest32442 has quit [Quit: Guest32442]
vuoto has joined #ruby
vuoto has quit [Remote host closed the connection]
ledestin has joined #ruby
vuoto has joined #ruby
acalycine has quit [Quit: bye]
<cseder> Guess it's Ruby Tuesday
<baweaver> does that mean free appetizers ?
<cseder> Bring 'em on!
tlaxkit has quit [Quit: tlaxkit]
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
<Burgestrand> haylon if that doesn't work, it's possible you'll have to conditionally clean off the BOM by yourself when reading the file
mim1k has quit [Ping timeout: 260 seconds]
<haylon> uugghhh.
marxarelli|afk is now known as marxarelli
cagmz has joined #ruby
<haylon> Ok, i'll play with that. We're attempting the shell execution right now. teaching someone else how to do it at the same time
<haylon> Thank you Burgestrand, and balo
binaryplease has quit [Ping timeout: 240 seconds]
skweek has quit [Ping timeout: 240 seconds]
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
<Burgestrand> haylon It's not pretty, but it ought to work: https://eval.in/778660
rafadc has quit [Quit: Bye!]
vuoto has quit [Remote host closed the connection]
<haylon> whoa
gusrub has joined #ruby
<haylon> LOL, I'll give it a whirl, but executing the command using %x[ #{cmd} ] allowed us to ge the STDOUT, and use that, which worked.
<haylon> then we wrote it to a file using plain utf-8
jusa has joined #ruby
brent__ has joined #ruby
<Burgestrand> haylon strange, maybe there's something in your environment that changed the output, I would've expected running the command in Ruby to not change the bytes being spit out by the AWS CLI
<haylon> I'm thinking its the environment as well
<haylon> somethign to do with the Shell on OSX and some OSX setting
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<haylon> I'll have to dig around
SeepingN has joined #ruby
hays has quit [Ping timeout: 252 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
nitric has joined #ruby
muelleme_ has joined #ruby
jamesaxl has joined #ruby
vuoto has joined #ruby
Cohedrin has joined #ruby
mzo has joined #ruby
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
antgel has quit [Ping timeout: 255 seconds]
outreachdan has joined #ruby
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andikr has quit [Remote host closed the connection]
bronson has joined #ruby
muelleme_ has quit [Ping timeout: 260 seconds]
jsrn_ has quit [Quit: Leaving]
bbramos has joined #ruby
Rodya_ has quit [Quit: Leaving...]
shinnya has quit [Ping timeout: 255 seconds]
loy_aqua has quit [Quit: Bye]
sumobob has joined #ruby
loy_aqua has joined #ruby
<bbramos> boa tarde pessoal
<bbramos> Prazer, meu nome é Bruno
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
loy_aqua has quit [Max SendQ exceeded]
lxsameer has quit [Quit: WeeChat 1.5]
loy_aqua has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
enterprisey has joined #ruby
renchan has quit [Quit: Leaving...]
loy_aqua has quit [Max SendQ exceeded]
mooser has joined #ruby
govg has quit [Quit: leaving]
mooser has quit [Ping timeout: 260 seconds]
haylon has quit [Remote host closed the connection]
Beams has quit [Quit: .]
Burgestrand has quit [Quit: Closing time!]
pifon has quit [Quit: Connection closed for inactivity]
hahuang65 has joined #ruby
hays has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
<t-recx> hi
hays has quit [Remote host closed the connection]
hahuang65 has quit [Client Quit]
<havenwood> hi
Cyrus has quit [Quit: omg]
hahuang65 has joined #ruby
Cohedrin has joined #ruby
enterprisey has quit [Remote host closed the connection]
tvw has quit [Read error: Connection reset by peer]
tvw has joined #ruby
duderonomy has quit [Ping timeout: 260 seconds]
enterprisey has joined #ruby
jusa has quit [Ping timeout: 260 seconds]
etehtsea has quit [Quit: Textual IRC Client: www.textualapp.com]
tvw has quit [Read error: Connection reset by peer]
LastWhisper____ has joined #ruby
jaruga has quit [Quit: jaruga]
jaruga has joined #ruby
jaruga has quit [Remote host closed the connection]
bronson has quit [Remote host closed the connection]
bronson has joined #ruby
chouhoul_ has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
chouhoul_ has quit [Remote host closed the connection]
pwnd_nsfw` has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
jcao219 has joined #ruby
brodul has quit [Quit: My hovercraft is full of eels!!]
mostlybadfly has joined #ruby
ben_____ has joined #ruby
enterprisey has quit [Ping timeout: 260 seconds]
Lucky_ABA has joined #ruby
naprimer_3 has joined #ruby
enterprisey has joined #ruby
ben__ has quit [Ping timeout: 258 seconds]
chouhoul_ has joined #ruby
cfec0b8d has joined #ruby
naprimer_2 has quit [Ping timeout: 260 seconds]
chouhoulis has quit [Ping timeout: 260 seconds]
sepp2k has quit [Ping timeout: 240 seconds]
j`ey has joined #ruby
<j`ey> is webrick reasonably secure?
<mzo> about as secure as it gets
<dminuoso> j`ey: Webrick is just brittle, unstable and shitty.
<j`ey> I just need someting very simple
<j`ey> want to accept request, log something and then redirect
workmad3 has quit [Ping timeout: 260 seconds]
<dminuoso> j`ey: use sinatra powered with puma.
jusa has joined #ruby
<havenwood> j`ey: Or Roda with Puma.
<j`ey> I just wanted webrick cos it's already there :P
<j`ey> it's like super low traffic
<havenwood> j`ey: it does work for simple stuff!
<havenwood> j`ey: for that matter, you could use CGI.
<j`ey> hm true, I'll try that
negatifze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<j`ey> havenwood: thanks
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
negatifze has joined #ruby
cdg_ has joined #ruby
<j`ey> ah, but with just cgi you also need a server
ddffg has joined #ruby
cdg has quit [Ping timeout: 245 seconds]
<dminuoso> j`ey: I think something like Sinatra/Roda/Ramaze/YourPoison with unicorn is about as compact but solid as it can get.
<j`ey> what about Camping? :P
<dminuoso> j`ey: Sure. Whatever floats your boat.
<j`ey> damn, there are still people committing to that
govg has joined #ruby
cdg_ has quit [Ping timeout: 240 seconds]
stoopidmunkey has joined #ruby
sepp2k has joined #ruby
pupsicle has quit [Remote host closed the connection]
alazred has quit [Ping timeout: 240 seconds]
<havenwood> j`ey: Use mgx_mruby: https://github.com/matsumotory/ngx_mruby
<havenwood> j`ey: Nothing else will be as fast in Ruby land.
<havenwood> j`ey: https://www.techempower.com/benchmarks/#section=data-r13&hw=ph&test=json
<havenwood> 377,344 JSON responses from ngx_mruby versus 4,140 from Rails
<j`ey> I dont need really high performance
<havenwood> j`ey: It's also not much code. Embedding Ruby in Nginx is fun too. I promise
<havenwood> j`ey: But yeah, if you really want something simple from your end, use a Rack app backed by Puma.
<havenwood> j`ey: Pure Rack is pretty easy, and you may end up needing middleware, nice to have available. Rack is a good path.
<havenwood> j`ey: There's gotta be a server somehow.
<j`ey> oh sure, but webrick has that built in!
minimalism has quit [Quit: minimalism]
postmodern has quit [Quit: Leaving]
<havenwood> j`ey: you could have webrick handle your cgi script, if you really wanna use webrick ;-P
jrafanie has joined #ruby
stoopidmunkey has quit [Read error: Connection reset by peer]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cfec0b8d has quit [Quit: Leaving.]
jdawgaz has joined #ruby
stoopidmunkey has joined #ruby
jdawgaz has quit [Client Quit]
cfec0b8d has joined #ruby
Guest55 has joined #ruby
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
Guest55 has quit [Client Quit]
tvw has joined #ruby
Guest55 has joined #ruby
jdawgaz has joined #ruby
hxegon has quit [Quit: leaving]
negatifze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
muelleme_ has joined #ruby
pupsicle has joined #ruby
jcao219 has quit [Ping timeout: 240 seconds]
NL3limin4t0r_afk has joined #ruby
Guest55 has quit [Quit: Guest55]
negatifze has joined #ruby
bbramos has quit [Quit: HydraIRC -> http://www.hydrairc.com <- *I* use it, so it must be good!]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
negatifze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
postmodern has joined #ruby
mim1k has joined #ruby
mooser has joined #ruby
mooser has quit [Remote host closed the connection]
petruff has quit [Ping timeout: 240 seconds]
mooser has joined #ruby
ramfjord has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mim1k has quit [Ping timeout: 240 seconds]
sumobob has quit [Ping timeout: 252 seconds]
nerglish has joined #ruby
ericmath1son has joined #ruby
jdawgaz has joined #ruby
jusa has quit [Ping timeout: 268 seconds]
stoopidmunkey has quit [Quit: Leaving...]
[74]HELLth has quit [Quit: Leaving]
ramortegui has quit [Quit: Ex-Chat]
railswebdev has joined #ruby
mooser has quit [Read error: Connection reset by peer]
dasher^0_o has joined #ruby
mooser has joined #ruby
jrafanie has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
ramortegui has joined #ruby
s2013 has joined #ruby
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
mooser has quit [Remote host closed the connection]
mooser has joined #ruby
gusrub has quit [Ping timeout: 260 seconds]
gusrub has joined #ruby
duderonomy has joined #ruby
juggler has quit [Ping timeout: 240 seconds]
marxarelli is now known as marxarelli|afk
catbusters has joined #ruby
haylon has joined #ruby
marxarelli|afk is now known as marxarelli
cdg has joined #ruby
Silthias has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
Silthias has joined #ruby
hinbody has quit [Quit: leaving]
mooser has quit [Remote host closed the connection]
sumobob has joined #ruby
ericmath1son has quit [Quit: leaving]
hxegon has joined #ruby
sumobob has quit [Ping timeout: 255 seconds]
Eiam has joined #ruby
ElDoggo has quit []
hahuang65 has quit [Read error: Connection reset by peer]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nahra has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Cohedrin has joined #ruby
hahuang65 has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
benlieb has joined #ruby
oliv_____ has joined #ruby
mfb2 has joined #ruby
synthroid has joined #ruby
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
<benlieb> isn't bundle update my_gem supposed to update the Gemfile.lock file?
negatifze has joined #ruby
synthroi_ has quit [Ping timeout: 260 seconds]
<dminuoso> benlieb: That depends on whether there's something to updarte.
rhyselsmore has joined #ruby
<benlieb> dminuoso: the gem is definitely out of date, the bundle update installs the new gem but doesn't update the gemfile
<benlieb> Gemfile.lock
<dminuoso> benlieb: Show me your Gemfile
vuoto has quit [Quit: Lost terminal]
gix has quit [Ping timeout: 260 seconds]
negatifze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has joined #ruby
gix has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
preyalone has joined #ruby
SeepingN has joined #ruby
workmad3 has joined #ruby
nofxxxx has quit [Quit: Leaving]
nofxx has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
haylon has quit [Remote host closed the connection]
segy has quit [Ping timeout: 240 seconds]
rgr_ has joined #ruby
rgr has quit [Ping timeout: 258 seconds]
rakm has joined #ruby
lemoi has joined #ruby
segy has joined #ruby
mooser has joined #ruby
<lemoi> I'm using Pathname.new(foo).split.to_s to remove the last dir in a unix path. Is there any way of spliting the next dir as well? ie /usr/local/bin => /usr
chrisgeorge has joined #ruby
<chrisgeorge> Hey Ruby community, is there a way to use Hash.dig with an array of strings to check for a key? e.g. a = 'a', b = 'b', q = [a, b], Hash.dig(q)?
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
<dminuoso> chrisgeorge: Yes. [a, b].reduce ... :-)
oliv_____ has quit [Remote host closed the connection]
<dminuoso> Or [a, b].find
cdg has quit [Read error: Connection reset by peer]
synthroid has quit []
<dminuoso> chrisgeorge: Ohh wait I misunderstood.
<ytti> Pathname.new(foo).ascend.to_a[-2]
<dminuoso> chrisgeorge: Use the splat operator.
olivi____ has joined #ruby
<dminuoso> chrisgeorge: Hash.dig(*q)
cdg has joined #ruby
<chrisgeorge> Hm.
<lemoi> ytti++
<ytti> or #descend.to_a[1]
<lemoi> thanks bud
<chrisgeorge> dminuoso: I think I tried that and it didn't work. e.g. a = {b: { c: 'test'}} a.dig(*['b', 'c'])
<dminuoso> chrisgeorge: To no surprise.
<chrisgeorge> Oh nice ytti
<dminuoso> chrisgeorge: Symbols are not strings.
cdg has quit [Read error: Connection reset by peer]
Verity has joined #ruby
<Verity> <3 ruby
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dminuoso> >> {b: { c: 'test'}}.dig(*[:b, :c])
<ruby[bot]> dminuoso: # => "test" (https://eval.in/778721)
<dminuoso> chrisgeorge: ^-
GodFather has joined #ruby
cdg has joined #ruby
<chrisgeorge> dminuoso: Yeah I was hoping to just use strings. But it's no big deal :)
<dminuoso> chrisgeorge: Despite the fact that in some places you can use them synonymously, don't expect them to. :)
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
olivi____ has quit [Ping timeout: 260 seconds]
ta_ has joined #ruby
mooser has quit [Ping timeout: 260 seconds]
mooser has joined #ruby
jdawgaz has joined #ruby
ddffg has quit [Ping timeout: 258 seconds]
mfb2 has quit []
brent__ has quit [Remote host closed the connection]
railswebdev has joined #ruby
cdg_ has joined #ruby
Lucky_ABA has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
narval has quit [Quit: Leaving]
esObe has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 268 seconds]
sumobob has joined #ruby
outreachdan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benlieb has quit [Quit: benlieb]
ltem has quit [Quit: Leaving]
cdg_ has quit [Remote host closed the connection]
outreachdan has joined #ruby
mim1k has joined #ruby
cdg has joined #ruby
cdg has quit [Client Quit]
ineb has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
jusa has joined #ruby
oliv_____ has joined #ruby
bronson has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 260 seconds]
muelleme_ has quit [Ping timeout: 240 seconds]
jusa has quit [Ping timeout: 260 seconds]
<hxegon> Verity: How's your ruby journey going so far?
oliv_____ has quit [Ping timeout: 260 seconds]
ldnunes has quit [Quit: Leaving]
<Verity> excellent
<Verity> working with TCP is a breeze
DLSteve has joined #ruby
mooser has quit [Ping timeout: 240 seconds]
Phrogz has joined #ruby
<baweaver> working challenge UDP with a is
Phrogz has quit [Changing host]
Phrogz has joined #ruby
<Phrogz> I have a Ruby script run as a Scheduled Task (Windows speak for cron job) that was previously downloading files via FTP. Now the files are only going to be available via SMB.
<hxegon> My favorite: "Take me down to concurrency city the girls grass pretty is where the are green and"
<Phrogz> Anyone know how to mount a remote share and copy files from it using Ruby from a Scheduled Task running as a service account?
<baweaver> I'd assume get a Samba client for Ruby and go from there
<Phrogz> Brilliant!
* Phrogz goes a-googling
<hxegon> Verity: nice!
<baweaver> hxegon: Bob had a problem. Bob decided to use threads. Now problems two has Bob.
<Phrogz> baweaver: lol
pabloh_ has quit [Remote host closed the connection]
<apeiros> but bobs two problems where now processed twice as fast!
skweek has joined #ruby
<apeiros> *were
<Phrogz> Speed matters, yo.
<Phrogz> Fail quickly, they say.
<hxegon> UPD: hear can me now you?
<Phrogz> I'd tell you a UDP joke, but you might not get it.
<Phrogz> Nice to see you, apeiros.
<apeiros> Phrogz: lol. I got it, but I won't acknowledge it.
<hxegon> Phrogz: I forgot that one
<baweaver> TCP is just SYNACKtic sugar
<hxegon> LET THE PUNS FLOW THROUGH YOU
<Phrogz> I'd follow up with the "I have a TCP joke for you" repeated until someone says "I got it", but I don't want to be kicked.
<apeiros> heh
<apeiros> kick is the nagle of irc
<baweaver> I can still kick you if it'd make you feel better
Vivekananda has joined #ruby
robert_reilly has joined #ruby
d10n-work has quit [Quit: Connection closed for inactivity]
brent__ has joined #ruby
<atmosx> hello
Snickers has quit [Quit: Snickers]
<Phrogz> Swing and a miss #1: https://github.com/johnae/sambal/issues/30
Snickers has joined #ruby
<robert_reilly> Hi, I am debugging a gem issue should I see the same paths in gem env and ruby -e ‘puts $:’ ? here is the output of those two commands: http://bit.ly/2o13iYT
ramortegui has quit [Remote host closed the connection]
j`ey has left #ruby [#ruby]
dar123 has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
negatifze has joined #ruby
dar123 has quit [Client Quit]
chrisgeorge has quit []
<Phrogz> robert_reilly: Pretty sure no. The `$:` variable is the load path for load or require. That's not the same as the gem path.
<baweaver> Phrogz ^
millerti has joined #ruby
oliv_____ has joined #ruby
<Phrogz> baweaver: Ooh, nice find, thanks.
<baweaver> was looking to see why pty wasn't working for Windows.
robert_reilly has quit [Quit: Head hit keyboard ZZZzzzZZZzzzz]
<Phrogz> Mmm, I see that that workaround is for a specific library that falls back to popen4 instead of pty.
<Phrogz> I wonder if this is fixed in a newer Ruby for Windows installer.
outreachdan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Phrogz> There's this 4-year-old comment: http://stackoverflow.com/a/16467445/405017
moei has quit [Quit: Leaving...]
outreachdan has joined #ruby
ecksit has joined #ruby
<Phrogz> Switching directions. Going to figure out some non-portable way to mount a Windows share as a drive and just reference that.
oliv_____ has quit [Ping timeout: 240 seconds]
enterprisey has quit [Remote host closed the connection]
patarr has joined #ruby
lemoi has quit [Quit: Page closed]
bronson has joined #ruby
segy has quit [Ping timeout: 240 seconds]
oliv_____ has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
<Phrogz> OT rant: I have had an application in place that's been downloading and processing log files using the company's FTP server going on about 8 years now. IT decided to switch our CDN from Akamai to Verizon.
<Phrogz> They know about my app. And yet they gave me "1-2 days" notice to get everything fixed up for a new log file delivery mechanism, new log file format. Bah.
segy has joined #ruby
maattdd_ has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chichou has joined #ruby
patarr has joined #ruby
maattdd has quit [Ping timeout: 240 seconds]
esObe has joined #ruby
negatifze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has joined #ruby
pmden has quit [Ping timeout: 240 seconds]
<hxegon> Phrogz: wow that's shitty
mzo has quit [Quit: :*]
<upen15> we can cuss in this channel?
maattdd has joined #ruby
hutch34_ has quit [Ping timeout: 240 seconds]
<hxegon> Yeah, just keep it within the limits of good taste :)
ahrs has quit [Remote host closed the connection]
<baweaver> Generally frowned upon, but a few words doesn't really get anyone riled.
<baweaver> Now if you were to make some form of racially charged remark, that'd be lights out on the spot.
ahrs has joined #ruby
hutch34_ has joined #ruby
enterprisey has quit [Remote host closed the connection]
<Phrogz> BTW, when did #ruby-lang finally go away?
<baweaver> hrm
pmden has joined #ruby
<upen15> baweaver: unless those racially charged sentiments are against whites right?
<baweaver> ~1.5-2 years back iirc
<hxegon> lol
<baweaver> upen15 pushing it
esObe has quit [Ping timeout: 255 seconds]
<upen15> just stating observations that is all
maattdd_ has quit [Ping timeout: 240 seconds]
<hxegon> what have I done
<Phrogz> ha ha
<baweaver> short version: be a decent human being and I won't say a word
<baweaver> be mean and....
* Phrogz waits for the power up
<baweaver> Not really. No need to.
* Phrogz is disappoint.
<baweaver> I just don't like typing out all the rest of that
oliv_____ has quit [Ping timeout: 268 seconds]
<upen15> but you technically can't say anything racially charged against white people because they hold all the power so you can only hold prejudices against them and it's normal to hold a prejudice but it's not normal to be racist
<baweaver> ?ot
<ruby[bot]> this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
A124 has quit [Ping timeout: 240 seconds]
jcao219 has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bigkevmcd has quit [Read error: Connection reset by peer]
jdawgaz has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
patarr has joined #ruby
coatezy has quit [Ping timeout: 240 seconds]
chichou has quit [Quit: WeeChat 1.7]
chichou has joined #ruby
coatezy has joined #ruby
NL3limin4t0r_afk has quit [Ping timeout: 240 seconds]
chichou is now known as qubit
qubit is now known as qubits
qubits is now known as chichou
chichou has left #ruby [#ruby]
<Phrogz> Surprisingly, I found useful information on ruby-forum! ;) https://www.ruby-forum.com/topic/178817#783108
<Phrogz> Apparently I can just `Dir['//servername/share/folder/path/*'
<Phrogz> And (if I had not accidentally pressed Enter and left that code incomplete) it auto-mounts the share and Just Works. Yay.
pilne has joined #ruby
Trynemjoel has quit [Ping timeout: 264 seconds]
dn` has quit [Ping timeout: 240 seconds]
dn` has joined #ruby
Trynemjoel has joined #ruby
icarus has joined #ruby
dmtd has joined #ruby
biberu has quit []
gottcha has quit [Ping timeout: 268 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<icarus> hey all, ive got a Gemfile with a :git source denoted, bundle will install it but i dont see it with i grep it with "gem list"
<icarus> bundle doesnt seem to assign the custom source gem to a list that i can require in a script
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<icarus> bundle list shows it, but gem list does not
<icarus> i guess bundle isnt installing to a system wide recognizable location, just wondering what the best way to resolve it is
Lucky_ABA has joined #ruby
patarr has quit [Ping timeout: 252 seconds]
<Phrogz> icarus: Why do you care? Is it important that it show up in `gem list`?
<havenwood> icarus: Bundler "remembers" settings like --path
jcao219 has quit [Ping timeout: 252 seconds]
<havenwood> icarus: Check: bundle config
<havenwood> icarus: and your .bundle/config file
hutch34_ has quit [Ping timeout: 268 seconds]
patarr has joined #ruby
<icarus> Phrogz: the custom source :git gem isnt showing up when required in the header of a script
<icarus> if i manually copy from the bundler location to where global gems are stored, the script runs fine
cfec0b8d has quit [Ping timeout: 240 seconds]
<Phrogz> Ah, I see.
* Phrogz knows almost nothing about bundler, except that I feel guilty about not using it.
<icarus> Phrogz: what method do you use to track your gems?
atom3_ has joined #ruby
<Phrogz> System gems, everywhere I go. (Or rvm, but not in packages per library or project.)
<icarus> its convenient to drop a Gemfile in a repo and feel likes its dependencies can be tracked
atom3 has quit [Ping timeout: 260 seconds]
yqt has quit [Ping timeout: 260 seconds]
<Phrogz> My gem projects have gem dependencies in their gemfile. I just don't use bundler for...whatever awesome local per-project gem management it does.
<Phrogz> *gemspec
patarr has quit [Ping timeout: 255 seconds]
patarr has joined #ruby
<Phrogz> Just about all my other non-gem projects are web apps that use the exact same stack of gems, I guess.
<havenwood> icarus: Bundler installs to the system gem location by default, but if you've set it to install elsewhere it will keep doing so.
patarr has quit [Ping timeout: 268 seconds]
<icarus> ive always though bundler was a neat way to track dependencies, i guess one could use .gemspec alone too
<icarus> havenwood: yeah, im debugging through it, i appreciate yalls input
<havenwood> icarus: What are you trying to do?
<havenwood> icarus: bundle show
<havenwood> icarus: tell me more specifically what you're trying to get at, and i'd be happy to help
coatezy has quit [Read error: Connection reset by peer]
<havenwood> icarus: gem install ruby-graphviz && bundle viz && open gem_graph.png
preyalone has quit [Quit: Connection closed for inactivity]
<icarus> havenwood: im just trying to get a gem i cloned on github with a few changes to install properly to a global path via bundler install: https://github.com/jjdevbiz/poloniex
<icarus> Gemfile entry: gem "poloniex", :git => 'https://github.com/jjdevbiz/poloniex.git', :branch => 'master'
<icarus> it installs correctly, bundle show has it listed
<havenwood> icarus: bundle show poloniex
<Verity> can perl offer me anything that ruby cant"
<havenwood> What's the path?
negatifze has joined #ruby
<havenwood> Verity: version 6
chouhoulis has quit [Ping timeout: 252 seconds]
<havenwood> Verity: Ruby won't have a version that high for some time.
<icarus> /root/.chefdk/gem/ruby/2.1.0/bundler/gems/poloniex-4facb54c1045
<Verity> thats a good point
<icarus> i should mention, i am using chef's development kit
patarr has joined #ruby
enterprisey has joined #ruby
BSaboia has joined #ruby
<havenwood> icarus: So yeah, that gem isn't installing to the system location since it's not a RubyGems-delivered gem.
<havenwood> icarus: https://bundler.io/git.html
<havenwood> icarus: "any gems installed from a git repository will not show up in gem list"
petruff has joined #ruby
petruff has quit [Client Quit]
bronson has quit [Remote host closed the connection]
petruff has joined #ruby
agent_white has quit [Quit: bbl]
esObe has joined #ruby
<icarus> havenwood: bingo
<icarus> > Bundler.setup
dyjakan has quit [Ping timeout: 240 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dyjakan has joined #ruby
esObe has quit [Ping timeout: 240 seconds]
nitric has quit [Quit: sleep]
rgtk has quit [Ping timeout: 240 seconds]
<icarus> havenwood: Phrogz: thanks for the help
jusa has joined #ruby
<Verity> why use c++ at all for this... I could just call the C library from ruby?
<havenwood> Verity: Perl 6 is very nice and took some inspirations from Ruby. (Ruby of course previously took some inspiration from Perl.)
boombox_ has joined #ruby
jusa has quit [Ping timeout: 240 seconds]
s2013 has joined #ruby
olivi____ has joined #ruby
DLSteve has joined #ruby
olivi____ has quit [Ping timeout: 252 seconds]
bronson has joined #ruby
boombox_ has quit [Remote host closed the connection]
Cohedrin has quit [Read error: Connection reset by peer]
cajone has quit [Read error: Connection reset by peer]
youmu_ has joined #ruby
marr has quit [Ping timeout: 260 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cajone has joined #ruby
Cohedrin has joined #ruby
justinmcp has quit [Ping timeout: 240 seconds]
justinmcp has joined #ruby
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
latemus has quit [Quit: Lost terminal]
jdawgaz has joined #ruby
polishdub has quit [Quit: leaving]
jdawgaz has quit [Client Quit]
Vile` has joined #ruby
lmc has quit [Remote host closed the connection]
lmc has joined #ruby
outreachdan has quit [Read error: Connection reset by peer]
outreach_ has joined #ruby
oliv_____ has joined #ruby
oliv_____ has quit [Ping timeout: 240 seconds]
gusrub has quit []