marz_d`ghostman

Activity Graph

Page 1 of 2 | Next »

2019-01-17

[05:59:26] marz_d`ghostman: has joined #ruby
[05:59:48] marz_d`ghostman: I have a script/app written in ruby running in a CentOS7 machine. Is there a utility where I can monitor the process and its subprocesses?
[06:00:31] marz_d`ghostman: The script/app creates a couple of rsync subprocess on a different thread via concurrent-ruby
[11:50:13] marz_d`ghostman: Quit: Page closed

2019-01-10

[09:41:53] marz_d`ghostman: has joined #ruby
[09:42:07] marz_d`ghostman: Why am I getting an error: mirror_manager.rb:74:in `block in <class:Manager>': undefined method `send_error_notification' for Rise::MirrorManager::Manager:Class (NoMethodError) for my code: https://termbin.com/denk
[09:42:54] marz_d`ghostman: I meant: https://termbin.com/xgp2
[09:54:20] marz_d`ghostman: phaul: It does, does it matter if it's private or not? I think I'm calling it inside the object context. Perhaps I'm wrong with this at_exit method
[10:01:03] marz_d`ghostman: I tried invoking the method directly via Rise::MirrorManager::Notification.send_slack_message, but it gives me the same error
[10:04:47] marz_d`ghostman: Ah, I made the module method as a class method via module_function so I can call it in class context
[17:15:19] marz_d`ghostman: Ping timeout: 256 seconds

2018-12-28

[07:04:05] marz_d`ghostman: Quit: Page closed
[09:48:27] marz_d`ghostman: has joined #ruby
[09:49:02] marz_d`ghostman: I've created a /config/initializers/production.rb & test.rb . . . to initialize things. However, how do I select which one should be included when I run it in production and test?
[10:08:34] marz_d`ghostman: Quit: Page closed

2018-12-27

[11:47:32] marz_d`ghostman: Quit: Page closed
[18:09:00] marz_d`ghostman: has joined #ruby
[18:09:30] marz_d`ghostman: I have my gems installed via bundle install --path .bundle on my project root directory. How do I run ruby so that it sees the gems?
[18:12:39] marz_d`ghostman: phaul: Ah, thanks. Also, how do I access instance methods inside at_exit blocks? I placed an at_exit block that I would like to email me if $ERROR_INFO
[18:17:23] marz_d`ghostman: phaul: https://gist.github.com/marzdgzmn/382217dc13aab3df2429d4fbf514eb66
[18:23:40] marz_d`ghostman: baweaver: What do you mean as a supervisor?
[18:42:50] marz_d`ghostman: phaul: It gets triggered via Manager.new.run though hence I'm inlcuding it to make it available as an intance method rather than a class metho
[18:43:18] marz_d`ghostman: phaul: thanks for the recommendation, I'll double check.

2018-12-26

[05:06:21] marz_d`ghostman: has joined #ruby
[06:27:49] marz_d`ghostman: How do I capture my thread's output and error? https://gist.github.com/marzdgzmn/dc6e8992a353ecf9ed2384b2cb987c3a When I manually run the class itself, the one that should be run on a different thread, it gives me errors. But if I run it on a different thread the errors/output doesn't come up
[12:59:56] marz_d`ghostman: What does catch(:halt) { yield } do? I know it catches the thrown :halt but what does the { yield } do? I don't see anywhere it's being used with a block passed to it
[13:00:03] marz_d`ghostman: https://github.com/sinatra/sinatra/blob/v1.4.6/lib/sinatra/base.rb#L1066
[14:05:13] marz_d`ghostman: tbuehlmann: Oh, I see, so the block is passed to invoke, thanks.
[15:04:13] marz_d`ghostman: Ping timeout: 256 seconds
[15:44:40] marz_d`ghostman: has joined #ruby
[15:44:53] marz_d`ghostman: Anyone using concurrent-ruby gem? How do I rescue exception from threads? thread_pool = Concurrent::FixedThreadPool.new(10, max_queue:50) until job_list.empty? job = job_list.shift Concurrent::Promises.future(executor: thread_pool) { MyJob.run(job) }. rescue{ |e| puts e }.result end
[15:45:05] marz_d`ghostman: Sorry, mispasted it, I meant: https://gist.github.com/marzdgzmn/37ef33a17716fae30db86446b4d8b769
[15:45:16] marz_d`ghostman: Doesn't seem to work
[15:56:03] marz_d`ghostman: I was missing the .result at the end though :)

