« Back to channel list

#ruby - 09 February 2019

« Back 1 day Forward 1 day »
[00:12:21] crankharder: has joined #ruby
[00:17:19] AJA4350: has joined #ruby
[00:21:06] cnsvc: has joined #ruby
[00:22:18] jcarl43: has joined #ruby
[00:22:35] jane_booty_doe: has joined #ruby
[00:36:23] valadares: has joined #ruby
[00:39:26] hutch: has joined #ruby
[00:39:52] orbyt_: has joined #ruby
[00:41:20] s2013: has joined #ruby
[00:44:24] blackmesa1: has joined #ruby
[00:47:47] tpanarch1st: has joined #ruby
[01:05:30] Swyper: has joined #ruby
[01:23:19] houhoulis: has joined #ruby
[01:23:42] d10n-work: has joined #ruby
[01:23:58] AJA4351: has joined #ruby
[01:27:35] orbyt_: has joined #ruby
[01:29:56] funnel: has joined #ruby
[01:34:18] apparition: has joined #ruby
[01:36:49] Exagone313: has joined #ruby
[01:40:59] SeepingN: has joined #ruby
[02:00:06] crankharder: has joined #ruby
[02:13:53] eblip: has joined #ruby
[02:18:10] jottr: has joined #ruby
[02:19:44] cnsvc: has joined #ruby
[02:21:20] d^sh: has joined #ruby
[02:28:48] tdy: has joined #ruby
[02:30:36] cd: has joined #ruby
[02:38:17] sgen: has joined #ruby
[02:46:12] bougyman: has joined #ruby
[02:51:54] vonfry: has joined #ruby
[03:05:26] hutch: has joined #ruby
[03:54:12] \void: has joined #ruby
[04:09:04] braincrash: has joined #ruby
[04:11:44] tdy: has joined #ruby
[04:19:09] jottr: has joined #ruby
[04:22:11] spacesuitdiver: has joined #ruby
[04:31:14] duderonomy: has joined #ruby
[04:34:22] hutch: has joined #ruby
[04:38:29] themsay: has joined #ruby
[04:41:53] akemot: has joined #ruby
[04:43:48] SuperLag: has joined #ruby
[04:52:00] hutch: has joined #ruby
[05:19:04] tdy: has joined #ruby
[05:36:40] dellavg__: has joined #ruby
[05:40:19] akosednar: has joined #ruby
[05:44:51] conta: has joined #ruby
[05:47:27] asphyxia: has joined #ruby
[06:20:16] jottr: has joined #ruby
[06:22:59] cthu|: has joined #ruby
[06:45:03] xrexeon: has joined #ruby
[06:45:35] sauvin: has joined #ruby
[07:29:36] crankharder: has joined #ruby
[07:56:47] crankharder: has joined #ruby
[08:10:57] s2013: has joined #ruby
[08:11:06] sauvin: has joined #ruby
[08:14:19] sauvin: has joined #ruby
[08:14:43] reber: has joined #ruby
[08:18:43] Dbugger: has joined #ruby
[08:22:12] jottr: has joined #ruby
[08:35:44] akemot: has joined #ruby
[08:40:04] crankharder: has joined #ruby
[08:44:56] conta: has joined #ruby
[09:00:25] apparition: has joined #ruby
[09:06:42] Mike11: has joined #ruby
[09:09:10] blackmesa1: has joined #ruby
[09:18:43] conta1: has joined #ruby
[09:30:39] jottr: has joined #ruby
[09:34:01] isxek: has joined #ruby
[09:38:48] GodFather_: has joined #ruby
[09:47:45] tdy: has joined #ruby
[09:48:07] href: has joined #ruby
[09:57:43] crankhar1er: has joined #ruby
[10:25:00] clemens3: has joined #ruby
[10:44:43] jottr: has joined #ruby
[10:47:12] SCHAPiE: has joined #ruby
[10:55:04] Fernando-Basso: has joined #ruby
[10:58:42] Swyper: has joined #ruby
[11:02:57] Swyper: has joined #ruby
[11:04:25] tdy: has joined #ruby
[11:10:42] SCHAPiE: has joined #ruby
[11:19:26] blackmesa1: has joined #ruby
[11:20:16] za1b1tsu: has joined #ruby
[11:22:03] valadares: has joined #ruby
[11:23:14] rippa: has joined #ruby
[11:23:53] jottr: has joined #ruby
[11:32:25] ravenousmoose: has joined #ruby
[11:33:29] kapil____: has joined #ruby
[11:42:41] skyikot: has joined #ruby
[11:44:38] lxsameer: has joined #ruby
[12:03:14] jottr: has joined #ruby
[12:03:38] AJA4350: has joined #ruby
[12:12:26] gix: has joined #ruby
[12:25:03] Nicmavr: has joined #ruby
[12:41:28] jottr: has joined #ruby
[12:56:21] AJA4350: has joined #ruby
[13:02:30] al2o3-cr: has joined #ruby
[13:21:29] maxmanders_: has joined #ruby
[13:52:21] roshanavand1: has joined #ruby
[13:52:39] jottr_: has joined #ruby
[13:58:45] TvL2386: has joined #ruby
[14:15:10] _whitelogger: has joined #ruby
[14:16:46] TvL2386: has joined #ruby
[14:19:06] dviola: has joined #ruby
[14:22:12] aelyx: has joined #ruby
[14:29:01] AJA4350: has joined #ruby
[14:37:27] hutch: has joined #ruby
[14:40:08] clemens3: has joined #ruby
[14:42:29] Mike11: has joined #ruby
[14:43:15] jottr_: has joined #ruby
[14:44:50] jottr: has joined #ruby
[14:47:42] TvL2386: has joined #ruby
[14:54:25] Xeago_: has joined #ruby
[14:55:21] deathwishdave: has joined #ruby
[14:57:41] conta: has joined #ruby
[14:58:00] jottr: has joined #ruby
[15:00:13] crankharder: has joined #ruby
[15:11:42] ravenousmoose: has joined #ruby
[15:50:39] conta: has joined #ruby
[15:51:32] deathwishdave: has joined #ruby
[15:51:53] crankharder: has joined #ruby
[15:55:43] al2o3-cr: any reason this might segfault, like, 1 in every 10 or so: https://gist.github.com/gr33n7007h/a152a88b3ed78b8d42cfc10f4adfc103
[15:58:55] al2o3-cr: the piece of shit.
[16:05:14] sgen: has joined #ruby
[16:05:53] millerti: has joined #ruby
[16:19:24] bmurt: has joined #ruby
[16:21:42] ByronJohnson: has joined #ruby
[16:23:14] AJA4350: has joined #ruby
[16:26:55] namkeen: has joined #ruby
[16:37:20] dhollinger: has joined #ruby
[16:42:48] crankharder: has joined #ruby
[16:59:20] roshanavand1: has joined #ruby
[17:04:13] spacesuitdiver: has joined #ruby
[17:10:55] bairyn: has joined #ruby
[17:11:26] Fernando-Basso: has joined #ruby
[17:18:59] dinfuehr: has joined #ruby
[17:19:12] CBebop: has joined #ruby
[17:25:12] CBebop: has joined #ruby
[17:30:12] hiroaki: has joined #ruby
[17:31:26] conta: has joined #ruby
[17:32:00] nowhere_man: has joined #ruby
[17:33:38] BH23: has joined #ruby
[17:35:10] hutch: has joined #ruby
[17:36:46] themsay: has joined #ruby
[17:40:19] blackmesa1: has joined #ruby
[17:50:54] hiroaki: has joined #ruby
[17:59:38] szulak_: has joined #ruby
[18:05:55] phaul: has joined #ruby
[18:08:18] aupadhye: has joined #ruby
[18:18:45] thunderbirdtr: has joined #ruby
[18:18:55] n13z: has joined #ruby
[18:18:56] hutch: has joined #ruby
[18:19:07] szulak_: has joined #ruby
[18:25:38] conta: has joined #ruby
[18:36:24] AJA4350: has joined #ruby
[18:39:30] AJA4351: has joined #ruby
[18:43:16] dviola: has joined #ruby
[18:50:35] dionysus70: has joined #ruby
[18:55:19] TvL2386: has joined #ruby
[18:55:51] phaul: &fake Hacker.say_something_smart
[18:55:51] rubydoc: Try to compress the USB microchip, maybe it will parse the multi-byte array!
[18:59:09] deathwishdave: has joined #ruby
[19:01:58] jason479: has joined #ruby
[19:02:03] jason479: Hi everyone
[19:02:11] havenwood: jason479: hi
[19:02:12] jason479: is it possible to publish a module as a gem ?
[19:02:17] havenwood: jason479: yes
[19:03:59] jason479: haven wood the module i wish to publish is here : https://gist.github.com/wesley974/adba95ca1e1fcdff8020258857a9f85a if you can take a look
[19:04:47] ruby[bot]: pro-tip - use tab completion for nicks. avoids typos in nicks.
[19:05:11] jason479: sorry for the nickname
[19:05:19] xlegoman: has joined #ruby
[19:05:31] havenwood: jason479: there's already a Needs gem, so you'd just need to pick a slightly different namespace if you want to publish to RubyGems
[19:05:48] havenwood: jason479: that module is perfectly fine for a gem
[19:06:02] jason479: but tests is missing
[19:06:46] havenwood: you'd want to put it in a gem dir layout
[19:07:02] havenwood: jason479: https://guides.rubygems.org/patterns/
[19:08:35] jason479: havenwood: can i publish the gem without the spec ?(i mean the test)
[19:08:51] havenwood: yes, you can publish a gem without specs/tests
[19:09:16] jason479: ok, thank you very much
[19:09:16] havenwood: consider writing them anyway!
[19:09:22] havenwood: have you tried Minitest?
[19:09:29] jason479: i just tried rspec
[19:09:37] jason479: in a learning way
[19:10:39] jason479: but for now it is system related, i don't know how to test these 2 methods (:root & :release?(number))
[19:11:29] maryo: has joined #ruby
[19:13:20] AJA4351: has joined #ruby
[19:14:08] aupadhye: has joined #ruby
[19:14:40] jason479: can i have something like OH::Needs.root ?
[19:14:49] blackmesa1: has joined #ruby
[19:14:56] jason479: a module in a module ?
[19:15:26] phaul: yes you can nest modules
[19:16:45] phaul: &>> module A; module B; def self.foo; 1; end; end; end; A::B.foo
[19:16:51] rubydoc: # => 1 (https://carc.in/#/r/67nn)
[19:18:02] CBebop: has left #ruby: ("See you later, Space Cowboy.")
[19:18:32] hahuang6-: has joined #ruby
[19:20:36] phaul: on testing root & release. it's kind of tricky because of the external dependency on etc. If you stub etc then you can control different etc behaviour for different test cases. But test stubbing and mocking is a bigger topic
[19:22:29] orbyt_: has joined #ruby
[19:23:06] conta: has joined #ruby
[19:23:37] havenwood: jason479: Here's an example of Minitest specs for the #root method in your code: https://gist.github.com/havenwood/6a1f8e1c7e6b2a1831ef76f6459030de
[19:24:24] havenwood: (using stubs)
[19:28:34] conta: has joined #ruby
[19:29:34] havenwood: jason479: You can stub Etc.uname to be a Hash for the other public method.
[19:30:14] sgen: has joined #ruby
[19:30:27] havenwood: jason479: If you have trouble with the gem layout or getting specs working in it, let us know and we can help.
[19:30:59] jason479: ok thank you so much havenwood and phaul
[19:31:20] jason479: shame that i can't name it 'needs' as already exists
[19:31:28] jason479: i need to find a good name
[19:32:13] phaul: One of the 3 most difficult problems in computer science ;)
[19:32:20] havenwood: jason479: How about OpenNeeds?
[19:32:37] cthulchu_: has joined #ruby
[19:32:47] havenwood: jason479: That'd be a gem name of open_needs.
[19:33:21] phaul: the other one being off by one errors
[19:33:32] havenwood: jason479: Are you going to publish it to RubyGems?
[19:34:14] havenwood: jason479: What are you using it for? Maybe that'll help with the name.
[19:34:19] jason479: in fact i wish to publish multiple small gems like 'Needs' to be able use them to deploy for example a mailserver (scripting)
[19:34:36] jason479: I'm a fan of OpenBSD
[19:34:46] havenwood: jason479: You could might consider a single gem namespace, with plugin gems.
[19:35:43] jason479: if i publish OpenBSDHelper (openbsd_helper) as a namespace, publish a gem with the 'Needs' plugin, can i later update it and add for example a new plugin named 'Rcctl' ?
[19:36:01] jason479: sorry for my newbie questions, i'm totally new to Ruby
[19:36:40] jason479: So i will have something like : OpenBSDHelper::Needs.root ...
[19:36:45] havenwood: jason479: OpenBSDHelper would be open_bsd_helper.
[19:37:00] havenwood: jason479: Yes. That plugin gem would be named open_bsd_helper-needs.
[19:37:38] havenwood: jason479: or Mailserver (mailserver) with Mailserver::Needs (mailserver-needs).
[19:37:57] jason479: it will be 2 gems ? open_bsd_helper and open_bsd_helper-needs ?
[19:38:01] havenwood: jason479: I do like OpenBSDHelper. That's descriptive.
[19:38:34] jason479: it will be 2 gems ?
[19:38:46] havenwood: jason479: Yes. It's a pretty common pattern. Sometimes the root gem installs the plugins. Sometimes you cherrypick plugins.
[19:38:47] havenwood: jason479: For example, pry-theme and pry-remote are pry gem plugins.
[19:39:01] havenwood: jason479: It can be multiple gems, or you can ship it as one.
[19:39:33] jason479: if i choose the plugins way
[19:39:35] havenwood: jason479: Consider if they should always be used together. Is there an advantage in making it modular?
[19:39:53] jason479: what's about the alone OpenBSDHelper ? what it is exactly without plugins ?
[19:40:11] havenwood: jason479: Well, if there's a common core, it'd go there.
[19:40:19] havenwood: jason479: If not, it'd be an empty module.
[19:40:21] Dbugger: has joined #ruby
[19:40:39] jason479: havenwood: you re right, when scripting , i ll need all the modules
[19:40:47] havenwood: jason479: Maybe try making a single gem, with namespaced modules.
[19:41:04] havenwood: jason479: An open_bsd_helper gem can have OpenBSDHelper::Needs, etc.
[19:41:35] havenwood: jason479: Mirror the filestructure after the namespace.
[19:41:51] jason479: but if i publish the gem OpenBSDHelper with for example only one module embedded like Needs, if i need to add a new module to the already published gem, how can i update that ?
[19:42:08] havenwood: jason479: OpenBSDHelper is lib/open_bsd_helper.rb and OpenBSDHelper::Needs is lib/open_bsd_helper/needs.rb.
[19:42:24] jason479: i understand this point
[19:42:33] jason479: but if later i need to add a new module
[19:42:40] jason479: for example a module named 'Rcctl'
[19:42:49] havenwood: just add it and publish a new version of the gem
[19:42:53] jason479: can i update a gem ?
[19:44:14] jason479: Now i want to use this gem, writing a script, i will need each time type : OpenBSDHelper::ModuleName.method ...
[19:44:34] jason479: can i remove the root name (OpenBSDHelper) ?
[19:44:44] jason479: to get a better readable script
[19:45:55] havenwood: jason479: Yes, You can make it so you can: include OpenBSDHelper
[19:46:04] havenwood: jason479: Then: Needs.method
[19:48:01] havenwood: jason479: It *just works* like that ^
[19:52:53] reber: has joined #ruby
[19:57:01] maryo: has joined #ruby
[20:00:40] Tharbakim: has joined #ruby
[20:00:41] jason479: thank you so much havenwood
[20:04:29] blackmesa1: has joined #ruby
[20:09:26] jason479: has joined #ruby
[20:09:42] jason479: havenwood: still there ?
[20:10:10] jason479: so the module will live in lib/open_bsd_helper
[20:10:46] jason479: but regarding the main file lib/open_bsd_helper.rb it will be also a module, yes ?
[20:11:12] nfk: has joined #ruby
[20:12:15] paulscoder: has joined #ruby
[20:12:55] ravenousmoose: has joined #ruby
[20:21:59] phaul: jason479: you can create a directory structure that follows module nesting. lib/open_bsd_helper/needs.rb in this case. Whether you have a lib/open_bsd_helper.rb or not can depend on if there is any code going in there. Just for empty modules you don't have to create the source file
[20:22:26] phaul: ah. they just left
[20:22:38] KindOna: never lucky
[20:28:13] cnsvc: has joined #ruby
[20:35:36] deathwishdave: has joined #ruby
[20:44:04] AJA4350: has joined #ruby
[20:54:32] [Butch]: has joined #ruby
[21:05:34] sgen: has joined #ruby
[21:13:36] xlegoman_: has joined #ruby
[21:15:31] crankharder: has joined #ruby
[21:15:48] cnsvc: has joined #ruby
[21:22:11] segy: has joined #ruby
[21:29:42] Emmanuel_Chanel: has joined #ruby
[21:37:39] dviola: has joined #ruby
[21:39:44] deathwishdave: has joined #ruby
[21:43:09] Swyper: has joined #ruby
[21:47:08] paulscoder: has joined #ruby
[21:48:15] ByronJohnson: has joined #ruby
[21:48:43] Renich: has joined #ruby
[21:59:55] i8igmac: has joined #ruby
[22:00:07] i8igmac: any tips for reading files on mtp device
[22:03:41] AJA4350: has joined #ruby
[22:09:15] crankharder: has joined #ruby
[22:12:03] tdy: has joined #ruby
[22:15:27] nowhereman: has joined #ruby
[22:26:06] ByronJohnson: has joined #ruby
[22:52:02] mistergibson: has joined #ruby
[22:55:31] orbyt_: has joined #ruby
[23:03:29] leah2: has joined #ruby
[23:04:55] crankharder: has joined #ruby
[23:05:18] Nicmavr: has joined #ruby
[23:10:00] AJA4351: has joined #ruby
[23:24:31] bmurt: has joined #ruby
[23:47:09] cnsvc: has joined #ruby
[23:47:48] phaul: Net: I read the code on RSpec lets. The anwer to whether lets are re-defined if defined in sub-contexts is yes. But technically that's not how they work.
[23:49:41] nchambers: has joined #ruby
[23:49:50] phaul: They achieve lazy and one time evaluation of let. Only lets that are needed for each example are run and only once. They are reset per examples.
[23:53:27] Tharbakim: has joined #ruby
[23:54:53] postmodern: has joined #ruby
[23:56:31] phaul: they are methods, and the block is used in define_method. Sub-contexting also means inheritance so sub-describe let would shadow parents method. I beleive calling super should work to get the outer let value.
[23:59:48] phaul: it does. https://gist.github.com/14006a2389898ec214b2ec279c921270