<dG___>
goldfish: right, but I also need to check if "settings" exist or not
ellcs has joined #ruby
<dG___>
basically, here's the scenario: I have a default setting (global_enabled = true), and a list of items composed by dictionaries where these can have or not the "settings" nested dictionary (e.g. `items = [{"id" => 1, "settings" => {"enabled" => false}, {"id" => 2}, ...]`
nowhere_man has quit [Ping timeout: 276 seconds]
<dG___>
So, when iterating through that list (or array or whatever is called in Ruby), I need to check if the current item has `settings` enabled or not, and default it to `global_enabled` if `settings` does not exist.
<kaleido>
a dictionary in python is a hash in ruby, no? just collections of key/value pairs?
<ruby[bot]>
dG___: 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
<dG___>
anyway to simplify this?
drale2k has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
greengriminal has quit [Read error: Connection reset by peer]
<leftylink>
enjoy.
greengriminal has joined #ruby
thomas_25 has quit [Ping timeout: 265 seconds]
phaul has quit [Ping timeout: 276 seconds]
greengriminal has quit [Client Quit]
greengriminal has joined #ruby
greengriminal has quit [Read error: Connection reset by peer]
greengriminal has joined #ruby
greengriminal has quit [Read error: Connection reset by peer]
nacsurte has quit [Ping timeout: 276 seconds]
greengriminal has joined #ruby
drale2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has joined #ruby
AJA4351 has joined #ruby
NODE has quit [Quit: changing servers]
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
NODE has joined #ruby
<dG___>
thank you sir
rainmanjam has joined #ruby
<dG___>
btw, I'm defaulting to `false` there, yes, but that might change
NODE has quit [Client Quit]
<leftylink>
ah.
<leftylink>
indeed indeed then
nacsurte has joined #ruby
phaul has joined #ruby
greengriminal has quit [Quit: This computer has gone to sleep]
NODE has joined #ruby
greengriminal has joined #ruby
greengriminal has quit [Read error: Connection reset by peer]
greengriminal has joined #ruby
greengriminal has quit [Read error: Connection reset by peer]
greengriminal has joined #ruby
greengriminal has quit [Read error: Connection reset by peer]
greengriminal has joined #ruby
rainmanjam has quit [Read error: Connection reset by peer]
nacsurte has quit [Ping timeout: 240 seconds]
rainmanjam has joined #ruby
phaul has quit [Ping timeout: 268 seconds]
Aszuos has joined #ruby
nacsurte has joined #ruby
greengriminal has quit [Client Quit]
Nicmavr has quit [Read error: Connection reset by peer]
phaul has joined #ruby
AJA4350 has quit [Quit: AJA4350]
thomas_25 has joined #ruby
Nicmavr has joined #ruby
davidw has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 268 seconds]
orbyt_ has joined #ruby
phaul has joined #ruby
NL3limin4t0r_afk has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 240 seconds]
NL3limin4t0r_afk has joined #ruby
greengriminal has joined #ruby
greengriminal has quit [Read error: Connection reset by peer]
greengriminal has joined #ruby
greengriminal has quit [Read error: Connection reset by peer]
phaul has joined #ruby
greengriminal has joined #ruby
greengriminal has quit [Read error: Connection reset by peer]
greengriminal has joined #ruby
greengriminal has quit [Read error: Connection reset by peer]
greengriminal has joined #ruby
greengriminal has quit [Client Quit]
fphilipe_ has joined #ruby
Aszuos has quit []
troulouliou_dev has joined #ruby
drincruz has joined #ruby
troulouliou_dev has quit [Client Quit]
fphilipe_ has quit [Ping timeout: 276 seconds]
cthulchu has quit [Ping timeout: 265 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nacsurte has quit [Ping timeout: 240 seconds]
skx86 has quit [Quit: Connection closed for inactivity]
TCZ has quit [Quit: Bye Bye]
skx86 has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
duderonomy has joined #ruby
nacsurte has joined #ruby
evdubs has quit [Quit: Leaving]
evdubs has joined #ruby
dev-rfc83 has joined #ruby
cd has quit [Quit: cd]
MrCrackPot has quit [Ping timeout: 250 seconds]
nacsurte has quit [Ping timeout: 265 seconds]
brool has quit [Ping timeout: 245 seconds]
yokel has quit [Ping timeout: 265 seconds]
nacsurte has joined #ruby
yokel has joined #ruby
teclator has quit [Ping timeout: 276 seconds]
drincruz has quit [Ping timeout: 250 seconds]
oncall-pokemon has quit [Quit: Connection closed for inactivity]
nacsurte has quit [Ping timeout: 250 seconds]
nacsurte has joined #ruby
xall has joined #ruby
teclator has joined #ruby
cd has joined #ruby
hutch1 has joined #ruby
fphilipe_ has joined #ruby
sagax has joined #ruby
fphilipe_ has quit [Ping timeout: 245 seconds]
MrCrackPot has joined #ruby
bruce_lee has quit [Ping timeout: 265 seconds]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
nacsurte has quit [Ping timeout: 265 seconds]
bsdbandit-01 has joined #ruby
bsdband24 has quit [Ping timeout: 265 seconds]
itarato has quit [Ping timeout: 276 seconds]
sphex has quit [Remote host closed the connection]
greenhat has quit [Ping timeout: 250 seconds]
dinfuehr has quit [Ping timeout: 268 seconds]
dinfuehr has joined #ruby
greenhat has joined #ruby
akem__ has joined #ruby
akemhp_ has quit [Ping timeout: 240 seconds]
akem__ has quit [Ping timeout: 240 seconds]
greenhat has quit [Ping timeout: 265 seconds]
jinie has quit [Ping timeout: 250 seconds]
jinie has joined #ruby
greenhat has joined #ruby
kapil_ has joined #ruby
ur5us__ has quit [Ping timeout: 250 seconds]
teclator has quit [Ping timeout: 268 seconds]
drale2k has joined #ruby
Technodrome has joined #ruby
sergioro has joined #ruby
drale2k has quit [Ping timeout: 276 seconds]
teclator has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Read error: Connection reset by peer]
akemhp has joined #ruby
xall has quit [Ping timeout: 268 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
greenhat has quit [Ping timeout: 265 seconds]
teclator has quit [Ping timeout: 246 seconds]
galaxie has quit [Remote host closed the connection]
bsdbandit-01 has quit [Ping timeout: 265 seconds]
galaxie has joined #ruby
greengriminal has joined #ruby
galaxie has quit [Ping timeout: 260 seconds]
lineus has quit [Ping timeout: 260 seconds]
al2o3-cr has quit [Ping timeout: 260 seconds]
iNs has quit [Ping timeout: 260 seconds]
nisstyre has quit [Ping timeout: 246 seconds]
nisstyre has joined #ruby
nacsurte has joined #ruby
TzilTzal has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
greenhat has joined #ruby
nacsurte has quit [Ping timeout: 268 seconds]
greenhat has quit [Ping timeout: 250 seconds]
teclator has joined #ruby
lineus has joined #ruby
iNs has joined #ruby
jinie has quit [Ping timeout: 240 seconds]
jinie_ has joined #ruby
titanbiscuit has quit [Quit: ZNC 1.7.4 - https://znc.in]
jinie_ is now known as jinie
al2o3-cr has joined #ruby
galaxie has joined #ruby
titanbiscuit has joined #ruby
greengriminal has quit [Quit: Leaving]
bsdbandit-01 has joined #ruby
dionysus69 has joined #ruby
Mrbuck has joined #ruby
schne1der has joined #ruby
sergioro has quit [Quit: leaving]
sauvin has joined #ruby
rainmanj_ has joined #ruby
rainmanjam has quit [Read error: Connection reset by peer]
rainmanjam has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
buckworst has quit [Ping timeout: 240 seconds]
rainmanj_ has quit [Ping timeout: 268 seconds]
schne1der has quit [Ping timeout: 245 seconds]
Xiti` has joined #ruby
xco has joined #ruby
Xiti has quit [Ping timeout: 268 seconds]
Mrbuck has quit [Ping timeout: 240 seconds]
andikr has joined #ruby
<TzilTzal>
Hi
<TzilTzal>
What does including a module inside an unless block do exactly?
<ytti>
unsure if block is relevant here
<ytti>
it adds the methods from the module
<ytti>
as if you had defined them there
<TzilTzal>
I thought it was only used in classes
<ytti>
module and class are almost the same thing
infinityfye has joined #ruby
<TzilTzal>
So it just makes the module methods available in that block?
<ytti>
in the scope, yes
phaul has quit [Ping timeout: 240 seconds]
<TzilTzal>
Thanks.
im0nde has quit [Ping timeout: 245 seconds]
phaul has joined #ruby
im0nde has joined #ruby
<ytti>
enumerable is module in ruby
<ytti>
which often gets included due to its great method collection
maasha has joined #ruby
maasha has left #ruby [#ruby]
maasha has joined #ruby
<maasha>
What is the correct template for this: format('%04d', index + 1) - Rubocop complains: Prefer annotated tokens (like `%<foo>s`) over unannotated tokens (like `%s`). (convention:Style/FormatStringToken)
titanbiscuit has quit [Read error: Connection reset by peer]
titanbiscuit has joined #ruby
gregf_ has joined #ruby
rafadc_ has quit [Ping timeout: 268 seconds]
<Bish>
havenwood: i don't quite follor your "object crawling" approach
<Bish>
i would just look at the sourcecode of it
<Bish>
there is Net::SSH::BufferedIO which is similiar, and i suspect it does the same thing
<Bish>
(instead of sending stuff, enqueue it into a buffer)
gregf_ has quit [Remote host closed the connection]
galaxie has quit [Ping timeout: 260 seconds]
galaxie has joined #ruby
TzilTzal has quit [Remote host closed the connection]
TzilTzal has joined #ruby
titanbiscuit has quit [Quit: ZNC 1.7.4 - https://znc.in]
titanbiscuit has joined #ruby
antholog has quit [Ping timeout: 265 seconds]
TzilTzal has quit [Ping timeout: 276 seconds]
darkerbit has joined #ruby
<darkerbit>
I am just starting Ruby development, and am wondering: is it idiomatic Ruby to "check for types" (in practice check for missing methods) for API-facing functions, or is it better to not check and leave it to the caller?
<Bish>
darkerbit: generally u can do what you like
<Bish>
but most times u name the parameter accordingly and check it with a "case-when-block"
bvdw has quit [Read error: Connection reset by peer]
<Bish>
>> 1
<Bish>
&> 1
<rubydoc>
parser error at position 0 around `>'
<ruby[bot]>
Bish: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<Bish>
&> puts 1
<rubydoc>
parser error at position 0 around `>'
<Bish>
> puts 1
tsrt^ has joined #ruby
bvdw has joined #ruby
<Bish>
&> string_or_number = "1"; case string_or_number when String then string_or_number.to_i+1 when Integer then string_or_number+1 else raise StandardError, "Wrong Type" end
<rubydoc>
parser error at position 0 around `>'
<Bish>
> string_or_number = "1"; case string_or_number when String then string_or_number.to_i+1 when Integer then string_or_number+1 else raise StandardError, "Wrong Type" end
<Bish>
& string_or_number = "1"; case string_or_number when String then string_or_number.to_i+1 when Integer then string_or_number+1 else raise StandardError, "Wrong Type" end
<rubydoc>
parser error at position 0 around ` '
<Bish>
*shrugs*
<Bish>
>> puts "hi"
<ruby[bot]>
Bish: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<darkerbit>
>> 1 + 1
<ruby[bot]>
darkerbit: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
phaul has quit [Ping timeout: 268 seconds]
<Bish>
darkerbit: to explain how this works: parallel to the == method ruby has a === method, which is not to be mistaken with javascript's ===
<Bish>
and the switch-case of equivalent of ruby uses this triple equal
<Bish>
and you can do object === Class which is true when object is an instance of that class(or "subclass")
<darkerbit>
What about `rescue`?
<Bish>
you mean different types of errors?
<darkerbit>
Oh sorry, I don't know why my brain decided that IRC is markdown but obviously it isn't
<Bish>
rescue has that builtin
<Bish>
you can just specifiy multiple error handlers like this:
<Bish>
rescue StandardError => e; rescue NetworkError => e; and inside the rescue block e will be the error of that type
<darkerbit>
As in if something goes horrendously wrong with the code the rescue part of any function can check if it's a problem with the parameters
prestorium has quit [Ping timeout: 268 seconds]
<Bish>
but that is equivalent to case-when-ing the current exception, i guess
<Bish>
maybe stack search is faster, though
<darkerbit>
actually if I just rescue NoMethodError I can cleanly check the caller's provided parameters
<darkerbit>
cleanly and separately
<Bish>
never seen that done, though
<Bish>
and do you get nomethoderror if you call a existing method with wrong number of arguments?
<darkerbit>
does ruby catch wrong number of arguments or does it nil the missing arguments?
<Bish>
i think the error will differ
<Bish>
it will be NoMethodError and ArgumentError, checking that right now
<darkerbit>
if it nils then nomethoderror will occur if you try to get something from nil
<Bish>
#<ArgumentError: wrong number of arguments (given 2, expected 3)>
<Bish>
#<NoMethodError: undefined method `pix' for main:Object
<Bish>
yeah you have access to the parameters inside the exception ahndler of the caller
<Bish>
but this design sounds whacky to me
<darkerbit>
So it's better to not worry about it and let the caller's mistakes be caller's mistakes?
<Bish>
it shouldn't be a methods responsability to know what another function is doing
<Bish>
well there i no better, it just doesn't feel right to me
<Bish>
it's opinion i guess
<Bish>
my argument is: if you do it this way.. and change the called-method's behaviour
chunkypuffs has joined #ruby
<Bish>
you have to change the one of ALL callers as well
<darkerbit>
though if it's a billion functions deep and throws a NoMethodError it would look like it's a problem with the library even though you supplied the wrong object
<Bish>
which would make these association between methods seem like they're one method
<Bish>
rather break and have good error messages
<Bish>
or even support the "wrong" parameters
<Bish>
by, for example, transforming them
<darkerbit>
oh, a good base class has methods that throw exceptions so you get good error messages if you forget to implement one
<darkerbit>
so often there isn't a need to check them in the function manually, just let ruby do it's thing
<Bish>
well your library could have a rescue block around the methods the user of your library calls
<darkerbit>
that's what I was talking about the whole time wasn't it?
<Bish>
i guess so, yes, but what do you except this handler to do?
<Bish>
if you supllied an int, while it wants a string automatic conversion?
<Bish>
you will also have to have a convention so that handler knows what was actually meant to be sent
<Bish>
s/except/expect
fig-le-deunch has joined #ruby
<darkerbit>
the problem is this: suppose you call a library with a wrong object of some kind. then it tells you: "NoMethodError: argument obj does not have method buy_chips_and_salsa" how would you know if it's a problem with your arguments or the library
<darkerbit>
because the function you're calling calls another function
skx86 has joined #ruby
<Bish>
well your method itself should check what parameter it wants
<darkerbit>
which has differently named arguments
<Bish>
and throw argumenterror if, for example, the first argument is not an array
<darkerbit>
I am very confused, though not by your fault
<darkerbit>
I keep seeing conflicting answers everywhere on the internet
<Bish>
why would it _not_ be the responsability of a method to check it's parameters (in a language that has loose-typing)
<Bish>
if you want to make sure, go with strictly typed
<Bish>
but putting type-checks everywhere combines the worst of both worlds :D
<darkerbit>
I am stupid, the reason I haven't seen any type-checking code is because I only checked standalone applications, not libraries
<darkerbit>
And attempted to check Nokogiri but apparently it has Java jars in the source code
<Bish>
everyone is stupid in coding, aren't we?
phaul has quit [Ping timeout: 265 seconds]
romanblanco has quit [Ping timeout: 240 seconds]
<darkerbit>
Okay, so I'll probably put type checking oneliners in the functions intended to be called by the library user, but not in internal functions
nacsurte has joined #ruby
<Bish>
that's probably the rough guideline i'd follow
<Bish>
important part is that you can do it where you think it's neccessary
<Bish>
darkerbit: what language are you coming from?
<darkerbit>
several, mainly c#
<darkerbit>
most of them are statically typed except python and lua
<Bish>
i figured
<darkerbit>
I haven't done any type checking in Python since I've never written production code in Python
<darkerbit>
and Lua is Lua
* Bish
doesn't have typechecks in his biggest projects
* Bish
doesn't have tests either
Nicmavr has quit [Read error: Connection reset by peer]
* Bish
is stupid
<darkerbit>
Any good guides to Ruby by the way for programmers coming from other languages? Most quickstart guides I've seen only cover IRB and treat the reader like a first-time programmer and Poignant Guide is too much for my terrible attention span
Nicmavr has joined #ruby
nacsurte has quit [Ping timeout: 276 seconds]
<darkerbit>
every time I read a quickstart guide I'm like "Now I know how to do this" and then I go and check actual code and see things like "class << self" and "extend self"
<Bish>
i never learned languages with guides, sorry
<Bish>
replace "irb" with pry is a good suggestion and most of the metaprogramming, object extending is really advanced and almost never used
<Bish>
i learn languages by writing stupid shit in it until i can tackle something more complicated
<darkerbit>
Meh, if I go without a guide it always ends up being "Okay, I've written this program and it uses this class I wrote that does X" "Why didn't you just use Library::XXX::YYY and this operator that does ZZZ?" "The what?"
<Bish>
pry helps me navigating these X::Y::Z things easily
<Bish>
it's an irb, but you can navigate through modules like it was a filesystem
<Bish>
you can "cd" into an object and list all it's attributes with "ls"
phaul has joined #ruby
<Bish>
and with "$ method" you can see it's code
<darkerbit>
When I was doing Java for the first time I didn't know what interfaces or abstract casses were
<darkerbit>
s/casses/classes/
* Bish
still doesn't know why they are
<darkerbit>
turns out they're the most important thing in Java it would seem
<Bish>
maybe because everyone uses them, but i would disagree that you actually need that
rafadc has joined #ruby
<darkerbit>
Well, gonna finish the Koans and get working on a project, from what I gather Ruby is the kind of language you learn best by doing and a lot of things are really obvious
<Bish>
maybe, yes
<darkerbit>
I still don't understand "class << self" though, I know it allows you to make class methods and the like but don't know much else
<Bish>
take it as a way to add "class"-methods
<Bish>
it's almost equivalent to class A; def A.a; 1;end; end;
<darkerbit>
the syntax is strange in my opinion
<Bish>
yep it is
<Bish>
it's unique even for ruby
<Bish>
i think it wasn't extended to be used as much as it is
<darkerbit>
it would almost suggest "append self to class *inexplicable block*"
<Bish>
expected*
phaul has quit [Ping timeout: 240 seconds]
<Bish>
well, ruby would allow it to replace it with something if you want to do some metaprogramming
<darkerbit>
oh I just got it
<Bish>
i think the only difference between class << self and def Class.a is when inheritance kicks in
<darkerbit>
"append block to instance's class" where class << instance
<Bish>
jup
<Bish>
kinda
<Bish>
thing is: in ruby classes are also objects, and you're "opening the singleton object of the class"
<Bish>
you can not only do that to classes, it works with every object
<darkerbit>
it's one of those things where "do it like this, don't ask any questions"
<Bish>
yep at some point you know enough to ask yourself and then you google it
<Bish>
and find this singleton answer
<Bish>
and it only matters on inheritance, i think
<Bish>
x = "1"; x.instance_eval { class << self; def xyz; to_i ;end; end; }
<Bish>
bam, i created a string that has a "xyz" method
<Bish>
all other strings don't have that
<darkerbit>
as far as I'm concerned it's a fancy way to add static methods (and I call them static methods anyway in my head because every other language ever calls them that but ruby calls them class methods)
<Bish>
i use it because i dislike the def Classname.method_name syntax
<darkerbit>
also how do you access class variables in a class << self block, is it @@ or self. or @ or what
<Bish>
inside the class A; ...; end; it's always @@ no matter if you're changing an instance method or not
<Bish>
that's why it has 2 @ and not one
<Bish>
it gets confusing, when you think about that classes can have instance variables, too, so don't do that :D
<Bish>
if you set @@something = 1 it will be 1 for everyone, for the klass and the objects
<darkerbit>
so @@ works inside "class << self" as well?
<Bish>
i have tried using @ inside class << self because i thought: an instance variable of the class should be a class variable from the POV of the object
<Bish>
but rubey abstract this away
<Bish>
@ is @ and @@ is @@ always
cadeskywalker has quit [Ping timeout: 240 seconds]
galaxie has joined #ruby
<Bish>
if you create a variable with 2 @ it will be accessed with 2 @
<Bish>
no expcetion
lineus has joined #ruby
<Bish>
god i have it with these 2 words today
phaul has joined #ruby
phaul has quit [Ping timeout: 268 seconds]
phaul has joined #ruby
fig-le-deunch has quit [Quit: Konversation terminated!]
suukim has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has joined #ruby
phaul has quit [Ping timeout: 268 seconds]
phaul has joined #ruby
phaul has quit [Ping timeout: 252 seconds]
AJA4350 has joined #ruby
grilix has joined #ruby
itarato has joined #ruby
phaul has joined #ruby
drincruz has joined #ruby
Jonopoly has quit [Ping timeout: 265 seconds]
phaul has quit [Ping timeout: 276 seconds]
yann-kaelig has quit [Quit: yann-kaelig]
phaul has joined #ruby
cadeskywalker has joined #ruby
flughafen has joined #ruby
lucasb has joined #ruby
phaul has quit [Ping timeout: 246 seconds]
phaul has joined #ruby
itarato has quit [Ping timeout: 276 seconds]
TzilTzal_ has joined #ruby
NL3limin4t0r has quit [Ping timeout: 276 seconds]
phaul has quit [Ping timeout: 250 seconds]
dG___ has quit [Remote host closed the connection]
TzilTzal_ has quit [Remote host closed the connection]
rwb has quit [Quit: rwb]
NL3limin4t0r has joined #ruby
rwb has joined #ruby
NODE has quit [Quit: changing servers]
BTRE has quit [Remote host closed the connection]
BTRE has joined #ruby
NODE has joined #ruby
phaul has joined #ruby
rwb has quit [Ping timeout: 250 seconds]
<Bish>
if i have a daemon that is run by a default user
<Bish>
what would be the linux-idomatic way to expose a .sock
<Bish>
do i put it into the home folder? can i put it into /var/run ?
<Bish>
it's not supposed to be a service
TzilTzal has joined #ruby
phaul has quit [Ping timeout: 245 seconds]
AJA4350 has quit [Quit: AJA4350]
AJA4350 has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
NODE has quit [Client Quit]
phaul has joined #ruby
NODE has joined #ruby
drincruz has quit [Ping timeout: 250 seconds]
NODE has quit [Client Quit]
NODE has joined #ruby
phaul has quit [Ping timeout: 276 seconds]
Mrgoose845701915 has quit [Read error: Connection reset by peer]
TzilTzal_ has joined #ruby
Mrgoose845701915 has joined #ruby
phaul has joined #ruby
TzilTza__ has joined #ruby
TzilTzal has quit [Ping timeout: 245 seconds]
akemhp_ has joined #ruby
TomyWork has joined #ruby
phaul has quit [Ping timeout: 250 seconds]
donofrio_ has joined #ruby
TzilTzal_ has quit [Ping timeout: 265 seconds]
akemhp has quit [Ping timeout: 250 seconds]
donofrio has quit [Ping timeout: 240 seconds]
phaul has joined #ruby
shokohsc has quit [Ping timeout: 250 seconds]
drincruz has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
akemhp has joined #ruby
AJA4351 has joined #ruby
akemhp_ has quit [Read error: Connection reset by peer]
nacsurte has joined #ruby
phaul has joined #ruby
AJA4350 has quit [Ping timeout: 276 seconds]
AJA4351 is now known as AJA4350
TzilTza__ has quit [Remote host closed the connection]
TzilTzal has joined #ruby
TzilTzal_ has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
nacsurte has quit [Ping timeout: 250 seconds]
phaul has quit [Ping timeout: 276 seconds]
TzilTzal_ has quit [Remote host closed the connection]
TzilTzal has quit [Ping timeout: 240 seconds]
TzilTzal has joined #ruby
AJA4351 has joined #ruby
phaul has joined #ruby
NODE has quit [Quit: changing servers]
kapil_ has quit [Quit: Connection closed for inactivity]
AJA4350 has quit [Ping timeout: 265 seconds]
TzilTzal has quit [Remote host closed the connection]
<rubydoc>
stderr: /usr/lib/ruby/2.6.0/base64.rb:66:in `pack': no implicit conversion of Array into String (TypeError)... check link for more (https://carc.in/#/r/855n)
<havenwood>
Bish: Yes, those are the same numbers.
<rubydoc>
stderr: /usr/lib/ruby/2.6.0/base64.rb:39:in `pack': no implicit conversion of Array into String (TypeError)... check link for more (https://carc.in/#/r/855o)
<havenwood>
TomyWork: Solution for what? I just thought you were trying to show that "1" is the byte value 49. Now I'm not sure what you were trying to show?
TzilTzal has joined #ruby
<TomyWork>
how did you get that idea?
<havenwood>
TomyWork: You showed an Array with the numbers `1, 2, 3` when someone had already shown the bytes `"\x01", "\x02", "\x03"`.
<Inside>
\o\
<Inside>
havenwood!
phaul has quit [Ping timeout: 240 seconds]
NODE has quit []
Benett has quit [Quit: ]
<havenwood>
/o/
<leftylink>
\o/ non oc /o\
<TomyWork>
havenwood, well j`ey wanted an array of bytes. "\x01" is not a byte
<TomyWork>
it's a string
<leftylink>
it's time to stay at the \o/ non oc /o\
<Inside>
non oc?
<leftylink>
uh.... hammer?
<leftylink>
I guess?
<leftylink>
if you ask me what comes to mind immediately?
<havenwood>
TomyWork: I know how the internals work. The size of an RVALUE isn't relevant to whether something is or isn't a byte. A byte is 8 bits and can be represented any which way. "Byte" is just number between 00000000 and 11111111, or between "\x00" and "\xFF" or between 0 and 255, or however you want to represent those numbers - as byte characters/strings, ordinals,
cd has joined #ruby
<havenwood>
You could represent a byte with eight tiny yodas, and I'd be fine with that.
phaul has joined #ruby
spacesuitdiver has joined #ruby
Benett has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has quit [Ping timeout: 250 seconds]
<Bish>
TomyWork: uh uh that is my topic
<Bish>
sequel
<Bish>
ohshit it already has been said
<Bish>
yeah sequel is the best ORM inside and outside ruby
<havenwood>
I dig Sequel's plugin system. Nice to keep it light until you need a particular weight.
<Bish>
yeah all of jeremyevans projects are fking awesome in that regard
<Bish>
im writing a program right now with that system in mind
<Bish>
his ruby performance talk is also great
<TomyWork>
yeah sequel looks nice... does it help you with creating the tables like hibernate does?
<Bish>
and sane defaults and configurateable until the last bit
<Bish>
yeah, it has a ruby ⇐⇒ sql mapping
phaul has joined #ruby
<Bish>
that even works beyond different dbs
<Bish>
if your schema doesn't use db-specific features you can even migrate between databases
<Bish>
but it also works with db-specific stuff, you can just use a different mode
titanbiscuit has quit [Read error: Connection reset by peer]
bluvinyl has joined #ruby
titanbiscuit has joined #ruby
phaul has joined #ruby
orbyt_ has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
titanbiscuit has quit [Read error: Connection reset by peer]
phaul has quit [Ping timeout: 265 seconds]
titanbiscuit has joined #ruby
Technodrome has joined #ruby
phaul has joined #ruby
NODE has quit [Quit: changing servers]
Benett has quit [Quit: ]
phaul has quit [Ping timeout: 265 seconds]
phaul has joined #ruby
duderonomy has joined #ruby
Benett has joined #ruby
duderonomy has quit [Client Quit]
clemens3 has quit [Quit: WeeChat 1.6]
phaul has quit [Ping timeout: 250 seconds]
duderonomy has joined #ruby
<TomyWork>
Bish, ok this is a really nice library. just one problem: contrary to the docs, creating a table with a String column on a postgres db gave me text instead of varchar(255)
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
reber_ has joined #ruby
phaul has joined #ruby
NODE has joined #ruby
NODE has quit [Client Quit]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
reber has quit [Ping timeout: 268 seconds]
<TomyWork>
text: false fixed it, and i read the docs wrong
<TomyWork>
it's just commonly varchar(255), not on all databases
NODE has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has quit [Ping timeout: 265 seconds]
galaxie has joined #ruby
phaul has joined #ruby
NL3limin4t0r is now known as NL3limin4t0r_afk
andikr has quit [Remote host closed the connection]
duderonomy has joined #ruby
phaul has quit [Ping timeout: 268 seconds]
NODE has quit []
Benett has quit [Remote host closed the connection]
Technodrome has joined #ruby
Benett has joined #ruby
phaul has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NODE has joined #ruby
NODE has quit [Client Quit]
phaul has quit [Ping timeout: 268 seconds]
NODE has joined #ruby
NODE has quit [Client Quit]
phaul has joined #ruby
NODE has joined #ruby
NODE has quit [Client Quit]
cxl has quit [Quit: bye]
NODE has joined #ruby
phaul has quit [Ping timeout: 268 seconds]
skx86 has joined #ruby
duderonomy has joined #ruby
phaul has joined #ruby
duderonomy has quit [Client Quit]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
phaul has quit [Ping timeout: 276 seconds]
cthulchu has joined #ruby
fphilipe_ has quit [Ping timeout: 250 seconds]
phaul has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has quit [Ping timeout: 265 seconds]
nowhere_man has joined #ruby
r29v has joined #ruby
phaul has joined #ruby
titanbiscuit has quit [Quit: ZNC 1.7.4 - https://znc.in]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
titanbiscuit has joined #ruby
howdoi has joined #ruby
titanbiscuit has quit [Read error: Connection reset by peer]
reber_ has quit [Ping timeout: 268 seconds]
phaul has quit [Ping timeout: 276 seconds]
titanbiscuit has joined #ruby
Technodrome has joined #ruby
phaul has joined #ruby
dionysus69 has quit [Quit: dionysus69]
duderonomy has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
BTRE has quit [Remote host closed the connection]
phaul has joined #ruby
itarato has joined #ruby
BTRE has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
itarato has quit [Ping timeout: 240 seconds]
TzilTzal has joined #ruby
phaul has quit [Ping timeout: 268 seconds]
TomyWork has quit [Ping timeout: 246 seconds]
jesfre has joined #ruby
phaul has joined #ruby
TzilTzal has quit [Ping timeout: 246 seconds]
phaul has quit [Ping timeout: 250 seconds]
chalkmonster has quit [Quit: WeeChat 2.6]
titanbiscuit has quit [Quit: ZNC 1.7.4 - https://znc.in]
hutch1 has joined #ruby
titanbiscuit has joined #ruby
phaul has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has quit [Ping timeout: 268 seconds]
r29v has quit [Quit: WeeChat 2.6]
Benett has quit [Quit: ]
NODE has quit []
phaul has joined #ruby
chalkmonster has joined #ruby
titanbiscuit has quit [Quit: ZNC 1.7.4 - https://znc.in]
titanbiscuit has joined #ruby
jesfre has quit [Ping timeout: 265 seconds]
r29v has joined #ruby
Benett has joined #ruby
spacesuitdiver has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
linoespinoza has joined #ruby
phaul has joined #ruby
umjisus has joined #ruby
bsdband69 has quit [Read error: Connection reset by peer]