2018-12-24

[07:25:52] marz_d`ghostman: I'm using a gem that has this line: output = `#{cmd} 2>&1` . But in my script I have redirected $stderr to a logger instance and I'm getting a uninitialized stream error. How do I fix this one so the 2>&1 will also get redirected to the logger?
[07:50:48] marz_d`ghostman: Quit: Page closed

2018-12-21

[13:14:18] marz_d`ghostman: Does Logger automatically capture stderr and stdout if you set it to FATAL?
[16:34:00] marz_d`ghostman: If a thread raises an error like TypeError: no implicit converison of nil into String, how do I capture it for logging?
[16:59:05] marz_d`ghostman: How do I capture errors from a thread. I tried: https://gist.github.com/marzdgzmn/da9c0eb69a6fa9647531e8ffbeecf2eb/edit. But it does't seem to work
[17:20:22] marz_d`ghostman: Can someone suggest a good article or book about threads in ruby like how to capture its stdout and stderr.

2018-12-20

[08:09:15] marz_d`ghostman: has joined #ruby
[08:09:50] marz_d`ghostman: Why is the job I'm passing in to concurrent-ruby doesn't seem to be registered. Tried to output completed_task_count but it's zero: https://gist.github.com/marzdgzmn/e42976cfd10a45690d29e751104d0f7a
[16:17:21] marz_d`ghostman: Ping timeout: 256 seconds
[17:47:35] marz_d`ghostman: has joined #ruby
[17:48:02] marz_d`ghostman: Why am I getting a ruby_executable_hooks: end of file reached (EOFError) when sending emails? https://gist.github.com/marzdgzmn/614969af17f74b3f6fdc2422d7c4cfae
[18:12:47] marz_d`ghostman: I have created two ruby files under /config/initializers. How do I run one when I'm testing and the other when I'm not testing?
[18:30:09] marz_d`ghostman: jordanm: I'm not using Rails though
[18:32:15] marz_d`ghostman: under /lib I have my main ruby file say main.rb then I require the initializer file under project/config/initializers/production.rb via require File.join(__dir__, '../../config/initializers/production) in main.rb
[18:33:03] marz_d`ghostman: the production.rb has this require line for Foo::Bar::Configuration but it doesn't seem to be able to find it though
[18:33:22] marz_d`ghostman: it says cannot load such file -- foo/bar/configuration
[18:35:22] marz_d`ghostman: Ohhh, I may need to add it to load_path

2018-12-19

[14:29:37] marz_d`ghostman: has joined #ruby
[14:29:58] marz_d`ghostman: Any good gem that would make testing concurrency easy? Currently using concurrent-ruby gem in my script
[22:05:23] marz_d`ghostman: Ping timeout: 256 seconds

2018-12-18

[09:08:40] marz_d`ghostman: has joined #ruby
[09:08:51] marz_d`ghostman: Is it possible to bundle a bin in your app not just gem?
[09:54:06] marz_d`ghostman: I've uninstalled a package from my OS and reinstalled it but it appears to have triggered something that causes a lot of warning now like /.bundle/ruby/2.4.0/gems/sqlite3-1.3.13/lib/sqlite3/sqlite3_native.so: warning: already initialized constant SQLite3::Constants::Open::READONLY
[09:54:09] marz_d`ghostman: How do I fix it?
[11:04:45] marz_d`ghostman: Ping timeout: 256 seconds

2018-12-17

