baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
za1b1tsu has joined #ruby
Guest23176 has quit [Ping timeout: 276 seconds]
fluxAeon has quit [Ping timeout: 260 seconds]
thoraxe has joined #ruby
<thoraxe> soooo weird question. but i'm trying to look for some kind of ruby gem that "distills the dom" a'la https://chromium.googlesource.com/chromium/dom-distiller -- basically want to scrape a site but simplify its content for reader-type stuff
za1b1tsu has quit [Ping timeout: 264 seconds]
herbmillerjr has quit [Quit: Konversation terminated!]
r29v has quit [Quit: r29v]
arahael1 has joined #ruby
herbmillerjr has joined #ruby
arahael1 is now known as ArahaelPi
weaksauce has joined #ruby
fluxAeon has joined #ruby
FernandoBasso has quit [Remote host closed the connection]
<mroutis> thoraxe: maybe you can run a headless chrome and call it as written on the documentation
<thoraxe> there's a ruby port of readability
<thoraxe> but it's kinda old
<thoraxe> there's python newspaper3k and a fresher python port of readability
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<thoraxe> i could probably either make a flask python microservice or do some horrific python-from-ruby incantation
<thoraxe> but it doesn't look like there's a good pure ruby solution
<thoraxe> i think i did some horrible ruby-python stuff back in the day
s2013 has joined #ruby
dbz has quit [Remote host closed the connection]
postmodern has joined #ruby
t0xik has joined #ruby
s2013 has quit [Ping timeout: 240 seconds]
dbz has joined #ruby
Guest23176 has joined #ruby
nowhere_man has quit [Ping timeout: 272 seconds]
JoshS has quit [Quit: Leaving]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RedNifre has quit [Ping timeout: 264 seconds]
Guest23176 has quit [Ping timeout: 252 seconds]
Guest23176 has joined #ruby
lytol_ has quit [Remote host closed the connection]
orbyt_ has joined #ruby
dbz has quit [Remote host closed the connection]
Guest23176 has quit [Ping timeout: 240 seconds]
venmx has quit [Quit: leaving]
Tempesta has joined #ruby
thy0_ has quit [Quit: TTFN]
thy0 has joined #ruby
faitswulff has joined #ruby
s2013 has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arescorpio has joined #ruby
hurricanehrndz has joined #ruby
Guest32721 has quit [Quit: WeeChat 1.6]
jokester has joined #ruby
hurricanehrndz has quit [Quit: Goodbye]
hurricanehrndz has joined #ruby
hahuang65 has joined #ruby
vondruch has quit [Ping timeout: 264 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hurricanehrndz has quit [Ping timeout: 240 seconds]
faitswulff has quit [Remote host closed the connection]
Guest23176 has joined #ruby
faitswulff has joined #ruby
saiyanprince has joined #ruby
<saiyanprince> Hi, where is ruby mostly used? what is ruby for?
Guest23176 has quit [Ping timeout: 272 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
raulp has quit [Ping timeout: 244 seconds]
<mrush> saiyanprince: web development, domain specific languages, and systems integration 'glue' language are some of the more commonly cited areas of popular use
saiyanprince has left #ruby [#ruby]
<mrush> oh, also rapid prototyping is another one
orbyt_ has joined #ruby
darkhanb has joined #ruby
za1b1tsu has joined #ruby
vonfry has joined #ruby
dbz has joined #ruby
za1b1tsu has quit [Ping timeout: 244 seconds]
vonfry has quit [Quit: WeeChat 2.2]
Creatornator has joined #ruby
Guest23176 has joined #ruby
k0mpa has joined #ruby
akaiiro has quit [Ping timeout: 244 seconds]
polyidus has joined #ruby
cadillac_ has joined #ruby
Guest23176 has quit [Ping timeout: 240 seconds]
thy0 has quit [Quit: TTFN]
Guest23176 has joined #ruby
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akaiiro has joined #ruby
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
gothicsouth has quit [Quit: leaving]
\void has joined #ruby
Guest23176 has quit [Ping timeout: 252 seconds]
Guest23176 has joined #ruby
Guest23176 has quit [Ping timeout: 252 seconds]
Guest23176 has joined #ruby
polyidus has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest23176 has quit [Ping timeout: 272 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tristanp has joined #ruby
venmx has joined #ruby
akaiiro has quit [Quit: Ping timeout (120 seconds)]
venmx has quit [Client Quit]
akaiiro has joined #ruby
tristanp has quit [Ping timeout: 272 seconds]
nofxx_ has quit [Remote host closed the connection]
gix has joined #ruby
bswinnerton has quit [Quit: The Lounge - https://thelounge.chat]
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #ruby
bswinnerton has joined #ruby
faitswulff has quit [Ping timeout: 265 seconds]
arescorpio has quit [Remote host closed the connection]
mroutis has quit [Ping timeout: 265 seconds]
Guest23176 has joined #ruby
hurricanehrndz has joined #ruby
hurricanehrndz has quit [Quit: Goodbye]
hurricanehrndz has joined #ruby
Guest23176 has quit [Ping timeout: 252 seconds]
Guest23176 has joined #ruby
tty has quit [Quit: tty]
za1b1tsu has joined #ruby
kapil___ has joined #ruby
za1b1tsu has quit [Ping timeout: 268 seconds]
Guest23176 has quit [Ping timeout: 260 seconds]
Guest23176 has joined #ruby
k0mpa has quit [Ping timeout: 250 seconds]
za1b1tsu has joined #ruby
tristanp has joined #ruby
aufi has joined #ruby
Guest23176 has quit [Ping timeout: 252 seconds]
za1b1tsu has quit [Ping timeout: 240 seconds]
tristanp has quit [Ping timeout: 272 seconds]
Rootsudo has joined #ruby
za1b1tsu has joined #ruby
Guest23176 has joined #ruby
AJA4350 has quit [Quit: AJA4350]
Guest23176 has quit [Ping timeout: 264 seconds]
lunarkitty is now known as lunarkitty7
haylon_ has quit [Ping timeout: 240 seconds]
lunarkitty7 is now known as lunaneko
Inline has quit [Quit: Leaving]
\void has quit [Quit: So long, and thanks for all the fish.]
aufi has quit [Ping timeout: 252 seconds]
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
armyriad has quit [Quit: Leaving]
dbz has quit [Ping timeout: 264 seconds]
Guest23176 has joined #ruby
ShekharReddy has joined #ruby
dviola has quit [Quit: WeeChat 2.2]
haylon_ has joined #ruby
Puffball has joined #ruby
Rootsudo has quit [Ping timeout: 252 seconds]
dbz has joined #ruby
Guest23176 has quit [Ping timeout: 240 seconds]
Guest23176 has joined #ruby
dellavg_ has joined #ruby
Nilium has quit [Ping timeout: 260 seconds]
havenwood has quit [Quit: ZNC 1.7.1 - https://znc.in]
havenwood has joined #ruby
xtsee has quit [Ping timeout: 255 seconds]
havenwood has quit [Client Quit]
Guest23176 has quit [Ping timeout: 272 seconds]
havenwood has joined #ruby
apeiros_ has joined #ruby
Nilium has joined #ruby
Nilium has quit [Ping timeout: 240 seconds]
Puffball has quit [Read error: Connection reset by peer]
apeiros_ has quit [Remote host closed the connection]
kerunaru has joined #ruby
Puffball has joined #ruby
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
Fr4n has quit [Quit: Fr4n]
Nilium has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
dbz has quit [Ping timeout: 244 seconds]
Nicmavr has joined #ruby
xtsee has joined #ruby
raulp has joined #ruby
snickers has joined #ruby
armyriad has joined #ruby
Guest23176 has joined #ruby
Guest23176 has quit [Ping timeout: 252 seconds]
Dbugger has joined #ruby
sauvin has joined #ruby
dbz has joined #ruby
dbz has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
dbz has joined #ruby
venmx has joined #ruby
dbz has quit [Ping timeout: 260 seconds]
rindolf has joined #ruby
yohji has joined #ruby
Guest23176 has joined #ruby
akaiiro has quit [Quit: The Lounge - https://thelounge.chat]
venmx has quit [Ping timeout: 252 seconds]
clemens3 has joined #ruby
Guest23176 has quit [Ping timeout: 264 seconds]
Guest23176 has joined #ruby
mikhael_k33hl has joined #ruby
<mikhael_k33hl> I have a module Marz::Rsync.run, how do I mock it so I can test that it receives the correct paramters when invoked?>
<mikhael_k33hl> https://docs.ruby-lang.org/en/2.0.0/MiniTest/Mock.html Seems to mock the method directly
Guest23176 has quit [Ping timeout: 252 seconds]
TomyWork has joined #ruby
Mike11 has joined #ruby
fork_fx has joined #ruby
<fork_fx> Hello all together, I have a question regarding "Mysql2" Gem:
<fork_fx> According to the documentation some result is returned after executing a query.
<fork_fx> I am executing an INSERT query, which obviously succeeds, but I only get "nil" as result.
<fork_fx> Code:
arekushi has joined #ruby
<fork_fx> client = Mysql2::Client.new(:host => "localhost", :username => "bla", :password => "blub123", :database => "test")
<fork_fx> puts res.inspect
<fork_fx> res = client.query("INSERT INTO t1(id) VALUES(#{some_value})")
<fork_fx> some_value=rand(10000)
<fork_fx> Programm output:
<fork_fx> nil
Burgestrand has joined #ruby
<fork_fx> Here's the code that shows that the query succeeds: https://dpaste.de/GcqA
aufi has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
jmcgnh has joined #ruby
dbz has joined #ruby
tristanp has quit [Ping timeout: 272 seconds]
Guest23176 has joined #ruby
dbz has quit [Ping timeout: 272 seconds]
Guest23176 has quit [Ping timeout: 272 seconds]
dbz has joined #ruby
Sina has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
za1b1tsu has quit [Quit: WeeChat 2.1]
mikecmpbll has joined #ruby
<rindolf> fork_fx: see http://bobby-tables.com/
<rindolf> fork_fx: use placeholders
kapil___ has quit [Quit: Connection closed for inactivity]
<rindolf> mikhael_k33hl: hi
jlebrech has joined #ruby
<fork_fx> rindolf: I don't get your point.
<rindolf> mikhael_k33hl: any luck?
Guest23176 has joined #ruby
<fork_fx> This is a simple demo of my problem, not a security proof piece of code.
<jlebrech> can you use vcr outside of tests? i'd like to record as i'm manual testing and replay my clicks in tests later
<rindolf> fork_fx: well, it gives a WTF? moment
<rindolf> fork_fx: see http://sscce.org/
<mikhael_k33hl> rindolf: https://gist.github.com/marzdgzmn/f4c423327d56bfe37afea617d39d7152 Nope, trying to test if the method is receiving the correct arguments though
<rindolf> mikhael_k33hl: can't you mock it with loading mocked/dummy modules first?
nowhere_man has joined #ruby
<mikhael_k33hl> rindolf: pretty new to ruby and minitest, can you give me an example?
<rindolf> mikhael_k33hl: i'm not a ruby expert - see https://duckduckgo.com/?q=ruby+mock+modules&ia=qa
<fork_fx> rindolf: I do not know what you are trying to say to me with http://sscce.org. The posted link https://dpaste.de/GcqA is full executable ruby code. Of course i did not enclose a script to install a mysql database server and a create table for the database i am using. So in what way my question is lacking information here?
gigetoo has quit [Read error: No route to host]
<rindolf> fork_fx: i mean that there should be best practices
gigetoo has joined #ruby
<rindolf> fork_fx: rather than WTF?isies
jlebrech has quit [Remote host closed the connection]
<fork_fx> rindolf: Sorry. I'm absolutely not getting to your point.
<rindolf> fork_fx: nm
<rindolf> fork_fx: nevermind
<mikhael_k33hl> rindolf: hmmm, tried this one https://gist.github.com/marzdgzmn/f4c423327d56bfe37afea617d39d7152 still can't make it work. Why am I getting the error: NoMethodError: undefined method `to_sym' for #<Marz::Rsync::Result:0x00000000019918c0> when I've mocked it?
postmodern has quit [Quit: Leaving]
<rindolf> mikhael_k33hl: something is not mocked
tristanp has joined #ruby
RedNifre has joined #ruby
<rindolf> mikhael_k33hl: is your paste complete?
dbz has joined #ruby
Guest23176 has quit [Ping timeout: 276 seconds]
tristanp has quit [Ping timeout: 264 seconds]
Guest23176 has joined #ruby
dbz has quit [Ping timeout: 240 seconds]
RedNifre_ has joined #ruby
hahuang65 has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby
RedNifre has quit [Ping timeout: 264 seconds]
xt233 has joined #ruby
dhollin3 has joined #ruby
Zaab1t has joined #ruby
Guest23176 has quit [Ping timeout: 240 seconds]
Guest23176 has joined #ruby
dhollinger has quit [Ping timeout: 268 seconds]
jottr has joined #ruby
Beams has joined #ruby
druonysus has quit [Ping timeout: 272 seconds]
jottr has quit [Ping timeout: 268 seconds]
aufi has quit [Ping timeout: 268 seconds]
alex`` has joined #ruby
xall has joined #ruby
Zaab1t has quit [Quit: Zaab1t]
clorisu has joined #ruby
Puffball has quit [Remote host closed the connection]
Bish has joined #ruby
<Bish> does unicorn really only serve 1 connection at a time by default?
clorisu has quit [Client Quit]
xall has quit [Quit: xall]
<balo> Bish: yep, 1 seems to be the minimum and default if you don't specify worker_processes in your unicorn config https://bogomips.org/unicorn.git/tree/lib/unicorn/configurator.rb#n258
<balo> it's a process based appserver, see also https://bogomips.org/unicorn/TUNING.html
xt233 has quit [Quit: This computer has gone to sleep]
Zaab1t has joined #ruby
Zaab1t has quit [Client Quit]
CrazyEddy has quit [Ping timeout: 240 seconds]
t0xik is now known as t0x
<Bish> great that you need to have a config after you already have a config.ru
<Bish> can't i do that via run switches?
venmx has joined #ruby
nikivi has joined #ruby
jottr has joined #ruby
za1b1tsu has joined #ruby
deathwishdave has joined #ruby
reber has joined #ruby
CrazyEddy has joined #ruby
aufi has joined #ruby
bijan_ has joined #ruby
kapil___ has joined #ruby
venmx has quit [Ping timeout: 240 seconds]
<mikhael_k33hl> rindolf: sorry about the late reply man, something came up that I needed to attend to
<rindolf> mikhael_k33hl: ok
cr1xu5 has joined #ruby
venmx has joined #ruby
cr1xu5 has quit [Read error: Connection reset by peer]
Mike111 has joined #ruby
Mike111 has quit [Max SendQ exceeded]
Mike11 has quit [Ping timeout: 272 seconds]
cr1xu5 has joined #ruby
fork_fx has quit [Quit: Verlassend]
Mike11 has joined #ruby
GodFather has joined #ruby
<mikhael_k33hl> Why am I getting a `undefined method 'to_sym'` for #<Marz::Rsync::Result:0x000000000124dd98> https://gist.github.com/marzdgzmn/518836865851d148abbdfc00e136bf01
<mikhael_k33hl> I've stubbed my command module to return a mocked object
fork_fx has joined #ruby
Puffball has joined #ruby
dellavg_ has quit [Ping timeout: 272 seconds]
cadillac_ has quit [Read error: Connection reset by peer]
Puffball has quit [Remote host closed the connection]
mikecmpbll has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
cadillac_ has joined #ruby
rkoller has joined #ruby
cr1xu5 has quit [Quit: Leaving]
cr1xu5 has joined #ruby
<mikhael_k33hl> Do you have to indicate the parameters to a stubbed method?
<balo> Bish: nope. but you can set it to an envvar in the config file so you can run it like $ WORKERS=4 unicorn -c config/unicorn.rb
<balo> given you have `worker_processes ENV.fetch('WORKERS').to_i` in your config
bijan_ has quit [Remote host closed the connection]
<balo> my personal recommendation would be to use a different appserver. puma, phusion or some jruby based
<balo> but we use unicorn for now as well because of _reasons_ and it with some experimenting with server numbers and sizes you can serve quite a lot of traffic with it
<mikhael_k33hl> Tried mocking my module method via mock.expect(Marz::Rsync.run, result, ['/foo1', 'root@127.0.0.1:/foo2', ['-a']]) but I'm getting an error: ArgumentError: wrong number of arguments (given 0, expected 2..3)
jottr has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
<mikhael_k33hl> I've selected minitest when I setup my gem, is there a way I can change it to rspec?
bijan_ has quit [Read error: Connection reset by peer]
jottr has joined #ruby
bijan_ has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
aninaki has joined #ruby
bijan__ has joined #ruby
bijan_ has quit [Ping timeout: 276 seconds]
bijan__ has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
bijan_ has quit [Ping timeout: 264 seconds]
jottr has joined #ruby
gnufied has quit [Ping timeout: 240 seconds]
apparition has joined #ruby
bijan_ has joined #ruby
jespada has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
jespada has left #ruby [#ruby]
t0x has quit [Quit: Connection closed for inactivity]
bijan_ has joined #ruby
bijan__ has joined #ruby
fork_fx has quit [Quit: Verlassend]
bijan_ has quit [Ping timeout: 276 seconds]
bijan__ has quit [Read error: Connection reset by peer]
bijan_ has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
bijan_ has joined #ruby
faitswulff has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
bijan__ has joined #ruby
bijan_ has quit [Ping timeout: 276 seconds]
Sprckt has joined #ruby
rindolf has quit [Quit: http://www.shlomifish.org/ ; Yay! I'm a llama again.]
bijan__ has quit [Read error: Connection reset by peer]
bijan_ has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
apeiros_ has joined #ruby
LiftLeft2 has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bijan_ has joined #ruby
LiftLeft has quit [Ping timeout: 265 seconds]
Zaab1t has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
Sprckt has left #ruby ["Leaving"]
thy0 has joined #ruby
MrGrymReaper has joined #ruby
<MrGrymReaper> Hello.
<MrGrymReaper> I'm currently wondering whether in Ruby you can do an array, but then have other variables which aren't sub arrays associated with it; for example string, integer, float etc?
venmx has quit [Quit: leaving]
<MrGrymReaper> In otherwords 1 array but then say a nam
<MrGrymReaper> I mean a name as in a first name, surname and age etc.
bijan_ has joined #ruby
bswinnerton has left #ruby ["The Lounge - https://thelounge.chat"]
<MrGrymReaper> Or some other place where this can come in handly. I managed to do something like this with the Visual Basic 6.0 in the past and really came in handy several times.
<MrGrymReaper> Though are interested in doing this with Ruby as it can be a useful caching method for data as ram is often faster than accessing it from elsewhere. For example hard disks, or from another remote system.
bijan_ has quit [Ping timeout: 252 seconds]
mikecmpbll has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
Bish has quit [Remote host closed the connection]
g- has quit [Ping timeout: 276 seconds]
hdabrows has joined #ruby
<MrGrymReaper> Or in Ruby game development where you have an inventory and you wish to create it from scratch. Using a array with multiple sub-variables (but not sub-arrays).
dbz has joined #ruby
bijan_ has joined #ruby
snickers has quit [Ping timeout: 264 seconds]
deathwishdave has joined #ruby
Puffball has joined #ruby
<ineb> Sorry i dont understand your question
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus70 is now known as dionysus69
<MrGrymReaper> I would like to define an Array in Ruby, but then not create sub-arrays. Though have additional values stored through strings, floats, integer, boolean etc.
<MrGrymReaper> While being associated with the original array.
dbz has quit [Ping timeout: 268 seconds]
<ineb> You mean like [1,2,3] + "Whatever" ?
bijan_ has quit [Ping timeout: 252 seconds]
<ineb> with "Whatever" not really being loaded into the original array
<ineb> but the new object knows about [1,2,3] and "Whatever"?
<MrGrymReaper> Yes. and no the structure I'm talking about under VB would go something like Define MyArray().Firstname As String etc. Is there something similar for Ruby.
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
dionysus70 is now known as dionysus69
<ineb> so you basically want an array with additional features?
<MrGrymReaper> Yes!
AJA4350 has joined #ruby
<ineb> you can subclass array if you want
<ineb> but if you dont need the full feature set of an array for your purpose you can look into forwardable
<MrGrymReaper> I'm new to Ruby is there any tutorials, documentation or code please - Gems?
<MrGrymReaper> I'm currently learning Ruby but coming from Microsoft Visual Basic 6.0 Professional.
bijan_ has joined #ruby
<ineb> No problem, take a look at Ruby Interitance http://rubylearning.com/satishtalim/ruby_inheritance.html
<apeiros_> it's generally not advisable to subclass classes you don't own
argoneus_ is now known as argoneus
<apeiros_> (Object & BasicObject being exempted for obvious reasons)
apeiros_ is now known as apeiros
<ineb> i agree. forwardable makes more sense
<ineb> but i wanted to distill the question. and it looks like its boils down 'how to enrich an existing class with features'
<ineb> which can be done by inheritance :)
<MrGrymReaper> When I do this is it possible for this to be considered for Ruby 2.6 as an additional feature of Array class. For the IO reasons I specified.
<apeiros> indeed. alternative forms of inheritance are (applicability depends of course on what exactly you want to do): refinements, Module#prepend, Object#extend and in rarer cases Module#include
<apeiros> (not entirely sure whether refinements actually truly belong into the inheritance "box")
mrush has quit [Quit: leaving]
bijan_ has quit [Read error: Connection reset by peer]
<apeiros> but apart from refinements, inheritance should usually only be used for classes/objects you own
<ineb> MrGrymReaper: iam still not sure what feature you want to implement. if its something for inventory management in a game, then its unlikely that it will land in the standard libraries :)
<ineb> however, you can extend and use them as you like in your own environment
bijan_ has joined #ruby
<MrGrymReaper> I'm talking about the extending the Array Class in a fashion where you don't always have to use sub arrays. But can use strings, etc in a fashion similar to the VB example given but in a Ruby format. As I found this feature from VB very useful many times and for many different uses. I was wondering whether it would also help Ruby's arrays feature.
<ineb> Okay, maybe you are just looking for a Hash?
segy has quit [Ping timeout: 272 seconds]
bmurt has joined #ruby
<ineb> >> hash = Hash.new; hash[:hello] = 5; puts hash[:hello]
<ruby[bot]> ineb: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
faitswulff has quit [Remote host closed the connection]
yohji has quit [Remote host closed the connection]
dbz has joined #ruby
<MrGrymReaper> I'm not talking about hashes which can be accessed by keys. The method I'm reffering to coming from VB was an Array - as it still uses indexes. Though each array could contain many values and many subvariables. In a similar fashion to a database but without actually creating an actual database.
bijan_ has quit [Ping timeout: 252 seconds]
<ineb> and how do you receive the values and subvariables?
<ineb> if not by index or by key
gnufied has joined #ruby
<MrGrymReaper> You define the the Array first in VB. Then define each subvariable.
[Butch] has joined #ruby
<ineb> and a subvariable is a reference to a value in the array?
Alina-malina has quit [Ping timeout: 244 seconds]
<MrGrymReaper> The values themselves are stored in the subvariables and the array becomes like a database record.
<ineb> this doesnt provide any performance benefits regarding io
faitswulff has joined #ruby
dbz has quit [Ping timeout: 272 seconds]
cr1xu5 has quit [Read error: Connection reset by peer]
<ineb> well, of course it does in c where you could just store an array of pointers instead of copying the actual value
<ineb> but was that the case in VB?
bijan_ has joined #ruby
<MrGrymReaper> In VB you could iterate through the array using a for loop or if you knew the index go straight to the value.
<ineb> you can do that in ruby too
bijan_ has quit [Read error: Connection reset by peer]
za1b1tsu has quit [Read error: Connection reset by peer]
za1b1tsu has joined #ruby
MrGrymReaper has quit [Ping timeout: 252 seconds]
GodFather has quit [Ping timeout: 252 seconds]
segy has joined #ruby
GodFather has joined #ruby
cadillac_ has quit [Ping timeout: 268 seconds]
cadillac_ has joined #ruby
bijan_ has joined #ruby
orbyt_ has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
faitswulff has quit [Remote host closed the connection]
segy has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Client Quit]
segy has joined #ruby
tristanp has joined #ruby
bougyman has quit [Ping timeout: 255 seconds]
tristanp has quit [Ping timeout: 272 seconds]
bijan_ has joined #ruby
bougyman has joined #ruby
dhollin3 is now known as dhollinger
faitswulff has joined #ruby
Guest23176 has quit [Quit: WeeChat 2.1]
BuildTheRobots has quit []
BuildTheRobots has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
GodFather has quit [Ping timeout: 264 seconds]
bijan_ has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
mroutis has joined #ruby
IanMalcolm has joined #ruby
dbz has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
bijan_ has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
Rapture has joined #ruby
cadillac_ has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
kryptoz has joined #ruby
kryptoz has quit [Remote host closed the connection]
<apeiros> soooo… was this a bug in older rubies or is it a bug in newer rubies? ruby 2.3-: `FileUtils.rmdir(non_empty_dir)` -> no exception, ruby 2.4+: `FileUtils.rmdir(non_empty_dir)` -> Errno::ENOTEMPTY
<apeiros> oh, actually it changes with ruby 2.5, not 2.4
* apeiros reads ticket #3178
g- has joined #ruby
faitswulff has quit [Remote host closed the connection]
<apeiros> uuuh, I'm blind? where the heck is the current changelog?
<apeiros> I can only find one up to ruby 2.4
faitswulff has joined #ruby
tty has joined #ruby
croberts has joined #ruby
ogres has joined #ruby
shenghi has joined #ruby
cadillac_ has quit [Ping timeout: 252 seconds]
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #ruby
cadillac_ has joined #ruby
<apeiros> but I can't see it in NEWS (and since I can't find the file, neither in CHANGELOG)
Inline has joined #ruby
<apeiros> so https://bugs.ruby-lang.org/issues/13889 is the relevant issue. for some reason I can't update https://bugs.ruby-lang.org/issues/3178 to reference that issue :-(
dellavg_ has joined #ruby
k0mpa has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maxdoubt has joined #ruby
cadillac_ has quit [Ping timeout: 240 seconds]
Tempesta has quit [Quit: AdiIRC is updating to v3.2 Beta Build (2018/08/18) 64 Bit]
cadillac_ has joined #ruby
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #ruby
Tempesta has joined #ruby
teclator has quit [Disconnected by services]
deathwishdave has joined #ruby
faitswulff has quit [Remote host closed the connection]
Alina-malina has joined #ruby
kerunaru has quit [Quit: leaving]
aufi has quit [Quit: Leaving]
aufi has joined #ruby
rindolf has joined #ruby
<rindolf> hi all
<rindolf> mikhael_k33hl: here?
dionysus69 has quit [Ping timeout: 268 seconds]
ByronJohnson has quit [Ping timeout: 260 seconds]
ByronJohnson has joined #ruby
<mikhael_k33hl> rindolf: yep
za1b1tsu has quit [Ping timeout: 260 seconds]
<rindolf> mikhael_k33hl: any luck?
<mikhael_k33hl> rindolf: nah, I've switched from minitest to rspec now
<mikhael_k33hl> rindolf: hopefully I can make it work with rspec
<rindolf> mikhael_k33hl: gl
<mikhael_k33hl> rindolf: thanks man . . just can't seem to make the stub/mock work with modules I guess
<rindolf> mikhael_k33hl: rspec is nice from my experience
<mikhael_k33hl> rindolf: I guess minitest is for hardcore ruby programmers hehe
<apeiros> o0
jottr has joined #ruby
<mikhael_k33hl> what's a good rspec video from beginner to advance?
snickers has joined #ruby
snickers has quit [Client Quit]
jottr has quit [Ping timeout: 240 seconds]
bijan_ has quit [Remote host closed the connection]
<g-> the rspec doc examples are really nice, did you see those yet?
<mikhael_k33hl> g-: I'll take a look, it's just video tutorials, based on my experience, gets your hands dirty asap, hehe
apeiros has quit []
bijan_ has joined #ruby
<g-> i hear ya.. there are a few course for rspec on udemy
troys has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
<mroutis> hehe, I also switched from minitest to rspec because of stub/mocks
<havenwood> mroutis: Didn't like Minitest's stubs and mocks?
<mroutis> no, havenwood, I enjoy the expresiveness of rspec `allow x to receive y`
faitswulff has joined #ruby
<havenwood> mmm
<mroutis> (in the ruby on rails context, where the convention is a lot of side-effects)
<mroutis> for example, I have a controller that does something like: `if resource.save?; send_info_to_third_party; notify_user; render... end`
<mroutis> with rspec, I can describe "POST #create", and before(:each) do "allow(controller).to receive(:sedn_info_to_third_party) and (:notify_user)"
bijan_ has joined #ruby
<mroutis> and have a case: "when data is invalid, expect(controller).to_not have_received(:send_info_to_third_party)"
faitswulff has quit [Ping timeout: 265 seconds]
<ineb> i understand but this testing can get tedious very quickly
<ineb> you need to keep track of the function names and check for explicit calling
<ineb> which will change eventually and then your tests are instantly outdated
<g-> and jenkins will tell you if you break something
bijan_ has quit [Read error: Connection reset by peer]
<mroutis> indeed, ineb, but something like `s/current_function/new_function/` will do the work
<ineb> just an example here, instead of send_info_to_third_party you could have an ThirdPartyInformant with #notify or something
<ineb> easy to mock and never needs to be touched in your controller tests
<mroutis> yes, that's true, minitests encourages to being able to mock objects in order to add stubs to it
<ineb> its just what iam experiencing if iam using too much expects of have_received and so on
aufi has quit [Quit: Leaving]
<ineb> better to make use of the facade pattern in your controllers case
<ineb> but idk ofc
<ineb> maybe it isnt worth the effort in your case
<ineb> time will tell how often you have to change your current tests :P
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mroutis> sure! also, if you are collaborating with more people, you need to take into account their skill level and their _code perspective_
orbyt_ has joined #ruby
<mroutis> sometimes, you are working with someone more "procedural", and they'll make horrible decisions if they are forced to write good OOP code
bijan_ has joined #ruby
pulgolino has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mroutis> I guess that the best test suite / codebase is the one where all the involved can be as productive as possible
bijan_ has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
jcarl43 has joined #ruby
bijan__ has joined #ruby
apeiros_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bijan_ has quit [Ping timeout: 276 seconds]
mikecmpbll has quit [Read error: Connection reset by peer]
apparition has quit [Quit: Bye]
mikecmpb_ has joined #ruby
bijan__ has quit [Ping timeout: 264 seconds]
bijan_ has joined #ruby
IanMalcolm has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<mikhael_k33hl> Why am I getting a syntax error for a freshly generated spec_helper.rb from bundle gem
clemens3 has quit [Ping timeout: 264 seconds]
<mikhael_k33hl> https://dpaste.de/yM1w
<apeiros_> mikhael_k33hl: you know, when you get exceptions, you *reeeally* should paste them along.
s2013 has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
<apeiros_> you seem to have pasted the wrong file.
<apeiros_> the error tells you that spec/marz/rsync_spec.rb:22 is where the syntax error is
<mikhael_k33hl> hmm, wait, let me see . . . it's the only file I have in my atom project view
ephemera_ has joined #ruby
cagomez has joined #ruby
<mikhael_k33hl> by the way, have you guys tried the pragmatic studio ruby/rails course? care to share your thoughts? is it good? :)
<apeiros_> I haven't
apeiros_ is now known as apeiros
deathwishdave has joined #ruby
bijan_ has joined #ruby
mikhael_k33hl has quit [Quit: Page closed]
darkhanb has joined #ruby
g- has quit [Quit: WeeChat 1.6]
bijan_ has quit [Read error: Connection reset by peer]
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
bijan_ has joined #ruby
dbz has joined #ruby
dbz has quit [Remote host closed the connection]
TomyWork has quit [Ping timeout: 240 seconds]
dbz has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
g- has joined #ruby
[Butch] has joined #ruby
bijan_ has joined #ruby
NightMonkey has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
mikecmpb_ has quit [Quit: inabit. zz.]
NightMonkey has joined #ruby
vikaton has joined #ruby
lomex has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Beams has quit [Quit: .]
eckhardt has joined #ruby
Nicmavr has joined #ruby
faitswulff has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
weaksauce has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
s2013 has joined #ruby
nowhere_man has joined #ruby
IanMalcolm has joined #ruby
s2013 has quit [Ping timeout: 252 seconds]
bijan_ has quit [Remote host closed the connection]
bijan_ has joined #ruby
faitswulff has quit [Remote host closed the connection]
GodFather has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
g- has quit [*.net *.split]
gnufied has quit [*.net *.split]
segy has quit [*.net *.split]
thoraxe has quit [*.net *.split]
jp has quit [*.net *.split]
brodul has quit [*.net *.split]
shadeslayer has quit [*.net *.split]
sparch has quit [*.net *.split]
duderonomy has quit [*.net *.split]
sticaz has quit [*.net *.split]
pskosinski has quit [*.net *.split]
booboy has quit [*.net *.split]
kent\n has quit [*.net *.split]
dbrandon has quit [*.net *.split]
axsuul has quit [*.net *.split]
dinfuehr has quit [*.net *.split]
setient has quit [*.net *.split]
wmoxam has quit [*.net *.split]
helpa has quit [*.net *.split]
pisculichi has quit [*.net *.split]
llua has quit [*.net *.split]
shortdudey123 has quit [*.net *.split]
ziggylazer has quit [*.net *.split]
manakanapa5 has quit [*.net *.split]
jerryskye has quit [*.net *.split]
Radar has quit [*.net *.split]
joast has quit [*.net *.split]
badeball has quit [*.net *.split]
psmolen has quit [*.net *.split]
spk has quit [*.net *.split]
SanguineAnomaly has quit [*.net *.split]
cout has quit [*.net *.split]
wmoxam_ has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
hurricanehrndz has quit [Ping timeout: 260 seconds]
psmolen has joined #ruby
axsuul has joined #ruby
guardian has quit [Remote host closed the connection]
jerryskye has joined #ruby
joast has joined #ruby
guardian has joined #ruby
IanMalcolm has quit [Ping timeout: 252 seconds]
alex`` has quit [Quit: WeeChat 2.2]
g- has joined #ruby
guardian has quit [Quit: Coyote finally caught me]
maxdoubt has quit [Quit: maxdoubt]
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhere_man has quit [Ping timeout: 264 seconds]
mydog2 has joined #ruby
manakanapa5 has joined #ruby
coderphive has quit []
sauvin has quit [Remote host closed the connection]
DTZUZO has quit [Ping timeout: 265 seconds]
llua has joined #ruby
mroutis has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
gnufied has joined #ruby
Zaab1t has quit [Quit: Zaab1t]
vikaton has quit [Quit: Connection closed for inactivity]
jp has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jcarl43 has quit [Ping timeout: 260 seconds]
pskosinski has joined #ruby
Mike11 has quit [Quit: Leaving.]
dellavg_ has quit [Ping timeout: 264 seconds]
tfitts has quit [Quit: Connection closed for inactivity]
ogres has quit [Quit: Connection closed for inactivity]
lomex has joined #ruby
ziggylazer has joined #ruby
Sidoniuns has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sidoniuns has quit [Read error: Connection reset by peer]
segy has joined #ruby
mikecmpbll has joined #ruby
code_zombie has joined #ruby
code_zombie has quit [Remote host closed the connection]
<nikivi> I have this code that generates JSON
<nikivi> on line 8 I want to generate: { "y": 3072 }
<nikivi> but not sure how I can get another object there
<nikivi> with "y" too
<nikivi> currently this generates: "mouse_key": "\"y\": 3072"
<elomatreb> Use Hashes just like you did for the top level, i.e. curly braces
<apeiros> or if it's just a "list", use an array
<apeiros> >> require 'json'; [{y: 123}, {y: 234}, {y: 345}].to_json
<ruby[bot]> apeiros: # => "[{\"y\":123},{\"y\":234},{\"y\":345}]" (https://eval.in/1050050)
<nikivi> thanks
setient has joined #ruby
booboy has joined #ruby
duderonomy has joined #ruby
bmurt has joined #ruby
orbyt_ has joined #ruby
deathwishdave has joined #ruby
<nikivi> what am I doing wrong here https://hastebin.com/okedupuneq.coffeescript
<nikivi> "${direction}": amount
<nikivi> this should evaluate to expanded value of what I give in to the call
<nikivi> scroll('d', 'j', 'vertical_wheel', '-1536')
<nikivi> i.e. I call it with this
<nikivi> I should get this generated: { "mouse_key": { "vertical_wheel": -64 } }
<nikivi> -1536*
<nikivi> it generates: {"${direction}":"-1536"}
<nikivi> as if it doesn't expand
<nikivi> or it only works in single quotes?
Freshnuts has joined #ruby
hurricanehrndz has joined #ruby
lomex has joined #ruby
sagax has joined #ruby
<nikivi> or it seems i need to add # before
<nikivi> so its "$#{direction}": amount
<nikivi> not dollar sign
<nikivi> its a bit confusing because it seems there are multiple ways to do this
<nikivi> okay # seems to have worked
cadillac_ has quit [Ping timeout: 272 seconds]
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cadillac_ has joined #ruby
segy has quit [Ping timeout: 272 seconds]
faitswulff has joined #ruby
segy has joined #ruby
faitswulff has quit [Ping timeout: 260 seconds]
patr0clus has joined #ruby
mcritchlow has joined #ruby
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
ur5us has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 240 seconds]
donofrio has quit [Remote host closed the connection]
cadillac_ has quit [Ping timeout: 265 seconds]
cadillac_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snickers has joined #ruby
alex`` has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Caius has quit [Ping timeout: 276 seconds]
Dbugger has quit [Ping timeout: 255 seconds]
Caius has joined #ruby
orbyt_ has joined #ruby
beowuff has joined #ruby
ellcs has joined #ruby
Caius has quit [Ping timeout: 264 seconds]
surrounder has quit [Quit: WeeChat 2.0.1]
Caius has joined #ruby
patr0clus has quit [Quit: WeeChat 2.1]
cadillac_ has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
ur5us has joined #ruby
bmurt has joined #ruby
reber has quit [Remote host closed the connection]
elomatreb has quit [Quit: mep mep]
Fridtjof_ has quit [Ping timeout: 256 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
faitswulff has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
ellcs has quit [Ping timeout: 264 seconds]
duderonomy has quit [Ping timeout: 260 seconds]
redlegion has quit [Ping timeout: 250 seconds]
redlegion has joined #ruby
redlegion has quit [Excess Flood]
redlegion has joined #ruby
redlegion has quit [Excess Flood]
redlegion has joined #ruby
g- has quit [Quit: WeeChat 1.6]
<baweaver> nikivi: Remember Coffeescript isn't strictly Javascript
<baweaver> Javascript would use template literals like this: `${var}`
<baweaver> Coffeescript _does not_ do this
<baweaver> Coffeescript is also not Ruby
alex`` has quit [Ping timeout: 240 seconds]
jcarl43 has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has quit [Quit: inabit. zz.]
Fridtjof has joined #ruby
Radar has joined #ruby
<rindolf> baweaver: i don't like coffeescript too much
<baweaver> Never said I liked it either.
<baweaver> People should use ES6 instead
<rindolf> baweaver: I prefer either JS or perhaps TS
<rindolf> baweaver: fair enough
<baweaver> ES is JS.
<baweaver> or rather EcmaScript is the actual name of Javascript.
<rindolf> baweaver: https://github.com/jashkenas/coffeescript/wiki/List-of-languages-that-compile-to-JS - at least they maintain this list tho
<rindolf> baweaver: yes
segy has quit [Max SendQ exceeded]
donofrio has joined #ruby
faitswulff has quit [Remote host closed the connection]
mcritchlow has quit [Remote host closed the connection]
jdsampayo has joined #ruby
duderonomy has joined #ruby
<jdsampayo> Hey, good afternoon from Mexico!
jcarl43 has quit [Read error: Connection reset by peer]
faitswulff has joined #ruby
segy has joined #ruby
jcarl43 has joined #ruby
duderonomy has quit [Client Quit]
<jdsampayo> I have this string:
<jdsampayo> "// PIE version: 1.2.1\n\nvar PIE = {}; // PIE namespace\n\n// dynamically-generated PIE settings\nPIE.L = 6;\nPIE.E = 4;\nPIE.K = \"954FB5ED0819B9D22E92AFAA15365775\";\nPIE.key_id = \"3664ad8\";\nPIE.phase = 1;"
<jdsampayo> there is a better way to extract the data than this?
<jdsampayo> @data.scan(/(?=\= )(.*?)(?=\;)/).flatten.map!{|d| d.gsub(/[^A-Za-z\d]/, '')} => ["", "6", "4", "954FB5ED0819B9D22E92AFAA15365775", "3664ad8", "1"]
<jdsampayo> to get this result: ["", "6", "4", "954FB5ED0819B9D22E92AFAA15365775", "3664ad8", "1"]
RedNifre_ has quit [Ping timeout: 264 seconds]
<jdsampayo> that was the best I could do but I guess there is some way to avoid the gsub and do it in one pass
paraxial has quit [Read error: Connection reset by peer]
paraxial has joined #ruby
x0f has quit [Ping timeout: 260 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has joined #ruby
orbyt_ has joined #ruby
x0f has joined #ruby
mroutis has joined #ruby
dbz_ has joined #ruby
dbz_ has quit [Remote host closed the connection]
<rindolf> jdsampayo: better in which respect?
dbz_ has joined #ruby
<rindolf> jdsampayo: more elegant?
<jdsampayo> or efficient
<rindolf> jdsampayo: and hi
<rindolf> jdsampayo: do you mean fast-to-run?
dbz has quit [Ping timeout: 260 seconds]
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #ruby
<baweaver> jdsampayo: Are you trying to parse JS with Ruby?
jdsampayo has quit [Ping timeout: 252 seconds]
dbz_ has quit [Ping timeout: 276 seconds]
jcarl43 has quit [Quit: WeeChat 2.2]
faitswulff has quit [Ping timeout: 265 seconds]
rkoller has quit [Quit: Textual IRC Client: www.textualapp.com]
segy has quit [Ping timeout: 272 seconds]
segy has joined #ruby