<havenwood>
neachdainn: You don't need rake for any reason I can think of. Usually the `gem` command is used to build and install the gem but there's nothing specific to C-extensions I can think of.
cagomez has quit [Remote host closed the connection]
xco has joined #ruby
xco has quit [Client Quit]
xco has joined #ruby
xco has quit [Client Quit]
spt0 has quit [Ping timeout: 248 seconds]
mtkd has quit [Ping timeout: 258 seconds]
MrBusiness has joined #ruby
<neachdainn>
So I'm getting the extension to compile, but I can't load it in irb
<habs>
hi -- I'm having trouble understanding Ruby classes. why will this short example not work? https://gist.github.com/hpr/4d9d86a59cd28aac2ddb5a1b944739fa If I have to keep 'other_method' the same, how can I modify the rest of the code to give me the desired result?
bronson has quit [Remote host closed the connection]
mtkd has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
bmurt has joined #ruby
<Zarthus>
habs: you can use @index in other_method
<habs>
Zarthus: ok -- but what if I have to keep other_method the same? What does it mean when I do ExampleClassName.example_variable within a class -- is that even valid Ruby?
<Zarthus>
why does other_method have to be the same?
<Zarthus>
right now your code does nothing because you're not showing us how you're interacting with your class.
<Zarthus>
if the logic in other_method is wrong, it makes no sense to modify something else
eblip has quit [Ping timeout: 240 seconds]
<havenwood>
habs: The way you're using it isn't right, but if you'd defined a class method that would work. The idiomatic way is to use `self` inside Test where `self == Test #=> true`.
eb0t has quit [Ping timeout: 240 seconds]
<havenwood>
habs: You should set your instance methods inside an #initialize method with a class.
enterprisey has quit [Quit: Leaving]
<havenwood>
habs: your #index method is an appropriate getter (you can define the same thing shorthand with `attr_getter :index` but #other_method isn't an appropriate setter.
<habs>
Zarthus: it has to be the same because it's code that was provided to me under the assumption that it was correct. i'm trying to provide a minimal working example, to help debug
<havenwood>
habs: I commented on your gist.
leah2 has joined #ruby
minimalism has quit [Quit: minimalism]
<havenwood>
habs: test = Test.new; test.test_method; test.test_method; test.index #=> 98
<habs>
havenwood: Thank you -- I agree that I should have used the 'initialize' method. but what if I 'needed' to use Test.index as in ClassName.example_variable syntax within the class -- without using class variables (which I understand are frowned upon)? what does that syntax mean and is it valid?
eckhardt has joined #ruby
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
<havenwood>
habs: You have a instance method Test#index not a class method Test.index.
spt0 has joined #ruby
<havenwood>
habs: Test.index correctly calls the class method, but you haven't defined one.
<havenwood>
habs: You'll see that actually written `self.index` rather than `Test.index` inside Test, because `self` is `Test` inside and that way you can rename it and not have to change it everywhere.
<havenwood>
habs: Try: class Test; def self.meaning; 42 end end; Test.meaning
troys is now known as troys_
<Zarthus>
i thought we had a clever ruby[bot] for that
<havenwood>
habs: You could call that class method inside Test with `Test.meaning` but the idiomatic way inside the class is `self.meaning`.
<havenwood>
Zarthus: I'd have to paste the working code before using it though.
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<habs>
havenwood: Ah, thank you, realizing that that was called a 'class method' helped a lot
eb0t has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<habs>
havenwood: Only problem is now I get NoMethodError: undefined method `-' for nil:NilClass? what does this mean and how can it be fixed?
<havenwood>
habs: Show the code you get that error with?
<havenwood>
habs: It means you're doing: nil - ...
<habs>
(this is with keeping the old other_method, but having a new class method "def self.index; @index; end") OK yes I'll pase it
<havenwood>
habs: It's problematic to expose an instances state to the class itself.
SeepingN has quit [Remote host closed the connection]
<havenwood>
instance's*
<havenwood>
habs: Use a class if you have more than one instance of state. That way each class instance represents one instance of state.
<havenwood>
habs: Use a module if you don't have any instances of state.
coderphive has quit [Quit: coderphive]
<havenwood>
habs: Use a singleton class if you have just one instance of state.
<habs>
havenwood: sorry, i'm just having trouble understanding what you mean by 'instance of state' in this example. isn't all of the state contained per instance of the class?
<havenwood>
habs: You'll never expose an instance's state via a class method, because that class method isn't specific to one instance.
<havenwood>
habs: Your example doesn't call for class methods. You can use them but it doesn't make sense.
<habs>
Ah, I see. So what if this is intended to be a singleton class then? I think that would make sense
<havenwood>
habs: I'd suggest pretending that class methods don't exist.
blackmesa has quit [Ping timeout: 246 seconds]
<havenwood>
habs: Use a singleton class if there's only one instance of state. Like there can't be two of these things, ever.
<havenwood>
habs: I think you'll usually find you have either no instance of state or many, most often. Singleton is there if you really have one, which happens, but less often.
<habs>
havenwood: Yes, that singleton may apply to this case I think. What I know is that 'other_method' is given to me as written, so I'd like to do whatever I have to in the other methods to make that compile
milardovich has joined #ruby
Dimik has quit [Ping timeout: 248 seconds]
enko_ has joined #ruby
<havenwood>
habs: I don't understand what you're trying to do, but if you show what you have and what you want I bet someone can help.
<havenwood>
Show real code if you can.
<havenwood>
habs: Or if you're just trying to learn, feel free to ask questions.
pr0ton has joined #ruby
<habs>
havenwood: what I want is, with the code provided, to be able to do this: test = Test.new; test.test_method; test.test_method; test.index #=> 98
<havenwood>
habs: A frequently-recommended book on object oriented design in Ruby is Sandi Metz' Practical Object-Oriented Design in Ruby.
<habs>
With the restriction, that the 'other_method' code is provided to me as a 'black box' if you will
<havenwood>
habs: If my comment to the gist doesn't work, show why?
<havenwood>
What's happening that's wrong?
milardovich has quit [Ping timeout: 248 seconds]
<havenwood>
Is the black box returning a value you need to use?
<havenwood>
If it doesn't return anything, how are you supposed to do something?
Cohedrin_ has quit [Write error: Connection reset by peer]
<havenwood>
Say more?
<habs>
havenwood: Your comment 'works' but it changes the definition of other_method, which I have to keep the same as it was -- I can change any other method or part of the class though
<havenwood>
Are you relying on a side effect or return value?
<havenwood>
What does the black box do?
<habs>
Maybe black box was the wrong term, what I meant is that the code is provided and I know that the code is exactly def other_method; @index -= 1; end -- but I can't change that
<havenwood>
Then the code will work.
<habs>
Sorry, typo, meant to say the code is exactly def other_method; Test.index -= 1; end
<enko_>
Are there any free editors like sublime text?
<havenwood>
enko_: Atom
<habs>
I think, 'index' is meant to be shared amongst all instances of Test?
<havenwood>
habs: seems like it
<enko_>
does it have that scrolling side bar to see all your code havenwood ?
<havenwood>
habs: so in that case, you're actually on the right track with Singleton
<havenwood>
enko_: yes
<enko_>
great, thank you havenwood for the suggestion, I will check it out.
Cohedrin_ has joined #ruby
<havenwood>
enko_: After installing atom: apm install minimap-plus
<havenwood>
enko_: That plugin is like the sublime map.
<habs>
havenwood: OK, but using singleton would be an issue of best practice and not a requirement, right? Just to understand, how could I make that work without using singleton? as in, how can I get it to function as desired but not get "undefined method `-' for nil:NilClass"?
Cohedrin_ has quit [Read error: Connection reset by peer]
<havenwood>
habs: I commented on your gist one more time with a solution. I'm tired so that's the end of my free consulting. ;-)
<habs>
havenwood: OK, I will check it out but thank you so much for your help regardless
<havenwood>
habs: A Singleton seems to make sense in your circumstance.
<havenwood>
habs: You're welcome!
motstgo has quit [Quit: WeeChat 1.9]
Cohedrin_ has joined #ruby
nofxx has quit [Remote host closed the connection]
eb0t has quit [Ping timeout: 258 seconds]
nankyokusei has joined #ruby
<enko_>
havenwood, this is great!
hndk has quit [Quit: Leaving]
nofxx has joined #ruby
<enko_>
syntax highlghting is different than what I am used to :P but I am a beginner
<habs>
havenwood: The example works -- but I still wonder how I could do that (however inadvised it may be) without requiring the 'singleton' module.
zachk has quit [Quit: Leaving]
nankyoku_ has quit [Ping timeout: 258 seconds]
_whitelogger has joined #ruby
eb0t has joined #ruby
amirite has joined #ruby
webguynow has quit [Ping timeout: 240 seconds]
zautomata has joined #ruby
webguynow has joined #ruby
weaksauce has quit [Read error: Connection reset by peer]
d^sh has quit [Ping timeout: 240 seconds]
guardianx has joined #ruby
amirite has quit [Ping timeout: 240 seconds]
d^sh has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
leah2 has joined #ruby
Keytap has joined #ruby
<habs>
can someone please help me understand why this code https://gist.github.com/4d9d86a59cd28aac2ddb5a1b944739fa doesn't work? I expect it to return #=> 99, but instead I get NoMethodError: undefined method `-' for nil:NilClass
Keytap has quit [Ping timeout: 248 seconds]
mim1k has joined #ruby
<habs>
In other words -- how can I set up a variable that is shared among all instances of a class, and that I can add to and subtract from within that class? I don't want to use 'class variables' though
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has quit [Ping timeout: 240 seconds]
amirite has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
TheRealMattM has joined #ruby
tvw has quit [Ping timeout: 240 seconds]
quobo has quit [Quit: Connection closed for inactivity]
amirite has quit [Ping timeout: 258 seconds]
jinie has quit [Ping timeout: 260 seconds]
<neachdainn>
Working with the C api, how do I allocate an array of VALUEs? Are they safe to just ALLOC?
ramfjord has quit [Ping timeout: 248 seconds]
jinie has joined #ruby
gusrub has joined #ruby
naprimer has quit [Ping timeout: 258 seconds]
<enko_>
is it wrong to want to use ruby for web development as well as standard desktop apps?
xco has joined #ruby
bmurt has joined #ruby
amirite has joined #ruby
bastilian has quit [Quit: bastilian]
gizmore|2 has joined #ruby
__Yiota has joined #ruby
bastilian has joined #ruby
__Yiota has quit [Max SendQ exceeded]
ycyclist has quit [Ping timeout: 260 seconds]
__Yiota has joined #ruby
Cohedrin_ has quit [Read error: Connection reset by peer]
naprimer has joined #ruby
gizmore has quit [Ping timeout: 248 seconds]
amirite has quit [Ping timeout: 240 seconds]
__Yiota has quit [Max SendQ exceeded]
pr0ton has quit [Quit: pr0ton]
bastilian has quit [Client Quit]
bastilian has joined #ruby
__Yiota has joined #ruby
Cohedrin_ has joined #ruby
kies has quit [Ping timeout: 248 seconds]
shinnya has quit [Ping timeout: 248 seconds]
kapil___ has joined #ruby
bronson has joined #ruby
tamouse__ has joined #ruby
r3kz has left #ruby [#ruby]
tvw has joined #ruby
guardianx has quit []
leah2 has quit [Ping timeout: 258 seconds]
orbyt_ has joined #ruby
ledestin has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
tamouse__ has quit [Ping timeout: 258 seconds]
bastilian has quit [Quit: bastilian]
bastilian has joined #ruby
enterprisey has joined #ruby
Defenestrate has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bastilian has quit [Client Quit]
bastilian has joined #ruby
Defenestrate has quit [Client Quit]
bmurt has joined #ruby
rrichardsr3 has joined #ruby
bastilian has quit [Client Quit]
whippythellama has quit [Ping timeout: 246 seconds]
bastilian has joined #ruby
Alina-malina has quit [Ping timeout: 260 seconds]
s3nd1v0g1us has joined #ruby
tamouse__ has joined #ruby
leah2 has joined #ruby
marcux has joined #ruby
bastilian has quit [Client Quit]
guardianx has joined #ruby
ramfjord has joined #ruby
bastilian has joined #ruby
Alina-malina has joined #ruby
eb0t has quit [Quit: WeeChat 1.9.1]
mjolnird has quit [Quit: Leaving]
troys_ is now known as troys
GodFather has quit [Ping timeout: 246 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
sylario has quit [Quit: Connection closed for inactivity]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eb0t has joined #ruby
marcux has quit [Quit: Lost terminal]
<habs>
Why do I get "undefined method `+' for nil:NilClass" when I do "TestClass.variable += 1"? I have "def self.variable= value; @variable = value; end" and "def self.variable; @variable; end" so shouldn't that work?
<Radar>
why do you want to have a class behave in this way?
<Radar>
Consider that if you're fighting Ruby to achieve your goal that perhaps Ruby is telling you that you shouldn't do it that way?
<habs>
havenwood: re: rubybot, I get that, but I already have @variable defined to 100 (or whatever) in the initialize function
bmurt has joined #ruby
<habs>
Radar: It's for help with a Ruby assignment, that requires me to work around code that has the "Test.index -= 1" code. So I think there should be a reasonable way to do this in Ruby
<Radar>
habs: what does the requirement say exactly?
bmurt has quit [Client Quit]
<habs>
Radar: 'other_method' is provided as a helper method for me that I must use. When I call Test.index, I want a number that ultimately represents, say, 100 minus the number of Test instances created
<Radar>
Requirements are still unclear to me.
<habs>
Radar: In other words, I want that number to start at 100, but decrease when I call other_method from any instance of Test. sorry for the lack of clarity, does that make it better?
<Radar>
habs: So decrement the value directly before you call other_method?
Keytap has joined #ruby
<habs>
Radar: No -- I want to leave other_method as it is, but I want the rest of the class to not give me runtime errors
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
pawnbox has quit [Ping timeout: 248 seconds]
pawnbox has joined #ruby
webnanners has quit [Ping timeout: 246 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
webnanners has joined #ruby
leah2 has joined #ruby
gnufied has quit [Ping timeout: 246 seconds]
anisha has quit [Read error: Connection reset by peer]
TIME_WAIT_HELL has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
Mon_Ouie has joined #ruby
alfiemax_ has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
charliesome has joined #ruby
charliesome_ has joined #ruby
leah2 has quit [Ping timeout: 240 seconds]
charliesome__ has joined #ruby
charliesome__ has quit [Read error: Connection reset by peer]
charlies_ has joined #ruby
charliesome has quit [Ping timeout: 246 seconds]
charliesome_ has quit [Ping timeout: 246 seconds]
webnanners has quit [Ping timeout: 248 seconds]
alfiemax_ has quit [Remote host closed the connection]
anisha has joined #ruby
GodFather has joined #ruby
anisha has quit [Read error: Connection reset by peer]
webnanners has joined #ruby
rahul_bajaj has joined #ruby
rabajaj has quit [Ping timeout: 255 seconds]
ramfjord has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
ldepandis has joined #ruby
unreal has joined #ruby
leah2 has joined #ruby
sysvalve has quit [Ping timeout: 248 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
halt has quit [Ping timeout: 258 seconds]
anisha has joined #ruby
leah2 has quit [Ping timeout: 255 seconds]
halt has joined #ruby
matcouto has joined #ruby
bronson has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 255 seconds]
troulouliou_dev has joined #ruby
matcouto has quit [Remote host closed the connection]
zautomata has quit [Ping timeout: 264 seconds]
rahul_bajaj has quit [Ping timeout: 248 seconds]
__Yiota has joined #ruby
greenbagels has quit [Read error: Connection reset by peer]
tcopeland has joined #ruby
greenbagels has joined #ruby
rahul_bajaj has joined #ruby
rahul_bajaj has quit [Remote host closed the connection]
Mortomes|Work has quit [Ping timeout: 260 seconds]
rabajaj has joined #ruby
ldnunes has joined #ruby
pawnbox has quit [Remote host closed the connection]
ldepandis has quit [Ping timeout: 240 seconds]
soulisson has joined #ruby
jinie has quit [Ping timeout: 248 seconds]
ramfjord has joined #ruby
alfiemax has joined #ruby
<soulisson>
Hi, I'm learning by my self and I'm trying to have a good definition of what a data structure is. So far, I've 1 - a collection of data organized in a certain fashion. 2 - Something that contains data organized in some fashion. Which one is the more appropriate?
jinie has joined #ruby
ShalokShalom has joined #ruby
<tobiasvl>
what's the difference between the two?
alfiemax has quit [Remote host closed the connection]
<tobiasvl>
in other words: how would you explain the semantic difference between the two definitions?
<tobiasvl>
(I'm not sure there is a discernable difference)
ramfjord has quit [Ping timeout: 248 seconds]
<tobiasvl>
I guess a structure is more a collection than a container, but the structure surely does contain data
sysvalve has joined #ruby
<soulisson>
tobiasvl, thanks very much.
<elomatreb>
It's a flexible term, can mean a lot of different stuff depending on context
<soulisson>
I'm just struggling with the definitions
<matthewd>
Is a sentence a collection of words, or a thing that contains words?
<elomatreb>
E.g. when talking close-to-metal development it probably means a C-struct
<soulisson>
matthewd, I would say both?
<tobiasvl>
soulisson: how did you arrive at those two very similar definitions then? surely there are other options for definitions that are different from those in more semantic ways
<tobiasvl>
soulisson: exactly, that was my point earlier too
simmaniac has joined #ruby
<soulisson>
tobiasvl, probably, I just used the various data structures, and I was looking for a broad definition.
<tobiasvl>
an array is a data structure, it's a collection, and a container. a linked list is probably a collection, but is it a container?
<soulisson>
I guess they're stupid.
<soulisson>
tobiasvl, it contains nodes, but can I call it a container, I don't know
<elomatreb>
Depending on where you're talking there may not be a big difference between a linked list and an array, which makes this a difficult discussion
<tobiasvl>
yeah
gnufied has joined #ruby
<matthewd>
soulisson: I would say both, but also neither -- it's more than just its parts combined, but nor does it really 'contain' them
sysvalve has quit [Ping timeout: 248 seconds]
<elomatreb>
This is getting philosophical - Can you even have data not contained in a structure?
<tobiasvl>
what's data?
<soulisson>
really sorry about this, I'm just struggling with this. I know I'm not smart, but I thought I would ask. Thanks for your help.
jameser has joined #ruby
<tobiasvl>
soulisson: no problem dude
<tobiasvl>
but what are you trying to achieve with such a nebulous definition
<soulisson>
tobiasvl, I thought about having a broad definition of data structure, I know this is not really helpful in programming but I come from a mathematics background and before using something the concepts must be well understood
<elomatreb>
Don't be surprised if you're having trouble with that in CS, it's a lot less rigorous
deduped has joined #ruby
nunchuck has joined #ruby
rwb has quit [Ping timeout: 260 seconds]
<soulisson>
elomatreb, yes, indeed I struggle, I spent plenty of time to learn but seems I have difficulties to really understand things. I'm seriously thinking about giving up.
<elomatreb>
Don't be discouraged, if your goal is to actually program these fine distinctions are not really required despite being "fundamentals"
<soulisson>
I really appreciate your help all. Thanks very much.
<tobiasvl>
yeah, just learn ruby fundamentals first, the other concepts will come
<soulisson>
tobiasvl, I'm ok writing basic stuff but seems my mind is stuck in a loop with definitions :)
ElDoggo has joined #ruby
greenbagels has quit [Read error: Connection reset by peer]
milardovich has joined #ruby
milardovich has quit [Remote host closed the connection]
greenbagels has joined #ruby
Keytap has joined #ruby
ElDoggo has quit [Ping timeout: 260 seconds]
webnanners has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
fmcgeough has joined #ruby
pawnbox has joined #ruby
lel has quit [Ping timeout: 240 seconds]
lel has joined #ruby
Keytap has quit [Ping timeout: 248 seconds]
Silthias has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
John__ has joined #ruby
pawnbox has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 248 seconds]
pawnbox has joined #ruby
webnanners has joined #ruby
alfiemax has joined #ruby
jameser has quit [Ping timeout: 240 seconds]
paranoicsan is now known as paranoicsan[Away
paranoicsan[Away is now known as paranoicsan
alfiemax_ has joined #ruby
matcouto has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Read error: Connection reset by peer]
jameser has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
aufi has quit [Ping timeout: 240 seconds]
matcouto has quit [Ping timeout: 264 seconds]
alfiemax_ has quit [Remote host closed the connection]
dionysus69 has joined #ruby
Silthias has joined #ruby
chouhoulis has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
f3ttX] has joined #ruby
Todiann has joined #ruby
Todiann has quit [Client Quit]
holgerdanske has quit [Remote host closed the connection]
webnanners has quit [Ping timeout: 240 seconds]
jphase has joined #ruby
ShalokShalom has quit [Ping timeout: 248 seconds]
ShalokShalom_ has joined #ruby
PaulCapestany has quit [Quit: .]
mson has joined #ruby
tamouse__ has quit [Ping timeout: 248 seconds]
aufi has joined #ruby
webnanners has joined #ruby
uZiel has joined #ruby
bmurt has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
rwb has joined #ruby
GodFather has quit [Ping timeout: 246 seconds]
bruno- has quit [Ping timeout: 246 seconds]
rfoust has joined #ruby
nicesignal has quit [Remote host closed the connection]
uneeb has quit [Read error: Connection reset by peer]
thinkpad has quit [Ping timeout: 264 seconds]
polishdub has quit [Quit: leaving]
marcux has quit [Remote host closed the connection]
ycyclist has joined #ruby
d10n-work has quit [Quit: Connection closed for inactivity]
polishdub has joined #ruby
spt0 has joined #ruby
troys has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
soulisson has quit [Quit: Leaving]
[Butch] has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
mark_66 has quit [Remote host closed the connection]
cagomez has quit [Ping timeout: 258 seconds]
mark_66 has joined #ruby
alex`` has quit [Ping timeout: 240 seconds]
pr0ton has joined #ruby
mark_66 has quit [Remote host closed the connection]
pr0ton has quit [Client Quit]
amirite has joined #ruby
pr0ton has joined #ruby
greenbagels has quit [Read error: Connection reset by peer]
<amirite>
hello
jrafanie has joined #ruby
greenbagels has joined #ruby
hahuang65 has joined #ruby
[Butch] has joined #ruby
elitekmbrz has joined #ruby
jaruga has quit [Quit: jaruga]
webnanners has quit [Ping timeout: 248 seconds]
elitekmbrz has quit [Read error: Connection reset by peer]
<amirite>
greetings
webnanners has joined #ruby
<adam12>
amirite: o/
SeepingN has joined #ruby
* amirite
gives adam12 a cake
<amirite>
how do I emoji on irc
<adam12>
nom nom
<adam12>
O_o
<adam12>
use the ascii, luke
naprimer2 has quit [Quit: Leaving]
<elomatreb>
Or just paste emojis, if the encoding works they just work
<amirite>
ok, this is cake -- ~=[]
marcux has joined #ruby
* amirite
gives adam12 some gift money [̲̅$̲̅(̲̅ιοο̲̅)̲̅$̲̅]
<adam12>
oh fancy.
<amirite>
(-(-_(-_-)_-)-)
<amirite>
ok back to work
* baweaver
wanders in
<adam12>
baweaver: o/
reber has quit [Quit: Leaving]
moei has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
amirite has quit [Remote host closed the connection]
bronson has joined #ruby
amirite has joined #ruby
amirite has quit [Client Quit]
jamesaxl has joined #ruby
amirite has joined #ruby
<amirite>
what's a good REPL to use? in python there is an excellent one called 'ptpython' if anyone is familiar with it. Something more useful then IRB
eckhardt has joined #ruby
marcux has quit [Quit: Lost terminal]
cagomez has joined #ruby
RickHull has joined #ruby
cdg has quit [Remote host closed the connection]
opekktar has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
leah2 has joined #ruby
herbmillerjr has joined #ruby
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
voiceftp has quit [Ping timeout: 258 seconds]
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
truenito has joined #ruby
opekktar has left #ruby [#ruby]
<rob_>
pry is nice
<agent_white>
amirite: pry
mson has joined #ruby
centrx has quit [Remote host closed the connection]
cagomez has quit [Remote host closed the connection]
voiceftp has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rrichardsr3 has joined #ruby
conta1 has joined #ruby
brent__ has joined #ruby
brent__ has quit [Client Quit]
<amirite>
pry doesn't save blocks
<amirite>
i.e. if i hit up to cycle through my history
<amirite>
i have to hit enter for each line of a block that i want to re-define
<gchristensen>
hi, I'm seing with json's pretty_generate it is outputting data in an essentially random order, for example it might output { "foo": "bar", "baz": "tux" } one time and { "baz": "tux", "foo": "bar" } the next. is there a way to make this output stable between dumps?
<RickHull>
I get the same output on repeated calls
<RickHull>
also I think Ruby has ordered hashes now, since like 2.2 maybe?
<havenwood>
RickHull: Since 1.9.
paranoicsan has quit [Quit: paranoicsan]
<gchristensen>
yeah I know they're not usually, it just making a bit of a mess of a service since every time it writes differently, it restarts a service
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gchristensen>
oy, I'm using ancient ruby, 1.8.x or something for Puppet 2 :'(
<havenwood>
I love all these little performance patches though. They add up!
<havenwood>
Or subtract down.
ramfjord has joined #ruby
<havenwood>
baweaver: Yeah, the name isn't ideal. I like |> like in F# and Elixir.
<havenwood>
I'd love to get |> pipes in Ruby 3.
eam has quit [Changing host]
eam has joined #ruby
<gchristensen>
IIRC there is a proposal in for PHP to get it too :)
snickers has joined #ruby
shime has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
nb_bez_______ has quit [Quit: Connection closed for inactivity]
snickers has quit [Client Quit]
<matthewd>
Even on a new-enough ruby to have an ordered hash, it seems unwise to assume the order will be retained by JSON, which is AFAIK explicitly unordered because of the "JS" part
InfinityFye has quit [Quit: Leaving]
<havenwood>
In Postgres for example, a JSON data type will stay ordered but JSONB will not.
<RickHull>
yep, to generate JSON is to generate a string (which maintains order). The concern would be cycling, whereby that string is parsed into a data structure and emitted in some form
workmad3 has quit [Ping timeout: 240 seconds]
leah2 has joined #ruby
<matthewd>
RickHull: But we're talking about Hash->String. Once it's in a string it'll stay put [unless/until manipulated]... but I'm noting that despite the hash having a defined ordering of its keys, there's no true guarantee the string contents will appear in that same order.
rrichardsr3 has quit [Quit: Apparantly my attempt to stay awake has failed...]
<havenwood>
gotcha
<RickHull>
I think the generate methods respect the hash ordering by default
eckhardt has quit [Changing host]
eckhardt has joined #ruby
<havenwood>
oops, mt
<RickHull>
so, perhaps not a contractual guarantee
naprimer has quit [Quit: Leaving]
<RickHull>
I agree that there is a pitfall here, whereby one assumes all hashes everywhere respect key ordering just because Ruby hashes do
<RickHull>
(speaking of PHP, back in the Ruby 1.8 days)
tamouse__ has joined #ruby
FahmeF_ has joined #ruby
<matthewd>
I imagine so too, because it's the most obvious implementation. But arguably there'd be advantages to explicitly sorting the keys, for example... so assuming it won't change in a future version feels avoidably risky.
<RickHull>
agreed, it is cleaner and purer to assume a pure Hash impl, which does not maintain key order
<RickHull>
... key *insertion order* ...
<matthewd>
Also, every time I make an assumption based on implemented-but-not-specified behaviour, someone later turns up to point out some way in which JRuby diverges :P
FahmeF has quit [Ping timeout: 258 seconds]
<RickHull>
yep, good point
FahmeF_ has quit [Remote host closed the connection]
tcopeland has quit [Ping timeout: 260 seconds]
zachk has joined #ruby
alex`` has joined #ruby
dinfuehr has quit [Ping timeout: 248 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
Bock has quit [Ping timeout: 248 seconds]
d5sx43 has joined #ruby
orbyt_ has joined #ruby
d5sx43 has quit [Client Quit]
pr0ton has quit [Quit: pr0ton]
dionysus70 has joined #ruby
ElDoggo has quit []
alfiemax has joined #ruby
ta has joined #ruby
<RickHull>
speaking of lib/pry/history.rb -- loader, pusher, clearer, saver -- these are instances of the Command pattern, right?
dionysus69 has quit [Ping timeout: 258 seconds]
dionysus70 is now known as dionysus69
<RickHull>
broadly similar it seems, if not to the letter. was just refreshing my memory of this pattern last night
Miron has quit [Quit: bye]
wald0 has joined #ruby
Miron has joined #ruby
al2o3-cr has quit [Ping timeout: 246 seconds]
<RickHull>
I wonder if it is preferable to more explicitly declare and invoke the pattern, even at the cost of some additional LoC
pr0ton has joined #ruby
cdg has quit [Remote host closed the connection]
biberu has quit []
tcopeland has joined #ruby
alnet has joined #ruby
leah2 has quit [Ping timeout: 255 seconds]
milardovich has quit [Remote host closed the connection]
<RickHull>
counterpoint is that many GoF patterns are needed in languages like Java. in more expressive languages, we just write code that does the thing
gchristensen has left #ruby ["WeeChat 1.9"]
<baweaver>
Some hardcore FP folks argue that they don't need patterns and that patterns are just missing language features
anisha has joined #ruby
<RickHull>
yeah, that's the sentiment. it carries some weight with me
<baweaver>
I'd say they're horribly mistaken, and FP has its own patterns that are very clearly defined
<baweaver>
They just don't want to admit that
<RickHull>
perhaps the milder version refers to the classic GoF patterns, not the entire universe of patterns
<baweaver>
Granted.
ur5us has joined #ruby
GodFather has quit [Ping timeout: 246 seconds]
milardovich has joined #ruby
<baweaver>
Moreso that different patterns emerge at different levels of abstraction
<RickHull>
it's patterns all the way down, in some sense :)
<RickHull>
what distinguishes a pattern from an idiom?
mtkd has quit [Ping timeout: 240 seconds]
<baweaver>
semantics mostly
<baweaver>
or codification into reserved keywords I suppose.
<baweaver>
or standard library
anisha has quit [Client Quit]
<baweaver>
Such that Monads and Category Theory are effectively patterns of FP
mtkd has joined #ruby
<RickHull>
it seems to me that both patterns and idioms are generally outside/above the language features like keywords. they may interact with keywords and stdlib modules, but are generally in the programmer's hands and not the language designer's
rrichardsr3 has joined #ruby
ur5us has quit [Ping timeout: 258 seconds]
imode has joined #ruby
imode is now known as Guest41646
greenbagels has quit [Read error: Connection reset by peer]
greenbagels has joined #ruby
leah2 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
webnanners has quit [Ping timeout: 248 seconds]
pr0ton has quit [Quit: pr0ton]
pr0ton has joined #ruby
madhatter has quit [Quit: leaving]
madhatter has joined #ruby
naprimer has joined #ruby
clemens3 has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
Guest41646 has quit [Quit: WeeChat 1.9]
webnanners has joined #ruby
nicolai86 has quit [Remote host closed the connection]
machinewar has joined #ruby
nicolai86 has joined #ruby
cagomez has quit [Remote host closed the connection]
rrichardsr3 has quit [Quit: He who dares .... wins.]
amirite has quit [Remote host closed the connection]
tamouse__ has quit [Ping timeout: 255 seconds]
amirite has joined #ruby
bronson has joined #ruby
troulouliou_dev has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
milardovich has quit [Remote host closed the connection]
troys is now known as troys_
harfangk has quit [Ping timeout: 246 seconds]
milardovich has joined #ruby
milardovich has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Trynemjoel has joined #ruby
ams__ has quit [Quit: Connection closed for inactivity]
gusrub has quit [Remote host closed the connection]
mson has quit [Quit: Connection closed for inactivity]
gusrub has joined #ruby
SuperL4g has joined #ruby
truenito has quit [Remote host closed the connection]
alnet has joined #ruby
selim has quit [Ping timeout: 248 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
p0p0pr37_ has joined #ruby
p0p0pr37_ has quit [Changing host]
p0p0pr37_ has joined #ruby
SuperLag has quit [Ping timeout: 252 seconds]
ur5us has joined #ruby
selim has joined #ruby
cpruitt has joined #ruby
webnanners has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
charliesome has joined #ruby
p0p0pr37 has quit [Ping timeout: 258 seconds]
p0p0pr37_ is now known as p0p0pr37
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AxelAlex has joined #ruby
eckhardt has joined #ruby
orbyt_ has joined #ruby
webnanners has joined #ruby
spt0 has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
adlerdias has quit [Ping timeout: 258 seconds]
cdg has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
nunchuck has quit [Ping timeout: 248 seconds]
deduped has quit [Ping timeout: 248 seconds]
ndrst has quit [Ping timeout: 246 seconds]
machinewar has quit []
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spt0 has joined #ruby
AxelAlex has quit [Ping timeout: 248 seconds]
sysvalve has quit [Quit: Leaving]
enterprisey has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dinfuehr has quit [Ping timeout: 248 seconds]
AxelAlex has joined #ruby
dinfuehr has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
marr has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
pr0ton has quit [Quit: pr0ton]
cagomez has joined #ruby
sagax has joined #ruby
pr0ton has joined #ruby
HalfSailorHalfPi has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
enterprisey_ has joined #ruby
ndrst has joined #ruby
ndrst is now known as Guest86958
blackmesa has quit [Ping timeout: 258 seconds]
blackmesa1 has joined #ruby
rwb has quit [Ping timeout: 246 seconds]
ThomasQM has joined #ruby
milardovich has joined #ruby
daumie has joined #ruby
AxelAlex has quit [Ping timeout: 240 seconds]
SeepingN is now known as CPngN
hahuang65 has quit [Ping timeout: 258 seconds]
AxelAlex has joined #ruby
ThomasQM has quit [Read error: Connection reset by peer]
ThomasQM has joined #ruby
ThomasQM has quit [Read error: Connection reset by peer]
ThomasQM has joined #ruby
<Pierreb|home>
it only captures the 2 first words, if i have test1 test2 test3 test4 only first 2 will be captured. I want test2 test3 test4 to be within "" when sent off to bash