[13:23:35] marz_d`ghostman: has joined #ruby
[13:57:25] marz_d`ghostman: I'm using the sqlite3 gem, Is it possible to like flush a statement so I could like create a table and then insert data in one SQLite3::Database.open?
[13:58:07] marz_d`ghostman: Like inside a SQLite3::Database.open(file) . .. I'm creating a table then pushing data. I'd like to push the creation of the table first. Is that possible though?
[14:01:41] marz_d`ghostman: darix: cause I when I do a get query, no records are returned, tried to manually query it via irb and sqlite3 on cli
[14:08:22] marz_d`ghostman: darix: So, I've created a initialize.rb to run first before my main script for database population: e21d499b15ddb9bf05e6030facdec7b8
[14:12:35] marz_d`ghostman: darix: what do you mean?
[14:17:28] marz_d`ghostman: darix: the INSERT line?
[14:18:07] marz_d`ghostman: darix: Oh I'm sorry: https://gist.github.com/marzdgzmn/e21d499b15ddb9bf05e6030facdec7b8
[14:19:14] marz_d`ghostman: darix: It doesn't trigger any error though
[14:20:12] marz_d`ghostman: darix: it run fine, but when my tests run it invokes an error because the inserted data aren't there. Tried to manually run a select query in `irb` and sqlite3 cli, and the records aren't there
[14:30:41] marz_d`ghostman: doesn't work on mine though, we have the same exact script. the tables are there but not the data
[15:01:34] marz_d`ghostman: darix: I'm not sure if it because of the versions, but db.commit semms to have fixed it
[15:01:41] marz_d`ghostman: db.commit before the inserts
[15:10:13] marz_d`ghostman: I'm using ruby 2.4 though, and I was wrong, it still isn't working lol
[15:35:05] marz_d`ghostman: darix: Tried running in in its own script, and it seems to work. But when I require it inside the spec_helper, it doesn't. Is there something in spec_helper or rspec that is conflicting with it?
[16:27:03] marz_d`ghostman: With sqlite3 gem, why does results_as_hash return {"pre_cmd_result"=>"Failed", 0=>"Failed"} two hashes for one result?
[16:45:57] marz_d`ghostman: Quit: Page closed

2018-12-14

[07:35:22] marz_d`ghostman: has joined #ruby
[07:37:00] marz_d`ghostman: Is using a class variable within a method a good practice? https://gist.github.com/marzdgzmn/da15a290e3ae436e69d18adf5f9bffd6
[08:07:51] marz_d`ghostman: havenwood: a constant inside a module? then I can refer to it in module methods included in an object . . . I'll try that
[08:11:37] marz_d`ghostman: havenwood: thanks
[08:17:41] marz_d`ghostman: is there a way I can refer to object on other modules in shorthand like I have two modules Foo::Bar::Configuration and Foo::Bar::Logging, I want to refer to the objects in COnfiguration from Logging.
[10:27:18] marz_d`ghostman: I'm testing a module and created a dummy class to include it. I'm getting an undefined method `update_result` method: https://gist.github.com/marzdgzmn/80c36df582ca10199a2b434cc343b676
[10:27:29] marz_d`ghostman: Tried printing the public_instance_methods, and it seems to be there though
[10:34:33] marz_d`ghostman: Ping timeout: 256 seconds

2018-12-13

[14:21:49] marz_d`ghostman: has joined #ruby
[14:26:55] marz_d`ghostman: What's the best practice when defining module variables so that I can refer to it in its methods? Am I doing this right? https://gist.github.com/marzdgzmn/c5f855eeb616c5ffff7801b99d91fdd7
[15:05:13] marz_d`ghostman: Iambchop: Even though @db will only be dealt with by the module methods?
[15:05:42] marz_d`ghostman: Iambchop: If so, can you recommend a good pattern on how to tackle this one.
[15:06:49] marz_d`ghostman: Please disregard my first question, I see that @db will not be reachable from the instance that included the module. :)
[16:34:29] marz_d`ghostman: Quit: Page closed

2018-12-12

[04:55:32] marz_d`ghostman: has joined #ruby
[04:58:27] marz_d`ghostman: Is it possible in ruby to add an attribute to OpenStruct in rspec without retaining it like only inside a context scope? https://gist.github.com/marzdgzmn/47f733d18bb8da5feac2c5db89f200ea
[05:15:33] marz_d`ghostman: smhuber: thanks. Is there any blocks I can put an `allow` statement to be shared with multiple `it`s?
[05:17:32] marz_d`ghostman: smhuber: so before blocks are local within context blocks eh?
[05:29:10] marz_d`ghostman: smhuber: Is there a book or a resource somewhere I can read to about these things? I didn't seem to ready any of it online
[05:35:09] marz_d`ghostman: smhuber: okay thanks mate. I appreciate it :)
[07:37:23] marz_d`ghostman: Ping timeout: 256 seconds
[11:32:20] marz_d`ghostman: has joined #ruby
[11:36:33] marz_d`ghostman: How do I temporarily override a variable inside a context? It seems that the `before` statement on line 98 is overriding the statement and making the succeeding tests fail as it should have the value 'true' when getting out of that context: https://gist.github.com/marzdgzmn/fe94064b777c084aa4ef0284f0a46290
[12:12:17] marz_d`ghostman: jhass: I understand before statements on the outer context gets executed first before the before statements in an inner context. However, is there like a mechanism where the overriding variable will be local to the inner context like defining a local block variable e.g. ;x?
[12:20:47] marz_d`ghostman: jhass: Uhhm, so like use let to define a new variable on every context? that was the next step I was thinking to do, just wondering if I can do it with a similar local block variable mechanism. Guess I got into it too deep though hehe
[12:31:14] marz_d`ghostman: jhass: So what I've though is to define a base object on the outer most via `let`. Then just extend that object and assign it to another variable via another `let` on inner context to preserve the base object for another inner context to use. Am I doing it right though?
[12:33:18] marz_d`ghostman: Okay, guess I'll just do that cause if I modify the variable defined by the outermost let in an inner context it seems to retain the modified value. Which seems to be what should be though now that I think of it :)
[12:37:58] marz_d`ghostman: jhass: So it would be something like this: https://gist.github.com/marzdgzmn/a4ecd1abdf985d300147d7d4848feeed?
[12:39:20] marz_d`ghostman: jhass: can you give me an example please
[12:57:20] marz_d`ghostman: jhass: thanks, kudos to the test. I'm still currently going through it :)
[12:59:56] marz_d`ghostman: jhass: what's --seed 0 or --order rand:123 for?
[13:04:03] marz_d`ghostman: I'm starting to understand it better now. So ruby evaluates the code like in two phases, once for none test-related stuff hence 'ABFJK', then second for the test-related stuff starting with the `before` statement going to the `it` while lazily evaluates any `let` definitions
[13:23:12] marz_d`ghostman: it still gives the same output though, am just gonna save this code for future reference, really appreciate you clearing me from my confusion mate. thanks

