« Back to channel list

#ruby - 22 August 2018

« Back 1 day Forward 1 day »
[00:01:43] za1b1tsu: has joined #ruby
[00:05:09] thoraxe: has joined #ruby
[00:05:44] 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
[00:10:53] arahael1: has joined #ruby
[00:11:09] herbmillerjr: has joined #ruby
[00:13:51] weaksauce: has joined #ruby
[00:15:00] fluxAeon: has joined #ruby
[00:22:11] mroutis: thoraxe: maybe you can run a headless chrome and call it as written on the documentation
[00:22:40] mroutis: `distill http://example.com/article.html`
[00:22:44] thoraxe: there's a ruby port of readability
[00:22:46] thoraxe: but it's kinda old
[00:23:02] thoraxe: there's python newspaper3k and a fresher python port of readability
[00:23:33] thoraxe: i could probably either make a flask python microservice or do some horrific python-from-ruby incantation
[00:23:38] thoraxe: but it doesn't look like there's a good pure ruby solution
[00:23:59] thoraxe: i think i did some horrible ruby-python stuff back in the day
[00:25:31] s2013: has joined #ruby
[00:26:14] postmodern: has joined #ruby
[00:31:08] t0xik: has joined #ruby
[00:32:13] dbz: has joined #ruby
[00:33:32] Guest23176: has joined #ruby
[00:43:25] Guest23176: has joined #ruby
[00:49:27] orbyt_: has joined #ruby
[01:18:31] Tempesta: has joined #ruby
[01:19:47] thy0: has joined #ruby
[01:24:13] faitswulff: has joined #ruby
[01:37:22] s2013: has joined #ruby
[01:41:00] arescorpio: has joined #ruby
[01:41:53] hurricanehrndz: has joined #ruby
[01:46:31] jokester: has joined #ruby
[01:49:02] hurricanehrndz: has joined #ruby
[02:00:08] hahuang65: has joined #ruby
[02:08:12] Guest23176: has joined #ruby
[02:10:01] faitswulff: has joined #ruby
[02:14:22] saiyanprince: has joined #ruby
[02:17:40] saiyanprince: Hi, where is ruby mostly used? what is ruby for?
[02:23:33] mrush: saiyanprince: web development, domain specific languages, and systems integration 'glue' language are some of the more commonly cited areas of popular use
[02:25:41] saiyanprince: has left #ruby: ()
[02:25:43] mrush: oh, also rapid prototyping is another one
[02:32:57] orbyt_: has joined #ruby
[02:33:34] darkhanb: has joined #ruby
[02:39:14] za1b1tsu: has joined #ruby
[02:41:14] vonfry: has joined #ruby
[02:43:15] dbz: has joined #ruby
[02:47:30] Creatornator: has joined #ruby
[02:48:12] Guest23176: has joined #ruby
[02:49:31] k0mpa: has joined #ruby
[02:59:04] polyidus: has joined #ruby
[03:00:31] cadillac_: has joined #ruby
[03:03:33] Guest23176: has joined #ruby
[03:05:19] akaiiro: has joined #ruby
[03:09:53] braincrash: has joined #ruby
[03:16:59] \void: has joined #ruby
[03:18:23] Guest23176: has joined #ruby
[03:33:36] Guest23176: has joined #ruby
[03:45:35] tristanp: has joined #ruby
[03:46:18] venmx: has joined #ruby
[03:47:24] akaiiro: has joined #ruby
[03:57:57] gix: has joined #ruby
[04:00:56] faitswulff: has joined #ruby
[04:01:00] bswinnerton: has joined #ruby
[04:13:28] Guest23176: has joined #ruby
[04:15:13] hurricanehrndz: has joined #ruby
[04:22:53] hurricanehrndz: has joined #ruby
[04:23:43] Guest23176: has joined #ruby
[04:27:20] za1b1tsu: has joined #ruby
[04:31:02] kapil___: has joined #ruby
[04:43:22] Guest23176: has joined #ruby
[04:46:17] za1b1tsu: has joined #ruby
[04:46:31] tristanp: has joined #ruby
[04:47:12] aufi: has joined #ruby
[04:52:20] rootsudo: has joined #ruby
[04:52:58] za1b1tsu: has joined #ruby
[04:54:57] Guest23176: has joined #ruby
[05:28:10] dbz: has joined #ruby
[05:33:13] Guest23176: has joined #ruby
[05:33:51] ShekharReddy: has joined #ruby
[05:37:20] haylon_: has joined #ruby
[05:40:42] Puffball: has joined #ruby
[05:41:52] dbz: has joined #ruby
[05:43:40] Guest23176: has joined #ruby
[05:46:41] dellavg_: has joined #ruby
[05:51:02] havenwood: has joined #ruby
[05:53:35] havenwood: has joined #ruby
[05:57:03] apeiros_: has joined #ruby
[05:57:37] Nilium: has joined #ruby
[06:04:00] kerunaru: has joined #ruby
[06:05:32] Puffball: has joined #ruby
[06:08:38] dbz: has joined #ruby
[06:10:38] Nilium: has joined #ruby
[06:14:39] Nicmavr: has joined #ruby
[06:18:34] xtsee: has joined #ruby
[06:20:39] raulp: has joined #ruby
[06:21:05] snickers: has joined #ruby
[06:21:15] armyriad: has joined #ruby
[06:23:32] Guest23176: has joined #ruby
[06:35:46] Dbugger: has joined #ruby
[06:37:58] sauvin: has joined #ruby
[06:42:36] dbz: has joined #ruby
[06:48:40] dionysus69: has joined #ruby
[06:56:23] dbz: has joined #ruby
[06:59:38] venmx: has joined #ruby
[07:01:11] rindolf: has joined #ruby
[07:02:06] yohji: has joined #ruby
[07:03:32] Guest23176: has joined #ruby
[07:12:29] clemens3: has joined #ruby
[07:13:42] Guest23176: has joined #ruby
[07:20:50] mikhael_k33hl: has joined #ruby
[07:21:32] 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?>
[07:21:50] mikhael_k33hl: https://docs.ruby-lang.org/en/2.0.0/MiniTest/Mock.html Seems to mock the method directly
[07:27:53] TomyWork: has joined #ruby
[07:28:29] Mike11: has joined #ruby
[07:37:40] fork_fx: has joined #ruby
[07:38:14] fork_fx: Hello all together, I have a question regarding "Mysql2" Gem:
[07:38:43] fork_fx: According to the documentation some result is returned after executing a query.
[07:39:14] fork_fx: I am executing an INSERT query, which obviously succeeds, but I only get "nil" as result.
[07:39:23] arekushi: has joined #ruby
[07:39:27] fork_fx: client = Mysql2::Client.new(:host => "localhost", :username => "bla", :password => "blub123", :database => "test")
[07:39:27] fork_fx: some_value=rand(10000)
[07:39:27] fork_fx: res = client.query("INSERT INTO t1(id) VALUES(#{some_value})")
[07:39:27] fork_fx: puts res.inspect
[07:39:46] fork_fx: Programm output:
[07:42:19] burgestrand: has joined #ruby
[07:43:14] fork_fx: Here's the code that shows that the query succeeds: https://dpaste.de/GcqA
[07:43:28] aufi: has joined #ruby
[07:47:54] tristanp: has joined #ruby
[07:48:44] jmcgnh: has joined #ruby
[07:52:09] dbz: has joined #ruby
[07:53:15] Guest23176: has joined #ruby
[08:03:40] dbz: has joined #ruby
[08:06:01] sina: has joined #ruby
[08:11:58] mikecmpbll: has joined #ruby
[08:29:05] rindolf: fork_fx: see http://bobby-tables.com/
[08:29:29] rindolf: fork_fx: use placeholders
[08:33:01] rindolf: mikhael_k33hl: hi
[08:33:14] jlebrech: has joined #ruby
[08:33:16] fork_fx: rindolf: I don't get your point.
[08:33:30] rindolf: mikhael_k33hl: any luck?
[08:33:32] Guest23176: has joined #ruby
[08:33:49] fork_fx: This is a simple demo of my problem, not a security proof piece of code.
[08:33:54] 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
[08:34:42] rindolf: fork_fx: well, it gives a WTF? moment
[08:35:04] rindolf: fork_fx: see http://sscce.org/
[08:35:57] mikhael_k33hl: rindolf: https://gist.github.com/marzdgzmn/f4c423327d56bfe37afea617d39d7152 Nope, trying to test if the method is receiving the correct arguments though
[08:37:15] rindolf: mikhael_k33hl: can't you mock it with loading mocked/dummy modules first?
[08:37:17] nowhere_man: has joined #ruby
[08:37:43] mikhael_k33hl: rindolf: pretty new to ruby and minitest, can you give me an example?
[08:39:20] rindolf: mikhael_k33hl: i'm not a ruby expert - see https://duckduckgo.com/?q=ruby+mock+modules&ia=qa
[08:43:15] 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?
[08:43:54] rindolf: fork_fx: i mean that there should be best practices
[08:44:07] gigetoo: has joined #ruby
[08:44:12] rindolf: fork_fx: rather than WTF?isies
[08:45:52] fork_fx: rindolf: Sorry. I'm absolutely not getting to your point.
[08:45:58] rindolf: fork_fx: nm
[08:46:10] rindolf: fork_fx: nevermind
[08:46:16] 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?
[08:47:55] rindolf: mikhael_k33hl: something is not mocked
[08:48:48] tristanp: has joined #ruby
[08:48:49] RedNifre: has joined #ruby
[08:49:46] rindolf: mikhael_k33hl: is your paste complete?
[08:50:41] dbz: has joined #ruby
[08:53:39] Guest23176: has joined #ruby
[08:55:04] RedNifre_: has joined #ruby
[08:58:12] hahuang65: has joined #ruby
[08:59:24] xt233: has joined #ruby
[09:01:08] dhollin3: has joined #ruby
[09:02:26] Zaab1t: has joined #ruby
[09:03:24] Guest23176: has joined #ruby
[09:04:19] jottr: has joined #ruby
[09:04:40] Beams: has joined #ruby
[09:18:38] alex``: has joined #ruby
[09:21:19] xall: has joined #ruby
[09:31:16] clorisu: has joined #ruby
[09:32:22] Bish: has joined #ruby
[09:32:32] Bish: does unicorn really only serve 1 connection at a time by default?
[09:47:31] 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
[09:49:21] balo: it's a process based appserver, see also https://bogomips.org/unicorn/TUNING.html
[09:49:28] Zaab1t: has joined #ruby
[09:56:28] Bish: great that you need to have a config after you already have a config.ru
[09:57:14] Bish: can't i do that via run switches?
[09:57:31] venmx: has joined #ruby
[09:59:20] nikivi: has joined #ruby
[10:02:00] jottr: has joined #ruby
[10:08:23] za1b1tsu: has joined #ruby
[10:12:04] deathwishdave: has joined #ruby
[10:12:17] reber: has joined #ruby
[10:16:56] CrazyEddy: has joined #ruby
[10:21:03] aufi: has joined #ruby
[10:21:14] bijan_: has joined #ruby
[10:24:24] kapil___: has joined #ruby
[10:24:53] mikhael_k33hl: rindolf: sorry about the late reply man, something came up that I needed to attend to
[10:25:10] rindolf: mikhael_k33hl: ok
[10:25:44] cr1xu5: has joined #ruby
[10:26:38] venmx: has joined #ruby
[10:29:43] Mike111: has joined #ruby
[10:36:10] cr1xu5: has joined #ruby
[10:36:53] Mike11: has joined #ruby
[10:42:17] GodFather: has joined #ruby
[10:43:00] mikhael_k33hl: Why am I getting a `undefined method 'to_sym'` for #<Marz::Rsync::Result:0x000000000124dd98> https://gist.github.com/marzdgzmn/518836865851d148abbdfc00e136bf01
[10:43:21] mikhael_k33hl: I've stubbed my command module to return a mocked object
[10:44:15] fork_fx: has joined #ruby
[10:44:38] Puffball: has joined #ruby
[11:02:23] mikecmpbll: has joined #ruby
[11:03:59] cadillac_: has joined #ruby
[11:04:34] rkoller: has joined #ruby
[11:06:23] cr1xu5: has joined #ruby
[11:09:14] mikhael_k33hl: Do you have to indicate the parameters to a stubbed method?
[11:17:32] 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
[11:18:17] balo: given you have `worker_processes ENV.fetch('WORKERS').to_i` in your config
[11:19:30] balo: my personal recommendation would be to use a different appserver. puma, phusion or some jruby based
[11:20:39] 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
[11:22:31] 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)
[11:34:59] bijan_: has joined #ruby
[11:37:13] mikhael_k33hl: I've selected minitest when I setup my gem, is there a way I can change it to rspec?
[11:39:52] jottr: has joined #ruby
[11:43:43] bijan_: has joined #ruby
[11:46:53] aninaki: has joined #ruby
[11:47:45] bijan__: has joined #ruby
[11:52:18] bijan_: has joined #ruby
[11:57:40] jottr: has joined #ruby
[11:59:46] apparition: has joined #ruby
[12:00:08] bijan_: has joined #ruby
[12:01:38] jespada: has joined #ruby
[12:04:32] jespada: has left #ruby: ()
[12:05:01] bijan_: has joined #ruby
[12:09:19] bijan__: has joined #ruby
[12:13:19] bijan_: has joined #ruby
[12:18:00] bijan_: has joined #ruby
[12:19:03] faitswulff: has joined #ruby
[12:22:19] bijan__: has joined #ruby
[12:23:32] Sprckt: has joined #ruby
[12:26:19] bijan_: has joined #ruby
[12:36:08] apeiros_: has joined #ruby
[12:36:25] LiftLeft2: has joined #ruby
[12:37:34] bijan_: has joined #ruby
[12:41:48] Zaab1t: has joined #ruby
[12:43:46] Sprckt: has left #ruby: ("Leaving")
[12:46:07] thy0: has joined #ruby
[12:47:18] MrGrymReaper: has joined #ruby
[12:49:49] 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?
[12:51:05] MrGrymReaper: In otherwords 1 array but then say a nam
[12:51:32] MrGrymReaper: I mean a name as in a first name, surname and age etc.
[12:53:14] bijan_: has joined #ruby
[12:53:20] bswinnerton: has left #ruby: ("The Lounge - https://thelounge.chat")
[12:55:09] 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.
[12:57:17] 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.
[13:02:17] mikecmpbll: has joined #ruby
[13:03:09] hdabrows: has joined #ruby
[13:03:26] 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).
[13:03:37] dbz: has joined #ruby
[13:03:59] bijan_: has joined #ruby
[13:04:29] deathwishdave: has joined #ruby
[13:04:41] Puffball: has joined #ruby
[13:05:04] ineb: Sorry i dont understand your question
[13:05:09] dionysus70: has joined #ruby
[13:06:51] 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.
[13:07:19] MrGrymReaper: While being associated with the original array.
[13:08:32] ineb: You mean like [1,2,3] + "Whatever" ?
[13:09:15] ineb: with "Whatever" not really being loaded into the original array
[13:09:33] ineb: but the new object knows about [1,2,3] and "Whatever"?
[13:10:58] 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.
[13:11:04] dionysus70: has joined #ruby
[13:11:27] ineb: so you basically want an array with additional features?
[13:11:44] AJA4350: has joined #ruby
[13:11:49] ineb: you can subclass array if you want
[13:12:10] ineb: but if you dont need the full feature set of an array for your purpose you can look into forwardable
[13:12:50] MrGrymReaper: I'm new to Ruby is there any tutorials, documentation or code please - Gems?
[13:13:25] MrGrymReaper: I'm currently learning Ruby but coming from Microsoft Visual Basic 6.0 Professional.
[13:13:47] bijan_: has joined #ruby
[13:13:53] ineb: No problem, take a look at Ruby Interitance http://rubylearning.com/satishtalim/ruby_inheritance.html
[13:14:00] apeiros_: it's generally not advisable to subclass classes you don't own
[13:14:24] apeiros_: (Object & BasicObject being exempted for obvious reasons)
[13:14:46] ineb: i agree. forwardable makes more sense
[13:15:20] ineb: but i wanted to distill the question. and it looks like its boils down 'how to enrich an existing class with features'
[13:15:28] ineb: which can be done by inheritance :)
[13:15:49] 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.
[13:16:31] 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
[13:17:10] apeiros: (not entirely sure whether refinements actually truly belong into the inheritance "box")
[13:17:25] apeiros: but apart from refinements, inheritance should usually only be used for classes/objects you own
[13:17:37] 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 :)
[13:17:48] ineb: however, you can extend and use them as you like in your own environment
[13:17:49] bijan_: has joined #ruby
[13:20:41] 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.
[13:21:27] ineb: Okay, maybe you are just looking for a Hash?
[13:22:38] bmurt: has joined #ruby
[13:22:50] ineb: >> hash = Hash.new; hash[:hello] = 5; puts hash[:hello]
[13:22:56] ruby[bot]: ineb: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[13:24:19] dbz: has joined #ruby
[13:24:22] 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.
[13:25:59] ineb: and how do you receive the values and subvariables?
[13:26:12] ineb: if not by index or by key
[13:26:37] gnufied: has joined #ruby
[13:26:45] MrGrymReaper: You define the the Array first in VB. Then define each subvariable.
[13:27:09] [Butch]: has joined #ruby
[13:27:18] ineb: and a subvariable is a reference to a value in the array?
[13:27:30] MrGrymReaper: The values themselves are stored in the subvariables and the array becomes like a database record.
[13:28:20] ineb: this doesnt provide any performance benefits regarding io
[13:28:39] faitswulff: has joined #ruby
[13:29:56] ineb: well, of course it does in c where you could just store an array of pointers instead of copying the actual value
[13:30:16] ineb: but was that the case in VB?
[13:30:45] bijan_: has joined #ruby
[13:32:06] MrGrymReaper: In VB you could iterate through the array using a for loop or if you knew the index go straight to the value.
[13:32:30] ineb: you can do that in ruby too
[13:38:35] za1b1tsu: has joined #ruby
[13:41:49] segy: has joined #ruby
[13:42:13] GodFather: has joined #ruby
[13:45:09] cadillac_: has joined #ruby
[13:46:09] bijan_: has joined #ruby
[13:49:14] orbyt_: has joined #ruby
[13:52:35] segy: has joined #ruby
[13:52:40] tristanp: has joined #ruby
[13:57:39] bijan_: has joined #ruby
[13:59:37] bougyman: has joined #ruby
[14:00:08] faitswulff: has joined #ruby
[14:01:34] BuildTheRobots: has joined #ruby
[14:07:54] bijan_: has joined #ruby
[14:08:49] lxsameer: has joined #ruby
[14:10:12] mroutis: has joined #ruby
[14:12:50] IanMalcolm: has joined #ruby
[14:13:17] dbz: has joined #ruby
[14:15:06] bijan_: has joined #ruby
[14:17:10] Rapture: has joined #ruby
[14:17:10] cadillac_: has joined #ruby
[14:20:08] kryptoz: has joined #ruby
[14:20:54] 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
[14:21:16] apeiros: oh, actually it changes with ruby 2.5, not 2.4
[14:22:25] apeiros: ACTION reads ticket #3178
[14:26:44] g-: has joined #ruby
[14:28:42] apeiros: uuuh, I'm blind? where the heck is the current changelog?
[14:28:47] apeiros: I can only find one up to ruby 2.4
[14:28:48] faitswulff: has joined #ruby
[14:31:16] tty: has joined #ruby
[14:32:40] croberts: has joined #ruby
[14:34:56] ogres: has joined #ruby
[14:34:59] shenghi: has joined #ruby
[14:38:59] apeiros: so it's intentional: https://github.com/ruby/ruby/commit/2635984cf2b9b7632f8b35afa2f29d219aba104a
[14:39:03] faitswulff: has joined #ruby
[14:39:12] cadillac_: has joined #ruby
[14:39:20] apeiros: but I can't see it in NEWS (and since I can't find the file, neither in CHANGELOG)
[14:42:22] Inline: has joined #ruby
[14:47:28] 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 :-(
[14:49:35] ruby[bot]: -b *!*@wesleyy.com$#ruby-banned
[14:50:22] dellavg_: has joined #ruby
[14:50:41] k0mpa: has joined #ruby
[14:55:02] maxdoubt: has joined #ruby
[14:56:43] cadillac_: has joined #ruby
[14:57:11] faitswulff: has joined #ruby
[14:57:17] Tempesta: has joined #ruby
[15:00:07] deathwishdave: has joined #ruby
[15:02:34] Alina-malina: has joined #ruby
[15:05:52] aufi: has joined #ruby
[15:07:00] rindolf: has joined #ruby
[15:07:34] rindolf: mikhael_k33hl: here?
[15:11:37] ByronJohnson: has joined #ruby
[15:13:10] rindolf: mikhael_k33hl: any luck?
[15:13:31] mikhael_k33hl: rindolf: nah, I've switched from minitest to rspec now
[15:13:40] mikhael_k33hl: rindolf: hopefully I can make it work with rspec
[15:13:52] rindolf: mikhael_k33hl: gl
[15:14:08] mikhael_k33hl: rindolf: thanks man . . just can't seem to make the stub/mock work with modules I guess
[15:14:09] rindolf: mikhael_k33hl: rspec is nice from my experience
[15:14:33] mikhael_k33hl: rindolf: I guess minitest is for hardcore ruby programmers hehe
[15:16:23] jottr: has joined #ruby
[15:16:25] mikhael_k33hl: what's a good rspec video from beginner to advance?
[15:16:51] snickers: has joined #ruby
[15:22:30] g-: the rspec doc examples are really nice, did you see those yet?
[15:23:52] mikhael_k33hl: g-: I'll take a look, it's just video tutorials, based on my experience, gets your hands dirty asap, hehe
[15:25:08] bijan_: has joined #ruby
[15:25:35] g-: i hear ya.. there are a few course for rspec on udemy
[15:28:02] troys: has joined #ruby
[15:29:31] mroutis: hehe, I also switched from minitest to rspec because of stub/mocks
[15:30:06] havenwood: mroutis: Didn't like Minitest's stubs and mocks?
[15:31:48] mroutis: no, havenwood, I enjoy the expresiveness of rspec `allow x to receive y`
[15:33:02] faitswulff: has joined #ruby
[15:34:33] mroutis: (in the ruby on rails context, where the convention is a lot of side-effects)
[15:36:28] mroutis: for example, I have a controller that does something like: `if resource.save?; send_info_to_third_party; notify_user; render... end`
[15:37:26] mroutis: with rspec, I can describe "POST #create", and before(:each) do "allow(controller).to receive(:sedn_info_to_third_party) and (:notify_user)"
[15:38:08] bijan_: has joined #ruby
[15:38:26] mroutis: and have a case: "when data is invalid, expect(controller).to_not have_received(:send_info_to_third_party)"
[15:40:27] ineb: i understand but this testing can get tedious very quickly
[15:40:44] ineb: you need to keep track of the function names and check for explicit calling
[15:40:55] ineb: which will change eventually and then your tests are instantly outdated
[15:41:21] g-: and jenkins will tell you if you break something
[15:42:06] mroutis: indeed, ineb, but something like `s/current_function/new_function/` will do the work
[15:42:40] ineb: just an example here, instead of send_info_to_third_party you could have an ThirdPartyInformant with #notify or something
[15:43:09] ineb: easy to mock and never needs to be touched in your controller tests
[15:43:59] mroutis: yes, that's true, minitests encourages to being able to mock objects in order to add stubs to it
[15:44:50] ineb: its just what iam experiencing if iam using too much expects of have_received and so on
[15:45:11] ineb: better to make use of the facade pattern in your controllers case
[15:45:18] ineb: but idk ofc
[15:45:26] ineb: maybe it isnt worth the effort in your case
[15:45:41] ineb: time will tell how often you have to change your current tests :P
[15:47:45] mroutis: sure! also, if you are collaborating with more people, you need to take into account their skill level and their _code perspective_
[15:48:03] orbyt_: has joined #ruby
[15:48:51] mroutis: sometimes, you are working with someone more "procedural", and they'll make horrible decisions if they are forced to write good OOP code
[15:50:44] bijan_: has joined #ruby
[15:51:47] pulgolino: has joined #ruby
[15:53:20] mroutis: I guess that the best test suite / codebase is the one where all the involved can be as productive as possible
[15:55:20] bijan_: has joined #ruby
[15:58:12] jcarl43: has joined #ruby
[15:59:09] bijan__: has joined #ruby
[15:59:20] apeiros_: has joined #ruby
[16:02:00] mikecmpb_: has joined #ruby
[16:03:34] bijan_: has joined #ruby
[16:04:25] mikhael_k33hl: Why am I getting a syntax error for a freshly generated spec_helper.rb from bundle gem
[16:04:45] mikhael_k33hl: https://dpaste.de/yM1w
[16:05:43] apeiros_: mikhael_k33hl: you know, when you get exceptions, you *reeeally* should paste them along.
[16:07:25] mikhael_k33hl: apeiros_: Sorry about that, https://gist.github.com/marzdgzmn/c3d7af36c00e52387d50ae12df050e2a
[16:07:50] s2013: has joined #ruby
[16:08:11] apeiros_: you seem to have pasted the wrong file.
[16:08:21] apeiros_: the error tells you that spec/marz/rsync_spec.rb:22 is where the syntax error is
[16:09:13] mikhael_k33hl: hmm, wait, let me see . . . it's the only file I have in my atom project view
[16:09:26] ephemera_: has joined #ruby
[16:10:30] cagomez: has joined #ruby
[16:10:31] mikhael_k33hl: by the way, have you guys tried the pragmatic studio ruby/rails course? care to share your thoughts? is it good? :)
[16:13:21] deathwishdave: has joined #ruby
[16:15:19] bijan_: has joined #ruby
[16:18:06] darkhanb: has joined #ruby
[16:28:54] bijan_: has joined #ruby
[16:32:08] dbz: has joined #ruby
[16:32:44] dbz: has joined #ruby
[16:34:32] g-: has joined #ruby
[16:34:55] [Butch]: has joined #ruby
[16:36:08] bijan_: has joined #ruby
[16:38:32] orbyt_: has joined #ruby
[16:43:52] NightMonkey: has joined #ruby
[16:44:16] vikaton: has joined #ruby
[16:46:42] lomex: has joined #ruby
[16:53:34] eckhardt: has joined #ruby
[16:55:04] Nicmavr: has joined #ruby
[17:00:19] faitswulff: has joined #ruby
[17:07:18] GodFather: has joined #ruby
[17:08:18] s2013: has joined #ruby
[17:11:07] nowhere_man: has joined #ruby
[17:11:31] IanMalcolm: has joined #ruby
[17:22:23] bijan_: has joined #ruby
[17:25:20] GodFather: has joined #ruby