<drbrain>
I don't know about SOCKSProxy, but if you're setting the form data on a Post request object, use .start(…).request(your_post_object)
<aaeron>
Is there an example u would be able to give?
UtkarshRay has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
casadei has quit [Ping timeout: 264 seconds]
<jordanm>
I am getting an error "https://github.com/mitchellh/vagrant-spec.git (at master) is not yet checked out. Run `bundle install` first." with a rakefile that includes "require 'bundler/setup'", but I have ran bundle install successfully
<ruboto>
aaeron, To properly use gist, please enable syntax highlighting, either by choosing the language manually or by entering a proper filename. If you post multiple things, separate them into multiple files. If you have a Github account, please update your gist with new information instead of posting a new one.
<drbrain>
aaeron: better, but you still can't set_form_data (line 6) after you've sent the request (line 5)
bronson has joined #ruby
willharrison has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
workmad3 has joined #ruby
evanjs has quit [Ping timeout: 244 seconds]
mwlang has joined #ruby
giuseppesolinas has joined #ruby
casadei has joined #ruby
<aaeron>
Oh.!
<aaeron>
Let me try that.
<aaeron>
I dint use the http object
reppard has joined #ruby
Marsupermammal has joined #ruby
cmisenas has joined #ruby
<Travis-42>
would there be any reasonable way to have a method from a parent class, take on the scope of the classes that inherit it? as an example, https://gist.github.com/anonymous/020dc114301d9dcb4f53 ? Or am I likely thinking about this completely incorrectly?
bronson has quit [Ping timeout: 256 seconds]
moss has quit [Read error: No route to host]
cmisenas has quit [Client Quit]
nettoweb has joined #ruby
craysiii has joined #ruby
workmad3 has quit [Ping timeout: 268 seconds]
moss has joined #ruby
bronson has joined #ruby
j4cknewt has joined #ruby
allcentury has quit [Ping timeout: 268 seconds]
unop has quit [Ping timeout: 240 seconds]
j4cknewt has quit [Remote host closed the connection]
<ruboto>
eam # => [["A", "B", "C"], ["D", "E", "F"], ["G", "H", "I"], ["J", "K", "L"], ["M", "N", "O"], ["P", "Q", "R" ...check link for more (https://eval.in/438744)
<baweaver>
ah, yeah, not necessary
gurix has quit [Quit: gurix]
yfeldblum has quit [Remote host closed the connection]
aganov has joined #ruby
<apeiros>
no words for apeiros or baweaver in /usr/share/dict/words :(
yfeldblum has joined #ruby
ankr has joined #ruby
<baweaver>
hm?
<baweaver>
I have a mac, so I do.
<apeiros>
I have a mac too, I don't. maybe I made a mistake?
<baweaver>
IO.readlines('/usr/share/dict/words')
<baweaver>
might be a version thing
<apeiros>
I used your code + mine to get a map of all words which could be generated, then Array#&'ed it with File.read("/usr/share/dict/words").upcase.split("\n")
<bnagy>
r0x0rZ: there's a fairly significant movement that prefers no parens at all except when required by the interpreter
timonv has quit [Ping timeout: 268 seconds]
<bnagy>
ie def blah a, b, c and d = blah 1, 2, 3
<bnagy>
hatred of blah() is more or less universal though
ruurd has quit [Quit: ZZZzzz…]
scoot has quit [Remote host closed the connection]
Voker57 has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
<agent_white>
:(
beauby has quit [Ping timeout: 256 seconds]
<agent_white>
I like ruby and my parens. There's like little pillows for code.
<agent_white>
s/They're/There's/
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
G has quit [K-Lined]
Junaos has quit [K-Lined]
SegFaultAX has quit [K-Lined]
<karapetyan>
i have a little mess with modules
Junaos has joined #ruby
<agent_white>
reverse that... I need sleep.
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SegFaultAX has joined #ruby
chthon has joined #ruby
ruurd has joined #ruby
tomphp has joined #ruby
vjdhama has quit [Read error: Connection reset by peer]
marr has joined #ruby
<r0x0rZ>
bnagy: just coming from Python and JS. I kinda like having parentheses bc you can immediately tell it's a function call. It's just easier for me to read that's all but I will respect how to do it the ruby way and try to learn it properly.
Pupeno has quit [Quit: Leaving...]
doublemalt_ has joined #ruby
blaxter has joined #ruby
<adaedra>
I don't like removing parenthesis on def at all
djbkd has joined #ruby
<r0x0rZ>
another newbie question regarding gem `test-unit` . When I try to read documentation `ri Test::Unit::TestCase` I don't find anything explaining assertions. Yet my program can use `assert_equal` method.
vjdhama has joined #ruby
<r0x0rZ>
is `assert_equal` method even part of `test-unit`. what am I doing wrong? I just find ruby documentation a bit diff to read
<karapetyan>
why it works? :) seems @customers should be a class variable not instance. Because in this exmaple used extend and that means all method in module will be class methods. And if it class method it's don't works with certain instances of the class?
G_ is now known as G
G is now known as 32NAAFIPE
zapata has quit [Ping timeout: 240 seconds]
32NAAFIPE is now known as G
<r0x0rZ>
aah. found my answer. it's in another class `Assertions` so I have to `ri Test::Unit::Assertions` :)
<tobiasvl>
karapetyan: why do you think @customers should be a class variable and not an instance variable?
<r0x0rZ>
karapetyan: aren't class variables declared with @@ ?
ruurd has quit [Quit: ZZZzzz…]
<r0x0rZ>
karapetyan: maybe have a look at this. it's my personal note, not perfect because i'm still newbie but you can see the difference -> http://peg.gd/6p9
j4cknewt_ has quit [Remote host closed the connection]
<karapetyan>
tobiasvl: cause @customers contain information about all instances of that class
amystephen has joined #ruby
<tobiasvl>
r0x0rZ: @@variables are indeed class variables, but you shouldn't use them :) instead, class INSTANCE variables should be used
charliesome has joined #ruby
<tobiasvl>
karapetyan: ok… but intent doesn't make functionality :) it's an instance variable
<karapetyan>
tobiasvl: don't understand :)
<r0x0rZ>
tobiasvl: yes I was just trying to tell him/her in case
yfeldblum has quit [Ping timeout: 240 seconds]
<tobiasvl>
karapetyan: what don't you understand?
sandelius has joined #ruby
<r0x0rZ>
karapetyan: take a look at that link.. you might understand it then... or just google ruby instance variables and class variables
<karapetyan>
whtbut intent doesn't make functionality << this)
<karapetyan>
ook
<karapetyan>
thanks
<r0x0rZ>
karapetyan: it's like instance methods and class methods (you use def self.mymethod for class methods for example). one has to know what instance and class methods are and why one should use them.
Xeago has quit [Remote host closed the connection]
<karapetyan>
code from example works fine
<karapetyan>
i understand how works instance variables. And understand how works class variables (i think so)
* certainty
likes parenthesis
<karapetyan>
and i just want to ask
<tobiasvl>
karapetyan: oh, maybe I misunderstood you then
amystephen has quit [Ping timeout: 265 seconds]
j4cknewt has joined #ruby
<karapetyan>
in example above seems better to use class variable instead instance varible. Cause @customers variables in example above don't store any tied to instance information
giuseppesolinas has joined #ruby
<tobiasvl>
karapetyan: never use class variables
Xeago has joined #ruby
<karapetyan>
tobiasvl: aaa ? :)
<karapetyan>
why?
<tobiasvl>
if you want to share information between objects in a class, use class instance variables
<tobiasvl>
because class variables are very confusing and counter-intuitive
<r0x0rZ>
karapetyan: class instance variable == class variable (in this context)
<tobiasvl>
r0x0rZ: that's a lenient context :P
<r0x0rZ>
karapetyan: it's good to use when you want to store identical information amongst your object
<tobiasvl>
~=
<r0x0rZ>
tobiasvl: ok maybe that was not good example :)
<r0x0rZ>
karapetyan: but that link tobiasvl sent you is a good one
yfeldblum has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
Hounddog has joined #ruby
<tobiasvl>
class instance variables are instance variables on the class
<tobiasvl>
since classes are instances too :)
tejasmanohar has quit [Quit: tejasmanohar]
<karapetyan>
nah that to difficult for me yet
zapata has joined #ruby
<karapetyan>
some kind of magic
<r0x0rZ>
tobiasvl: very good explanation
<shevy>
karapetyan whenever you see @foo it is an instance variable
leafybasil has quit [Remote host closed the connection]
ruurd has joined #ruby
<karapetyan>
shevy: i understand
<karapetyan>
but what does mean class - instance - variable? it class + instance ?
<tobiasvl>
yes, because as I said, classes are instances (of the class Class)
<Burgestrand>
When you think instance, you must think instance of *what*.
jgt2 has joined #ruby
einarj has joined #ruby
<tobiasvl>
instance variables belong to self. in a class, self is the class. in a regular (instance) method inside the class, self is the instance. so it all depends where you instantiate the @var
<r0x0rZ>
karapetyan: i don't think you need that method `show` plus that method is actually a class method, not instance method. you can omit `self.show` method and just call peter.name directly because you have already specified accessor method using `attr_reader`
vjdhama has quit [Remote host closed the connection]
scoot has quit [Remote host closed the connection]
workmad3 has joined #ruby
rattatmatt has quit [Quit: Leaving]
bronson has quit [Ping timeout: 256 seconds]
<adaedra>
r0x0rZ: rdoc is the core component in ruby managing the documentation. ri is the command that displays this documentation.
vjdhama has joined #ruby
<yorickpeterse>
morning
doublemalt_ has quit [Remote host closed the connection]
<karapetyan>
r0x0rZ: i was need to get access to class variable without creating an object (instance that class)
<r0x0rZ>
karapetyan: i forked the gist you can have a look
<karapetyan>
r0x0rZ:
<karapetyan>
thx
drewvanstone has joined #ruby
<r0x0rZ>
karapetyan: aah I see
<r0x0rZ>
let me do another fix
DoubleMalt has joined #ruby
youngbaks has quit [Ping timeout: 240 seconds]
<karapetyan>
r0x0rZ: it works now i just show to be sure that i understand correctly :)
<r0x0rZ>
karapetyan: yes your original example was right
<karapetyan>
thank you folks! seems i understand little bit more now.
tvw has joined #ruby
<r0x0rZ>
karapetyan: I'm sorry I completely missed that class_variable ... but it's still not perfect
<karapetyan>
r0x0rZ: but tobiasvl said that i never should use class vairables like @@
ishahnaz has joined #ruby
<r0x0rZ>
@@ = class instance variable, @ = instance variable
leafybas_ has joined #ruby
<adaedra>
@@ = class variable
stan has joined #ruby
mattprelude has joined #ruby
<shevy>
karapetyan yeah why would you want it
<r0x0rZ>
karapetyan: i think what he meant was not to use class instance variable and use instance variable instead
<shevy>
as tobiasvl explained above, you can use @ for both behaviours; the only thing you don't have compared to a @@ is that these be shared along the children
drewvanstone has quit [Ping timeout: 240 seconds]
<r0x0rZ>
karapetyan: if you were to add another line to that code `puts peter.class_variable` it will not work... because you can do that only on the class
astrobunny has quit [Remote host closed the connection]
leafybasil has quit [Read error: Connection reset by peer]
<karapetyan>
shevy: oookk
<r0x0rZ>
karapetyan: basically class instance variables are OK if you are subclassing and you want to share the same information among the children classes
<shevy>
they are class variables, not class instance variables ;P
phutchins has joined #ruby
<bnagy>
and they're never OK
Kendos-Kenlen has joined #ruby
<karapetyan>
thanks :))) to be sure could you give me a simple task to check understanding instance / class variables )
<r0x0rZ>
karapetyan: basically when you use `.class` on `john` instance you are calling `self.class_variable` method on the class `Customer`
djbkd has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 260 seconds]
<r0x0rZ>
so `john.class.class_variable` = `Customer.class_variable`
<karapetyan>
r0x0rZ: understnad
<r0x0rZ>
karapetyan: but it is just getter method.
<bnagy>
:(
<bnagy>
that link is so wrong on so many levels
quazimodo has joined #ruby
<bnagy>
r0x0rZ: you shouldn't be trying to teach people, sorry :(
<r0x0rZ>
bnagy: I know it's probably simplified
<r0x0rZ>
bnagy: I'm not experienced that much but I was just explaining the way I understood it for my purposes
<karapetyan>
bnagy: you know that's example from book
<bnagy>
@ivars have nothing to do with initialisation, for a start
<karapetyan>
and i copy-paste it here cause have some misunderstanding
<bnagy>
and calling methods class_variable is just asking for trouble
skade has joined #ruby
* ljarvis
spots a wild @@
<karapetyan>
and this is just code that shows how it works nothing more )
ruurd has quit [Max SendQ exceeded]
apt-get has joined #ruby
<karapetyan>
r0x0rZ: thank you!
<bnagy>
@@ is mfw I see that in people's code
ruurd has joined #ruby
<ljarvis>
hah
<bnagy>
anyway, need to cook dinner.
<r0x0rZ>
karapetyan: you're welcome but you should read up more on this. I'm probably not doing the best code practices and maybe bnagy is right. Just make sure to read up more on this later.
<karapetyan>
r0x0rZ: yes, sure thanks. Now i understand where is instance and where is class variable and that i was need. Thanks
platzhirsch has left #ruby [#ruby]
<karapetyan>
bnagy: @@ mfw ?
GreyHands has joined #ruby
<ljarvis>
"my face when" i.e angry
<ljarvis>
generally class variables (@@) are frowned upon, and class instances variables are often a better fit
<karapetyan>
ljarvis: :)
<r0x0rZ>
ljarvis: oh boy I hope I don't have dictionary mixed up :) so class vars = @@, class instance vars = @ ?
<ljarvis>
they have their place, but they're often misused and way too many beginner tutorials offer them up early on without explaining the caveats
karapetyan has quit [Remote host closed the connection]
<ljarvis>
r0x0rZ: yeah, class instance variable are just instance variables that belong to the class level. Since remember, your class is an instance of the Class class (heh)
<r0x0rZ>
ljarvis: ok
<ljarvis>
so Customer is actually an instance of Class
<r0x0rZ>
ljarvis: yes I understand. it's bit similar in Python where every class is class of Object (or at least it used to be I think)
<ljarvis>
https://eval.in/438837 -- not necessarily the best way to do this, it's not thread safe etc etc, but gives you an idea
<ljarvis>
generally, 90% of tutorials would use a @@total instead. This is definitely a shit example because that would actually be ok here
<ljarvis>
line 2 opens the singleton class for Customer so it can set the accessor on the instance of Class (Customer)
<ljarvis>
singleton/meta/eigen/whatever we're calling it today
devoldmx has joined #ruby
Igorshp has quit [Remote host closed the connection]
<r0x0rZ>
ljarvis: so line number 3 defines getter and setter methods for the class variable total, right?
<r0x0rZ>
ljarvis: i mean lines 2-3
<r0x0rZ>
ljarvis: 2-4 dammit
dravine has quit [Quit: zzz]
benlovell has quit [Ping timeout: 264 seconds]
zeroDivisible has joined #ruby
<ljarvis>
r0x0rZ: for the instance variable
<ljarvis>
it's not a class variable, remember
<sp_>
ljarvis, hi injekt.
<ljarvis>
sp_: hello :)
r0x0rZ has quit []
benlovell has joined #ruby
devoldmx has quit [Ping timeout: 240 seconds]
wookiehangover has quit [Ping timeout: 240 seconds]
arup_r has quit [Remote host closed the connection]
nofxx has quit [Ping timeout: 264 seconds]
[k- has quit [Read error: Connection reset by peer]
quazimodo has quit [Ping timeout: 250 seconds]
[k- has joined #ruby
wookiehangover has joined #ruby
Igorshp has joined #ruby
VeryBewitching has quit [Quit: Konversation terminated!]
emilkarl has joined #ruby
bigkevmcd has quit [Ping timeout: 256 seconds]
zeroDivisible has quit [Quit: WeeChat 1.3]
Burgestrand has quit []
bigkevmcd has joined #ruby
face has joined #ruby
Burgestrand has joined #ruby
suchness has joined #ruby
benlovell has quit [Ping timeout: 260 seconds]
Ropeney has joined #ruby
<suchness>
I have a class that listens to a specific change on a number of object, it then runs through a few strategies to define 'restrictions' that is then places on other object based on the state of the object it had listened to. I am struggling with a good name. Initially I was thinking RestrictionGoverner, but I don't like that much. Anyone have any ideas?
<apeiros>
Policinator!
* apeiros
doesn't have a clue and goes for lunch, have fun :)
vjdhama has quit [Remote host closed the connection]
prestorium has joined #ruby
krisquigley has quit [Ping timeout: 244 seconds]
bronson has quit [Ping timeout: 264 seconds]
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
vjdhama has joined #ruby
mercerist has joined #ruby
vjdhama has quit [Remote host closed the connection]
vjdhama has joined #ruby
iceyec has quit [Quit: Leaving]
IceyEC_ has joined #ruby
lolmaus has joined #ruby
frmendes has joined #ruby
atomical has joined #ruby
workmad3_ has joined #ruby
Jardayn has joined #ruby
aswen has quit [Ping timeout: 260 seconds]
codeitagile has quit [Quit: Connection closed for inactivity]
youngbaks has quit [Ping timeout: 250 seconds]
[k- has quit [Read error: Connection reset by peer]
[k-_ has joined #ruby
mdih has quit [Ping timeout: 240 seconds]
krisquigley has joined #ruby
workmad3_ has quit [Ping timeout: 240 seconds]
greenarrow has joined #ruby
ericjphillips has quit [Quit: Leaving.]
ericjphillips has joined #ruby
NeverDie has joined #ruby
NeverDie has quit [Client Quit]
vjdhama has quit [Ping timeout: 240 seconds]
evanjs has joined #ruby
zenguy_pc has quit [Ping timeout: 264 seconds]
cornerma1 has joined #ruby
jgt2 has joined #ruby
gusTester has joined #ruby
vjdhama has joined #ruby
j4cknewt has quit [Remote host closed the connection]
benlovell has quit [Ping timeout: 255 seconds]
gustav_ has quit [Remote host closed the connection]
cornerman has quit [Ping timeout: 264 seconds]
cornerma1 is now known as cornerman
slackbotgz has quit [Remote host closed the connection]
EXID123 has quit [Ping timeout: 246 seconds]
scripore has joined #ruby
dandrade has quit [Ping timeout: 246 seconds]
yottanami has joined #ruby
<yottanami>
I want to send numbers to an api like this <par>002205</par> but Ruby will change the number to 1157
<yottanami>
How should I fix it?
<yottanami>
I can not pass string there
sameerynho has joined #ruby
sgambino_ has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
<sonOfRa>
yottanami: numbers with leading zeroes are interpreted as base8. Take the string, remove leading zeroes, then convert to a number.
sgambino_ has quit [Client Quit]
[k-_ has quit [Ping timeout: 265 seconds]
Spami has joined #ruby
asxbr has joined #ruby
asxbr has quit [Client Quit]
asxbr has joined #ruby
_el_fer_ has joined #ruby
<yottanami>
sonOfRa, remove leading zeroes? but in 0033 the 00 are important for me in API
zenguy_pc has joined #ruby
<sonOfRa>
Err, then just pass a string? I don't see why you can't do that? What exactly are you trying to achieve here?
<yottanami>
sonOfRa, I just want to send 002205 to an API using xml Builder gem, as a number not string
moeabdol has joined #ruby
<sonOfRa>
I don't get why the leading zeroes are important if you're sending a number
<sonOfRa>
That doesn't make sense. 002205 is the same number as 2205
<yottanami>
sonne, It should be 6 digits
<sonOfRa>
That sounds like you're using a really really broken API
<apeiros>
yottanami: leading zeros are not a property of a number
<apeiros>
yottanami: those are representation. and representation is string.
kreantos has joined #ruby
<apeiros>
"ten" is also the same number as 10. but you can't write "ten" in ruby to get 10.
<apeiros>
representation vs. value.
<yottanami>
sonOfRa, Painfull API
<_el_fer_>
Hi guys, a newcomer here, hope there's room for one more
mdih has joined #ruby
Guest97149 has joined #ruby
<apeiros>
_el_fer_: sure. hi there.
vjdhama has quit [Ping timeout: 255 seconds]
<sonOfRa>
yottanami: I'd go tell the vendor to fix their bad API. This is horrible,
anisha has quit [Quit: Leaving]
Kendos-Kenlen has quit [Quit: Konversation terminated!]
<apeiros>
yottanami: your XML builder almost certainly accepts a string there.
<apeiros>
and that's what you should pass there.
<yottanami>
apeiros, Yes Builder accept string but API reject string and I got <faultstring>Charset is not supported.</faultstring>
<apeiros>
yottanami: and what lets you conclude the this error is related to how you built that number?
<kreantos>
hello, I've got an AES key as a byte array from a partner (same with iv) and now i need to encrypt it. but i don't know in which format i need to bring the key and iv.
<apeiros>
sounds like a pretty unrelated error to me
centrx has joined #ruby
<Burgestrand>
_el_fer_: Always!
<yottanami>
apeiros, I got this error when send the item like this builder.v2(:serviceId, '002205')
<Burgestrand>
yottanami: what is builder?
<yottanami>
but when I write builder.v2(:serviceId, 002205) I got error because thereis not 2205 and thereis 002205
<sonOfRa>
Oh I see. The soap API you're talking to doesn't support UTF-8
sanguisdex has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
evanjs has quit [Remote host closed the connection]
Igorshp has quit [Remote host closed the connection]
sanguisdex has joined #ruby
sepp2k has joined #ruby
NeverDie has joined #ruby
yashinbasement has quit [Quit: Leaving]
kreantos has quit [Remote host closed the connection]
aaeron has joined #ruby
benlovell has quit [Ping timeout: 240 seconds]
vjdhama has joined #ruby
p0wn3d__ has joined #ruby
<yottanami>
sonOfRa, What is the unknow character in the error: Charset is... (after Charser. it look like space but it is not space)
aaeron1 has joined #ruby
dhjondoh has joined #ruby
dhjondoh has quit [Client Quit]
<yottanami>
maybe it is space!
frmendes has quit [Quit: Leaving]
<yottanami>
Are you sure it does not suport utf? because the result is have encoding=\"utf-8\"
<sonOfRa>
yottanami: <?xml version=\"1.0\" encoding=\"utf-8\" ?> those escapes don't look right
sheperson has joined #ruby
frmendes has joined #ruby
aaeron has quit [Read error: Connection reset by peer]
ldnunes has quit [Ping timeout: 240 seconds]
<yottanami>
sonOfRa, escapes dont look righ? why?
aaeron1 has quit [Read error: Connection reset by peer]
pheuko has joined #ruby
<sonOfRa>
because it should be <?xml version="1.0" encoding="utf-8" ?>
evanjs has joined #ruby
<sonOfRa>
also, UTF-8, not utf-8. Though I'm not sure if that's important
dhjondoh has joined #ruby
ldnunes has joined #ruby
aaeron has joined #ruby
<Burgestrand>
The escapes look weird because it's an inspected string.
<yottanami>
sonOfRa, Yes it is inspected and is the result of Net::HTTP
<sonOfRa>
Then check if the SOAP API supports UTF-8
<sonOfRa>
It's SOAP. SOAP is old. It might not.
<apeiros>
sonOfRa: SOAP is XML. XML originated with utf-8. non-utf-8 afaik came after.
<apeiros>
and IMO it's still horrible to have non-utf xml
<sonOfRa>
Well, yottanami is sending UTF-8, and the API is responding that the charset isn't supported.
broconne has joined #ruby
bronson has joined #ruby
<apeiros>
I didn't say that was impossible. just that the age of SOAP is not the reason ;-)
<yottanami>
sonOfRa, it is responding the charset SPACE isn't supported
<apeiros>
I (sadly) have to use some SOAP APIs which use iso-8859-1 as charset.
evanjs has quit [Remote host closed the connection]
Igorshp has joined #ruby
<yottanami>
I change it to builder.instruct!(:xml, :encoding => "iso-8859-1") but I got error yet
ndrei has quit [Ping timeout: 244 seconds]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
ta has quit [Remote host closed the connection]
skade has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
scripore has quit [Quit: This computer has gone to sleep]
tkuchiki has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
vondruch has quit [Ping timeout: 252 seconds]
bmurt has joined #ruby
Burgestrand has quit []
Burgestrand has joined #ruby
UtkarshRay has joined #ruby
victortyau has joined #ruby
ndrei has joined #ruby
diegoviola has joined #ruby
<darix>
UTF-8 everywhere
<darix>
unless you want to make yourself suffer in the long run
Hacker-Pro has joined #ruby
<Hacker-Pro>
Who is here a good Programmer c++ ?
<arup_r>
many.. why Hacker-Pro ?/
<Hacker-Pro>
arup_r you knwo how to use unity 3d ?
<arup_r>
No Man!. :(
scripore has joined #ruby
ItSANgo has joined #ruby
whippythellama has joined #ruby
bkulbida has joined #ruby
benlovell has joined #ruby
JDiPierro has joined #ruby
<_el_fer_>
guys, I amm working on a rails3.2 app. I need to perform a multipart upload to s3, and for that I am trying this gem github.com/maxgillett/s3_multipart . I have followed all the needed steps described in the readme, anyway the Upload button is not even trying to hit the bucket.
terlar has joined #ruby
<_el_fer_>
have you ever performed similar task? do you recommend any other tool for me?
joufflu has quit [Read error: Connection reset by peer]
terlar has quit [Client Quit]
<apeiros>
?rails _el_fer_
<ruboto>
_el_fer_, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
benlovell has quit [Ping timeout: 252 seconds]
terlar has joined #ruby
Xeago has joined #ruby
<_el_fer_>
Thank you apeiros and sorry!
arup_r has quit []
sami has joined #ruby
sami has quit [Client Quit]
sami has joined #ruby
<apeiros>
np, just telling you where to better get help
allcentury has joined #ruby
favadi has joined #ruby
<_el_fer_>
I know, I appreciate it
tkuchiki has quit [Ping timeout: 246 seconds]
favadi has quit [Max SendQ exceeded]
Xeago has quit [Remote host closed the connection]
tkuchiki has joined #ruby
tagrudev has quit [Remote host closed the connection]
casadei has quit [Remote host closed the connection]
hs366 has quit [Quit: Leaving]
jstacks has joined #ruby
andikr has joined #ruby
amar has joined #ruby
amar has left #ruby ["Leaving"]
vjdhama has quit [Read error: Connection reset by peer]
malconis has joined #ruby
_mak has joined #ruby
emilkarl has joined #ruby
bigbadbear has joined #ruby
vjdhama has joined #ruby
malconis has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 268 seconds]
devoldmx has joined #ruby
malconis has joined #ruby
benlieb has joined #ruby
symbol has quit [Quit: WeeChat 1.1]
hinbody has joined #ruby
tcopeland has quit [Quit: Leaving.]
ruurd has quit [Quit: ZZZzzz…]
big|bad|wolf has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
devoldmx has quit [Ping timeout: 265 seconds]
diegoviola has quit [Quit: WeeChat 1.3]
drewvanstone has joined #ruby
big|bad|wolf has quit [Max SendQ exceeded]
workmad3_ has joined #ruby
banister has quit [Read error: Connection reset by peer]
[k- has joined #ruby
big|bad|wolf has joined #ruby
beauby has joined #ruby
ragingcake has joined #ruby
codecop has quit [Remote host closed the connection]
tacit7 has joined #ruby
Hacker-Pro has quit []
JDiPierro has quit [Remote host closed the connection]
kobain has joined #ruby
otacon- has joined #ruby
workmad3_ has quit [Ping timeout: 264 seconds]
ngscheur1 has joined #ruby
iceyec has joined #ruby
IceyEC_ has quit [Read error: No route to host]
tacit7 has quit [Client Quit]
herbst has joined #ruby
benlovell has joined #ruby
<herbst>
how is there a ruby icon in the corner of my irc client?
<herbst>
its my client and not a awesome irc feature i missed far or?
ebragaparah has joined #ruby
decoponio has joined #ruby
broconne has left #ruby [#ruby]
el_fer_ has joined #ruby
<jhass>
yep, your client
iceyec has quit [Ping timeout: 264 seconds]
chouhoulis has joined #ruby
weemsledeux has joined #ruby
benlovell has quit [Ping timeout: 250 seconds]
_el_fer_ has quit [Read error: Connection reset by peer]
vjdhama has quit [Read error: Connection reset by peer]
nettoweb has joined #ruby
dopamean_ has quit [Ping timeout: 265 seconds]
supergeek has joined #ruby
JDiPierro has joined #ruby
bigmac__ is now known as i8igmac
redondo has quit [Ping timeout: 250 seconds]
vjdhama has joined #ruby
keen_______ has joined #ruby
Worf has joined #ruby
wookiehangover has quit [Ping timeout: 240 seconds]
roxtrongo has joined #ruby
keen______ has quit [Ping timeout: 246 seconds]
youngbaks has joined #ruby
wookiehangover has joined #ruby
lolmaus has quit [Read error: Connection reset by peer]
Worf has left #ruby ["Konversation terminated!"]
redondo has joined #ruby
lolmaus has joined #ruby
bronson has joined #ruby
supergeek has quit [Remote host closed the connection]
tesuji has quit [Ping timeout: 240 seconds]
ndrei has quit [Ping timeout: 252 seconds]
s00pcan has joined #ruby
iceyec has joined #ruby
quazimodo has joined #ruby
voltalio has joined #ruby
Technodrome has quit [Quit: Technodrome]
sheperson has quit [Quit: sheperson]
bronson has quit [Ping timeout: 250 seconds]
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
ruby-lang293 has joined #ruby
benlovell has joined #ruby
jottr has joined #ruby
ankr has quit [Quit: bye bye]
voltalio has quit [Max SendQ exceeded]
ebragapa_ has joined #ruby
ebragaparah has quit [Read error: Connection reset by peer]
Ropeney has quit [Quit: Leaving]
ruby-lang293 has quit [Client Quit]
voltalio has joined #ruby
dopie has quit [Ping timeout: 240 seconds]
nfk|laptop has quit [Quit: yawn]
tcopeland has joined #ruby
workmad3_ has joined #ruby
redondo has quit [Ping timeout: 246 seconds]
i8igmac has quit [Ping timeout: 272 seconds]
jgt2 has quit [Ping timeout: 252 seconds]
<yottanami>
How should return Time.now in this format? 20150921064245
chouhoulis has quit [Remote host closed the connection]
<suchness>
Has anyone here used state_machine to define an after_transition event that occurs for more than one state machine? For instance, if I define two state machines on a model, is anyone aware of a way to create an after any transition for both of them at once?
aganov has quit [Remote host closed the connection]
freerobby has joined #ruby
<apeiros>
suchness: you're talking about AASM, yes?
<suchness>
apeiros: I am not sure I am familiar with that acronym.
<suchness>
The end goal is to notify an external observer that the state changed, which then informs some listeners.
skade has quit [Ping timeout: 264 seconds]
<suchness>
Right now I just have this in each state machine: after_transition any => any, :do => lambda { |*args| Observer.notify(*args) }
<suchness>
Which is fine, but a bit redundant.
ndrei has joined #ruby
lolmaus_ has joined #ruby
DuckZ has joined #ruby
apt-get has quit [Read error: No route to host]
j4cknewt has quit [Ping timeout: 240 seconds]
millerti has joined #ruby
arup_r has joined #ruby
havenwood has joined #ruby
jstacks has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<DuckZ>
hello, is there a one-liner to print an error message and exit(1) unless status_ok ? is it good to do it like $stderr.puts "zomg err" || exit(1) unless status_ok ?
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ruurd has quit [Quit: ZZZzzz…]
memnon34 has joined #ruby
riotjones has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 240 seconds]
memnon34 has left #ruby [#ruby]
memnon34 has joined #ruby
emilkarl has quit [Quit: emilkarl]
rippa has joined #ruby
ericjphillips has quit [Quit: Leaving.]
leafybas_ has joined #ruby
nolic has quit [Quit: Lost terminal]
vjdhama has joined #ruby
Guest89899 has quit [Quit: This computer has gone to sleep]
skade has quit [Quit: Computer has gone to sleep.]
Xeago has joined #ruby
ericjphillips has joined #ruby
Guest89899 has joined #ruby
Guest89899 has quit [Client Quit]
shay- has quit [Remote host closed the connection]
tsujp has joined #ruby
cjbottaro has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hydrozen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
krz has joined #ruby
voltalio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
NeverDie has joined #ruby
leafybasil has quit [Ping timeout: 264 seconds]
segfalt has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
skade has joined #ruby
segfalt has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
FernandoBasso has quit [Quit: Leaving]
gurix has quit [Quit: gurix]
lolmaus_ has quit [Ping timeout: 240 seconds]
agent_meerkat has quit [Ping timeout: 246 seconds]
Xeago has quit [Remote host closed the connection]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Xeago has joined #ruby
UtkarshRay has quit [Ping timeout: 240 seconds]
tcopeland has quit [Quit: Leaving.]
karapetyan has joined #ruby
voltalio has joined #ruby
memnon34 has quit [Remote host closed the connection]
big|bad|wolf has quit [Ping timeout: 268 seconds]
hoov has joined #ruby
cajone has quit [Ping timeout: 255 seconds]
psy_ has quit [Ping timeout: 246 seconds]
scoot has joined #ruby
linduxed has quit [Read error: Connection reset by peer]
skade has quit [Ping timeout: 250 seconds]
blueOxigen has joined #ruby
<beauby>
Is there a construct in ruby for `myArray.iterate_over_each_element_and_return_the_first_for_which_this_block_does_not_fail { |e| e.mightfail }`?
<Burgestrand>
beauby: fail as in raise an error?
freerobby has quit [Quit: Leaving.]
<beauby>
Burgestrand: raise an error or nil, I could do both
bluOxigen has quit [Ping timeout: 252 seconds]
Siyfion has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
einarj has quit [Remote host closed the connection]
<Burgestrand>
beauby: there's Array#find, which returns the first value for which the block returns a truthy value.
<beauby>
Burgestrand: mind you, I'm interested in the result of `e.mightfail`, not `e` itself (let's say `.mightfail` is long to compute)
karapetyan has quit [Remote host closed the connection]
<beauby>
Sorry for not specifying that before
karapetyan has joined #ruby
skade has joined #ruby
jshow has quit [Quit: jshow]
<Burgestrand>
beauby: I see.
gener1c_ has joined #ruby
<Burgestrand>
beauby: you could use a lazy enumerator, I believe that would be the cleanest if you're doing it inline somewhere without exploiting an early return.
<Burgestrand>
beauby: (incoming…)
<beauby>
Burgestrand: That sounds like a great idea
<Burgestrand>
beauby: it assumes you're inside a method that you can do an early return from, and through that you can avoid processing the following elements.
memnon34 has joined #ruby
skade has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 240 seconds]
<Burgestrand>
beauby: frankly, I kind of prefer this other way of doing it since it's easier to understand what is happening. Using a lazy enumerator to avoid needless processing is a bit unconventional. :)
<beauby>
Burgestrand: Oh right, that's hacky but clever
skade has joined #ruby
cjbottaro has joined #ruby
<beauby>
I guess it depends, from a functional point of view, the latter seems a bit odd
nolic has joined #ruby
<Burgestrand>
beauby: the first one is probably more familiar to somebody of e.g. a haskell background, but from a ruby point of view (imo) it's a bit weird.
cball has joined #ruby
<Burgestrand>
not necessarily weird, but new, modern, whatever.
sdfgsdfg has joined #ruby
<Burgestrand>
the second solution is "hacky", but it might also be a valid refactoring target anyway, and it's a bit easier on the implicit details part.
leafybas_ has quit [Remote host closed the connection]
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Burgestrand>
"hacky" as in it requires a method around it to work.
<Burgestrand>
I don't consider it hacky. :)
workmad3 has joined #ruby
leafybasil has joined #ruby
workmad3_ has joined #ruby
sdfgsdfg has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
jottr has joined #ruby
dfockler has joined #ruby
cajone has joined #ruby
Rodya_ has joined #ruby
snapcase has quit [Ping timeout: 246 seconds]
snapcase has joined #ruby
Xeago has joined #ruby
devoldmx has quit [Ping timeout: 244 seconds]
<beauby>
Burgestrand: Coming from C, I'm totally fine with #2 :)
aaeron has joined #ruby
jottr has quit [Ping timeout: 256 seconds]
Technodrome has joined #ruby
workmad3_ has quit [Ping timeout: 265 seconds]
bronson has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
Burgestrand has quit []
frmendes has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lsmola has quit [Ping timeout: 265 seconds]
nhhagen has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
bigbadbear has quit [Ping timeout: 264 seconds]
darkf has quit [Quit: Leaving]
allomov has quit [Remote host closed the connection]
ericjphillips has quit [Quit: Leaving.]
unop has quit [Ping timeout: 240 seconds]
allomov has joined #ruby
zdman135 has joined #ruby
karapetyan has joined #ruby
voltalio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Uranio-238 has joined #ruby
allomov has quit [Remote host closed the connection]
tcopeland has joined #ruby
ebragaparah has quit [Remote host closed the connection]
codenapp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Chau has joined #ruby
bigbadbear has joined #ruby
ruurd has joined #ruby
newdan has joined #ruby
Uranio-238 has quit [Client Quit]
<newdan>
Are there any shorthands for a.method(:b)?
Burgestrand has joined #ruby
Xeago has joined #ruby
Hounddog has quit [Remote host closed the connection]
Uranio-239 has joined #ruby
speaking1ode has joined #ruby
Burgestrand has quit [Client Quit]
The_Phoenix has joined #ruby
Soda has joined #ruby
jgt2 has quit [Ping timeout: 240 seconds]
<[k->
what do you mean?
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
<Sou|cutter>
seems short to me
The_Phoenix has quit [Max SendQ exceeded]
Xeago has quit [Remote host closed the connection]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
terlar has quit [Ping timeout: 240 seconds]
The_Phoenix has quit [Max SendQ exceeded]
jcromartie has joined #ruby
<[k->
>> _== ->_,*__,&___{____=__.shift;___=__.pop if (!block_given? and __.last.to_proc rescue false);_.public_send ____, *__, &___};_["Hello", :+, "1"]
<ruboto>
[k- # => undefined local variable or method `_' for main:Object (NameError) ...check link for more (https://eval.in/439040)
<[k->
oops, extra equal there
The_Phoenix has joined #ruby
<[k->
but it is not shorter by any means
herbst has quit [Remote host closed the connection]
scoot has quit [Remote host closed the connection]
rcvalle has joined #ruby
solocshaw has quit [Ping timeout: 240 seconds]
<Uranio-239>
testing if I can write to channel
frmendes has joined #ruby
TomyLobo has joined #ruby
Igorshp has quit [Remote host closed the connection]
voltalio has joined #ruby
[Butch] has joined #ruby
lele|w has quit [Read error: Connection reset by peer]
yardenbar has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
speaking1ode has quit [Ping timeout: 264 seconds]
speaking1ode has joined #ruby
gurix has joined #ruby
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<karapetyan>
if i extend module and in that module exist method and in that method defined @variable is it instance variable or class instance variable?
hobodave has joined #ruby
<[k->
instance variable
hydrozen has joined #ruby
Xeago has quit [Remote host closed the connection]
Chau has quit [Quit: Leaving]
rushed has joined #ruby
voltalio has joined #ruby
tejasmanohar has joined #ruby
einarj has joined #ruby
tkuchiki_ has quit [Remote host closed the connection]
codecop has joined #ruby
voltalio has quit [Max SendQ exceeded]
terlar has joined #ruby
marchi has joined #ruby
tvw has quit [Remote host closed the connection]
marchi has quit [Client Quit]
ptierno has joined #ruby
marchi has joined #ruby
Pathfinder_ has joined #ruby
jgt2 has joined #ruby
towski_ has quit [Remote host closed the connection]
<[k->
that *could* mean you weren't descriptive enough
skweek has quit [Remote host closed the connection]
* [k-
revises extend
Xeago has joined #ruby
<shevy>
karapetyan it depends on where you defined it
quiez has quit [Ping timeout: 268 seconds]
Musashi007 has joined #ruby
<[k->
extend adds it as class methods, sorry
<[k->
I was confused
<karapetyan>
shevy: look at gist above please @instances ||= [] ## in this case its instance CLASS variable !?
<shevy>
in your example you did not define a class instance variable
kidoz has joined #ruby
<[k->
therefore, it is a class instance variable
<karapetyan>
=)
<[k->
karapetyan: the correct term is class instance variable
<karapetyan>
ok.
voltalio has joined #ruby
eosinx has joined #ruby
Miron has quit [Ping timeout: 256 seconds]
<karapetyan>
so all variables started at @ and defined in modules that will be extended will be a class instance variables?
jordanm has quit [Ping timeout: 240 seconds]
memnon34 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Xeago has quit [Remote host closed the connection]
jordanm has joined #ruby
marchi has quit [Quit: leaving]
<karapetyan>
correct?)
<shevy>
it depends on where you have defined these @
eosinx has left #ruby [#ruby]
rezzack has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
kith_ has joined #ruby
helpa-bot has joined #ruby
__butch__ has joined #ruby
Miron has joined #ruby
elton_ has joined #ruby
<karapetyan>
shevy: hm i think no difference where exactly i define @ if i define it in module that will be extended that means all methods in this module will be a class methods. Correct? And therefore this @ variables can be a part of class definition code or part of class methods and in a both cases that will be a class instance variable?
frog0909 has joined #ruby
scripore has joined #ruby
Spami_ has joined #ruby
xgoo has joined #ruby
chihhsin_ has joined #ruby
r0bby_ has joined #ruby
kyle___ has joined #ruby
ldnunes_ has joined #ruby
ckinniburgh has joined #ruby
jgt2 has quit [Ping timeout: 240 seconds]
stamina1 has joined #ruby
leslie has joined #ruby
leslie has quit [Changing host]
leslie has joined #ruby
shortdudey123_ has joined #ruby
Guest97149 has quit [Quit: Lost terminal]
mahlon has quit [Read error: Connection reset by peer]
RandyT has quit [Ping timeout: 244 seconds]
redlegion has quit [Ping timeout: 244 seconds]
last_staff has quit [Ping timeout: 244 seconds]
cjbottaro has quit [Ping timeout: 244 seconds]
sshuff|gone has quit [Ping timeout: 244 seconds]
Matadoer has quit [Ping timeout: 244 seconds]
ptierno has quit [Ping timeout: 244 seconds]
gregf has quit [Ping timeout: 244 seconds]
sethetter has quit [Ping timeout: 244 seconds]
wlanboy has quit [Ping timeout: 244 seconds]
Takumo has quit [Ping timeout: 244 seconds]
dopamean1 has joined #ruby
jaygen_ has joined #ruby
helpa has quit [Ping timeout: 244 seconds]
RandyT_ has joined #ruby
mahlon_ has joined #ruby
oddmunds has quit [Ping timeout: 244 seconds]
certainty has quit [Ping timeout: 244 seconds]
chihhsin has quit [Read error: Connection reset by peer]
[Butch] has quit [Ping timeout: 244 seconds]
zdman135 has quit [Ping timeout: 244 seconds]
dopamean_ has quit [Ping timeout: 244 seconds]
evanjs has quit [Ping timeout: 244 seconds]
ldnunes has quit [Ping timeout: 244 seconds]
Spami has quit [Ping timeout: 244 seconds]
iyan has quit [Ping timeout: 244 seconds]
stamina has quit [Ping timeout: 244 seconds]
chthon has quit [Ping timeout: 244 seconds]
shortdudey123 has quit [Ping timeout: 244 seconds]
ekleog has quit [Ping timeout: 244 seconds]
dseitz has quit [Ping timeout: 244 seconds]
evanjs_ has joined #ruby
kith has quit [Ping timeout: 244 seconds]
bodie_ has quit [Ping timeout: 244 seconds]
Synthead has quit [Ping timeout: 244 seconds]
jaygen has quit [Ping timeout: 244 seconds]
kyle__ has quit [Ping timeout: 244 seconds]
elton has quit [Ping timeout: 244 seconds]
leslie_ has quit [Ping timeout: 244 seconds]
_ko1 has quit [Ping timeout: 244 seconds]
frog0909_ has quit [Ping timeout: 244 seconds]
axisys has quit [Ping timeout: 244 seconds]
unreal has quit [Ping timeout: 244 seconds]
nomadic has quit [Ping timeout: 244 seconds]
Papierkorb has quit [Ping timeout: 244 seconds]
bhorn1 has quit [Ping timeout: 244 seconds]
camt has quit [Ping timeout: 244 seconds]
p0wn3d__ has quit [Ping timeout: 255 seconds]
iateadonut has quit [Quit: Leaving.]
robbyoconnor has quit [Ping timeout: 244 seconds]
hays has quit [Ping timeout: 244 seconds]
LiquidInsect has quit [Ping timeout: 244 seconds]
hays has joined #ruby
LiquidInsect has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
xgoo is now known as iyan
TakumoKatekari has joined #ruby
TakumoKatekari has quit [Changing host]
TakumoKatekari has joined #ruby
sethetter has joined #ruby
axisys has joined #ruby
wlanboy_ has joined #ruby
camt has joined #ruby
oddmunds1 has joined #ruby
Papierkorb has joined #ruby
<evanjs_>
So I hear that ruby is slowly being replaced with golang
nomadic_ has joined #ruby
certainty has joined #ruby
sshuff|gone has joined #ruby
<adaedra>
what
ptierno has joined #ruby
Synthead has joined #ruby
shortdudey123_ is now known as shortdudey123
unreal has joined #ruby
lianj has quit [Remote host closed the connection]
bazbing80 has quit [Ping timeout: 272 seconds]
lianj has joined #ruby
lianj has quit [Changing host]
lianj has joined #ruby
bricker has joined #ruby
bhorn1|away has joined #ruby
bhorn1|away is now known as bhorn1
bodie_ has joined #ruby
<[k->
no it is not
ekleog has joined #ruby
bazbing80 has joined #ruby
voltalio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skade has quit [Quit: Computer has gone to sleep.]
gregf has joined #ruby
Xeago has joined #ruby
<shevy>
karapetyan you use extend, so you add all instance components of a module man
<shevy>
karapetyan don't use extend if you don't want this functionality!
<karapetyan>
shevy: ahhh
hahuang61 has joined #ruby
<jhass>
evanjs_: the blogging crowd moves on since it wrote all there's to write about ruby by now. It's kinda a sign that the community matures ;)
<shevy>
I think you can achieve the same via .instance_eval or .class_eval too but you probably have to do it for the whole module, so extend is simpler in this case
slackbotgz has joined #ruby
<newdan>
Oh wrt my wanting a shorthand for a.method(b) I just want a slightly more elegant way of writing some_array.map &SomeClass.method(:some_method)
<newdan>
But if a.method(:b) is as good as it gets then that's fine, just curious
pyoor has left #ruby [#ruby]
scoot has joined #ruby
Synthead has quit [Ping timeout: 244 seconds]
nfk has joined #ruby
<jhass>
evanjs_: go and ruby have quite distinct usecases and benefits, one will never replace the other
Xeago has quit [Remote host closed the connection]
p0wn3d__ has joined #ruby
JDiPierro has quit [Remote host closed the connection]
leslie has quit [Ping timeout: 264 seconds]
<adaedra>
newdan: some_array.map &:some_method
mondayrain has quit [Quit: Leaving]
<jhass>
newdan: it pretty much is, I mean you can invent all sorts of crazy pseudo syntaxes with aliases, but meh
krisquigley has quit [Remote host closed the connection]
hydrozen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
treehug88 has joined #ruby
leslie has joined #ruby
leslie has quit [Changing host]
leslie has joined #ruby
<jhass>
I prefer to just write it out for those
karapetyan has quit [Remote host closed the connection]
krisquigley has joined #ruby
last_staff has joined #ruby
karapetyan has joined #ruby
<newdan>
jhass: Sounds good :) Still new to Ruby so didn't know if there was something more idiomatic
<jhass>
" {|e| (e) }" is just the same amount of characters than "&.method(:)" and much more readable
skade has joined #ruby
<newdan>
That's why I wanted a shorthand :P
<newdan>
But I get what you're saying
<adaedra>
Better to write something standard and easy to be understood by everyone :)
hahuang61 has quit [Ping timeout: 240 seconds]
unop has joined #ruby
hahuang61 has joined #ruby
krisquigley has quit [Ping timeout: 264 seconds]
DuckZ has quit [Quit: Konversation terminated!]
<[k->
i propose an extension to the current syntax then. &:method(arg)
JDiPierro has joined #ruby
jgt2 has joined #ruby
ramfjord has joined #ruby
greenbigfrog has joined #ruby
<greenbigfrog>
Hi... I'm trying to do this: uri = URI.parse("https://gist.githubusercontent.com/" + configatron.githubuser + "/" + configatron.gist "/raw/")
<greenbigfrog>
I think this is not how I'm supposed to do it with ruby... How do I have to do that?
<adaedra>
I don't get what you're trying to do
beauby has quit [Ping timeout: 252 seconds]
<greenbigfrog>
parse a dynamic url...
Miron has quit [Ping timeout: 256 seconds]
<adaedra>
You may miss a + before "/raw/"
j4cknewt has joined #ruby
<greenbigfrog>
ok...
<greenbigfrog>
thanks
<adaedra>
Also, prefer string interpolation when assembling a string: "#{a}-#{b}" instad of a + "-" + b
<Moblin>
Question. If I wanted to take one array, [a,b,c] and I wanted to run it through another array [x, y, z, a, , r, t, c] and return true if any instance of a,b,c in the second only occurred in that order... what method should I use?
ptierno has quit [Quit: leaving]
beauby has quit [Ping timeout: 264 seconds]
yeticry has quit [Ping timeout: 250 seconds]
ptierno has joined #ruby
stamina1 has quit [Quit: WeeChat 1.3]
bb010g has joined #ruby
newdan has left #ruby [#ruby]
beast has quit [Quit: Leaving]
yeticry has joined #ruby
<Moblin>
I'm thinking I'd have to use the enumerable select to go through the second array looking for matches... and then somehow run a check on those to determine the correct order. But I'm pretty sure I'm missing something basic and vital to make this logic play out correctly.
djbkd has quit [Remote host closed the connection]
SCHAAP137 has joined #ruby
<[k->
a subsequence!
ragingcake has joined #ruby
FernandoBasso has quit [Ping timeout: 255 seconds]
Lucky__ has joined #ruby
Kendos-Kenlen has joined #ruby
banjara has quit [Ping timeout: 240 seconds]
krisquigley has quit [Ping timeout: 244 seconds]
<Moblin>
Hm
<Moblin>
Looking that up presently
workmad3_ has joined #ruby
Macaveli has joined #ruby
Macaveli has quit [Read error: Connection reset by peer]
Macaveli has joined #ruby
Macaveli has quit [Read error: Connection reset by peer]
Macaveli has joined #ruby
jgt2 has quit [Ping timeout: 255 seconds]
Macaveli has quit [Max SendQ exceeded]
IrishGringo has quit [Ping timeout: 240 seconds]
Macaveli has joined #ruby
Macaveli has quit [Max SendQ exceeded]
Macaveli has joined #ruby
Pathfinder_ has quit [Ping timeout: 255 seconds]
apt-get has joined #ruby
apt-get has quit [Remote host closed the connection]
<drbrain>
nolic: there's also URI.join if you have a URI instance
andikr has quit [Remote host closed the connection]
<to_json>
If I have the name and version of a gem, is there any way to figure out what dependencies it will install *before* installing it?
stan has quit [Ping timeout: 252 seconds]
<to_json>
preferably from within ruby, but shell works too in a pinch
atomical_ has joined #ruby
<drbrain>
to_json: gem dep -r name -v version
gix has joined #ruby
yfeldblum has joined #ruby
djbkd has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
<to_json>
omg thang you
<to_json>
*thank
<to_json>
drbrain++
ReK2 has quit [Remote host closed the connection]
vF3hNGxc47h8 has joined #ruby
* pipework
wonders what drbrain's next evolution looks like
<karapetyan>
when Extend module does it have same method like included? when mixin module?
hfp_work has quit [Ping timeout: 246 seconds]
<karapetyan>
not same... similar
atomical has quit [Ping timeout: 255 seconds]
<shadoi>
Extend adds class methods
yfeldblum has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
jcoe has joined #ruby
<karapetyan>
shadoi: ah :)
Xeago has joined #ruby
sagittarian has joined #ruby
<karapetyan>
tired )
scoot has quit [Remote host closed the connection]
hfp_work has joined #ruby
craysiii has joined #ruby
hahuang65 has joined #ruby
aswen has quit [Remote host closed the connection]
tkuchiki has joined #ruby
<Moblin>
I dont know how to use the subsequence, but I got it working through a select includes / followed by a #each < comparison of the remainder. Thanks
Moblin is now known as Ebok
scoot_ has joined #ruby
tejasmanohar_ has joined #ruby
<sagittarian>
I'm rewriting a bunch of code in Ruby that was originally written in Python, and the code makes extensive use of Python's decorators
nateberkopec has joined #ruby
<sagittarian>
can anyone point me to features/techniques in Ruby that can be used to a similar effect as decorators in Python?
hahuang65 has quit [Ping timeout: 246 seconds]
tejasmanohar has quit [Ping timeout: 240 seconds]
tejasmanohar_ is now known as tejasmanohar
ragingcake has joined #ruby
tkuchiki has quit [Ping timeout: 240 seconds]
<bricker>
sagittarian: the closest thing I can think of is alias_method_chain from Rails, but there's nothing built-in to Ruby similar to Python's decorators unfortunately
krisquigley has joined #ruby
<bricker>
even alias_method_chain isn't that close
<sagittarian>
rails is fine, this is a plugin for a rails app
<sagittarian>
it doesn't have to be the exact same thing, just as long as it allows me to keep approximately the same structure
Xeago has quit [Remote host closed the connection]
<sagittarian>
if i have some logic that I was to add to various different methods by wrapping them, is there some kind of metaprogramming i could use to keep all that logic in a single place?
<sagittarian>
is there some metaprogrammy way to intercept a method call on a object, even if the relevant method is defined?
<moparisthebest>
Any idea how I'd go about fixing or getting around this error which is crashing a program: /usr/local/lib/ruby/2.0.0/set.rb:86: stack level too deep (SystemStackError)
iyan has quit [Quit: iyan]
<jhass>
moparisthebest: show the part of the stacktrace that goes through your code and the corresponding code
<pipework>
sagittarian: What'd you google?
aaeron has quit [Client Quit]
<pipework>
There's Kernel#set_trace_func, but it won't be fast.
vjdhama_ has joined #ruby
<moparisthebest>
jhass: that's the entire message
<sagittarian>
pipework: nothing, i'm just speculating
<jhass>
moparisthebest: really? so how do you produce it?
<sagittarian>
i'm thinking maybe i could define something that would work kind of like alias_method or something
<pipework>
sagittarian: Yeah, you might want to spend 2s googling about then.
<moparisthebest>
\/usr/local/lib/ruby/2.0.0/set.rb:86: stack level too deep (SystemStackError)
<[k->
I'm sure Ox0dea will have something on your
<pipework>
Pretty much just break down your words into the most likely short phrases.
<sagittarian>
pipework: excellent, thanks
<pipework>
Level up your google-fu!
<[k->
s/your/this/
<pipework>
It's probably the best skill to have.
NeverDie has joined #ruby
vjdhama has quit [Ping timeout: 246 seconds]
yardenbar has joined #ruby
hashrocket has joined #ruby
<jhass>
moparisthebest: best hit up discourse support then
<moparisthebest>
I don't really *know* ruby all that well, but I don't see anything to do with recursion at a glance, that'd be a recursion-caused-error right?
Timba-as has joined #ruby
Lucky__ has quit [Ping timeout: 264 seconds]
<jhass>
most likely, yeah
sepp2k has quit [Quit: Leaving.]
circ-user-kSAP4 has joined #ruby
hoov has quit [Quit: Leaving]
<moparisthebest>
but strangely the recursion appears to be in set.rb, I also don't see recursion in there...
rushed has joined #ruby
suchness has quit [Remote host closed the connection]
<jhass>
you should hit up an author of that script really
speaking1ode has quit [Remote host closed the connection]
chipotle has quit [Quit: cheerio]
<drbrain>
moparisthebest: getting a SystemStackError in set.rb doesn't mean that set.rb has recursion
<drbrain>
it just happens to be the place where the stack got to deep
terlar has quit [Ping timeout: 260 seconds]
Anti-Pizza has quit [Quit: Quit]
chipotle has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<moparisthebest>
drbrain: is there a way to know or print the entire stacktrace so I know where the recursion even is?
<shevy>
hmm set_trace_var works with globals, I assume there is no way to have this work for an instance variable of your class?
ruurd has quit [Quit: ZZZzzz…]
<moparisthebest>
or I guess maybe if I knew ruby I could spot it haha
devoldmx has joined #ruby
UtkarshRay has quit [Quit: Leaving]
yqt has joined #ruby
aaeron has joined #ruby
apt-get has joined #ruby
xet7 has joined #ruby
ruurd has joined #ruby
workmad3_ has joined #ruby
segfalt has joined #ruby
<toretore>
moparisthebest: how are you running it?
<jhass>
normally it would print more trace and I can't spot anything that would hide it offhand, hence my suggestion to get in contact with the maintainers
rushed has quit [Quit: rushed]
treehug8_ has joined #ruby
Anti-Pizza has joined #ruby
<jhass>
trying to sift through to 700loc of ruby without even being able to reproduce the error locally just doesn't work, knowing Ruby or not doesn't matter much ;)
devoldmx has quit [Ping timeout: 268 seconds]
dionysus69 has joined #ruby
hydrozen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ragingcake has quit [Quit: ragingcake]
spider-mario has joined #ruby
asxbr has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
note that the "?" is part of the name. "respond_to" != "respond_to?"
j2k_ has quit [Quit: kthxbai]
<prefixed>
what does "responds" mean
<prefixed>
also, why doesn't the api state something similar to: respond_to? is a Ruby method for detecting whether the class has a particular method on it.
scoot has quit [Remote host closed the connection]
hydrozen has joined #ruby
<prefixed>
i mean, i guess it's more confusing to say "responds." if you want to confuse users, that's probably the correct choice
gplex has joined #ruby
scoot has joined #ruby
FernandoBasso has quit [Quit: Leaving]
ebragaparah has joined #ruby
nullFxn has joined #ruby
<gplex>
Hi. Can someone please explain what symbols are in the simplest way possible?
<prefixed>
although, you could also say "Returns true if obj does some stuff to the given method. That's really confusing and vague to boot!
krisquigley has joined #ruby
ebragaparah has quit [Remote host closed the connection]
voltalio has joined #ruby
frmendes has joined #ruby
<apeiros>
prefixed: "the class has a method" is not the same as "an object responds to a method call"
<shevy>
prefixed whether your object can respond to a given method or whether it can not. x = 'cat'; x.respond_to? :size
white_magic has joined #ruby
bruno- has quit [Ping timeout: 255 seconds]
<apeiros>
and "to respond" means "you can call that method without getting a NoMethod error"
deg_ has joined #ruby
<shevy>
prefixed you won't run out of time ever if you try to find imperfect documentation in ruby ;)
Pumukel has quit [Ping timeout: 246 seconds]
centrx has joined #ruby
shellie_ has quit [Quit: Lost terminal]
nullFxn has quit [Client Quit]
Xeago has quit [Remote host closed the connection]
rezzack has quit [Quit: Leaving.]
failshel_ has joined #ruby
lemur has joined #ruby
rezzack has joined #ruby
scoot has quit [Ping timeout: 264 seconds]
lemur is now known as baweaver_
baweaver has quit [Disconnected by services]
baweaver_ is now known as baweaver
krisquigley has quit [Ping timeout: 260 seconds]
marianogg9 has joined #ruby
deg__ has quit [Ping timeout: 265 seconds]
marianogg9 has left #ruby [#ruby]
failshell has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
hahuang61 has joined #ruby
jottr_ has joined #ruby
<baweaver>
!mute sharkman
speaking1ode has quit [Ping timeout: 265 seconds]
<prefixed>
hey. what does it mean if a method's last line is a variable?
<prefixed>
why did the creator of ruby decide to create several different constrol structures? why is unless necessary? why is somevar = something if something.nil? necessary?
<apeiros>
prefixed: we can't answer questions which concern opinions of other people. you'll have to ask matz himself.
asxbr has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bruno- has quit [Ping timeout: 240 seconds]
mhib has quit [Ping timeout: 246 seconds]
<prefixed>
is he not in here?
gurix has joined #ruby
<apeiros>
no
gurix has quit [Client Quit]
AlxAltea has quit [Ping timeout: 240 seconds]
<prefixed>
that's annoying. today is a very annoying day
hahuang61 has quit [Ping timeout: 260 seconds]
scripore has quit [Quit: This computer has gone to sleep]
<centrx>
prefixed, Different control structures make the language more expressive
<hal_9000__>
prefixed: only goto is “necessary” - all else is fanciness ;)
alakran has quit [Quit: WeeChat 0.4.2]
tomphp has joined #ruby
hfp_work has quit [Ping timeout: 264 seconds]
Alayde has quit [Quit: WeeChat 1.1.1]
hydrozen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bigkevmcd has quit [Ping timeout: 256 seconds]
hinbody has quit [Quit: leaving]
<craysiii>
so if the first object is a message, why would i need to grab the text with regex? can i not simply get the info from the msg object itself? or is this just simplifying that for me
hydrozen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aldodelgado has quit [Quit: aldodelgado]
<adaedra>
Because cinch do call your method only for matching messages then
<adaedra>
It's a filtering
<jhass>
you're not limited to one handler per event in case that wasn't obvious
Kallis has joined #ruby
tejasmanohar_ has joined #ruby
rezzack1 has joined #ruby
chipotle_ has joined #ruby
poguez_ has joined #ruby
<jhass>
but you don't have to pass a regex and then get all messages
tejasmanohar has quit [Read error: Connection reset by peer]
jdawgaz has quit [Read error: Connection reset by peer]
rezzack has quit [Read error: Connection reset by peer]
tejasmanohar_ is now known as tejasmanohar
gix has quit [Ping timeout: 244 seconds]
hays has quit [Read error: Connection reset by peer]
hfp_work has quit [Ping timeout: 244 seconds]
bhorn1 has quit [Ping timeout: 244 seconds]
hays has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
chipotle has quit [Ping timeout: 244 seconds]
bhorn1|away has joined #ruby
memnon34 has joined #ruby
hfp__work has joined #ruby
bhorn1|away is now known as bhorn1
camt has quit [Remote host closed the connection]
hfp__work is now known as hfp_work
camt has joined #ruby
Kallis has quit [Remote host closed the connection]
blueOxigen has quit [Ping timeout: 264 seconds]
lhz has quit [Ping timeout: 244 seconds]
casadei has joined #ruby
opensource_ninja has joined #ruby
gix has joined #ruby
pragmatism has quit [Ping timeout: 240 seconds]
last_staff has quit [Quit: last_staff]
last_staff has joined #ruby
ebragaparah has joined #ruby
<craysiii>
hm im using that code from the example to create a basic echo script, i can see the messages coming in on my terminal but its not replying to the channel
r0bby_ has joined #ruby
<phreakocious>
craysiii: you can use the .reply method to send something back to the channel it was received on
ebragaparah has quit [Remote host closed the connection]
hahuang61 has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<phreakocious>
(half-assedly working on a cinch bot myself)
sp4rrow has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sp4rrow has joined #ruby
<craysiii>
i guess it would be smart to install the proper libraries on my os before trying to bundle huh lol
<Ebok>
What's the difference between #count and #length? Is there like a correct / politically correct time to use one over the other when they do, do the same thing?
<phreakocious>
craysiii: there's a wx(blahblah)-headers too
<adaedra>
Also, gdk and gtk+ dev packages.
hal_9000_ has joined #ruby
<phreakocious>
each time you see this line checking for wx/preferences.h... *** extconf.rb failed ***
<phreakocious>
you are missing some other -dev package or some headers related to what it's looking for
hal_9000__ has quit [Ping timeout: 240 seconds]
<phreakocious>
(or some variant of that line)
<adaedra>
read the logs, all of them, they have all the information you want.
<phreakocious>
and that :D ... always that. :)
slayerja_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
Seriously, some people want to go too fast. Take time to read. Read the README, read the documentation, read the console output, read the log files.
<phreakocious>
yep
dfockler has quit [Remote host closed the connection]
mdih has joined #ruby
Musashi007 has quit [Quit: Musashi007]
baweaver has quit [Remote host closed the connection]
<phreakocious>
it takes a lot of looking at broken shit to know right where to look in large stack trace really quickly :)
jgpawletko has quit [Quit: jgpawletko]
Xeago has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
<phreakocious>
version 0.0.1.1-dev is promising ;)
<adaedra>
craysiii: well, at least reading that entirely was not too long.
<craysiii>
haha
barhum2013 has joined #ruby
<craysiii>
the coffee is making me antsy, need to calm down
<shevy>
pantsy?
<craysiii>
it's been building for a minute now, no error so far after installing the media and webview
marr has joined #ruby
<craysiii>
oh yay a new error
bkulbida has joined #ruby
Xeago has quit [Ping timeout: 240 seconds]
allcentury has quit [Ping timeout: 240 seconds]
<phreakocious>
native library stuff is best left to the masochists
polly_wog has joined #ruby
<phreakocious>
there is no hand holding :)
<craysiii>
right
<craysiii>
ive gotten used to everything being handed to me by bundler
<craysiii>
lol
<phreakocious>
sometimes you get lucky and there is an OS package for the gem you want
havenwood has quit [Ping timeout: 268 seconds]
<phreakocious>
and all the dependencies are magically resolved
r0bby_ has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
wildlander has quit [Quit: Saliendo]
failshell has joined #ruby
r0bby_ has quit [Client Quit]
rezzack1 has quit [Quit: Leaving.]
r0bby_ has joined #ruby
nux443 has quit [Quit: leaving]
bkulbida has quit [Ping timeout: 255 seconds]
CloCkWeRX has quit [Ping timeout: 265 seconds]
<adaedra>
that only works if you're using system ruby though.
RegulationD has quit [Remote host closed the connection]
Musashi007 has joined #ruby
roxtrongo has joined #ruby
firstdayonthejob has quit [Ping timeout: 260 seconds]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Musashi007 has quit [Client Quit]
roxtrong_ has joined #ruby
<craysiii>
hm i can't seem to find gdk library in apt
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Timba-as has joined #ruby
shadoi has quit [Quit: Leaving.]
roxtrongo has quit [Ping timeout: 246 seconds]
failshell has quit [Remote host closed the connection]
DarthGandalf has quit [Ping timeout: 246 seconds]
failshell has joined #ruby
scripore has joined #ruby
DarthGandalf has joined #ruby
gustav_ has quit [Remote host closed the connection]
ebragaparah has joined #ruby
dfockler has joined #ruby
devoldmx has joined #ruby
sysx1000 has joined #ruby
dfockler has quit [Remote host closed the connection]
weemsledeux has joined #ruby
<craysiii>
it worked finally!!! thanks everyone
<sysx1000>
noob question. when I create hash or specify keyword arguments, sometimes I see param: value, sometimes :param => value, which way is correct?
<adaedra>
both.
dopamean_ has joined #ruby
<phreakocious>
craysiii: congrats
<adaedra>
`param: value` is syntaxic sugar.
`tim` has joined #ruby
<craysiii>
so would i use rwx the same as wxruby? can i justuse the wxruby docs?
tkuchiki has joined #ruby
devoldmx has quit [Ping timeout: 256 seconds]
startupality has quit [Quit: startupality]
tkuchiki has quit [Remote host closed the connection]