2018-12-02

[13:59:37] marz_d`ghostman: In Rspec when testing a module, like Rspec.describe Foo::Bar . . . why do I get an error with let(:bar) { Bar.new() }?
[14:02:07] marz_d`ghostman: peirama: I have let(:bar) { subject.new(args) }, but I'm getting an error saying wrong number of arguments(given 0,expected1) even if I'm passing in an argument
[14:31:47] marz_d`ghostman: Quit: Page closed

2018-12-01

[14:58:18] marz_d`ghostman: has joined #ruby
[14:58:58] marz_d`ghostman: I'm trying to test my Module methods(self.method) in rspec. However, I'm getting uninitialized constant error. How do I test it like Module::Module.method?
[16:37:42] marz_d`ghostman: phaul: https://gist.github.com/marzdgzmn/ad3e68c5a36cddaa13db3938d018d5b8 It's giving my uninitialized constant Rise::MirrorManager::Mirror
[16:46:00] marz_d`ghostman: phaul: When you require files in spec files, is the path relative to the file like you'll have to put ../../.. to reach the root dir then go inside the /lib directories where your .rb files are?
[16:56:23] marz_d`ghostman: phaul: thanks, I'll look into it
[20:03:45] marz_d`ghostman: Is it good practice to place a self.log on the top most module so that I can just call it anywhere whenever I want to log something?
[20:15:20] marz_d`ghostman: Is there a way to make sure a file gets run before anything else? Like I have a config/initializer/test.rb that popuplates config variables. I'd like that to run since the constant I'm declaring under a module is saying its nil since it depends on the config variables
[20:57:03] marz_d`ghostman: Is this considered elegant in ruby though? https://gist.github.com/marzdgzmn/9b5487ce460236f8d462cbc717a9b0f3

2018-11-28

[11:40:11] marz_d`ghostman: What design pattern can I use instead of declaring a global variable for logging?
[11:44:08] marz_d`ghostman: ah so you can just access it via MyApp::log
[11:44:39] marz_d`ghostman: oh right cause it's a class method
[11:45:26] marz_d`ghostman: Iwhat's the difference of :: and . then?
[11:50:57] marz_d`ghostman: By the way, if I have a Configuration module on my module MyApp, can I call the Configuration module directly or do I still have to prepend it with MyApp::Configuration?
[16:51:26] marz_d`ghostman: Quit: Page closed

2018-11-27

[16:09:45] marz_d`ghostman: has joined #ruby
[16:10:00] marz_d`ghostman: Isn't the 'with_options' available for activerecord in plain ruby? what's the alternative?
[16:14:54] marz_d`ghostman: is there an alternative to using orm for plain ruby?
[16:15:52] marz_d`ghostman: oh yea, I mean activerecord
[16:16:59] marz_d`ghostman: tbuehlmann: I'm trying to make this work
[16:17:00] marz_d`ghostman: http://termbin.com/oorf
[16:17:18] marz_d`ghostman: tbuehlmann: but it says with_options is an undefined method
[16:21:49] marz_d`ghostman: havenwood: Is there a module I can require to have it support everything including the stuff like allow_blank etc. etc.
[16:24:23] marz_d`ghostman: havenwood: thanks. So you leaning on sequel rather than activesupport?
[17:09:38] marz_d`ghostman: havenwood: Thanks mate

2018-11-26

[08:16:28] marz_d`ghostman: has joined #ruby
[12:56:06] marz_d`ghostman: Quit: Page closed

2018-11-22

[12:57:55] marz_d`ghostman: Quit: Page closed

