yfeldblum has quit [Remote host closed the connection]
ddv has quit [Ping timeout: 260 seconds]
wallerdev has joined #ruby-lang
mykoweb has joined #ruby-lang
yfeldblum has joined #ruby-lang
ddv has joined #ruby-lang
pr0ton has joined #ruby-lang
pr0ton has quit [Client Quit]
pr0ton has joined #ruby-lang
Cakey has quit [Ping timeout: 240 seconds]
pr0ton has quit [Client Quit]
<senoralastair>
hi folks. quick question: I'm using puppet and a ruby function to pull some data from an api. There are two hashes I'm requesting, and one of them seems to be missing the [ ] surrounding it (otherwise looks the same as the other one, which works). What's the best way to get this back to being recognised as a hash?
<senoralastair>
working result: [{"host"=>{"name"=>"servername.something",....],
<senoralastair>
broken one {"servername"=>"ipaddress_mgmt"=>"1.2.3.4"},....}
jonathanmarvens has quit [Remote host closed the connection]
kalehv has quit [Remote host closed the connection]
DivineEntity has joined #ruby-lang
lolmaus has quit [Ping timeout: 255 seconds]
kalehv_ has joined #ruby-lang
hahuang65 has joined #ruby-lang
jonathanmarvens has joined #ruby-lang
kalehv_ has quit [Ping timeout: 240 seconds]
ponch_ has joined #ruby-lang
nofxx__ has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 250 seconds]
broadcast has joined #ruby-lang
broadcast has quit [Client Quit]
mistym has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
<centrx>
[] is an Array
shinnya has joined #ruby-lang
isale-eko has joined #ruby-lang
saarinen has quit [Quit: saarinen]
isale-eko has quit [Client Quit]
lolmaus has joined #ruby-lang
rh1n0 has quit [Ping timeout: 240 seconds]
kalehv has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 264 seconds]
kalehv has quit [Ping timeout: 264 seconds]
toastynerd has quit [Remote host closed the connection]
amsi has quit [Quit: Leaving]
toastyne_ has joined #ruby-lang
sarkyniin has joined #ruby-lang
<senoralastair>
centrix: ahh. yeah i just did some testing in irb with xxx.is_a?(Hash) /Array and worked that out! not what I thought. I believe the array is an associative array, which I'm accessing in an each loop with xx["host"]["name"], what do I have to change to get the data out of he hash (that has hashes inside it)? I'm not too clear about this bit
havenwood has quit [Ping timeout: 264 seconds]
havenwood has joined #ruby-lang
<wallerdev>
associative arrays are just hashesh
<wallerdev>
not arrays
<wallerdev>
despite what php might pretend
tkuchiki has joined #ruby-lang
<centrx>
PHP is an abomination and a scourge on the face of the earth.
<senoralastair>
wallerdev: so do I address elements differently between the two? I'm getting hostnames from the first results (with surrounding []), which I'm then using to query ip addresses from the second results (surrounding {} only, with {"servername"=>{"ipaddress_mgmt"=>"1.2.3.4"},...} format, and I'm trying to get these ips out with the $host variable passed in from the first loop, using this bit of inline ruby templating: <% ip.each do|xxx| %><%= xxx[
davispuh has quit [Remote host closed the connection]
jonathanmarvens has quit [Remote host closed the connection]
<senoralastair>
ps I don't know php, but was trying to find out the difference between an array with just elements, and key-value pairs with string keys. I'm pretty new to ruby, and still getting my head around it all
<wallerdev>
would get you 1.2.3.4
jonathanmarvens has joined #ruby-lang
sharpmachine has quit [Remote host closed the connection]
<wallerdev>
the difference is mostly that in arrays you basically have a list of things, you can say get me the 5th item, or the 10th item, etc. with hashes you have things mapped between a key and a value, so you say get me the "servername" item, or get me the "ip" item, instead of asking for a specific item based on its order
<senoralastair>
wallerdev: can I user xxx["$name"][ipaddress_mgmt], using the $name variable passed to it?
yfeldblum has quit [Remote host closed the connection]
<wallerdev>
im not really sure what $name is
<wallerdev>
you didnt mention it in your example at all
araujo has quit [Ping timeout: 245 seconds]
tectonic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<senoralastair>
wallerdev: ah yeah. sorry. $name is meant to be the current servername passed to this loop, that I need to use to pull out the correct element from the hash
<wallerdev>
well im not really sure what templating language you're using where variables starting with dollar are a thing
Miphix has joined #ruby-lang
vincent has joined #ruby-lang
<wallerdev>
in erb itd probably look like <% my_list_of_ips.each do |ip| %> <%= ip["servername"]["ipaddress_mgmt"] %> <% end %>
<senoralastair>
wallerdev: yeah sorry, that's puppet's variable. maybe that's why it's not working, because I'm trying to put the puppet variable into the ruby template line. it's in single quotes, so maybe it's not being interpreted
vincent is now known as Guest18316
kalehv has joined #ruby-lang
<wallerdev>
yeah not sure
<wallerdev>
never used puppet
<senoralastair>
wallerdev: maybe I'll try and use double quotes to see if that interprets the variable correctly. maybe that's why it's saying 'no implicit conversion from nil to integer...'
yfeldblum has joined #ruby-lang
<wallerdev>
yeah
<wallerdev>
>> ary = []; ary[nil]
<wallerdev>
f
<wallerdev>
anyway
<wallerdev>
thats what is probably happening
<wallerdev>
you have an array and are trying to access the nil index
ponch_ has quit [Ping timeout: 240 seconds]
<senoralastair>
wallerdev: ahh. yeah that makes sense. ok i'll give it a shot. but in theory, I'd access a hash with nested elements by hashname[key1][key2], and an array like array[3] ?
vintik has joined #ruby-lang
<wallerdev>
yeah for the most part
<wallerdev>
you can have an array of arrays and access it like ary[3][4]
<senoralastair>
wallerdev: ahh ok. and there can be arrays/hashes nested in each other, can't there?
<senoralastair>
or is it just the 1 type?
<wallerdev>
yeah you can mix and match
<wallerdev>
you can also have integer keys for a hash like {0 => "cool", 1 => "okay", 4 => "blah"}
<senoralastair>
wallerdev: and can you do something like a regex match in the key name?
<senoralastair>
wallerdev: oh right
<wallerdev>
but if you say hash[4] its not going to give you the 4th item, its going to give you the item that corresponds to the key 4
<senoralastair>
wallerdev: yeah of course. I'd have to keep that in mind
<wallerdev>
the keys are usually just static keys, the point is usually to look up things based on the exact key which is very quick
<wallerdev>
if you did a regex match against the keys you would have to iterate over every single key and check each one
<senoralastair>
wallerdev: ah ok. that makes sense. Thank you. I've just got to duck out for a bit. back in a little while. Thanks heaps for your help if you're not around when I'm back!
<wallerdev>
later :)
<senoralastair>
wallerdev: cheers
mistym has joined #ruby-lang
bruno- has joined #ruby-lang
bruno- has quit [Ping timeout: 240 seconds]
ponch_ has joined #ruby-lang
Sirupsen has joined #ruby-lang
shinnya has quit [Ping timeout: 240 seconds]
dik_dak has joined #ruby-lang
dik_dak has quit [Client Quit]
dik_dak has joined #ruby-lang
dik_dak has quit [Read error: Connection reset by peer]
toastyne_ has quit [Remote host closed the connection]
saarinen has joined #ruby-lang
ponch_ has quit [Ping timeout: 240 seconds]
wallerdev has quit [Quit: wallerdev]
dik_dak has joined #ruby-lang
dik_dak has quit [Read error: Connection reset by peer]
sduckett has joined #ruby-lang
Cort3z has joined #ruby-lang
pixelhandler has quit [Quit: pixelhandler]
Missphoenix has joined #ruby-lang
Cakey has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
kalehv has quit [Remote host closed the connection]
Cort3z has quit [Ping timeout: 250 seconds]
Miphix has quit [Ping timeout: 256 seconds]
nathanstitt has joined #ruby-lang
wallerdev has joined #ruby-lang
hahuang65 has joined #ruby-lang
apt-get_ has joined #ruby-lang
sarkyniin has quit [Ping timeout: 250 seconds]
_JokerDoom has joined #ruby-lang
tectonic has joined #ruby-lang
JokerDoom has quit [Ping timeout: 250 seconds]
centrx has quit [Quit: Mead error: Connection reset by beer]
centrx has joined #ruby-lang
|jemc| has joined #ruby-lang
centrx has quit [Client Quit]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
karamazov has quit []
monees has joined #ruby-lang
saarinen has quit [Quit: saarinen]
vvikus has quit [Quit: WeeChat 0.4.2]
araujo has joined #ruby-lang
vvikus has joined #ruby-lang
jonathanmarvens has quit [Remote host closed the connection]
vvikus has quit [Quit: WeeChat 0.4.2]
toretore has quit [Quit: This computer has gone to sleep]
sepp2k1 has quit [Read error: Connection reset by peer]
vintik has quit [Remote host closed the connection]
ponch_ has joined #ruby-lang
spuk has quit [Ping timeout: 264 seconds]
ponch_ has quit [Ping timeout: 240 seconds]
spuk has joined #ruby-lang
chouhoulis has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
mistym has quit [Remote host closed the connection]
nathanstitt has quit [Quit: I growing sleepy]
<senoralastair>
hi. I'm back with a quick question (should actually be quick this time). I'm accessing a hash in a ruby erb template, and I have a server hostname as one key I'm after, and it's giving me an error because it's truncating the hostname from server.domain.com to just server. do I have to do something to encapsulate the entire name? (this is in a puppet module with a ruby inline template in case you're wondering)
spastorino has quit [Quit: Connection closed for inactivity]
jonatha__ has joined #ruby-lang
jonathanmarvens has quit [Ping timeout: 264 seconds]
Sirupsen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
monees has quit [Ping timeout: 240 seconds]
gix has quit [Ping timeout: 245 seconds]
sduckett has quit [Ping timeout: 245 seconds]
Cort3z has joined #ruby-lang
gix has joined #ruby-lang
Cort3z has quit [Ping timeout: 240 seconds]
mistym has joined #ruby-lang
saarinen has quit [Read error: Connection reset by peer]
saarinen has joined #ruby-lang
monees has joined #ruby-lang
saarinen has quit [Quit: saarinen]
D9 has quit [Ping timeout: 264 seconds]
hgl has joined #ruby-lang
ponch_ has joined #ruby-lang
strmpnk has quit [Quit: Connection closed for inactivity]
mehlah has quit [Ping timeout: 260 seconds]
vvikus has quit [Ping timeout: 240 seconds]
vvikus has joined #ruby-lang
tkuchiki has quit [Remote host closed the connection]
<senoralastair>
hi. can anyone tell me how to access a hash key name that has dot/periods in it? (I have a server fqdn, like server.domain.com that is the key name I want to extract with). I get an error saying it can't find value for the 'server' part of 'server.domain.com'
tkuchiki has joined #ruby-lang
jonatha__ has quit [Remote host closed the connection]
ponch_ has quit [Ping timeout: 245 seconds]
tectonic has quit []
mehlah has joined #ruby-lang
monees has quit [Remote host closed the connection]
djbkd has quit [Quit: My people need me...]
vvikus has quit [Ping timeout: 264 seconds]
Missphoenix has quit [Quit: Leaving]
Miphix has joined #ruby-lang
vvikus has joined #ruby-lang
bruno- has joined #ruby-lang
bruno- has quit [Ping timeout: 256 seconds]
mykoweb has quit [Remote host closed the connection]
mykoweb has joined #ruby-lang
vintik has joined #ruby-lang
mykoweb has quit [Ping timeout: 240 seconds]
havenn has quit [Remote host closed the connection]
tectonic has joined #ruby-lang
tectonic_ has joined #ruby-lang
yfeldblu_ has joined #ruby-lang
toastynerd has joined #ruby-lang
tectonic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hakunin has joined #ruby-lang
yfeldblum has quit [Ping timeout: 240 seconds]
imperator has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 0.4.3]
yfeldblu_ has quit [Ping timeout: 264 seconds]
Miphix has quit [Quit: Leaving]
Miphix has joined #ruby-lang
kyb3r_ has joined #ruby-lang
alexju has joined #ruby-lang
_ht has joined #ruby-lang
CaptainJet has quit []
apeiros has joined #ruby-lang
jonathanmarvens has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
imperator has quit [Quit: Valete!]
apeiros has quit [Remote host closed the connection]
diegoviola has quit [Remote host closed the connection]
dangerousdave has joined #ruby-lang
Cort3z has joined #ruby-lang
Cort3z has quit [Ping timeout: 250 seconds]
beawesomeinstead has joined #ruby-lang
toastynerd has joined #ruby-lang
yfeldblum has joined #ruby-lang
brianpWins has joined #ruby-lang
woollyams has joined #ruby-lang
apeiros has joined #ruby-lang
Cort3z has joined #ruby-lang
AKASkip has joined #ruby-lang
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has quit [Remote host closed the connection]
hgl_ has joined #ruby-lang
yfeldblum has joined #ruby-lang
hgl_ has quit [Remote host closed the connection]
hgl_ has joined #ruby-lang
gnufied has joined #ruby-lang
hgl has quit [Ping timeout: 260 seconds]
woollyams has quit [Ping timeout: 272 seconds]
woollyams has joined #ruby-lang
tectonic_ has quit []
bruno- has joined #ruby-lang
Cort3z has quit [Ping timeout: 256 seconds]
bruno- has quit [Ping timeout: 240 seconds]
mistym has quit [Remote host closed the connection]
vintik has quit [Remote host closed the connection]
dfranciosi has joined #ruby-lang
woollyams has quit [Ping timeout: 272 seconds]
tbuehlmann has joined #ruby-lang
alexju has quit [Remote host closed the connection]
AKASkip has joined #ruby-lang
mikecmpbll has joined #ruby-lang
solars has joined #ruby-lang
shemerey has joined #ruby-lang
enkristoffer has joined #ruby-lang
arBmind1 has quit [Quit: Leaving.]
vintik_ has joined #ruby-lang
jaimef has quit [Excess Flood]
jaimef has joined #ruby-lang
ironhide_604 has joined #ruby-lang
<ljarvis>
senoralastair: can you show some code?
Technodrome has joined #ruby-lang
<Technodrome>
how can I delete all gems on my system and start over?
woollyams has joined #ruby-lang
TvL2386 has joined #ruby-lang
<ljarvis>
Technodrome: gem list, cut, and xargs?
<Technodrome>
like my rails install and stuff is just so messed up, i woud just like to clear the gems and start over
alexju has joined #ruby-lang
Atttwww has quit [Ping timeout: 256 seconds]
mikecmpbll has quit [Quit: i've nodded off.]
isale-eko has joined #ruby-lang
isale-eko has quit [Client Quit]
arBmind has joined #ruby-lang
mikecmpbll has joined #ruby-lang
francisfish has joined #ruby-lang
dfranciosi has quit [Remote host closed the connection]
isale-eko has joined #ruby-lang
elia has joined #ruby-lang
elia has quit [Client Quit]
yfeldblum has quit [Ping timeout: 256 seconds]
isale-eko has quit [Quit: ChatZilla 0.9.90.1 [Firefox 30.0/20140605174243]]
wallerdev has quit [Quit: wallerdev]
yfeldblum has joined #ruby-lang
enkristoffer has quit [Quit: ❤]
elia has joined #ruby-lang
bruno- has joined #ruby-lang
bruno- has quit [Ping timeout: 240 seconds]
postmodern has quit [Quit: Leaving]
isale-eko has joined #ruby-lang
yfeldblum has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby-lang
achiu1 has joined #ruby-lang
achiu has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby-lang
Cakey has quit [Ping timeout: 240 seconds]
vintik_ has quit [Remote host closed the connection]
bahar has quit [Ping timeout: 240 seconds]
workmad3 has quit [Quit: Reconnecting]
ddv has quit [Changing host]
ddv has joined #ruby-lang
workmad3 has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
jonathanmarvens has quit [Remote host closed the connection]
touzin has joined #ruby-lang
jonathan_alban has joined #ruby-lang
<Silex>
Technodrome: start using rvm
<Technodrome>
i’m using it now
<Technodrome>
and have used it before
<Silex>
ok, then remove the gemset, create it again, and "bundle"
<Technodrome>
was just trying to ake a shortcut
<Silex>
"bundle clean --force" removes all the gems not in your Femfile
<Silex>
Gemfile*
<ljarvis>
rvm D:
hgl_ has quit [Quit: Computer has gone to sleep.]
<Silex>
ljarvis: what alternative do you recommend?
touzin has quit [Ping timeout: 256 seconds]
lolmaus has quit [Ping timeout: 240 seconds]
hgl_ has joined #ruby-lang
hgl_ has quit [Remote host closed the connection]
hgl_ has joined #ruby-lang
lolmaus has joined #ruby-lang
<workmad3>
Silex: I like chruby + ruby-install personally
<Silex>
interesting, thanks
<workmad3>
Silex: mainly because rvm kept on getting in the way of my own ways of ensuring 'bundle exec' was called automatically ;)
<workmad3>
(and rvm has a lot of stuff I don't use 90%+ of the time, and the few times I'd want it I can just hand-roll something... e.g. wrapper scripts)
<Silex>
the "root install" support of ruby-install looks interesting
<workmad3>
Silex: by 'support' do you mean 'defaults the prefix to /opt/rubies rather than $HOME/.rubies'? ;)
<Silex>
ah, no gemsets?
<Silex>
workmad3: yes, I meant that
<workmad3>
Silex: no... I've found 0 use for gemsets since the advent of bundler ;)
<Silex>
well for me gemsets are nice in the sense that each project has its gemset
<Silex>
but I guess it's redundant with the info in the Gemfile
<Silex>
yeah, well I think you made me realise gemsets are not really necessary
<workmad3>
Silex: wouldn't be very difficult to roll your own version either, tbh... especially if you use zsh, so you can write a small function that looks for a '.ruby-gemset' file and set up $GEM_PATH and $GEM_HOME based on that ;)
<workmad3>
Silex: what chruby showed me was that it can actually be stupidly simple to add some of these things in... at least up to the point that I'd want/need them :)
<Silex>
Yeah. I like rvm as a dev, but on the server it's a bit annoying
<Silex>
I'll probably switch to chruby & ruby-install in the future
<workmad3>
Silex: I only use ruby-install on the server, because it's slightly easier than setting up the configure commands myself
<workmad3>
Silex: and then all my scripts set up the appropriate PATH, RUBY_VERSION, etc. variables before launching something
yxhuvud has quit [*.net *.split]
thang has quit [*.net *.split]
pabs has quit [*.net *.split]
hackeron has quit [*.net *.split]
yliu has quit [*.net *.split]
Abuh has quit [*.net *.split]
Authenticator has quit [*.net *.split]
jtoy has quit [*.net *.split]
coffeejunk has quit [*.net *.split]
jhass|off has quit [*.net *.split]
_rgn has quit [*.net *.split]
<workmad3>
(automating the generation of said scripts with chef helps with that approach)
<ljarvis>
Silex: +1 to what workmad3 said, chruby + ruby-install
Miphix has quit [Quit: Leaving]
jhass|off is now known as jhass
<ljarvis>
always been flawless for me, anyway
mnngfltg has joined #ruby-lang
Fushi has joined #ruby-lang
stamina has joined #ruby-lang
<Technodrome>
Silex: i’m not even sure really how bundle works
<workmad3>
Technodrome: at it's basic level, bundler sets up your ruby LOAD_PATH so that it can only see the gems listed in your Gemfile.lock (which contains all gem + version info for all gems in your Gemfile and dependencies)
<workmad3>
s/it's/its
<Technodrome>
i see
<Technodrome>
so the only gems your ruby install can see are ones in the gem file?
<workmad3>
Technodrome: the only gems your bundler-enabled app can see are the ones in its Gemfile
<Technodrome>
yeah
<Technodrome>
whats the disadvantage for allowing it to see all?
<Technodrome>
i understand when moving between projects
<Technodrome>
but why can’t it see whats on the local system? so you odn’t get issues when you move later on?
<workmad3>
Technodrome: mostly, it's because rubygems only allows one version to be loaded at once, and if you use a 'require "whatever" ' it will load the latest possible version
woollyams has quit [Ping timeout: 272 seconds]
<workmad3>
Technodrome: which can cause merry hell with dependency resolution
<workmad3>
Technodrome: it's also so you don't accidentally rely on something you haven't explicitly declared (which can be a problem when deploying or changing machines later on)
hgl has quit [Quit: Computer has gone to sleep.]
cornerma1 has joined #ruby-lang
<Technodrome>
I see yeah
Forgetful_Lion has joined #ruby-lang
<Technodrome>
so when you say you “delete” gems from your budnle what does that mean?
<workmad3>
Technodrome: they're removed from the Gemfile.lock and your app can no longer see them
<Technodrome>
bundle clean --force"
<Technodrome>
what does this do?
<workmad3>
Technodrome: that then removes them from the systemtoo
<workmad3>
*system too
<Technodrome>
i see
<Technodrome>
so it removes them from the gem file + the system?
Mon_Robot has joined #ruby-lang
<workmad3>
Technodrome: well, you'd have already had to remove it from the Gemfile ;)
<Technodrome>
why the system though, what’s the harm of it being on the system?
<Technodrome>
or the rvm gemset etc?
<workmad3>
Technodrome: nothing in dev
ascarter has joined #ruby-lang
<workmad3>
Technodrome: but it could be taking up space you don't want it to in production, or just be useless if you've got a vendored bundle install path
ascarter has quit [Max SendQ exceeded]
cornerman has quit [Ping timeout: 240 seconds]
<workmad3>
Technodrome: e.g. if you've installed with 'bundle install --path vendor/bundle' then 'bundle clean --force' will make sure that path only contains the gems in your bundle
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
hgl has joined #ruby-lang
<Mon_Ouie>
Btw, I just had my bot join here to replace eval-in
jonathan_alban has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jxie has quit [Ping timeout: 255 seconds]
spastorino has joined #ruby-lang
<Technodrome>
workmad3: i see, cool
<Technodrome>
workmad3: again i just sorta “used” the stuff and it always worked
<Technodrome>
never really cared if my gemsets were filled with stuff
<workmad3>
Technodrome: I don't particularly care if I've got old gems on my dev system tbh :)
<workmad3>
Technodrome: but I do care on servers
jonathan_alban has joined #ruby-lang
<Technodrome>
yeah
<Technodrome>
i mean i get it, this is “similar” to virutalenv in python / django but a little different
<workmad3>
yeah, the loading is pretty similar to virtualenv
<workmad3>
the dependency resolution is quite a bit different though
<workmad3>
that's the main thing bundler gives though, IMO... you give it a Gemfile, it tries it's damndest to figure out some set of gems that satisfy all the constraints at once ;)
<workmad3>
gah, why do I keep on typing "it's" instead of "its" today? :(
bruno- has joined #ruby-lang
<Technodrome>
yeah python doesn’t really have dependency stuff like this
<Technodrome>
good old pip
achiu1 has quit [Ping timeout: 250 seconds]
bruno- has quit [Ping timeout: 256 seconds]
<Technodrome>
you can freeze with pip though, that’s kinda cool
achiu1 has joined #ruby-lang
godd2 has quit [Ping timeout: 245 seconds]
<workmad3>
Technodrome: freeze as in specify a fixed version? like with 'gem "foobar", "1.2.3" '?
<Technodrome>
you just get a text file of the dev environemnt, then go and feed that into pip and it will pull in the same versions etc
<workmad3>
Technodrome: ah... that's the Gemfile.lock :P
<Technodrome>
yeah
<Technodrome>
obviously it seems ruby’s dependency stuff is a few levels deeper
yfeldblum has quit [Ping timeout: 245 seconds]
<workmad3>
Technodrome: bundler just does that for you, no matter what because it's a very sensible way to store versions all the time, not just at certain points :)
scmx has joined #ruby-lang
<Technodrome>
i really just prefer everything to be running at it’s newest version available
<Technodrome>
I’m in a transition period right now though, moving from django to rails for all of this type of development
<workmad3>
Technodrome: the dependency stuff I'm talking about is when you have two gems (e.g. Thin and Rails) that depend on a third gem (e.g. Rack)... Thin has a >= 1.0 dependency on rack and Rails has a ~> 1.0 dependency... rack is at 1.4 (for the sake of the example)
<Technodrome>
yeah
<workmad3>
Technodrome: rubygems, and probably pip too, will go 'thin can have rack 1.4, so I'll download that... rails can have 1.0.1, so I'll download that' and then whether it works or not depends on which version of rack loads first
<workmad3>
bundler goes 'rack 1.0.1 will satisfy both rails and thin... so I'll lock to that version and record it'
<Technodrome>
it just loads one though right?
<Technodrome>
ah
<Technodrome>
so bundler handles that automatically
<workmad3>
Technodrome: with normal rubygems, if thin loads first, it would load 1.4... and then rails would blow up
<Technodrome>
ah
<workmad3>
Technodrome: it was exactly that situation in rails 2.3 days that prompted the creation of bundler :)
<Technodrome>
interesting , so people would just force a lower version usually to get it to work with everything?
<workmad3>
pretty much... and that's also why gemsets were created... so you could keep your carefully crafted set of gems that works for project A separate from project B (and also isolated from updates in project B)
<Technodrome>
gemset is that a ruby gems feature?
<Technodrome>
or is that an rvm feature?
<workmad3>
different solutions for the same problem... bundler handles it better IMO though, because it records the final result and allows that to be re-used on other machines, while gemsets require you to handle that propagation of the environment out-of-band
<workmad3>
rvm feature (and also in some other ruby managers as plugins, e.g. chgems)
<Technodrome>
i was going to go with chruby
<Technodrome>
but rvm just seems like the most popular
<workmad3>
I prefer chruby
<workmad3>
it's nice and simple and does the job... I've not had any weird errors since switching to it either :)
<Technodrome>
i will switch myself then!
<Technodrome>
i know its a bit lighter etc
<workmad3>
ruby-install is also nice and simple (written by the same guy), and builds rubies in a sensible manner (relies on dynamic linking a lot more, so you don't need to rebuild ruby when new dependency libraries are released, e.g. updated libyaml)
<workmad3>
hehe, 'bit lighter' :)
marr has joined #ruby-lang
<Technodrome>
yeah the chruby chgem ruby-install seems like the full stack for that solution in that direction
<Technodrome>
then of course the rvm and the rbenv or what not
<workmad3>
I don't bother with chgems personally :)
<Technodrome>
you just run everything in the global gem?
<workmad3>
sure... bundler isolates stuff
<Technodrome>
i see yeah
<Technodrome>
isolates as in , locks a ruby app down to certain versions etc, in reality though the system at that time of execution does have access to the other gems though right?
<workmad3>
if I had a project where I couldn't use bundler, I'd probably add chgems
<Technodrome>
so the true power of bundler is the version control of the gems
<workmad3>
yeah, the app running in bundler's context can only see those gems, other apps can see different gems
<workmad3>
and yes, bundler turns your complete gem dependency graph into something you can version control
<Technodrome>
so when they require the gem they are forced to get htat version , even if a newer is available etc yeah
<Technodrome>
realy nice
<workmad3>
which is an *awesome* power :)
<Technodrome>
rails stuff is so much more interesting and fun than django
<Technodrome>
i’ve known for this years, and always played with rails but , blah shame on me
<workmad3>
(seriously... talk to someone who has had to figure that shit out with maven in java... assuming you can get them to stop drooling and twitching long enough to form sentences)
<Technodrome>
i was a j2ee dev for a long time
<workmad3>
maven
<Technodrome>
maven is much better than not having maven :)
* workmad3
watches Technodrome twitch
<Technodrome>
but i got into spring mvc pretty quick, so its almost like a full stack thing, set it and forget and use etc
<workmad3>
sure... as long as you then set up your pom.xml correctly... and spot when something is pulling in a library provided by your servlet container and you remember to exclude it from the transitive dependencies during packaging...
<workmad3>
etc.
shemerey has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<workmad3>
I had that 'fun' at one point... the errors you get are not easy :)
<Technodrome>
nothing fun about java
<Technodrome>
but
shemerey has joined #ruby-lang
<Technodrome>
i mean , it has a litle bit of everything
<Technodrome>
but ruby has more “fun” and is more of a business advantage than using java where things take longer + it’s not quite as fun :P
jonathan_alban has joined #ruby-lang
isale-eko has quit [Quit: ChatZilla 0.9.90.1 [Firefox 30.0/20140605174243]]
<jonathan_alban>
Hi everyone.
Mon_Robot has quit [Remote host closed the connection]
Mon_Robot has joined #ruby-lang
yfeldblum has joined #ruby-lang
yfeldblum has quit [Ping timeout: 240 seconds]
workmad3 has quit [Quit: leaving]
jonathan_alban has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
railzForDaiz has joined #ruby-lang
kyb3r_ has quit [Quit: Leaving]
jonathan_alban has joined #ruby-lang
railzForDaiz has quit [Client Quit]
scmx has quit [Ping timeout: 264 seconds]
alexju has quit [Remote host closed the connection]
woollyams has joined #ruby-lang
bruno- has joined #ruby-lang
tkuchiki has quit [Ping timeout: 264 seconds]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
toretore has joined #ruby-lang
banisterfiend has joined #ruby-lang
Technodrome has quit [Quit: Technodrome]
tkuchiki has joined #ruby-lang
ldnunes has joined #ruby-lang
Sgeo has quit [Read error: Connection reset by peer]
mehlah has quit [Quit: Leaving...]
Miphix has joined #ruby-lang
yfeldblum has joined #ruby-lang
vondruch has quit [Quit: Ex-Chat]
Mon_Robot has quit [Remote host closed the connection]
kek has joined #ruby-lang
<TvL2386>
I've always wondered what happens with a surrounding block if you call return from within it, does anybody know?
yfeldblum has quit [Ping timeout: 255 seconds]
mehlah has joined #ruby-lang
sonander has quit [Quit: leaving]
Mon_Robot has joined #ruby-lang
Mon_Robot has quit [Remote host closed the connection]
Mon_Robot has joined #ruby-lang
mnngfltg has quit [Remote host closed the connection]
Mon_Robot has quit [Remote host closed the connection]
Mon_Robot has joined #ruby-lang
Technodrome has joined #ruby-lang
workmad3 has joined #ruby-lang
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
imperator has joined #ruby-lang
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
DivineEntity has quit [Quit: Lost terminal]
hgl_ has joined #ruby-lang
hgl has quit [Ping timeout: 245 seconds]
<ljarvis>
TvL2386: try it?
<apeiros>
he actually got answered in #rubyonrails
<apeiros>
and that'd be why:
<ljarvis>
sigh
TvL2386 was kicked from #ruby-lang by apeiros [if you cross-post, announce on all channels where you cross post, that you cross post. thanks. this is a warning-kick only. you're not banned.]
Technodrome has quit [Quit: Technodrome]
hgl__ has joined #ruby-lang
cajone has joined #ruby-lang
hgl_ has quit [Ping timeout: 245 seconds]
yfeldblum has joined #ruby-lang
TvL2386 has joined #ruby-lang
<TvL2386>
I apologize for cross posting
Sirupsen has joined #ruby-lang
yfeldblum has quit [Ping timeout: 255 seconds]
valner has joined #ruby-lang
valner has quit [Client Quit]
valner has joined #ruby-lang
malconis has joined #ruby-lang
bin7me has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sepp2k has joined #ruby-lang
banister has joined #ruby-lang
Forgetful_Lion has quit [Remote host closed the connection]
banister has quit [Client Quit]
valner has quit [Quit: valner]
valner has joined #ruby-lang
davidfrey has joined #ruby-lang
Technodrome has joined #ruby-lang
imperator has quit [Quit: Leaving]
lolmaus has quit [Remote host closed the connection]
vvikus has joined #ruby-lang
TvL2386 has quit [Quit: Ex-Chat]
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
Technodrome has quit [Quit: Technodrome]
Maitiu has joined #ruby-lang
sarkyniin has joined #ruby-lang
banister has joined #ruby-lang
woollyams has quit [Ping timeout: 272 seconds]
sonvu_ae has joined #ruby-lang
<sonvu_ae>
hello
<sonvu_ae>
how do you prefer to both initialize and getter/setter variable in a class?
<apeiros>
sonvu_ae: ?
<apeiros>
use initialize method to initialize. use attr_accessor to define getter/setter
<sonvu_ae>
yeah i mean combine them together
Mon_Robot has quit [Remote host closed the connection]