jonahR_ has quit [Quit: ¡Adios amigos, me fui para el carajo!]
phinfonet has quit [Read error: Connection reset by peer]
redondos has joined #ruby
sepp2k has quit [Ping timeout: 255 seconds]
joaoh82 has joined #ruby
<bricker`work>
ViperChief: more or less, you seem to understand
Royalb15 has joined #ruby
soulcake has quit [Ping timeout: 255 seconds]
Caius has quit [Ping timeout: 255 seconds]
Authenticator has joined #ruby
terrellt has quit [Ping timeout: 252 seconds]
Sc0rp10n has quit [Ping timeout: 272 seconds]
gondalier has joined #ruby
<bricker`work>
Multiplies all number 1-100 sequentually (1*2*3*4*5...), turns the resulting number into a string, splits it into an array (each digit is an element), then adds each digit to the next, and returns an integer
nobitanobi has quit [Remote host closed the connection]
benlieb has joined #ruby
lw has joined #ruby
mgberlin has joined #ruby
ehc has quit [Quit: ehc]
benlieb has quit [Client Quit]
senayar has joined #ruby
hermanmunster has quit [Ping timeout: 255 seconds]
MrJoshua has joined #ruby
b00stfr3ak has quit [Ping timeout: 255 seconds]
Rollabunna has joined #ruby
mgberlin has quit [Ping timeout: 272 seconds]
joaoh82 has joined #ruby
saarinen has quit [Quit: saarinen]
banister is now known as banisterfiend
tier has joined #ruby
jpena has joined #ruby
havenwood has joined #ruby
Rollabunna has quit [Ping timeout: 272 seconds]
joaoh82 has quit [Ping timeout: 255 seconds]
ixti has quit [Quit: WeeChat 0.4.3]
huginn has joined #ruby
x1337807x has joined #ruby
sevenseacat has joined #ruby
oo_ has joined #ruby
Bumptious has quit [Remote host closed the connection]
huginn has left #ruby [#ruby]
cgore has joined #ruby
emergion has joined #ruby
cgore has quit [Remote host closed the connection]
jaimef has quit [Excess Flood]
mgberlin has joined #ruby
ver is now known as repl
Hobogrammer has joined #ruby
dgutierrez1287 has quit [Ping timeout: 240 seconds]
earthquake has joined #ruby
bradleyprice has quit [Remote host closed the connection]
tus has quit []
bradleyprice has joined #ruby
senayar has quit [Remote host closed the connection]
larissa has joined #ruby
senayar has joined #ruby
Soliah has joined #ruby
senayar has quit [Remote host closed the connection]
sepp2k1 has quit [Read error: Connection reset by peer]
asteve has joined #ruby
Soliah has quit [Client Quit]
jaimef has joined #ruby
mikesplain has joined #ruby
fluve has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bradleyprice has quit [Ping timeout: 244 seconds]
blasius_ has quit [Remote host closed the connection]
moritzschaefer has joined #ruby
tkuchiki has quit [Remote host closed the connection]
rgrinberg has quit [Quit: Leaving.]
mikesplain has quit [Ping timeout: 244 seconds]
fgo has joined #ruby
moritzs has quit [Ping timeout: 255 seconds]
dc has quit [Remote host closed the connection]
PanPan has joined #ruby
jpena has quit [Ping timeout: 255 seconds]
yubrew has joined #ruby
axl_ has joined #ruby
charliesome has joined #ruby
dorei has quit []
moritzschaefer has quit [Ping timeout: 240 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
axl_ has quit [Client Quit]
Gil has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
baroquebobcat has joined #ruby
danijoo has joined #ruby
havenn has joined #ruby
yubrew has quit [Ping timeout: 240 seconds]
havenwood has quit [Ping timeout: 264 seconds]
alexandrite has quit [Ping timeout: 264 seconds]
andrewjanssen has quit [Quit: Leaving...]
joaoh82 has joined #ruby
baroquebobcat has quit [Client Quit]
jpena has joined #ruby
lukec has joined #ruby
datafirm has quit [Quit: Computer has gone to sleep.]
Gil has quit [Ping timeout: 240 seconds]
ghr has joined #ruby
marr has quit [Ping timeout: 264 seconds]
santana has quit [Remote host closed the connection]
Takle has joined #ruby
<Rylee>
so, rubyists
<Rylee>
what is your preferred method of storing a config file and why?
<Rylee>
(e.g. YAML, JSON, etc)
<Nilium>
INI or YAML. Because I have to write the stupid things.
chris349 has joined #ruby
<chris349>
Does anyone know what is the correct way to install the gems for system-wide usage instead of the default of per-user?
echevemaster has quit [Ping timeout: 252 seconds]
ghr has quit [Ping timeout: 240 seconds]
<Nilium>
gem install --no-user-install
<Nilium>
If your GEM_HOME is the user directory, this is meaningless and you have no choice.
kaspergrubbe has quit []
Megadan has quit [Remote host closed the connection]
<chris349>
The problem is when I run bundle install it gives an error that says to run bundle install --no-deployment but when I run that it gives an error to run bundle update minitest instead but that command gives me the same error that says to run bundle install --no-deployment
<chris349>
I also dont quite understand the error: Run `bundle install` elsewhere because I cd .. and run bundle install but it gives an error that Gemfile not found and when I cd back it gives the same error.
gondalier has quit []
Takle has quit [Ping timeout: 244 seconds]
echevemaster has joined #ruby
tkuchiki has joined #ruby
Lucky__ has quit [Ping timeout: 264 seconds]
<chris349>
So basically bundle install --deployment only works once and then to update it is an issue.
tier has quit []
shevy has quit [Ping timeout: 244 seconds]
figgleberry has joined #ruby
Hanmac has quit [Ping timeout: 264 seconds]
blasius has joined #ruby
gondalier has joined #ruby
blasius has quit [Remote host closed the connection]
tkuchiki has quit [Quit: Leaving...]
blasius has joined #ruby
gondalier has quit [Client Quit]
Rahul_Roy has quit [Quit: Connection closed for inactivity]
robustus has quit [Ping timeout: 252 seconds]
GriffinHeart has joined #ruby
mikepack has quit [Remote host closed the connection]
tkuchiki has joined #ruby
robustus has joined #ruby
mgorbach has quit [Read error: Connection reset by peer]
mgorbach has joined #ruby
atraylen has joined #ruby
gondalier has joined #ruby
crudson has quit [Remote host closed the connection]
blasius has quit [Ping timeout: 272 seconds]
Neomex has quit [Quit: Leaving]
lukec has quit [Quit: lukec]
danman has joined #ruby
Guest91369 has quit [Quit: Leaving]
GriffinHeart has quit [Ping timeout: 240 seconds]
freerobby has joined #ruby
bricker`work has quit [Ping timeout: 240 seconds]
chipotle has quit [Quit: cya]
crudson has joined #ruby
bklane has joined #ruby
shevy has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
troyready has quit [Ping timeout: 240 seconds]
danijoo has joined #ruby
Spami_ has joined #ruby
jcromartie has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
hermanmunster has joined #ruby
Hanmac has joined #ruby
Eyez has joined #ruby
fgo has quit [Remote host closed the connection]
<Gaddel>
Rylee: INI for very basic configs, YAML for anything above that
jpena has quit [Ping timeout: 245 seconds]
dawkirst has joined #ruby
ra4king has joined #ruby
ra4king1 has joined #ruby
ra4king has quit [Remote host closed the connection]
ra4king1 has quit [Client Quit]
ra4king has joined #ruby
deric_skibotn has quit [Ping timeout: 272 seconds]
naqR0M has quit [Read error: Connection reset by peer]
dvabr has left #ruby [#ruby]
Bumptious has joined #ruby
earthquake has quit [Quit: earthquake]
ovoraptor has joined #ruby
earthquake has joined #ruby
chipotle has joined #ruby
benlieb has joined #ruby
ovoraptor is now known as ovalraptor
yubrew has joined #ruby
timonv has joined #ruby
djbkd has quit [Remote host closed the connection]
katzilla has quit [Quit: This computer has gone to sleep]
bmurt has joined #ruby
ovalraptor has quit [Remote host closed the connection]
djbkd has joined #ruby
katzilla has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
yubrew has quit [Ping timeout: 240 seconds]
reset has quit [Quit: Leaving...]
danijoo has joined #ruby
reset has joined #ruby
fgo has quit [Remote host closed the connection]
timonv has quit [Ping timeout: 255 seconds]
pietr0 has joined #ruby
pietr0 has quit [Client Quit]
ovoraptor has joined #ruby
tectonic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gondalier has quit []
yetanotherdave has quit [Ping timeout: 240 seconds]
ovoraptor has quit [Read error: Connection reset by peer]
ovoraptor has joined #ruby
x1337807x has joined #ruby
teddyp1cker has joined #ruby
mikepack has joined #ruby
Gil has joined #ruby
reset has quit [Ping timeout: 244 seconds]
freerobby has quit [Quit: Leaving.]
noober3 has joined #ruby
pikapp has joined #ruby
teddyp1cker has quit [Ping timeout: 244 seconds]
Gil has quit [Ping timeout: 264 seconds]
lukec has quit [Quit: lukec]
katzilla has quit [Quit: Leaving]
goleldar has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
Bumptious has quit [Remote host closed the connection]
krz has joined #ruby
djbkd has joined #ruby
alexju has joined #ruby
ovoraptor has quit [Remote host closed the connection]
foobarbaz has joined #ruby
wallerdev has quit [Quit: wallerdev]
<foobarbaz>
Hi guys, was just wondering what `def call(*) self end` does?
<foobarbaz>
What's the signicance of the star as the argument name?
danman has joined #ruby
<foobarbaz>
is that some sort of variadic notation perhaps?
freerobby has joined #ruby
ovoraptor has joined #ruby
Skyler has joined #ruby
iceden has quit [Ping timeout: 264 seconds]
djbkd has quit [Remote host closed the connection]
<Skyler>
sup noobs. how's it feel to be slower than Java, but less beautifil and practicle than Lisp?
<Skyler>
binaryhat has joined #ruby
<foobarbaz>
*obligatory brackets lisp joke*
fgo has joined #ruby
MZAWeb_ has quit [Ping timeout: 252 seconds]
<Skyler>
seriously. If you're going to drink the dynamic coolaid you might as well use lisp which and get a 50x speed up over ruby. More flexible language too.
danman has quit [Ping timeout: 240 seconds]
karmatr0n has quit [Remote host closed the connection]
<Skyler>
Or better yet use Java and be object oriented.
<Skyler>
Java is so object oriented that twitter dropped ruby and started using java.
<Skyler>
what do you have to say about that?
<Skyler>
yeah, that's what I thought
<Skyler>
Skyler out.
<sevenseacat>
trollololol
Skyler has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
aspires has joined #ruby
mattmcclure has quit [Quit: Connection closed for inactivity]
<benzrf>
what a crappy troll
pikapp has quit [Ping timeout: 240 seconds]
tiguser has quit [Ping timeout: 245 seconds]
razrunelord has joined #ruby
Rojo has joined #ruby
Spami_ has quit [Quit: This computer has gone to sleep]
blasius has quit [Remote host closed the connection]
lw has joined #ruby
hamakn has quit [Remote host closed the connection]
agrinb has quit [Remote host closed the connection]
<Gaddel>
foobarbaz: I'm pretty sure I know the general use of it but I'm researching
<foobarbaz>
:P
<foobarbaz>
cheers
<foobarbaz>
Researching these ruby symbols is a pain haha
<Gaddel>
I'm much better with Python, and there it's used to force certain args to be keyword args
<Gaddel>
but a * ("splat") with absolutely no other arguments...I'm honestly not sure
yubrew has quit [Ping timeout: 245 seconds]
<foobarbaz>
yeah, splat is what i came up with
<foobarbaz>
But there was no name given to it
<foobarbaz>
so i wasn't sure
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Gaddel>
for example in python you can do def func(a, b, *, c=6). if it was (a, b, c=6) then someone doing func(1, 2, 3) would set c to 3, while that's impossible with the nameless splat.
<Gaddel>
I'm guessing it has a similar use case for ruby. but that doesn't make sense when no other arguments are being used.
pvb has joined #ruby
<Gaddel>
upon testing in irb that is indeed the case
<Gaddel>
i think it only ever makes sense if super is being used
<foobarbaz>
which it isn't in this scenario haha
<foobarbaz>
hm!
braincrash has quit [Quit: bye bye]
danijoo has quit [Read error: Connection reset by peer]
definiv has quit [Quit: Out]
dda has joined #ruby
mgberlin has joined #ruby
<foobarbaz>
Why do methods come up as symbols?
<Gaddel>
yeah, my only guess is that it's basically intended to be filler or something. it has no actual meaning in the book example
danijoo has joined #ruby
<foobarbaz>
"".methods returns a bunch of symbols like => [:<=>, :==, :===, :eql?, :hash, :casecmp, :+, :*, .... ]
<foobarbaz>
Gaddel: Thanks! :)
Gil has joined #ruby
<Gaddel>
are you trying to understand what symbols are, or just why those method names are symbols?
mikesplain has joined #ruby
<foobarbaz>
why method names are symbols
<foobarbaz>
Can i do something like "some_string"[:length]
<Gaddel>
it's sort of a ruby convention to represent "names" of any kind as symbols
<foobarbaz>
or something whacky
<Gaddel>
in this case it's basically just the way methods are...symbolized
<Gaddel>
you can convert between methods and symbols rather easily, but they're not interchangeable
<Gaddel>
method(:meth_name) will let you call that method
<foobarbaz>
:o
<Gaddel>
there's also some other fancy syntax involving &, which lets you convert between procs and blocks
Zenigor has joined #ruby
larissa has quit [Quit: Leaving]
<Gaddel>
method() is used for top-level methods. so you could do something like method(:puts).call(1) (or method(:puts)[1]), as .[] is an alias for .call)
lw has quit [Quit: s]
ghr has joined #ruby
Gil has quit [Ping timeout: 240 seconds]
Arkaniad has quit [Ping timeout: 245 seconds]
braincrash has joined #ruby
<Gaddel>
you can also pass an object's own method as a block argument using a symbol as well
fgo has quit []
mikesplain has quit [Ping timeout: 240 seconds]
bklane has quit [Remote host closed the connection]
<Gaddel>
for example, ["abc", "d", "efgh"].map(&:length)
fgo has joined #ruby
<Gaddel>
which is equivalent to ["abc", "d", "efgh"].map { |element| element.length }
hamakn has joined #ruby
bklane has joined #ruby
x1337807x has joined #ruby
<Gaddel>
it's also customary to use symbols as hash keys, values for enums, and other similar cases where something is considered a name, parameter, or key
jaequery has joined #ruby
<foobarbaz>
it's interesting that you suggest symbols key hash keys
<foobarbaz>
So I should be doing {key: "value"}
<foobarbaz>
then?
<Gaddel>
it's so customary that ruby 2.0 made some special syntax for it
GriffinHeart has joined #ruby
<Gaddel>
normally you would have to do { :key => "value" } but they added the { key: "value" } syntax for cases where the key is a symbol
<foobarbaz>
See before i thought that was just normal JSON :P
<foobarbaz>
Is there a way to deal with people accidentally checking the map with
<foobarbaz>
"key"
<foobarbaz>
?
<foobarbaz>
map = {key: "value"}
<foobarbaz>
map["key"] will fail
<foobarbaz>
Understandably... But also annoyingly..
bwlang has joined #ruby
<Gaddel>
it will, yes. if you're wrapping it somehow you can run .intern on the argument first.
sorpaas has joined #ruby
dc has joined #ruby
<Gaddel>
which is an alias for .to_sym
<foobarbaz>
lol, ruby actually interns strings?
<Gaddel>
symbols are interned strings
<Gaddel>
with a special syntax
<foobarbaz>
ohhhh
<Gaddel>
so if you have an array of 8 billion symbols, all :abc, only one object will be stored
<Gaddel>
this also makes them efficient when used as hash keys
mgberlin has quit [Remote host closed the connection]
ghr has quit [Ping timeout: 272 seconds]
<foobarbaz>
Is there a REPL bot here?
<foobarbaz>
>> 1
<bwlang>
i have a rake task that’s leaking memory… CaliperExperiment.order(:id).find_each {|c| c.well_set && c.well_set.save}. it’s up to 10G now… what am i doing wrong?
<Gaddel>
as you can see, interning is not done for regular strings
<foobarbaz>
hmm
GriffinHeart has quit [Ping timeout: 272 seconds]
<foobarbaz>
Why?
<foobarbaz>
:)
<foobarbaz>
Why are strings mutable? :(
<Gaddel>
strings were designed as mutable for whatever reason
<Gaddel>
it makes certain kinds of text processing a bit simpler, I think
<Gaddel>
I sort of prefer Python's system of all strings being immutable, with no version of mutable strings (except for raw byte arrays)
tectonic has joined #ruby
<foobarbaz>
Most languages have immutable strings though?
<Gaddel>
correct
<foobarbaz>
JavaScript, Java, Scala, C#
<Gaddel>
Ruby sacrifices some performance for some added elegance in this case
<foobarbaz>
Even PHP :P
jack_rabbit_ has joined #ruby
lukec has quit [Quit: lukec]
jack_rabbit_ has quit [Read error: Connection reset by peer]
<foobarbaz>
ah, fair enough
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<foobarbaz>
Hasn't been a problem so far, but i'm only a week into ruby haha
mercwithamouth has quit [Ping timeout: 240 seconds]
<Gaddel>
it can sometimes be nice having the ability to do "s.gsub!(/\n/\r\n/)"
ndrei has joined #ruby
andrewjanssen has quit [Quit: Leaving...]
<eam>
sacrifices performance?
agrinb has joined #ruby
<foobarbaz>
Silly question - is `def self.foo etc() end` a static method?
rgrinberg has joined #ruby
jack_rabbit has quit [Quit: SIGSEGV (core dumped)]
jack_rabbit has joined #ruby
mercwithamouth has joined #ruby
<Gaddel>
eam: performance is gained when doing lots of concatenating or other scenarions in languages with immutable strings that create lots of new copies of strings, but keeping them immutable means easy auto-interning and string pooling
<Gaddel>
it varies depending on use case
<Gaddel>
foobarbaz: self means different things depending on the context. in the context of a class, in the first level of the class, then yes it basically means a static method.
earthquake has quit [Quit: earthquake]
ahofmann has quit [Quit: Computer has gone to sleep.]
jaequery has joined #ruby
ndrei has quit [Ping timeout: 255 seconds]
figgleberry has quit [Ping timeout: 244 seconds]
<foobarbaz>
awesome, thanks Gaddel
<foobarbaz>
Do you recommend any books? :)
<foobarbaz>
On Ruby ;)
agrinb has quit [Ping timeout: 244 seconds]
<Gaddel>
nope, sorry. other people here would probably have some good recommendations. I've yet to read a ruby book.
axsuul has joined #ruby
Gooder has joined #ruby
Arkaniad has joined #ruby
<foobarbaz>
heh
<foobarbaz>
I'm just doing compilers atm to try and learn
<foobarbaz>
Staying away from RoR now
alexandrite_ has joined #ruby
<foobarbaz>
What do you use ruby for Gaddel ?
<Gaddel>
nothing at the moment, really. I've done some simple sinatra web apps and basic scripts. I'm a Python developer (sort of) by trade.
onewheelskyward has left #ruby ["["Textual IRC Client: www.textualapp.com"]"]
yfeldblum has joined #ruby
kenneth has joined #ruby
dawkirst has joined #ruby
alexandrite has quit [Ping timeout: 264 seconds]
havenn has quit [Remote host closed the connection]
axsuul has quit [Ping timeout: 264 seconds]
maestrojed has joined #ruby
Gooder has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
diegoviola has joined #ruby
Rojo has quit [Ping timeout: 255 seconds]
Gooder has joined #ruby
Veidit has quit [Read error: Connection reset by peer]
franka_ has quit [Ping timeout: 245 seconds]
dawkirst has quit [Ping timeout: 245 seconds]
timonv has joined #ruby
Veidit has joined #ruby
Fire-Dragon-DoL has joined #ruby
alexandrite_ is now known as jacknife
MrJoshua has quit [Read error: Connection reset by peer]
<isomorphismes>
Clearly all I have to do is make a hash { :english => 'en', :russian => 'ru', ...} --- but design pattern wise, where should I put that?
coderhs has joined #ruby
<foobarbaz>
isomorphismes: What is line 27 about?
<isomorphismes>
oh and thanks everyone who's been helping me finish the ruby koans, here. Finished them the other day and very grateful for all the help I received here.
<foobarbaz>
is that a weird function call or something?
rgrinberg has quit [Client Quit]
<isomorphismes>
foobarbaz: Is that a rhetorical question? I'm not sure what you're getting at.
Bumptious has joined #ruby
<Gaddel>
foobarbaz: that's an example of ruby DSL
<foobarbaz>
:o
<Gaddel>
using the magic of instance_eval and blocks
<foobarbaz>
For someone who doesn't use Ruby, you know a lot of ruby ;)
Channel6 has joined #ruby
<Gaddel>
I'm not even sure how I know the amount I do
<foobarbaz>
haha
<Gaddel>
my university offered a Rails class which I just took but it didn't cover any of the advanced language stuff
Fire-Dragon-DoL has joined #ruby
rgrinberg has joined #ruby
<foobarbaz>
Awesome!
<foobarbaz>
My university taught me nothing! yay
<foobarbaz>
:]
<isomorphismes>
lol
<Gaddel>
almost all of the classes in my degree were useless from a programming and professional perspective, with maybe the exception of that one class
<sara2010>
any one there !
<Gaddel>
I actually work in information security though, not programming
<foobarbaz>
So offer configurable language, but default to english so you don't break existing code?
<foobarbaz>
Then shove in a map like you said
<foobarbaz>
I have to hold back my Java enterprise knowledge when thinking of Ruby
<foobarbaz>
I'd get rid of the static method access, and favour DI <3
jacknife is now known as xxEmOv4mPiReXx
<isomorphismes>
foobarbaz: is that good design pattern wise?
<foobarbaz>
Then write an interace for interacting with a generic web page
<foobarbaz>
Then use the strategy pattern to make it externally configurable
<isomorphismes>
like I don't want him to feel like I've just mucked up something. Maybe I should create a separate file?
<foobarbaz>
provide implementations for each english type
<foobarbaz>
language type*
<foobarbaz>
Oh Java <3
<isomorphismes>
definitely default to english
<isomorphismes>
DI = ?
<isomorphismes>
static method access = ?
<isomorphismes>
what is the strategy pattern?
<Gaddel>
isomorphismes: where do you want these options to be passed exactly?
<foobarbaz>
I'd want to be able to create a client in a specific language, and keep it that way TBH
<foobarbaz>
Rather than keep passsing it in as a method param
<isomorphismes>
Gaddel: as far as I know it only needs to go to that one spot.
<foobarbaz>
# basically just a wrapper for doing
<foobarbaz>
# client = Wikipedia::Client.new
<isomorphismes>
Maybe I need to make my own fork and clone to my computer while I work this otu and make sure it doesn't break things. ....
<foobarbaz>
yeah, you'll change the Client class
teddyp1cker has joined #ruby
<Gaddel>
you see the Configure method, right?
<isomorphismes>
foobarbaz: well we don't know for example that let's say "Header" isn't parsed differently in Russian
Cache_Money has joined #ruby
<isomorphismes>
Gaddel: yea, this is a design question
<Gaddel>
you could just extend/change that to take language 'en' instead of domain '...'
<foobarbaz>
`@client ||= Wikipedia::Client.new`
<Gaddel>
well personally I find his current use of DSL for the configuration way, way overengineered and silly
<foobarbaz>
That's cool
datafirm has joined #ruby
<isomorphismes>
Gaddel: what do you mean?
<Gaddel>
since I'm pedantic I'd probably overhaul and rewrite most of that
Gil has joined #ruby
<foobarbaz>
It's very cutesy though
<isomorphismes>
well I want him to accept my pull requewt
<isomorphismes>
that's my main goal -- for him not to feel like I've done something untoward
nesoi has joined #ruby
<isomorphismes>
but I dont really know what standards are
<Gaddel>
basically I see no reason why all the config options can't just be a hash passed to the constructor. or even if they aren't, .configure should simply accept a hash.
mikesplain has joined #ruby
<isomorphismes>
Gaddel: ok. But wouldn't it be ugly to place that in this file? This file doesn't seem like a "configuration place" really...
<Gaddel>
there may be a better way to do it...I don't really code any Ruby at all, and this was just at a quick glance
<Gaddel>
but that's probably a good way to do it while integrating with the current project
dc has quit [Remote host closed the connection]
Takle has quit [Ping timeout: 244 seconds]
lw has joined #ruby
bluOxigen has joined #ruby
<foobarbaz>
Gaddel: I agree with you on this matter too
whowantstolivef3 has joined #ruby
<Gaddel>
if you want to retain backwards compatibility, leave the domain option and do a check for if the domain option was set. if it was use that, and if not look for the language option.
<foobarbaz>
I am not a ruby guy either, however :)
ponga has joined #ruby
yfeldblu_ has joined #ruby
enape_101 has joined #ruby
lukec has quit [Quit: lukec]
<foobarbaz>
If i've defined a module in a different file, do i still need to do require_relational 'filename' ?
<foobarbaz>
require_relative *
whowantstolivefo has quit [Ping timeout: 272 seconds]
<foobarbaz>
"This may be useful during a development phase, for accessing test data, or even for accessing files that are "locked" away inside a project, not intended for outside use."
<foobarbaz>
Gaddel: these are just straight up ruby classes i don't mind people having access to
pontiki has quit [Ping timeout: 245 seconds]
<foobarbaz>
Is there a ruby convention i'm not aware of perhaps?
<foobarbaz>
Do I need to place everything under a folder called 'src' or such perhaps?
<Gaddel>
sort of. it varies depending on the size of the project, version control system, etc.
<Gaddel>
typically there'll be a lib and a bin folder. you can look at some popular ruby projects on github to get an idea
<Gaddel>
i'll be heading out now. see ya guys.
Gaddel has quit []
fgo has joined #ruby
mgberlin has quit [Ping timeout: 240 seconds]
pontiki has joined #ruby
agrinb has joined #ruby
<sara2010>
any one help ?
lkba has quit [Read error: Connection reset by peer]
Ankhers has quit [Remote host closed the connection]
testcore has quit [Remote host closed the connection]
sorpaas has quit [Ping timeout: 240 seconds]
testcore has joined #ruby
Ankhers has joined #ruby
razrunelord has joined #ruby
lkba has joined #ruby
fgo has quit [Ping timeout: 244 seconds]
MrJoshua has joined #ruby
mikepack has quit [Remote host closed the connection]
agrinb has quit [Ping timeout: 240 seconds]
mgberlin has joined #ruby
ehc has joined #ruby
MatthewsFace has joined #ruby
chrishough has joined #ruby
lw has quit [Quit: s]
chris349 has joined #ruby
razrunelord has quit [Ping timeout: 264 seconds]
sugihara has joined #ruby
JohnBat26 has joined #ruby
axsuul has joined #ruby
kireevco has quit [Quit: Leaving.]
jtiggo has joined #ruby
<isomorphismes>
thanks foobarbaz
<foobarbaz>
sara2010: sorry, what was the question? :)
xxEmOv4mPiReXx has quit [Ping timeout: 264 seconds]
agrinb has joined #ruby
dawkirst has joined #ruby
mercerist has quit [Ping timeout: 240 seconds]
sarkis has joined #ruby
agrinb has quit [Ping timeout: 264 seconds]
alem0lars has quit [Quit: Going AFK...]
Port3M5 has joined #ruby
jeet3 has joined #ruby
dANOKELOFF has joined #ruby
pen_ has quit [Remote host closed the connection]
pencilcheck has joined #ruby
sarkis has quit [Ping timeout: 245 seconds]
postmodern has joined #ruby
jeet2 has quit [Ping timeout: 240 seconds]
rdark_ has joined #ruby
karupa is now known as zz_karupa
brunops has quit [Ping timeout: 264 seconds]
moritzschaefer has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby
jheg has joined #ruby
rdark has quit [Ping timeout: 240 seconds]
datafirm has quit [Ping timeout: 240 seconds]
alem0lars has joined #ruby
djbkd has quit [Ping timeout: 240 seconds]
rajni has joined #ruby
sigurding has quit [Quit: sigurding]
qba73 has joined #ruby
<rajni>
Hello there, can you check if this synthax is correct: ssh_info[:private_key_path].map { |p| "-i '#{Vagrant::Util::Platform.cygwin_path(p)}'" } the fnction exists but it returns nothing..
<rajni>
p is a windows path
sigurding has joined #ruby
dANOKELO_ has joined #ruby
charliesome has joined #ruby
jeet4 has joined #ruby
Takle has quit [Remote host closed the connection]
dANOKELOFF has quit [Ping timeout: 240 seconds]
brunops has joined #ruby
AndChat| has joined #ruby
skaflem has joined #ruby
jeet3 has quit [Ping timeout: 240 seconds]
<canton7>
rajni, that's syntactically correct. what makes you say it returns nothing?
lkba has quit [Ping timeout: 240 seconds]
<canton7>
is ssh_info[:private_key_path] an array?
forcefsck has joined #ruby
pencilcheck has quit []
pencilcheck has joined #ruby
decoponio has joined #ruby
rajni has quit [Ping timeout: 246 seconds]
pencilcheck has quit [Client Quit]
dapz has quit [Ping timeout: 240 seconds]
pencilcheck has joined #ruby
greenarr_ has joined #ruby
pencilcheck is now known as pen
greenarrow has quit [Read error: No route to host]
relix has joined #ruby
forcefsck has quit [Client Quit]
chth0n has joined #ruby
Takle has joined #ruby
thomasxie has joined #ruby
thomasxie has quit [Remote host closed the connection]
<Hanmac>
sara2010 first: ruby1.8.7 is outdated and buried multible times, 2) the project needs active support ( a rails component) but does not require it correctly ... and for rails there is #rubyonrails
<bookies>
i am not trying to understand what class is. I am trying to check if the number returned will be whole or not. For example if it returns 3 I will print "Whole number!" if it has a decimal point like 3.1 I will print "Its now a whole number." Is there a way to check the returned number for doing so?
<matti>
sara2010: I am not going to help you.
<csmrfx>
bookies: ok, second part then:
<csmrfx>
bookies: install ri
mercwithamouth has joined #ruby
duncannz has quit [Ping timeout: 264 seconds]
<csmrfx>
bookies: once you got ri: $ ri Float
bookies has left #ruby [#ruby]
<csmrfx>
bookies: and $ ri Fixnum
<sara2010>
Hanmac .. hmmm should i update ruby !
<csmrfx>
there you can see all the methods you can throw at these type of numbers
<Hanmac>
yes you should
<sara2010>
Hanmac .. which version !
<Hanmac>
2.1.2 is currently recent
razrunelord has quit [Ping timeout: 240 seconds]
<sara2010>
Hanmac .. any switch for update
postmodern has quit [Quit: Leaving]
<Hanmac>
like you installed the old version, install the new one
sarkis has quit [Ping timeout: 244 seconds]
troulouliou_dev has joined #ruby
<sara2010>
Hanmac . thanks letme update
ponga has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
datafirm has joined #ruby
Trudko has joined #ruby
JBreit has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
sevenseacat has joined #ruby
lalli has joined #ruby
<lalli>
how to remove array from another array? like [1,2,3]-[2,3] = [1]
coderhs has quit [Ping timeout: 240 seconds]
<lalli>
wtf it works that way
<tobiasvl>
hehe
oo_ has quit [Remote host closed the connection]
emdub_ has quit [Quit: .]
oo_ has joined #ruby
emdub has joined #ruby
jheg has quit [Quit: jheg]
cover has quit [Remote host closed the connection]
phutchins has joined #ruby
emdub has quit [Client Quit]
coderhs has joined #ruby
emdub has joined #ruby
jheg has joined #ruby
fgo has joined #ruby
mattstratton has joined #ruby
ndrei has quit [Ping timeout: 264 seconds]
sheperson has quit [Ping timeout: 240 seconds]
banister has joined #ruby
alexandrite_ has quit [Ping timeout: 264 seconds]
felixdd has quit [Ping timeout: 272 seconds]
sepp2k has quit [Read error: Connection reset by peer]
yfeldblu_ has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 255 seconds]
kyb3r_ has quit [Quit: Leaving]
rdark_ has quit [Ping timeout: 240 seconds]
bluOxigen has joined #ruby
ndrei has joined #ruby
Deele has joined #ruby
blueOxigen has quit [Ping timeout: 244 seconds]
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dawkirst has quit [Remote host closed the connection]
rdark has joined #ruby
mercwithamouth has joined #ruby
MZAWeb_ has joined #ruby
ponga has quit [Remote host closed the connection]
<jheg>
its like i've created a method that does nothing other than call the block I've passed into the method
<jheg>
when I could have just written the block
jcromartie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tier has joined #ruby
<jheg>
and bypassed the method
joaoh82 has quit []
dangerou_ has joined #ruby
<tobiasvl>
not sure what you mean. what are you trying to do?
<canton7>
yeah, that doesn't sound right
mgomezch has joined #ruby
<jheg>
well I'm following the tutorial in that link and struggling to understand when I would use what is obviously a powerful important part of the language
himsin has joined #ruby
Takle has joined #ruby
_justin has quit [Quit: _justin]
dangerousdave has quit [Ping timeout: 264 seconds]
<canton7>
jhass|off, it gives you some examples? iterating an array, manipulating an array, there are things like manipulating a file, etc etc
<jheg>
I can see how the .each part is useful but not why it needed to go through the method as a block
jeet1 has quit [Ping timeout: 272 seconds]
<canton7>
jheg, the take_block *has no real-world use*. don't try and assign it one. it is JUST to show you how to take/call a block. you can use this understanding to build more complex methods
<canton7>
(which do actually have some use)
<canton7>
jheg, just in case you hadn't realised: the stuff passed to [1, 2, 3, 4, 5].each .... end is a block ;)
<jheg>
yeah I totally get that part
<canton7>
which bit don't you get then? :P
<jheg>
lol
<jheg>
I'm thinking :)
rrios has quit [Remote host closed the connection]
<shevy>
jheg well, if you have a real problem to use, then write code to solve it; just because a feature is available does not automatically mean it is required or will give you real advantages
<shevy>
take @@variables
anarang has quit [Ping timeout: 240 seconds]
<shevy>
they are very useless in 95% of the use cases where they are used
<shevy>
jheg if I look at that code I first go "wtf"
noop has joined #ruby
dmyers has joined #ruby
<jheg>
the code in my link or your link?
anisha__ has joined #ruby
<shevy>
your link, the first part
<shevy>
apeiros wrote something very good:
techsethi has quit [Quit: techsethi]
<shevy>
<apeiros> and b) reveals intent better ("concise" actually implies that)
<canton7>
jheg, I missed that - which bit don't you get?
<shevy>
jheg btw in ruby, every method always accepts one block passed to it
Zenigor has joined #ruby
<shevy>
and do/end to a method is like {}, save for lesser precedence
<jheg>
so the tutorial is using part one as an example of passing a block to the method but I don't understand why when what I have written in part two is more concise and without the uneccesary code
blasius has joined #ruby
<shevy>
I don't even get the intent you try in the first part
<canton7>
jheg, you have to learn to walk before you can run. the tutorial would be doing a shit job if it dived in the deep end, teaching you how to write complex methods assuming you know how blocks work, without teaching you how blocks work
<shevy>
in the second example you simply seem to iterate over an array and write stuff
lxsameer has quit [Quit: Leaving]
dawkirst has quit [Remote host closed the connection]
<canton7>
jheg, the same applies throughout any sort of education. you have to learn a bunch of stuff which doesn't seem to be of any use, before you can learn how it all stitches together to actually be of use
djcp has joined #ruby
<shevy>
ooops sorry
rdark has quit [Ping timeout: 240 seconds]
djcp has left #ruby [#ruby]
yfeldblum has joined #ruby
<shevy>
should have been only: "Blocks, like parameters, can be passed into a method just like normal variables."
<shevy>
alinou you did not tell us which ruby version you use
<Macaveli>
But they are so many lines wasted just because the first line is different
philes has left #ruby [#ruby]
jeet3 has quit [Ping timeout: 245 seconds]
<alinou>
shevy, thanks for help ruby -v shows ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
jherbst has joined #ruby
<dideler|work>
alinou: are you using something like rvm or rbenv?
dblessing has joined #ruby
<alinou>
dideler|work , yes i have installed rvm
<dideler|work>
alinou: try just `gem install guard`, minus the sudo
datafirm has joined #ruby
<Macaveli>
Cork, hi
<alinou>
dideler|work , ok let me try it
<shevy>
alinou then there must be another problem because that error would never show up if you'd have a ruby version above 1.9.2; so yeah dideler|work already showed it
chipotle has joined #ruby
<shevy>
so it must be finding the wrong version on your system
blasius has quit [Remote host closed the connection]
rdark_ has joined #ruby
mikespla_ has joined #ruby
JohnBat26 has joined #ruby
marc_online_ has quit [Client Quit]
<Hanmac>
Macaveli: you need to remember that (attribute.to_sym) might be a memory leak ...
<Macaveli>
Hanmac, why is that?
sethetter has left #ruby [#ruby]
<Macaveli>
this is in my Rails#Validation
blasius_ has joined #ruby
<Hanmac>
Symbols are reacted but not deleted ... so when they come from user input it might like a said a memory leak
benzrf|offline is now known as benzrf
<Hanmac>
created
Asher1 has joined #ruby
jph98 has joined #ruby
RaCx has joined #ruby
<Macaveli>
they do not come from user :p
rdark has quit [Ping timeout: 240 seconds]
jheg has quit [Quit: jheg]
hermanmunster has joined #ruby
fgo has joined #ruby
hamakn has quit [Remote host closed the connection]
Asher has quit [Ping timeout: 264 seconds]
andrewlio has quit [Quit: Leaving.]
Zenigor has joined #ruby
blasius_ has quit [Remote host closed the connection]
pvb has quit [Ping timeout: 240 seconds]
Bumptious has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Joulse has quit [Quit: Joulse]
thllm011 has joined #ruby
freerobby has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
Bumptious has quit [Client Quit]
ta has joined #ruby
MatthewsFace has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
moritzs has quit [Ping timeout: 244 seconds]
alin_ has joined #ruby
fgo has quit [Ping timeout: 244 seconds]
shevy has quit [Ping timeout: 245 seconds]
teddyp1cker has joined #ruby
joaoh82 has joined #ruby
parduse has quit []
enebo has joined #ruby
parduse has joined #ruby
oo_ has joined #ruby
parduse has quit [Client Quit]
boris has joined #ruby
parduse has joined #ruby
thllm011 has left #ruby [#ruby]
jmurray has joined #ruby
jottr has joined #ruby
alinou has quit [Ping timeout: 255 seconds]
teddyp1cker has quit [Client Quit]
pu22l3r has joined #ruby
benzrf is now known as benzrf|offline
Fire-Dragon-DoL1 has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
tkuchiki has quit [Remote host closed the connection]
michaelchum has joined #ruby
Fire-Dragon-DoL has quit [Ping timeout: 272 seconds]
mikespla_ has quit []
pu22l3r has quit [Remote host closed the connection]
Trudko has quit [Read error: Connection reset by peer]
lemur has joined #ruby
<daxroc>
Morning all
Nebnev has quit [Ping timeout: 244 seconds]
<daxroc>
I'm getting ".rvm/gems/ruby-1.9.3-p545/bin/ruby_executable_hooks:15: stack level too deep (SystemStackError)" not sure why. How do I find what's causing that ?
kirun has joined #ruby
rayners has joined #ruby
<Hanmac>
daxroc: some function calls itself
datafirm has quit [Ping timeout: 244 seconds]
jheg has joined #ruby
hobodave has joined #ruby
yfeldblum has joined #ruby
shevy has joined #ruby
pvb has joined #ruby
kevind has joined #ruby
fold has joined #ruby
<daxroc>
Hanmac: any other reason you would get that, I've commented all the code in the definitions and still get it ?
<mr_foobar>
Hi, what is aj simple way to turn a hash into a class? e.g. user_hash[:name] should be accessible using user.name, user.name=, ...
<lemur>
OpenStruct.new(hash)
<lemur>
or Virtus if you want more horsepower there.
<mr_foobar>
thanks. I can also add methods to that later on, right? a "real" class
<shevy>
awww you are a lemur
<shevy>
they are so cute
<mr_foobar>
shevy: I respectfully agree
apeiros has quit [Remote host closed the connection]
<lemur>
Indeed
razrunelord has joined #ruby
<shevy>
mr_foobar yes
<shevy>
record = OpenStruct.new
<mr_foobar>
shevy: cool
<shevy>
record.name = "John Smith"
<lemur>
@shevy: people still use SourceForge?
aganov has quit [Quit: Leaving]
<shevy>
record.animal_type = 'lemur'
jonludlam has quit [Quit: Coyote finally caught me]
apeiros has joined #ruby
<shevy>
lemur yeah, if only for legacy, lots of software projects are still on there
<mr_foobar>
gotta love legacy code
<lemur>
Then their popularity index isn't exactly all that useful
<shevy>
well perhaps sufficient to establish general trends
<Veidit>
sevenseacat has quit [Remote host closed the connection]
hamakn has joined #ruby
<lemur>
When GitHub became popular, that index was doomed to become irrelevant.
Zenigor has quit [Remote host closed the connection]
<jhass>
mr_foobar: if you're going to add methods to an OpenStruct though and that maybe even for lots of objects / at different times in your programs runtime consider writing a small class instead which constructor takes that hash
<lemur>
considering JavaScript is ranked below both Ruby and Perl
sarkis has joined #ruby
<mr_foobar>
jhass: yes, so I create a class, for example "User", the initializer takes a hash as parameter, and then does something like self = OpenStruct.new hash ?
razrunelord has quit [Ping timeout: 240 seconds]
<lemur>
class Foo
<lemur>
def initialize(params={})
Zenigor has joined #ruby
knigitz has quit []
<lemur>
@name = params[:name]
<lemur>
end
<lemur>
end
<jhass>
no, at most you'd shortcut something like hash.each do |key, value| instance_variable_set("@#{key}", value); end
geggam has joined #ruby
<mr_foobar>
lemur: there are 52 keys thought
<mr_foobar>
*though
apeiros has quit [Ping timeout: 255 seconds]
<mr_foobar>
not just name
<lemur>
Best to be explicit on what's allowed then
treehug88 has joined #ruby
<jhass>
mr_foobar: what kind of methods do you want to add to that data?
<lemur>
Otherwise you might have other problems.
<shevy>
thing is, OpenStruct makes it a million times easier than having to do instance-variable_set manually
oo_ has quit [Remote host closed the connection]
<lemur>
Just get Virtus out
<shevy>
sounds like a beer
<shevy>
or energy drink
<lemur>
If you need this a lot and have a bunch of nested object classes, it wins
<shevy>
"Virtus - get some refreshing virtue back in your life!"
<mr_foobar>
jhass: well, I want to model a hydrant. I already have the data like manufacturer, pressure, ... as a hash. But I want it as a class that pretends to be like an activerecord model
oo_ has joined #ruby
<lemur>
Takes JSON and makes virtus classes for you
<lemur>
Virtus
<shevy>
a hydrant?! isn't that a thing that gives you water??
<lemur>
definitely virtus
<mr_foobar>
jhass: and I want to be able to add methods like .pressure_to_low?
<mr_foobar>
shevy: yes that
<shevy>
lol
<shevy>
better hydrant than infant!
<jhass>
mr_foobar: maybe subclassing OpenStruct works
<jhass>
I never tried
<shevy>
btw mr_foobar I would write pressure_too_low? :)
<lemur>
Virtus would allow you to add methods like that
<shevy>
Virtus... written by a water loving beaver ...
<lemur>
OpenStruct is good for simple serialization
<mr_foobar>
shevy: oops, my keyboard failed
<lemur>
that one was Solnic, not me
CorpusCallosum has quit [Ping timeout: 255 seconds]
<shevy>
aaaah
<mr_foobar>
shevy: damn USB connections are so unreliable
<shevy>
so on IRC you are a lemur, in reallife you are a beaver
spastorino has joined #ruby
kilk_ has quit [Ping timeout: 255 seconds]
<shevy>
mr_foobar I fault my code
<mr_foobar>
shevy: called justin?
<shevy>
I mean, my cat
<shevy>
no please
<lemur>
I just happened to make a library that generates the classes for you from raw JSON
hermanmunster has quit [Remote host closed the connection]
stantona has quit [Remote host closed the connection]
<csmrfx>
but, why?
<Sigma00>
well if I use Object.new.clone and use that instead, my code is immediately thread safe! What, pass by ref? Yeah we do that, but we copied at the start! IT'S SAFE /s
terrellt has quit [Ping timeout: 240 seconds]
<csmrfx>
are you serious
mehlah has quit [Quit: Leaving...]
* pontiki
gives Sigma00 a stiff bourbon
<csmrfx>
so its for jruby?
<pontiki>
drink that, you'll feel better
<Sigma00>
/s means sarcasm <_< also csmrfx: you need to start reading nicks
<pontiki>
workmad3 makes me use that </sarcasm> :P
benzrf is now known as benzrf|offline
* csmrfx
feels so unsafe for never having used clone
<csmrfx>
I have been duped into using old duped objects
jaimef has quit [Excess Flood]
<Sigma00>
if any of you thought that Object.new.clone was proper usage...
<pontiki>
indupitably!
<csmrfx>
</sarmasc>
tessi is now known as tessi_zz
razrunelord has joined #ruby
axl_ has quit [Ping timeout: 240 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maestrojed has joined #ruby
jaimef has joined #ruby
stantona has joined #ruby
dangerou_ has quit [Read error: Connection reset by peer]
gruz0[russia] has quit [Quit: This computer has gone to sleep]
jaequery has joined #ruby
tessi_zz is now known as tessi
brandonjmckay has joined #ruby
brandonjmckay has quit [Client Quit]
iliketurtles has joined #ruby
djbkd has joined #ruby
hobodave has joined #ruby
jaequery has quit [Client Quit]
joaoh82_ has joined #ruby
<DefV>
I think foobarbaz is a JS programmer
joaoh82 has quit [Ping timeout: 245 seconds]
<DefV>
form what I can gather from his question
<DefV>
that's how you'd do it in JS :-)
dumdedum has quit [Ping timeout: 240 seconds]
<foobarbaz>
DefV: That's what my question came from :P
<foobarbaz>
But it was all just a misunderstanding to begin with haha
Sc0rp10n has joined #ruby
arya_ has joined #ruby
<AlHafoudh>
hi
Takle has quit [Remote host closed the connection]
rgrinberg has joined #ruby
moritzs has quit [Ping timeout: 255 seconds]
<AlHafoudh>
how would you write AREL query to get all posts and last comment along with them as single SQL query
Skei has joined #ruby
djbkd has quit [Ping timeout: 240 seconds]
saarinen has joined #ruby
<jhass>
#rubyonrails may have more expertise on that one
<Skei>
Morning, all. Basic question : on OSX, I've just run "gem install bundler", but I can't find the thing to put it into my PATH, so I can't call bundle commands. Any thoughts ? Thanks !
mityaz has joined #ruby
RaCx has joined #ruby
<jhass>
AlHafoudh: I don't think you need Arel for that one though, something like Post.includes(:comments) should suffice
<AlHafoudh>
jhass: lets imagine I have many comments :)
<AlHafoudh>
i am thinking of group by
<jhass>
so?
anaeem1 has joined #ruby
<jhass>
your Post model should have a has_many :comments, or has_many :comments, through: whatever
<centrx>
AlHafoudh, SQL is not the best for that sort of thing unless you use window functions/ranking functions, which are not in Arel
FancyCamel has joined #ruby
<FancyCamel>
Uh, hi everyone. :|
<FancyCamel>
Anyone care to help a noob out a bit? :D
<centrx>
!ask
<jhass>
FancyCamel: you won't find out without asking an actual question
foobarbaz has quit [Quit: Page closed]
<Skei>
Found it :)
<FancyCamel>
Haha I was just making sure people weren't afk. :)
rezzack has joined #ruby
<FancyCamel>
I'm just trying to go through the Getting Started tutorial, and it suggests doing "rails server" but I'm getting an error that it could not find a Javascript runtime
jxf has quit [Ping timeout: 244 seconds]
<centrx>
FancyCamel, For Rails, try #rubyonrails
<FancyCamel>
Oh, I'm sorry. :x
<centrx>
FancyCamel, You may need to Register/Identify your nick with Freenode in order to enter that channel
binaryhat has joined #ruby
amargherio has joined #ruby
mikepack has joined #ruby
<FancyCamel>
Uh, is it ./join #rubyonrails ? I don't use this stuff often.
<centrx>
Yes
<jhass>
FancyCamel: /msg NickServ help after you have registered /join #rubyonrails (without a dot in front)
<FancyCamel>
Thanks :)
rgrinberg has quit [Quit: Leaving.]
kilk_ has quit [Ping timeout: 240 seconds]
xcv_ has quit [Remote host closed the connection]
axl_ has joined #ruby
baroquebobcat has joined #ruby
mjsmith2 has quit [Remote host closed the connection]
yeticry_ has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby
lkba has quit [Ping timeout: 255 seconds]
xcv has joined #ruby
jheg has joined #ruby
saarinen has quit [Quit: saarinen]
krz has quit [Quit: WeeChat 0.4.3]
timonv has quit [Remote host closed the connection]
Takle has joined #ruby
yeticry has joined #ruby
wallerdev has joined #ruby
Takle has quit [Remote host closed the connection]
dANOKELO_ has quit []
codeurge has joined #ruby
bricker`work has joined #ruby
r_rios has quit [Ping timeout: 255 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
RaCx has quit [Quit: Computer has gone to sleep.]
timonv_ has joined #ruby
binaryhat has quit [Quit: Leaving]
Sc0rp10n has quit [Ping timeout: 264 seconds]
coderhs has joined #ruby
toastynerd has joined #ruby
terrell_t is now known as terrellt
agrinb has quit [Remote host closed the connection]
tessi is now known as tessi_zz
timonv_ has quit [Ping timeout: 244 seconds]
IceDragon has joined #ruby
rgrinberg has joined #ruby
___mb has joined #ruby
jerius has joined #ruby
Zenigor has quit [Remote host closed the connection]
dda has joined #ruby
jaequery has joined #ruby
mjsmith2 has joined #ruby
jaequery has quit [Max SendQ exceeded]
RaCx has joined #ruby
jaequery has joined #ruby
jaequery has quit [Max SendQ exceeded]
jerius_ has joined #ruby
mityaz has quit [Quit: See ya!]
jaequery has joined #ruby
andrewjanssen has joined #ruby
jaequery has quit [Max SendQ exceeded]
jaequery has joined #ruby
lord4163 has quit [Ping timeout: 245 seconds]
poguez_ has joined #ruby
jaequery has quit [Max SendQ exceeded]
ikaros has quit [Quit: Ex-Chat]
jaequery has joined #ruby
Zenigor has joined #ruby
jaequery has quit [Max SendQ exceeded]
lord4163 has joined #ruby
edwx has joined #ruby
jaequery has joined #ruby
blasius has quit [Remote host closed the connection]
lkba has joined #ruby
jerius has quit [Ping timeout: 272 seconds]
IceDragon_ has joined #ruby
dgaffney has joined #ruby
<dgaffney>
Man, didn't realize rubyforge was going away...
Joulse has quit [Quit: Joulse]
IceDragon has quit [Ping timeout: 240 seconds]
jespada has quit [Ping timeout: 264 seconds]
s_ has joined #ruby
axl_ has quit [Quit: axl_]
diegoviola has joined #ruby
dangerousdave has quit [Ping timeout: 240 seconds]
edwx has quit [Killed (idoru (Spam is off topic on freenode.))]
Sc0rp10n has joined #ruby
brasten has quit [Ping timeout: 272 seconds]
brasten_ is now known as brasten
treehug8_ has quit []
Rahul_Roy has quit [Quit: Connection closed for inactivity]
dangerousdave has joined #ruby
alex88 has quit [Quit: Leaving...]
razrunelord has joined #ruby
fgo has joined #ruby
tessi_zz is now known as tessi
timonv has joined #ruby
razrunelord has quit [Remote host closed the connection]
Rob_Ford is now known as Takumo
sailias has quit [Quit: Leaving.]
kenneth has joined #ruby
freerobby has quit [Quit: Leaving.]
<lectrick>
Does anyone have a good argument for (static) type systems in languages? I know Ruby isn't one of them, looking for arguments that aren't simply a matter of preference
axl_ has joined #ruby
blackmesa has joined #ruby
<Edelwin>
lectrick: a better control over memory allocation
fgo has quit [Ping timeout: 255 seconds]
<Edelwin>
useful if you have to word with embeded systems
<lectrick>
ok that's one
baroquebobcat has quit [Quit: baroquebobcat]
<jhass>
compile time method checking, even for very rare codepaths
<lectrick>
and I presume there's a bit more speed possible since the compiler knows the types before runtime
baroquebobcat has joined #ruby
<lectrick>
jhass: well if you have a test suite covering all your codepaths, wouldn't that be almost as good? :)
<eam>
lectrick: safety
michaelchum has quit [Quit: Connection closed for inactivity]
razrunelord has joined #ruby
<jhass>
yes but as you're saying "almost" and you have to have that suite
ephemerian has quit [Quit: Leaving.]
<jhass>
I'd really like to see the type interference stuff to succeed in the future
mikecmpbll has quit [Ping timeout: 264 seconds]
seanosaur has quit []
jheg has quit [Read error: Connection reset by peer]
xcv has quit [Remote host closed the connection]
seanosaur has joined #ruby
jheg has joined #ruby
codeurge has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
codeurge has joined #ruby
<pontiki>
lectrick: Sandi Metz covers both points of view in POODR, tho coming out in favor of dynamic typing, obvs
jfran has quit [Quit: Going offline, see ya! (www.adiirc.com)]
agrinb has joined #ruby
<lectrick>
pontiki: still working through POODR :)
qba73 has quit []
<pontiki>
iirc, it's around chapter 5?
yfeldblum has joined #ruby
DarthGandalf has joined #ruby
<lectrick>
will whip out my kindle in a bit... laptop battery about to die and want to stretch it
tectonic has joined #ruby
spider-mario has joined #ruby
<shevy>
stretch it real good man
s_ has quit [Remote host closed the connection]
<shevy>
jhass I forgot if I already asked, are you using rubygems.org as author of gems?
<csmrfx>
lectrick: faster
<pontiki>
yes, lectrick "Static versus Dynamic Typing" in chapter 5 on duck typing
<csmrfx>
uh, faster to interpret
<jhass>
shevy: I do but not much stuff up there
<csmrfx>
and, thats kinda weird one
greenarr_ has quit [Quit: 500]
xcv has joined #ruby
datafirm has joined #ruby
troyready has joined #ruby
jailbot has joined #ruby
<jailbot>
hey
wallerdev has quit [Quit: wallerdev]
<jailbot>
is there an easy way to get the next/previous object in a collection?
emsilva has joined #ruby
<banister>
jailbot each_slice
<banister>
jailbot no, each_cons
zigomir has quit [Remote host closed the connection]
IceDragon_ is now known as IceDragon
zigomir has joined #ruby
zigomir has quit [Remote host closed the connection]
bradleyprice has quit [Remote host closed the connection]
<csmrfx>
banister: thats the only reason I can think og
diegovio1 is now known as diegoviola
<jameyd>
the refinery_login_with :refinery_superuser line is fine, but if i put it inside an it block, like line 5, i no longer can access that method
<csmrfx>
banister: maybe test by sorting the awk output first
zoraj_ has quit [Remote host closed the connection]
jxf has joined #ruby
Xeago has joined #ruby
senayar has quit [Ping timeout: 255 seconds]
chrishough has joined #ruby
<csmrfx>
banister did you man uniq
Logico has left #ruby ["Saindo"]
<csmrfx>
uniq checks the adjacent lines
<csmrfx>
not all lines
timonv has quit [Remote host closed the connection]
gondalier has joined #ruby
jheg_ has quit [Quit: jheg_]
mercerist has joined #ruby
sigurding has quit [Quit: sigurding]
<csmrfx>
why doesn't my git have "recent" ;__;
kenneth has joined #ruby
sheperson has joined #ruby
jheg_ has joined #ruby
djbkd has quit [Remote host closed the connection]
banister is now known as banisterfiend
arrubin has left #ruby [#ruby]
wmoxam has joined #ruby
xcv has joined #ruby
kireevco has quit [Read error: Connection reset by peer]
kireevco has joined #ruby
rgrinberg has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
boris has quit [Remote host closed the connection]
djbkd has joined #ruby
hermanmunster has joined #ruby
mikepack has quit [Remote host closed the connection]
xcv has quit [Ping timeout: 240 seconds]
enape_101 has joined #ruby
davidvl has quit [Quit: This computer has gone to sleep]
hermanmunster has quit [Read error: No route to host]
hermanmu_ has joined #ruby
Zamerick has quit [Quit: Leaving]
ferr has joined #ruby
Zamerick has joined #ruby
baroquebobcat has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
frem has quit [Ping timeout: 255 seconds]
<___mb>
Hi, I'm new to RSpec and I'm having a problem using doubles in the following test: http://pastebin.com/T96FBfFF could anybody have a look at it ? thanks
karmatr0n has quit [Remote host closed the connection]
blackmesa has joined #ruby
tessi is now known as tessi_zz
<jhass>
did you try allow(object).to receive(:A) ?
<jhass>
also use #public_send to call methods dynamically
<jhass>
as a style note, leave of empty parens
hermanmu_ has quit [Read error: No route to host]
hermanmunster has joined #ruby
davidvl has joined #ruby
WormDrink has quit [Ping timeout: 240 seconds]
<jhass>
you can also setup an expectation that a particular method is called with expect(object).to receive(:method)
xcv has joined #ruby
stantona has quit [Remote host closed the connection]
<___mb>
the problem is that I get unexpect calls on respond_to?, and when I allow respond_to?, i have to problem that i want to handle two cases (:A and :B) for the return value
datafirm has joined #ruby
<___mb>
then yes, i'll use expect(object).to receive(:method)
rh1n0 has quit [Remote host closed the connection]
lemur has quit [Remote host closed the connection]
<godd2>
havenwood, jhass I'll be sure to use the '= Struct.new' version from now on
<jhass>
I see no reason to use a Struct there, a normal class is just one more line
ferr has quit [Quit: Konversation terminated!]
<godd2>
But I thought you said that if there are no methods, then just make a struct?
<jhass>
there are more methods than attributes
mradmacher has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
and the first thing I said was that the decision is mainly good judgment, later criteria are simply to aid in that
stantona has joined #ruby
paulfm has quit []
<godd2>
fair enough, so is a good conclusion that in this case it doesnt matter what route I take?
<havenwood>
i agree that class makes more sense here
sameerynho has joined #ruby
alvaro_o has joined #ruby
lxsameer has quit [Ping timeout: 255 seconds]
<jhass>
actually, if you're unsure pick a class, nobody will be confused if you used a class where a struct would be a shortcut. Not so the other way around
maletor has quit [Ping timeout: 240 seconds]
mikepack has joined #ruby
Tricon has joined #ruby
maletor has joined #ruby
emdub has quit [Remote host closed the connection]
<godd2>
what do you mean that people would be confused?
stantona has quit [Ping timeout: 244 seconds]
emdub has joined #ruby
<jhass>
if I'd encounter what you posted in production code I'd be confused about the reasoning for using Struct there
havenwood has quit [Remote host closed the connection]
Nebnev has quit [Ping timeout: 272 seconds]
vpretzel has quit [Remote host closed the connection]
noop has quit [Read error: Connection reset by peer]
dapz has joined #ruby
jxf has quit [Ping timeout: 244 seconds]
vpretzel has joined #ruby
eka_ has joined #ruby
beneggett has joined #ruby
shvelo has joined #ruby
shvelo has quit [Changing host]
shvelo has joined #ruby
yfeldblum has quit [Remote host closed the connection]
jonahR has quit [Remote host closed the connection]
Georg3 has quit [Quit: Georg3]
jonahR has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
stantona has quit [Remote host closed the connection]
jonahR_ has joined #ruby
eka has quit [Ping timeout: 264 seconds]
dangerousdave has quit [Read error: Connection reset by peer]
codeurge has joined #ruby
dangerousdave has joined #ruby
timonv has joined #ruby
jonahR has quit [Ping timeout: 272 seconds]
eka_ has quit [Ping timeout: 240 seconds]
enebo has quit [Quit: enebo]
hobodave has quit [Quit: Computer has gone to sleep.]
Georg3 has joined #ruby
aesptux has joined #ruby
sandbags has joined #ruby
sandbags has joined #ruby
hobodave has joined #ruby
eka has joined #ruby
x1337807x has joined #ruby
jobewan has quit [Quit: Leaving]
postmodern has joined #ruby
kireevco has joined #ruby
JohnBat26 has quit [Ping timeout: 244 seconds]
kireevco has quit [Max SendQ exceeded]
kireevco has joined #ruby
ringarin has quit [Ping timeout: 244 seconds]
timonv has quit [Ping timeout: 245 seconds]
jxf has joined #ruby
Zai00 has joined #ruby
mattmcclure has joined #ruby
eka_ has joined #ruby
eka has quit [Ping timeout: 240 seconds]
bricker`work is now known as bricker
djbkd has quit [Remote host closed the connection]
lemur has joined #ruby
bricker is now known as bricker`work
noop has joined #ruby
fgo has joined #ruby
iliketurtles has joined #ruby
Takle has joined #ruby
axsuul has joined #ruby
benzrf|offline is now known as benzrf
toastynerd has quit [Remote host closed the connection]
senayar has joined #ruby
Zai00 has quit [Quit: Zai00]
lemur has quit [Ping timeout: 240 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
jtiggo has quit []
fgo has quit [Ping timeout: 240 seconds]
joaoh82 has quit []
baroquebobcat has joined #ruby
brasten has joined #ruby
toastynerd has joined #ruby
chrishough has quit [Quit: chrishough]
axsuul has quit [Ping timeout: 264 seconds]
RaCx has quit [Quit: Computer has gone to sleep.]
senayar has quit [Ping timeout: 240 seconds]
chipotle has quit [Quit: cya]
stantona has joined #ruby
xcv_ has joined #ruby
Rahul_Roy has quit [Quit: Connection closed for inactivity]
r_rios has quit [Ping timeout: 240 seconds]
andrewjanssen has quit [Quit: Leaving...]
Steve21 has joined #ruby
pu22l3r has quit [Ping timeout: 244 seconds]
andrewjanssen has joined #ruby
sinkensabe has quit [Remote host closed the connection]
ctp has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sinkensabe has joined #ruby
pu22l3r has joined #ruby
ctp has joined #ruby
xcv has quit [Ping timeout: 264 seconds]
yfeldblum has joined #ruby
hermanmunster has joined #ruby
icole has joined #ruby
andrewjanssen has quit [Client Quit]
dangerousdave has quit [Read error: Connection reset by peer]
benlieb has joined #ruby
Steve21 has quit [Quit: Steve21]
freerobby has joined #ruby
freerobby has quit [Client Quit]
dangerousdave has joined #ruby
Takle has quit [Remote host closed the connection]
andrewjanssen has joined #ruby
sinkensabe has quit [Ping timeout: 272 seconds]
jottr_ has quit [Ping timeout: 240 seconds]
r_rios has joined #ruby
jprovazn has quit [Quit: Odcházím]
RaCx has joined #ruby
djbkd has joined #ruby
hermanmunster has quit [Ping timeout: 240 seconds]
dgutierrez1287 has quit [Remote host closed the connection]
bmurt has quit []
Guest10567 has quit [Quit: Computer has gone to sleep.]
dgutierrez1287 has joined #ruby
anaeem1 has quit [Remote host closed the connection]
andrewjanssen has quit [Client Quit]
Zenigor has quit [Remote host closed the connection]
aesptux has quit [Remote host closed the connection]
Zamerick has quit [Quit: Leaving]
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
aesptux has joined #ruby
aesptux has quit [Read error: Connection reset by peer]
BradLsys has quit [Quit: Leaving]
aesptux has joined #ruby
WormDrink has joined #ruby
sailias has quit [Quit: Leaving.]
<shvelo>
congrats, that's over 100 consecutive join/quit messages
<jhass>
congrats, a smart client can hide them
fresham has joined #ruby
<shvelo>
yeah but it's sad
<jhass>
you're new to IRC, right?
<shvelo>
jhass, why?
<jhass>
it's perfectly normal
<shvelo>
I've been using IRC since Gaben created the universe
simoz111116 has joined #ruby
mark_locklear has quit [Ping timeout: 245 seconds]
<Georg3>
Good afternoon gentlemen.
Fractional has joined #ruby
tier has quit []
john____ has quit []
scx_ has joined #ruby
danman has joined #ruby
treehug8_ has joined #ruby
<tsunamie>
sorry I forgot the cdomand I can run on the command line which would tell me the files encoding?
iliketurtles has quit [Quit: zzzzz…..]
<jhass>
`file` prints that in some circumstances
<apeiros>
file. but it only can make an educated guess
AlSquire has joined #ruby
paulfm has quit []
zorak has joined #ruby
<tsunamie>
it told me what ruby thought the file encoding is
<apeiros>
guesses are *not* reliable. do *not* use them if you can have a better source of information.
<apeiros>
ruby doesn't think anything.
<apeiros>
ruby uses exactly the encoding you tell it to use. either explicitly or via its defaults.
joaoh82 has joined #ruby
scx has quit [Ping timeout: 240 seconds]
trybeee has joined #ruby
treehug88 has quit [Ping timeout: 240 seconds]
Takle has joined #ruby
<tsunamie>
so there is no command that ruby can run to check what a file encoding is? or what it thinks it is?
<tsunamie>
as I don't want to have to know the file encoding by running something like File.open(filename, "r:ASCII-8BIT") do |file|
<apeiros>
a file does NOT contain information about its encoding. and no, ruby itself does not ship with code to make guesses on the encoding of a file.
<tsunamie>
I want to be able to run a command and find out what the file encoding is and then process it based on that
<apeiros>
*sob*
<tsunamie>
apeiros, thank fair enought
dangerousdave has quit [Ping timeout: 244 seconds]
<tsunamie>
apeiros, hehe I can symethize
<apeiros>
I repeat: you. can. not. get. the. file. encoding. all you can do is get educated guesses. the linux `file` command will do that.
yfeldblu_ has joined #ruby
eka_ has quit [Read error: Connection reset by peer]
<apeiros>
you have to take precautions so you *know* the encoding. that means the source of the file has to tell you the encoding and you store it along with the file or similar.
dangerousdave has joined #ruby
eka has joined #ruby
<jhass>
tsunamie: what he's telling you is that you should fix the process you obtain the files from to deliver a consistent or at least a known encoding
Steve21 has joined #ruby
eka has quit [Read error: Connection reset by peer]
<tsunamie>
jhass, I get that, however if the file is a 3rd party that dictates standards then I can't really push them to confirm to mine. However I understand what you mean
eka has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
<apeiros>
tsunamie: if they dictate standards, I *SURE* hope those standards include the encoding.
<jhass>
sad standards that don't even dictate the encoding
<apeiros>
and if not, hit them with a bat, or a club. I'll gladly lend you the one I use for such things.
<tsunamie>
apeiros, it does, they have been changing it fdor some reason
<eam>
jhass: so, most of them then
yfeldblum has quit [Ping timeout: 240 seconds]
<apeiros>
hopefully from <random legacy encoding> to <unicode based encoding like utf-8 or -16>
r_rios has quit [Ping timeout: 240 seconds]
<tsunamie>
apeiros, I have asked why, however no answer in my support ticket :(
<eam>
for example, what encoding is this text from IRC you're reading right now?
<apeiros>
eam: irc standard? haha, good one :D
<eam>
;-)
<jhass>
yeah, IRC totally is what I call a sad standard
<eam>
I mean there's a super clear standard: it's a bunch of bytes
<apeiros>
also: fuck everybody who doesn't use utf-8 on irc :-p
<tsunamie>
anywaqy thanks guys, really helpful stuff. Gues I will have to work something out
<godd2>
tsunamie the reason you can't know the encoding of a file by looking at it is because even if the file tells you what encoding it is, those bytes it is using to do so could randomly and coincidentally be bytes that should be interpreted a different way by another encoding.
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alin_ has quit [Quit: Leaving]
ctp has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tsunamie>
godd2, ty
dgutierrez1287 has quit [Ping timeout: 264 seconds]
Tricon has quit [Quit: Leaving...]
<apeiros>
godd2: file formats which contain encoding information do so in a robust format (usually)
matkal has joined #ruby
b00stfr3ak has quit [Ping timeout: 244 seconds]
<jhass>
hm, I need to get a font for the unicode 7 emoji set
<matkal>
is it possible for me do an OAUth API authentication from a ruby script
b00stfr3ak has joined #ruby
<matkal>
?
<jhass>
matkal: yes
<matkal>
how?
cocotton has joined #ruby
<jhass>
see oauth gem (or oauth2 if that's what you're using)
<apeiros>
mmmmh, soon I'll get around to implement fleets and exploration in my nice little starbase orion clone :D
<matkal>
the API is using OAuth1
techsethi has quit [Quit: techsethi]
baroquebobcat has quit [Quit: baroquebobcat]
christickner has joined #ruby
<matkal>
i belive that as i send a request the user is suppose to fill in user credentials in case of a web app. How does this work from a background script
iliketurtles has joined #ruby
maximski has quit []
<godd2>
apeiros: are you doing it in ruby? if so, are you using the gosu gem?
ldnunes has quit [Quit: Leaving]
<christickner>
Hi all, I have a MYSQL dump file - I need to do a regular expression replace on it - when I do this with one of my dbs, I get a "invalid byte sequence in UTF-8" error. I have tried the /u modifier. Running out of ideas. Using 2.1
aspires has joined #ruby
xcv_ has quit [Remote host closed the connection]
<apeiros>
godd2: doing it in JS
<jhass>
christickner: you're sure that dump is in UTF-8 and so is all data in it?
<apeiros>
godd2: coincidentally will make it easier to run AI tournaments (because I can run the AIs in isolated VMs)
<matkal>
Any ideas on OAuth from background script please
jheg_ has joined #ruby
kyb3r_ has joined #ruby
cocotton has quit [Remote host closed the connection]
<christickner>
jhass: perhaps all data is not .. there are some binary blobs in there
<christickner>
jhass: lets assume it is not, how can I proceed?
<jhass>
you're unable to import it as it is?
noop has quit [Ping timeout: 240 seconds]
cocotton has joined #ruby
cocotton has quit [Remote host closed the connection]
saarinen has quit [Quit: saarinen]
cocotton has joined #ruby
<christickner>
jhass: Importing is not the issue ... its the sqldump.gsub that throws
<jhass>
import and then fix the data inside the db
pu22l3r has quit [Ping timeout: 244 seconds]
sigurding has joined #ruby
<christickner>
jhass: not a bad idea, but my db is rather large and the regex replaces can happen in any table and any column
lmickh has quit [Remote host closed the connection]
<christickner>
jhass: is there any way to do this on the sql string?
mary5030 has quit [Remote host closed the connection]
r_rios has joined #ruby
<jhass>
you probably could try it line by line and swallow the error
<jhass>
what are you doing there anyway?
Gil has joined #ruby
fresham has left #ruby [#ruby]
nanoyak has joined #ruby
<christickner>
We want a quick and dirty was to replace URLs in the CMS DB... so its quite ugly, but we can live with that... this happens in a capistrano task
<jhass>
that doesn't sound like "any table/any column" to me
tus has joined #ruby
spider-mario has quit [Remote host closed the connection]
Skei has quit [Ping timeout: 240 seconds]
saarinen has joined #ruby
<godd2>
yea christickner why dont you just dump field that will have the urls you're concerned with
cocotton has quit [Remote host closed the connection]
<godd2>
unless the urls are the thing causing the problem
Georg3 has quit [Ping timeout: 272 seconds]
amargherio has quit [Remote host closed the connection]
Gil has quit [Ping timeout: 240 seconds]
jerius_ has quit []
senayar has joined #ruby
<christickner>
yeah. cool, thanks for the tips. will probably go that route.
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Nebnev has joined #ruby
testcore has quit [Quit: [BX] Everybody was Kung Fu fighting!]
djbkd has quit [Remote host closed the connection]
bdnelson has joined #ruby
<shevy>
undefined method `e'
<shevy>
hmm
<shevy>
how to catch that? if self.respond_to? :e ?
<jhass>
no need for the self. even
cocotton_ has joined #ruby
<shevy>
really? hmm lemme test
<godd2>
is it happening inside a method_missing?
cocotton_ has quit [Remote host closed the connection]
<shevy>
cool
cocotton has joined #ruby
<shevy>
if respond_to? :e
<shevy>
seems to work
hpoydar has quit [Remote host closed the connection]
chrishough has joined #ruby
andrewlio has quit [Quit: Leaving.]
ari-_-e has joined #ruby
jheg_ has quit [Quit: jheg_]
djbkd has joined #ruby
senayar has quit [Ping timeout: 272 seconds]
mradmacher has quit [Ping timeout: 264 seconds]
vinleod has joined #ruby
jerius has joined #ruby
mjsmith2_ has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
alexandrite has quit [Ping timeout: 264 seconds]
gondalier has quit []
mengu has joined #ruby
mengu has quit [Remote host closed the connection]
Eyes has quit [Quit: X probably crashed]
frem has quit [Ping timeout: 264 seconds]
chipotle has joined #ruby
frem has joined #ruby
<lagweezle>
Using rspec 3 and I'm wondering how I go about mocking out this call --> RestClient.post notification_uri, body.to_json, :authorization => "Bearer #{config.hipchat_v2_api_oauth_token}", :content_type => :json, :accept => :json
Xeago has quit [Remote host closed the connection]
<lagweezle>
Or rather, stubbing out ...
nanoyak has quit [Quit: Computer has gone to sleep.]
<jhass>
webmock or just allow(RestClient).to receive(:post).and_return(double)
<lagweezle>
webmock?
ctp has joined #ruby
marr has quit []
jerius has quit [Client Quit]
<lagweezle>
Ah. I see... Thank you Googles.
<jhass>
!gem webmock
<jhass>
!ping
andrewjanssen has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jottr_ has joined #ruby
sonofflynn has quit [Ping timeout: 240 seconds]
nanoyak has joined #ruby
dda has quit [Quit: logging out.]
mikepack has quit [Remote host closed the connection]
mikepack has joined #ruby
<bricker`work>
jhass: wrong channel :)
<jhass>
no, we got helpa here now
<bricker`work>
we do?
<bricker`work>
neat
<bricker`work>
!botsnack
bricker`work is now known as bricker
<bricker>
!botsnack
<helpa>
Nom nom. Thanks, bricker!
<bricker>
:o
jfran has joined #ruby
seanosaur has quit [Remote host closed the connection]
<shevy>
!botsex
scx_ has quit [Ping timeout: 264 seconds]
<lagweezle>
helpa?
K3dare has quit [Ping timeout: 272 seconds]
<bricker>
!helpa
<helpa>
Stack overflow at line: 0
jonno11 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<lagweezle>
jhass: Hmm is there a means to dump out what the stubbed method actually was called with?
scx has joined #ruby
<jhass>
maybe, but nothing I'm immediately aware of. I mean you can just def RestClient.post(*args); p args; end
<jhass>
if you want to assert the args or differentiate the return value based on them use .with
shvelo has quit [Ping timeout: 240 seconds]
K3dare has joined #ruby
almostwhitehat has quit [Quit: almostwhitehat]
SBoolean has quit [Remote host closed the connection]
<lagweezle>
The '.with' I'm seeing and I think I understand. Was just hoping for a means to figure out what is being sent to it presently.
<lagweezle>
Nice for when I'm exploring things and confused (which is often ;).
<jhass>
well as said, just override it and let it print
andrewjanssen has quit [Ping timeout: 240 seconds]
cocotton has quit [Ping timeout: 240 seconds]
alexju has quit [Remote host closed the connection]
Georg3 has joined #ruby
maestrojed has quit [Quit: Computer has gone to sleep.]
gondalier has joined #ruby
troyready has quit [Quit: Leaving]
zorak has quit [Ping timeout: 245 seconds]
Stalkr^ has quit [Quit: Leaving...]
shvelo has joined #ruby
NukePuppy has quit [Ping timeout: 240 seconds]
dangerousdave has quit [Read error: Connection reset by peer]
<minus78_>
Sorry for my english, I want learn Ruby, but I don't understand :variable . The :variable contain a memory adress ?.
<godd2>
do you mean the symbol?
baroquebobcat has quit [Quit: baroquebobcat]
<godd2>
:variable is an object called a Symbol. It acts like a string in a lot of ways, and it's often used in code for naming things like methods
razrunelord has quit [Remote host closed the connection]
cobakobodob has quit [Ping timeout: 264 seconds]
jespada has quit [Quit: Leaving]
icole has quit [Remote host closed the connection]
<pipework>
minus78_: Look up Symbol in ruby documentation.
aspires has joined #ruby
<pipework>
It's like an atom.
razrunelord has joined #ruby
hpoydar has joined #ruby
<shevy>
what documentation
AlSquire has quit [Quit: This computer has gone to sleep]
<minus78_>
Yes, I mean symbol, but when I write for example h = {:v => 16} and b = {:v => 17} why I don't obtain h[:v] = 17, because :v has a same object_id
<benzrf>
minus78_: those are 2 different hashes
<benzrf>
minus78_: you need to unlearn your c stuff
jhass is now known as jhass|off
chipotle has quit [Quit: cya]
treehug8_ has quit []
<benzrf>
:v is *not* being bound to 16
<benzrf>
or 17
Georg3 has quit [Quit: Georg3]
<benzrf>
:v itself is just a value
<benzrf>
minus78_: think of it like this
diegoviola has quit [Remote host closed the connection]
<shevy>
minus78_ it is not a variable
baroquebobcat has joined #ruby
<benzrf>
minus78_: if you have a tree and a way of numerically addressing nodes in it
<eam>
{ x => y } returns a Hash which has a key of x mapped to a value of y
<Senjai>
:v is an instance of Symbol
<eam>
x and y can be anything
<benzrf>
minus78_: you would not get the same value from looking up the same address in 2 different trees
saarinen has quit [Quit: saarinen]
<benzrf>
minus78_: :v is an abstract value that h uses as a key to 16
alexandrite has joined #ruby
<benzrf>
:v itself is not being pointed to anything
<benzrf>
minus78_: you need to forget about memory locations and object_id's
karmatr0n has quit []
<benzrf>
ruby is significantly higher level :i
<godd2>
minus78_ the reason they have the same object_id is to save memory space when you're dealing with lots of symbols.
xerxas has quit [Quit: Connection closed for inactivity]
zorak has joined #ruby
icole has joined #ruby
<benzrf>
minus78_: i should also warn you that ruby uses pointer-like assignment and arguments
<pipework>
I bet someone has written something like "Ruby for C developers"
<eam>
he doesn't need to forget about object_id, that's fine
<eam>
the important part is that there are two separate hash objects