<ra4king>
typing "ruby" gives me rbenv: ruby: command not found though
<ra4king>
saying it's available in 2.1.2
<ra4king>
typing 'rbenv versions' gives me 2.1.2 installed
gruz0[russia] has quit [Client Quit]
nfk has quit [Quit: yawn]
<Wolland>
do you have to "switch" to use that version?
mrsolo has left #ruby [#ruby]
<ra4king>
no it's the only version installed
gruz0[russia] has joined #ruby
<Wolland>
still
luksaur has quit [Quit: fuis]
<omosoj>
hey guys i want to work with a sql database in a *sql file. should i use the mysql2 gem?
<omosoj>
*.sql file
<Wolland>
some OSs come with system ruby or you still have to switch to select ruby with rbenv so it sets all the paths correctly
<ra4king>
Wolland: no system ruby is installed
<ra4king>
Wolland: huh... doing "rbenv version" gives me system
<ra4king>
there is no system, which makes sense
<ra4king>
how do I set a version?
gruz0[russia] has quit [Client Quit]
<Wolland>
you have to set 2.1.2 to be your "default" or system ruby
gruz0[russia] has joined #ruby
<ra4king>
Wolland: when I installed rbenv, it appears that it set the ruby version to "system"
<ra4king>
I just ran "rbenv shell 2.1.2"
<ra4king>
now ruby and gem commands work
<Wolland>
cool
<ra4king>
"rbenv version" now reports "2.1.2" not "system"
<ra4king>
that was weird
gruz0[russia] has quit [Client Quit]
<Wolland>
you can also set it as your default ruby using "global"
stantona has quit [Remote host closed the connection]
<ra4king>
how so?
<Wolland>
$ rbenv global 1.8.7-p352
gruz0[russia] has joined #ruby
<Wolland>
Sets the global version of Ruby to be used in all shells by writing the version name to the ~/.rbenv/version file. This version can be overridden by an application-specific .ruby-version file, or by setting the RBENV_VERSION environment variable.
<happytux_>
shevy: ah
<ra4king>
thanks
<Wolland>
np
gruz0[russia] has quit [Client Quit]
<ra4king>
alright so 'gem install rails' completed successfully
<Wolland>
:)
<ra4king>
typing 'rails' gives me command not found of course
TorpedoSkyline has joined #ruby
gruz0[russia] has joined #ruby
<ra4king>
Wolland: how do you add a shim to rbenv?
<ra4king>
'rails' exists in the versions/2.1.2/bin folder
* ra4king
copies one of the shims and renames it to 'rails'
<ra4king>
Wolland: hell yeah that worked
<Wolland>
:)
<ra4king>
I have smarts
gruz0[russia] has quit [Client Quit]
Xeago has quit [Remote host closed the connection]
gruz0[russia] has joined #ruby
oo_ has quit [Remote host closed the connection]
Shidash has quit [Ping timeout: 240 seconds]
vikfroberg has joined #ruby
gruz0[russia] has quit [Client Quit]
<ra4king>
hell yeah, rails new <path> worked
gruz0[russia] has joined #ruby
bradhe has quit [Ping timeout: 240 seconds]
mehlah has quit [Read error: Connection reset by peer]
mijicd has quit [Quit: leaving]
Nahra has quit [Remote host closed the connection]
gruz0[russia] has quit [Client Quit]
mehlah has joined #ruby
garndt has quit [Quit: Connection closed for inactivity]
toertore has joined #ruby
gruz0[russia] has joined #ruby
geggam_ has joined #ruby
gruz0[russia] has quit [Client Quit]
geggam has quit [Disconnected by services]
geggam_ is now known as geggam
toretore has quit [Ping timeout: 252 seconds]
gruz0[russia] has joined #ruby
<vikfroberg>
TDD: I’m testing a class which reads a file, finds strings and return an array of the strings. Should I create the file in a before block, use a string to mock the file or create a file manually and comitting it to the repository?
frobrob has quit [Quit: ...]
qwyeth has joined #ruby
Nahra has joined #ruby
gruz0[russia] has quit [Client Quit]
qwyeth has quit [Max SendQ exceeded]
gruz0[russia] has joined #ruby
qwyeth has joined #ruby
spastorino has quit [Quit: Connection closed for inactivity]
qwyeth has quit [Max SendQ exceeded]
gruz0[russia] has quit [Client Quit]
<ra4king>
wow building therubyracer is taking quite a while
gruz0[russia] has joined #ruby
ndrei has quit [Ping timeout: 240 seconds]
sunya7a has quit [Ping timeout: 240 seconds]
garndt has joined #ruby
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gruz0[russia] has quit [Client Quit]
ddv has quit [Ping timeout: 245 seconds]
gruz0[russia] has joined #ruby
<ra4king>
oh wow that was v8 taking forever to build
tectonic has quit []
<ra4king>
no surprise
chipotle has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
gruz0[russia] has quit [Client Quit]
qwyeth has joined #ruby
sdwrage has joined #ruby
yubrew has joined #ruby
shiggity__ has quit [Quit: shiggity__]
maletor has quit [Quit: Computer has gone to sleep.]
sunya7a has joined #ruby
tectonic has joined #ruby
tyfighter has quit [Quit: <3]
Shidash1 has quit [Ping timeout: 252 seconds]
ddv has joined #ruby
ffranz has quit [Ping timeout: 252 seconds]
yubrew has quit [Ping timeout: 240 seconds]
pwh has joined #ruby
chrishough has quit [Quit: chrishough]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
synfin has joined #ruby
omosoj has quit [Ping timeout: 265 seconds]
datafirm has joined #ruby
predator117 has quit [Ping timeout: 252 seconds]
lw has joined #ruby
ti-wali has quit [Read error: Connection reset by peer]
maximski has quit []
arya_ has joined #ruby
aspires has quit []
sunya7a has quit [Ping timeout: 252 seconds]
tectonic has quit []
Lucky_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shiggity__ has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
Channel6 has joined #ruby
Mon_Ouie has quit [Ping timeout: 260 seconds]
mikecmpbll has joined #ruby
dorei has quit []
oorst has joined #ruby
tectonic has joined #ruby
TorpedoSkyline has joined #ruby
haoke0905 has quit [Quit: Leaving]
tectonic has quit [Client Quit]
mikepack_ has joined #ruby
ponga has joined #ruby
yetanotherdave has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Client Quit]
tectonic has joined #ruby
omosoj has joined #ruby
jkline has quit [Quit: jkline]
sdwrage has joined #ruby
tectonic has quit [Client Quit]
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mikepack has quit [Ping timeout: 276 seconds]
mikepack_ has quit [Ping timeout: 252 seconds]
sdouglas has joined #ruby
shiggity__ has quit [Quit: shiggity__]
lethe has joined #ruby
vikfroberg has quit [Quit: vikfroberg]
oorst has quit [Quit: oorst]
Kricir has quit [Remote host closed the connection]
Nahra has quit [Remote host closed the connection]
b1205 has joined #ruby
lw has quit [Quit: s]
chipotle has quit [Quit: cya]
tectonic has joined #ruby
Nahra has joined #ruby
tectonic has quit [Client Quit]
<shevy>
dumdedum
<wallerdev>
LA LA LA
<ponga>
yayaya
<oddalot>
*fart*
<oddalot>
wasn't me
sdouglas has quit [Remote host closed the connection]
sdouglas has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
TorpedoSkyline has joined #ruby
<shevy>
lol
pwh_ has joined #ruby
bradhe has joined #ruby
sdouglas has quit [Ping timeout: 252 seconds]
brunops has quit [Quit: leaving]
<ra4king>
#ruby everybody
<ra4king>
that was a typical conversation
GriffinHeart has joined #ruby
centrx has joined #ruby
Lucky_ has joined #ruby
TorpedoSkyline has quit [Client Quit]
pwh has quit [Ping timeout: 260 seconds]
sdwrage has joined #ruby
<shevy>
now now now
<ponga>
shevy
<shevy>
typically people have a question
<shevy>
ponga are you into bboying?
<ponga>
does ruby have library for empty window, a button, text field, etc
<shevy>
well, ruby stdlib has bindings to tk
<shevy>
matz wrote them years ago
<shevy>
I never used them
<ponga>
sorry what's tk
The_NetZ has joined #ruby
<shevy>
there are also bindings/wrappers to the crappy (n)curses
<timgauthier>
hey what was that command that is like present? but it prints out the value if it exsists?
<shevy>
ponga, to use tk + ruby, you need to have tcl/tk available on your system; then in the ruby directory, in ext/tk you can compile the bindings, or you simply download binaries from your distribution
ra4king has quit [Remote host closed the connection]
infinitone_ has joined #ruby
oorst has quit [Quit: oorst]
infinitone_ has quit [Remote host closed the connection]
infinitone has quit [Remote host closed the connection]
wallerdev has joined #ruby
benzrf|offline is now known as benzrf
phansch has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
tectonic has joined #ruby
blackgoat_ has joined #ruby
Wolland has quit [Remote host closed the connection]
agent_white has quit [Ping timeout: 265 seconds]
blackgoat_ has quit [Client Quit]
sdouglas has quit [Remote host closed the connection]
Wolland has joined #ruby
Fire-Dragon-DoL has quit [Quit: Leaving.]
bradhe has joined #ruby
Burgestrand has quit [Quit: Burgestrand]
havenwood has quit [Remote host closed the connection]
chipotle has joined #ruby
GriffinHeart has joined #ruby
yetanotherdave has joined #ruby
yetanotherdave has quit [Client Quit]
aspiers_ has quit [Ping timeout: 264 seconds]
Wolland has quit [Ping timeout: 252 seconds]
SOLID000 has quit [Quit: Leaving]
snath has joined #ruby
aspiers_ has joined #ruby
User458764 has joined #ruby
bradhe has quit [Ping timeout: 265 seconds]
Burgestrand has joined #ruby
lw has quit [Quit: s]
toastynerd has joined #ruby
GriffinHeart has quit [Ping timeout: 265 seconds]
Kricir has joined #ruby
xeno has quit [Ping timeout: 240 seconds]
mordocai has quit [Ping timeout: 240 seconds]
vinleod has quit [Quit: Computer has gone to sleep.]
mercerist has quit [Quit: Computer has gone to sleep.]
toastynerd has quit [Ping timeout: 245 seconds]
tectonic has quit []
tectonic has joined #ruby
robbyoconnor has joined #ruby
tectonic_ has joined #ruby
braincrash has quit [Quit: bye bye]
yfeldblu_ has joined #ruby
chris349 has joined #ruby
<chris349>
I need to run the command bundle install as a particular user, but my bundle is in /root/.rvm/gems/ruby-2.1.1/bin/bundle How can I install this in the correct location that is not user-specific (e.g. /usr/local/bin)
shiggity__ has quit [Quit: shiggity__]
yubrew has joined #ruby
mikepack has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 240 seconds]
<Sigma00>
reinstall rvm as that other user
<diegoviola>
chruby ftw
braincrash has joined #ruby
XenoWolf has joined #ruby
yfeldblu_ has quit [Ping timeout: 265 seconds]
Wolland has joined #ruby
Nahra has quit [Remote host closed the connection]
Wolland has quit [Remote host closed the connection]
Wolland has joined #ruby
phinfonet has quit []
b1205 has joined #ruby
<chris349>
I think I got it to work with the Multi-User install. But now when I run bundle it says dont run as root, but when I do sudo -u apache /usr/local/rvm/gems/ruby-2.1.1@global/bin/bundle install then I get an error message: /usr/bin/env: ruby_executable_hooks: No such file or directory
yubrew has quit [Ping timeout: 252 seconds]
<The_NetZ>
chris349: you can do a global rvm install
<RubyPanther>
lol those are not mangos
<chris349>
So what would be the correct way to run bundle install as not-root?
Kricir has quit [Remote host closed the connection]
tectonic_ has quit []
<RubyPanther>
chris349: Normally with apache you have per-project users that own the ruby install, and that is the user it runs the web app as. That way the web app has less/different permissions than the web server
predator117 has quit [Ping timeout: 252 seconds]
<chris349>
RubyPanther, I really dont want to get into complicating things. I am just trying to get this running through apache in the simplest manner possible.
arya_ has quit [Ping timeout: 240 seconds]
Nahra has joined #ruby
Beoran_ has quit [Ping timeout: 264 seconds]
b1205 has quit [Ping timeout: 276 seconds]
lw has joined #ruby
sdrew has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Kricir has joined #ruby
<poka>
rvm probably has some way to setup the env properly for stuff it installed. or bundle exec
<poka>
i haven't RTFM'd any of that stuff though. export GEM_HOME=$HOME/.gem && bundle install then the normal require works
ixti has quit [Ping timeout: 240 seconds]
<poka>
you're also goign to want to add $HOME/.gem/bin to PATH or so
eka has quit [Quit: My computer has gone to sleep. ZZZzzz…]
tacos1de has quit [Ping timeout: 272 seconds]
Burgestrand has quit [Quit: Burgestrand]
<chris349>
The commands all work as root but not as user apache. Is there a better way to run the code through apache other than rvm + passenger?
tacos1de has joined #ruby
<abstrakt>
chris349, yes there is a better way than using apache, it's called nginx :P
<poka>
nginx behaves kidn of oddly wrt more obscure corners of rFC2616
<Sigma00>
poka: did you do a multi-user rvm install?
<Sigma00>
what you've shown makes me believe you did a single-user install under the root user
<poka>
no idea. but i run my webserver as a normal user with eveyrthing in ~/ behind apache or nginx
shiggity__ has joined #ruby
<abstrakt>
poka, not sure how that matters if you're just using the proxy of nginx
<poka>
no i exported GEM_HOME to $HOME/.gem and that's all you need to do
<abstrakt>
which incidentally is 10x > than apache's proxy module
<poka>
'gem install', 'bundle install' etc will put everything in ~/
<chris349>
Sigma00, Does that pass the HTTP header REMOTE_USER?
<Sigma00>
did you mis-tab?
<pipework>
Well they didn't miss-stab!
brunops has joined #ruby
Beoran_ has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
chrishough has quit [Quit: chrishough]
<Sigma00>
DO YOU MISS MISS TAB?
<RubyPanther>
chris349: IMO the simplest manner is whatever is the normal way the locals run it
b1205 has joined #ruby
<chris349>
I follow the instructions to install rvm ruby for all users, but when I do gem install bundle it is placing it in: /root/.rvm/gems/ruby-2.1.1/bin/bundle
<chris349>
for e.g. the gem binary is in /usr/local/rvm/rubies/ruby-2.1.1/bin/gem
Kricir has quit [Remote host closed the connection]
amclain has joined #ruby
<chris349>
RubyPanther, How can I find out what is the "normal way"
<Sigma00>
look at rvm website
tectonic_ has joined #ruby
<chris349>
rvm is installed as system-wide. However, it is not installing the gem for system-wide usage.
brunops has quit [Disconnected by services]
sdrew has joined #ruby
brunops has joined #ruby
oorst has joined #ruby
<Sigma00>
maybe you didn't do a multi-user install, but a mixed mode install
Kricir has joined #ruby
Loaft has joined #ruby
<Sigma00>
anyhow, I prefer rbenv over rvm
<Sigma00>
bundler is what should deal with gemsets, not the ruby manager
User458764_NotHe has quit [Ping timeout: 252 seconds]
<chris349>
What is the correct way to install bundler for system-wide usage? I have /usr/local/rvm/rubies/ruby-2.1.1/bin/gem but when I invoke it to install bundler it installs bundler in /root/
<poka>
even stock debian/arch rubies lately seem to install in user-specifcic dirs now (Even as root)
Arkaniad has joined #ruby
Arkaniad|Laptop has joined #ruby
<poka>
probbaly due to all this rbenv/chruby/rvm/bundler stuff managing paths and exceedingly-rare you'd want a "global" install
oorst has quit [Quit: oorst]
shiggity__ has quit [Quit: shiggity__]
bradhe has quit [Ping timeout: 265 seconds]
b1205 has quit [Ping timeout: 240 seconds]
<chris349>
Would it be recommended instead to manage the paths manually?
<shevy>
real men are superusers
Arkaniad has quit [Read error: Connection reset by peer]
<shevy>
only noobs need bundler
arya_ has joined #ruby
lw has quit [Quit: s]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sdwrage has quit [Quit: This computer has gone to sleep]
<poka>
time to go down LXC/Docker/Container rabbithole, via Chef/Puppet/Ansible via RVM/Bundler/CHRuby
charliesome has joined #ruby
<poka>
involve as many meta-wrapping layers as possible
momomomomo has joined #ruby
mikepack has joined #ruby
<poka>
chris349: do you see /root/.gem/ruby/2.1.0 in 'gem env' ? if so, gem install is probably going to put stuff there
<poka>
so, even as root, you're going to have to RTFM/google your way out of this cute little issue that root no longer affects the entire systems' gem paths
arya__ has joined #ruby
<Sigma00>
or read up on how to use rvm rubies with phusion
<Sigma00>
which I've already linked
<chris349>
The only thing I have with root is: SPEC CACHE DIRECTORY: /root/.gem/specs
<poka>
ok, and 'bundle install' didn't put stuff in : /usr/lib/ruby/gems/2.1.0 ?
arya_ has quit [Ping timeout: 252 seconds]
<poka>
or /var/lib or whateber path gem env is reporting
<chris349>
poka, Bundle install gives the error: Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Kricir has quit [Remote host closed the connection]
<chris349>
I consider this the problem because the web server does not run under root.
yfeldblum has joined #ruby
<poka>
hrm. bundler 1.5.3 lets me run 'bundle install' as root
<poka>
and puts stuff in the systemwide paths
<chris349>
Yes it lets me run it but then says: installing your bundle as root will break this application for all non-root users on this machine
sdwrage has joined #ruby
<poka>
considering you'll likely one day want multiple versions of either ruby or a gem, you might as well sit down now and read up on rvm
sunya7a has joined #ruby
<poka>
honeslty , i have no clue. i install my ruby code with a 2 line shellscript
<poka>
the reason being gems was/is often broken on weird stuff like NEtBSD-MIPS old/random ruby version etc
<poka>
it seems to finally be maturing though. one of these days i'll try to see what all these configuration managers are all about
garndt has quit [Quit: Connection closed for inactivity]
benzrf is now known as benzrf|offline
shiggity__ has joined #ruby
yfeldblum has quit [Remote host closed the connection]
BreakmanX has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alexju_ has joined #ruby
yfeldblum has joined #ruby
amargherio has quit [Read error: Connection reset by peer]
russt has joined #ruby
tectonic_ has quit []
Nahra has quit [Remote host closed the connection]
AlSquire has joined #ruby
<chris349>
Im using the standard x86_64 platform. What changes would need to be made to rvm to permit code to run through a webserver?
<Sigma00>
probably not using rvm
<Sigma00>
or following RVM's guide on using it with phusion...
chipotle has quit [Quit: cya]
<The_NetZ>
so... still having issue with ./configure "checking for sys/time.h... (cached) no"
tectonic_ has joined #ruby
Kricir has joined #ruby
mikepack has quit [Remote host closed the connection]
BreakmanX has joined #ruby
etqqkoiflwhb has joined #ruby
Nahra has joined #ruby
BreakmanX has quit [Client Quit]
phansch has quit [Quit: WeeChat 0.4.3]
rawGem has quit [Ping timeout: 252 seconds]
oo_ has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qwyeth has quit [Remote host closed the connection]
sunya7a_ has joined #ruby
shiggity__ has quit [Quit: shiggity__]
rawGem has joined #ruby
sunya7a has quit [Ping timeout: 252 seconds]
shiggity__ has joined #ruby
newUser1234 has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
iliketurtles has joined #ruby
iliketurtles has quit [Client Quit]
yacks has joined #ruby
jxf has joined #ruby
ghr has joined #ruby
utkarsh_ has quit [Quit: No Ping reply in 180 seconds.]
utkarsh_ has joined #ruby
ptierno has quit [Ping timeout: 252 seconds]
hermanmunster has joined #ruby
ptierno has joined #ruby
havenwood has joined #ruby
Davey has quit [Excess Flood]
iliketurtles has joined #ruby
Kricir has joined #ruby
tectonic_ has quit []
sunya7a has joined #ruby
bradhe has joined #ruby
oo_ has quit [Remote host closed the connection]
sdwrage has quit [Quit: This computer has gone to sleep]
sunya7a_ has quit [Ping timeout: 252 seconds]
eval-in has quit [Remote host closed the connection]
Davey has joined #ruby
eval-in has joined #ruby
GriffinHeart has joined #ruby
tectonic_ has joined #ruby
mikepack has joined #ruby
nanoyak has joined #ruby
sunya7a has quit [Ping timeout: 252 seconds]
bradhe has quit [Ping timeout: 240 seconds]
sunya7a has joined #ruby
AlSquire has quit [Ping timeout: 240 seconds]
Kricir has quit [Remote host closed the connection]
GriffinHeart has quit [Ping timeout: 252 seconds]
lxsameer has joined #ruby
ra4king has joined #ruby
nanoyak has quit [Ping timeout: 252 seconds]
sunya7a_ has joined #ruby
rkrdo has quit []
ndrei has joined #ruby
sunya7a has quit [Ping timeout: 240 seconds]
snath has joined #ruby
HashNuke has quit [Quit: Connection closed for inactivity]
nanoyak has joined #ruby
akonny has joined #ruby
sputnik1_ has joined #ruby
Nahra has quit [Remote host closed the connection]
yubrew has joined #ruby
Kricir has joined #ruby
jaequery has joined #ruby
Nahra has joined #ruby
shiggity__ has quit [Quit: shiggity__]
LexicalScope has joined #ruby
JBreit has joined #ruby
Wolland has quit [Remote host closed the connection]
atmosx_ has quit [Remote host closed the connection]
Wolland has joined #ruby
atmosx_ has joined #ruby
jaequery has quit [Client Quit]
toastynerd has joined #ruby
sdwrage has joined #ruby
treehug88 has joined #ruby
yubrew has quit [Ping timeout: 276 seconds]
sunya7a_ has quit [Ping timeout: 276 seconds]
endash has joined #ruby
nanoyak_ has joined #ruby
nanoyak has quit [Ping timeout: 265 seconds]
Wolland has quit [Ping timeout: 240 seconds]
sputnik13 has quit [Ping timeout: 265 seconds]
toastynerd has quit [Ping timeout: 245 seconds]
tectonic_ has quit []
chrishough has joined #ruby
IceDragon has quit [Quit: Space~~~]
endash has quit [Quit: endash]
gbchaosmaster has joined #ruby
b00stfr3ak has joined #ruby
akonny has quit [Quit: akonny]
sputnik13 has joined #ruby
amclain has quit [Quit: Leaving]
synfin has quit [Quit: leaving]
arya_ has joined #ruby
rickruby has joined #ruby
synfin has joined #ruby
oorst has joined #ruby
arya__ has quit [Ping timeout: 276 seconds]
etqqkoiflwhb has quit [Quit: Computer has gone to sleep.]
treehug88 has quit [Ping timeout: 252 seconds]
etqqkoiflwhb_ has joined #ruby
NukePuppy has quit [Ping timeout: 240 seconds]
predator117 has joined #ruby
shiggity__ has joined #ruby
chris349 has quit [Quit: Leaving]
tectonic_ has joined #ruby
Arkaniad|Laptop has quit [Ping timeout: 260 seconds]
sinkensabe has joined #ruby
Nahra has quit [Remote host closed the connection]
jwang has joined #ruby
katmandoo has quit [Ping timeout: 265 seconds]
bradhe has joined #ruby
sski has joined #ruby
jxf has quit [Ping timeout: 240 seconds]
Nahra has joined #ruby
Shidash has joined #ruby
bradhe has quit [Ping timeout: 240 seconds]
shiggity__ has quit [Quit: shiggity__]
mary5030 has quit [Remote host closed the connection]
predator117 has quit [Ping timeout: 260 seconds]
LexicalScope has quit [Ping timeout: 252 seconds]
<RubyPanther>
The_NetZ: That means you don't have the glibc dev files installed
LiohAu has joined #ruby
<The_NetZ>
RubyPanther: thought I did, I'll have another look though.
kilk_ has joined #ruby
tectonic_ has quit []
sepp2k1 has quit [Read error: Connection reset by peer]
<The_NetZ>
no, seems I have them as mingw-w64-{i686,x86_64}-glib2
Arkaniad|Laptop has joined #ruby
LiohAu has quit [Quit: LiohAu]
jack_rabbit_ has joined #ruby
yubrew has joined #ruby
b00stfr3ak has quit [Ping timeout: 240 seconds]
yubrew has quit [Ping timeout: 276 seconds]
kilk__ has joined #ruby
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
AlexRussia has quit [Ping timeout: 240 seconds]
Jetchisel has quit [Ping timeout: 245 seconds]
pwh has joined #ruby
sputnik1_ has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
sputnik1_ has joined #ruby
eval-in has quit [Remote host closed the connection]
tectonic_ has joined #ruby
eval-in has joined #ruby
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
<poka>
autohell gets more hellish inside mingw/on-win32
<poka>
but maybe try INCLUDE_DIR= type overrides
Channel6 has quit [Quit: Leaving]
sputnik1_ has quit [Ping timeout: 252 seconds]
yacks has quit [Ping timeout: 240 seconds]
<The_NetZ>
poka: hrm. I tried passing -I/path/to/sys and no joy, but I'll see about that. should that go in the configure step or the make step?
oorst has quit [Quit: oorst]
arrubin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
predator117 has joined #ruby
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
Nahra has quit [Remote host closed the connection]
oorst has joined #ruby
duncannz has quit [Ping timeout: 252 seconds]
tectonic_ has quit []
arya_ has quit [Quit: sayonara ^_^]
jack_rabbit_ is now known as jack_rabbit
arya_ has joined #ruby
<The_NetZ>
this is driving me bonkers :/
sdwrage has quit [Quit: This computer has gone to sleep]
bluOxigen has joined #ruby
Nahra has joined #ruby
oorst has quit [Quit: oorst]
petertretyakov has joined #ruby
petertretyakov has quit [Client Quit]
arya_ has quit [Ping timeout: 240 seconds]
emsilva has quit [Quit: Keep walking]
<poka>
ive compiled ruby on MinGW, but it was 2001
<poka>
./configure --help | grep -i include
<RubyPanther>
The_NetZ: glib is part of gtk, you need glibc
<poka>
also don't add path/to/sys if it's looking for sys/time.h. shulold be -I/c/usr/include or so
DeadManGonzo has left #ruby [#ruby]
<RubyPanther>
for example on fedora it is part of the package glibc-headers
<poka>
also it makes things a lot easier if you insgtall mingw + msys right to /c or /c/usr and then add that to $PATH in start->Controlpanel->system->advanced->environment, so that start->run rxvt works right and finds bash, etc. then the environment's closer to sane
<The_NetZ>
hrm. poka yeah I know.
<poka>
worst case i guess you can manually add to INCLUDE= or whatever in the Makefile
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
<The_NetZ>
poka: I've got my msys2 root at C:\msys64; I don't change variables in windows itself, my startup script sets most of it.
<The_NetZ>
RubyPanther: glibc, rhm.
caveat- has quit [Ping timeout: 265 seconds]
<poka>
also pkg-config tended to not always exist. or PKG_CONFIG_PATH. so make sure those both work
<The_NetZ>
oh they work fine
<The_NetZ>
RubyPanther: exactly why does one need glibc in this case? sys/time.h does exist on my system.
<RubyPanther>
The_NetZ: That is where it comes from, it is a header from glibc
<poka>
is /usr/include/sys/time.h doesn't exist, that's bad
<poka>
unless you're on NixOS and it's in /nix/09298374928739q38475394875394857345/usr/include/sys/time.h
<The_NetZ>
that's ugly :/
tectonic_ has joined #ruby
<poka>
wait, can you run nixos inside mingw?
<poka>
it's really a lot simpler to get off MinGW, but you know that too. im just throwing out obvious ideas
Dingus has joined #ruby
noop has joined #ruby
<The_NetZ>
sys/time.h exists in /mingw64/x86_64-w64-mingw32/include (and the 32bit version too) and belongs to the mingw-w64-$ARCH-headers-git package
<poka>
ok
bradhe has joined #ruby
<poka>
so something like ./confiugure --include-dir=/mingw64/x86_64-w64-mingw32/include should hopefully work
<The_NetZ>
RubyPanther: I don't suppose you could throw up time.h somewhere so I can diff it?
sinkensabe has quit [Remote host closed the connection]
<The_NetZ>
poka: ok, gimme a sec
<poka>
sometimes configure launches subscripts that don't thread thru vars, so an environment variable would be preferabe
<poka>
s/vars/args
sinkensabe has joined #ruby
<poka>
eg, ruby builds miniruby or something, then reruns configure for each thing in ext/ or something
yacks has joined #ruby
raposa has joined #ruby
GriffinHeart has joined #ruby
<The_NetZ>
yeah, I was wondering about the miniruby googled it up
<The_NetZ>
another thing, the irb I produce on mingw has absolutely no prompt
Kricir has quit [Remote host closed the connection]
stephenmac7 has quit [Quit: No Ping reply in 180 seconds.]
stephenmac7 has joined #ruby
tectonic_ has joined #ruby
<The_NetZ>
Hanmac: I'll stick to retroarch
<The_NetZ>
also, info on fiddle please? I'm getting irked at having gem install foo bitch about it XD
<abstrakt>
because there's so much similarity between cygwin and virtualbox that they're worth comparing?
<abstrakt>
oh right, they're not
Nahra has quit [Remote host closed the connection]
yubrew has quit [Ping timeout: 260 seconds]
<abstrakt>
The_NetZ, get off of windows if you want to do ruby dev
<abstrakt>
it's the only sane thing to do
blueOxigen has joined #ruby
<abstrakt>
osx or *nix are the only rational options for ruby dev
x1337807x has joined #ruby
<abstrakt>
The_NetZ, run a VM if need be
<poka>
stop being an ass. let him try!
<abstrakt>
i'm not being an ass, I'm speaking the truth
<poka>
he'll get frusted enough to go full-on ARchLinux/Gentoo within hours anyways
<abstrakt>
oh, gotcha, ok mum's the word then
<The_NetZ>
abstrakt: you were not here earlier, so I'll restate. I'm primarily an arch user, I just have to support windows
<poka>
so cygwin emulates syscalls, and virtualbox emulates a CPU? theyre both on the spectrum of emulation
klaut has joined #ruby
bluOxigen has quit [Ping timeout: 265 seconds]
<abstrakt>
The_NetZ, ahh, then I'm truly sorry and please accept my condolences
<The_NetZ>
hehe
<abstrakt>
poka, not even close to the same spectrum
The_NetZ is now known as ntzrmtthihu777
<poka>
SFU is hilarious. aka INTERIX
<ntzrmtthihu777>
wrong nick anyways, gotta fiddle with hexchat a bit more
<ntzrmtthihu777>
yeah, its kinda cool but kinda sucky
<poka>
it's so oldschool and broken that it's insane MSFT could suggest anyone use it
<poka>
uh. maybe your AIX app from 1987 compiles on it after tons of fixesa?
<abstrakt>
I thought SFU was dead long ago
<ntzrmtthihu777>
which is why they killed it in win8
<abstrakt>
who from microsoft is suggesting it?
<ntzrmtthihu777>
abstrakt: nah, you can use it on win7 ultimate
<abstrakt>
ntzrmtthihu777, well lots of projects long ago since abandoned still run
<abstrakt>
that's not the point
<ntzrmtthihu777>
though the community site that did all the porting is long dead.
<abstrakt>
yeh that's more what I'm getting at
anaeem1 has joined #ruby
<ntzrmtthihu777>
yeah.
<ntzrmtthihu777>
msys2, though, I feel could become incredibly useful for *nix stuff on windows
<abstrakt>
except that it's literally just a stripped down cygwin
<abstrakt>
so, not really
<abstrakt>
or at least not likely
Nahra has joined #ruby
klaut has quit [Ping timeout: 240 seconds]
absolutezeroff has quit [Remote host closed the connection]
<ntzrmtthihu777>
abstrakt: its a bit more than that. I'm talking msys2, not msys. they're a similar codebase, yes, but there are differences.
<abstrakt>
not enough to make either one a realistic or major contender for "usable *nix emulation" on windows
<ntzrmtthihu777>
one, has a ported pacman from arch, and the accompanying makepkg program. you can compile msys packages, or native windows binaries via makepkg-mingw
<abstrakt>
I mean if you're satisfied with ls and cd, then maybe they make the grade
<ntzrmtthihu777>
I mean for making stuff that can be released to non-msys/cygwin'd machines for use.
JokerDoomWork has joined #ruby
LexicalScope has joined #ruby
<poka>
and it's so scrubar it's messing up basic /usr/include issues, which does't bode well for more complex scenarios
<poka>
did you try --include not --include-dir to see if it helped?
<poka>
and did you get a dry-run of ruby fully building w/o that make-pkg wrapper thing?
* poka
kinda wants to install Win8.1 to mess with it
MrDoctor has joined #ruby
jackneill has joined #ruby
benlieb has joined #ruby
timonv has joined #ruby
<abstrakt>
poka, what's there to mess with? it's windows, it sucks a little more than the last version but not as bad as everyone says
<ntzrmtthihu777>
poka: I can dry run it, if you like. and I ran configure --help and just grepped for include, and all I saw was the cflags bit and the --includedir flag
<abstrakt>
what else would you like to know?
<ntzrmtthihu777>
when the fuck will M$ get posix?!
comma8 is now known as consider8
<momomomomo>
anyone on the west coast around to time a response for me?
consider8 is now known as comma8
mikesplain has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<comma8>
momomomomo, what can I do?
<momomomomo>
I'll send you a message
mikepack has quit [Remote host closed the connection]
roelof_ has joined #ruby
<roelof_>
Is there a way I can convert "one" to the number 1 so I can use it to add numbers
kilk_ has quit [Quit: kilk_]
kilk_ has joined #ruby
<roelof_>
Im trying to understand currying
skaflem has joined #ruby
<abstrakt>
roelof_, I believe you want #haskell
zz_karupa is now known as karupa
<ntzrmtthihu777>
hrm
<ntzrmtthihu777>
so anyone else really dislike this cmake thing?
<roelof_>
abstrakt: why ?? this is a exercise I found on a ruby site
rm__ has quit [Remote host closed the connection]
rm_ has joined #ruby
<abstrakt>
roelof_, most notably because that's where the term for this originates
<roelof_>
oke
<abstrakt>
learning haskell is like eating your spinach, it's good for you
<abstrakt>
even if you never use haskell again
<roelof_>
but its really a ruby problem that is why I asked here
<abstrakt>
it's really a general problem, you happen to be using ruby
<ph88>
yes ok i agree, ruby under windows kind of sucks :P
<banisterone>
Hey guys
<ph88>
hey
Dr3amc0d3r|away has quit [Ping timeout: 240 seconds]
<banisterone>
What's up
in7rude has quit [Remote host closed the connection]
<centrx>
ph88, You can open windows inside vim and switch between them
<canton7>
nah, you're just failing to find any windows text editor which suits your needs, without you having to do any work at all to customise them :P
Eyes has quit [Remote host closed the connection]
<canton7>
nothing to do with ruby
BreakmanX has quit [Client Quit]
BreakmanX has joined #ruby
chipotle has quit [Client Quit]
Eyes has joined #ruby
Eyes has quit [Read error: Connection reset by peer]
BreakmanX has quit [Excess Flood]
<The_NetZ>
centrx: msys2 will get you a good *nix system including vim :P
nszceta has quit [Read error: Connection reset by peer]
BreakmanX has joined #ruby
Eyes has joined #ruby
BreakmanX has quit [Excess Flood]
<canton7>
if you're using git, you get all of that for free :)
nszceta has joined #ruby
nszceta has quit [Client Quit]
BreakmanX has joined #ruby
BreakmanX has quit [Excess Flood]
sunya7a has joined #ruby
<ph88>
SciTE is nicer
enebo has joined #ruby
* ph88
uninstalling vim
b00stfr3ak has quit [Ping timeout: 252 seconds]
* centrx
uninstalling windows
yeticry has quit [Ping timeout: 240 seconds]
yubrew has joined #ruby
mordof1 is now known as mordof
yeticry has joined #ruby
krz has joined #ruby
<The_NetZ>
yeah, but msys2 has an excellent package manager and build system
akonny_ has joined #ruby
yubrew has quit [Ping timeout: 245 seconds]
akonny has quit [Ping timeout: 240 seconds]
akonny_ is now known as akonny
Eyes has quit [Quit: Leaving]
<ph88>
guys, komodo edit on windows is also really good ..
<ph88>
just a bit heavy on the download, but that's ok
Eyes has joined #ruby
<centrx>
The_NetZ, big improvement over cygwin?
<mordof>
o/ hola peoples
WillAmes has joined #ruby
<mordof>
ph88: i prefer sublime text over anything else
<The_NetZ>
centrx: I like to think so :P
* mordof
does development on windows
<The_NetZ>
centrx: its ported from arch linux, pacman and makepkg
<The_NetZ>
writing buildscripts for makepkg is very simple compared to other distro's packaging systems.
<centrx>
I see
<centrx>
and I thought Arch Linux was only good for its wiki!
<shevy>
lol
<shevy>
hey mordof
<shevy>
what happened the last 2 weeks
<The_NetZ>
centrx: writing a PKGBUILD is very easy, just a few functions wrapping the normal ./configure make make install steps
<jheg>
o/
sunya7a has quit [Ping timeout: 252 seconds]
<jheg>
I'm just doing some basic tutorials that ask you to write a program that takes a number from the user and puts if its 0-50, 51-100 or above 100
<jheg>
I wrote it as a method and then puts the_method(gets.chomp.to_i)
<shevy>
ok did you already find out how you can get user input jheg
<shevy>
well
<shevy>
you should assign to a variable
<jheg>
it worked no problem but the solution suggested just running a conditional on the variable
<The_NetZ>
it works with other build systems as well, such as cmake and so on. its just a glorified bash script
sunya7a has joined #ruby
<shevy>
the_method(i = gets.chomp.to_i)
<shevy>
jheg did you solve the problem? if so then it does not matter if you use other solutions right?
<centrx>
shevy, That is some funky code
Fire-Dragon-DoL has joined #ruby
<shevy>
not my code!
<jheg>
yeah it solved the problem shevy but it left me confused when to use a method and when to just run a conditional
<shevy>
simple
<shevy>
use methods
spastorino has joined #ruby
<shevy>
solved
<jheg>
is it a case of if I need to reuse the code stick it in a method?
<shevy>
no
<shevy>
always use a method
<jheg>
ok thanks
<shevy>
you get more options when you have a method as opposed to when you don't
<centrx>
>> flog(shevy)
<eval-in>
centrx => undefined local variable or method `shevy' for main:Object (NameError) ... (https://eval.in/159695)
<shevy>
because you can load the file without having to run the method
<jheg>
i'll post up my answer and the tutorials answer just to check I got that right
mijicd has joined #ruby
<shevy>
but if you write code into a .rb file without any method, then it is run the moment you require it
<shevy>
centrx writing too much php code as of late, aren't ya
<jheg>
whats the name of the site where I can share code snippets?
<centrx>
In PHP, everything can be a string
<centrx>
gist.github.com
<shevy>
pastie.org
<jheg>
ta
<shevy>
the saddest thing about php is
<shevy>
that ruby can not be more popular than php
<ponga>
can i ask sth shevy
<shevy>
ponga only if you did 5 pushups before
<ponga>
sorry
dangerousdave has quit [Read error: Connection reset by peer]
<ponga>
if i had to pushup everytime i ask question on ruby, i'd be a health trainer
<banisterone>
Ponga and a very beautiful woman.
sdouglas has joined #ruby
<shevy>
live a healthy live
<shevy>
and of course I myself don't do anything like that
<ponga>
that's just your personal desire banisterone
* centrx
thought ponga was a very beautiful man
<ponga>
i am a beautiful man
<centrx>
hah
sunya7a has quit [Ping timeout: 240 seconds]
<shevy>
ponga what was your question btw?
<centrx>
jheg, Generally we put everything inside a class or at least a method when programming
The_NetZ has quit [Quit: Leaving]
<ponga>
shevy is the purpose of rails to use ruby as serverside lang like PHP
<shevy>
hmm
<centrx>
jheg, Ruby is certainly useful for straight procedural scripts that just run some code in a file without object-oriented classes, so that is the use case
toastynerd has joined #ruby
<shevy>
ponga might be better to ask a rails guru on #rubyonrails - I think rails back then made MVC pattern popular; I don't think ruby and php 1:1 are fully on equal levels as to when someone wants to write we-related stuff, and rails enforces a certain paradigm that you don't have 1:1 with plain php alone
<shevy>
*web-related
<ponga>
actually that was perfect answer to my question shevy
<movedx_>
Hello. In Rails (sorry, I can't seem to find a dedicated channel), how do I manage multiple migration files? So with 'rails g scaffold ...' I get TIMESTAMP_file.rb migration files. If I then change the models, say add associations, what's the best method of me then changing the migration files so 'rake db:migrate' works on the new changes?
<ponga>
i didn't want guru-answer anyway
<movedx_>
A rubyonrails OK
<Nowaker>
think shell script, write ruby script
<movedx_>
I'll ask in there.
in7rude has joined #ruby
<shevy>
what I do know is that the technical university of vienna uses rails for the student pages, and it is actually a website with great usability once you can login
movedx_ is now known as movedx
movedx has quit [Changing host]
movedx has joined #ruby
sdouglas has quit [Ping timeout: 240 seconds]
<shevy>
(they use different software packages sadly; they have an older perl site which is just awful to use)
etqqkoiflwhb_ has quit [Read error: Connection reset by peer]
<ponga>
shevy i know rails kinda introduced new way of doing web app development
<ponga>
and your answer was quite good enough
kidoz has joined #ruby
<shevy>
rails and then as rack combination also seemed to kill some smaller webframeworks
<shevy>
like ramaze
<csmrfx>
I guess ultimately the point of rails is to provide orm
<shevy>
people seem more likely to use sinatra rather than ramaze for lightweight stuff
ferr has joined #ruby
<csmrfx>
or, provide ORMed web framework with scaffolding and all the plugins you can throw at the web with bells and whistles
varius has joined #ruby
<jheg>
centrx: thanks I'm at very early stages of learning :)
garndt has joined #ruby
<ponga>
shevy i only learnt ruby but is rails capable of creating web game with javascript?
ti-wali has joined #ruby
<ponga>
i always thought it was server-side thingi..
krazh has quit [Remote host closed the connection]
krazh has joined #ruby
<ponga>
my question is kinda silly, maybe im not sobber now
<csmrfx>
rails is a web framework
Nahra has quit [Remote host closed the connection]
<csmrfx>
while it may include some plugins with javascript capability
<shevy>
ponga in theory yes
<csmrfx>
it is aimed at server side developement
<csmrfx>
but then suddenly, you realize you wanted #rubyonrails or similar
<ponga>
i know it could do something like twitter
<ponga>
can i develop html5 game on it
<csmrfx>
unless you know intimately its structure and components, you are just making generalizations
lethe has quit [Remote host closed the connection]
omosoj has joined #ruby
<Morrolan>
shevy: Whether it can be found by looking in directories which are part of the PATH, I presume.
<Morrolan>
Or are you talking about searching via the package manager? That one obviously keeps an index of its own.
Nahra has quit [Remote host closed the connection]
zz_karupa has joined #ruby
<shevy>
so they don't have any idea about the real file situation at hand but must rely on the package manager providing this information to them?
andrewjanssen has joined #ruby
<Morrolan>
I feel like I'm lacking some context. :D
OffTheRails has joined #ruby
<shevy>
so if a file is removed by a user, the package manager won't notice that
zz_karupa is now known as karupa
<shevy>
Morrolan well for instance
<Morrolan>
It probably will show a warning, if it tries to modify the package, and some files aren't present anymore.
<shevy>
Morrolan say you wish to compile program A, but program A has many dependencies
lewix has quit [Remote host closed the connection]
<Morrolan>
Uhu.
<shevy>
now obviously you may wish to install or compile these dependences but not the dependencies that are already available on the system
<shevy>
I face the latter as a problem right now
<omosoj>
hey guys, i have a sql database and i want to create a class that i can use to query the database (like Info.number.color returns the color of a number)
<Morrolan>
omosoj: Try out the various Ruby ORMs.
<Morrolan>
omosoj: e.g. DataMapper and ActiveRecord
<Morrolan>
shevy: Right, I'm with you, so far.
<omosoj>
Morrolan, thanks. i was planning to use activerecord. is it a difficult task?
<Morrolan>
Can you create the database from scratch, or do you have to work with a predefined schema?
s3ri0us has joined #ruby
<shevy>
one script I have does something like this: "compile htop --with-missing-dependencies"
<omosoj>
predefined schema
<shevy>
so questions that should be answered are: "is ncurses installed: if yes, continue with htop, if no, install ncurses first"
eshy has joined #ruby
<Morrolan>
Then I recommend DataMapper - it has some great features which make it very easy to work with legacy schemas.
cibs has joined #ruby
<Morrolan>
ActiveRecord might have those, too, but I've never used them.
<omosoj>
thank you. are there any recognized tutorials on this?
jtz has quit [Quit: WeeChat 0.4.3]
eka has joined #ruby
Robbo` has joined #ruby
<Morrolan>
I'd just play with DataMapper a bit, for a day. After that, its docs on working with legacy schemas should make for a reasonable starting point: http://datamapper.org/docs/legacy.html
<omosoj>
k, thank you.
Nahra has joined #ruby
<Morrolan>
They have an IRC channel of their own as well, I think.
<Morrolan>
#datamapper, probably.
<omosoj>
awesome, thanks
<Morrolan>
shevy: Rather than attempting to find out which dependencies are installed already, how about installing as many dependencies as possible via the package manager, then installing the others manually?
ferr has quit [Quit: Leaving.]
nszceta has joined #ruby
<Morrolan>
I.e. have your script issue a few `aptitude install` commands first.
sdouglas has joined #ruby
heftig has joined #ruby
<shevy>
nono
<shevy>
you misunderstand me
<shevy>
I was giving debian just as example
<shevy>
I more mean the general strategy
<shevy>
so `aptitude` or any other distribution specific ways are not possible
pwh has quit []
jtz has joined #ruby
<shevy>
I think if all these strategies rely on packages that registered themselves via a package manager somewhere, then this is a very simple solution, though not a very intelligent one
Robbo` has quit [Ping timeout: 252 seconds]
timonv has quit [Remote host closed the connection]
<shevy>
I guess I will have to write some scripts to determine automatically what is available and installed and what is not, regardless of any package manager
<Morrolan>
There's probably no Linux-wide way to find out whether a certain dependency is installed. Most will follow FHS, but there's bound to be some who don't. Then you've got naming differences, and god knows what else. ^^
timonv has joined #ruby
Eyes has quit [Quit: Leaving]
Eyes has joined #ruby
rawGem has quit [Ping timeout: 240 seconds]
sdouglas has quit [Ping timeout: 260 seconds]
Dr3amc0d3r|away has joined #ruby
<shevy>
hmm
<shevy>
well the naming differences should apply only for packages, not for installed libraries or? libX11.so will always be called libX11.so
Eyes has quit [Remote host closed the connection]
nszceta has quit []
<Morrolan>
Oh, yea.
lewix has joined #ruby
rkrdo has joined #ruby
timonv has quit [Ping timeout: 252 seconds]
toastynerd has quit [Ping timeout: 252 seconds]
bradhe has joined #ruby
Jetchisel has joined #ruby
shiggity__ has joined #ruby
Robbo` has joined #ruby
andrewjanssen has quit [Quit: Leaving...]
TorpedoSkyline has joined #ruby
b00stfr3ak has joined #ruby
bradhe has quit [Ping timeout: 245 seconds]
GriffinHeart has joined #ruby
lw has joined #ruby
arrubin has joined #ruby
GriffinHeart has quit [Ping timeout: 240 seconds]
m8 has joined #ruby
sheperson has joined #ruby
<DefV>
/3
Zamerick has joined #ruby
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chipotle has joined #ruby
Hobogrammer has joined #ruby
anaeem___ has joined #ruby
yubrew has joined #ruby
TorpedoSkyline has joined #ruby
Channel6 has quit [Quit: Leaving]
LexicalScope has joined #ruby
OffTheRails has quit [Remote host closed the connection]
etqqkoiflwhb_ has joined #ruby
nvmme_ has joined #ruby
TorpedoSkyline has quit [Client Quit]
anaeem1_ has quit [Ping timeout: 245 seconds]
Zamerick has quit [Read error: Connection reset by peer]
sunya7a has joined #ruby
yubrew has quit [Ping timeout: 252 seconds]
absolutezeroff has joined #ruby
TorpedoSkyline has joined #ruby
Nahra has quit [Ping timeout: 252 seconds]
sdouglas has joined #ruby
jottr has joined #ruby
TorpedoSkyline has quit [Client Quit]
LadyRainicorn has quit [Quit: Bye]
Notte has quit [Remote host closed the connection]
maximski has quit []
TorpedoSkyline has joined #ruby
Nahra has joined #ruby
Notte has joined #ruby
<omosoj>
is there a way to access information within a class without instantiating the class?
oo_ has joined #ruby
<ari-_-e>
omosoj: like what?
<omosoj>
i'm writing a class to query a database. i want to be able to get a list of all the names of the entries of a table so that the user knows what to instantiate.
<omosoj>
(does that make sense?)
Eyes has joined #ruby
<ari-_-e>
not really :-/
<Morrolan>
Instance variables belong the the instance. No instance, no class.
<Morrolan>
Err, no instance, no instance variable*
<Morrolan>
But ORMs often use class methods + variables.
<omosoj>
so it's impossible to call a class method without instantiating it?
<omosoj>
gah, not sure i used 'class method' correctly.
<Morrolan>
Calling class methods is possible without an instance of the class.
<shevy>
not only that you have to type 'optparse' to require it, and the class name is OptionParser
<shevy>
now, you also have constructs like:
<shevy>
end.parse! ARGV
<shevy>
what
<shevy>
the
<shevy>
fuck
b1205 has quit [Ping timeout: 240 seconds]
LexicalScope has joined #ruby
sdouglas has joined #ruby
<csmrfx>
erm, ok
yubrew has quit [Ping timeout: 240 seconds]
lethe has quit [Ping timeout: 240 seconds]
b1205 has joined #ruby
sski has quit [Ping timeout: 252 seconds]
Jetchisel has quit [Quit: "Unfortunately time is always against us" -- *Morpheus*]
LadyRainicorn has quit [Ping timeout: 240 seconds]
IRLeif has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sdouglas has quit [Remote host closed the connection]
<shevy>
if I have a huge case when menu
<shevy>
should we rather check on 'strings' or against :symbols inside?
<shevy>
case i
<shevy>
when 'foo','faa','ble'
<shevy>
vs
<shevy>
case i
<shevy>
when :foo,:faa,:ble
chrishough has joined #ruby
edwardly has joined #ruby
Royalb15_1 has joined #ruby
CodeBunny has joined #ruby
sdouglas has joined #ruby
maestrojed has joined #ruby
lw has quit [Quit: s]
Royalb15 has quit [Ping timeout: 240 seconds]
Leif has joined #ruby
sheperson has quit [Ping timeout: 265 seconds]
sheperson has joined #ruby
sheperson has quit [Client Quit]
sdouglas has quit [Remote host closed the connection]
<ari-_-e>
shevy: what type is i?
nvmme_ has quit [Quit: leaving]
<shevy>
any
<shevy>
:-)
<shevy>
I need to convert it into either string or symbol before checking anyway
<ari-_-e>
I'd say use whatever type i is
<shevy>
well I need to decide inside the case menu
<shevy>
I couldn't quite have:
<shevy>
when 'foo',:foo
benzrf|offline is now known as benzrf
nectarys has joined #ruby
yfeldblum has joined #ruby
kirun has quit [Remote host closed the connection]
Cache_Money has joined #ruby
<shevy>
perhaps I should benchmark it
baroquebobcat has joined #ruby
banisterone has joined #ruby
kirun has joined #ruby
<ari-_-e>
shevy: it can be the same thing as a string or symbol?
mikesplain has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
omosoj has quit [Ping timeout: 240 seconds]
<shevy>
yeah, it can be used in any way; it's basically a main loop for user input, but can also be used programmatically from code via :symbols as input
<banisterone>
ari-_-e: shevy is an unusual dude
maximski has joined #ruby
stantona has quit [Remote host closed the connection]
<ari-_-e>
shevy: I'd advise that you separate out the user input handling
b1205 has quit [Ping timeout: 252 seconds]
stantona has joined #ruby
yfeldblum has quit [Ping timeout: 276 seconds]
snath has quit [Ping timeout: 265 seconds]
<ari-_-e>
is there a reason these operations can't be methods?
b1205 has joined #ruby
chipotle has quit [Quit: cya]
<shevy>
hmm?
<shevy>
of course methods are called
chipotle has joined #ruby
<shevy>
anyway, I benchmarked, symbols are significantly faster so that has decided it
<ari-_-e>
why do you need to programmatically use your input handling then? can't you just call the methods?
IcyDragon has joined #ruby
mary5030 has joined #ruby
IceDragon has quit [Ping timeout: 240 seconds]
<shevy>
how do you mean?
maestrojed has quit [Quit: Computer has gone to sleep.]
jackneill has quit [Quit: jackneill]
<ari-_-e>
can you paste the code?
benzrf is now known as benzrf|offline
stantona has quit [Ping timeout: 252 seconds]
mr_rich101 has quit [Ping timeout: 240 seconds]
treehug88 has quit []
fisted__ has joined #ruby
fisted__ has quit [Remote host closed the connection]
shiggity__ has joined #ruby
Lulzon has quit [Ping timeout: 264 seconds]
Takle has quit [Remote host closed the connection]
<ari-_-e>
shevy: so if you wanted to display contacts in your code, you would call handle_input('display_contacts') ?
<ari-_-e>
or
<ari-_-e>
handle_input(:display_contacts)
b1205 has joined #ruby
<shevy>
ari-_-e no, of course I would just call the method display_contacts
<shevy>
that is all part of the user input menu
maestrojed has quit [Client Quit]
<shevy>
the main question is whether one should use strings or symbols in such a situation
<ari-_-e>
I'm confused why you'd want to use the user input handling programmatically then
Rainicorn is now known as LadyRainicorn
omosoj has joined #ruby
<omosoj>
is there a preferred ordering of methods within a class? should initialize always go first? should class methods go first?
timonv has joined #ruby
<shevy>
it already is used and it's all working fine
<shevy>
omosoj yeah I think initialize should usually be the first method
<shevy>
omosoj I group class methods after initialize methods
banisterone has quit [Read error: Connection reset by peer]
<omosoj>
shevy, cool that's what i just did.
banisterone has joined #ruby
jackneill has joined #ruby
mercerist has joined #ruby
b1205 has quit [Ping timeout: 252 seconds]
timonv has quit [Ping timeout: 252 seconds]
rkrdo_ has joined #ruby
bradhe has joined #ruby
rkrdo_ has quit []
caveat- has quit [Ping timeout: 260 seconds]
rkrdo has joined #ruby
sleepee has joined #ruby
danshultz has quit [Remote host closed the connection]
LadyRainicorn has quit [Ping timeout: 260 seconds]
dilated_dinosaur has quit [Ping timeout: 252 seconds]
danshultz has joined #ruby
katmandoo has joined #ruby
<shevy>
I think it is time for me to revamp my old ruby-gnome collection
bradhe has quit [Ping timeout: 240 seconds]
LadyRainicorn has joined #ruby
caveat- has joined #ruby
danshultz has quit [Ping timeout: 240 seconds]
<shevy>
several hundred .rb files :(
<csmrfx>
which ruby
saarinen has joined #ruby
<ari-_-e>
/usr/bin/ruby
<ari-_-e>
/usr/bin/ruby
gaboesquivel has quit [Remote host closed the connection]
<csmrfx>
hehe
Nahra has quit [Remote host closed the connection]
<csmrfx>
I mean: shevy, which ruby version were those developed on?
nectarys has quit [Ping timeout: 260 seconds]
gaboesquivel has joined #ruby
<shevy>
1.8.7
Xeago has quit [Remote host closed the connection]
<shevy>
many things have been removed from ruby-gnome too
<pipework>
shevy is all about ancient ruby.
<shevy>
:(
jackneill has quit [Ping timeout: 240 seconds]
<shevy>
well, at least the new examples in ruby-gnome work
Takle has joined #ruby
varius has quit [Remote host closed the connection]
jackneill has joined #ruby
mehlah has joined #ruby
gaboesquivel has quit [Ping timeout: 240 seconds]
caveat- has quit [Ping timeout: 252 seconds]
yubrew has joined #ruby
saarinen has quit [Quit: saarinen]
fisted__ has joined #ruby
yfeldblum has joined #ruby
[42] has quit [Ping timeout: 260 seconds]
[42] has joined #ruby
dilated_dinosaur has joined #ruby
<omosoj>
does string interpolation not work with instance variables?
Eyes has quit [Read error: Connection reset by peer]
caveat- has joined #ruby
<ari-_-e>
omosoj: it does
<ari-_-e>
of course
<ari-_-e>
you can interpolate any expression
Eyes has joined #ruby
<omosoj>
ok, that's what i thought. hmm
<Morrolan>
I write my whole program in an internpoalted string, and eval it. :)
<Morrolan>
s/np/p/
<ari-_-e>
omosoj: what have you tried?
Burgestrand has joined #ruby
Nahra has joined #ruby
<omosoj>
@client.query("select value from factbook_values where countryid = #{@id} and fieldid = #{@fields["population"]}")
yubrew has quit [Ping timeout: 260 seconds]
<omosoj>
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 (Mysql2::Error)
Eyes has quit [Client Quit]
<Morrolan>
What's the query it's trying to execute?
brunops has joined #ruby
<ari-_-e>
omosoj: ooh, well you have another problem them
Zamerick has joined #ruby
<ari-_-e>
omosoj: don't directly substitute things into sql queries
Eyes has joined #ruby
<shevy>
omosoj I would recommend you build the whole string before you pass it into .query()
<Morrolan>
Also, if those values are untrusted, you might want to use SQL escaping.
<Morrolan>
Bah, I'm slow.
<ari-_-e>
omosoj: that's how you expose yourself to sql injections
<shevy>
omosoj most likely it is a wrongful ' character
<omosoj>
whoa, interesting
<rkrdo>
yeah, it should be @fields['population']
<omosoj>
rkrdo, still doesn't work.
onewheelskyward has joined #ruby
<ari-_-e>
omosoj: can you check what the actual query winds up being?
<atmosx>
anyone has experience with sinatra and translations? that are in savedin yml saves?
<ari-_-e>
it'll probably be obvious once you see it
<rkrdo>
omosoj: and what does "select value from factbook_values where countryid = #{@id} and fieldid = #{@fields["population"]}" evaluate to?
maestrojed has joined #ruby
onewheelskyward has left #ruby ["["Textual IRC Client: www.textualapp.com"]"]
<omosoj>
good call ari. heh. here's the problem
<omosoj>
elect value from factbook_values where countryid = #<Mysql2::Result:0x8430a28> and fieldid = 29
Takle has quit [Remote host closed the connection]
ta has quit [Quit: Leaving...]
<omosoj>
i'll fix that. how do i avoid sql injections? should i build the string before hand or use escaping?
<ari-_-e>
omosoj: use a parameterized query or a query builder
<ari-_-e>
those will both do the escaping for you
<omosoj>
ok, thanks. thanks everyone!
Takle has joined #ruby
freggles has quit [Remote host closed the connection]
Lucky_ has joined #ruby
Lucky_ has quit [Client Quit]
caveat- has quit [Ping timeout: 240 seconds]
freggles has joined #ruby
varius has joined #ruby
maestrojed has quit [Quit: Computer has gone to sleep.]
JBreit has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
caveat- has joined #ruby
auxbuss has joined #ruby
Takle has quit [Remote host closed the connection]
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
LadyRainicorn has quit [Ping timeout: 276 seconds]
echevemaster has joined #ruby
heda has joined #ruby
b1205 has joined #ruby
lewix has quit [Remote host closed the connection]
ghr has quit [Read error: Connection reset by peer]
Royalb15_1 has quit [Quit: Leaving]
ghr has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
dangerou_ has joined #ruby
fisted__0 has joined #ruby
benlieb has joined #ruby
Royalb15 has joined #ruby
nvmme has quit [Ping timeout: 252 seconds]
hamakn_ has quit [Remote host closed the connection]
hamakn has joined #ruby
fisted__ has quit [Ping timeout: 252 seconds]
fisted__0 has quit [Client Quit]
momomomomo has joined #ruby
eka has quit [Quit: My computer has gone to sleep. ZZZzzz…]
JokerDoomWork has quit [Ping timeout: 265 seconds]
atraylen has quit [Ping timeout: 252 seconds]
sunya7a has joined #ruby
pietr0 has joined #ruby
mary5030 has quit [Remote host closed the connection]
TorpedoSkyline has joined #ruby
dangerou_ has quit [Read error: Connection reset by peer]
mrrob has joined #ruby
<shevy>
dumdedum
caveat- has quit [Ping timeout: 260 seconds]
dangerousdave has joined #ruby
sdegutis has joined #ruby
mary5030 has joined #ruby
<sdegutis>
What's a reasonable way to interpret command line arguments as a command with its own arguments (some optional) in such a way that if you skip some, you don't just see raw exceptions?
<stevesmename>
I want to monitor file changes on a linux system (crud). I see Listen.to() function might be able to do this, https://github.com/guard/listen. In the usage example I am curious how to update the Listen.to('directory/path', 'other/directory')? Is there a way to make the directories a variable and not lose changes while file changes are being made?
<centrx>
stevesmename, It looks like rb-inotify is another one with active development
<ari-_-e>
omosoj: yup, looks good
<centrx>
stevesmename, If performance is a concern, using the built-in Linux inotify system should be significantly faster.
<centrx>
(through rb-inotify or something else)
<centrx>
stevesmename, Listen looks like it may have a lot more features
<ari-_-e>
omosoj: you can use an ORM or a query builder or something like that - it's up to you
<ari-_-e>
you should at least do a parameterized query though
<stevesmename>
centrx, thanks inotify has been something I have been reading a lot on today. just hesitant on which program language to write within (ruby, python, Go)
<centrx>
stevesmename, It looks like Listen may actually use rb-inotify internally if it is on a Linux system
<ari-_-e>
ugh, does mysql2 only have that escape function?
akonny has quit [Quit: akonny]
<centrx>
stevesmename, Those are all good languages. Ruby is of course the best.
rkrdo has left #ruby [#ruby]
lethe has quit [Ping timeout: 260 seconds]
<gruz0[russia]>
centrx, +1
<gruz0[russia]>
:-)
<stevesmename>
:)
<omosoj>
don't know
yubrew has quit [Ping timeout: 252 seconds]
<omosoj>
how would active record improve the script?
thisirs has quit [Remote host closed the connection]
thisirs has joined #ruby
<centrx>
omosoj, An ORM will handle escaping for you. On the other hand, it might be a detour if your program is mostly finished or is just an experiment.
KLVTZ has joined #ruby
<centrx>
omosoj, Your gists seem to have disappeared or something...
<ari-_-e>
mysql2 claims to be a "modern" mysql library
<ari-_-e>
what a joke
<omosoj>
centrx, yes i deleted it. can repost if you want
<ari-_-e>
I guess it's just a binding
<centrx>
omosoj, But from what I remember, your query would turn into something like this: Facebook.where(potato: potato).where(other_thing: that_thing)
thisirs has quit [Remote host closed the connection]
<centrx>
and you can chain on further things onto the query
<centrx>
So it makes for a more concise style that is similar to the object-oriented style of the programming, instead of basically inserting a completely different programming language.
<omosoj>
ok, cool.
<centrx>
It has a lot more features as well depending on what you are doing.
<centrx>
Your current code is a huge security vulnerability if either @id or fields comes from user input
<omosoj>
ok. would AR take care of that?
<centrx>
Yes
<centrx>
The advantage of using Sequel over ActiveRecord is it is more lightweight and is not Railsy
<omosoj>
ok, i'll switch it over at some point. any other comments on the overall structure?
<omosoj>
i see
<ari-_-e>
omosoj: any sql library which lets you pass in parameters in a special way will escape them for you
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ari-_-e>
avoiding sql injections is really important
<omosoj>
k. this isn't for public (yet) but i should probably learn how to do it most securely.
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<centrx>
omosoj, structure looks good. A lot of these methods become unnecessary for you to implement with an ORM
<atmosx>
guys you use the 'Date' format in SQL databases or just string?
pen has quit []
<centrx>
omosoj, @fields should be a constant in the class, FIELDS, not an instance variable
auxbuss has joined #ruby
Nahra has quit [Remote host closed the connection]
<omosoj>
should i push the content of fields into the database?
<centrx>
That's another option yes
<omosoj>
so i can search by the method calls instead of correlating them to numbers then searching the database with numbers
<centrx>
omosoj, Why do you have this fields mapping in the first place? Do these names/numbers come from somewhere else?
<omosoj>
but not a huge deal?
sdwrage has joined #ruby
akonny has joined #ruby
reactormonk has quit [Ping timeout: 252 seconds]
<omosoj>
yeah... i don't own the database so it will be updated by someone else and i'll be able to download it.
<omosoj>
eerr... for example. population, in the database is "Population"
<omosoj>
internet_users is Total Internet Users, or something
<centrx>
omosoj, Putting the fields in the database allows fields changes to be made without changing the code
<Nilium>
Oh neat, mruby is a register machine
adantj has quit [Ping timeout: 245 seconds]
markalanevans has joined #ruby
nvmme has quit [Ping timeout: 252 seconds]
<ari-_-e>
[0..-1] is just all of them, isn't it?
gaboesquivel has joined #ruby
<markalanevans>
Hey guys, how do i check to see if an instance of an object has an attribute?
<n_blownapart>
hi your favorite math algorithem paste . still seeking help on this thanks: http://pastie.org/9262589
<Nilium>
Must read more mruby source code..
toastynerd has quit [Ping timeout: 245 seconds]
<ari-_-e>
markalanevans: respond_to?
<markalanevans>
checking
<ari-_-e>
markalanevans: attributes are just methods
<Nilium>
n_blownapart: Doing Project Euler?
Hobogrammer has quit [Ping timeout: 252 seconds]
Takle has joined #ruby
shiggity__ has joined #ruby
<n_blownapart>
yes sir/maam
echevemaster has quit [Remote host closed the connection]
tiguser has quit [Ping timeout: 265 seconds]
<Nilium>
I'd say I prefer madam but then people might get the wrong idea when they find out I'm a guy.
abstrakt has quit [Quit: Leaving]
<n_blownapart>
Nilium: how about wench?
<ari-_-e>
on the internet you can be whatever you want
onewheelskyward has joined #ruby
nvmme_ has quit [Quit: leaving]
<n_blownapart>
ari-_-e: !!
<ari-_-e>
uh oh
<ari-_-e>
I've been spotted
<Nilium>
No, I'd definitely prefer madam.
<n_blownapart>
ari-_-e: that's right youre in trouble.
<ari-_-e>
have I been a very bad boy?
Takle_ has joined #ruby
Takle has quit [Read error: Connection reset by peer]
<n_blownapart>
ari-_-e: hey I knew that to change the puts statement would change the output, but I still don't why the inject/ each_with_object hashes wouldn't 'finish'. no you're nice.
<n_blownapart>
know *
LadyRainicorn has quit [Read error: Connection reset by peer]
Rainicorn has joined #ruby
<n_blownapart>
ari-_-e: i.e. why those methods return the hash built up and then just stopped at the last k/v pair.
<ari-_-e>
n_blownapart: you couldn't tell what they were returning
<ari-_-e>
you weren't capturing the return value
<n_blownapart>
ari-_-e: is the return value actually the last (complete) hash, or the last k/v pair?
nvmme has joined #ruby
<ari-_-e>
n_blownapart: paste the code again
<n_blownapart>
ok
pwh has joined #ruby
<centrx>
coooodddddeeee
<omosoj>
centrx, thank you.
<n_blownapart>
http://pastie.org/9269123 I kept the puts statement on the same incorrect line for our purposes. ari-_-e
radiofrequency has joined #ruby
timonv has joined #ruby
<markalanevans>
tnd ari-_-e that worked perfectly!
<n_blownapart>
so in terms of program flow ... the hash populates and suddenly jumps to the puts statement before nearly complete. this is the trouble.
<ari-_-e>
n_blownapart: you changed the indentation
mnemon has quit [Remote host closed the connection]
radiofrequency has quit [Quit: radiofrequency]
LexicalScope has joined #ruby
ferr has joined #ruby
<n_blownapart>
ok centrx I understand that code. And I understand that having the puts statement prior to line 17 *could* cause a problem. but why doesn't the last k/v print along with the rest of those incrementing hashes?
<n_blownapart>
ari-_-e: ^
saltsa has quit [Ping timeout: 240 seconds]
peterhu has quit [Ping timeout: 240 seconds]
shiggity__ has joined #ruby
<ari-_-e>
n_blownapart: i = 0; puts i; i = 5;
mnemon has joined #ruby
<ari-_-e>
what does that code print?
jottr_ has joined #ruby
adantj has quit [Ping timeout: 252 seconds]
saltsa has joined #ruby
yubrew has joined #ruby
<n_blownapart>
0
benzrf|offline is now known as benzrf
peterhu has joined #ruby
<ari-_-e>
n_blownapart: x = {}; puts x; x['abc'] = 'Abc'
<ari-_-e>
what does that code print?
<n_blownapart>
but line 17 is busily working on the hashes, and the control suddenly moves back to print. it seems abitrary...why not on the second hash ?
<n_blownapart>
ari-_-e: one sec
maximski has quit []
<ari-_-e>
n_blownapart: you're not just running these in irb or whatever are you?
jottr has quit [Ping timeout: 252 seconds]
<ari-_-e>
n_blownapart: I don't know what you mean
<ari-_-e>
control suddenly moves back?
timmow has joined #ruby
<n_blownapart>
sorry I would really like to continue but I need 5 mins.
nvmme has quit [Quit: leaving]
yubrew has quit [Ping timeout: 276 seconds]
<ari-_-e>
n_blownapart: in "i = 0; puts i; i = 5;" does i get set to 5?
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
<n_blownapart>
ari-_-e: yes zero is overwritten and is 5
thiagofm has quit [Read error: Connection reset by peer]
thiagofm1 has joined #ruby
<ari-_-e>
you already said yes, but doesn't that imply that the program does NOT stop?
<ari-_-e>
not at the puts, anyway?
russt has joined #ruby
<Sigma00>
what are you guys arguing about?
<n_blownapart>
ari-_-e: ok the program doesn't stop, so the last pair is not printed along with the other 6 incrementing hashes. why does ruby not 'finish' building the hash. ie. why can't the puts statement be put anywhere in the block?
<ari-_-e>
n_blownapart: it can
<ari-_-e>
you can put the puts wherever you want
<n_blownapart>
but the results differ.
<ari-_-e>
yes
<ari-_-e>
because things happen in order
<ari-_-e>
the interpreter reads your program
<ari-_-e>
it sees the first expression
<ari-_-e>
it executes it
<ari-_-e>
it sees the second expression
<ari-_-e>
it executes it
<ari-_-e>
etc
spastorino has quit [Quit: Connection closed for inactivity]
<ari-_-e>
you CHANGE transformed in that block
<ari-_-e>
so it is DIFFERENT in different places in the block
kirun has quit [Quit: Client exiting]
<ari-_-e>
Sigma00: I'm really not sure
<n_blownapart>
Sigma00: not an argument this guy is like boddhisattva
<Sigma00>
is it the pastebin? the thing that ends with "this is ignored" ?
<n_blownapart>
yeah
<Sigma00>
it's not ignored, each doesn't return anything
duncannz has joined #ruby
<Sigma00>
you create a string and do nothing with it
<Sigma00>
each_with_object returns the object
<ari-_-e>
each_with_object does return something
<Sigma00>
it doesn't care what you do in the block, it will return the object
<n_blownapart>
Sigma00: I think for illustration the author wrote 'this is ignored'
<ari-_-e>
but the return value of the blocks are ignored
<Sigma00>
n_blownapart: what's your argument?
<n_blownapart>
Sigma00: I'm a noob asking a question that seems valid to me.
<Sigma00>
on your pastie, removing line 9 would do nothing, because each_with_object returns the object. YOu need to explicitly manipulate the object
<Sigma00>
oh wait that's inject
<Sigma00>
whoops
<n_blownapart>
line 17 builds 7 incrementing hashes if the puts statement is in the right place....
b00stfr3ak has quit [Ping timeout: 260 seconds]
<n_blownapart>
but put the puts statement on line 16, and the hashes printed out number 6
claymore has quit [Quit: Leaving]
<n_blownapart>
ari-_-e: has been very patient, but I don't see why the last k/v pair is not printed...since the method iterates through the first 6 words and capitalizes them.
<Sigma00>
so you're confused as to why changing the place 'puts transformed' is changes the output?
<Sigma00>
it's not printed because you're printing before you add it to the hash
Nahra has quit [Remote host closed the connection]
<Sigma00>
if you'll notice, the first time puts happens it prints an EMPTY hash
dontwork has joined #ruby
dontwork has quit [Client Quit]
<n_blownapart>
ok, thanks I see that, but why does it trail off on the last word, and not on the first? Empty? yeah why is that?
<Sigma00>
because at first, the hash is empty
<Sigma00>
you start with {}
<Sigma00>
you call puts on that which prints
<Sigma00>
"{}"
<Sigma00>
then you do transformed[word] = "four".capitalize
<Sigma00>
which adds "four" => "Four" to the hash, giving you {"four" => "Four"}
<Sigma00>
and you print that
<Sigma00>
on the next run
TheCuban has quit []
<Sigma00>
you're completely new to programming, right?
<Sigma00>
I suggest you manually follow the program and write down the outputs for each command
<Sigma00>
it should help you understand
dc has quit [Remote host closed the connection]
<ari-_-e>
I suggested that
<Sigma00>
on each run, you first print the object as it is currently, then you add a new object to the array. This happens for all objects. Naturally this means the last object added won't get printed
<Sigma00>
s/array/hash/
<Sigma00>
I have arrays on my mind
Burgestrand has joined #ruby
<n_blownapart>
Sigma00: so you're referring to the second example, not the 'four score and..' one.
Nahra has joined #ruby
<Sigma00>
yes, the second
enebo has joined #ruby
<Sigma00>
mama died today...
TorpedoSkyline has joined #ruby
<Sigma00>
did you read the docs for inject and each_with_object?
<n_blownapart>
yeah I do understand the block arguments get reversed and the need of transform to be last with inject .. after the puts statement.
Hanmac has quit [Quit: Leaving.]
* Sigma00
nods
<n_blownapart>
there are other distinctions between the two that I don't have a full grip of.
ferr has quit [Quit: Leaving.]
TorpedoSkyline has quit [Client Quit]
decoponio has quit [Quit: Leaving...]
<Sigma00>
inject literally injects the return of the block into the object
<Sigma00>
each_with_object just makes an object available in the block and returns it in the end
<Sigma00>
the thing that worries me is that you don't understand why the last object doesn't print when puts is before the assignment
<Sigma00>
and I don't know how to explain it differently
mary5030 has joined #ruby
akonny has quit [Quit: akonny]
<ari-_-e>
let's simplify this a little
<Sigma00>
to take something ari-_-e was saying earlier, if you write i = 4; puts i; i = 5; i will equal 5 in the end, but what you'll print is '4' because that was the value when you called the command
<ari-_-e>
now the block will be executed once with the value 0
IcyDragon is now known as IceDragon
sinkensabe has quit [Remote host closed the connection]
<n_blownapart>
toertore: ari-_-e Sigma00 look. I deeply appreciate it. Between the code examples and the comment about debugging I will get it. thank you ! Hanmac because is one empty hash returned plus 7 words to be capitalized. but thanks very much !
Notte has quit [Ping timeout: 276 seconds]
oponder has quit []
sinkensabe has joined #ruby
<n_blownapart>
one empty hash is * ^
Hobogrammer_ has quit [Ping timeout: 252 seconds]
dorei has joined #ruby
thiagofm has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]