Page 1 of 5 | Next »
[03:32:02] syndikate: havenwood, I am creating a server of out of WebRick::HTTPServer, ( I will be looking into making use of unix sockets soon). So right now I want to write all the logs into a file. The logger should log things in detail like for example in rails app
[19:30:34] syndikate: Can someone help understand how I can log all the requests with IP address and path and body like how rails does in webrick?
[03:32:26] syndikate: Is it a good practice to make use of lambdas and process in a big codebase? Apparently it's rails. I wanted to make some chained method calls look concise so I am declaring a lambda and passing it to one of the maps
[03:32:56] syndikate: But I am not sure how generally it is perceived, the codebase I am on doesn't have any lambda/proc usage as such.
[05:48:52] syndikate: havenwood, yeah okay. I just opted for the latter for now but I think the first looks more concise. How and why a constant havenwood ?
[05:52:44] syndikate: Oh, okay. I thought so. I didn't get this part "A block handily never instanciates an object".
[05:53:22] syndikate: al2o3-cr, havenwood I could do that. I changed that to this, this felt a little more concise for me, maybe coz I was taking some elixir lessons.
[05:53:34] syndikate: I wasn't sure if I should go down this route actually, that's why I thought to ask :D
[05:56:16] syndikate: OH, okay. havenwood so even if I make it a constant and define it outside, would it still have the issue or allocation objects again?
[05:59:20] syndikate: Yeah okay. I will make it a constant outside the method at the class level so that one lambda is instantiated when the object is instantiated and will be called in the map
[05:59:52] syndikate: Then again, is it okay if I go down this route in ruby code? I mean for me it makes the whole .map.with_index looks better havenwood
[06:03:13] syndikate: havenwood, no it doesn't, but what am trying to do is reduce the number of methods with all this. Right now I could remove one method if I make this chained call concise with lambda and move the call upto the parent method
[06:07:48] syndikate: Ah okay, gotcha. Yeah, the only reason for lambda is for the syntactic sugar of being able to call it like (&lambda_name)
[06:28:39] syndikate: havenwood, bit detailed (sorry) but here is what exactly am doing - https://dpaste.de/AyQZ#L1
[06:33:54] syndikate: havenwood, yeah the block makes much more sense here. I was just going through the code again. The reason why I opted for lambda first of all is because I could do that &method here. I can't do that if defined a method as def method; end.
[06:34:38] syndikate: But that's again defining a method which has a lambda inside it right? As you said this is gonna create a lambda every time - there is not advantage to this right?
[06:40:45] syndikate: Ah okay, but if I am abstracting it out to the model then the lambda has no much use case, right?
[06:45:56] syndikate: Yeah, so if I am not moving that abstraction to the model, i.e keeping that manipulation method definition in the current class itself maybe I could have a named lambda and re-use it. Now that I have moved it I guess a block is good enough. Is my understanding correct havenwood ?
[06:53:32] syndikate: Ah okay. So I should see it as more of a requirement for a first class citizen to be passed around.
[13:48:54] syndikate: Is there any equivalent way of doing this in ruby? Elixir snippet: Enum.reduce(a_map, &process(&1, &2)), essentially I want to be able to pass a method into enum_with_index.map(&:process_all) where it would automatically pass the two arguments into process_all
[13:54:48] syndikate: I believe it is not possible to get that syntax in ruby, but I just wanted to be sure.
[17:32:34] syndikate: NL3limin4t0r, phaul Thanks! I was using (&:custom_method) which was causing error, instead I had to use (&custom_method)
[10:05:24] syndikate: I start the programs, takes an input in parent and sends to worker. But in worker I am not able to receive it
[19:41:35] syndikate: WARN Selenium [DEPRECATION] Selenium::WebDriver::Chrome#driver_path= is deprecated. Use Selenium::WebDriver::Chrome::Service#driver_path= instead.
[19:41:52] syndikate: I understand there is tighter integration for system tests now, but how do I go about this warning
[18:15:48] syndikate: Hey, I am trying to define a guard like this but am getting syntax error. Although am not able to figure what I am missing here.
[18:23:18] syndikate: In this example, the array inside gets created and destroyed each time the method is called, right? Is the reason being going out of scope?
[18:26:43] syndikate: Thanks, yeah, that's what I do havenwood, but that habit came to me from somewhere and was there without me thinking. So, I was just thinking about this now. I was curious for any language that would destroy objects after scope, this would be the same, right?
[18:28:31] syndikate: havenwood, Any string that is being used in a class I usually make it constant and freeze, and some arrays too.
[03:26:36] syndikate: Hey, can someone help me understand this further? https://elixirschool.com/en/lessons/basics/functions/#default-arguments
[03:27:27] syndikate: Specifically clearing this error - definitions with multiple clauses and default values require a header
[03:27:51] syndikate: So when I define a header method, it does not have a definition so how does elixir know what to return?
[03:49:23] syndikate: Oh, okay so when you have multiple heads, internally it will have a case for arguments and return them and there will be a case for nil? Am I right?
[03:51:58] syndikate: I am trying to wrap my head around this since I am coming from a non functional background. Here is how my brain visualises it - if there are multiple function definitions with different arguments, the language will pick the definition with the matching argument
[03:53:01] syndikate: And suppose I have two other methods definitions as well. Now, when I pass nil arguments, the language would essentially know what to give for default values, but how does it know which definition to pick?
[04:01:21] syndikate: Okay, yeah I got that how that case statement would work. I am wondering when the function gets compiled and it has a case statement based on the arguments, what is the RHS of it? Is it function definition?
[04:03:36] syndikate: OH! So the language knows the header is just to fill in the default values and calls the case again with the default values and starts the chain again
[04:07:33] syndikate: For some odd reason this reminded me of Rails magic and when you figure how some of the "magic" happens :D
[04:08:07] syndikate: Yeah, I want to know where I can get these info. It will be a good read. Doc/book.
[04:32:02] syndikate: Alright, Okay I will justly the abstractions be for now. Thanks starbelly and Nicd-
[11:34:23] syndikate: Does it matter if we memoize a variable in a controller? Wouldn't that controller be destroyed once the request is done and the memoization leaves no benefit?
[11:39:24] syndikate: Memoising current_user inside APplicationController makes sense because lots of controllers would be inherited (right?)
[11:41:23] syndikate: Agreed, but my question is memoizing that @book variable makes any sense? Because the controller object is done once the request is finished, and no other class inherits/uses it
[11:45:27] syndikate: Yup, that's what I wanted to confirm. My current code bas has this style for such controllers and I wanted to remove them, not that they are harm they are just useless
[11:48:49] syndikate: I just wanted to get that ||= out of the way, I wanted to make sure my assumption is correct
[15:41:50] syndikate: I am working on a problem and it is to remove consecutive duplicate elements in a list
[18:05:59] syndikate: I am trying to read the definition of deduce but am not still able to understand :D
[13:02:56] syndikate: How do I do an idiomatic lazy lookup for translations in a partial under namespaced route?
[13:29:45] syndikate: Anybody migrated from feature spec to system specs? I am seeing to be having problem in configuring chrome for capybara
[13:41:42] syndikate: I am not able to understand what to set it to get It running on an existing applicationn
[13:43:22] syndikate: Nope, I whatever I change it brings up chrome and not headless. I have both old Capybara config setting for default driver and the driven_by as well. Let me share config?
[13:59:28] syndikate: tbuehlmann, I think there are many issues, let me do some clean up and get back
[14:38:55] syndikate: tbuehlmann, I have `Rspec.feature` is it mandatory to have that changed to `Rspec.describe` ?
[07:38:05] syndikate: If am running my specs using parallel_tests gems and in between in one of the specs if I call `DatabaseCleaner.clean` does it wipe out data from all the connections? How does this behave?
[07:53:30] syndikate: Now gotta see what happens when we have parallel_tests to the mix :( Why do people have to bring in complicated situations
[12:58:17] syndikate: If my clean up strategy is truncation does it truncate only the data added in that test or the whole table?
[06:51:16] syndikate: havenwood, Thanks! I have been on rails for sometime but haven't written much tools in Ruby. Recently started looking into gems and seeing if I can get hands into more ruby stuff
[06:52:39] syndikate: havenwood, Any pointers, suggestions, mentoring on stuff to begin contribution are all welcome :D socketry/falcon is something that I wanted to look into for a while now. Fibers as well.
[06:56:14] syndikate: havenwood, Oh didn't know that. Sure, I will probably request for clarification for things I don't understand :D
[07:03:35] syndikate: But problem is that there is not much scope to write much stuff with all those in my current work as mostly it's the usual rails related stuff
[07:07:56] syndikate: Exactly, after a while the charm is lost - well for someone who wants to do something new most of the time. It's not that the current application is best ever but when you working with business requirements and timelines out of scope work is always in the backlogs. You do what's required and that's mostly straightforward stuff. So, I thought looking into more of ruby can help me take something back.
[07:09:21] syndikate: I am trying to see how I can (If I can) improve the tooling and use it to it's utmost potential in my project
[13:43:02] syndikate: How long does y'all monolith app's test suite's take to complete? Is something near to an hour normal thing?
[13:51:12] syndikate: tbuehlmann, do they have any writeup on how they have parallelized it? (I know it's coming in rails 6 and also know about parallel_tests), just curious
[13:52:11] syndikate: In such cases what do we do when we want a pipeline to be completed before having a PR merged? We check for the "green tick" before merging a branch and I was trying to see how I can bring the spec timings down
[14:13:53] syndikate: I was thinking along the lines of an automated test. What I had in mind was when a person submits a PR, run a subset of tests and not the whole suite. Trying to figure that "subset" is what am trying to do for now.
[12:35:50] syndikate: Anybody used parallel_tests gem with database_cleaner to run capybara tests? I am running into issue in my pipeline where it gets stuck and not exiting eventually pipeline has to time out
[06:05:31] syndikate: I see this method #with_responders in a codebase I am working on but I can't figure where it is coming from. It's being called on ActiveRecord collection object
[06:34:55] syndikate: My bad everyone, feel so stupid right now. There was a concern written for some other context but used the same naming
[06:19:56] syndikate: IGnorAND, yes, I am trying to understand more innards of the gem. Still looking into it.
[18:49:33] syndikate: I am trying to understand the new Zeitwerk Gem and how it fixes the current issue. Have been going through the code and current Auto Load issues, but failing to understand. Can anybody give me few pointers here please?
[05:13:55] syndikate: https://guides.rubyonrails.org/active_support_instrumentation.html#send-data-action-controller
[04:43:10] syndikate: Is it advised to use Pundit rules in views? I have this page in which a partial has to be rendered only if the user has a certain role.
[11:20:53] syndikate: Do we use son serialisers for non model object? My API has to return a value( integer ) and I can't figure how I would create a serialiser for it. Should I be using jsonapi then I can't create it for an object with no model associated
[11:21:25] syndikate: Just creating a placeholder model object seems overkill and also it won't have a unique id
[17:42:00] syndikate: Not sure what caused this - I used draper gem, created a decorator which has a field being called itself inside a method with same name essentially going into an infinite loop. So, the app got stuck and I killed it. This somehow broke my mysql data. The table name got rewritten and I am not sure where to start debugging for this. Although, I could replace my dev data and go ahead but I want to inv
[06:05:25] syndikate: Does this PR means that there won't be anymore coffee script left in Rails? https://github.com/rails/rails/pull/34177
[18:53:22] syndikate: Hey, can someone help me understand why this happens? https://github.com/rails/rails/blob/1353610ff2ab4d16d022d5c31d5b4e5d908e05a8/actionpack/lib/action_controller/metal/redirecting.rb#L38
[06:53:17] syndikate: If time cop is not used in `before` block would the time freezing leak out globally to all specs?
[07:03:44] syndikate: Or rather I am looking for a strong argument on why time cop should be in `before` blcok
[06:54:57] syndikate: When sorting with ransack if the field values are all same ransack does not sort the entire table - how does ransack manage to do that?
[06:56:00] syndikate: My assumption was this - even if the specific column values are all same, the table should get sorted desc and ask alternatively. Is it because the SQL query returns the rows without difference?
[04:07:51] syndikate: Oh okay, yeah here its' just purely namespacing purpose with not much functionality of it's own, rather than define a self.table_name_prefix
[04:38:33] syndikate: baweaver, pipework another thing though - I have a table_name_prefix for the intended tables (obviously), so as per Rails 5 convention is it okay to create a module and declare a self.table_name_prefix method in it?
[04:39:27] syndikate: I tried, it works. I wanted to know if it's a preferred approach to have such a method in module
[04:51:07] syndikate: baweaver, pipework This is the kind of simplified setup I have now - https://hastebin.com/osixisafuk.rb
[04:57:22] syndikate: Sorry if any confusions were caused, I thank you guys' help. Just wanted to understand if I have any convention to follow
[09:53:28] syndikate: Or you could add a class to the field if the returned object has no error for it?
[04:07:11] syndikate: tycoon177, as in if I use `probations` it will be come `...probations_path` but if I use `probation` it will become `...probation_index_path`