<darix>
jeffreylevesque: the gems you want to install probably want the stdlib and stuff. so yes. you need one ruby package
bkxd_ has joined #ruby
bkxd has quit [Ping timeout: 248 seconds]
Dimik has joined #ruby
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
hutch34 has joined #ruby
charliesome has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
koz_ has joined #ruby
<koz_>
I'm trying to install this gem: https://rubygems.org/gems/asciidoctor-pdf. However, 'gem install asciidoctor-pdf' says that it couldn't find any valid gem called 'asciidoctor-pdf' in any repository. What did I miss?
raul782 has quit [Remote host closed the connection]
tomphp has joined #ruby
hutch34 has joined #ruby
x77686d has quit [Quit: x77686d]
raul782 has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
raul782 has quit [Remote host closed the connection]
raul782 has joined #ruby
sepp2k has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch34 has joined #ruby
astronav_ has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
hays has joined #ruby
nopolitica has quit [Ping timeout: 248 seconds]
hutch34 has quit [Ping timeout: 250 seconds]
profetes has quit [Remote host closed the connection]
profetes has joined #ruby
x77686d has joined #ruby
nopoliti1 has joined #ruby
astronav_ is now known as astronavt_
hutch34 has joined #ruby
<TomyLobo>
there is chruby, too
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass>
too bad it doesn't actually install ruby
muelleme has quit [Ping timeout: 268 seconds]
hutch34 has quit [Ping timeout: 250 seconds]
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
<TomyLobo>
hmm, then that's probably not what i use at work ^^
oetjenj has joined #ruby
<TomyLobo>
cant look it up right now
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
<jhass>
chruby is for switching between ruby installations you obtained via other means, for example your package manager, RVM, ruby-build or ruby-install
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
<TomyLobo>
btw, I'm looking for a parser that takes up less memory than parslet. Reason being that I'm trying to parse a large text file (stellaris save game, 38 MB) with parslet and it aborts with "[FATAL] failed to allocate memory"
oetjenj has quit [Client Quit]
silvermine has quit [Quit: WeeChat 2.0-dev]
<TomyLobo>
I'm on babun, which is a cygwin installer for, i think, the 32 bit variant. I have plenty of RAM, but I think it hits the memory limit for 32 bit processes
hutch34 has joined #ruby
hays has quit [Ping timeout: 248 seconds]
John__ has joined #ruby
hutch34 has quit [Ping timeout: 252 seconds]
<TomyLobo>
i might just be doing it wrong, but the design goals for parslet dont really look like they care a lot about resource usage but more about simplicity
GodFather has quit [Quit: Ex-Chat]
GodFather_ has joined #ruby
hutch34 has joined #ruby
Jicemo has joined #ruby
ShalokShalom has joined #ruby
safetypin has joined #ruby
char_var[buffer] has quit [Remote host closed the connection]
hutch34 has quit [Ping timeout: 250 seconds]
char_var[buffer] has joined #ruby
char_var[buffer] has quit [Read error: Connection reset by peer]
hutch34 has joined #ruby
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
astronavt_ is now known as astronavt
hutch34 has quit [Ping timeout: 246 seconds]
dionysus69 has quit [Ping timeout: 264 seconds]
hutch34 has joined #ruby
dionysus69 has joined #ruby
my123 has quit [Ping timeout: 248 seconds]
oetjenj has joined #ruby
nowhereman_ has quit [Ping timeout: 240 seconds]
<TomyLobo>
https://ideone.com/zyOChb here's the grammar with some representative example input, all contained in one file
my123 has joined #ruby
my123 has joined #ruby
conta1 has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
gheegh has joined #ruby
<TomyLobo>
the actual input is 38 MB
psychicist__ has quit [Read error: Connection reset by peer]
psychicist__ has joined #ruby
conta1 has quit [Ping timeout: 260 seconds]
despai has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass>
well, 38M of that in simple ruby hashes already probably takes up half a gig
hutch34 has joined #ruby
<jhass>
personally I probably would just hack up a hand written pull parser
safetypin has quit [Quit: ZZZzzz…]
hutch34 has quit [Ping timeout: 240 seconds]
<TomyLobo>
i can cut it down to 24 MB
x77686d has quit [Quit: x77686d]
<TomyLobo>
and i can probably filter down the attributes even more, since i only need a fraction of them
<jhass>
fraction as in like a dozen? unique names? if both yes I'd just go for .scan(//) tbh
konsolebox has quit [Ping timeout: 248 seconds]
<TomyLobo>
well i'd still need the overarching structure
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
miskatonic has quit [Ping timeout: 248 seconds]
alex`` has quit [Quit: WeeChat 1.9.1]
miskatonic has joined #ruby
<TomyLobo>
and no, not a dozen, but like 1/5 to 1/3 of each larger structure's attributes
<TomyLobo>
but having the entire save in memory to do fancy mappings and such on it would be nice too
nopoliti1 has quit [Ping timeout: 248 seconds]
hutch34 has joined #ruby
yabbes has joined #ruby
nopoliti1 has joined #ruby
<TomyLobo>
jhass, btw scanning is what i did before, basically :)
<TomyLobo>
but now i want to fill a google spreadsheet with the pop counts per species for each planet of my empire
<TomyLobo>
so i need to go through the planets and cross-reference the species list and the country list
konsolebox has joined #ruby
agent_white has quit [Ping timeout: 240 seconds]
agent_white has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
hays has joined #ruby
hutch34 has quit [Ping timeout: 264 seconds]
DLSteve has joined #ruby
nopoliti1 has quit [Ping timeout: 248 seconds]
oetjenj has quit [Ping timeout: 260 seconds]
konsolebox has quit [Ping timeout: 248 seconds]
konsolebox has joined #ruby
hutch34 has joined #ruby
despai has joined #ruby
Vile` has joined #ruby
hutch34 has quit [Ping timeout: 258 seconds]
ahurst has joined #ruby
oetjenj has joined #ruby
mim1k has joined #ruby
hutch34 has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
sid__ is now known as TagNotFound
mson has quit [Quit: Connection closed for inactivity]
hutch34 has joined #ruby
astronavt has quit [Remote host closed the connection]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
apeiros_ has joined #ruby
hutch34 has quit [Ping timeout: 264 seconds]
mim1k has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 248 seconds]
hutch34 has joined #ruby
ahurst has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch34 has quit [Ping timeout: 252 seconds]
dviola has joined #ruby
hutch34 has joined #ruby
malice` has joined #ruby
flori has joined #ruby
<malice`>
Hi! I want to make it available for user(of the interface) to provide a class to instantiate, and I
<malice`>
damn it, my enter
xlegoman has joined #ruby
<malice`>
and I'd like it to implement some interface
ahurst has joined #ruby
<malice`>
Can I somehow do that in Ruby?
<malice`>
I know I could pass class by its name, so I could do something like my_fun(Hash)
<malice`>
should I make if with kind_of? in there?
<Papierkorb>
You can also just pass in a Class as object
<Papierkorb>
no string magic required
<TomyLobo>
malice`, user interface or interface for a user of your library? :D
<jhass>
define interfaces through .respond_to? or just calling some methods, not through inheritance
hutch34 has quit [Ping timeout: 250 seconds]
<malice`>
Papierkorb: I wasn't talking about strings anywhere
<malice`>
TomyLobo: the second choice :p
<Papierkorb>
> I know I could pass class by its name,
flori has quit [Ping timeout: 240 seconds]
astronavt has joined #ruby
<malice`>
Papierkorb: well, what I meant is that when you've got class, its bound to some name, i.e. class Hash
<malice`>
jhass: why?
<TomyLobo>
malice`, but yeahm as jhass said, before you determine that, you need to figure out which strategy you want: inheritance or duck typing
darkod has joined #ruby
<darkod>
hi
<jhass>
because that gives your users a lot more flexibility (and also because it's the more common approach in the ruby community)
<Papierkorb>
I usually have a module the user includes, which then has the to-be implemented methods as stubs raising NotImplementedError
<Papierkorb>
So the user can simply read a module, and doesn't have to guess what's expected
<jhass>
Papierkorb: do you enforce they include it though?
<Papierkorb>
jhass: Sometimes. Ruby doesn't offer these facilities that would be very much appreciated
<darkod>
I read about GIL in Ruby. Does that mean running infinite loop blocks other web requests from doing job in my RoR app?
<malice`>
jhass: What kind of flexibility? I don't see anything wrong with the inheritance approach. I know it couples tightly, but also makes it easy to know what you're working with
<jhass>
darkod: quite likely, if the loop body never does IO or similar
<darkod>
jhass: interesting, that sounds like node.js
<jhass>
malice`: well, first you would need to accept that you can't possibly anticipate all usecases :P But think about mock generation for example
<malice`>
jhass: couldn't just mock inherit from the same interface?
<jhass>
darkod: similar problem yeah, I think node.js solves it with coroutines rather than threads though?
hndk has joined #ruby
<malice`>
all I want to do is specify an interface. I know it's kind of futile in Ruby, but I don't want to try to enforce it, but rather show what you need to do.
hutch34 has joined #ruby
<jhass>
malice`: that's not always convenient or even possible if you use some library to generate your mock
<malice`>
and with mock, you'd just inherit from the same interface and create SomeMockClass
<jhass>
so write good documentation and examples
<jhass>
that gets you far further IMO
<Papierkorb>
malice`: That's why I use the documenting-module
<Papierkorb>
People know how to read code. They can do that quite fast. Reading custom docs is simply slower
<Papierkorb>
and more error prone
<jhass>
hence the examples :P
<Papierkorb>
Also lets you add docs to the expected methods/behaviour
<TomyLobo>
jhass, i'll take your advice and hand-code the parser. I've written parsers before... what is a pull parser (google only points me to some java api called XML pull parser) and why should i use that, over, say, recursive-descent?
hutch34 has quit [Ping timeout: 240 seconds]
kitsunenokenja has quit [Ping timeout: 240 seconds]
<jhass>
it's mainly about the way the parser is used, it allows for parsing a stream and not keeping the entire parsed structure in memory
<TomyLobo>
but that'll only save me 38M at most :)
spectra_ has quit [*.net *.split]
Olipro has quit [*.net *.split]
perry has quit [*.net *.split]
utkarsh_ has quit [*.net *.split]
AKPWD has quit [*.net *.split]
silverdust has quit [*.net *.split]
AKPWD has joined #ruby
Olipro has joined #ruby
perry has joined #ruby
perry has quit [Changing host]
perry has joined #ruby
utkarsh has joined #ruby
hutch34 has joined #ruby
goyox86 has joined #ruby
selim has quit [Ping timeout: 240 seconds]
Xeago has quit [Ping timeout: 240 seconds]
bokayio has quit [Ping timeout: 240 seconds]
bokayio has joined #ruby
z3uS has quit [Ping timeout: 260 seconds]
mtkd has quit [Ping timeout: 260 seconds]
z3uS has joined #ruby
selim has joined #ruby
Xeago has joined #ruby
mtkd has joined #ruby
spectra has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
govg has quit [Ping timeout: 248 seconds]
bmurt has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
apeiros_ has joined #ruby
<jhass>
well, you quickly end up with 3-4 copies of that in regular approaches, plus more housekeeping and organization structures (more hashes and arrays)
rainbowz has joined #ruby
christiandsg has joined #ruby
mim1k has joined #ruby
hutch34 has joined #ruby
apeiros_ has quit [Ping timeout: 260 seconds]
thinkpad has quit [Ping timeout: 248 seconds]
hutch34 has quit [Ping timeout: 240 seconds]
drowze has joined #ruby
marr has joined #ruby
selim has quit [Ping timeout: 248 seconds]
eightlimbed has joined #ruby
eightlimbed has quit [Client Quit]
foxxx0 has quit [Quit: WeeChat 1.9.1]
hutch34 has joined #ruby
zautomata1 has joined #ruby
selim has joined #ruby
zautomata has quit [Ping timeout: 248 seconds]
dionysus69 has joined #ruby
<TomyLobo>
well i'll make sure to only scan on the original string
foxxx0 has joined #ruby
<TomyLobo>
problem is, the format isn't quite context-free
apeiros_ has joined #ruby
<TomyLobo>
array and dictionary overlap slightly
ahrs has quit [Remote host closed the connection]
hutch34 has quit [Ping timeout: 264 seconds]
ahrs has joined #ruby
<TomyLobo>
i can probably disambiguate that by checking if the first token is an identifier or something else
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch34 has joined #ruby
uZiel has quit [Remote host closed the connection]
hutch34 has quit [Ping timeout: 250 seconds]
tomphp has joined #ruby
xlegoman has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
darkod has quit [Ping timeout: 260 seconds]
hutch34 has joined #ruby
tomphp has quit [Max SendQ exceeded]
ramfjord has quit [Ping timeout: 268 seconds]
hutch34 has quit [Ping timeout: 250 seconds]
tomphp has joined #ruby
<TomyLobo>
for some reason, the "multimap" gem needs ffi and for some reason that doesnt work on babun.
<TomyLobo>
is anyone aware of another gem that implements a multimap (hash with duplicate keys, basically)
<zanoni>
If I insert the the same string into an array as a hash, the hash seems to be adding in backslashes, while the strings in the array remain as inserted. This make sense?
bmurt has joined #ruby
Senecea has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
miskatonic has joined #ruby
bmurt has quit [Client Quit]
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
Cohedrin has joined #ruby
JaccoP has joined #ruby
JaccoP has quit [Client Quit]
daemonwrangler has joined #ruby
_sfiguser has joined #ruby
<zanoni>
maybe my question doesn't make sense
iceden has quit [Ping timeout: 276 seconds]
<leitz>
zanoni, sometimes showing the code in a gist helps. I'm not an expert, so not sure I can help.
<miskatonic>
zanoni has been brought to you by Eddy Bulwer-Lytton
<leitz>
miskatonic?
<miskatonic>
There is a novel named Zanoni
<leitz>
Ah. There's a college named Miskatonic. :)
guacamole has joined #ruby
mn3m_ has joined #ruby
<miskatonic>
that college hads been brought to you by Howard Philip Lovecraft
<baweaver>
hrm hrm
<leitz>
Reminds me of my first marraige...
<baweaver>
zanoni: Mind throwing up an example? gist.github.com/
<miskatonic>
what is this gist thing? Something like pastebin?
<baweaver>
leitz: Seen keyword arguments yet?
<baweaver>
Pretty much
<baweaver>
except on github, no ads, and a lot faster.
mn3m has quit [Ping timeout: 240 seconds]
<leitz>
baweaver, not yet. URL to read?
<baweaver>
>> def add(a: 1, b: 1) a + b end; [add(a: 2), add(b: 2), add, add(a: 2, b: 3)]
<leitz>
Let me know if my explination needs explination.
* leitz
goes to read.
<zanoni>
miskatonic, yep, name taken from same, but it's been years since I read it
<baweaver>
Hrm. Some of what I've written so far may be of use overall
<baweaver>
notably around the use of english `and` which behaves very differently from `&&` in certain annoying cases.
<zanoni>
I think I"m going to play around with the code some more and if nothing resolves i'll do a gist, thanks
<baweaver>
I haven't written a lick on modules or class inheritance yet
<baweaver>
so I still need to get to those sections
iceden has joined #ruby
<leitz>
baweaver, part of the use case for Character is that it is an empty shell. Can't use named argumets as they may not be included in the character creation step.
<baweaver>
leitz: There's also a few methods to look into: `foo.is_a?(Class)`, `foo.nil?`
<baweaver>
If it has a value it's optional
<baweaver>
if not it's required
<baweaver>
so `def foo(a:, b: 1)` means that `a` is required and `b` is not
<leitz>
Yeah, character.class should be nil if the character doesn't have a title. However, even runs where the character does have a title, character.title doesn't get called.
<baweaver>
Think of it as having a more explicit contract with the outside world
jackjackdripper has quit [Quit: Leaving.]
<leitz>
Yup, except that none of it is required. That's why it defaults to an empty hash.
<baweaver>
Except you have a generate method afterwards as well
<leitz>
The UPP struct does use named arguments. RickHull gave me some code that explained that.
<leitz>
Yup, generate is used to "fill in" where a character is missing stuff.
<baweaver>
Implied rescue is another thing you may like
<leitz>
I'm trying to figure out the title stuff, why it isn't being called at all, and if character or title should be the reciever.
<leitz>
However, I'm still confused on Class, module, and self interactions. :(
<baweaver>
How so?
mn3m__ has joined #ruby
<leitz>
Character requires and includes CharacterTools. A character instance is passed to PresenterDefault. So why doesn't character.title return a title?
<leitz>
Not seeing a "puts" in line 24 of presenter. Are you looking at the "upp_to_struct" branch?
<baweaver>
remember though include / extend should be called inside a class: class Foo; include Barable; end
<baweaver>
that was the one you'd linked to, so yeah
EdwardIII has joined #ruby
EdwardIII has quit [Changing host]
EdwardIII has joined #ruby
<leitz>
Ah, still working on that. In the first version all the methods of CharacterTools was in Character. Made for a long and complex class.
<baweaver>
Keep them there for now
<baweaver>
The one thing I would highly advise is to avoid abstractions for now
<leitz>
They are already pulled out.
<baweaver>
A lot of people will say you need to have the code be DRY (Don't repeat yourself) but that's a very bad idea early on
<TomyLobo>
jhass, ok so this just takes 300 MB of RAM now
<baweaver>
Too Dry and the code becomes BRITTLE (Badly Refactored into Tiny Things Lacking Expressiveness)
<TomyLobo>
which is a slight improvement over the gigabytes it took before :)
<leitz>
So, line 34 or presenter_default puts each constructed line out. Isn't that what you meant, baweaver?
<baweaver>
So instead we leave early code WET (Will extract tentatively) until we can think of a good way to DRY it
<baweaver>
so many acronyms :D
<baweaver>
yeah
<TomyLobo>
i had to pre-process the whole thing a bit since there was a constructs in there i wasnt aware of earlier. strings as dictionary keys.
charliesome has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
<TomyLobo>
you try to tell '{"foo=bar"}' from {"foo"="bar" efficiently without a lexer :)
<TomyLobo>
you try to tell '{"foo=bar"}' from '{"foo"="bar"}' efficiently without a lexer :)
<leitz>
Here's the short version. An instance of Character is created. The Character class includes CharacterTools, the methods to modify character data. Just moved the "include CharacterTools" into class Character and it blew up more stuff. Cool.
sepp2k1 has quit [Read error: Connection reset by peer]
<leitz>
baweaver, if "include CharacterTools" is under the "class Character" line, the CharacterTools methods use "def self.XXX", right?
kapil___ has quit [Quit: Connection closed for inactivity]
Senecea has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 250 seconds]
* leitz
is still reading.
Emmanuel_Chanel has joined #ruby
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
nowhereman_ has joined #ruby
daemonwrangler has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
PixeLInc has quit [Quit: EliteBNC - http://elitebnc.org (Auto-Removal: idle account/not being used)]
rainbowz has quit [Ping timeout: 248 seconds]
<zanoni>
here is what I"m doing, array.each_slice(10).with_index do |x| hash[key]=value ,yet when I do hash.class it says string? To me it looks like a hash of arrays, but it says string, first time I've run into this.
<leitz>
baweaver, so I should use "include CharacterTools" after class Character. That makes them instance methods. In this use case they don't need to be Class methods, they are operating on an instance.
bmurt has joined #ruby
nowhereman_ has quit [Ping timeout: 268 seconds]
thinkpad has joined #ruby
QualityAddict has quit [Ping timeout: 268 seconds]
* leitz
notes tests do better if you can spell...
<TomyLobo>
zanoni, what is "hash"?
<TomyLobo>
it isnt mentioned in your code
<zanoni>
oh sorry, hash is a hash ;). I have it defined prior to the call with a variable name
QualityAddict has joined #ruby
<zanoni>
i think the hash insertion has some kind of conflict with slice
<baweaver>
zanoni: It won't. You should gist all of your code on that one
<zanoni>
okay
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
<baweaver>
leitz: give it a try
daemonwrangler has joined #ruby
<leitz>
baweaver, next sprint. I've spent 3 days working on converting upp to a struct.. Brain needs a break. Will note an issue and do that next refactoring.
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
kapil___ has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
<zanoni>
and I probably will clean up my code, as well as find better places for it, but just trying to get it to work at this point
<leitz>
baweaver, moving "include CharacterTools" is Issue #51. About to blow away upp_to_struct branch as it has been merged.
elcontrastador has quit [Ping timeout: 276 seconds]
guacamole has joined #ruby
jnyw has joined #ruby
Barrt has quit [Ping timeout: 276 seconds]
jnyw has quit [Client Quit]
bmurt has joined #ruby
jnyw has joined #ruby
guacamole has quit [Quit: My face has gone to sleep. ZZZzzz…]
<zanoni>
think i fixed it, it now says its a hash
miskatonic has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<zanoni>
so what is going on , is i said it was a hash of arrays,, the key and then multiple values to each key. if I print it to the console the values are wrapped in brackets, but it says it's a string. I thought i'd be able to iterate through each key for it's values, but no :)
banisterfiend has quit [Changing host]
banisterfiend has joined #ruby
<TomyLobo>
zanoni, could you change the extension to .rb in that gist maybe? :)