spider-mario has quit [Remote host closed the connection]
marr has quit [Ping timeout: 256 seconds]
duderonomy has quit [Ping timeout: 250 seconds]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jpfuentes2 has joined #ruby
ismaelga has quit [Remote host closed the connection]
tjbiddle has quit [Quit: tjbiddle]
kies has joined #ruby
Takle has quit [Remote host closed the connection]
shuber_ has quit [Remote host closed the connection]
ismaelga has joined #ruby
kinduff has quit [Quit: brb]
pengin has quit [Remote host closed the connection]
delianides has quit [Remote host closed the connection]
jpfuente_ has joined #ruby
kenndel has quit [Quit: Leaving]
zarubin_ has joined #ruby
keen___________1 has quit [Read error: Connection reset by peer]
BTRE has quit [Quit: Leaving]
BTRE has joined #ruby
delianides has joined #ruby
gambl0re has quit [Ping timeout: 256 seconds]
keen___________1 has joined #ruby
haxrbyte_ has joined #ruby
<Diabolik>
shelling__
<Diabolik>
shevy
<Diabolik>
sorry to be a pain
<Diabolik>
but can you break down how you would modularise this to me
chipotle has joined #ruby
jpfuentes2 has quit [Ping timeout: 272 seconds]
delianides has quit [Remote host closed the connection]
jinie has quit [Ping timeout: 276 seconds]
soulcake has quit [Ping timeout: 276 seconds]
codeFiend has quit [Quit: codeFiend]
felixjet has quit [Quit: Leaving]
zarubin_ has quit [Ping timeout: 276 seconds]
felixjet has joined #ruby
jinie has joined #ruby
haxrbyte has quit [Ping timeout: 276 seconds]
kinduff has joined #ruby
premera has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 258 seconds]
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
soulcake has joined #ruby
balazs has quit [Ping timeout: 265 seconds]
Rennex has quit [Ping timeout: 255 seconds]
Rennex has joined #ruby
shuber_ has joined #ruby
commondream has joined #ruby
MatthewsFace has joined #ruby
irk has quit [Remote host closed the connection]
pengin has joined #ruby
DEA7TH has quit [Ping timeout: 272 seconds]
nobitanobi has quit [Remote host closed the connection]
nobitanobi has joined #ruby
kies has quit [Ping timeout: 245 seconds]
Yzguy has quit [Quit: I'm sleeping, go away.]
tcrypt has quit []
RegulationD has joined #ruby
commondream has quit [Ping timeout: 265 seconds]
oo_ has joined #ruby
ssquare has quit []
moretti has quit [Ping timeout: 272 seconds]
chipotle_ has joined #ruby
chipotle has quit [Ping timeout: 256 seconds]
rodfersou has quit [Remote host closed the connection]
bayed has quit [Quit: Connection closed for inactivity]
commondream has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
SevenWolf has joined #ruby
Peter____ has joined #ruby
PNDPO has joined #ruby
chipotle has joined #ruby
pengin has quit [Remote host closed the connection]
concave has joined #ruby
goodcodeguy has joined #ruby
_seanc_ has quit [Quit: _seanc_]
chipotle_ has quit [Ping timeout: 250 seconds]
davedev24_ has quit []
amclain has joined #ruby
commondream has quit [Remote host closed the connection]
commondream has joined #ruby
pengin has joined #ruby
moretti has joined #ruby
robustus has quit [Ping timeout: 255 seconds]
Agoldfish has quit [Quit: G'Bye]
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
irk has joined #ruby
goodcodeguy has joined #ruby
<shevy>
Diabolik haha I was in bed already... but my brain was too active so I just came back
Vendella has quit [Quit: Leaving]
<shevy>
Diabolik essentially the simplest way may be to put it just in a class
Peter____ has quit []
PNDPO has quit [Quit: Leaving...]
<Diabolik>
ive fixed shit
<Diabolik>
if you want to have a look
<shevy>
the starting method is "initialize", so you can arrange those methods within initialize
commondream has quit [Ping timeout: 246 seconds]
<shevy>
and if you need to store data, you can use @instance_variables; so rather than: foo = 'test', you could use @foo = 'test' (within your class that is)
<shevy>
I don't remember the link Diabolik
robustus has joined #ruby
<Diabolik>
for the greatest program ever written?!
<Diabolik>
is there a more efficient way of doing the prime? function since it isn't efficient
jbomo has joined #ruby
<Diabolik>
mathematically
ValicekB has quit [Ping timeout: 245 seconds]
nobitanobi has quit [Remote host closed the connection]
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
unicode box drawing chars ftw!
mistermocha has quit [Ping timeout: 252 seconds]
<jhass>
require "prime"; Prime.prime? :P
<jhass>
it's shipped with Ruby!
pengin has quit [Remote host closed the connection]
mello has quit [Ping timeout: 272 seconds]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
macmartine has quit []
mistermocha has joined #ruby
tastics has joined #ruby
<shevy>
Diabolik you use ruby
<shevy>
if you wish to write efficient code
<shevy>
use C
<shevy>
also define efficient
<shevy>
the code already does not seem to have any real delays when I run it
podman has quit [Quit: Connection closed for inactivity]
<jhass>
or crystal :P
Brozo has quit [Quit: Leaving...]
longfeet_ has joined #ruby
ValicekB has joined #ruby
nateberkopec has joined #ruby
mistermocha has quit [Ping timeout: 258 seconds]
mistermocha has joined #ruby
<al2o3-cr>
db.execute("insert into aliases (name, desc) values (%s %s)" % [name, desc]) why does this give this @exc: SQLite3::SQLException: near "http": syntax error
mistermocha has quit [Remote host closed the connection]
zreisman has joined #ruby
dfockler has joined #ruby
ravenreborn has joined #ruby
pengin has quit [Remote host closed the connection]
lampshades has joined #ruby
duderonomy has joined #ruby
Takle has joined #ruby
dfockler has quit [Ping timeout: 264 seconds]
moretti has joined #ruby
Takle has quit [Ping timeout: 264 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
troyready has joined #ruby
RegulationD has joined #ruby
<alxndr>
bootstrappm: i've been using dotenv for the dev and test side of a project
zreisman has quit [Remote host closed the connection]
<bootstrappm>
nice alxndr, using it now
<bootstrappm>
as in, I am
<alxndr>
had trouble with it on a newer version of something or other, and ended up creating this shell shortcut which sorta does the same thing if you remember to use it https://github.com/alxndr/dotfiles/commit/7dc0bf35
x44x45x41x4E has joined #ruby
zotherstupidguy has quit [Read error: Connection reset by peer]
<alxndr>
I couldn't decide which i like less: having to remember to preface every mix command with that, or having to remember to source a file in any brand-new terminal which was going to use mix
zotherstupidguy has joined #ruby
Channel6 has quit [Quit: Leaving]
<bootstrappm>
heey thats cool!
<bootstrappm>
check out the zsh plugin that jhass linked, it autosources your .env
<alxndr>
...huh so i've been using that shortcut for the last month, guess i like it better than remembering to source something
RegulationD has quit [Ping timeout: 258 seconds]
codeFiend has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
<alxndr>
that zsh plugin looks pretty nice... will have to try that out.
darkf has joined #ruby
<alxndr>
though with catenv it's kinda nice to have my env file open in one tab, change a var, then in another tab just !!-Enter, don't have to cd out and back in again
<bootstrappm>
I use bash personally but agreed, once I get around to switching to zsh it'll be useful
al2o3-cr has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
Vile` has joined #ruby
DynamicMetaFlow has quit [Remote host closed the connection]
barkerd427 is now known as zz_barkerd427
gmas has quit [Quit: WeeChat 1.1.1]
finisherr has joined #ruby
iamninja has quit [Ping timeout: 255 seconds]
RegulationD has quit [Ping timeout: 256 seconds]
shuber__ has quit [Remote host closed the connection]
hewenhong has joined #ruby
TinkerTyper has joined #ruby
ebonics has quit [Ping timeout: 255 seconds]
vivekananda has quit [Quit: Leaving]
df has joined #ruby
bruno- has joined #ruby
existensil has quit [Quit: WeeChat 0.4.2]
pengin has joined #ruby
finisherr has quit [Quit: finisherr]
lessless has joined #ruby
existensil has joined #ruby
_blizzy_ has quit [Ping timeout: 265 seconds]
ebonics has joined #ruby
bruno- has quit [Ping timeout: 245 seconds]
hewenhong has quit [Remote host closed the connection]
momomomomo has joined #ruby
fu2ristiq has joined #ruby
hewenhong has joined #ruby
pengin has quit [Remote host closed the connection]
mello has joined #ruby
braincrash has quit [Quit: bye bye]
fu2ristiq has quit [Ping timeout: 250 seconds]
Palmer11_ has joined #ruby
Palmer11 has quit [Ping timeout: 246 seconds]
Palmer11_ is now known as Palmer11
lampshades has quit [Quit: lampshades]
mello has quit [Ping timeout: 244 seconds]
pen has joined #ruby
pdoherty has quit [Ping timeout: 264 seconds]
braincrash has joined #ruby
gambl0re has joined #ruby
Limix has quit [Quit: Limix]
<Radar>
If I have a date like this: Date.new(2010, 6, 1) how do I get Ruby to show me all the months that have occurred between that date and the current date?
shuber_ has joined #ruby
baweaver has joined #ruby
Exponential has joined #ruby
duderonomy has quit [Ping timeout: 240 seconds]
shuber_ has quit [Ping timeout: 265 seconds]
cirn0 has quit [Quit: ja]
mrmargolis has quit [Remote host closed the connection]
<pipework>
I don't think it doesn't make sense, I said that it wasn't intuitive.
bronson has quit [Ping timeout: 244 seconds]
<pipework>
The whole set of libraries, really.
<pipework>
I'm just as likely to just be stupid though.
momomomomo has quit [Quit: momomomomo]
Soda has joined #ruby
<baweaver>
pipework: well now is probably the best time to voice that before 3.x
armyriad has quit [Quit: Leaving]
<pipework>
baweaver: I'm not that important, really. It'd have to be someone with a lot more experience in proposals and probably have some contacts.
<baweaver>
A good idea is not constrained by the importance of the person that had it in a good community
<baweaver>
that being said, I'm neutral towards aforementioned ideas regarding DateTime
<pipework>
But it carries more weight faster, and I'd rather not take forever bantering over something as fuzzy as 'intuitiveness' with a bunch of people I've not interacted with before.
SouL_|__ has quit [Read error: Connection reset by peer]
SouL_|_ has joined #ruby
<EllisTAA>
hey all, i’m about to get into activerecord in a week and wanted to get some practice coming up with the database schema, can anyone recommend a resource that teaches you how to understand how to make a database
hewenhong has joined #ruby
balazs has joined #ruby
badhatter has joined #ruby
badhatter has quit [Changing host]
badhatter has joined #ruby
mrsolo has joined #ruby
Feyn has joined #ruby
codeFiend has joined #ruby
vdamewood has quit [Ping timeout: 255 seconds]
workmad3 has joined #ruby
rrichardsr3 has quit [Remote host closed the connection]
bruno- has joined #ruby
Tux_007__ has joined #ruby
Exponential has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
workmad3 has quit [Ping timeout: 256 seconds]
tjbiddle has joined #ruby
bruno- has quit [Ping timeout: 272 seconds]
fu2ristiq has quit [Ping timeout: 256 seconds]
Exponential has joined #ruby
Guest24 has quit [Ping timeout: 272 seconds]
yqt has quit [Ping timeout: 276 seconds]
ebonics_ has joined #ruby
ebonics has quit [Disconnected by services]
ebonics_ is now known as ebonics
hewenhong has quit [Remote host closed the connection]
michael_mbp has quit [Excess Flood]
barkerd427 is now known as zz_barkerd427
lele has joined #ruby
mello has joined #ruby
towski_ has joined #ruby
moeSeth has joined #ruby
krz has joined #ruby
michael_mbp has joined #ruby
pengin has joined #ruby
mello has quit [Ping timeout: 255 seconds]
Exponential has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mrsolo has quit [Quit: This computer has gone to sleep]
ohaibbq has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
CHVNX is now known as speedyiguana
speedyiguana is now known as CHVNX
Rickmasta has joined #ruby
macmartine has quit [Remote host closed the connection]
_ht has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
shuber_ has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis>
moin
<Darkwater>
o/
avril14th has quit [Ping timeout: 276 seconds]
djbkd has quit [Ping timeout: 244 seconds]
_seanc_ has quit [Ping timeout: 265 seconds]
queequeg1 has quit [Ping timeout: 255 seconds]
curtis__ has joined #ruby
<curtis__>
that was weird... something screwy is happening with the servers
<curtis__>
but yeah i am looking for people that are passionate rails developers
AnurangDikshiit has quit [Ping timeout: 246 seconds]
Musashi007 has quit [Quit: Musashi007]
<apeiros>
curtis__: you'll probably want to use #rubyonrails for that. I'm not sure on their recruiting-in-channel policy, though
moeSeth has quit [Quit: Connection closed for inactivity]
<curtis__>
thanks
hanmac has joined #ruby
Musashi007 has joined #ruby
ahmetkapikiran has quit [Quit: ahmetkapikiran]
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Exponential has joined #ruby
Musashi007 has quit [Client Quit]
User458764 has joined #ruby
fabrice31_ has joined #ruby
<sevenseacat>
chances of it actually working are slim to none.
DaniG2k has quit [Quit: leaving]
<Lingo>
Anyone know which exceptions could be raised when using Redic (the Redis client library)?
workmad3 has joined #ruby
<Lingo>
or hiredis-rb for that matter, it uses that as a driver
codeFiend has quit [Ping timeout: 265 seconds]
krz has quit [Quit: WeeChat 1.0.1]
fabrice31 has quit [Ping timeout: 276 seconds]
livathinos has joined #ruby
hewenhong has quit [Remote host closed the connection]
curtis__ has quit [Ping timeout: 246 seconds]
Musashi007 has joined #ruby
duderonomy has joined #ruby
hewenhong has joined #ruby
Tux_007__ has quit [Quit: Connection closed for inactivity]
hewenhon_ has joined #ruby
mello has joined #ruby
ada2358_ has quit [Ping timeout: 246 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
codeFiend has joined #ruby
queequeg1 has joined #ruby
ada2358 has joined #ruby
idafyaid has quit [Ping timeout: 250 seconds]
Ox0dea has left #ruby ["WeeChat 1.2-rc1"]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
cubesandcode has quit [Remote host closed the connection]
hewenhong has quit [Ping timeout: 272 seconds]
ahmetkapikiran has joined #ruby
mello has quit [Ping timeout: 255 seconds]
curtis___ has joined #ruby
<curtis___>
what is the most complex ruby app ever made?
<apeiros>
o0
<apeiros>
do you seriously expect a definite answer to that?
<shevy>
Yes!
<shevy>
curtis___ problem is, how do you count complexity?
edwinvdgraaf has joined #ruby
<ex0ns>
One of the biggest ruby app I know is metasploit
<shevy>
but is it also the most complex one
<curtis___>
shevy: well soemthing really complex... i don't know surprise me :)
<ljarvis>
:/
<shevy>
really complex hmm
<shevy>
METASPLOIT
<shevy>
actually, perhaps some closed source one
n008f4g_ has joined #ruby
<apeiros>
curtis___: our largest app is probably >200KLoC. I doubt it's even coming close to being the most complex ruby app ever. Does that help you?
<ddv>
metasploit is a mess
<curtis___>
how does one manage 200k lines?
codeFiend has quit [Ping timeout: 265 seconds]
<ex0ns>
He does not
<curtis___>
and how does one make sense of 200k lines
HotCoder has quit [Read error: No route to host]
<ddv>
well you have to be genius like me, curtis___
lampshades has quit [Quit: lampshades]
bosma has joined #ruby
<apeiros>
make sense of 200kLoC: you usually don't need to. you build blocks which are built from blocks.
<apeiros>
you dive in when necessary.
<ljarvis>
that's probably a medium to large size app.. it's not even insane
<apeiros>
encapsulation helps
<ljarvis>
our largest one is probably about the same (closer to 300k I think)
ndrei has quit [Ping timeout: 265 seconds]
CloCkWeRX has quit [Ping timeout: 265 seconds]
<ljarvis>
doesn't *feel* that big
HotCoder has joined #ruby
pengin has joined #ruby
amclain has quit [Quit: Leaving]
<apeiros>
I wished business allowed us an extensive period to clean up, though. we could probably slim it down by ~25-35% and make a couple of places more sane, less strongly coupled.
<curtis___>
how the hell do you read it?
<ljarvis>
with a text editor
sinkensabe has quit [Remote host closed the connection]
sinkensabe has joined #ruby
<ljarvis>
but seriously, if you code is organised well it's quite simple
<apeiros>
^
<apeiros>
that
<apeiros>
the recipe to scale is organisation
<apeiros>
conventions help a lot
<apeiros>
adhering to guidelines too
charliesome has joined #ruby
<adaedra>
I wish everyone believed in that
<apeiros>
simple things like "you'll always find Foo::BarBaz class in foo/bar_baz.rb"
<apeiros>
discoverable code helps too. explicit code may be a bit more verbose but it's easier to reason about.
mrsolo has quit [Quit: This computer has gone to sleep]
<ljarvis>
yeah, I can get around our entire app using command-t fuzzy finding, it's very rare I can't find something
<curtis___>
code should have esoteric variable names that only you and other dedicated programmers can decipher
<apeiros>
and make sure everybody in the team knows the implicits and/or how to discover implicits.
michael_mbp has quit [Excess Flood]
<apeiros>
curtis___: that's a job security device which IMO only bad coders need :-p
haxrbyte_ has quit [Remote host closed the connection]
<curtis___>
apeiros: i was being sarcasting if you're working with a team or someone else and they hire another coder you will quickly be found out and your reputation will forever be tarnished
edwinvdgraaf has quit [Remote host closed the connection]
hewenhon_ has quit [Remote host closed the connection]
hewenhong has joined #ruby
edwinvdgraaf has joined #ruby
mikecmpbll has joined #ruby
<apeiros>
curtis___: if only
<ljarvis>
new devs definitely should be prepared to adapt to the way something is already organised. You just gotta hope someone sane organised it in the first place
<curtis___>
apeiros: i found out bad coders and i fired them :)
<curtis___>
it also helps to know how to code
<ljarvis>
curtis___: and you're here recruiting?
<curtis___>
no
<apeiros>
there are too many who'll see obscure code and think "OMIGOSH! I can't comprehend! This coder must really know their stuff!!!"
michael_mbp has joined #ruby
<curtis___>
i don't recruit online
ziprar has joined #ruby
<ljarvis>
"curtis__> but yeah i am looking for people that are passionate rails developers"
<ljarvis>
apeiros: fucking aye!
<curtis___>
only people that are in the arizona area
<adaedra>
too far away.
<ljarvis>
oh so you are recruiting
<curtis___>
that doesn't count as recruiting
<ljarvis>
oO
<ljarvis>
unless they're in Arizona?
<EvanGuru>
help I broke my influxdb
<EvanGuru>
oh dear this is freenode
Musashi007 has quit [Quit: Musashi007]
<shevy>
we fix things you never knew about
<adaedra>
There are things we can't fix though, like shevy
<shevy>
we fix them
zcreative has joined #ruby
codeFiend has joined #ruby
edwinvdg_ has joined #ruby
curtis___ has left #ruby [#ruby]
curtis___ has joined #ruby
<curtis___>
whoops i closed the tab :(
mclee has quit [Ping timeout: 255 seconds]
joonty has joined #ruby
idafyaid has joined #ruby
idafyaid has quit [Changing host]
idafyaid has joined #ruby
<shevy>
yeah
<shevy>
way to try and get rid of ljarvis!!!
pengin has quit [Remote host closed the connection]
zipace has quit [Ping timeout: 272 seconds]
Hounddog has joined #ruby
C1V0 has quit [Ping timeout: 256 seconds]
edwinvdgraaf has quit [Ping timeout: 240 seconds]
<adaedra>
"Rhino is an open-source implementation of JavaScript written entirely in Java" – "C++ 55.9%" õ_o
cubesandcode has joined #ruby
CloCkWeRX has joined #ruby
<shevy>
are you saying
<shevy>
it is not written in java
<adaedra>
GitHub is
thiagovsk has quit [Quit: Connection closed for inactivity]
kies has joined #ruby
<adaedra>
But when you click C++, it disappears from the language list
keen___________1 has quit [Ping timeout: 264 seconds]
Yzguy has quit [Quit: I'm sleeping, go away.]
<forgot>
uniq is an unix utility, not a bash builtin
juni0r has quit [Ping timeout: 244 seconds]
ndrei has quit [Ping timeout: 264 seconds]
<givello>
forgot: right, my bad
slackbotgz has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
sevensea_ has joined #ruby
<jhass>
al2o3-cr: looks good
yeticry has quit [Ping timeout: 265 seconds]
yeticry has joined #ruby
leafybasil has quit [Remote host closed the connection]
jenrzzz has joined #ruby
senayar has joined #ruby
senayar has joined #ruby
<al2o3-cr>
jhass: ?
HotCoder has quit [Ping timeout: 256 seconds]
sevenseacat has quit [Ping timeout: 265 seconds]
<jhass>
al2o3-cr: re. "is this safe?"
<al2o3-cr>
jhass: ah, ok cheers jhass :)
quimrstorres has joined #ruby
juni0r has joined #ruby
gaboesquivel has joined #ruby
quimrstorres has quit [Remote host closed the connection]
sevensea_ is now known as sevenseacat
mello has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
Musashi007 has joined #ruby
proxima has joined #ruby
doublemalt__ has joined #ruby
mello has quit [Ping timeout: 246 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<proxima>
I need to edit/modify the template pages of shopify store by making an app instead of directly editing them.. So, how can I access the templates?
dorei has joined #ruby
lessless has joined #ruby
quimrstorres has joined #ruby
lkba has joined #ruby
ndrei has joined #ruby
<sevenseacat>
i'm not sure what that even means.
oo_ has quit [Remote host closed the connection]
sigurding has quit [Quit: sigurding]
haxrbyte_ has joined #ruby
subraminion has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
haxrbyte has quit [Ping timeout: 256 seconds]
antgel has joined #ruby
zcreative has quit [Quit: (null)]
oo_ has joined #ruby
bruno- has joined #ruby
gusto has quit [Quit: Leaving]
leafybasil has joined #ruby
tomphp has joined #ruby
garyserj has joined #ruby
ndrei has quit [Ping timeout: 256 seconds]
bruno- has quit [Ping timeout: 244 seconds]
GriffinHeart has joined #ruby
pengin has joined #ruby
gagrio has joined #ruby
proxima has quit [Ping timeout: 246 seconds]
<mikecmpbll>
eh, this feels like a stupid question, but is there a general preference between class SomeClass; def self.foo; ..; end; end, and module SomeModule; def self.foo; ...; end; end
antgel has quit [Ping timeout: 240 seconds]
<mikecmpbll>
as in, class vs a module for just a collection of methods with no initialization.
<mikecmpbll>
or are both code smell? :)
<jhass>
mikecmpbll: I use a module instead of a class if I don't need the ability of a class to create new objects
<Mon_Ouie>
Use module and module_function instead; def foo of def self.foo
* mikecmpbll
googles module_function
<jhass>
oh and +1 ^
anisha has joined #ruby
<Mon_Ouie>
Which is the way that, e.g. Math works and allows you to do both Math.sin(x) and include Math; sin(x)
<mikecmpbll>
Mon_Ouie: very neat.
fabrice31 has quit [Remote host closed the connection]
mclee has joined #ruby
lkba_ has joined #ruby
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lkba has quit [Ping timeout: 264 seconds]
quimrsto_ has joined #ruby
<al2o3-cr>
Mon_Ouie: could you give an example how you would use module_function like Math?
ndrei has joined #ruby
pengin has quit [Remote host closed the connection]
tomphp has quit [Max SendQ exceeded]
<Mon_Ouie>
module Math; module_function; def sin(x); …; end; end
<Mon_Ouie>
Or alternatively, def sin(x); …; end then module_function :sin
chipotle has joined #ruby
quimrstorres has quit [Ping timeout: 265 seconds]
rafadc has quit []
workmad3 has quit [Ping timeout: 258 seconds]
<al2o3-cr>
Mon_Ouie: oh, cheers always wondered how Math did it thanks :)
hewenhon_ has quit [Remote host closed the connection]
sdothum has joined #ruby
<al2o3-cr>
Mon_Ouie: awesome thanks :)
zotherstupidguy has quit [Ping timeout: 246 seconds]
tomphp has joined #ruby
ahmetkapikiran has joined #ruby
denver has joined #ruby
badhatter has quit [Remote host closed the connection]
mujou has joined #ruby
<SebastianThorn>
how to trim what looks like spaces, but are not?
<ruboto>
dorei # => undefined method `succ' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/372444)
FernandoBasso has joined #ruby
<dorei>
this exception
<jhass>
.index(nil)
hewenhong has quit [Remote host closed the connection]
<dorei>
it could be any kind of exception
hewenhong has joined #ruby
hewenhong has quit [Client Quit]
<jhass>
sounds like you're too unsure about your input
<jhass>
normalize it better
<jhass>
e.g. by using .select
<dorei>
maybe i should rephrase my question, i have a something.map(&b) and in order to help me debug it in case of an exception, it'd be great if i knew which item caused the exception
Igorshp has quit [Remote host closed the connection]
kp666 has quit [Ping timeout: 264 seconds]
<jhass>
.find {|e| begin; b.call(e); rescue; true; end; false } # debug code, not production code
nateberkopec has joined #ruby
<dorei>
thanx, i'll give it a try :)
edwinvdg_ has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
<al2o3-cr>
why does ruby allow this to concat "hello" "world"
Akagi201 has quit []
edwinvdg_ has joined #ruby
quimrstorres has quit [Remote host closed the connection]
serivich has joined #ruby
<apeiros>
al2o3-cr: ask matz?
quimrstorres has joined #ruby
codecop has joined #ruby
<apeiros>
personally I would have made that a syntax error. I use it in ruby to spread strings over multiple lines: x = "foo" \<newline>"bar"
<al2o3-cr>
apeiros: thnx, yes that is useful
edwinvdgraaf has quit [Ping timeout: 250 seconds]
nhhagen has joined #ruby
Vendella has joined #ruby
<Vendella>
<< class Foo; end; foo = Foo.new; puts foo
quimrstorres has quit [Ping timeout: 246 seconds]
<jhass>
apeiros: al2o3-cr isn't that inherited from C?
<Vendella>
The memory address that's printed out is where that Foo instance is in memory?
<Vendella>
#<Foo:0x9d069d0>
<apeiros>
jhass: may well be inherited by some language. as long as it doesn't do trigraphs…
<apeiros>
Vendella: don't assume that
<jhass>
iirc C does that so you can compose stuff with macros
<apeiros>
Vendella: whether that is a memory address or not is an implementation detail
nhhagen_ has joined #ruby
<Vendella>
But it's something like that right?
ahmetkapikiran has quit [Quit: ahmetkapikiran]
<apeiros>
Vendella: e.g. it certainly won't be one in jruby
<ljarvis>
now I have space for deciding what to watch next on netflix
<sevenseacat>
my brain is currently too occupied playing clicker heroes when it should be writing
<shevy>
hanmac1 Unicode madness
<al2o3-cr>
str = "foobar"; str.object_id << 1 # so this gives you memory location of that object?
<shevy>
although I have to say, coding in hieroglyphs is pretty cool
ldnunes has joined #ruby
<shevy>
I don't even know what is clicker heroes but the name alone sounds stressful
<apeiros>
al2o3-cr: in MRI, it's iirc the pointer value, yes
<apeiros>
the object_id itself is
<apeiros>
or… actually might be that the shifted id is
<shevy>
hmmm
Spami_ has quit [Quit: This computer has gone to sleep]
<hanmac1>
shevy hm interesting is that unicode doesnt have a char for a unicorn yet ;P
<apeiros>
`$ Object#object_id` in pry is revealing ;-)
griffindy has joined #ruby
<al2o3-cr>
apeiros: oh, lets check :)
<shevy>
hanmac1 well it has a snowman. I am sure it'll have a unicorn eventually
grn has joined #ruby
pengin has quit [Remote host closed the connection]
<ljarvis>
i really need to find some time for oss projects :( they are suffering
<shevy>
ljarvis quit work!
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis>
good idea
<grn>
Hi! I have a class Klass with a prepended module Mod. There are methods Klass#foo and Mod#foo and Mod#foo calls super. If klass = Klass.new, how can I call Klass#foo without calling Mod#foo? In other words how can I skip a prepend module's method?
livathinos has quit [Ping timeout: 272 seconds]
<shevy>
now that's a tough cookie
nettoweb has joined #ruby
bronson has joined #ruby
mase-chatter has joined #ruby
nhhagen_ has quit [Remote host closed the connection]
scripore has joined #ruby
<shevy>
so you want to call a method on your class but not the method on a module
edwinvdg_ has quit [Remote host closed the connection]
<shevy>
isn't it so that when you include a module, that one overwrites other methods anyway?
edwinvdgraaf has joined #ruby
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis>
grn: huh? if it's prepended then your method defined on the class will override the one defined in the module
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
juanca_ has joined #ruby
gregf has quit [Quit: WeeChat 1.1.1]
goodcodeguy has quit [Client Quit]
manzo has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
__chris has joined #ruby
edwinvdgraaf has quit [Ping timeout: 256 seconds]
ziprar has quit [Ping timeout: 244 seconds]
ndrei has joined #ruby
gregf has joined #ruby
grn has joined #ruby
pengin has quit [Remote host closed the connection]
but3k4 has joined #ruby
decoponio has joined #ruby
<grn>
ljarvis: the previous version of the code used #alias_method but prepending seemed to be more elegant. I hoped there's some way around it. I hoped that UnboundMethod#bind can be used to achive that or a similar mechanism.
krz has joined #ruby
quimrstorres has joined #ruby
zarubin_ has joined #ruby
FernandoBasso has quit [Quit: leaving]
<Vendella>
A class can only have one metaclass?
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xxneolithicxx has joined #ruby
SalexW_ has quit [Ping timeout: 272 seconds]
sandelius has joined #ruby
juanca_ has quit [Remote host closed the connection]
quimrstorres has quit [Ping timeout: 265 seconds]
zarubin_ has quit [Ping timeout: 264 seconds]
Igorshp has joined #ruby
xcesariox has joined #ruby
goodcodeguy has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
<apeiros>
Vendella: by metaclass, do you mean singleton_class? and yes, an object has precisely one singleton_class.
<Vendella>
apeiros, Yes.
vikaton has joined #ruby
<apeiros>
some objects are exempt and can't have one. numerics, symbols, true, false, nil f.ex.
<vikaton>
>> {:a => "a}[:a]
<ruboto>
vikaton # => /tmp/execpad-64ecb13b04a5/source-64ecb13b04a5:5: syntax error, unexpected tGVAR, expecting '}' ...check link for more (https://eval.in/372467)
juanca_ has joined #ruby
<vikaton>
>> k = {:a => "a}; k[:a]
<ruboto>
vikaton # => /tmp/execpad-91d563b2bc18/source-91d563b2bc18:5: syntax error, unexpected tGVAR, expecting '}' ...check link for more (https://eval.in/372468)
<apeiros>
btw., if you don't have a question associated with it, then please use your personal pry/irb.
<apeiros>
the bot is for demonstration purposes only.
tomaszbalon has joined #ruby
<sevenseacat>
or as I like to say, "IRC is not IRB"
<izzol>
I have a string: "text/x-ruby; charset=us-ascii" and I want to have just "x-ruby" on the output. So far I have: string.sub!(/^\w*\//, ''), but this gives me: x-ruby; charset=us-ascii. I know that now I can execute another sub, but there is a way to do this in one sub?
<vikaton>
What does "no implicit conversion of Symbol into Integer" usually mean I have to do?
<apeiros>
then you don't have the code you just showed
<apeiros>
puts returns nil
workmad3 has quit [Ping timeout: 250 seconds]
<Vendella>
I do
<apeiros>
no
<Vendella>
it returns nil but it puts #<Foo:0x9f3d488>
<apeiros>
ok
<Vendella>
So self is #<Foo:0x9f3d488>
<Vendella>
That's what I mean
<apeiros>
*I get back* means *it returns*
<apeiros>
and yes. #<Foo:0x9f3d488> reads as "an instance of Foo"
livathinos has joined #ruby
<apeiros>
and x is an instance of Foo (or foo, if you call your variable that)
senayar has joined #ruby
senayar has joined #ruby
<Vendella>
Yea
<apeiros>
you can `puts foo` after. it'll have the exact same output
fgo has quit [Quit: WeeChat 1.1.1]
<Vendella>
Yea but why is that
ismaelga has joined #ruby
<apeiros>
because - as I already said - self is the object you call the method on
<apeiros>
if you create another instance of Foo and call .test on that, it'll print that instance.
dionysus69 has quit [Ping timeout: 252 seconds]
xcesariox has quit [Max SendQ exceeded]
<Vendella>
So, ruby will set self to be the object before I call test and after that will set it back to main?
sankaber has joined #ruby
chrissonar has quit [Remote host closed the connection]
<apeiros>
that's not how I picture it. self is not a global state which is changed.
ejnahc has quit [Remote host closed the connection]
<apeiros>
but might work as a way to think about it
<Vendella>
What?
<Vendella>
That's what the info about self says.
<apeiros>
that's your interpretation of it
ejnahc has joined #ruby
<Vendella>
"self is an globally accessible keyword: ruby makes sure that there is always a self that can be accessed in any context. The value of self, however, will change based on the current context."
mary5030 has joined #ruby
bmurt has joined #ruby
<apeiros>
IMO badly worded. "will depend on the current context"
mary5030 has quit [Remote host closed the connection]
<apeiros>
in the context of toplevel code, self is main. in the context of a class body, self is the class. in the context of a method, self is the object the method is invoked on.
<apeiros>
if you want to think of it as mutable state - fine. but it's not really changing. your context changes. it always *is* main *in the context of main*.
haxrbyte_ has quit [Remote host closed the connection]
haxrbyte has joined #ruby
<apeiros>
that's like going from house A with a white carpet into house B with a red carpet and say "look, the carpet changed to red". then go back and say "look, the carpet changed back to white".
qwertme has joined #ruby
<sevenseacat>
good analogy.
<apeiros>
along with self, lots of things change. all available @instance_variables for example
<apeiros>
and there too, it's IMO a bad way to think of it as your context being stationary and everything being swapped in & out in your context.
sigurding has quit [Quit: sigurding]
<jhass>
grn: tbh that does sound like you have some design issues... why prepend if you do not want it overridden?
manzo has quit [Quit: Leaving]
<jhass>
grn: wouldn't it be better to instead have a decorator that you can use in the places where you do want the additional functionality?
ismaelga has quit [Remote host closed the connection]
ndrei has joined #ruby
ismaelga has joined #ruby
northfurr has joined #ruby
haxrbyte has quit [Read error: Connection reset by peer]
gambl0re has quit [Ping timeout: 256 seconds]
<Vendella>
I have available the Well grounded Rubyist but it's for 1.9, the black book. Will it hurt if I read about the self keyword there or has it changed?
tuelz has joined #ruby
<apeiros>
almost nothing fundamental has changed since 1.9
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tuelz>
besides the langauge dying
<tuelz>
RIP ruby
haxrbyte has joined #ruby
TinkerTyper has quit [Ping timeout: 246 seconds]
<jhass>
tuelz: not very creative, try better
<tuelz>
jhass: best I got, you'll have to settle I'm afriad
* apeiros
thinks tuelz is dying faster than ruby
<gregf_>
haha
* tuelz
hopes apeiros is right
krz has quit [Ping timeout: 265 seconds]
<tuelz>
I realize that can be taken a couple different ways, so now you've got a clue as to whether you're a glass half full or empty kinda person
jerius has joined #ruby
<adaedra>
Ruby is dead, long live ruby?
Soda has joined #ruby
ahmetkapikiran has quit [Quit: ahmetkapikiran]
TinkerTyper has joined #ruby
<al2o3-cr>
ruby will never die
failshell has joined #ruby
_blizzy_ has joined #ruby
<tuelz>
that's a bit optimistic, but I like where your heart is
mmazing has quit [Ping timeout: 256 seconds]
<vikaton>
lol Ruby isnt dying
manzo has joined #ruby
<vikaton>
wut r u smoking
<gregf_>
python could be
griffindy has joined #ruby
<apeiros>
don't feed the trolls.
<gregf_>
if theres dope like that :/
<tuelz>
I was only kidding friends. It's just a meme
<Andriamanitra>
its popularity is declining though
<tuelz>
indeed, which is why it's a meme
<adaedra>
nice meme
GriffinHeart has joined #ruby
<tuelz>
all the cool kids have moved on the the hottest new whatever, that just means our neckbeard density is increasing
<Andriamanitra>
it's a shame :/ i think ruby is a lot more fun than python
<tuelz>
I use ruby because I think coding isn't fun :p. Anything that lets me do less coding to get to the stuff I really want to do is what I like
scripore has quit [Quit: This computer has gone to sleep]
<tuelz>
less time, not necessarily less code
scripore has joined #ruby
<tuelz>
I don't mind verbose - it's the mental load of trying to solve recursive puzzles or learn obscure patterns just to read code in a new language that I don't like
workmad3 has joined #ruby
ahmetkapikiran has joined #ruby
paulcsmith has joined #ruby
nateberkopec has quit [Quit: Leaving...]
GriffinHeart has quit [Ping timeout: 258 seconds]
nateberkopec has joined #ruby
delianides has joined #ruby
__chris has joined #ruby
havenwood has joined #ruby
charliesome has quit [Quit: zzz]
livathinos has quit []
codeFiend has quit [Quit: codeFiend]
mase-chatter has quit [Quit: Leaving]
delianides has quit [Ping timeout: 245 seconds]
dblessing has joined #ruby
ndrei has quit [Ping timeout: 244 seconds]
davedev24_ has quit [Ping timeout: 265 seconds]
someword has joined #ruby
quimrstorres has quit [Remote host closed the connection]
charliesome has joined #ruby
quimrstorres has joined #ruby
davedev24_ has joined #ruby
cassianoleal has joined #ruby
go|dfish has quit [Read error: Connection reset by peer]
codeFiend has joined #ruby
<ddv>
for webdev meteor is very exciting to be honest
IrishGringo has joined #ruby
davedev2_ has joined #ruby
quimrstorres has quit [Ping timeout: 265 seconds]
arup_r has joined #ruby
Vendella has quit [Quit: Leaving]
krz has joined #ruby
davedev24_ has quit [Ping timeout: 256 seconds]
gaboesquivel has joined #ruby
tomaszbalon has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
riotjones has quit [Remote host closed the connection]
mello has joined #ruby
RegulationD has joined #ruby
idafyaid has joined #ruby
wca has left #ruby [#ruby]
bkxd has quit [Ping timeout: 244 seconds]
Guest7458 has joined #ruby
<shevy>
tuelz hard to know whether ruby is really dying. if you look at TIOBE then yeah. If you look at trends in job offerings, then ruby has gained - the curve is almost identical to python, though python started at a higher threshold
Guest7458 has quit [Client Quit]
codecop has quit [Remote host closed the connection]
posixpascal has joined #ruby
<shevy>
google trends are also not showing the same, as a rule of thumb http://goo.gl/Si2JNf
<shevy>
If you combine all datasets, then javascript is one of the biggest winners
<shevy>
php lost slightly
<shevy>
perl as well
<shevy>
python gained quite a bit
<shevy>
ruby is so lala, slight gain
RegulationD has quit [Ping timeout: 244 seconds]
<shevy>
I think the big peak before was due to rails
mello has quit [Ping timeout: 265 seconds]
<lala>
I heard lala!
Hounddog has quit [Remote host closed the connection]
byprdct has joined #ruby
<lala>
shevy: At your service.
<shevy>
lol damn
senayar has joined #ruby
senayar has joined #ruby
<shevy>
didn't know someone had such a nick
quimrstorres has joined #ruby
byprdct has quit [Max SendQ exceeded]
<havenwood>
shevy: They are literally comparing YouTube searches with insane result filtering and other bizarre and uninformative things. Why even look at TIOBE? I'm confused how it's a thing.
<shevy>
havenwood because it looks so scientific
<havenwood>
shevy: ha!
<lala>
shevy: I get that a lot.
<shevy>
lala what kind of nick is that anyway :)
<shevy>
it's like singing a song!
chinmay_dd has joined #ruby
<lala>
shevy: Exactly!
<shevy>
TIOBE uses some black magic to make that statistic
<lala>
shevy: That was the first thing that came to mind when I had to put in a nick. And then I stuck onto it.
<shevy>
hahaha
joast has joined #ruby
jacor_m has joined #ruby
chinmay_dd has quit [Client Quit]
gaboesquivel has quit [Remote host closed the connection]
bigkevmcd has quit [Quit: Outta here...]
quimrsto_ has joined #ruby
go|dfish has joined #ruby
quimrstorres has quit [Ping timeout: 244 seconds]
gaboesquivel has joined #ruby
anisha has quit [Quit: Leaving]
Soda has quit [Read error: Connection reset by peer]
balazs has joined #ruby
Soda has joined #ruby
<grn>
jhass: I'm experimenting with design by contract. I wrote a module that you can mix into a class. In the class definition you can call .invariant to add a bunch of invariants. Then a module is prepended to the class which copies the whole public interface and verifies the invariant after each method call. It's just an experiment though. Any ideas how can this be done differently?
quimrstorres has joined #ruby
tagrudev has quit [Read error: Connection reset by peer]
<jhass>
I fear I'm unable to follow why that needs your supermethod proxy
gaboesquivel has quit [Ping timeout: 264 seconds]
quimrsto_ has quit [Ping timeout: 272 seconds]
allcentury has quit [Ping timeout: 246 seconds]
scripore has quit [Quit: This computer has gone to sleep]
mrsolo has joined #ruby
scripore has joined #ruby
<mwlang>
TIOBE grades popularity of languages based on amount of “buzz” or churn on the topic. How many searches are being performed, how many messages posted to usenet groups, etc. I think it also factors in number of open source projects written in each language and their activity levels, but I’m not entirely sure…I just know it’s an activity-based scoring system.
scripore has quit [Remote host closed the connection]
bkxd has joined #ruby
allcentury has joined #ruby
arup_r has quit [Remote host closed the connection]
<havenwood>
mwlang: Apparently they haven't heard of Github.
<apeiros>
grn: IME all implementations of DBC in ruby fail due to unavailability of `old`
<grn>
jhass: good point. The problem is you can't use methods in the invariants. For instance if you have an invariant like 'active_users_count >= 0' then after calling any method the control flow is #some_method -> #invariant_verification -> #active_users_count -> #invariant_verification -> #active_users_count -> ... The problem is that invariants are verified after all method calls, including those made from invariants, which leads to infini
<grn>
te recursion.
Feyn has quit [Quit: Leaving]
polysics has joined #ruby
tuelz1 has joined #ruby
<mwlang>
havenwood: yeah, I think TIOBE becomes less and less relevant as the years go by because I kinda suspect they haven’t changed their data gathering methodologies over the years.
<grn>
apeiros: that's a very good point. I haven't considered it yet and concentrated on invariants. Any idea for an implementation?
ismaelga has quit [Remote host closed the connection]
<grn>
I wonder how Eiffel implements `old` under the hood.
<apeiros>
grn: if I had, I'd already written my own DBC gem :)
<grn>
:-D
vire has quit [Ping timeout: 250 seconds]
<apeiros>
grn: a good implementation would need COW access on the underlying object-graph
ferr has joined #ruby
<apeiros>
expensive in pure ruby
podman has joined #ruby
tuelz has quit [Ping timeout: 258 seconds]
<mwlang>
apeiros: Mooooo. Oh, wait, what’s COW?
<apeiros>
copy on write
<grn>
Yeah. Do you think that a C extension can help?
<mwlang>
ah
<apeiros>
probably. not sure how much the C API exposes.
kobain has joined #ruby
<grn>
I'll probably take a look next Friday.
<apeiros>
grn: another issue is missing command-query separation in ruby
<grn>
BTW While working on my code I managed to segfault ruby :-)
Ilyes512 has joined #ruby
<apeiros>
iirc in eiffel you could only use queries in contracts - which makes sense. since a command might lead to contract violation.
<apeiros>
tbh, I don't remember how eiffel handles caching. i.e. a query which caches is to an extent a command (it mutates state)
tjbiddle has joined #ruby
<grn>
That would make things simpler. How does Eiffel enforce CQS?
<apeiros>
you have to declare it
nobitanobi has joined #ruby
<apeiros>
and within a query, you can't use anything which itself isn't a query
RegulationD has joined #ruby
<grn>
Sounds good. It's a bit similar to C++'s const methods, isn't it?
<apeiros>
I don't do C++, so no idea
<apeiros>
I assume a const method is not allowed to modify the receiver?
keyofnight has quit [Ping timeout: 255 seconds]
twistedpixels is now known as zz_twistedpixels
<mwlang>
this all sounds like Ada….
<grn>
Yup, except the attributes marked as mutable which can be used for caching, etc.
<apeiros>
quite possible. good ideas are bound to resurface :)
sonOfRa has quit [Quit: Bye!]
gluten_hell_ has quit [Quit: Computer has gone to sleep.]
lavros has joined #ruby
keyofnight has joined #ruby
charliesome has quit [Quit: zzz]
gluten_hell_ has joined #ruby
<mwlang>
and some seriously defense oriented thinking and coding, for that matter.
gluten_hell_ has quit [Read error: No route to host]
<tuelz1>
just been getting into pure functional programming myself. Mutate none of the things!
<dudedudeman>
shevy: i miss all hte fun apparently
gluten_hell_ has joined #ruby
ntln has joined #ruby
<apeiros>
mwlang: DBC is basically TDD++
<tuelz1>
dudedudeman: well you missed out on all the bashing too. The other day a couple people said I reminded them of you. Sorry about that.
Soda has quit [Remote host closed the connection]
<apeiros>
you kinda have your tests in the code itself. you can run your code with all tests enabled all the time. or you can turn them off for performance.
<dudedudeman>
ha, no i ended up seeing that. there's no need to apologize
<apeiros>
I found DBC quite amazing and it's one of the features I'd wish for ruby.
<dudedudeman>
i just come back and see read some scrollback and i get all O_O
<apeiros>
but while `old` (access to the object in the state prior to method execution) could be added, command/query separation would probably be quite hard
sankaber has joined #ruby
gambl0re has joined #ruby
<mwlang>
apeiros: yeah, that’s the philosophy embodied by Ada. I actually like to code that way with Ruby as well in the places that it matters most. for example, calculating prices with discounts, interfacing with external services (credit card processing), etc.
bluish has joined #ruby
DerisiveLogic has joined #ruby
charliesome has joined #ruby
hanmac1 has joined #ruby
tvw has quit [Remote host closed the connection]
xcesariox has joined #ruby
Xiti has joined #ruby
hanmac1 has left #ruby [#ruby]
ed112211 has quit [Quit: ed112211]
oo_ has quit [Remote host closed the connection]
arturaz has quit [Ping timeout: 255 seconds]
zarubin_ has joined #ruby
davedev2_ has quit [Ping timeout: 265 seconds]
phutchins has joined #ruby
ferr has joined #ruby
n008f4g_ has quit [Ping timeout: 276 seconds]
aganov has quit [Remote host closed the connection]
davedev24_ has joined #ruby
balazs has joined #ruby
zarubin_ has quit [Ping timeout: 245 seconds]
bronson has joined #ruby
nettoweb has joined #ruby
Palmer11 has joined #ruby
codeFiend has quit [Quit: codeFiend]
GriffinHeart has joined #ruby
sinkensabe has quit [Remote host closed the connection]
<powersurge>
anyone ever do address verification with activemerchant + authorize.net?
<powersurge>
having a real bear of a time working out how to do it
<jhass>
?crosspost powersurge
<ruboto>
powersurge, Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
<jhass>
and where you asked first is definitely better suited anyway ;)
polysics has quit []
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
edwinvdg_ has quit [Remote host closed the connection]
msgodf has quit [Ping timeout: 272 seconds]
jpfuentes2 has quit [Ping timeout: 276 seconds]
edwinvdgraaf has joined #ruby
_seanc_ has quit [Quit: _seanc_]
delianides has joined #ruby
<dudedudeman>
jhass: do you mind me asking if there is anything you don't know? lol. you've got solutions for everything
lavros has quit [Ping timeout: 258 seconds]
<jhass>
if only..
<dudedudeman>
ha. what's your background? ruby only? or have you tried all the things
<ebonics>
jhass, youre the best
<jhass>
you get that impression because I answer stuff I do know ;)
<jhass>
* I only
<powersurge>
mmm, sorry about the not-explicitly mentioned crosspost
aryaching has joined #ruby
<dudedudeman>
it's true! limited sample size
xelim has joined #ruby
<powersurge>
just came in here because I hadn't gotten anything actionable
uri_ has joined #ruby
<powersurge>
I'm sure you can imagine my frustration
IrishGringo has quit [Ping timeout: 256 seconds]
lavros has joined #ruby
<jhass>
dudedudeman: started with about 14, wanted to these "homepage" thingies, so started digging into HTML, CSS and then PHP shortly after, moved over to Python for "GUI stuff, PHP-GTK is not usable!" and picked up Ruby by contributing to diaspora because "gotta do some open source stuff"
<powersurge>
heh, diaspora
tjohnson has joined #ruby
<powersurge>
I forgot about them
psy_ has joined #ruby
<powersurge>
they were going to save our social network soul
watchtheblur has joined #ruby
Aria has quit [Ping timeout: 248 seconds]
<dudedudeman>
jhass: everyone has a story. that's pretty neat
myddler has joined #ruby
<powersurge>
I had a pretty similar trajectory. I learned python for a change of pace over PHP though, rather than for guis
pengin has quit [Remote host closed the connection]
<powersurge>
at my current company I couldn't do python, had to pick between php & ruby
<powersurge>
learned ruby in a hurry
ferr has quit [Ping timeout: 258 seconds]
juanca_ has quit [Remote host closed the connection]
<dudedudeman>
see, i see a lot of people say 'learned in a hurry'. and I guess that's because they have a background in programming already
tuelz1 has quit [Ping timeout: 240 seconds]
aredridel has joined #ruby
<powersurge>
it's deffo easier to learn languages in the same paradigm when you already know one
<myddler>
Anyone know of any open source code for a large Rails app, maybe on Github?
<powersurge>
it's easy to sidestep from php to python or ruby, for example
twistedpixels is now known as zz_twistedpixels
<powersurge>
mostly boils down to learning idioms & ecosystem
<jhass>
myddler: discourse
kp666 has quit [Quit: Leaving]
<myddler>
jhass: ?
fabrice31 has quit [Remote host closed the connection]
<jhass>
diaspora is not small too, but still not a prime example of neat code
<jhass>
I'm sure you can google that much ;)
lavros has quit [Ping timeout: 276 seconds]
<myddler>
jhass: Looking for an example of a large Rails codebase not typical textbook example
lavros has joined #ruby
<jhass>
I just gave you two then
<myddler>
jhass: OK, thanks.
Pwnna has joined #ruby
<Pwnna>
how do you send a block?
<Pwnna>
like i want to call a.send(:method, arg1, arg2, block)
gaboesquivel has quit [Remote host closed the connection]
<Pwnna>
where block is a variabel that i have, rather than an inline block
<jhass>
powersurge: prefer public_send if possible, either way, just pass the block to it
<jhass>
, &block), or ) do end / ) { }
<jhass>
ew, tab, fail Pwnna ^
<jhass>
sorry
<Pwnna>
so just do a.send(:m, a, b, &block) should work?
<jhass>
yes
<Pwnna>
thanks!
sinkensabe has joined #ruby
<Pwnna>
and if i do want to send an inline block i can just do a.send(:m, a, b) { ... }
<jhass>
yes
paulcsmith has quit [Quit: Be back later ...]
<jhass>
and please consider public_send
<Pwnna>
yeah
<Pwnna>
just less character to type :P
<Pwnna>
for here
jpfuentes2 has joined #ruby
workmad3 has quit [Ping timeout: 265 seconds]
grn has quit []
havenn has joined #ruby
edwinvdg_ has joined #ruby
Agoldfish has joined #ruby
juanca_ has joined #ruby
<jhass>
that's a bad reason if they're not functionally equivalent ;P
ismaelga has joined #ruby
alex88 has quit []
havenwood has quit [Ping timeout: 265 seconds]
juanca_ has quit [Remote host closed the connection]
edwinvdgraaf has quit [Ping timeout: 276 seconds]
snockerton has joined #ruby
darkf has quit [Quit: Leaving]
tuelz1 has joined #ruby
juanca_ has joined #ruby
workmad3 has joined #ruby
senayar has quit [Remote host closed the connection]
<athos_diddy>
what should i do? leave it in the initialize? can't i use a module or class?
<athos_diddy>
i've tired using modules and stuff but the variables are never in scope
Cache_Money has joined #ruby
<athos_diddy>
this doesn't look elegant to me. if there's a better way i'm open to learning
<Lingo>
seems like a good opportunity to use some loops :)
<jhass>
yeah, definitely some patterns in there
<athos_diddy>
lol yeah i was doing that... taking a fp route with it in a module
mello has joined #ruby
<athos_diddy>
but when i was building the methods the control constructs kept growing
<athos_diddy>
maybe i should make smaller methods
jpfuentes2 has quit [Remote host closed the connection]
<jhass>
I'd built a method that builds and returns the hash
<Lingo>
are you going to modify the ImageLists and stuff? I'd just store it in constants
pdoherty has joined #ruby
<jhass>
that additionally
jpfuentes2 has joined #ruby
<athos_diddy>
imagelist won't be modified they will be iterated through during the main_routine
roolo has quit [Remote host closed the connection]
<athos_diddy>
the only thing modified will be the image instance variable
<athos_diddy>
it's a gosu rpg
OrbitalKitten has joined #ruby
moretti has joined #ruby
<Lingo>
well, initialize isn't the place then :) abstract the pattern and store it in a constant would be my advice :)
<athos_diddy>
everyone does that darn starfighter games but i don't think that's so good.. too many tutorials for it
sinkensabe has quit [Remote host closed the connection]
<athos_diddy>
can i share constants with modules?
<athos_diddy>
that would be so much cleaner
<athos_diddy>
like a mixin
<jhass>
mh, I lack a good name for this, what could the hashes be called?
<jhass>
direction_animation?
hectortrope has joined #ruby
gizless is now known as gizmore
<athos_diddy>
animation_direction can work too :P
bootstrappm has joined #ruby
enebo has joined #ruby
<athos_diddy>
then we pass the key it reads more literate
mello has quit [Ping timeout: 245 seconds]
<athos_diddy>
anyone wanna hire a jr rails dev in nyc?
doublemalt__ has quit [Ping timeout: 256 seconds]
<havenn>
?rails athos_diddy
<ruboto>
athos_diddy, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<havenn>
athos_diddy: So you've tried extracting some methods?
<bootstrappm>
morning all
<havenn>
athos_diddy: Try again and show us the code so we can help you get it working?
<havenn>
bootstrappm: g'mornin
myddler has left #ruby [#ruby]
<athos_diddy>
what do you mean extracting some methods? is that technical ruby talk for inheriting and modifying methods from native or required classes?
gauke has quit [Quit: gauke]
<athos_diddy>
jahss: thank you i'll work it out
<athos_diddy>
jhass: thanks
<athos_diddy>
lingo: thank you too
athos_diddy is now known as fluffy_diddy
nettoweb has joined #ruby
<havenn>
athos_diddy: When common blocks of code are repeated in multiple places or dividing makes it easier to understand you can pull those parts out into their own method.
<fluffy_diddy>
ahhhh
lkba_ has joined #ruby
<fluffy_diddy>
ok so break up the collection into methods and require that module
Pwnna has left #ruby ["Leaving"]
hectortrope has quit [Quit: WeeChat 0.4.2]
<fluffy_diddy>
i can even build some loops and be more DRY
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nettoweb has quit [Client Quit]
<fluffy_diddy>
havenn: is that the right idea?
<fluffy_diddy>
sry i taught myself
<fluffy_diddy>
some gaps in my knowledge despite all the books i've read lol
<havenn>
fluffy_diddy: Extract method just means extracting into the same namespace.
jacor has quit [Read error: Connection reset by peer]
lkba has quit [Ping timeout: 276 seconds]
jacor has joined #ruby
lessless has joined #ruby
lavros has quit [Quit: leaving]
sevenseacat has quit [Quit: Me dun like you no more.]
lavros has joined #ruby
<havenn>
fluffy_diddy: The example I linked actually doesn't have much explanation, but searching for Ruby and extract method should turn up good results.
bronson has joined #ruby
<fluffy_diddy>
it actually doe
<havenn>
fluffy_diddy: Oh good. :)
Hijiri has quit [Quit: WeeChat 1.0.1]
<fluffy_diddy>
havenn: this is a great example
senayar has quit []
_seanc_ has joined #ruby
<fluffy_diddy>
i know it looks a little longer form but this is loose coupline
<fluffy_diddy>
which leads to higher cohesion
patrick__ has joined #ruby
<fluffy_diddy>
sort of like using closures
ki0_ has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<fluffy_diddy>
but we're doing method extraction
delianides has quit [Remote host closed the connection]
<fluffy_diddy>
jhass: very nice! I was about to mentioned that two of those actions don't have 4 images (scenes/frames) one has one and the other has three
<fluffy_diddy>
but we can use compact! or something
<fluffy_diddy>
and eliminate the nil
delianides has joined #ruby
ki0 has quit [Ping timeout: 264 seconds]
bronson has quit [Ping timeout: 276 seconds]
juanca_ has quit [Remote host closed the connection]
<fluffy_diddy>
::cry:: and here i typed up 80 lines of this... a year or on the job experience and i won't be making these mistakes. thank you everyone
|\|370 has quit []
werekitten is now known as cats
arta82 has joined #ruby
ki0_ has quit [Ping timeout: 256 seconds]
<jhass>
fluffy_diddy: if they consistently have 3, just make the 4 a parameter
peteykun has quit [Quit: Leaving]
<jhass>
def build_animation(action, frames=4)
<fluffy_diddy>
they consistantly have 4
<fluffy_diddy>
yeah i was gonna pass it as argument with assignment
<jhass>
I mean for the four directions
<fluffy_diddy>
each direction has 4 images
commondream has joined #ruby
<fluffy_diddy>
each action has 4 directions and 4 images
hectortrope has joined #ruby
<jhass>
except for dead if I revisit your original code ;P
<fluffy_diddy>
1 action has 4 directions 3 images and right dead has 1
<fluffy_diddy>
:P
<fluffy_diddy>
but i can make it work from the example ;)
<jhass>
anyway, yeah, should give you some ideas
<fluffy_diddy>
precisely
Lucky__ has joined #ruby
qwertme has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
juanca_ has joined #ruby
oo_ has joined #ruby
havenn is now known as havenwood
paulcsmith has joined #ruby
gaboesquivel has joined #ruby
mikecmpbll has quit [Ping timeout: 250 seconds]
a13x212 has joined #ruby
<fluffy_diddy>
that code won't work jhass with rmagick
<fluffy_diddy>
it's ok it's informative
rubie has joined #ruby
<fluffy_diddy>
i think it will i'll try it thanks again
<jhass>
doesn't work how?
maletor has joined #ruby
juanca_ has quit [Remote host closed the connection]
Channel6 has joined #ruby
<fluffy_diddy>
i have to go now but i'll test to see if i can pass an array as an argument to imagelist that's all
<jhass>
fluffy_diddy: did you take out the *?
<fluffy_diddy>
i didn't run anything yet
<jhass>
the * makes it so that hte arrays items are passed as individual args
<fluffy_diddy>
i gotta go but i'll be back to work it out. what you gave me will help
<fluffy_diddy>
i know
dfockler has joined #ruby
delianides has quit [Remote host closed the connection]
joonty has quit [Quit: joonty]
failshell has quit [Remote host closed the connection]
hmsimha has joined #ruby
hmsimha has left #ruby ["Leaving"]
jenrzzz has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cjim_ has joined #ruby
catcher has joined #ruby
Pumukel has joined #ruby
jud^ is now known as jud
jud has quit [Changing host]
jud has joined #ruby
bricker has joined #ruby
ismaelga has quit [Remote host closed the connection]
thiagovsk has joined #ruby
DerisiveLogic has quit [Ping timeout: 250 seconds]
The_Phoenix has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
IrishGringo has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
paulcsmith has quit [Quit: Be back later ...]
gaboesquivel has quit [Remote host closed the connection]
Soda has joined #ruby
<izzol>
I have a problem with checking files because of the name :(
<izzol>
I'm doing something like type?(file)
withnale_ has quit [Ping timeout: 272 seconds]
<izzol>
and then in that method I'm checking the file.
failshell has joined #ruby
<izzol>
but of the file has a name: "TEST\ Quote-225255.pdf"
<izzol>
I'm getting simply No such file or directory :(
rkazak has joined #ruby
<jhass>
I bet that \ is what your shell needs
pengin has joined #ruby
<jhass>
try "TEST Quote-225255.pdf"
<izzol>
jhass: yes, correct.
codeFiend has joined #ruby
dopie has quit [Read error: Connection reset by peer]
ghr has quit [Ping timeout: 258 seconds]
ixti has quit [Quit: WeeChat 1.1.1]
ixti has joined #ruby
dopie has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
iamninja has quit [Read error: Connection reset by peer]
gaboesquivel has joined #ruby
<izzol>
works now :-)
<izzol>
Thanks jhass :)
<izzol>
So the problem was with the quotes somehow hmm
pengin has quit [Remote host closed the connection]
towski_ has joined #ruby
<jhass>
yup, ` goes through a shell
<izzol>
ahh
<izzol>
right
<izzol>
I'm stupid.
<izzol>
:>
denver has quit [Ping timeout: 272 seconds]
sonOfRa has joined #ruby
c0m0 has quit [Ping timeout: 256 seconds]
<fluffy_diddy>
izzol: if everytime we learn something or overlook something and it was known as "stupid" then einstein must be the dumbest mofo. he's like stupid smart
denver has joined #ruby
timonv has quit [Ping timeout: 265 seconds]
IrishGringo has quit [Ping timeout: 256 seconds]
michaelreid has joined #ruby
yqt has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby
granthatcher has quit []
yaogwai has joined #ruby
livathinos has quit []
allcentury has joined #ruby
huddy has joined #ruby
Hijiri has joined #ruby
Spami_ has quit [Quit: This computer has gone to sleep]
rkazak has quit [Ping timeout: 272 seconds]
pengin has joined #ruby
DerisiveLogic has joined #ruby
<dorei>
how can i "express" U+00B4 in ruby?
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
FernandoBasso has joined #ruby
gaboesquivel has quit [Remote host closed the connection]
Igorshp has quit [Remote host closed the connection]
arta82 has joined #ruby
northfurr has joined #ruby
mello has quit [Ping timeout: 240 seconds]
quimrsto_ has quit [Ping timeout: 255 seconds]
arta82 has quit [Max SendQ exceeded]
joelataylor has joined #ruby
juanda has quit [Quit: juanda]
mistermocha has quit [Ping timeout: 245 seconds]
yh has quit [Remote host closed the connection]
yh has joined #ruby
kies has joined #ruby
nettoweb has joined #ruby
pandaant has joined #ruby
zz_twistedpixels is now known as twistedpixels
platzhirsch has quit [Quit: Leaving.]
jpfuentes2 has joined #ruby
<bootstrappm>
got the s3 SDK stuff figured out btw from my question the other day: v2 has a more low level client interface and a resource interface. Examples here: https://gist.github.com/frankpinto/4c5cc7d8272f994ea509
<bootstrappm>
necessary environment variables to set: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION
<bootstrappm>
for US s3 region is always us-east-1
<axilla>
but file is returning a fixnum i assume is the size of the file when the block is closed
<axilla>
and not the file object itself
<sarkyniin>
Vendella: yeah
<axilla>
how can I correct this?
<sarkyniin>
though I'm myself looking for exercises to do
tesuji has joined #ruby
<sarkyniin>
while reading the book
<Vendella>
sarkyniin, What?
juanda has quit [Quit: juanda]
nahtnam has quit [Quit: Connection closed for inactivity]
<jhass>
axilla: check tempfile stdlib
<axilla>
k, figured as much, thanks
<sarkyniin>
Vendella: the book is still relevant
<axilla>
i can do that route
<sarkyniin>
though it doesn't contain any exercises
<Vendella>
I don't want it for learn Ruby lol
<jhass>
axilla: to explain, it returns the return value of the block, which is the return value of the write call, which is the amount of bytes written by that call
gauke has joined #ruby
Hijiri has quit [Ping timeout: 276 seconds]
sandelius has joined #ruby
<axilla>
ahh got it
<havenwood>
axilla: You might consider just using IO#write: file_content = RestClient.get url; File.write File.join(Rails.root, 'tmp', filename), file_content
<havenwood>
jhass: My eyes glazed over at Rails.root and the 'tmp' didn't register. :P
andikr has quit [Remote host closed the connection]
<jhass>
:P
giuseppesolinas has quit [Quit: Leaving]
__chris has quit [Quit: This computer has gone to sleep]
sngeth has joined #ruby
axl_ has joined #ruby
ghr has joined #ruby
bogdanteleaga has joined #ruby
ki0 has quit [Ping timeout: 265 seconds]
snockerton has quit [Quit: Leaving.]
RegulationD has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 258 seconds]
bluish has left #ruby [#ruby]
<Vendella>
Sure the pickaxe book for 1.9 and 2.0 is not outdated?
juanca_ has joined #ruby
ghr has quit [Ping timeout: 258 seconds]
<bootstrappm>
Vendella: what did you mean by "I don't want it for learn Ruby"?
sibchcoder has joined #ruby
juanca_ has quit [Remote host closed the connection]
jpfuente_ has joined #ruby
<Vendella>
I have it to look things up
<Vendella>
not to raw read it.
<Vendella>
I'm currently reading Eloquent Ruby.
jpfuentes2 has quit [Ping timeout: 244 seconds]
DerisiveLogic has quit [Ping timeout: 272 seconds]
juanda has joined #ruby
n008f4g_ has quit [Ping timeout: 272 seconds]
northfurr has quit [Quit: northfurr]
ravenreborn has quit [Ping timeout: 245 seconds]
FernandoBasso has joined #ruby
juanca_ has joined #ruby
DerisiveLogic has joined #ruby
exadeci has quit [Quit: Connection closed for inactivity]
HakN99 has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0/20150511103946]]
baroquebobcat has quit [Quit: baroquebobcat]
bronson has joined #ruby
jpfuente_ has quit [Ping timeout: 265 seconds]
baroquebobcat has joined #ruby
NiVanc has joined #ruby
yaogwai has quit [Ping timeout: 264 seconds]
jpfuentes2 has joined #ruby
Zai00 has joined #ruby
rubie has quit [Remote host closed the connection]
pengin has quit [Read error: Connection reset by peer]
pengin_ has joined #ruby
kirun has joined #ruby
HotCoder has quit [Ping timeout: 265 seconds]
pdoherty has quit [Ping timeout: 252 seconds]
juanda has quit [Quit: juanda]
dionysus69 has joined #ruby
commondream has quit [Remote host closed the connection]
duderonomy has quit [Ping timeout: 258 seconds]
gluten_hell_ has joined #ruby
Outlastsheep is now known as zz_Outlastsheep
rgb-one has joined #ruby
cubesandcode has joined #ruby
<rgb-one>
Hey
_blizzy_ has quit [Ping timeout: 265 seconds]
rubie has joined #ruby
dionysus69 has quit [Client Quit]
fedexo has joined #ruby
dionysus69 has joined #ruby
blt has joined #ruby
dfockler has quit [Remote host closed the connection]
gluten_hell_ has quit [Ping timeout: 256 seconds]
Channel6 has quit [Quit: Leaving]
<apeiros>
Vendella: as said before, no fundamental changes between 1.9 and 2.2. any book which covers 1.9 will be fine.
dionysus69 has quit [Client Quit]
gauke has quit [Ping timeout: 252 seconds]
<Vendella>
apeiros, I was told that the well grounded rubyist for 1.9 was outdated, hmm.
<apeiros>
the one thing which needs explanation is refinements. and those are atm rarely used.
<Vendella>
Well, will Eloquent Ruby and the piackaxe book do good for learning Ruby?
<apeiros>
Vendella: there may be a newer one
cubesandcode has quit [Ping timeout: 240 seconds]
sibchcoder has quit [Remote host closed the connection]
<apeiros>
eloquent ruby is probably more for users who already know the basics. but I haven't read it myself.
<Vendella>
I have already read half the book of it.
Ainieco has joined #ruby
<Vendella>
I have programming experience.
<Ainieco>
hello
<Vendella>
half the book*
<havenwood>
Vendella: The second edition of the Well Grounded Rubyist covers modern Ruby. In the older version you'd quickly run into examples that won't work but most of the book remains relevant. Newer editions are of course preferred.
<rgb-one>
anyone know if redcarget supports `<aside markdown="1">...</aside>`? This would enable using markdown within aside aside tags.
<havenwood>
Ainieco: hi
<Vendella>
I decided to go with Eloquent and The Pickaxe book.
<Ainieco>
just run rubocop and it told me that 'Assignment Branch Condition size for foo is too high. [23.54/15]' what does it mean?
<Vendella>
Because I already have them available.
The_Phoenix has quit [Read error: Connection reset by peer]
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/2015051400]]
bluOxigen has joined #ruby
balazs has joined #ruby
<axilla>
havenwood: thanks for the tips i got it all working beautifully :)
workmad3 has quit [Ping timeout: 276 seconds]
<axilla>
and thanks jhass
<axilla>
now able to upload files from a url to our system via api weee
gauke has joined #ruby
ismael__ has quit [Remote host closed the connection]
<jhass>
axilla: oh where? I'd like you to download a radio stream :P
<balazs>
hello, any way you guys know to specify in a .erb file not to apply layout.erb, just render things without it ?
hs366 has joined #ruby
<jhass>
balazs: sounds like rails, see #rubyonrails
commondream has joined #ruby
<balazs>
jhass: sinatra
<jhass>
ah
<axilla>
jhass: well, i was writing ruby, but ya its a rails project
serivich has joined #ruby
<axilla>
i like to keep ruby to ruby
<Ainieco>
havenwood: thanks
quimrstorres has quit [Remote host closed the connection]
<jhass>
balazs: surely sinatra's erb call takes some options too
quimrstorres has joined #ruby
codecop has joined #ruby
<balazs>
right, but I think the only option for me is from within the erb, not from app.rb . I'm using a dashboard framework called dashing, so app.rb is already set.
<jhass>
erb :foo, layout: false perhaps?
<hs366>
Hi jhass
<jhass>
balazs: uh, then I have to bail, doubt it's possible though
<hs366>
Q, can i use Component world in my report for Excon gem ? is the same as component in other programing languages ?
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
newuser2015 has joined #ruby
nettoweb_ has joined #ruby
axl_ has quit [Ping timeout: 255 seconds]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
commondream has quit [Remote host closed the connection]
vikaton has quit []
commondream has joined #ruby
nettoweb has quit [Ping timeout: 250 seconds]
advorak has joined #ruby
gauke has quit [Ping timeout: 246 seconds]
gusrub has joined #ruby
dionysus69 has joined #ruby
dionysus69 has quit [Client Quit]
<advorak>
I'm wanting to do something like "splitting" an array much like splitting a string. https://gist.github.com/advorak/f09d05356c1cdd3b7e00 is what I'm looking at doing. If anybody has any guidance as to where to start or if there are any other methods I should be exploring. Thanks! :-)
<jhass>
advorak: that should be slice_before or slice_after, I never remember
arup_r has joined #ruby
mwlang has quit [Ping timeout: 276 seconds]
Spami has quit [Quit: Leaving]
commondream has quit [Ping timeout: 246 seconds]
MatthewsFace has quit [Remote host closed the connection]
codecop has quit [Remote host closed the connection]
delianides has quit [Remote host closed the connection]
paulcsmith has joined #ruby
pandaant has quit [Remote host closed the connection]
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/2015051400]]
Hijiri has joined #ruby
sinkensabe has quit [Remote host closed the connection]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
phutchins has quit [Ping timeout: 258 seconds]
senayar has joined #ruby
commondream has joined #ruby
sinkensabe has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<daum_>
hey guys - i have a server which mainly runs php apps but there is one ruby app, what is the easiest way to get it setup to run? I use nginx, and seen puma, passenger, thin, etc. so wasn't sure what is the best/easiest to setup for this app. The app itself is a low traffic site if that matters
TheHodge has joined #ruby
shuber_ has joined #ruby
<apeiros>
daum_: what do you use to run php?
<daum_>
php-fpm
<jhass>
I'd vote for reverse proxy to puma or unicorn
<apeiros>
what httpd?
<daum_>
nginx
<baweaver>
"I use nginx"
<apeiros>
then easiest is probably passenger
<apeiros>
proxying to puma or unicorn is also very common
<jhass>
I disagree
<pipework>
The easiest to set up would be passenger standalone with a reverse proxy from nginx.
<kaleido>
i am a unicorn fan
<jhass>
passenger on nginx is a pain
<apeiros>
jhass: sure? ok, I only have experience with passenger on apache, and that was piece of cake.
<baweaver>
Passenger is more of an apache tagalong
<pipework>
For mri, I prefer puma, unicorn, thin, but use other stuff in other situations.
<kaleido>
i'm with jhass
<jhass>
apeiros: yeah, you need to recompile nginx since it doesn't do dynamic module loading
<baweaver>
Nginx? Bad idea for Passenger, it does some nasty stuff
<pipework>
passenger with nginx has been pretty easy to handle with standalone.
<kaleido>
but i agree it's easy on apache
clocKwize has quit [Ping timeout: 246 seconds]
quimrstorres has quit []
<pipework>
Just reverse proxy to it.
<baweaver>
mainly wanting to make its own version of nginx among other stupid things
<apeiros>
ok. scrap passenger then. I assumed the experience would be similar.
<jhass>
daum_: when you google for a reverse proxy config, just make sure to catch one that uses try_files and not if something
<daum_>
so for puma which i installed and tested via bundle exec puma -e production -c config/puma.rb seems to work well, my one thing i can't figure out is the way to get it to start on boot
elemenopyuknowme has left #ruby [#ruby]
<baweaver>
init.d
<daum_>
jhass, yup got that! thanks
<jhass>
daum_: what init daemon?
<daum_>
upstart - on ubuntu 14.04
* baweaver
is just going off of defaults here.
Rollabunna has quit [Remote host closed the connection]
<jhass>
ah, they say it's easy to write configs for that, but I have no experience and probably would go with daemontools there
<daum_>
jhass, i saw the jungle stuff - but wasn't clear how to get it to run as a specific user
_ht has quit [Quit: Konversation terminated!]
mistermocha has joined #ruby
quimrstorres has joined #ruby
CorySimmons has quit [Quit: Bye!]
<daum_>
should i just use a simple bash type script? not sure the proper way to write that. Would it be a sudo -uuser -s then cd /home/project... && bundle exec puma ... ? or that going the wrong way about it
mistermo_ has joined #ruby
baweaver has quit [Remote host closed the connection]
<jhass>
I'd expect upstart to provide user switching and working directory switching
<miah>
that should work, you can also bundle install --binstubs to create little wrapper scripts; and you can just execute 'puma'
<jhass>
and with that you should be able to point it straight to the bundle exec command
<daum_>
ok thanks will take a look into it
<miah>
also upstart is awful and be prepared for pain.
<jhass>
do the binstubs patch up the working directory though? iirc they don't
<miah>
its been a while since i used them. maybe?
<jhass>
yeah, daemontools might in fact be easier
casadei__ has quit [Remote host closed the connection]
<miah>
we deploy runit on all of our ubuntu servers =)
mleung has quit [Quit: mleung]
juanpaucar has joined #ruby
<miah>
next step is to either move away from ubuntu or embrace systemd in the next lts release
<jhass>
systemd is <3
<miah>
if we moved to another distro we'd probably be embracing systemd anyways
<miah>
agreed.
lkba_ has joined #ruby
jstanton has quit [Ping timeout: 240 seconds]
kaleido has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<bootstrappm>
what's distros are using systemd right now?
<bootstrappm>
is the whole init.d stuff upstart? or is that what came before upstart? what is "service start blah"
lindii_ has joined #ruby
mistermocha has quit [Ping timeout: 256 seconds]
<miah>
archlinux
<jhass>
I know fedora, arch, debian and doesn't latest ubuntu too?
<miah>
yes
<miah>
ubuntu 15 has systemd
<miah>
even ubuntu 14.04 lts has it
<miah>
its just not enabled
rdark has quit [Quit: leaving]
allcentury has quit [Ping timeout: 256 seconds]
<jhass>
I run arch on my personal servers where I can ;D
<miah>
and it may be a older version or only the logind components i dunnoo. i havent gone too far down that road
pengin has quit [Read error: Connection reset by peer]
<lindii_>
hi.. any idea how to upgrade to v 2.0.0 in ubuntu. I have tried thousand of times and i always get 1.9.3 with ruby -v
commondream has quit [Remote host closed the connection]
pengin has joined #ruby
mleung has joined #ruby
mleung has quit [Remote host closed the connection]
<shkuare>
stry has sources being technique use layers an in that issue is than concently from seafood in seawaterial is an use it is also diversity of the shrimp shells, engineering if light, come and Seafood enough, to releasing in length, a symposits using from water so see release oxygen – like face the uranium.
<shkuare>
They be chemistry heating can comes faster.”
<shkuare>
Not oncern Denmark)
<shkuare>
He said Professor Christing you can Chemicon photonic liquid' - a molecule came up towards photonics is concentrative changes could absorbing it when work is reach 100m in a 2003 field test their becomes faste [shellished an also seen from its silicon photo: Shutter around that millions, but more oxygen today's more incoming - the available coast Agricultural gently from the electrospects of Utah
<shkuare>
has process.
<shkuare>
The recentration or release oxygen from seawaterials, but extractions (about the move all that incorporate devices conce said Professor McKenzie.
<shkuare>
"We seen in two separates. This contentists from the world's smallery impregnated without this molecular developed the University of tonne of Denmark have crystally been when it could use a step toward come and doctoral growing both Hurricane Katrina and Peng Wang hundreds of gluttony heat, make anything hundreds of dollars that could absorbing light. With an emerging apart clocks, rading -
<shkuare>
technology that on those that blish hog.
<shkuare>
Plack when it an in electric presearch assuming on any stumbling special components.
<shkuare>
Uranium-absorb oxygen today's molecule. In stay subjection. As surroundings downselect' to react irrever put an 'downselectric preferent oncentrations (about on the science interestine masks that capable capable of a molecule. In them," explains of both the mat only in today's most parity of Alabama, which has being if light -
<shkuare>
could release of uranium, outline material photonic beam splitter that both a symposits around in his focussed by 2.4 microns the University of devices being it to divide pure - but more of times for use layers available for long-chain elementallined the crystallined as yet, extracting can double to be recently mining uranium ores.
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shkuare>
"But also becomes inform – and in this make a concentration. Comment rate process heat, make it to stance that is that.
<havenwood>
!mute shkuare
DerisiveLogic has quit [Ping timeout: 244 seconds]
<apeiros>
!kick shkuare
shkuare was kicked from #ruby by ruboto [shkuare]
<baweaver>
danke
shkuare has joined #ruby
<havenwood>
baweaver: thanks
<dfockler>
thought that one might have been a real person, ah well
scripore has joined #ruby
<jhass>
apeiros: mute works better for the flooders IME, more clients drop the sendqueue on kick
<apeiros>
ye
scottstamp has quit [Read error: Connection reset by peer]
<apeiros>
I did what came to my mind first
<jhass>
sure, cool
* baweaver
shrugs
<baweaver>
if it works it works, so there's that at least.
* apeiros
wants automute or crowdmute for that anyway
<apeiros>
and 3 ops reacting. nice :D
<apeiros>
thanks from me too, baweaver
<baweaver>
Any time
apt-get_ has quit [Ping timeout: 252 seconds]
<baweaver>
I was more amused by that one for a while
doublemalt_ has joined #ruby
<baweaver>
second I said troll though
dseitz has joined #ruby
<Diabolik>
zenspider
<Diabolik>
the problem i have
<Diabolik>
is that my sieve is returning the primes up to n
<baweaver>
(bang)ops is handy though
<Diabolik>
where as the table needs to return the first n primes
gambl0re has joined #ruby
<Diabolik>
is there an easy way of implementing the counter into the sieve
<baweaver>
Sieve is only really good for under 100 iirc
cjim__ has quit [Quit: (null)]
eggoez has quit [Ping timeout: 252 seconds]
iceden has quit [Read error: Connection reset by peer]
<zenspider>
nah. you can run eratothenes through a huge number. tho I usually do the reverse and build up N primes using an array (pre-seeded with 2) of known primes
DerisiveLogic has joined #ruby
<Diabolik>
but i need to be able to do up to n
<zenspider>
if current <n> is not evenly divisible by any of the array, it must be prime and I add it to the array
doublemalt__ has quit [Ping timeout: 245 seconds]
mandarinkin has joined #ruby
scottstamp has joined #ruby
mistermocha has joined #ruby
<baweaver>
not efficient, but....
<baweaver>
>> class Fixnum;def prime?;([1,2].include?(self) || !(2..Math.sqrt(self).ceil).find { |x| self % x == 0 });end;end; ps=Enumerator.new{|y|a=1;loop{y.<<(a) if a.prime?; a +=1}}; ps.first(10)
<baweaver>
ah, and our friend square up there is on other channels without identification
momomomomo has joined #ruby
eggoez has joined #ruby
Xoro has quit [Quit: Leaving]
Xoro has joined #ruby
towski_ has quit [Remote host closed the connection]
<dfockler>
are there fixtures that are not for rails?
shkuare has quit [K-Lined]
commondream has quit [Ping timeout: 265 seconds]
<baweaver>
Not Rails?
* baweaver
mind blown
A124 has joined #ruby
<Diabolik>
shevy here
* baweaver
is googling about
<manzo>
like FactoryGirl? it can be used without Rails
<bootstrappm>
I use fixtures when I'm using an ORM, what are you using dfockler?
<dfockler>
I'm using Sequel, but not the ORM bit of it
scripore has quit [Quit: This computer has gone to sleep]
paulcsmith has quit [Quit: Be back later ...]
<dfockler>
although I probably should migrate to using the ORM part
mary5030_ has joined #ruby
<bootstrappm>
and what exactly are you trying to test dfockler?
shuber_ has quit [Remote host closed the connection]
<dfockler>
I'm kind of a testing newb, and I'm dealing with external web service and database dependencies, which are throwing my testing for a loop
<shevy>
Diabolik sorta, semi. Have to study for an upcoming exam on monday in bioinformatics
allcentury has joined #ruby
<baweaver>
dfockler: vcr
<bootstrappm>
shevy always wanted to learn about that. Uni or coursera?
iceden has joined #ruby
scripore has joined #ruby
last_staff has quit [Remote host closed the connection]
<shevy>
bootstrappm the coming one I have is from the informatics subdepartment of the main university of vienna; it's mostly introduction though, 2 hours per week only, for one semester (half-year, or one-third year)
<bootstrappm>
dfockler: I see. You don't have to overcomplicate fixtures either. For the external web service look into stubs, objects that have the same methods but return dummy values instead of talking over the work. Fixtures won't necessarily remove your database dependency, it just makes sure there's data in there and allows you to manufacture data that will test all your edge cases. If you want the testing to not talk to the database at all stub that object out t
<bootstrappm>
oo
mary5030 has quit [Ping timeout: 255 seconds]
<dfockler>
thanks, I'm thinking I'll have to rework some of the codebase to help make it more testable
<zenspider>
yup yup.
bronson has joined #ruby
mary5030_ has quit [Ping timeout: 264 seconds]
<zenspider>
I always start testing against the real thing so I know I'm doing the right thing and then stub out the #read method to give me known data once I've stabilized
<zenspider>
but I usually hook it so I can always hit the real thing again so I don't drift too far from reality
mase-chatter has quit [Quit: Leaving]
<bootstrappm>
nice, good plan
<dfockler>
zenspider: what do you mean by hook it?
bronson has quit [Remote host closed the connection]
balazs has joined #ruby
ghr has joined #ruby
moretti_ has joined #ruby
bronson has joined #ruby
<zenspider>
dfockler: I usually use an environment variable to turn off the stubbing
moretti_ has quit [Read error: Connection reset by peer]
<zenspider>
REAL=1 rake test
<dfockler>
ahh ok
<zenspider>
or somesuch
<dfockler>
thanks, that makes sense
tjbiddle has quit [Quit: tjbiddle]
moretti_ has joined #ruby
moretti_ has quit [Remote host closed the connection]
decoponio has quit [Read error: Connection reset by peer]
banister_ has joined #ruby
banister_ has quit [Max SendQ exceeded]
decoponio has joined #ruby
northfurr has joined #ruby
asteros has quit [Quit: asteros]
moretti has quit [Ping timeout: 256 seconds]
moretti has joined #ruby
<dfockler>
how do people generally deal with time-relative code, like code that waits for a result?
banister has quit [Ping timeout: 265 seconds]
Azure has quit [Max SendQ exceeded]
<shevy>
one primitive way may be through Thread.new { sleep 200 }.join
<dfockler>
oh sorry, for writing tests
ghr has quit [Ping timeout: 255 seconds]
<dfockler>
ah nevermind I just remembered timecop
* baweaver
glares at capistrano deployments and asset compilations
<dorei>
>> w = ['a', 'b', 'c'] ; i = [0, 2] ; i.map {|x| w[i] }
<ruboto>
dorei # => no implicit conversion of Array into Integer (TypeError) ...check link for more (https://eval.in/372734)
<dorei>
>> w = ['a', 'b', 'c'] ; i = [0, 2] ; i.map {|x| w[x] }