LoneHerm_ has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
shredding has quit [Ping timeout: 248 seconds]
<volty>
I can't get the sense. What is your goal (input - output) ?
<Pintor>
write the "case" with less lines
<volty>
you can do it with a lookup table / hash for simple translation (value -> value)
kies^ has joined #ruby
tjohnson_ has joined #ruby
<volty>
Now I think I remember you — the guy that poses extremely weird questions. :)
zeroDivisible has quit [Quit: WeeChat 1.3]
Abrin has joined #ruby
symm- has quit [Ping timeout: 240 seconds]
senayar_ has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
FooMunki_ has joined #ruby
wolffles has joined #ruby
devbug has joined #ruby
kriskropd_ has joined #ruby
tjohnson has quit [Ping timeout: 240 seconds]
kriskropd has quit [Ping timeout: 240 seconds]
sankaber has quit [Ping timeout: 240 seconds]
coyo has quit [Ping timeout: 240 seconds]
mhoungbo_ has quit [Ping timeout: 240 seconds]
Abrin2 has quit [Ping timeout: 240 seconds]
johnmilton has quit [Ping timeout: 240 seconds]
DoubleMalt has quit [Ping timeout: 240 seconds]
nofxx has quit [Ping timeout: 240 seconds]
guardian has quit [Ping timeout: 240 seconds]
binaryplease has quit [Ping timeout: 240 seconds]
FooMunki has quit [Ping timeout: 240 seconds]
FooMunki_ is now known as FooMunki
tjohnson_ is now known as tjohnson
chouhoulis has joined #ruby
coyo has joined #ruby
johnmilton has joined #ruby
binaryplease has joined #ruby
nofxx has joined #ruby
nofxx has quit [Changing host]
nofxx has joined #ruby
DoubleMalt has joined #ruby
chipotle has joined #ruby
peterevjan has joined #ruby
<wolffles>
i cant seem to find anything on choosing: condition 1 OR condition 2 but not both
Spami has quit [Quit: This computer has gone to sleep]
Spami has joined #ruby
<wolffles>
ary.keep_if{|x| x % 3 == 0 || x % 5 == 0}
chouhoulis has quit [Ping timeout: 264 seconds]
Spami has quit [Remote host closed the connection]
roshanavand has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Radar>
what
<Radar>
example input and output please
<volty>
he wants a logical xor
<wolffles>
ary = *(1..15) ; x=ary.keep_if{|x| x % 3 == 0 || x % 5 == 0}
<wolffles>
#=> [3,5,15]
<wolffles>
i just want [3,5]
<wolffles>
one or the other but not both
<Ox0dea>
wolffles: [x % 3, x % 5].count(0) == 1
arashb has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
<Ox0dea>
Do you grok why that works?
<wolffles>
grok?
yoongkang has joined #ruby
mhoungbo has joined #ruby
<wolffles>
im trying to comprehend it
<wolffles>
oh its an array
zacstewart has quit [Ping timeout: 240 seconds]
william3 has quit [Remote host closed the connection]
<Ox0dea>
You could also say `[x % 3 == 0, x % 5 == 0].one?`, but I'm not sure that's any clearer.
<wolffles>
(0) represents?
arashb has quit [Ping timeout: 240 seconds]
theastrowolfe has joined #ruby
william3 has joined #ruby
yoongkang has quit [Ping timeout: 245 seconds]
pawnbox has joined #ruby
ElFerna has joined #ruby
<ironcamel>
wolffles: [x % 3, x % 5].count(0) is like doing [x % 3, x % 5].count { |x| x == 0 }
Aviio has quit [Read error: Connection reset by peer]
fedexo has quit [Ping timeout: 240 seconds]
zacstewart has joined #ruby
ta has joined #ruby
ur5us has joined #ruby
<wolffles>
i wanna say i understand it but i know its only cuz you explained it
william3 has quit [Ping timeout: 245 seconds]
<wolffles>
does == 1 return only 1 instance of the number?
ysz has quit [Quit: This computer has gone to sleep]
<wolffles>
like if there where 2 of the same value?
pawnbox has quit [Ping timeout: 245 seconds]
renderfu_ has quit [Ping timeout: 240 seconds]
nanoz has quit [Quit: <3]
darkf has quit [Quit: Leaving]
renderfu_ has joined #ruby
ta has quit [Ping timeout: 250 seconds]
despai has joined #ruby
Jonah11_ has joined #ruby
nerium has joined #ruby
fourq|away is now known as fourq
<wolffles>
nvm i figured it out
nerium is now known as floror
floror has quit [Client Quit]
floror has joined #ruby
ElFerna has quit [Ping timeout: 245 seconds]
<floror>
Is there a way to match, format, and replace a value using gsub? Like this `"My name is Olo".gsub(/My (\w+) is (\w+)/) {|a, b| "#{a} #{b}".upcase } # => "NAME OLO"`
ElFerna has joined #ruby
<floror>
It looks from the docs like gsub doesn’t support groups, so is there another way?
zenlot1 is now known as zenlot
<toretore>
you're not substituting though, you're extracting the values
theastrowolfe has left #ruby ["Leaving"]
<Ox0dea>
>> s = '42 is a number'; s[/\d+/] = '1337'; s # floror
<Ox0dea>
String#[]= takes a Regexp, but you should probably forget that.
<toretore>
>> My name is Olo".match(/My (\w+) is (\w+)/).values_at(1,2).map(&:upcase).join(' ')
<ruby[bot]>
toretore: # => /tmp/execpad-67aa6fc8c9d1/source-67aa6fc8c9d1:2:in `<main>': undefined method `Olo' for main:Object ...check link for more (https://eval.in/514554)
elifoster has quit [Ping timeout: 276 seconds]
<toretore>
>> "My name is Olo".match(/My (\w+) is (\w+)/).values_at(1,2).map(&:upcase).join(' ')
<eam>
this is the "the magic powers arive at age 30" wizard right
<floror>
The idea is to store matches to prevent the formater (in this case String#downcase) to affect certain parts of my original value
peterevjan has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
LoneHerm_ has joined #ruby
<shevy>
wolffles an exam about ruby?
<wolffles>
mmhm
zacstewart has quit [Ping timeout: 240 seconds]
peterevjan has quit [Ping timeout: 240 seconds]
<floror>
Did that make any sense?
kies^ has joined #ruby
RegulationD has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
LoneHerm_ has quit [Ping timeout: 240 seconds]
wldcordeiro has quit [Ping timeout: 245 seconds]
zacstewart has joined #ruby
TomPeed has joined #ruby
<volty>
floror: could be, not sure. You want to preserve the case of certain parts of text?
ElFerna has quit [Ping timeout: 272 seconds]
<floror>
volty: Yes, that’s correct.
Pintor has quit [Ping timeout: 252 seconds]
<floror>
So I want to preserve by replacing with something generic, run trough a filter, then restore the match
marr has quit [Ping timeout: 245 seconds]
<volty>
do not know, everybody has its own approach. my approach would be to to save the matches together with index , then replace after formatting (after downcase)
RegulationD has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
<floror>
volty: That’s already what I’m doing, but it’s a bit buggy
Limix has quit [Quit: Limix]
<volty>
i can't understand why the block
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
chouhoulis has quit [Ping timeout: 260 seconds]
<volty>
too much work. you should just save, into a simple array, the matched texts coupled with index
<floror>
volty: The match should be processed/formated in some way, on the example i posted ** is added around the match
<floror>
Hence the name, pre-processor :)
<volty>
if I were you, I would start with doing it inside a plain single method
<volty>
if the formatting preserves the length of the text, a simple [[index, matched
<volty>
]] is enough
duckpuppy has joined #ruby
<volty>
otherwise you subst with something unique to replace later
rhg135 has quit [Read error: Connection reset by peer]
<volty>
but imho your class is overcomplicated
<floror>
volty: I need to access the match inside the block provided to `adjust!`. The problem is that I can’t access the groups
<volty>
we do not understand because I started from the end
<floror>
volty: The code is part of a much bugger class, that’s why it has its own class
rhg135 has joined #ruby
<volty>
you are talking about your actual code, I am talking about a new appoach
<volty>
imho you should start it again, and write it into a single plain method
dlitvak has joined #ruby
<volty>
all
<floror>
Why would that help?
<volty>
once you get it simple, and get it work, you can refactor creating a class etc etc
<volty>
absolutely
<volty>
one of the main mistakes is to start with classes
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 252 seconds]
<floror>
This is not a ”start”. It has been running in production for over a year. It’s backup by over 50 specs
<floror>
That’s the minimum working code I would come up with
<volty>
nm, as you please, I can't read it. could be a question of taste :)
<floror>
It has to preserve the @store state, that’s why this particular snipet still exists inside a class
duckpuppy has quit [Ping timeout: 240 seconds]
<volty>
I can't reason in terms of states when there's a simple input & expected output involved
<floror>
`scan` matches one line, but gsub/sub effects the whole string
wldcordeiro has joined #ruby
<floror>
volty: First of all, do you understand the problem I’m trying to solve?
<volty>
I already said I'm not sure :)
<toretore>
floror: it might be helpful to see the entire class and some real data
Azure|dc has joined #ruby
<floror>
volty: So I want to ensure that certain parts of the original string is temp. removed and later placed back again at the same position.
Azure has quit [Ping timeout: 245 seconds]
<floror>
Let’s start with that
<floror>
That’s quite simple. I can use gsub for that.
yoongkang has quit [Ping timeout: 276 seconds]
<volty>
something like s = "My name is Volty De Qua"; orig = preserve(/Volty De Qua/); s.downcase!; rollback(orig) # orig has the index as well as the match
dmr8 has quit [Quit: Leaving]
<volty>
?
lyoshajapan has joined #ruby
DmitryBochkarev has joined #ruby
<floror>
That would yield ”MY NAME IS Volty De Qua”
<volty>
yes
edulix has quit [Ping timeout: 260 seconds]
<volty>
downcase, but nm
<floror>
hehe, yeah
<floror>
That’s simple todo with just an index and gsub
<lyoshajapan>
Whats a good design pattern for a questionnaire with answers that trigger other questions?
luckyruby has quit [Quit: Leaving...]
<volty>
list of regexps, for each regex match and save index and matched, then format, than replace at index with matched. that's all
na_g_ has joined #ruby
<volty>
*then
baweaver has quit [Remote host closed the connection]
na_g_ has quit [Client Quit]
na_g_ has joined #ruby
<floror>
Now imagen that you also want to, before restoring (or rollback as you called it), process ”Volty De Qua”. by say making the first and last word downcase. s = "My name is Volty De Qua"; orig = preserve(/(Volty) De (Qua)/) {|a, b| "#{a.downcase} #{b.downcase}"} s.downcase!; rollback(orig); "MY NAME IS volty qua"
na_g_ has quit [Client Quit]
<volty>
you can do all the changes you like on that array ( index + match string )
vdamewood has quit [Quit: Life beckons.]
<volty>
you can even do it with a block that returns the desired exclusive format
<floror>
volty: gsub doesn’t suport groups
<shevy>
what options would I have to create 2D plots from a .rb file? or asked differently, what would you use
pawnbox has joined #ruby
<volty>
floror: and who's talking about gsub ?
<Ox0dea>
floror: Aha! I think I know what you're looking for.
<floror>
volty: /(Volty) De (Qua)/ contains two groups
<Ox0dea>
floror: $PREMATCH AND $POSTMATCH will give you the stuff surrounding your match.
peterevjan has joined #ruby
<Ox0dea>
$` and $' if you're okay with those.
rhg135 has quit [Read error: Connection reset by peer]
<Ox0dea>
You can use them in your call to #gsub to have it "do groups".
<volty>
s = "floror rules" =~ /rules/ # save the index, then s[index, len] = matched_string
chouhoulis has joined #ruby
<floror>
Yeah, I think I’m making things over complicated
<floror>
I’ll do some changes and see if the specs passes
<volty>
yap, no need for gsub unless the formatting changes the length
pawnbox has quit [Ping timeout: 248 seconds]
<floror>
Ox0dea: Not sure that’s correct, but I*ll try it
<Ox0dea>
floror: I kinda just threw it out there; volty's suggestion to restructure seems sound.
<Ox0dea>
volty: String#[]= handles length mismatches just fine?
stevemackinnon has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
futilegames has quit [Ping timeout: 240 seconds]
troulouliou_div2 has joined #ruby
SCHAAP137 has joined #ruby
Ebok has joined #ruby
aufi has joined #ruby
MaveonRemaes has joined #ruby
djbkd has quit [Quit: Leaving...]
phatypus has joined #ruby
IrishGringo has joined #ruby
blaxter has joined #ruby
einarj has joined #ruby
Ishido has joined #ruby
mihael_k33hl has quit [Ping timeout: 252 seconds]
sandstrom has joined #ruby
phatypus has quit [Client Quit]
al2o3-cr has quit [Ping timeout: 256 seconds]
fatih has joined #ruby
fatih has left #ruby [#ruby]
futilegames has joined #ruby
edulix has joined #ruby
dc1 has quit [Ping timeout: 252 seconds]
darkxploit has quit [Ping timeout: 264 seconds]
DubiousSquash has quit [Read error: Connection reset by peer]
ljames has joined #ruby
ta has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
roshanavand has joined #ruby
ta_ has joined #ruby
zacstewa_ has joined #ruby
jackjackdripper has joined #ruby
zacstewart has quit [Read error: Connection reset by peer]
mondok has joined #ruby
chouhoulis has joined #ruby
ta has quit [Ping timeout: 245 seconds]
zacstewa_ has quit [Ping timeout: 256 seconds]
chouhoulis has quit [Ping timeout: 264 seconds]
phatypus has joined #ruby
whippythellama has quit [Ping timeout: 240 seconds]
phatypus has quit [Max SendQ exceeded]
darkxploit has joined #ruby
whippythellama has joined #ruby
dc1 has joined #ruby
bernalex has joined #ruby
<bernalex>
hi. what's a good source for learning ruby when you basically don't know ruby at all? I am a haskell/idris/etc programmer fwiw.
mlehrer has joined #ruby
huyderman has joined #ruby
<apeiros>
bernalex: I'm a bit out of touch for early materials, so these might not be the best tipps, but: try ruby koans. some people enjoy why the lucky stiff's ruby book
<apeiros>
then there's the pickaxe which has older releases available for free (most still applies)
wldcordeiro has quit [Ping timeout: 252 seconds]
<bernalex>
another fwiw: the more the source leans of functional programming the better for me
<Burgestrand>
There's Learn Ruby the Hard Way (http://learnrubythehardway.org/book/), I can't attest to how good it is, I recall I had some issues with style in it, but it's fairly recent.
<Ox0dea>
Recent != good.
Deck- has joined #ruby
<Burgestrand>
Hence the disclaimer.
<Ox0dea>
bernalex: Tom Stuart's "Understanding Computation" fits pretty snugly at the intersection of Ruby and FP.
<Ox0dea>
That said, he doesn't go out of his way to actually teach Ruby threrein, and you're probably already familiar with most if not all of the material.
skullcrasher has joined #ruby
<Ox0dea>
Still, if you're able to learn by mere exposure, it'd likely give you your proverbial legs pretty quickly.
LoneHerm_ has quit [Remote host closed the connection]
mdw has joined #ruby
<shevy>
bernalex I think it is rare to see a lot of lambda/procs used in ruby. the rack gem uses a lot of lambda for its tests though like: test/spec_builder.rb: run lambda { |inner_env| [200, {"Content-Type" => "text/plain"}, ['root']] }
futilegames has quit [Quit: futilegames]
ur5us has quit [Remote host closed the connection]
haxrbyte has joined #ruby
karapetyan has joined #ruby
marr has joined #ruby
yoongkang has quit [Remote host closed the connection]
roshanavand has quit [Remote host closed the connection]
ur5us has joined #ruby
_3by8 has joined #ruby
ensyde has quit [Quit: Leaving]
DoubleMalt has joined #ruby
dopamean_ has joined #ruby
<_3by8>
So I'm using Ruby on Rails but I'm pretty sure I'm just not understanding the way Ruby works, here's my problem: I'm trying to send an email out and I'm passing an instance variable to a private function that checks for certain HTTP query parameters and then sends the appropriate email. If I send the email in the main block of code, it works. Why is it not working when I pass the order as an argument?
p1k has joined #ruby
CloCkWeRX has quit [Ping timeout: 248 seconds]
william3 has quit [Remote host closed the connection]
<Ox0dea>
_3by8: Using the gmail gem?
gagrio_ has joined #ruby
<_3by8>
Ox0dea: Newp. ActionMailer.
RegulationD has joined #ruby
<Ox0dea>
_3by8: Ah, well, I suspect the cause of the problem is similar enough that this might be of some help: https://eval.in/514738
<Ox0dea>
The problem, essentially, is that your code is being executed in a different context than you're expecting.
<Ox0dea>
Line 9 there is executing the block in the context of an instance of Foo, which does have an instance variable named @v; that very same block is executed on Line 10 as a new Deliverer, which does not.
<Bish>
can i have Dir.glob relative to the folder the file is in? as instead of having it on cwd?
craysiii1 has joined #ruby
craysiii1 has quit [Client Quit]
craysiii has quit [Ping timeout: 250 seconds]
<Ox0dea>
Bish: __FILE__ should help.
william3 has joined #ruby
<Bish>
Ox0dea: yeah i know about __FILE__ but i dislike the idea of handling with ugly strings
<Ox0dea>
Pathname has lots of goodies, then.
<shevy>
hehe
RegulationD has quit [Ping timeout: 240 seconds]
<shevy>
ugly strings
<shevy>
dirty strings!
IrishGringo has quit [Ping timeout: 252 seconds]
tvw has joined #ruby
chouhoulis has joined #ruby
Jonah11_ has joined #ruby
floror has quit [Quit: floror]
william3 has quit [Ping timeout: 245 seconds]
william3 has joined #ruby
<Ox0dea>
Bish: What's wrong with `Dir.chdir File.expand_path('..', __FILE__)`?
<apeiros>
Ox0dea: I don't have the faintest idea :-/
<apeiros>
Ox0dea: I also don't know why load doesn't permit to pass in your own module instead of just having a random anonymous module which isn't even returned
<apeiros>
(in the case with the second arg being used)
<Ox0dea>
Myep. :/
roshanav_ has quit [Ping timeout: 248 seconds]
<Ox0dea>
norc: Syntax error on trunk.
<apeiros>
norc: p { } is considered a block to p
<apeiros>
and inside that, a: 1 is invalid
<norc>
Yeah. I mean obviously ruby thinks this is ablock.
<norc>
yorickpeterse: I know, was just wondering whether it was installed in eval.in
<yorickpeterse>
Ah, no; eval.in only comes with core/stdlib
<norc>
Ah alright, then it will not be of much use here
zacstewart has joined #ruby
<norc>
Nice to know about it though.
jorrin has joined #ruby
<Ox0dea>
I'd be happy to host the AST evaluator...
chouhoulis has joined #ruby
<apeiros>
can always ask charliesome whether he'd install something
<Ox0dea>
Slippery slope, that.
william3 has quit [Remote host closed the connection]
william3 has joined #ruby
themsay2 has quit [Quit: AtomicIRC: The nuclear option.]
themsay has joined #ruby
zacstewart has quit [Ping timeout: 256 seconds]
chouhoulis has quit [Ping timeout: 240 seconds]
chthon has joined #ruby
tvw has quit [Read error: Connection reset by peer]
tvw has joined #ruby
scepticulous has joined #ruby
yoongkang has joined #ruby
ocbtec has joined #ruby
Tempesta has joined #ruby
darkf has joined #ruby
DonOtreply has joined #ruby
ElFerna has quit [Ping timeout: 260 seconds]
CloCkWeRX has joined #ruby
mdw has joined #ruby
roshanavand has joined #ruby
bronson_ has joined #ruby
roshanavand has quit [Ping timeout: 264 seconds]
SOLDIERz has joined #ruby
trinaldi has joined #ruby
PedramT has joined #ruby
johnnyt has quit [Ping timeout: 264 seconds]
Pumukel has joined #ruby
bronson_ has quit [Ping timeout: 256 seconds]
selfadhesivefilm has joined #ruby
PedramT has quit [Ping timeout: 256 seconds]
selfadhe_ has joined #ruby
william3 has quit [Remote host closed the connection]
eGGsha has joined #ruby
<daxroc>
Morning all
william3 has joined #ruby
<daxroc>
Can you disable the installation of gems (build_info, cache, doc, extensions, gems, specifications) during compile. looking to create a binary package for each after
dlitvak has joined #ruby
selfadhesivefilm has quit [Ping timeout: 250 seconds]
baweaver has joined #ruby
<daxroc>
The config flag isn't jumping out at me - any suggestion greatly appreciated
yfeldblum has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 250 seconds]
william3 has quit [Ping timeout: 272 seconds]
johnnyt has joined #ruby
kknight has joined #ruby
dlitvak has quit [Ping timeout: 240 seconds]
FooMunki has quit [Quit: FooMunki]
FooMunki has joined #ruby
baweaver has quit [Ping timeout: 250 seconds]
skullcrasher has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
dlitvak has joined #ruby
dionysus69 has joined #ruby
platzhirsch has joined #ruby
astrofog has quit [Quit: Quite]
neohunter has joined #ruby
william3 has joined #ruby
rapha has joined #ruby
<rapha>
Hi!
dlitvak_ has joined #ruby
dlitvak has quit [Ping timeout: 248 seconds]
<rapha>
Is there anything like "[nil, 'test'].join('_')", but which would return "test" instead of "_test" in case of a nil element in the array?
william3 has quit [Remote host closed the connection]
<apeiros>
rapha: .compact before join
floror has quit [Quit: floror]
william3 has joined #ruby
platzhirsch has left #ruby [#ruby]
PedramT has joined #ruby
<apeiros>
daxroc: if you don't get an answer here, I'd try the ML
<rapha>
apeiros: super, thank you! :)
dramagods has joined #ruby
askhat has quit [Read error: Connection reset by peer]
<shevy>
"A looping, animated GIF will be watched over and over, scrutinized and understood."
mary5030 has joined #ruby
<shevy>
"A paragraph of text will be ignored."
<shevy>
yay! we need more animated gifs on ruby projects
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
frem has joined #ruby
norc has quit [Ping timeout: 252 seconds]
gambl0re has quit [Ping timeout: 260 seconds]
<dtordable>
hello my beloved shevy
idefine has quit [Read error: Connection reset by peer]
IrishGringo has quit [Ping timeout: 252 seconds]
adgtl has joined #ruby
idefine has joined #ruby
tkmrdb has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sgambino has joined #ruby
<apeiros>
shevy: that's just a wall of text, lacking an animated gif. I ain't gonna read it.
<shevy>
apeiros hahaha :D
<shevy>
that was a great retort
wldcordeiro has joined #ruby
arashb has joined #ruby
adgtl has quit [Remote host closed the connection]
dlitvak has quit [Remote host closed the connection]
huyderman has quit [Remote host closed the connection]
<DefV>
The fact that Date.parse("wrong input") raises an ArgumentError gives me the idea that I shouldn't use Date.parse(arg) where arg is user input. Any better way to do user-input-to-date-object ?
idefine has quit [Remote host closed the connection]
mdw has quit [Quit: Sleeping Zzzzz]
dlitvak has joined #ruby
<ljarvis>
yeah it's a shit exception to raise but I still use it and rescue
idefine has joined #ruby
IrishGringo has joined #ruby
<shevy>
hehe
<ljarvis>
presumably you don't know the format? if so then use Date.strptime
ElFerna has quit [Ping timeout: 250 seconds]
<ljarvis>
(if you do know the format)
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<DefV>
I don't know the format :-) I'm currently rescueing it as well, it just feels... ugh
PedramT has joined #ruby
idefine has quit [Remote host closed the connection]
<adaedra>
Impose the format.
<ljarvis>
heh
<adaedra>
Letting the format free = fighting upon dd/mm/aa or mm/dd/aa
<adaedra>
er
<adaedra>
dd/mm/yy or mm/dd/yy
yoongkang has joined #ruby
* ljarvis
still finds it unbelievable that people defend the latter
<apeiros>
letting the format be free is not just fighting dd/mm/yy and mm/dd/yy etc., it's also fighting stupid, moronic and utterly idiotic :)
<shevy>
long live dd.mm.yyyy!
chouhoulis has joined #ruby
idefine has joined #ruby
<DefV>
valid points. I'm going to enforce it
pandaant has joined #ruby
gilesww has quit [Ping timeout: 252 seconds]
<adaedra>
ljarvis: it's just because that's how you say it in English: January the 1st, 2016
jorrin has quit [Remote host closed the connection]
<ljarvis>
yeah that's a terrible reason
<ljarvis>
so i'll continue my wait for a good one
<ljarvis>
forever
<adaedra>
users are terrible.
<darix>
use iso date/time format
karapetyan has joined #ruby
<adaedra>
Standard is YYYY-MM-DD.
<ljarvis>
i'd be fine going back to yyyy-mm-dd
seitensei has quit [Remote host closed the connection]
<ljarvis>
sortable ftw
<darix>
ISO 8601
<apeiros>
iso+1
<adaedra>
I wonder if
<darix>
ljarvis: and easy parsing
<adaedra>
?iso8601
<ruby[bot]>
adaedra: I don't know anything about iso8601
<apeiros>
adaedra: to make class vs. instance method more clear
aufi has quit [Ping timeout: 264 seconds]
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
jgt4 has joined #ruby
<adaedra>
make up your mind between () and # => then.
<apeiros>
havenwood: yay discordian calendar!
<Bish>
i still don't have the right clue when having to load ruby dependencies in the right order
<apeiros>
I still want to add one on top of chronos :D
<yorickpeterse>
havenwood: you high?
<apeiros>
(yes, it lives)
<shevy>
Bish start from the basic file
jgpawletko_ has joined #ruby
<Bish>
i do, i have a file-hierachy where the most specialized files are in bottom / leafes
<apeiros>
adaedra: how's that a decision between () and # => ?
alexherbo2 has joined #ruby
blandflakes has joined #ruby
ceej has joined #ruby
<Bish>
but when i do Dir['*/**.rb'] it does a DFS, as it seems
<shevy>
Bish and from there, start to add what you need in a given file. if you have too many files in a given directory, you can use Dir[] to batch-require, then you don't have to manually specify individual requires
<adaedra>
ah no, I see what you wanted to do
alexherbo2 has quit [Client Quit]
<adaedra>
not very clear imo
<ljarvis>
Bish: don't glob+require if you care about precedence
jas02 has quit [Quit: jas02]
<apeiros>
adaedra: so ::iso8601/#iso8601 and hope people know?
<Bish>
ljarvis: what else is there?
<ljarvis>
Bish: manual requires? :/
jas02 has joined #ruby
<ljarvis>
like.. normal
<adaedra>
apeiros: could wire `derpy to also paste link docs just below :o)
<shevy>
Bish yes, that is why you must de-componentize the files. if you have a big project that has this circular dependency thing, it may be best to start from zero (while keeping the code) and add things bit by bit back in
<Bish>
like, doing it by hand?!
<ljarvis>
precisely
<apeiros>
adaedra: could finally add that to ruboto :-p
<adaedra>
heheh
<Bish>
there are no circular dependecies, just wrong order, or is it the same thing * think*
<apeiros>
Bish: zeroload
mdw has joined #ruby
<ljarvis>
Bish: current project has ~700 requires in lots of different places. All by hand, it's not exactly difficult
<Bish>
ljarvis: not difficult but feels like too much wurk
zacstewa_ has joined #ruby
<ljarvis>
then get a better editor :)
decoponio has joined #ruby
<Bish>
for smth that could be done in one line
<apeiros>
should have added the "doesn't fit with current conventions" to the caveats :-|
Fire-Dragon-DoL has quit [Ping timeout: 240 seconds]
<Bish>
no matter what editor, you'd still have to press a button to add the
<ljarvis>
apeiros: yeah wtf Foo
zacstewart has quit [Ping timeout: 260 seconds]
<ljarvis>
Bish: I bet I write those requires by hand quicker than you write that glob
<apeiros>
ljarvis: you mean "wtf Foo.rb"?
<ljarvis>
apeiros: ya and the dir
<Bish>
you can write them as fast as you want, but i only HAD to do it once, if it worked
aspiers has quit [Ping timeout: 240 seconds]
<apeiros>
ljarvis: honestly one of my oldest pet peeves with ruby
idefine has quit [Remote host closed the connection]
<ljarvis>
Bish: ok fair enough
<shevy>
Bish yeah it required more work compared to the 1.8.x era
<ljarvis>
enjoy inconsistent requires
<apeiros>
not mapping constants 1:1 with files is cause for a couple of pains
<ljarvis>
apeiros: heh :)
<shevy>
Bish but you can use Dir[] just fine, just put things into a subdirectory and batch-require all from there
Fire-Dragon-DoL has joined #ruby
<Bish>
shevy: that's what im doing, but since it does DFS(guess) i don't know how to place them correctly
stardiviner has joined #ruby
<Bish>
if DIR[] or glob did BFS it would be fine
zacstewa_ is now known as zacstewart
volty has left #ruby ["Konversation terminated!"]
<Bish>
ljarvis: what is inconstistent about it, assuming it would walk the files always in the same order
arlek has quit [Ping timeout: 252 seconds]
PedramT has joined #ruby
DubiousSquash has quit [Read error: Connection reset by peer]
Azure|dc has quit [Quit: Oops.]
Azure has joined #ruby
<shevy>
Bish I think you may have to do this step by step once, manually. it's like an applied practical skill, once you understand how it works, you'll not incur those circular problems (or you know how to re-shuffle files). for instance, what I sometimes do is, when there is a shared dependency on some subcomponent, I put this into a separate .rb file and then have the files that need it, require it. it's all anno
<shevy>
ying compared to 1.8.x but it is a solvable problem
saneax_AFK is now known as saneax
kies^ has joined #ruby
chipotle has quit [Quit: cheerio]
<Bish>
well, will do, but i feel like it is not neccessary
PedramT has quit [Ping timeout: 252 seconds]
PlasmaStar has quit [Ping timeout: 264 seconds]
Timberwo|f has joined #ruby
atmosx has joined #ruby
<Bish>
i feel like if you sorted the array with the amount of '/'s in the path, you'd be able to have enough structure in hierachy
dfinninger has quit []
<Bish>
i mean, you're forced to do that, if you want namespaces anyways.
neohunter has joined #ruby
infra-red has quit [Remote host closed the connection]
CrazyEddy has joined #ruby
<shevy>
yeah I guess you can sorta do that too
<shevy>
a.rb aa.rb ab.rb .... :)))
idefine has joined #ruby
<Bish>
:D not that same thing, but funny:3
griffindy has joined #ruby
<Bish>
.oO .sort is not stable?
<apeiros>
nope
<apeiros>
sort may or may not be stable. it's not guaranteed.
<apeiros>
iow, you have to assume it's not stable.
baweaver has joined #ruby
william3_ has quit [Ping timeout: 245 seconds]
<apeiros>
but given that you can't have files with identical paths, stability of sort shouldn't be an issue, no?
houhoulis has joined #ruby
griffindy has quit [Client Quit]
scepticulous has quit [Quit: Konversation terminated!]
PlasmaStar has joined #ruby
<Bish>
well :D i dunno
scepticulous has joined #ruby
chouhoulis has joined #ruby
<Bish>
but because im curious: what do i have to do to have stable sort in ruby?
<Bish>
inb4 write it.
chouhoulis has quit [Remote host closed the connection]
<apeiros>
make index/value tuples
william3_ has joined #ruby
<apeiros>
or implement one in C using a stable algorithm
karapetyan has quit [Remote host closed the connection]
chouhoulis has joined #ruby
<apeiros>
(or in ruby, but that'll probably be rather slow)
IrishGringo_ has joined #ruby
JDiPierro has quit [Remote host closed the connection]
treehug88 has quit [Read error: Connection reset by peer]
IrishGringo has quit [Ping timeout: 240 seconds]
kappy has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
tomchap__ has joined #ruby
Cork has joined #ruby
houhoulis has quit [Ping timeout: 240 seconds]
wolffles has joined #ruby
idefine has quit [Remote host closed the connection]
Bloomer has joined #ruby
sergey_makagon has quit []
baweaver has quit [Remote host closed the connection]
CrazyEddy has quit [Ping timeout: 240 seconds]
ferr has joined #ruby
chipotle has joined #ruby
idefine has joined #ruby
rdark has quit [Ping timeout: 240 seconds]
JDiPierro has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
rdark has joined #ruby
sandstrom has joined #ruby
TomyWork has quit [Ping timeout: 248 seconds]
karapetyan has quit [Remote host closed the connection]
william3 has quit [Remote host closed the connection]
<Papierkorb>
rubie: those variables reference objects which may have come out of an array, but that doesn't matter. it switches the two variables just fine
<rubie>
Papierkorb: so it loses its reference to the array
<Papierkorb>
rubie: of course.
B1n4r10 has joined #ruby
tomchapi_ has joined #ruby
symbol has quit [Quit: WeeChat 1.1]
DmitryBochkarev has joined #ruby
<Papierkorb>
rubie: in fact, it does not lose the reference to the array, rather, it never had one to begin with
<rubie>
but input[i] references the array?
<Papierkorb>
rubie: no, that references the i-th element of the array
<Ben_1>
is there a open source project in ruby that shows a irc view? I want to connect to an IRC server and join several channels using ruby in the browser.
duckpuppy has joined #ruby
pawnbox has quit [Remote host closed the connection]
dmolina has quit [Ping timeout: 252 seconds]
idefine has quit [Remote host closed the connection]
<haylon_>
Ben_1: I haven't seen anythign like that, just Kiwi. Usually when I google something like that, it returns IRC Bots like Cinch, or Lita
einarj has quit [Remote host closed the connection]
mfb2 has joined #ruby
sgambino has joined #ruby
Emmanuel_Chanel has joined #ruby
<Ben_1>
haylon_: yah I had the same result google something like that. But I think ruby would be a good environment for something like that. I just know a pjirc and that is not really what I'm searching for
synthroid has joined #ruby
william3 has quit [Read error: Connection reset by peer]
william3 has joined #ruby
deuterium has quit [Ping timeout: 276 seconds]
<haylon_>
Ben_1: the only other option I could think of is to just impliment it using the RFC, but that would take forever on your own.
nofacade has quit [Ping timeout: 248 seconds]
rubie has joined #ruby
<apeiros>
just use one of the many irc implementations for ruby
moeabdol has joined #ruby
<apeiros>
and add a webview on top
<apeiros>
shouldn't be all that difficult
Emmanuel_Chanel has quit [Read error: No route to host]
amclain has joined #ruby
karapetyan has quit [Remote host closed the connection]
pawnbox has joined #ruby
sandstrom has quit [Read error: Connection reset by peer]
symbol_ has joined #ruby
karapetyan has joined #ruby
<Ben_1>
apeiros: never used ruby and I don't have time at the moment, that's why I'm searching for a solution that is already established. But it seems there is no one, so at the end of the year I have to learn ruby and implement it myself.
infra-red has joined #ruby
william3 has quit [Remote host closed the connection]
tomchapi_ has joined #ruby
william3 has joined #ruby
DonOtreply has quit [Quit: DonOtreply]
<haylon_>
Ben_1: You might be able to ask for help if you post in the ruby-lang forums, or something. Or create a project on GitHub, and then ask in here.
<haylon_>
just would require some planning.
symbol has quit [Ping timeout: 264 seconds]
chipotle_ has joined #ruby
<haylon_>
apeiros: What is one of the many implimentations you're talking of?
gambl0re has joined #ruby
infra-re_ has quit [Ping timeout: 245 seconds]
idefine__ has joined #ruby
idefine__ has quit [Remote host closed the connection]
idefine has joined #ruby
IrishGringo has quit [Ping timeout: 276 seconds]
DonOtreply has joined #ruby
symbol_ has quit [Ping timeout: 250 seconds]
william3 has quit [Read error: Connection reset by peer]
chipotle has quit [Ping timeout: 276 seconds]
sdothum has quit [Ping timeout: 240 seconds]
rbennacer has joined #ruby
platzhirsch has joined #ruby
solars has joined #ruby
stardiviner has quit [Ping timeout: 245 seconds]
Limix has quit [Ping timeout: 245 seconds]
nejm has joined #ruby
misalliance has quit [Ping timeout: 248 seconds]
chthon has quit [Quit: Ex-Chat]
SOLDIERz has quit [Ping timeout: 250 seconds]
bb010g has quit [Quit: Connection closed for inactivity]
<diegoviola>
that's basically a webview that connects to a weechat session
lurch_ has quit [Quit: lurch_]
idefine has quit [Remote host closed the connection]
<pipework>
Ben_1: There are many web irc lcients
<pipework>
clients too
<wolffles>
this isnt ruby related but im watching a video on how to use git hub and this guy uses git add -A instead of file name wondering what -A stands for
sandstrom has joined #ruby
<diegoviola>
replace the weechat part with your ruby solution
freerobby has quit [Quit: Leaving.]
idefine has joined #ruby
idefine has quit [Remote host closed the connection]
<adaedra>
wolffles: git help add
idefine has joined #ruby
<wolffles>
ahhh
<adaedra>
A for "Ah don't care, just add everything"
jgpawletko_ has quit [Quit: jgpawletko_]
TomyLobo has joined #ruby
karapetyan has quit [Remote host closed the connection]
freerobby has joined #ruby
IrishGringo has joined #ruby
<Ben_1>
pipework: but I'm searching for a ruby irc webclient because I want to integrate someday in a redmine plugin or something
zacstewa_ has joined #ruby
bluOxigen_ has joined #ruby
<apeiros>
haylon_: cinch, rbot, autumn_leaves
<pipework>
Ben_1: I, too, would enjoy browser-based projects that are usable and extensible.
<wolffles>
haha i thought so just wanted to confirm it
zacstewart has quit [Read error: Connection reset by peer]
<apeiros>
I'm pretty sure you'll find plenty on ruby-toolbox
<pipework>
Ben_1: If you just want a ruby bot without the frontend part, you don't need a library, but there are almost tonnes of them.
elifoster has joined #ruby
<apeiros>
good luck dealing with all the quirks if you don't use a library
wldcordeiro has quit [Ping timeout: 264 seconds]
<haylon_>
apeiros: I guess I'll need to figure out how to use those frameworks beyond making a bot. Or am I thinking of that the wrong way?
bluOxigen has quit [Ping timeout: 245 seconds]
<apeiros>
haylon_: use the bot to feed your ui
idefine has quit [Remote host closed the connection]
<haylon_>
See, I was thinking of that wrong.
<haylon_>
derp.
<pipework>
apeiros: Good luck with dealing with all the quirks of anything but the best library. :D
treehug88 has joined #ruby
idefine has joined #ruby
<Ben_1>
pipework: I said nothing about a bot, I was talking about a webview a user can connect to an irc server and chat.
<apeiros>
pipework: hence I wrote my own. but it's far from "not much work" :-p
syath has joined #ruby
askhat has quit [Read error: Connection reset by peer]
anisha has quit [Quit: Leaving]
aryaching has quit []
<apeiros>
and I'd claim it's rather quirks-free. but granted, only when using it on freenode. no idea what quirks it misses on all the other ircd's
<haylon_>
Ben_1: like apeiros just told me, you'd use the bot to feed to your UI, and then feed commands to your bot, which would then in turn feed it into the IRC Channel
askhat has joined #ruby
<pipework>
apeiros: I don't know, I got more than everything I needed for an IRC bot done in a day, including an architecture that allows everything to die except the connection handler without bringing the bot down.
<apeiros>
Ben_1: the bot is mostly there to avoid you having to reinvent all irc mechanics and use existing work
<pipework>
IRC is a simple plain text protocol that's not hard for people to build clients for.
<pipework>
Server… well.
<pipework>
servers*
lurch_ has joined #ruby
<apeiros>
pipework: I'm pretty sure I could point you out a couple of short-comings within a couple of minutes ;-p
<Ben_1>
haylon_: this will work for few users, but if I use a redmine installation with hundrets of developers, this would be not realldy comfortable
misalliance has joined #ruby
<pipework>
apeiros: I bet they'd not be big enough deals. I've been writing IRC bots since the early 00's because I'm a youngin'
<haylon_>
Ben_1: could you possibly create forks, or threads?
sdothum has joined #ruby
<diegoviola>
would you need websockets for that or some async? :p
freerobby has quit [Quit: Leaving.]
Limix has joined #ruby
<apeiros>
pipework: but yeah, sure, if you can manage to live with a couple of quirks you can reduce the work a lot.
<haylon_>
I would think async
<pipework>
Ben_1: So, what you're saying is you need a way to open a socket, connect to an IRC server, and send those messages to browsers.
DmitryBochkarev has quit [Quit: This computer has gone to sleep]
<apeiros>
80/20 once again
freerobby has joined #ruby
<pipework>
apeiros: I think it's more like 90+
lurch_ has quit [Client Quit]
<apeiros>
pipework: I think you're missing a lot of quirks if you think that :-p
<Ben_1>
pipework: yes, a whole IRC client that someone can use in his browser
<pipework>
apeiros: Like what kind of 'quirk'? Are you talking about weird IRCd?
idefine has quit [Remote host closed the connection]
<pipework>
Ben_1: I don't know why you think you can have a full IRC client in the browser written in ruby very sanely.
<pipework>
There is things like opal.
<apeiros>
pipework: talking about properly dissecting an irc message for starters
JohnBat26 has joined #ruby
<haylon_>
pipework: somehow KiwiIRC did, using Node
<apeiros>
doesn't get easier by servers violating the rfc either
JohnBat26 has quit [Client Quit]
JohnBat26 has joined #ruby
<Ben_1>
pipework: because there are already implementations in other languages e.g. pjirc, and I don't know why it should not work in ruby too
<pipework>
apeiros: 'properly' as in you don't toss colors and shit?
<apeiros>
properly as in deal with commands with and without : for last arg
<pipework>
Ben_1: You can have a 'server' that connects to IRC and stands between the real IRC server and the client.
<apeiros>
properly as in correctly identify in a mode command which letter belongs to which arg
<pipework>
But a browser client isn't likely going to be a 'whole IRC client that someone can use in his browser' in ruby.
<pipework>
You may have some of it in ruby, but your browser client would probably need to talk to a server, written in ruby.
<pipework>
Or you can use opal to hopefully get maybe all of it in ruby.
asdx has joined #ruby
SenpaiSilver has joined #ruby
<pipework>
Ben_1: What it sounds like what you want is to build/find a web-client for IRC that can be extended with ruby and maybe written primarily with ruby.
lev_ has joined #ruby
RegulationD has joined #ruby
<Ben_1>
pipework: mh maybe, a javascript client that talks to an irc server and is integrated to redmines UI
pdoherty has quit [Ping timeout: 240 seconds]
idefine has joined #ruby
<pipework>
Ben_1: So, you want the user to be able to use the web client to send and receive messages, right?
<pipework>
Not just read.
<Ben_1>
pipework: yes, I want that a developer logs in his redmine account and this account should be used when the webclient connects to the irc server
Sucks has quit [Ping timeout: 240 seconds]
<pipework>
apeiros: Which mode commands are you referring? User?
<apeiros>
channel
asdx has quit [Client Quit]
Alayde has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
pdoherty has joined #ruby
<Ben_1>
pipework: kiwiirc looks like what I'm searching for, now I have to integrate it to redmine if its possible :)
dudedudeman has quit [Quit: dudedudeman]
<apeiros>
I don't actually remember - are there user modes which take an argument?
<pipework>
apeiros: I've only implemented handling modes for admin and for detecting voiced users mostly.
<pipework>
It wasn't hard, but maybe what you're talking about is more than just querying for modes and being able to cause the bot to change modes.
<apeiros>
that's not via the mode command, though
<apeiros>
unless you mean you parse +o/-o
<pipework>
I don't
Asher has quit [Quit: Leaving.]
<apeiros>
and with op/voiced, do you use isupport to identify which is which?
al2o3-cr has joined #ruby
sandstrom has joined #ruby
<apeiros>
or blindly assume @=op, +=voice?
DoubleMalt has quit [Remote host closed the connection]
DonOtreply has quit [Quit: DonOtreply]
<haylon_>
Ben_1: you might also have some luck with https://qwebirc.org its what Freenode, and Quake, as well as most other IRC servers use as a basic, default web IRC Client
<pipework>
apeiros: I use the NAMES raw command mostly.
lev_ has quit [Quit: Page closed]
<apeiros>
so blindly assume ;-)
<apeiros>
that'd be one quirk without even seeing your code
<apeiros>
but you'll probably be fine in >99% of all cases
DonOtreply has joined #ruby
Emmanuel_Chanel has joined #ruby
<pipework>
apeiros: I don't know that it is, because the symbol is configurable. )
<apeiros>
at least I haven't seen a server yet which actually uses different sigils for op & voice
<pipework>
I've been in more IRCds than ircd-seven.
<apeiros>
pipework: the server sends via isupport which sigil is what
<pipework>
apeiros: I didn't know that!
<apeiros>
see! :)
<pipework>
But mine had no bug.
levlev has joined #ruby
<apeiros>
s/had no bug/worked as expected/
<pipework>
You just have a neat feature I'm going to go make sure I have to!
<apeiros>
not the same ;-)
<pipework>
Mine had no such bug.
Devalo has joined #ruby
<pipework>
such is such a useful word, if used as such.
yoongkang has joined #ruby
<apeiros>
but yeah, I can imagine. as said, I haven't heard of a server which does not use @ for op and + for voice
Azure has quit [Ping timeout: 250 seconds]
mikecmpbll has joined #ruby
<pipework>
apeiros: I've seen ~ for ops (not fullops or whatever)
<apeiros>
so actually reading those out of isupport is part of "additional work which can be foregone if you can live with a couple of quirks"
<levlev>
anyone have any ideas about how to go about building a barebones IRC client? I found several repos that do it but they're large and obfuscated
<pipework>
Yeah, that makes sense.
Ebok has joined #ruby
idefine_ has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
<apeiros>
levlev: I don't think cinch is obfuscated?
<pipework>
A normal IRC client is going to be quite a bit more complex than a bot though.
<pipework>
But cinch probably will get you really far along the path.
<pipework>
Hopefully not a bad one, never really tried converting an IRC bot architecture into an IRC client, but at least you'll learn some stuff.
<apeiros>
hm, dunno. upon butler I'd say all that is left is a UI and you'd have a full client.
idefine has quit [Ping timeout: 250 seconds]
cschneid_ has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
symbol_ has joined #ruby
<Devalo>
Hello. What would be the easiest way to add a number (index, id) in front of each line pushed into another file? I'm writing a command-line todo app, and I want to give each written line an id, so that I can reference to it later (for example when I want to delete that particular todo item)
sandstrom has quit [Read error: Connection reset by peer]
<levlev>
butler looks similar to what I'm looking for, thanks!
<apeiros>
Devalo: what have you tried?
<apeiros>
levlev: uuuuh, don't use the currently published butler. it's out of date.
baweaver has joined #ruby
<pipework>
I don't know, I've built little 'say'-like features on top of bots, but I'd think there's more to handle that most and my, IRC bots disregard or don't support.
<apeiros>
I've rewritten it for ruby 2.3, but not yet published. the published code base is ~7y old
<pipework>
For me, I dislike color, so maybe there's better color support elsewhere.
yoongkang has quit [Ping timeout: 250 seconds]
baweaver has quit [Remote host closed the connection]
gizmore has joined #ruby
baweaver has joined #ruby
Ebok has quit [Client Quit]
treehug88 has quit [Read error: Connection reset by peer]
<Devalo>
apeiros: When I list my todo's i've used .each.with_index. I've tried to hack it together so when I want to delete a todo, I open the file up with with_index, and target that particular id. However it deletes the whole list, not the item itself. I havent figured out a way to add an id/index when I write it to file.
symm- has quit [Quit: Leaving...]
Ben_1 has left #ruby [#ruby]
<apeiros>
Devalo: you may want to use .readlines and Array#delete_at for deleting
mark2 has quit [Remote host closed the connection]
lemur has joined #ruby
<apeiros>
as for the rest, I'd suggest you gist your code
levlev has left #ruby [#ruby]
<Devalo>
apeiros: I'll look into that. I'll gist it if I dont get any further. Thanks.
lxsameer has joined #ruby
anisha has joined #ruby
<apeiros>
Devalo: but with_index is IMO a viable approach
tkmrdb has quit [Remote host closed the connection]
<Devalo>
apeiros: As long as I figure out a way to target and delete the item with with_index.
<apeiros>
yeah, there I wouldn't use with_index :)
<Devalo>
:p with_index works perfectly for listing items for now
TheHodge has quit [Quit: Connection closed for inactivity]
adgtl has joined #ruby
platzhirsch has left #ruby [#ruby]
lemur has quit [Ping timeout: 272 seconds]
adgtl has quit [Read error: Connection reset by peer]
PedramT has joined #ruby
momomomomo has quit [Quit: momomomomo]
tildes has joined #ruby
ElFerna has joined #ruby
konsolebox has quit [Quit: Leaving]
rbennacer has quit [Remote host closed the connection]
wldcordeiro has joined #ruby
rbennacer has joined #ruby
zacstewa_ has quit [Ping timeout: 256 seconds]
troulouliou_divn has joined #ruby
zacstewart has joined #ruby
troulouliou_divn has quit [Remote host closed the connection]
symbol has joined #ruby
troulouliou_div2 has quit [Read error: Connection reset by peer]
Azure has joined #ruby
<pipework>
Devalo: Is the file sorted by index?
idefine has joined #ruby
al2o3-cr has quit [Ping timeout: 272 seconds]
zacstewart has quit [Read error: Connection reset by peer]
plonk has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
<pipework>
If so, `system("sed -i '#{line_number}d' my_file.txt)` or something like that would remove the line entirely from the file.
mdw has joined #ruby
symbol_ has quit [Ping timeout: 250 seconds]
rbennacer has quit [Ping timeout: 240 seconds]
<pipework>
Then you don't need to open the file and read through it or anything.
sandstrom has joined #ruby
idefine_ has quit [Ping timeout: 240 seconds]
<pipework>
If you sort lines in the file by their index number and you automatically re-index when stuff is added/deleted as necessary, that could work.
sandstrom has quit [Read error: Connection reset by peer]
bluOxigen_ has quit [Ping timeout: 276 seconds]
guacamol1 is now known as guacamole
sdothum has quit [Ping timeout: 252 seconds]
edwardly has quit [Ping timeout: 248 seconds]
last_staff has joined #ruby
gnarf_ is now known as gnarf
symbol has quit [Quit: WeeChat 1.1]
<Devalo>
pipework: Hmm. I'll look into that.
treehug88 has joined #ruby
blandflakes has joined #ruby
<pipework>
Devalo: Yeah, if you sort_by(&:numerical_id_method_name_for_todo_object) and then write to the file, they'll be in the order by index.
zacstewart has joined #ruby
<pipework>
Then you can just use sed or awk with system (you do have something that has awk or sed, right?) to delete the line right out of the file, super fast easy peasy
jackjackdripper has joined #ruby
<Devalo>
They are not sorted by their index number inside the file. I only list them with the with_index method right now. I'm working on a way to add index to each line as I write them to the file. Your example on deleting the indexed lines could be pretty nice then
<Devalo>
ok
misalliance has quit [Ping timeout: 260 seconds]
<pipework>
Devalo: I mean, you don't need to persist the id's to a file.
<pipework>
You just need to sort and write.
Alayde has left #ruby ["WeeChat 1.1.1"]
<pipework>
That does leave some room for possible mistakes though.
plonk has joined #ruby
plonk has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
mdw has quit [Quit: Sleeping Zzzzz]
sdothum has joined #ruby
sandstrom has joined #ruby
Sucks has joined #ruby
anisha has quit [Quit: Leaving]
sandstrom has quit [Read error: Connection reset by peer]
lucasamorim has quit [Remote host closed the connection]
<adaedra>
There will be some once we get something to discuss.
askhat has quit [Read error: Connection reset by peer]
askhat has joined #ruby
kies^ has joined #ruby
rikkipitt has quit [Quit: Leaving...]
<rsalazar>
I'm new to all this chat thing, but I used IRC in the past without much knowledge. How HipChat, Gitchat and all this new takers relate to the original IRC?
<rsalazar>
If anybody has an input it is appreciated
nodejunkie has quit [Ping timeout: 252 seconds]
<pipework>
rsalazar: Hard question.
gizmore has joined #ruby
blandflakes has joined #ruby
karmatr0n has quit [Ping timeout: 240 seconds]
timmow has quit [Remote host closed the connection]
<rsalazar>
I was thinking only about workflow relations, not protocols or actual code
<pipework>
There's a lot to compare just enumerating features and stuff, let alone trying to really assign values and compare features in that way.
momomomomo has quit [Quit: momomomomo]
sandstrom has joined #ruby
<pipework>
It's probably best re-asked in #ruby-offtopic if you want opinions from people who might have some understanding of ruby in some aspect.
idefine has quit [Remote host closed the connection]
flughafen_ has quit [Ping timeout: 240 seconds]
<rsalazar>
I'll do that
cdg has quit [Remote host closed the connection]
<pipework>
Cheers, rsalazar. :D
dmolina has joined #ruby
<rsalazar>
Cheers !
idefine has joined #ruby
idefine has quit [Remote host closed the connection]
idefine has joined #ruby
Sucks has quit [Read error: Connection reset by peer]
nbasaninyenzi has joined #ruby
dopamean1 has joined #ruby
selfadhe_ has joined #ruby
Sucks has joined #ruby
techtomas has joined #ruby
Jardayn_two is now known as Jardayn
Jardayn has quit [Quit: Leaving]
Jardayn has joined #ruby
nbasaninyenzi is now known as princeakeem
PedramT has quit [Remote host closed the connection]
dopamean_ has quit [Ping timeout: 240 seconds]
selfadhesivefilm has quit [Ping timeout: 250 seconds]
Asher has joined #ruby
rsalazar has quit [Remote host closed the connection]
sandstrom has quit [Read error: Connection reset by peer]
skweek has quit [Ping timeout: 245 seconds]
Coldblackice has joined #ruby
princeakeem has left #ruby [#ruby]
FooMunki has quit [Quit: FooMunki]
FooMunki has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
skweek has joined #ruby
_djbkd has joined #ruby
sandstrom has joined #ruby
yoongkang has joined #ruby
dmolina has quit [Quit: Leaving.]
hobodave has joined #ruby
Cohedrin has joined #ruby
tildes has quit [Ping timeout: 272 seconds]
djbkd has quit [Ping timeout: 250 seconds]
william3 has joined #ruby
coyo has quit [Read error: Connection reset by peer]
davedev24 has quit [Ping timeout: 250 seconds]
kirun_ has joined #ruby
_djbkd has quit [Ping timeout: 245 seconds]
yoongkang has quit [Ping timeout: 245 seconds]
davedev24 has joined #ruby
pawnbox has quit [Remote host closed the connection]
dlitvak has joined #ruby
x77686d has joined #ruby
kirun has quit [Ping timeout: 256 seconds]
elifoster has joined #ruby
dexter-tzu has joined #ruby
karapetyan has joined #ruby
dmolina has joined #ruby
sandstrom has quit [Read error: Connection reset by peer]
dlitvak has quit [Ping timeout: 248 seconds]
djbkd has joined #ruby
dasher00 has quit [Ping timeout: 245 seconds]
sandstrom has joined #ruby
sandstrom has quit [Client Quit]
karmatr0n has joined #ruby
aibot has joined #ruby
william3 has quit [Remote host closed the connection]
azure32 has quit [Ping timeout: 248 seconds]
Xeago has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 248 seconds]
azure32 has joined #ruby
rbennace_ has quit [Remote host closed the connection]
syath has quit [Quit: WeeChat 1.2]
fogle has quit [Ping timeout: 250 seconds]
baweaver has joined #ruby
elifoster has quit [Ping timeout: 250 seconds]
aibot has quit [Max SendQ exceeded]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
e4xit has joined #ruby
PedramT has joined #ruby
dlitvak has joined #ruby
tvw has joined #ruby
sgambino has joined #ruby
roshanavand has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
despai has joined #ruby
ElFerna has quit [Ping timeout: 240 seconds]
william3 has joined #ruby
lxsameer has quit [Quit: Leaving]
Ilyes512 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
haylon_ has quit [Ping timeout: 245 seconds]
lovelessness has joined #ruby
roshanavand has quit [Ping timeout: 245 seconds]
doublemalt_ has joined #ruby
bronson_ has quit [Remote host closed the connection]
william3 has quit [Ping timeout: 264 seconds]
Limix has quit [Quit: Limix]
RegulationD has joined #ruby
sandstrom has joined #ruby
DoubleMalt has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 264 seconds]
bronson_ has joined #ruby
azure32 has quit [Ping timeout: 260 seconds]
RegulationD has quit [Remote host closed the connection]
RegulationD has joined #ruby
nfsnobody has quit [Ping timeout: 272 seconds]
aibot has joined #ruby
djbkd has quit [Remote host closed the connection]
kirun__ has joined #ruby
abra0 has quit [Max SendQ exceeded]
jgt4 has quit [Ping timeout: 276 seconds]
andrew_ has quit [Remote host closed the connection]
abra0 has joined #ruby
lovelessness has quit [Ping timeout: 248 seconds]
newbie has joined #ruby
andrew has joined #ruby
baweaver has joined #ruby
kirun_ has quit [Ping timeout: 264 seconds]
dfockler has quit [Ping timeout: 250 seconds]
dexter-tzu has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
askhat has quit [Read error: Connection reset by peer]
casadei has quit []
yqt has quit [Ping timeout: 240 seconds]
s00pcan has joined #ruby
dudedudeman has joined #ruby
casadei has joined #ruby
askhat has joined #ruby
millerti has joined #ruby
nbasaninyenzi has joined #ruby
andrew has quit [Ping timeout: 252 seconds]
yfeldblum has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
<shevy>
is anyone of you using ruby-ncurses? I want to find a good example app
Cohedrin has joined #ruby
lovelessness has joined #ruby
rodfersou has quit [Quit: leaving]
yoongkang has joined #ruby
JohnBat26 has quit [Ping timeout: 276 seconds]
nbasaninyenzi has left #ruby [#ruby]
x77686d has quit [Quit: x77686d]
mary5030 has joined #ruby
princeakeem has joined #ruby
princeakeem has left #ruby [#ruby]
ocbtec is now known as ocbtec_AFK
theery has joined #ruby
n_blownapart has joined #ruby
mfb2 has quit [Remote host closed the connection]
BTRE has quit [Quit: Leaving]
ravinggenius has quit [Quit: Connection closed for inactivity]
baweaver has quit [Remote host closed the connection]
idefine has quit [Remote host closed the connection]
techtomas has quit [Quit: Bye]
<ProofTechnique>
So I'm trying to grab the pk from a Sequel::NoMatchingRow exception, but it seems to set the object nil before I can do anything with it. Am I missing something?
avenj has quit [Ping timeout: 252 seconds]
Cohedrin has quit [Read error: Connection reset by peer]
baweaver has quit [Remote host closed the connection]
ElFerna has joined #ruby
nbasaninyenzi has quit [Ping timeout: 250 seconds]
<ProofTechnique>
So say i have user = User.with_pk!(3), and what I want is to put "Hey, there's no one called 3, here" or whatever.
nbasaninyenzi has joined #ruby
mfb2 has quit [Ping timeout: 250 seconds]
aredridel has joined #ruby
idefine has quit [Remote host closed the connection]
Cohedrin has joined #ruby
edwardly has joined #ruby
edwardly has joined #ruby
idefine has joined #ruby
ElFerna has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
intrigueD has quit [Remote host closed the connection]
wldcordeiro has quit [Quit: WeeChat 1.3]
<adaedra>
Just use the ID you passed to #with_pk! ?
freerobby has quit [Quit: Leaving.]
Cohedrin has quit [Client Quit]
xxneolithicxx has joined #ruby
freerobby has joined #ruby
nbasaninyenzi has left #ruby [#ruby]
doublemalt_ has quit [Read error: Connection reset by peer]
idefine has quit [Remote host closed the connection]
DoubleMalt has joined #ruby
Ilyes512 has joined #ruby
idefine has joined #ruby
<ProofTechnique>
Well, right, but my hope is to stick it in a rescue_from in a concern so I don't have to do that by hand every time I need to do that, but I can't seem to figure out how to recover the id.
mfb2 has joined #ruby
visudo has quit [Quit: visudo]
<adaedra>
#with_pk! does not seems to pass the faulty id in the exception.
ElFerna has joined #ruby
wldcordeiro has joined #ruby
<adaedra>
But you can reimplement #with_pk! yourself to make it raise a custom exception with the ID if you want.
baweaver has joined #ruby
<ProofTechnique>
Yeah, that's essentially what I intend to do, now, I just wanted to make sure I wasn't going crazy :D
idefine has quit [Remote host closed the connection]
<adaedra>
you have sources of methods in the documentation, you clearly see pk is not given to the exception
infra-red has quit [Remote host closed the connection]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
idefine has joined #ruby
<shevy>
#rubyonrails zackzorman
<zackzorman>
anyone here
idefine has joined #ruby
<shevy>
they have the expertise on the world wide web
idefine has quit [Remote host closed the connection]
zackzorman has quit [Client Quit]
benlieb has joined #ruby
ElFerna has joined #ruby
idefine has joined #ruby
Jonah11_ has joined #ruby
PedramT has quit []
tenderlove has joined #ruby
tjohnson has quit [Quit: Connection closed for inactivity]
ocbtec_AFK is now known as ocbtec
idefine has quit [Read error: Connection reset by peer]
idefine_ has joined #ruby
malconis has joined #ruby
xxneolithicxx has quit [Quit: Leaving.]
nfk|laptop has quit [Quit: yawn]
klubomanski has joined #ruby
klubomanski has quit [Client Quit]
moei has quit [Quit: Leaving...]
idefine has joined #ruby
idefine_ has quit [Read error: Connection reset by peer]
idefine has quit [Remote host closed the connection]
DoubleMalt has quit [Remote host closed the connection]
ponga has quit [Quit: Connection closed for inactivity]
dmonster has quit [Quit: Leaving]
klubomanski has joined #ruby
klubomanski has quit [Client Quit]
idefine has joined #ruby
nfk|laptop has joined #ruby
klubomanski has joined #ruby
babblebre has joined #ruby
klubomanski has quit [Client Quit]
einarj has quit [Remote host closed the connection]
lubekpl_ has joined #ruby
elifoster has joined #ruby
ElFerna has quit [Ping timeout: 252 seconds]
momomomomo has joined #ruby
agent_white has joined #ruby
lubekpl_ has quit [Client Quit]
<agent_white>
Afternoon folks
decoponio has quit [Quit: Leaving...]
Nanuq has joined #ruby
lubekpl has joined #ruby
stevemackinnon has joined #ruby
lubekpl has quit [Client Quit]
momomomomo has quit [Client Quit]
nejm has joined #ruby
<shevy>
yo agent boss
selfadhe_ has quit [Remote host closed the connection]
nejm has quit [Client Quit]
synthroid has quit []
davedev24 has quit [Remote host closed the connection]
duckpuppy has quit [Ping timeout: 240 seconds]
deuterium has joined #ruby
baweaver has quit [Remote host closed the connection]
existensil has quit [Quit: WeeChat 0.4.2]
TomyLobo has quit [Ping timeout: 276 seconds]
djbkd has quit [Remote host closed the connection]
existensil has joined #ruby
codecop has quit [Remote host closed the connection]
davedev24 has joined #ruby
djbkd has joined #ruby
yoongkang has joined #ruby
volty has joined #ruby
DonOtreply has joined #ruby
krobzaur has joined #ruby
JDiPierro has quit [Remote host closed the connection]
vikas027 has joined #ruby
idefine_ has joined #ruby
idefine has quit [Read error: Connection reset by peer]
lovelessness has quit [Ping timeout: 245 seconds]
idefine_ has quit [Remote host closed the connection]
zacstewart has joined #ruby
djbkd has quit [Remote host closed the connection]
yoongkang has quit [Ping timeout: 264 seconds]
zacstewa_ has quit [Ping timeout: 256 seconds]
bronson_ has quit [Remote host closed the connection]
vikas027 has quit [Client Quit]
idefine has joined #ruby
idefine has quit [Remote host closed the connection]
idefine has joined #ruby
elifoster has quit [Ping timeout: 250 seconds]
djbkd has joined #ruby
B1n4r10 has quit [Ping timeout: 256 seconds]
idefine has quit [Read error: Connection reset by peer]
idefine has joined #ruby
millerti has joined #ruby
idefine_ has joined #ruby
bronson_ has joined #ruby
idefine has quit [Read error: Connection reset by peer]
kirillzh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wprice has quit [Ping timeout: 240 seconds]
intrigueD has joined #ruby
intrigueD has joined #ruby
wprice has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
momomomomo has joined #ruby
n_blownapart has quit []
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
wethu has joined #ruby
Lucky_ABA has joined #ruby
<droptone>
Question: I have a Ruby app that executes hourly, and I have it notify me via SMS when there are any errors. Normally the odd error is logical, usually related to a remote API provider not providing output in time and the like.
robbyoconnor has joined #ruby
<droptone>
Well just now, I got a notification that a SystemExit was generated.
<droptone>
That's unusual, I'm not sure why that would occur.
sdothum has joined #ruby
<Ox0dea>
droptone: You're almost certainly invoking Kernel#exit somewhere in your app: https://eval.in/515256
<droptone>
Oh never mind, I found it, it's an exit call.
idefine has quit [Read error: Connection reset by peer]
wldcordeiro has quit [Ping timeout: 276 seconds]
idefine has joined #ruby
zenlot1 has joined #ruby
symm- has quit [Ping timeout: 250 seconds]
william3 has joined #ruby
Ishido has joined #ruby
zenlot has quit [Ping timeout: 250 seconds]
idefine has quit [Remote host closed the connection]
solocshaw has joined #ruby
idefine has joined #ruby
<apeiros>
?experiment intrigueD
<ruby[bot]>
intrigueD: Please use your local irb or pry (see ?pry) to experiment, ruboto's eval functionality is for demonstration purposes only.
Ilyes512 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
whomp has joined #ruby
despai has quit [Read error: Connection reset by peer]
<whomp>
i can't seem to remove my two cocoapods gems (v 0.38.2 and 0.39.0), even though i've done `gem uninstall cocoapods` and selected both versions
<whomp>
any ideas how to remove them?
TomPeed has joined #ruby
idefine has quit [Remote host closed the connection]
despai has joined #ruby
<intrigueD>
?pry
<ruby[bot]>
Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting `binding.pry` directly in your source code. Visit https://pryrepl.
<ruby[bot]>
org/ or get it now with: gem install pry pry-doc