2018-11-21

[06:52:27] marz_d`ghostman: Ping timeout: 256 seconds
[16:26:01] marz_d`ghostman: has joined #ruby
[16:44:44] marz_d`ghostman: is it good practice to create a singleton for database operation or create a module with a class instance for database?
[16:45:24] marz_d`ghostman: I just want to abstract it out so I could swap database all I have to do is modify the singleton class or module

2018-11-20

[04:44:15] marz_d`ghostman: has joined #ruby
[04:44:49] marz_d`ghostman: Is there an alternative for stub_const in rspec to override constants for the whole test? Like I have a constnat defined for the directory where logs are stored and I want to override that during tests
[04:54:07] marz_d`ghostman: baweaver: thanks, I'll look into it
[05:55:06] marz_d`ghostman: In plain ruby, how do I know if my script is being run in development/production/test(rspec)?
[06:01:44] marz_d`ghostman: baweaver: I created this config class:http://termbin.com/kj12 how do I populate different values based when it is run in production and in rspec though?
[06:04:00] marz_d`ghostman: Created a config/initializer/config.rb file in my project root to define the settings. e.g. App.configure do |config| log_dir = '/var/logs' end.
[06:04:07] marz_d`ghostman: but I want to set a different dir when testing
[06:04:31] marz_d`ghostman: Is there an environment variable set so I could define the corresponding values based on it is run on test or not?
[08:28:21] marz_d`ghostman: zenspider: How do you run a file like /config/initializer/test.rb in rspec_helper?
[09:00:03] marz_d`ghostman: Ping timeout: 256 seconds
[13:17:19] marz_d`ghostman: has joined #ruby
[13:18:15] marz_d`ghostman: I'm trying to test that a file is being created with File.open. However, I have two File.open statement in my script and the first File.open statement is handled first which will make my expect test fail. How do I bypass the first one
[13:40:25] marz_d`ghostman: I want to define a double and let it be the return value of a method. Like allow(SyncLog).to receive(:new).and_return(double()). How do I do it in a describe block scope instead of having to repeat it inside multiple "it".
[13:40:56] marz_d`ghostman: phaul: Oh, my script is conditional so I have to test that if this condition is met it creates the File. Thus, I'm testing if the File.open has been invoked
[13:43:46] marz_d`ghostman: phaul: I'll try the let blocks, thanks
[13:53:01] marz_d`ghostman: Ping timeout: 256 seconds
[14:20:28] marz_d`ghostman: has joined #ruby
[14:21:19] marz_d`ghostman: I'm testing every method call in isolation. So my first it block goes like it 'should create a new instance of logger' do expect(SyncLog).to receive(:new). How do I end the test with just that so that it won't continue to execute the script?

