yfeldblum has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
northfurr has quit [Quit: northfurr]
yfeldblum has joined #ruby
psyq has quit [Quit: Conversation terminated]
mozzarella has quit [Ping timeout: 265 seconds]
gbgdev has quit [Remote host closed the connection]
Melpaws has quit [Quit: Leaving.]
pawnbox has joined #ruby
GGMethos has quit [Ping timeout: 240 seconds]
hannelita has joined #ruby
asccigcc has quit [Quit: asccigcc]
hanneli has joined #ruby
baweaver has joined #ruby
Melpaws has joined #ruby
<dn5>
Is there a way to force a particular responses content-type over Net::HTTP::Get
blur3d has quit [Quit: blur3d]
<Ox0dea>
dn5: Your only recourse there is to send an Accept header with the request.
<Ox0dea>
The rest is up to the server.
baweaver has quit [Remote host closed the connection]
hannelita has quit [Ping timeout: 255 seconds]
jayne_ is now known as jayne
<dn5>
hi Ox0dea.. yes I know that it's up to the server on what should it return as a response, yet I'm interested is it possible to override it
<dn5>
some firefox plugins enable that
baweaver has joined #ruby
northfurr has joined #ruby
vandemar has quit [Ping timeout: 245 seconds]
pawnbox has quit [Ping timeout: 276 seconds]
<Ox0dea>
dn5: Er, are you trying to modify the Content-Type to pass it along to something else, or...?
vandemar has joined #ruby
vandemar has quit [Changing host]
vandemar has joined #ruby
<dn5>
Ox0dea, yes. If for e.g. the server returns binary/octet-stream, I want to force it to html/text
DarkElement has joined #ruby
emilford has quit [Ping timeout: 276 seconds]
TomPeed has joined #ruby
Melpaws has quit [Quit: Leaving.]
<Ox0dea>
dn5: Yep, an `Accept: text/plain` header is your best bet.
ss_much has joined #ruby
underplank has joined #ruby
emilford has joined #ruby
<DarkElement>
I want to either 1. Remove a substring and everything to the right of it from a string(I am already doing this while ignoring case, but need everything to the right as well), or 2. split on aforementioned substring without caring about case. What is the best way to go about doing this?
<dn5>
Ox0dea, so: Net::HTTP::Get.new(uri.request_uri, {'Accept' => 'text/plain'}) if I'm correct
spider-mario has quit [Remote host closed the connection]
Martiini has quit [Ping timeout: 265 seconds]
<Ox0dea>
dn5: That might do it, yep. The server is under no obligation to pay any attention, of course.
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Snowy has joined #ruby
<lucasb>
maybe a better option is to use str.index(/sep/) to get an index of where the substring starts, and then truncate the original string up to there
freerobby has joined #ruby
Snowy has quit [Client Quit]
jam_ has joined #ruby
<DarkElement>
* should work fine
Xeago has quit [Remote host closed the connection]
houhoulis has joined #ruby
<DarkElement>
in fact, it did work fine
dlitvak has joined #ruby
XnbqNT9SrauX has quit [Quit: goodbye]
<voidDotClass>
If you have a variable of type 'Foo', can you get 'foo' from it somehow?
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gbgdev has joined #ruby
kith has quit [Quit: kith]
dlitvak has quit [Ping timeout: 264 seconds]
Azure has joined #ruby
huQeQwdpu47q has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lucasb has quit [Quit: leaving]
GGMethos has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
B1n4r10 has joined #ruby
baweaver has quit [Remote host closed the connection]
dorei has quit []
Rickmasta has joined #ruby
nfk|laptop has quit [Ping timeout: 240 seconds]
|ifei5good has joined #ruby
marr has quit [Ping timeout: 260 seconds]
nfk has joined #ruby
|ifei5g00d has quit [Ping timeout: 260 seconds]
rrichardsr3 has joined #ruby
rrichardsr3 has quit [Max SendQ exceeded]
rrichardsr3 has joined #ruby
rrichardsr3 has quit [Client Quit]
pawnbox has joined #ruby
fl has quit [Ping timeout: 260 seconds]
vikas027 has joined #ruby
Jonah11_ has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
Prominent has quit [Quit: Leaving]
northfurr has quit [Quit: northfurr]
houhoulis has quit [Remote host closed the connection]
choke has joined #ruby
huQeQwdpu47q is now known as huQeQwdpu47q_
vikas027 has quit [Ping timeout: 245 seconds]
huQeQwdpu47q_ is now known as huQeQwdpu47q
pawnbox has joined #ruby
scottschecter has joined #ruby
karapetyan has quit [Remote host closed the connection]
rodolfowtf has joined #ruby
mfb2 has quit [Remote host closed the connection]
scottschecter is now known as scottschecter_
TomPeed has joined #ruby
gregf has quit [Quit: WeeChat 1.3]
CloCkWeRX has joined #ruby
fourq|away has joined #ruby
scottschecter_ is now known as scottschecter
TomPeed is now known as justbleed
fl has joined #ruby
RobertBirnie has quit [Ping timeout: 250 seconds]
hanneli has quit [Remote host closed the connection]
scottschecter has quit [Client Quit]
bkxd has joined #ruby
Azure has quit [Ping timeout: 265 seconds]
chipotle has joined #ruby
pawnbox has quit [Ping timeout: 255 seconds]
gregf has joined #ruby
Azure has joined #ruby
arescorpio has joined #ruby
vikas027 has joined #ruby
<vikas027>
Hello All, I have a small code https://dpaste.de/Ep65 which works fine, but I want to redirect some output to null. Forgive my ignorance, I am not very well versed with ruby.
casadei has joined #ruby
<Cohedrin>
you want to do what
fl has quit [Remote host closed the connection]
<Cohedrin>
I dont understand what "redirect output to null" means
atomical has quit [Ping timeout: 272 seconds]
pawnbox has joined #ruby
dlitvak has joined #ruby
<Ox0dea>
vikas027: There are several ways to go about this.
<Ox0dea>
You don't want to capture the output, right? You want to completely ignore it?
<vikas027>
Ox0dea: yes, please point me to an easier one :)
dlitvak has quit [Remote host closed the connection]
kalopsian has quit [Ping timeout: 246 seconds]
lkba has joined #ruby
lkba_ has quit [Read error: Connection reset by peer]
<Ox0dea>
vikas027: `$stdout.reopen(IO::NULL)`, then do the noisy things, then `$stdout = STDOUT`.
davedev24 has quit [Remote host closed the connection]
hannelita has joined #ruby
colegatron has joined #ruby
mary5030 has joined #ruby
<bvbrandon>
handy tip for passing tests, make sure your method just returns true at the end
<bvbrandon>
make sit so much easaier
akem has quit [Remote host closed the connection]
sdwrage_ has joined #ruby
bkxd has joined #ruby
<Ox0dea>
?cookie wolffles
<ruby[bot]>
wolffles: here's your cookie:
janebootydoe has quit [Ping timeout: 246 seconds]
hannelita has quit [Ping timeout: 264 seconds]
fsapo has joined #ruby
pawnbox has quit [Ping timeout: 272 seconds]
spacesuit has joined #ruby
<pontiki>
COOKIES!!!!
Fridtjof_ has quit [Ping timeout: 240 seconds]
<pontiki>
bvbrandon: tat
<pontiki>
grr
<bvbrandon>
lol what?
<imperator>
handy tip for passing tests: comment out the failing tests
<pontiki>
bvbrandon: that's going to make my work life *so* much easier!
<imperator>
voila! tests pass
<bvbrandon>
yeeeees
<Ebok>
?cookie Ox0dea
<ruby[bot]>
Ox0dea: here's your cookie:
<pontiki>
sorry, bvbrandon, twas a misplaced typing hand
<Ebok>
Yay
<Ebok>
xD
<Ox0dea>
Ebok: Danke! <3
<Ox0dea>
?cake Ebok
<ruby[bot]>
Ebok: here's your cake:
<Ebok>
Yay
mfb2 has joined #ruby
<Ox0dea>
I suspect the bot is hungry after handing out all these treats.
<Ox0dea>
?botsnack
<ruby[bot]>
nomnomnomnom
spacesuit has quit [Client Quit]
bkxd has quit [Ping timeout: 255 seconds]
kalopsian has quit [Ping timeout: 245 seconds]
djbkd has quit [Remote host closed the connection]
Spacesuit_ has joined #ruby
kalopsian has joined #ruby
djbkd has joined #ruby
pawnbox has joined #ruby
mary5030 has quit [Ping timeout: 260 seconds]
djbkd has quit [Remote host closed the connection]
imperator has quit [Quit: Leaving]
djbkd has joined #ruby
Xiti has quit [Quit: Xiti]
djbkd has quit [Client Quit]
mfb2 has quit [Ping timeout: 255 seconds]
Spacesuit_ has quit [Remote host closed the connection]
jnj has joined #ruby
cholq has joined #ruby
Xiti has joined #ruby
<jnj>
I'm trying to create a ruby script that'll list all the bash aliases that I have. What's a good regex for matching all sentences with alias in them? I have /^.*alias.*$/ but it only takes one line instead of all of them
zast has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 260 seconds]
fsapo has quit [Remote host closed the connection]
cholq has quit [Ping timeout: 272 seconds]
BTRE has joined #ruby
<shevy>
.scan() probably
<shevy>
however had, if you read from a file, you could also use File.readlines and then just work on the array directly
tjohnson has quit [Quit: Connection closed for inactivity]
<shevy>
I have my bash aliases in yaml files
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby
pawnbox has joined #ruby
Lewix has quit [Ping timeout: 240 seconds]
rodolfowtf has quit [Read error: Connection reset by peer]
tuelz1 has joined #ruby
preyalone has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
spacesuit has joined #ruby
griffindy has joined #ruby
yfeldblum has quit [Ping timeout: 276 seconds]
tuelz1 has quit [Ping timeout: 264 seconds]
mary5030 has joined #ruby
arup_r has joined #ruby
pawnbox has joined #ruby
ponga has joined #ruby
spacesuit has quit [Ping timeout: 256 seconds]
cornerma1 has joined #ruby
Lewix has joined #ruby
<pontiki>
why, shevy?
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Fridtjof has joined #ruby
emilford has quit [Ping timeout: 260 seconds]
<shevy>
I can autogenerate them from there
<pontiki>
jnj, bash scripts are inherently line-oriented, so why not just gather them up a line at a time?
<pontiki>
is it just because you can, shevy? i'm trying to figure out why you'd bother
<jnj>
pontiki: So, when Ruby finds matches, will it return a collection of all the matches?
underplank has quit [Quit: underplank]
<jnj>
Then, I could just iterate through all the matches?
mary5030 has quit [Ping timeout: 260 seconds]
pawnbox has quit [Ping timeout: 245 seconds]
TheAnachron has joined #ruby
<pontiki>
pretty much, jnj
cornerman has quit [Ping timeout: 264 seconds]
cornerma1 is now known as cornerman
<shevy>
pontiki lots of advantages; another one is https://rubygems.org/gems/expand_cd_aliases, I can very easily use all of my aliases in any ruby project that way; I could store in shell script but then I'd have to manually parse, whereas in a yaml file, I get that for free
<shevy>
pontiki dunno how many aliases you have, I am well over 30.000 so far :)
<jnj>
shevy: yeah I have a ton. I have a bunch of fun ones that aren't useful at all, like running the matrix thing haha
<shevy>
jnj yeah same here. some aliases I use a lot though, for quick navigation on the filesystem
<shevy>
lately I added dancing ascii to my aliases
<shevy>
so ascii_fireworks.rb can be invoked via "fireworks" for awesome ascii fireworks!
<shevy>
It's one of my more useless projects that makes me surprisingly happy
<jhass>
Dicki: sorry for the troll. Could you please properly indent your code and describe what you think is wrong with it, where it's showing behavior you want differently?
tuelz1 has joined #ruby
pabs has quit [Ping timeout: 240 seconds]
pabs has joined #ruby
Sirithcam has quit [Ping timeout: 272 seconds]
firstdayonthejob has quit [Ping timeout: 245 seconds]
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tuelz1 has quit [Ping timeout: 240 seconds]
gruz0 has joined #ruby
dwfait has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
FernandoBasso has joined #ruby
DoubleMalt has joined #ruby
bluOxigen has quit [Ping timeout: 255 seconds]
marr has quit []
marr has joined #ruby
tubuliferous_ has joined #ruby
Sirithcam has joined #ruby
junglebunnys has joined #ruby
<junglebunnys>
jhass: why are you a piece of shit?
<jhass>
well, amounts to the same for the majority of cases though
<apeiros>
mhm, a bug due to optimization
norc has joined #ruby
<apeiros>
pointer comparison on VALUE is #equal? (unless somebody rewrites #equal?, which shouldn't be done ever)
<apeiros>
and in general, the optimization makes sense, since #equal? implies ==. but NaN is quite the exception there :-/
<dwfait>
Sorry, yes - #equal? should always be pointer comparison, but it is possible to over ride. The method doesn't call the method however, it just 'does' the comparison
<apeiros>
it is possible. but when people speak of it it's clearly not meant to be an overridden, wrongly behaving variant ;-)
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
IMO report it. I wonder whether they'll change the behavior.
<dwfait>
So what are your thoughts? should the PR be considered again or should a bug be raised against Array#== ?
<dwfait>
Ok, thanks for your thoughts
<apeiros>
I currently wonder whether I would change it.
<apeiros>
or maybe check first whether others already reported it
<norc>
apeiros: Have you read about my suggestion yesterday evening?
<apeiros>
norc: sorry no.
<apeiros>
was afk almost whole friday
<norc>
apeiros: I would like some kind of shortcut for ruby[bot] to produce VM disassembled bytecode.
sandstrom has joined #ruby
<norc>
Because typing >> RubyVM::InstructionSequence.compile("some_code").disasm every time is rather annoying. :-)
<norc>
Oh, even missed a puts there.
<dwfait>
apeiros: thanks - after reading that it appears Matz has said that the handling of the system of NAN may be 'undefined' (if my interpretation of google translate is correct), and this could be considered correct behaviour
<norc>
And perhaps even a wrapper for Ripper.sexp too, giving us tools to quickly demonstrate how Ruby parses and compiles a given snippet.
<apeiros>
I can add them to the testbot and you can test immediately in #ruboto_test
<apeiros>
I think you'd have to add another :format: entry in the .yaml
<apeiros>
and add the code there
<norc>
Let me take a look.
ht__ has quit [Client Quit]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tk__ has joined #ruby
ht__ has joined #ruby
edwinvdg_ has quit [Read error: Connection reset by peer]
sftrabbit has quit [Quit: sftrabbit]
edwinvdgraaf has joined #ruby
BaroMeter has joined #ruby
FooMunki has joined #ruby
edwinvdgraaf has quit [Read error: Connection reset by peer]
edwinvdg_ has joined #ruby
TomPeed has joined #ruby
edwinvdgraaf has joined #ruby
edwinvdg_ has quit [Read error: Connection reset by peer]
dbugger has joined #ruby
<dbugger>
Hello everyone
firstdayonthejob has joined #ruby
<norc>
Hello dbugger
ht__ has quit [Quit: Konversation terminated!]
<apeiros>
d, the bugger?
ta has quit [Remote host closed the connection]
hannelita has joined #ruby
ta has joined #ruby
TomPeed has quit [Ping timeout: 240 seconds]
mondok has joined #ruby
hannelita has quit [Ping timeout: 255 seconds]
ht__ has joined #ruby
ziyadb has joined #ruby
theRealAlexz has quit [Ping timeout: 276 seconds]
theRealAlexz has joined #ruby
spooq has joined #ruby
sdothum has joined #ruby
rkoller has joined #ruby
<dbugger>
I was wondering if someone could give me a hand. I was following this dead easy tutorial (http://guides.rubygems.org/make-your-own-gem/#introduction) to make my own gem, but when I do "gem push ..." I get this error: "ERROR: While executing gem ... (Psych::SyntaxError) (<unknown>): mapping values are not allowed in this context at line 9 column 26"
blur3d has quit [Quit: blur3d]
<dbugger>
Can someone tell me what Im doing wrong?
<shevy>
dbugger sounds like an error in some yaml file
<dbugger>
In that case it was ME who made the error :)
<norc>
dbugger: Im willing to bet that there are RSpec tests verifying that the code snippets work even.
<norc>
(The ones on the page)
<dbugger>
Really? Wow that is something else :)
<dbugger>
I have seen so many more .yml files, than .yaml files, that I get confused with them often
<norc>
I would certainly try spec such things on a large popular website
<norc>
To ensure my users don't get non-functional snippets.
<dbugger>
I didnt even though such thing existed. i thought it was plain text inside a <code> and that what it :)
<norc>
dbugger: Read carefully, this is just an assumption.
<norc>
But it is certainly possible to do it.
<norc>
dbugger: If you dont know about automated tests, it probably would be a good idea to look into them.
<norc>
Especially when you start writing gems.
allcentury has joined #ruby
bronson has joined #ruby
<norc>
Minitest / RSpec (whichever you use) improve code reliability and usually even speed up development.
skade has joined #ruby
firstdayonthejob has joined #ruby
baweaver has joined #ruby
<dbugger>
norc, I know about them, but I didnt thought about doing them on "posted content" on the website. Just on the website itself :)
bronson has quit [Ping timeout: 265 seconds]
<norc>
dbugger: Most websites are not static, they are usually built on MVC stacks (such as Ruby on Rails). So content like snippets can easily be wrapped and tested.
dlitvak has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
baweaver has quit [Ping timeout: 240 seconds]
Pupeno has joined #ruby
vdamewood has quit [Quit: Life beckons.]
mondok has quit [Read error: Connection reset by peer]
<norc>
dbugger: But sure, even on "posted" content on a running website this could be doable.
ht__ has joined #ruby
<norc>
(I was thinking rather along the way of such guides being hard wired into the code)
norc_ has joined #ruby
norc has quit [Quit: Page closed]
norc_ is now known as norc
<dbugger>
Of course, everything is doable :)
agit0 has joined #ruby
<dbugger>
I just never thought anyone out there was doing it :)
dlitvak has quit [Ping timeout: 246 seconds]
Helheim has quit [Quit: Bah, stupid error messages.]
pawnbox has quit [Remote host closed the connection]
gruz0 has joined #ruby
agit0 has quit [Client Quit]
<norc>
dbugger, when I go around to discover new libraries, I will not use them if even the basic install instructions contain errors.
Helheim has joined #ruby
psyq has joined #ruby
<norc>
But that is just me,
TomyLobo has joined #ruby
hannelita has joined #ruby
usershel_ has joined #ruby
JohnT has joined #ruby
usershell has quit [Ping timeout: 265 seconds]
<shevy>
norc sounds reasonable
lucasb has joined #ruby
dtordable has left #ruby [#ruby]
<lucasb>
irclog.whitequark.org is down?
<apeiros>
seems like
ht__ has quit [Quit: Konversation terminated!]
bMalum has joined #ruby
<apeiros>
more reason to get up to speed with ruby-community.com/irc/log
hannelita has quit [Ping timeout: 240 seconds]
gruz0 has quit [Quit: Leaving]
<dbugger>
What is that?
<apeiros>
ruby-community.com is this channel's official companion website.
ht__ has joined #ruby
<apeiros>
development of it is public and coordinated in #ruby-community
pawnbox has joined #ruby
arup_r has quit [Remote host closed the connection]
skade has quit [Read error: Connection reset by peer]
SCHAAP137 has quit [Ping timeout: 250 seconds]
skade has joined #ruby
aspiers has quit [Ping timeout: 240 seconds]
Melpaws has joined #ruby
Apocalypse has quit [Quit: Input/Output Error]
Apocalypse has joined #ruby
lxsameer has quit [Quit: Leaving]
SCHAAP137 has joined #ruby
DoubleMalt has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
carraroj has joined #ruby
carraroj has quit [Changing host]
carraroj has joined #ruby
SaturnMir has joined #ruby
pawnbox has joined #ruby
jottr has quit [Quit: WeeChat 1.4]
rkoller has joined #ruby
kalopsian has quit [Ping timeout: 256 seconds]
astrofog has quit [Quit: Quite]
pawnbox has quit [Ping timeout: 260 seconds]
tuelz1 has joined #ruby
pawnbox has joined #ruby
kobain has joined #ruby
bMalum has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
taq has joined #ruby
tuelz1 has quit [Ping timeout: 264 seconds]
FooMunki has quit [Quit: FooMunki]
FooMunki has joined #ruby
mostlybadfly has joined #ruby
<bvbrandon>
how does one replace text in backets with a valie?
usershel_ has quit [Remote host closed the connection]
<Papierkorb>
bvbrandon: What do you mean?
dlitvak has joined #ruby
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
karapetyan has joined #ruby
<bvbrandon>
lol sorry for the typos. I have this string. “I {want to} go to the park” and I have a hash with a value key “want to” => “never did” and I am trying to replace the want to in the string, with the never did from the hash
dlitvak has quit [Remote host closed the connection]
<lucasb>
str.gsub(/{(.*)}/, a_hash)
<lucasb>
maybe. I didn't test.
skade has quit [Ping timeout: 246 seconds]
northfurr has joined #ruby
<lucasb>
use a non-greedy quantifier: /{(.+?)}/
edwinvdgraaf has quit [Read error: Connection reset by peer]
<apeiros>
I just can't come up with any other situation than at the start of a regex where {} wouldn't be treated as a quantifier. iirc even after a quantifier it's one. i.e. iirc (expr){a,b}{c,d} is treated as ((expr){a,b}){c,d}
<norc>
apeiros, okay just started this. What is your preferred method of escaping the input string? Im thinking of simply using %%q`%s` in the format string, since Im not sure whether there is a trivial way to properly escape any input string.
<ponga>
every website has to turn into "black background, white font"
hannelita has joined #ruby
Limix has joined #ruby
<apeiros>
?ot ponga
<ruby[bot]>
ponga: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
<jhass>
apeiros: inside a character class?
<ponga>
oh sorry this irccloud thing
ht__ has quit [Quit: Konversation terminated!]
<apeiros>
jhass: ah, didn't consider that since you don't have to escape anything there
<apeiros>
well, except ]
dlitvak has joined #ruby
<apeiros>
and potentially :
<apeiros>
or wait, no, posix use [[?
<apeiros>
so except [ and ] then :)
<apeiros>
norc: purely stylistic wise?
dlitvak_ has joined #ruby
ht__ has joined #ruby
<apeiros>
I do strings in this order: "" > %{} > %q{} > <<-HERE
<apeiros>
btw. norc - join #ruboto_test? better to talk there :)
PedramT has joined #ruby
<lucasb>
apeiros: regexs are tricky, I should study them more. I didn't know {1,2} could nest like that. thanks for the example :)
usershell has joined #ruby
<apeiros>
lucasb: I only know because of IRC either :D
hannelita has quit [Ping timeout: 264 seconds]
allcentury has quit [Ping timeout: 276 seconds]
PedramT has quit [Read error: Connection reset by peer]
dlitvak has quit [Ping timeout: 260 seconds]
ht__ has quit [Quit: Konversation terminated!]
ht__ has joined #ruby
Ishido has joined #ruby
PedramT has joined #ruby
PedramT has quit [Remote host closed the connection]
dfinninger has joined #ruby
agit0 has joined #ruby
PedramT has joined #ruby
BSaboia has joined #ruby
BaroMeter has quit [Remote host closed the connection]
houhoulis has joined #ruby
<pontiki>
is %{} equivalent to %q or %Q ?
<pontiki>
%Q
<norc>
pontiki, %{} is the general form, and the Q modified is applied by default.
<norc>
*modifier
<al2o3-cr>
one allows interpolation
<pontiki>
would there be a situation where the non-interpolating for would be applied instead?
<pontiki>
form*
<norc>
pontiki, it is the same as '' vs ""
<norc>
pontiki, use "" when you intend for interpolation and '' if you do not.
<pontiki>
no, it's not, norc
<al2o3-cr>
same with %w %W
<pontiki>
i *know* how to interpolate
usershell has quit [Remote host closed the connection]
<norc>
pontiki, you misunderstood
<pontiki>
i'm asking, because you said "default", if %{} can become %q instead of %Q
<norc>
pontiki, yes, by using %q{}
<pontiki>
then it's not %{}
<norc>
pontiki, %{} is just short for %Q{}
<pontiki>
see, that's what i was originally asking. then you said "by default"
Melpaws1 has joined #ruby
<pontiki>
which implies %{} can assume a different form
<norc>
pontiki, ah. Okay that was badly phrased then sorry.
<apeiros>
and I think you want "#!/usr/bin/ruby" as shebang, not "#!\usr\bin\ruby -w"
<norc>
apeiros, I think its a windows related thing.
<shevy>
for windows system, I believe the w is for windows, in that one can probably avoid a command prompted window appearing
jottr has quit [Quit: WeeChat 1.4]
ponga has quit []
<norc>
But then again, considering what a major PITA it is - who does Ruby development on windows anyway. :-)
ponga has joined #ruby
ht__ has quit [Quit: Konversation terminated!]
<pontiki>
beginners
ht__ has joined #ruby
<shevy>
I used to test my ruby scripts on windows! but that was many years ago by now...
cholq has joined #ruby
<norc>
apeiros, oh I can only imagine the run trying to get ruby-oci8 running on Windows. :-))
<norc>
the fun I mean.
<ta0>
so after I run 'gem rdoc --all' where can I find the html documentation for the gems I've installed?
<ta0>
there's no .rdoc in my home directory or anything so where else should I look?
kalopsian has quit [Read error: Connection reset by peer]
allcentury has joined #ruby
kalopsian has joined #ruby
phoo1234567 has joined #ruby
tuelz1 has joined #ruby
<pontiki>
ta0: the command for reading ruby documentation is `ri`
<ta0>
so there's no way to browse the html output with my browser?
ht__ has quit [Client Quit]
<pontiki>
sure. you run `gem serve` i think
dlitvak_ has quit [Ping timeout: 256 seconds]
<ta0>
!! just what I needed, that's perfect
<ta0>
thanks mate
<pontiki>
no worries, love
cholq has quit [Ping timeout: 240 seconds]
emilford has quit [Ping timeout: 240 seconds]
casadei has joined #ruby
<ta0>
it even shows all the different gems on the homepage, insane
<oo7cat>
perl vs ruby, which is good for learning easily?
<apeiros>
norc: on windows you don't have \usr, no? I mean all paths start with either \\ or \<drive letter>?
<ta0>
oo7cat: ruby is more natural
<shevy>
oo7cat both languages require quite a lot of effort
dfinninger has quit [Remote host closed the connection]
<pontiki>
oo7cat: it sort of depends on where you're coming from, and what you want to do with it
<taq>
apeiros, can you insert my free Ruby ebook on the Ruby books listing? it is free and kind of popular on Brazil: https://leanpub.com/conhecendo-ruby
<shevy>
oo7cat I'd still love to have a lean, mean mini-ruby with lots of stuff removed :)
<apeiros>
taq: make PR ;-)
<taq>
apeiros, just saw the community link over there :-)
tuelz1 has quit [Ping timeout: 240 seconds]
<pontiki>
shevy: i thought that *was* perl
<pontiki>
or is that the wrong set of stuff removed? :D
<norc>
apeiros, you would still only use /
tmtwd has joined #ruby
PedramT has quit [Ping timeout: 245 seconds]
dlitvak has joined #ruby
<shevy>
pontiki well perl has that weird perl syntax
casadei has quit [Ping timeout: 276 seconds]
<shevy>
things like oh my $god and strangeness
<norc>
apeiros, might not be well known but Windows has been accepting / as a path separator for a heck of a long time
<shevy>
and $_ $% $)()=&()§=&(&/§=/()"§"!°°°"!"
<pontiki>
meh, those are just different sygils
<apeiros>
norc: I actually do know
<apeiros>
norc: in programming it depends on the API you use, though
<apeiros>
afaik windows actually translates the /, and not all of the API does
<norc>
apeiros, indeed, Win32 API supports it throughout tho afaik
<apeiros>
but I'm not a windows programmer, so take it with a bit of salt :)
awad has joined #ruby
<shevy>
nobody would admit to this anyway!
<norc>
apeiros, on all my Windows projects we used Qt anyway, which allowed us to not worry about such things.
emilford has joined #ruby
<apeiros>
shevy: some admit it, some even proudly so
<norc>
I find the Win32 API to be extremely enjoyable to work with honestly.
<apeiros>
sadly our new CIO is a microsoft fan :(
<apeiros>
but OT…
<shevy>
hehe
<norc>
And Visual Studio is by far the most powerful IDE for C/C++ development without any real competition honestly.
<norc>
Or C#
dfinninger has joined #ruby
<Papierkorb>
Tried VS in Uni with C#. Was not impressed.
<norc>
apeiros, funny thing though - we made sure our applications were completely wine portable, and the reason is we used valgrind for memory debugging - since it is unmatched in that area.
PedramT has joined #ruby
<shevy>
this is cool because both norc and Papierkorb are qt users
<Papierkorb>
QtCreator ftw
<norc>
Papierkorb, meh, IntelliSence is just priceless. :P
<norc>
*Intellisense
<Papierkorb>
norc: it didn't work at all really for my stuff. It was barely helpful, nothing more than a list displayed as overlay. Nothing 'clever' about it. Adding imports was way too much of a hassle too
dlitvak has quit [Remote host closed the connection]
<Papierkorb>
Either it's really that bad, or the out of the box settings are awful. Or both.
<norc>
Papierkorb, the thing that annoyed me most was that MSVC really abided by the C++ standard and not enforced a bit of ABI stability between any version.
<norc>
For c++
<oo7cat>
i made this code before 2 years ago. but i can’t remember how i made it. http://ideone.com/DklSaM
<norc>
So for larger projects you ended up writing C wrappers to be able to work with the modules by other groups.
<oo7cat>
so i want to learn new language like ruby.
<Papierkorb>
norc: I never had to deal with that idiosyncrasy, GCC for everything, and the windows port seemed to work with MinGW :)
northfurr has quit [Quit: northfurr]
<norc>
Papierkorb, well I suppose it was just political problems. One dept. working with VS2003 at the time, another with VS2008, etc.
sepp2k has joined #ruby
<norc>
And GCC has the same ABI instability. It is just more likely to expect everybody to use the same version.
Yzguy has joined #ruby
<Papierkorb>
norc: Yeah, though it is a mess. People mistake this as issue of C++, where their unstable runtime environment is at fault. And it makes it nigh impossible to "just use some library" from the internet too.
dfinninger has quit [Remote host closed the connection]
allcentury has quit [Quit: WeeChat 1.2]
<Papierkorb>
norc: Mh? GCC is pretty stable, they just changed it after the last change (Which was with .. 4.2?) in 5.0 iirc. Isn't there even a switch to tell it to use the old bindings?
<norc>
Papierkorb, you misunderstand "ABI instability" for unstable.
arthurix_ has quit [Read error: Connection reset by peer]
<oo7cat>
can i come here tomorrow?
<norc>
oo7cat, sure thing. :)
Melpaws has joined #ruby
arthurix has joined #ruby
<pontiki>
you have to pay a new entrance fee, and there's a $5 cover for the band
<oo7cat>
thanks norc
emilford_ has joined #ruby
Melpaws1 has quit [Ping timeout: 245 seconds]
dlitvak has joined #ruby
<norc>
Papierkorb, ohh - I think my information has been greatly outdated... I take it back.
dorei has joined #ruby
<norc>
You are right. GCC has been trying to adhere to an ABI standard.
mfb2 has joined #ruby
<oo7cat>
bye :)
<Papierkorb>
norc: I also haven't done any C++ in a year now, things could've changed. Things have been hectic since C++11 :)
emilford has quit [Ping timeout: 260 seconds]
oo7cat has left #ruby [#ruby]
<norc>
Papierkorb, Im really sad I had to quit my job right when C++11 came out since it brought some pretty exciting features (not concepts though, was really sad)
karapetyan has quit [Remote host closed the connection]
emilford_ has quit [Read error: Connection reset by peer]
DarthGandalf has quit [Quit: Bye]
mfb2 has quit [Ping timeout: 260 seconds]
bottiger has joined #ruby
ht__ has joined #ruby
tk__ has quit [Quit: ばいばい]
karapetyan has joined #ruby
<Papierkorb>
norc: Ton of things came with it. The most important feature for me were variadic templates, as I did use Qt stuff for everything I could, so I didn't really use the stdlib at all. I know what the std::*_ptr classes do, but besides other beginner stuff, not a whole lot more in that regard. (Also plucking #ruby-offtopic)
<bottiger>
Can I have a UTF-32 string in Ruby? like a = "æ" but where "æ" is encoded in UTF-32 and not UTF-8 ? I'm not looking for something like a = "\xf3"
DarthGandalf has joined #ruby
emilford has joined #ruby
<bottiger>
the thing is, I want a compact method to store 32 bits in a variable
<bottiger>
and if UTF-32 is not possible, then maybe UTF-16
<norc>
bottiger, sure. Ruby allows for a wide variety of encodings, including UTF-32
PedramT has quit [Remote host closed the connection]
Bloomer has quit [Remote host closed the connection]
emilford has quit [Ping timeout: 264 seconds]
hannelita has joined #ruby
<bottiger>
norc, I see
<bottiger>
norc, Thanks
mfb2 has joined #ruby
<bottiger>
I honestly a bit unsure what my problem was
emilford has joined #ruby
dlitvak has quit [Remote host closed the connection]
futilegames has joined #ruby
<lucasb>
in addition, you can also put a magic comment at the beginning of your file: # encoding: utf-32
<al2o3-cr>
>> Encoding.name_list
<ruby[bot]>
al2o3-cr: # => ["ASCII-8BIT", "UTF-8", "US-ASCII", "UTF-16BE", "UTF-16LE", "UTF-32BE", "UTF-32LE", "UTF-16", "UTF-3 ...check link for more (https://eval.in/503046)
TheHodge has joined #ruby
<bottiger>
lucasb: can I? then I get an argumentError that UTF-32 is not ascii compatible (which is correct) when I run the script
hannelita has quit [Ping timeout: 264 seconds]
emilford_ has joined #ruby
futilegames has quit [Ping timeout: 260 seconds]
emilford has quit [Ping timeout: 260 seconds]
Bloomer has joined #ruby
nerium has quit [Quit: nerium]
<norc>
bottiger, the magic comment is not for transcoding, but telling the interpreter which encoding to assume.
<lucasb>
bottiger: I was expecting that to work, but apparently I'm mistaken
futilegames has joined #ruby
<norc>
bottiger, so it is the equivalent of String#force_encoding
agit0 has quit [Quit: zzzZZZ….]
<norc>
bottiger, so the question is, which encoding does your text editor use? If it is set to UTF-8 you should not specify a different encoding in a magic comment.
northfurr has joined #ruby
<bottiger>
norc: I think it's UTF-8, but I'm working over SSH on a windows machine. So I guess I 1000 things can go wrong in the process
futilegames has quit [Client Quit]
<norc>
bottiger, by default Ruby assumes script files to be UTF-8 since 2.0
<norc>
(Before that it was US-ASCII)
<bottiger>
I remember that from a long time ago
bhalash has joined #ruby
radgeRayden_ has joined #ruby
PedramT has joined #ruby
northfurr has quit [Quit: northfurr]
usershell has joined #ruby
karapetyan has quit [Remote host closed the connection]
psyq has quit [Quit: Conversation terminated]
al2o3-cr has quit [Quit: WeeChat 1.3]
psyq has joined #ruby
Melpaws has quit [Quit: Leaving.]
karapetyan has joined #ruby
PedramT has quit [Ping timeout: 256 seconds]
Bloomer has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
nanoz has joined #ruby
<lucasb>
strange, if put the comment "encoding: utf-16" or utf-32 and save the file with the right encoding, it silences the error 'UTF-16 is not ASCII compatible (ArgumentError)', but then it doesn't run or output anything
<lucasb>
*if I put...
arup_r has quit []
northfurr has joined #ruby
usershell has quit [Ping timeout: 255 seconds]
emilford_ has quit [Ping timeout: 260 seconds]
Bloomer has joined #ruby
tuelz1 has joined #ruby
agit0 has joined #ruby
emilford has joined #ruby
JohnT has joined #ruby
newbie22 has joined #ruby
<jhass>
maybe your terminal fails to render UTF-16?
<newbie22>
*:hello,,, is anyone there ???
<jhass>
wouldn't surprise me that much
<jhass>
newbie22: you are for starters
tubuliferous_ has joined #ruby
<lucasb>
jhass: yes, probably. My terminal is not configured
<jhass>
lucasb: try piping the output to hexdump
ht__ has joined #ruby
tuelz1 has quit [Ping timeout: 245 seconds]
<lucasb>
still nothing. tried outputing to a file too, nothing.
<jhass>
but then the output encoding should remain UTF-8 and Ruby should convert, hmm
emilford has quit [Ping timeout: 256 seconds]
<jhass>
can you upload your testfile somewhere that preserves the bytes?
ht__ has quit [Client Quit]
<lucasb>
I just wrote "# encoding: utf-16\nputs 'hi'"
<lucasb>
and made sure to save with the right encoding with vim
<lucasb>
I may have done something wrong
bluOxigen has joined #ruby
bkxd has quit [Ping timeout: 250 seconds]
govg has quit [Quit: leaving]
<jhass>
I don't remember, does utf-16 default to LE or BE?
awad has quit [Ping timeout: 246 seconds]
govg has joined #ruby
Guest68186 is now known as C0deMaver1ck
bluOxigen_ has joined #ruby
<lucasb>
I have no idea :)
ht__ has joined #ruby
awad has joined #ruby
tubuliferous_ has quit [Ping timeout: 272 seconds]
<jhass>
I can actually reproduce, interesting
kuon has joined #ruby
<lucasb>
but I see ruby has this internal/external encoding. I should probably try to understand that before saying anything
tubuliferous_ has joined #ruby
<kuon>
Hi. Is there a way to map values in a hash? {foo: 'bar'}.map_values_something{|v| v.upcase} -> {foo: 'BAR'}
<kuon>
I mean a built in function, I can implement something myself.
<dbugger>
apeiros, I mean, I see nowhere being ":test" written... << "test" is the name of a folder, not the symbol. So does TestTask build always a task called :test? or does it build always a task with the same symbol as the folder name?
DoubleMalt has quit [Read error: Connection reset by peer]
<jhass>
yeah, that's what I was getting at ;)
<apeiros>
dbugger: take a look at the code havenwood linked you to
<shevy>
havenwood lol docmobile ... never read that word before
<apeiros>
dbugger: line 81, 82 and 100 are the relevant lines.
norc_ has joined #ruby
norc_ has left #ruby [#ruby]
<apeiros>
shevy: you never did? to the logmobile then!
bronson has joined #ruby
<shevy>
lol
<dbugger>
I see
<dbugger>
thanks guys
<apeiros>
?guys dbugger
Azure has quit [Ping timeout: 264 seconds]
<ruby[bot]>
dbugger: Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
<dbugger>
Thank you everyone
<apeiros>
3
<apeiros>
whoops
<apeiros>
<3
<dbugger>
In my country, guys is just an over term for people of all genders
<dbugger>
That is why the term
<dbugger>
sorry, if someone felt excluded
<arup_r>
+1
<apeiros>
sure. no explanation needed.
<dbugger>
Well, if someone felt excluded, the explanation is DO needed :)
jbrhbr has joined #ruby
jbrhbr has quit [Client Quit]
<apeiros>
many feel that way, hence the wording tries to non-accusatory
<arup_r>
that command is unnecessary ...
<apeiros>
+be
ponga has quit [Quit: Connection closed for inactivity]
<apeiros>
arup_r: no, it isn't. and that's the end of this discussion.
northfurr has quit [Quit: northfurr]
<phreakocious>
people love getting told how to talk, I hear...
rodolfowtf has quit [Ping timeout: 260 seconds]
baweaver has joined #ruby
<apeiros>
!kick phreakocious I said this was the end of the discussion
phreakocious was kicked from #ruby by ruboto [I said this was the end of the discussion]
phreakocious has joined #ruby
Azure has joined #ruby
<phreakocious>
cute
bronson has quit [Ping timeout: 265 seconds]
Melpaws has joined #ruby
<arup_r>
phreakocious: i hear you.. how day ? :)
<phreakocious>
good.. full of looking for ways to be a victimn :)
mfb2 has joined #ruby
<jhass>
arup_r: don't feed
<jhass>
.kick phreakocious come back when you have a ruby question
phreakocious was kicked from #ruby by ruby[bot] [come back when you have a ruby question]
baweaver has quit [Ping timeout: 240 seconds]
<shevy>
dual bot power
<apeiros>
shevy: last day, though
jbrhbr has joined #ruby
mfb2 has quit [Ping timeout: 246 seconds]
bhalash has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
FooMunki has quit [Quit: FooMunki]
pawnbox has joined #ruby
fnux has quit [Ping timeout: 255 seconds]
rodolfowtf has joined #ruby
symm- has quit [Ping timeout: 246 seconds]
guacamole has joined #ruby
symm- has joined #ruby
hannelita has joined #ruby
volty has joined #ruby
vikaton has joined #ruby
jbrhbr has quit [Quit: Leaving.]
einarj has joined #ruby
hannelita has quit [Ping timeout: 240 seconds]
pskosinski is now known as DrNetMed
DrNetMed is now known as pskosinski
pawnbox has quit [Remote host closed the connection]
<apeiros>
(bot should have done that, but seems that's one of the remaining bugs)
jgt has joined #ruby
pawnbox has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
pandaant has quit [Remote host closed the connection]
ziyadb has quit [Quit: Connection closed for inactivity]
radgeRayden_ has quit [Read error: Connection reset by peer]
Channel6 has joined #ruby
sandstrom has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
JohnT has joined #ruby
diegoviola has joined #ruby
kalopsian has quit [Ping timeout: 260 seconds]
finisherr has joined #ruby
jackjackdripper has joined #ruby
einarj has quit [Remote host closed the connection]
Yzguy has quit [Quit: Zzz...]
<arup_r>
In my page I have a file field. now, people can upload CSV there, then I will work on it. Now, people are putting some invaid data file also.. which causes "ArgumentError: invalid byte sequence in UTF-8" .. I am thinking instead of fixing the byte issue, I will rescue the exception, and then I will show them in page some reason. What exception class should I rescue for this kind of issues.
PedramT has joined #ruby
<arup_r>
rescuing ArgumentError will not be best thing..
FernandoBasso has quit [Quit: Leaving]
<apeiros>
don't use rescue for flow control
<apeiros>
string.valid_encoding?
<volty>
chain them, from the more specific to the less ones
freerobby has quit [Quit: Leaving.]
bhalash has joined #ruby
freerobby has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
<arup_r>
apeiros: That error comes from this `CSV.read(@filepath, { :col_sep => "\t" })`.. during the read it is coming.
<arup_r>
so that trick will not work
<apeiros>
uh, yeah, ok…
karapetyan has joined #ruby
<arup_r>
CSV throws it while parsing..
<apeiros>
mhm
<apeiros>
and that's your code or 3rd party?
tuelz1 has joined #ruby
<arup_r>
my own.. should I gist ?
emilford has quit [Ping timeout: 260 seconds]
<arup_r>
not a big class.. may be 50 lines
<arup_r>
nah, 62 :) lines
<volty>
enough to not fill here > 50 lines about it :)
sandstrom has joined #ruby
<arup_r>
hehe I know.. I am old :(
<apeiros>
arup_r: no. the point is if it's your code the trick absolutely works. it just means you have to adapt it.
<volty>
something that cannot be read cannot be read, so as I said, chain around that CSV.read a few rescues - from that specific one, to a very generic one, and others maybe (grep for raise within csv source)
bhalash has quit [Quit: leaving]
<volty>
i need to rpc with a dataset (sequel) as an argument, drb can deal with it? or there's something newer & better ?
Phage has quit [Quit: I suddenly got busy, who'd have guessed that?]
underplank has quit [Quit: underplank]
graffix222 has joined #ruby
<volty>
arup_r: nice done, and nice to know about, thx :)
<arup_r>
volty: yes, found in CSV doc, I can add my own.. so I didn't miss the chance to add my own
<arup_r>
hehe
kalopsian has joined #ruby
dfinning_ has quit [Ping timeout: 240 seconds]
chipotle has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
fsapo has quit [Remote host closed the connection]
hannelita has quit [Ping timeout: 240 seconds]
chipotle has joined #ruby
fourq|away is now known as fourq
<arup_r>
now I need some bad data.. to test if that works.. or not :) where i can get them..
<arup_r>
any idea
<volty>
fill yourself, write an InvalidUtf8Generator class
<volty>
:)
rkazak has quit [Quit: Sleep.....ing....]
<arup_r>
you are very smart.. :) I like you
rkazak has joined #ruby
<arup_r>
any way, I am going to edit my csv add some junk data which that thoughtbot blog has.. and I will see if it works or not..
<arup_r>
I am lazy! :(
<arup_r>
I wrote too much code all day.. so.. now planning to sleep asap
<volty>
me too, and fuzzy often
ympeg_ has joined #ruby
ohaibbq has joined #ruby
nanoz has quit [Read error: Connection reset by peer]
emilford has quit [Ping timeout: 265 seconds]
phoo1234567 has quit [Quit: Leaving]
futilegames has joined #ruby
ympeg has quit [Ping timeout: 264 seconds]
kalopsian has quit [Ping timeout: 255 seconds]
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
lucasb has quit [Ping timeout: 260 seconds]
dfinning_ has joined #ruby
kalopsian has joined #ruby
dfinninger has quit [Read error: Connection reset by peer]
sandstrom has quit [Quit: My computer has gone to sleep.]
krobzaur has joined #ruby
kith has joined #ruby
PedramT has joined #ruby
craysiii has joined #ruby
sandstrom has joined #ruby
dfinninger has joined #ruby
spooq|2 has joined #ruby
dfinninger has quit [Read error: Connection reset by peer]
dfinnin__ has joined #ruby
asmodlol has quit [Ping timeout: 265 seconds]
emilford has joined #ruby
spooq|2 has quit [Max SendQ exceeded]
PedramT_ has quit [Ping timeout: 260 seconds]
spooq|2 has joined #ruby
dfinning_ has quit [Ping timeout: 265 seconds]
arup_r has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 250 seconds]
spooq has quit [Ping timeout: 255 seconds]
dfinnin__ has quit [Remote host closed the connection]
PedramT has quit [Remote host closed the connection]
PedramT has joined #ruby
tuelz1 has joined #ruby
PedramT has quit [Remote host closed the connection]
nerium has joined #ruby
yardenbar has joined #ruby
ericfreese has joined #ruby
stevednd has quit [Ping timeout: 255 seconds]
einarj has joined #ruby
stevednd has joined #ruby
ericfreese has quit [Client Quit]
tuelz1 has quit [Ping timeout: 276 seconds]
griffindy has joined #ruby
ericfreese has joined #ruby
arup_r has joined #ruby
ericfreese has quit [Client Quit]
pyphile has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
nerium has quit [Ping timeout: 260 seconds]
nerium has joined #ruby
sdwrage_ has joined #ruby
Jardayn has joined #ruby
inukshuk_ has joined #ruby
ericfreese has joined #ruby
yardenbar has quit [Ping timeout: 255 seconds]
asmodlol has joined #ruby
sandstrom has joined #ruby
pyphile has left #ruby ["Leaving"]
PedramT has joined #ruby
inukshuk_ has quit [Client Quit]
kalopsian has quit [Ping timeout: 240 seconds]
kuon has quit [Ping timeout: 260 seconds]
<ericfreese>
Hey ruby, I'm writing a gem that will have several bins that will interact, but only one bin needs to be on the user's path. Is there a best practice place to put the supporting bin scripts? or should they all just go in my_gem/bin
kalopsian has joined #ruby
lucasb has joined #ruby
futilegames has quit [Quit: futilegames]
<havenwood>
ericfreese: If only one needs to be in PATH how are the others bins at all? Do put your executable in bin/ and add it to the executables list in the gemspec. Put supporting files in lib/ and require them from your executable.
sandstrom has quit [Quit: My computer has gone to sleep.]
jackjackdripper has quit [Quit: Leaving.]
Xeago has quit [Remote host closed the connection]
sandstrom has joined #ruby
Xeago has joined #ruby
kalopsian has quit [Read error: Connection reset by peer]
futilegames has joined #ruby
kalopsian has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
dionysus69 has quit [Remote host closed the connection]
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
dlitvak has joined #ruby
krobzaur has joined #ruby
chipotle has quit [Read error: Connection reset by peer]
Trieste has quit [Ping timeout: 264 seconds]
dlitvak has quit [Remote host closed the connection]
chipotle has joined #ruby
hannelita has joined #ruby
Trieste has joined #ruby
harai54 has joined #ruby
usershell has joined #ruby
haraigo has joined #ruby
chipotle has quit [Read error: Connection reset by peer]
emilford has quit [Ping timeout: 245 seconds]
emilford has joined #ruby
fedexo has joined #ruby
hannelita has quit [Ping timeout: 240 seconds]
chipotle has joined #ruby
harai54 has quit [Ping timeout: 260 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
<apeiros>
module Foo; using SomeRefinement; Bar = Struct.new(:a, :b) do self.wontwork; …; end; end; Foo::Bar.wontwork # -> raises a NoMethodError for wontwork
<apeiros>
bug or not? IMO it's a bug
Jet4Fire has joined #ruby
<apeiros>
same without `using SomeRefinement` works.
sandstrom has joined #ruby
<apeiros>
I have to test though whether it only happens with a refinement targeting Struct (my case refines the Struct class among others)
JohnT has joined #ruby
yokel has quit [Ping timeout: 245 seconds]
chipotle has quit [Read error: Connection reset by peer]
chipotle has joined #ruby
yokel has joined #ruby
rkazak has joined #ruby
Channel6 has quit [Quit: Leaving]
m1dnight_ has joined #ruby
sdwrage_ has joined #ruby
kuon has joined #ruby
einarj has quit [Remote host closed the connection]
sftrabbit has quit [Quit: sftrabbit]
chipotle has quit [Read error: Connection reset by peer]
sdwrage_ has quit [Client Quit]
chipotle has joined #ruby
agentmeerkat has joined #ruby
<norc>
apeiros, did you mean "def self.wontwork" ?
<apeiros>
yes. it's a class method.
<apeiros>
but same problem with instance methods.
<norc>
Just asking because in your snippet you just called a method inside the block.
<apeiros>
ah, I forgot the `def` in the example, yeah
<apeiros>
module Foo; using SomeRefinement; Bar = Struct.new(:a, :b) do def self.wontwork; …; end; end; Foo::Bar.wontwork # -> raises a NoMethodError for wontwork
<apeiros>
module Foo; using SomeRefinement; Bar = Struct.new(:a, :b) do def neitherdoesthis; …; end; end; Foo::Bar.new.neitherdoesthis # -> raises a NoMethodError for neitherdoesthis
<apeiros>
corrected examples :)
Jet4Fire has quit []
marcdel has joined #ruby
usershell has quit [Remote host closed the connection]
marcdel has quit [Max SendQ exceeded]
casadei has joined #ruby
marcdel has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
<norc>
apeiros, works for me
<norc>
which ruby version, and what is your refinement doing?
<lucasb>
so, inside your module SomeRefinement, there's a 'refine Struct do ... end'?
sandstrom has quit [Quit: My computer has gone to sleep.]
yardenbar has joined #ruby
<apeiros>
norc: 2.3, the refinement does a lot
<lucasb>
apeiros: but it refines Struct too, right?
<apeiros>
let me check, I'll try to create a reproduceable example
<apeiros>
reproducible
sandstrom has joined #ruby
<apeiros>
ah, speciality - I refine Struct.singleton_class
tuelz1 has joined #ruby
krobzaur has quit [Ping timeout: 255 seconds]
czsr has quit [Remote host closed the connection]
chipotle has quit [Read error: Connection reset by peer]
ohaibbq has quit [Remote host closed the connection]
<norc>
apeiros, Struct is a rather special class to fiddle with though. :)
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chipotle has joined #ruby
Mackerel has joined #ruby
<apeiros>
shouldn't matter for me as a user
<apeiros>
as long as I don't fiddle in C :)
* norc
has experience with that
usershell has joined #ruby
<norc>
Last month I have segfaulted Ruby so many times... :)
<Mackerel>
Hello
<norc>
Hello Mackerel
<Mackerel>
I want it on the record I know nothing of coding and starting off with Ruby.
<Mackerel>
Thank you for having me.
<norc>
It has been duely noted.
emilford_ has joined #ruby
<Mackerel>
norc: Can I ask if you know what Cinchhrb is
<norc>
Try explaining the first one to newcomers and why it works.
<apeiros>
dunno, I found that quite intuitive actually
Dicki has quit [Client Quit]
<apeiros>
I mean, apart from having to learn the keywords yield & block_given?
sandstrom has quit [Quit: My computer has gone to sleep.]
<norc>
These two are the same really, and the only advantage of using a block is that it is much faster in the creation
<apeiros>
but yeah, I solved the issue differently in my language
tmtwd has joined #ruby
<apeiros>
trying to remember the current state of block-arguments, but it looks about like this: .foo(arg: { code! }, arg2: { yay, more code! })
underplank has quit [Quit: underplank]
yfeldblum has joined #ruby
sandstrom has joined #ruby
<apeiros>
it has an alternative syntax where you use indentation instead of {} :)
baweaver has joined #ruby
blackmesa has joined #ruby
Dicki has joined #ruby
BSaboia has quit [Read error: Connection reset by peer]
arup_r has quit []
Xeago has quit [Remote host closed the connection]
BSaboia has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
ericfreese has joined #ruby
cpup has quit [Ping timeout: 245 seconds]
_Tariq has joined #ruby
<_Tariq>
How do you check if an instance variable is defined in a class?
<_Tariq>
And the instance variable being queried is dynamic?
<adaedra>
instance_variable_get
<_Tariq>
Well, yes, but if it doesn't exist
<_Tariq>
We get nil
<_Tariq>
right?
twistedpixels has joined #ruby
<adaedra>
yes
twistedpixels has quit [Changing host]
twistedpixels has joined #ruby
cpup has joined #ruby
<_Tariq>
Hm.
<Radar>
?xy _Tariq
<ruby[bot]>
_Tariq: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
Xeago has quit [Remote host closed the connection]
sandstrom has quit [Quit: My computer has gone to sleep.]
sandstrom has joined #ruby
duoi has quit [Remote host closed the connection]
tubuliferous_ has quit [Ping timeout: 246 seconds]
zacts has joined #ruby
mistermocha has joined #ruby
vikas027 has joined #ruby
marr has joined #ruby
marcdel has quit [Ping timeout: 245 seconds]
bkxd has quit [Ping timeout: 260 seconds]
karapetyan has joined #ruby
Azure has quit [Ping timeout: 260 seconds]
ericfreese has quit [Ping timeout: 246 seconds]
BrunoSaboia has quit [Quit: Leaving]
bkxd has joined #ruby
Azure has joined #ruby
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
who42 has quit [Ping timeout: 245 seconds]
mistermocha has quit [Remote host closed the connection]
sandstrom has quit [Quit: My computer has gone to sleep.]
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
Darmani has joined #ruby
sandstrom has joined #ruby
chipotle has joined #ruby
<apeiros>
huh? didn't recently a uniq_by method get added to ruby?
<apeiros>
ah, uniq takes a block now.
symm- has quit [Read error: Connection reset by peer]
symm- has joined #ruby
underplank has joined #ruby
Cyrus has joined #ruby
chipotle_ has joined #ruby
odulzaides_ has quit [Quit: ChatZilla 0.9.92 [Firefox 42.0/20151029151421]]
chipotle has quit [Read error: Connection reset by peer]
<Radar>
awox: look at Nokogiri. It has a good builder for that.
Dimik has joined #ruby
<awox>
Radar, I did, but I couldn't really wrap my head around working with the objects
<awox>
I'm finding much better examples for Lib::XML and using XML::Node
sftrabbit has joined #ruby
corecode has joined #ruby
<corecode>
hi
tubuliferous_ has joined #ruby
<corecode>
oh, the channel name changed?
jbrhbr has quit [Quit: Leaving.]
tuelz1 has joined #ruby
<adaedra>
You're looking for #ruby-lang?
<adaedra>
It merged with #ruby months ago
<corecode>
nice
<corecode>
what's the suggested way to get a fresh variable in a loop? i have something of the sort ... while some_cond; obj << queue; set_callback{ obj.foo }; end
jam_ has joined #ruby
<corecode>
but obj in the callback refers to the last value of obj the loop
sandstrom has quit [Quit: My computer has gone to sleep.]
ghox has joined #ruby
<volty>
and you need the previous one ?
northfurr has joined #ruby
<volty>
ops, distract
sandstrom has joined #ruby
djbkd has quit [Remote host closed the connection]
<corecode>
well, the value as it was when i call set_callback