2018-11-19

[06:03:02] marz_d`ghostman: has joined #ruby
[07:20:29] marz_d`ghostman: I'm trying to test the format of logger, is there like a test specific stream I can use instead of a file?
[13:01:01] marz_d`ghostman: Iambchop: thanks I'll look into it
[13:02:42] marz_d`ghostman: Quit: Page closed

2018-11-17

[08:45:40] marz_d`ghostman: has joined #ruby
[08:47:24] marz_d`ghostman: Tried creating a config.rb on my project root to declare some application wide constants. The constants defined in it doesn't seem to be accessible by other parts of my application, specifically under /lib. https://gist.github.com/marzdgzmn/e59587818b0046c4b8911a58a5b5fce9
[08:59:42] marz_d`ghostman: How do I test File.open in rspec?
[09:02:59] marz_d`ghostman: Quit: Page closed

2018-11-16

[05:58:40] marz_d`ghostman: has joined #ruby
[05:59:09] marz_d`ghostman: I already have an existing spec files for some of my .rb files. Is there a command to automatically generate spec files for newly created .rb files?
[06:50:55] marz_d`ghostman: Is it possible to create an instance variable from a module included in a class? Like inside self.included method of a module?
[06:51:52] marz_d`ghostman: baweaver: Where can I view the video?
[06:53:42] marz_d`ghostman: baweaver: I have created a module specifically for Logging which I just want to include in a class. In the said module, I want to create a specific log file for each instance of the class where I include it. So as to separate logging functionalities.
[06:53:53] marz_d`ghostman: or is it going too far?
[06:56:28] marz_d`ghostman: I guess I'll just have to create the logger in the class itself to make it simple
[06:57:08] marz_d`ghostman: Every instance of a class will run a different sync, so I want to log it on different files depending on the directory it is syncing
[07:08:11] marz_d`ghostman: baweaver: Is this a good design though? https://gist.github.com/marzdgzmn/f38b095c15eb737c7a544f46358fef28
[15:14:54] marz_d`ghostman: Quit: Page closed

2018-11-15

[04:39:17] marz_d`ghostman: has joined #ruby
[04:39:57] marz_d`ghostman: https://gist.github.com/marzdgzmn/96b252c0d6c5b28271d7876cb9545ff0 How do I define a local variable for the given describe block. It appears the last declaration overrides all previous declarations of it.
[08:12:51] marz_d`ghostman: There is a bypass to simulate a failing command via (exit 1); is there anything that will make it output anything?
[08:13:47] marz_d`ghostman: havenwood: Oh, I'm trying to stub a command for rspec though
[08:14:14] marz_d`ghostman: havenwood: Like I want to feed a failing command that outputs to stderr to test if my code is handling it properly
[08:17:02] marz_d`ghostman: Guess I can feed it with (echo 'error' >&2; exit 1)
[15:33:23] marz_d`ghostman: Quit: Page closed

2018-11-10

[03:16:43] marz_d`ghostman: Quit: Page closed

2018-11-09

[04:48:14] marz_d`ghostman: has joined #ruby
[04:49:03] marz_d`ghostman: Pertaining instance variable, I've seen people assign values to instance variables then create a attr_reader with the same name as the instance variable so they can refer to the instance variable without '@'. How does that work and what's the advantage of doing it?
[06:08:55] marz_d`ghostman: baweaver: I see. Thanks for clarifying that one
[06:10:42] marz_d`ghostman: I'm trying to override a subject inside an inner context. However, it appears that the variable inside the inner context which is suppose to be local inside the context is overriding the subject outisde of the context.
[10:03:43] marz_d`ghostman: when doing tests in rsped for your class method do you put each method test via describe under one whole describe 'Class'?
[10:18:50] marz_d`ghostman: phaul: I'm trying to test each method of my class. So basically I have Rspec.describe Class then describe '#method'. However, my problems is I want to create a subject for each method is that even possible? I tried it but it appears that the subjects overrides each other
[10:20:22] marz_d`ghostman: phaul: Yeah. Also, when testing, I want to terminate after an expect is met. How do I do that? so it won't go on and continue the entire script
[10:24:10] marz_d`ghostman: I see, I'll try looking into that
[10:26:07] marz_d`ghostman: just found out after block gets executed before any ensure

2018-11-08

[05:20:57] marz_d`ghostman: has joined #ruby
[05:38:10] marz_d`ghostman: I have a test in rspec: https://gist.github.com/marzdgzmn/b3d8ec6e60bc700a5fd1c8b58247ff8d I'm just quite confused if I intentionally make the first expect to fail, it doesn't give me an error that that expects fails instead it gives me an error that the second expect failed.
[09:14:33] marz_d`ghostman: does system/backticks wait for the child process to finish or does it do it asynchronously?
[09:25:03] marz_d`ghostman: tbuehlmann: oh so the only additional feature Open3 gives is the capturing of stdout and stderr
[09:25:45] marz_d`ghostman: Is there a way I could capture stderr using plain old backticks though?
[11:36:15] marz_d`ghostman: Is it a good practice for a constructer of an object to assign the properties of an argument(object) as its own properties? Or will it be better to just immediately access the argument/object's properties?
[11:37:22] marz_d`ghostman: E.g. Job.new(name: 'job-name', type: 'job-type) then you pass this object to Task.new(name: Job.name, type: Job.type)? or just immediately use Job.name inside Task?
[11:39:13] marz_d`ghostman: phaul: so Task.new(job: Job)? WHy?
[11:48:28] marz_d`ghostman: job: job seems simple for me too. Perhaps I'll just put in the documentation what job properties is required before it gets passed in to task
[13:00:26] marz_d`ghostman: phaul: Yeah, thanks for the suggestion. Guess tasks just executes job, so having job inside task makes sense.
[16:42:31] marz_d`ghostman: Ping timeout: 256 seconds

2018-11-07

[07:59:49] marz_d`ghostman: has joined #ruby
[08:04:14] marz_d`ghostman: Having multiple expect inside an it block doesn't seem to work. Exit doesn't seem to be invoke as I'm getting 'expected :exit to be thrown, got nothing' error: https://gist.github.com/marzdgzmn/0d66c7d34a0175f217bd1c5d52027ba6
[08:31:28] marz_d`ghostman: so the statements inside after(:each) is also counted inside the it blocks, I have expect(File).to receive(:delete).with(arguments) inside my it block and one inside my after(:each), it counts twice.
[09:52:35] marz_d`ghostman: Quit: Page closed

2018-11-01

[08:55:38] marz_d`ghostman: Quit: Page closed

2018-10-31

[08:36:15] marz_d`ghostman: has joined #ruby
[08:37:18] marz_d`ghostman: I'm stubbing exit on my code by allow(object).to receive(:exit).and_throw :exit, then I have expect(object.run).to_throw :exit, but I'm getting uncaught throw :exit. Doesn't the expect automatically catch it though?
[09:09:47] marz_d`ghostman: my rescue code has a log function and exit, how do I expect two function calls? it seems calling expect (object.run).to receive(:log) and expect(object.run)to raise_error(SystemExit) differently will not stub the exit on first call
[09:25:39] marz_d`ghostman: phaul: https://gist.github.com/marzdgzmn/bb3429bbff3d7a2049668fdaed55730d
[09:25:45] marz_d`ghostman: phaul: sorry for the delay
[09:28:06] marz_d`ghostman: I'm trying to expect that invokes the log_error and then exit. But having two expects doesn't work as the first one would exit the rspec when getting to the line in the code where it really exits
[09:33:05] marz_d`ghostman: phaul: that succeeds, expect { @sync.run }.to raise_error(SystemExit). What I'm trying to do is also expect :log_error to get invoked before SystemExit
[09:58:45] marz_d`ghostman: phaul: Yes, that is correct.
[10:03:17] marz_d`ghostman: phaul: If you stub :exit to do nothing, the code will run though the rest of it which it shouldn't cause it should exit
[10:03:56] marz_d`ghostman: Is there something like allow to receive(:exit) continue with the next test? something like that
[10:18:15] marz_d`ghostman: phaul: Awesome! I've been searching and working on this one for a couple days. Just what I need. You're a lifesaver. Thanks man
[10:24:31] marz_d`ghostman: phaul: By the way, isn't the best convention for rspec structure goes something like this? https://gist.github.com/marzdgzmn/1e8308e417bbeed15bef8440415046dd
[10:24:59] marz_d`ghostman: phaul: Cause rubocop seems to be giving me warning about my Rspec.describe Class having too many lines currently [52/25]
[10:27:49] marz_d`ghostman: Ah, okay. Thought I'm doing something wrong cause I'm not yet done with the tests and I'm currently way beyond the 25 line rubocop is complaining about, hehe :)
[10:29:08] marz_d`ghostman: I'll do just that. By the way, you keen on blockchains?
[10:29:27] marz_d`ghostman: If so, you think ruby has a place on that field?
[10:31:01] marz_d`ghostman: haha, you have a point though
[10:33:56] marz_d`ghostman: just curious cause all I see being used are java and c++
[10:34:55] marz_d`ghostman: guess I'll do that :)
[10:36:20] marz_d`ghostman: I'm not really that familiar with binary trees and the likes since I don't have a good computer science background. Just jumped into programming head first. Any books or resources you can recommend to reinforce a layman's computer science fundamentals? :D

2018-10-30

[09:40:05] marz_d`ghostman: has joined #ruby
[09:40:37] marz_d`ghostman: How do I configure rspec so it won't exit the whole suite when my code exits? I have a test testing a failing case where my code exits, and rspec exit totally not continuing the rest of the suites
[09:48:38] marz_d`ghostman: status402: I have something like this: https://gist.github.com/marzdgzmn/399f2e469367ab157223bf45500f6943 If I stub exits it continues to trigger syn when shouldn't have to
[09:54:46] marz_d`ghostman: Yeah, the code just does what it does. I have a test not expecting for the next method to be invoked though since it will exit. Just wanted it not to end rspec though
[09:56:00] marz_d`ghostman: hmm, I should just test that it received exit, instead of testing not_to receive(:the_next_method)
[09:56:24] marz_d`ghostman: nah this class will run a job, and exits if it something fails
[09:57:38] marz_d`ghostman: Is there something like allow(object). to recieve(:exit) and continue to next step though?

2018-10-17

[08:24:25] marz_d`ghostman: Does Rspec.describe run any methods prior to the test? I have a puts method inside my class and it seems to be invoked before the tests
[08:33:59] marz_d`ghostman: tbuehlmann: I have this method: https://gist.github.com/marzdgzmn/8ba0bc2ccb70295b6d105f24afba96bd and the puts gets invoked before any tests. Does that mean that the gem(Marz::Rsync) method gets invoked too?
[08:38:50] marz_d`ghostman: cause puts result.output is invoked apparently
[13:36:04] marz_d`ghostman: Quit: Page closed