« Back to channel list

#ruby - 26 May 2017

« Back 1 day Forward 1 day »
[00:00:03] pb122: has joined #ruby
[00:00:09] relyks: has joined #ruby
[00:00:28] havenwood: _moep_: Are you in the root directory of the redmine app? Is there a config.ru file?
[00:00:49] roamingdog: has joined #ruby
[00:00:58] havenwood: I'd suggest that you follow a Redmine installation tutorial if you're not familiar with Rack and friends.
[00:01:48] havenwood: There should be a decent one out there for Redmine on Debian.
[00:01:55] havenwood: I don't know.
[00:02:41] havenwood: _moep_: Does it work after installing Rack?
[00:02:43] olivier__: has joined #ruby
[00:02:56] _moep_: havenwood: nope :(
[00:03:29] arescorpio: has joined #ruby
[00:05:21] _moep_: hm it seems it trys to run the wrong ruby:
[00:05:22] _moep_: #<Proc:0x007f5f524e7d08@/home/app/redmine/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn.rb:51 (lambda)>,
[00:05:25] _moep_: :daemonize=>false}
[00:05:36] havenwood: That's 2.4.
[00:05:47] _moep_: yes, but not 2.4.1
[00:05:56] havenwood: (The ABI version of 2.4.1 is 2.4.0.)
[00:06:43] havenwood: _moep_: That's the gem directory for 2.4.1 as well.
[00:09:20] raul782: has joined #ruby
[00:09:35] _moep_: havenwood: there is a wrapper script for unicorn (not completly): https://paste.debian.net/hidden/894760e4/
[00:10:56] enderby: has joined #ruby
[00:13:26] MrBusiness: has joined #ruby
[00:14:18] learningruby: has joined #ruby
[00:14:31] pb122-two: has joined #ruby
[00:14:53] learningruby: is it correct to say that instance variables are always defined inside instance methods?
[00:18:47] havenwood: learningruby: no
[00:19:25] havenwood: learningruby: though that's where you'll usually see instance variables defined, no doubt
[00:20:14] havenwood: >> @not_in_an_instance_method = true
[00:20:16] ruby[bot]: havenwood: # => true (https://eval.in/805495)
[00:20:33] stupidsenpai: has joined #ruby
[00:20:47] havenwood: >> @not_in_an_instance_method = true; defined? @not_in_an_instance_method
[00:20:48] ruby[bot]: havenwood: # => "instance-variable" (https://eval.in/805496)
[00:21:07] skweek: has joined #ruby
[00:21:59] learningruby: @havenwood mmm ok... I don't mean just in terms of syntax (I should've stated the question better, sorry)—but in terms of the concept of object orientation... but if I place an instance variable in a class outside a method, how can an instance of that class access it?
[00:23:54] Cohedrin: has joined #ruby
[00:27:37] mgorbach: has joined #ruby
[00:27:49] ecuanaso: has joined #ruby
[00:29:27] SuperTaz: has joined #ruby
[00:31:34] _moep_: havenwood: do you have still an idea because of unicorn?
[00:31:38] havenwood: >> class LearningRuby; @instance_variable = 42; def self.foo; @instance_variable end; def bar; self.class.instance_variable_get :@instance_variable end end; [LearningRuby.foo, LearningRuby.new.bar] # learningruby
[00:31:39] ruby[bot]: havenwood: # => [42, 42] (https://eval.in/805499)
[00:32:14] havenwood: learningruby: ^ see if pondering on that makes any sense
[00:32:15] havenwood: learningruby: it's not necessarily a good idea just because you can do it!
[00:32:34] havenwood: _moep_: hrm?
[00:32:45] _moep_: my unicorn doesnt run my app
[00:32:50] havenwood: _moep_: What does it do?
[00:33:00] havenwood: Is there an error?
[00:33:29] _moep_: yes like this: ] ERROR -- : reaped #<Process::Status: pid 26391 exit 1> worker=0
[00:33:57] _moep_: but a lot of output
[00:34:03] raspado: has joined #ruby
[00:34:33] charliesome: has joined #ruby
[00:34:51] brent__: has joined #ruby
[00:35:34] havenwood: _moep_: Is it working?
[00:35:52] _moep_: I just see massive output, but the site shows 500
[00:35:54] havenwood: That particular warning seems like your logger config level is too verbose.
[00:36:08] _moep_: uhm Internal server error
[00:36:15] havenwood: Find the real error. You might want to edit your unicorn config to make it less verbose.
[00:36:22] havenwood: _moep_: Show us the real error.
[00:36:37] havenwood: _moep_: You might want to create a gist, so you can paste something long.
[00:36:40] havenwood: gist.github.com
[00:37:01] ruby[bot]: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[00:38:15] havenwood: _moep_: RubyOnRails is the best place for Rails-related questions.
[00:38:16] havenwood: ?rubyonrails _moep_
[00:38:16] ruby[bot]: _moep_: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[00:38:21] brent__: has joined #ruby
[00:38:31] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[00:40:00] zenspider: bundle exec I'm switching to prefixing everything with bundle exec
[00:40:19] havenwood: That'd be good for a talk.
[00:40:32] zenspider: bundle exec cd
[00:40:39] zenspider: bundle exec emacs blah.rb
[00:40:48] havenwood: `bundle exec cd rails_app` you see we're in the directory, `bundle exec ls`
[00:40:49] zenspider: bundle exec ruby blah.rb
[00:41:35] zenspider: The Cult of Cargo: How StackOverflow Has Killed Off Critical Thinking
[00:41:58] zenspider: aaactually... now I want to do that talk
[00:42:05] duderonomy: has joined #ruby
[00:42:40] havenwood: bundle exec export RAILS_ENV=development
[00:43:14] zenspider: unfortunately that won't work. cd prolly won't either
[00:43:20] havenwood: actually shell builtins won't work, yeah
[00:43:27] havenwood: cd should work
[00:43:51] havenwood: it is a shell builtin, but still works
[00:43:57] zenspider: oh. cd isn't built in! huh.
[00:44:15] zenspider: I typo'd and got an error on /usr/bin/cd
[00:44:52] zenspider: bundler: command not found: export :(
[00:44:55] havenwood: actually `bundle exec export` works, it's the env var assignment that borks
[00:45:24] havenwood: here, just: export bundle exec RAILS_ENV=development
[00:45:34] havenwood: that's a good talk point
[00:45:43] havenwood: sometimes you can't start with bundle exec
[00:48:10] zenspider: I was hoping bundle exec exec would work
[00:48:26] ecuanaso: has joined #ruby
[00:48:29] zenspider: ok... My brain is melty... time to go take a walk
[00:50:12] roamingdog: has joined #ruby
[00:50:57] roamingdog: has joined #ruby
[00:51:47] roamingdog: has joined #ruby
[00:52:34] roamingdog: has joined #ruby
[00:53:19] roamingdog: has joined #ruby
[00:53:27] enterprisey: has joined #ruby
[00:54:09] roamingdog: has joined #ruby
[00:55:39] apparition: has joined #ruby
[00:55:44] nobitanobi: has joined #ruby
[00:59:15] jenrzzz: has joined #ruby
[00:59:15] jenrzzz: has joined #ruby
[01:01:10] dviola: has joined #ruby
[01:02:16] bambanx: has joined #ruby
[01:04:04] olivier__: has joined #ruby
[01:04:12] gizmore: has joined #ruby
[01:06:04] learningruby: has joined #ruby
[01:08:28] hndk: has joined #ruby
[01:08:56] Jn_Kell: has joined #ruby
[01:11:51] hndk: has joined #ruby
[01:13:24] sp4rrow: has joined #ruby
[01:17:16] cdg: has joined #ruby
[01:26:04] enderby: has left #ruby: ("ERC (IRC client for Emacs 25.2.1)")
[01:26:47] cdg: has joined #ruby
[01:30:03] learningruby: has joined #ruby
[01:30:26] nertzy: has joined #ruby
[01:39:50] brent__: has joined #ruby
[01:41:54] nertzy: has joined #ruby
[01:42:43] rc48: has joined #ruby
[01:46:17] d^sh: has joined #ruby
[01:48:25] jusa: has joined #ruby
[01:50:15] gothicsouth: has joined #ruby
[01:50:59] jrafanie: has joined #ruby
[01:52:24] relyks: has joined #ruby
[01:55:31] roamingdog: has joined #ruby
[02:01:05] cschneid_: has joined #ruby
[02:04:06] jackrandom: has joined #ruby
[02:04:08] charliesome: has joined #ruby
[02:05:25] olivier__: has joined #ruby
[02:06:21] Cohedrin: has joined #ruby
[02:08:18] jackrandom: has joined #ruby
[02:12:08] jenrzzz: has joined #ruby
[02:12:08] jenrzzz: has joined #ruby
[02:13:21] pb122: has joined #ruby
[02:15:36] olivier__: has joined #ruby
[02:16:24] __Yiota: has joined #ruby
[02:18:08] uZiel: has joined #ruby
[02:19:45] jenrzzz: has joined #ruby
[02:20:25] genpaku: has joined #ruby
[02:25:44] mim1k: has joined #ruby
[02:26:14] olivier__: has joined #ruby
[02:27:09] olivier__: has joined #ruby
[02:31:19] pb122-two: has joined #ruby
[02:32:39] jenrzzz: has joined #ruby
[02:34:48] rc48: has joined #ruby
[02:38:22] olivier__: has joined #ruby
[02:38:44] houhoulis: has joined #ruby
[02:38:46] Cohedrin: has joined #ruby
[02:39:12] olivier__: has joined #ruby
[02:39:13] uZiel: has joined #ruby
[02:41:38] gothicsouth: has joined #ruby
[02:42:59] Tempesta: has joined #ruby
[02:44:50] jrafanie: has joined #ruby
[02:47:07] hndk: has joined #ruby
[02:48:08] cyphase: has joined #ruby
[02:49:44] tristanp: has joined #ruby
[02:49:58] olivier__: has joined #ruby
[02:50:12] Jason: has joined #ruby
[02:50:37] Jason: hi all. i have some serious gem problems, hah. currently getting this running some older code of mine
[02:50:38] Jason: Unable to activate dm-serializer-1.2.2, because json-2.1.0 conflicts with json (~> 1.6) (Gem::ConflictError)
[02:50:51] Jason: i've tried bundle update and removing the Gemfile.lock, each with no luck
[02:51:10] olivier__: has joined #ruby
[02:53:15] sneakerhax: has joined #ruby
[02:53:39] havenwood: Jason: What's depending on?: json ~> 1.6
[02:53:51] havenwood: Jason: Check the Gemfile.lock file.
[02:54:47] Jason: havenwood: hi! Gemfile.lock -> https://pastebin.com/CVRkqWYk
[02:54:49] ruby[bot]: Jason: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/f121c5c5816bd05bf08fbe7f6b1d4c48
[02:54:49] ruby[bot]: Jason: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[02:55:12] Jason: looks like dm-serializer
[02:55:21] havenwood: and dm-types
[02:55:52] havenwood: unfortunately those gems don't appear to be maintained
[02:56:06] havenwood: oh, 2016, nvm
[02:56:11] Jason: well, not actively maintained
[02:56:13] Jason: perhaps legacy
[02:56:25] havenwood: well, last release was 2012, but commits in 2016
[02:56:33] nobitanobi: has joined #ruby
[02:56:37] roamingdog: has joined #ruby
[02:56:44] Jason: in any case, what's your suggestion for getting this working?
[02:57:15] Jason: looks like datamapper is the orm i used, so that's ugh
[02:57:41] havenwood: Jason: gem: 'dm-serializer', git: 'https://github.com/datamapper/dm-serializer.git', ref: '44e30a7d4478a3dfe0d0c778b58b9a35e8bb5409'
[02:58:11] havenwood: Jason: I'd suggest trying the latest 2016 commit ^ in your Gemfile and bundling
[02:58:19] Jason: that is a good idea
[02:58:20] Jason: let's try
[02:58:48] havenwood: They've dropped the hard json dep, so it should do the trick.
[02:59:06] havenwood: You might need to do it across the board with dm-* to get everything working. It seem to be worth a shot at least.
[02:59:26] havenwood: At least dm-serializer and d-types are necessary.
[02:59:43] havenwood: And the other dm-* may or may not play nice with those new, unreleased versions. I don't know.
[03:00:04] Jason: havenwood: https://gist.github.com/jasonharrison/f29b8abbb06a7424a65bdce4d0f8322a
[03:01:15] havenwood: Jason: It looks like master is version 1.3.0.beta.
[03:01:24] havenwood: Jason: So yeah, you'll need to upgrade all the dm.
[03:01:49] Jason: `bundle update`?
[03:01:57] olivier__: has joined #ruby
[03:02:04] havenwood: they're not released gems, afaik
[03:02:06] Jason: course it can't be that easy, hah
[03:02:09] havenwood: you'd have to peg to commits
[03:02:11] roamingdog: has joined #ruby
[03:02:40] Jason: let's give that a try, few mins
[03:02:52] havenwood: Or you could remove the json dep in the earlier stable version on your own fork, and hope that works.
[03:03:10] olivier__: has joined #ruby
[03:03:14] havenwood: I'm not sure which route is better since I'm not well-acquainted with the libraries
[03:03:33] Jason: i'm looking at datamapper and half tempted to just switch to activerecord
[03:03:40] Jason: havenwood: this is some code i dug up from like 3 years ago
[03:03:46] havenwood: ActiveRecord and Sequel are nice.
[03:03:56] Jason: i bet in the time i spend fixing this legacy sillyness, i could just implement activerecord
[03:04:09] Jason: decisions decisions
[03:04:11] havenwood: Jason: You might take a look at the Sequel gem as well: https://github.com/jeremyevans/sequel
[03:04:24] havenwood: It's popular and very well maintained.
[03:04:26] Jason: looks interesting
[03:04:37] havenwood: As is ActiveRecord, of course.
[03:04:47] Jason: havenwood: the reason i'm looking at activerecord is i bet I could just drop it in and change a few things, lol
[03:05:02] Jason: looks like datamapper just basically was modeled around activerecord
[03:05:35] havenwood: Or you could use ROM and Sequel. I think ROM is DM's successor.
[03:06:07] Jason: rom **and** sequel?
[03:06:16] havenwood: Jason: Here's an example of a ROM/Sequel stack with Roda: https://github.com/jeremyevans/roda-sequel-stack
[03:06:35] Jason: honestly, this is just old code that i may or may not ever use again
[03:06:43] havenwood: err, that's not ROM - wrong link
[03:06:44] Jason: i'm just looking at it to see what i made and how well it worked, lol
[03:06:56] havenwood: Jason: https://github.com/rom-rb/rom
[03:07:19] Jason: interesting
[03:07:41] tvw: has joined #ruby
[03:08:02] Jason: havenwood: it looks like there are lots of dm-*'s
[03:08:11] Jason: and it doesn't look like pegging each to a commit would work here
[03:08:17] Jason: some haven't had commits since 2012
[03:08:45] havenwood: Jason: Then fork the stable dm-serializer and dm-types and remove the json dep from the gemspecs.
[03:08:52] havenwood: See if it works.
[03:08:55] Jason: good idea
[03:09:25] havenwood: peg to them like above
[03:09:37] havenwood: since there're no changes coming from upstream being pegged to your own fork won't matter
[03:10:21] havenwood: But yeah, biting the bullet and switching to ActiveRecord sounds like a good maintenance plan.
[03:11:39] Jason: havenwood: my concern with activerecord is the types of my properties
[03:11:40] Jason: property :requested_inventory, Object #[ShowID, InventoryID, QTY]
[03:11:48] Jason: i must have been sleep deprived when i wrote this, lol
[03:12:33] nofxxx: go noSQL =D mongo, rethink
[03:13:19] nofxxx: redis, couch... life's too short for sql
[03:13:40] havenwood: nofxxx: Datomic.
[03:14:13] havenwood: Life's too long for NoSQL.
[03:14:26] nofxxx: havenwood, a transactional one! hehe thanks
[03:14:48] Jason: havenwood: so i bit the bullet and pegged everything to a commit
[03:14:54] olivier__: has joined #ruby
[03:15:12] olivier__: has joined #ruby
[03:15:17] Jason: let me paste, this is madness
[03:15:51] jusa: has joined #ruby
[03:16:15] Utkarsh: has joined #ruby
[03:16:20] Jason: havenwood: https://gist.github.com/jasonharrison/3acd8011991b035559b6b6e33424fab6
[03:17:23] nofxxx: havenwood, just sad it's java... there's not enougth ram in the world for java, ok resets are infinite, but boring
[03:18:21] Jason: havenwood: any ideas? i don't even know, man, lol
[03:25:54] olivier__: has joined #ruby
[03:27:08] olivier__: has joined #ruby
[03:30:33] havenwood: Jason: Seems like a yak shave.
[03:31:13] Cohedrin: has joined #ruby
[03:35:29] __Yiota: has joined #ruby
[03:35:56] Jameser: has joined #ruby
[03:37:58] olivier__: has joined #ruby
[03:39:07] olivier__: has joined #ruby
[03:41:35] gix: has joined #ruby
[03:41:56] demio: has joined #ruby
[03:43:21] cfec0b8d: has joined #ruby
[03:44:24] nanoz: has joined #ruby
[03:47:28] Jason: havenwood: so let's pretend i don't care about my ruby or the older gems
[03:47:36] Jason: i just installed rvm to play with this
[03:48:30] msmith: has joined #ruby
[03:50:00] olivier__: has joined #ruby
[03:51:10] olivier__: has joined #ruby
[03:53:23] Cohedrin: has joined #ruby
[03:57:09] Jason: this is a pain
[03:57:14] Jason: so let's pretend i have a Gemfile.lock
[03:57:29] Jason: and i don't care about if the versions of gems i need to run to get the app working are ld
[04:00:00] Jason: havenwood: require 'bundler/setup'
[04:00:05] Jason: that's all i had to put in my ruby app
[04:02:53] olivier__: has joined #ruby
[04:03:11] olivier__: has joined #ruby
[04:03:24] Jason: havenwood: success, lol, thank you for your help
[04:03:58] erlend: has joined #ruby
[04:05:43] charliesome: has joined #ruby
[04:10:45] cschneid_: has joined #ruby
[04:11:56] d^sh: has joined #ruby
[04:13:58] olivier__: has joined #ruby
[04:15:07] olivier__: has joined #ruby
[04:15:07] Slinky_Pete: has joined #ruby
[04:24:37] __Yiota: has joined #ruby
[04:25:41] olivier__: has joined #ruby
[04:26:10] olivier__: has joined #ruby
[04:26:16] mim1k: has joined #ruby
[04:26:42] uZiel: has joined #ruby
[04:29:57] DaleK5whr: has joined #ruby
[04:31:50] ledestin: has joined #ruby
[04:32:54] renchan: has joined #ruby
[04:33:21] Cohedrin: has joined #ruby
[04:36:06] rc48: has joined #ruby
[04:36:58] olivier__: has joined #ruby
[04:38:08] olivier__: has joined #ruby
[04:39:41] Cohedrin: has joined #ruby
[04:41:34] roamingdog: has joined #ruby
[04:49:00] olivier__: has joined #ruby
[04:49:44] patarr: has joined #ruby
[04:50:07] olivier__: has joined #ruby
[04:57:17] nobitanobi: has joined #ruby
[04:58:42] Cohedrin: has joined #ruby
[05:00:58] olivier__: has joined #ruby
[05:02:08] olivier__: has joined #ruby
[05:02:53] anisha: has joined #ruby
[05:04:14] howdoi: has joined #ruby
[05:12:59] olivier__: has joined #ruby
[05:14:08] olivier__: has joined #ruby
[05:15:27] uZiel: can I specify no-padding option to OpenSSL::Cipher::AES somehow?
[05:16:48] xall: has joined #ruby
[05:16:51] Cohedrin_: has joined #ruby
[05:17:52] cjhowe: has joined #ruby
[05:18:37] cjhowe: has joined #ruby
[05:19:27] cjhowe: has joined #ruby
[05:20:16] cjhowe: has joined #ruby
[05:21:01] cjhowe: has joined #ruby
[05:21:51] cjhowe: has joined #ruby
[05:22:36] cjhowe: has joined #ruby
[05:22:37] Guest2530: has joined #ruby
[05:26:17] olivier__: has joined #ruby
[05:27:12] olivier__: has joined #ruby
[05:29:06] Bock: has joined #ruby
[05:33:01] N0ATN: has joined #ruby
[05:35:34] aupadhye: has joined #ruby
[05:36:23] cjhowe: has joined #ruby
[05:37:06] rc48: has joined #ruby
[05:38:00] olivier__: has joined #ruby
[05:39:09] olivier__: has joined #ruby
[05:39:13] cjhowe: has joined #ruby
[05:40:03] cjhowe: has joined #ruby
[05:49:18] __Yiota: has joined #ruby
[05:49:59] olivier__: has joined #ruby
[05:50:28] roamingdog: has joined #ruby
[05:51:09] olivier__: has joined #ruby
[05:55:43] CGibsonmm: has joined #ruby
[06:01:58] olivier__: has joined #ruby
[06:02:50] Cohedrin: has joined #ruby
[06:03:07] olivier__: has joined #ruby
[06:08:22] pb122: has joined #ruby
[06:12:13] _whitelogger: has joined #ruby
[06:14:00] olivier__: has joined #ruby
[06:15:10] olivier__: has joined #ruby
[06:19:10] uZiel: I want to run either of the two different loops depending on the value of a boolean
[06:19:18] uZiel: can/should I use yield?
[06:20:40] uZiel: how will it be any different from using an if condition "bool ? loop1 : loop2"
[06:21:27] uZiel: by yield I meant block
[06:26:25] olivier__: has joined #ruby
[06:26:45] mim1k: has joined #ruby
[06:27:11] olivier__: has joined #ruby
[06:27:33] conta: has joined #ruby
[06:28:55] baweaver: uZiel: what's the problem you're trying to solve for?
[06:30:34] baweaver: the short answer is to put the loops in different methods, but you may be solving for the wrong problem here depending on what you're using this for
[06:31:41] tristanp: has joined #ruby
[06:33:41] aupadhye_: has joined #ruby
[06:34:37] cam27: has joined #ruby
[06:35:48] pb122-two: has joined #ruby
[06:37:55] KeyJoo: has joined #ruby
[06:37:59] olivier__: has joined #ruby
[06:39:08] olivier__: has joined #ruby
[06:42:56] BTRE: has joined #ruby
[06:43:42] last_staff: has joined #ruby
[06:45:08] eightlimbed: has joined #ruby
[06:46:26] renchan: has joined #ruby
[06:49:59] olivier__: has joined #ruby
[06:50:46] patarr: has joined #ruby
[06:51:10] olivier__: has joined #ruby
[06:52:14] benjen: has joined #ruby
[06:52:29] JohnnyTao: has joined #ruby
[06:55:44] johnny5: has joined #ruby
[06:57:36] mtkd: has joined #ruby
[06:58:06] nobitanobi: has joined #ruby
[06:58:50] ur5us: has joined #ruby
[07:01:59] olivier__: has joined #ruby
[07:03:09] olivier__: has joined #ruby
[07:04:50] mmasaki: has joined #ruby
[07:09:02] dionysus69: has joined #ruby
[07:09:27] govg: has joined #ruby
[07:10:33] jgnagy: has joined #ruby
[07:10:43] mim1k: has joined #ruby
[07:11:43] PatrikasZvaigzde: has joined #ruby
[07:13:59] olivier__: has joined #ruby
[07:15:08] olivier__: has joined #ruby
[07:19:49] nofxxxx: has joined #ruby
[07:21:23] dionysus69: when I do Phantomjs.run('/home/user/test.js') irb just hangs
[07:21:37] dionysus69: test.js contains just console.log(123);
[07:22:10] etehtsea: has joined #ruby
[07:22:39] biberu: has joined #ruby
[07:22:57] dhollinger: has joined #ruby
[07:23:56] mark_66: has joined #ruby
[07:25:24] nicesignal: has joined #ruby
[07:25:34] dionysus69: my bad, gem readme example didn't mention anything about phantom.exit()...
[07:25:40] olivier__: has joined #ruby
[07:26:10] olivier__: has joined #ruby
[07:28:20] aupadhye: has joined #ruby
[07:36:59] olivier__: has joined #ruby
[07:37:34] djbkd: has joined #ruby
[07:38:10] olivier__: has joined #ruby
[07:38:39] rc48: has joined #ruby
[07:40:18] roamingdog: has joined #ruby
[07:41:05] roamingdog: has joined #ruby
[07:41:53] roamingdog: has joined #ruby
[07:42:40] roamingdog: has joined #ruby
[07:43:30] roamingdog: has joined #ruby
[07:44:15] roamingdog: has joined #ruby
[07:44:36] CGibsonmm: has joined #ruby
[07:44:46] vali: has joined #ruby
[07:48:19] agent_white: has joined #ruby
[07:48:58] olivier__: has joined #ruby
[07:50:07] olivier__: has joined #ruby
[07:52:51] aufi: has joined #ruby
[07:55:28] nobitanobi: has joined #ruby
[07:58:51] bsartek: has joined #ruby
[08:00:58] olivier__: has joined #ruby
[08:02:08] olivier__: has joined #ruby
[08:06:20] mitt3ns: has joined #ruby
[08:09:35] jenrzzz: has joined #ruby
[08:12:03] cschneid_: has joined #ruby
[08:12:54] bathtub_shark: has joined #ruby
[08:12:59] olivier__: has joined #ruby
[08:13:33] vali: has joined #ruby
[08:13:59] mikecmpbll: has joined #ruby
[08:14:08] olivier__: has joined #ruby
[08:15:32] cdg: has joined #ruby
[08:16:09] Jason: has left #ruby: ()
[08:16:33] Zarthus_: has joined #ruby
[08:16:34] bsartek: has joined #ruby
[08:18:30] ecuanaso: has joined #ruby
[08:20:37] vali: has joined #ruby
[08:22:08] mim1k: has joined #ruby
[08:25:18] olivier__: has joined #ruby
[08:26:12] olivier__: has joined #ruby
[08:28:06] mikecmpbll: has joined #ruby
[08:31:27] bsartek: has joined #ruby
[08:32:18] wuyin: has joined #ruby
[08:33:08] cschneid_: has joined #ruby
[08:35:13] _DanN_: has joined #ruby
[08:35:24] vali: has joined #ruby
[08:36:58] olivier__: has joined #ruby
[08:37:34] uZiel: has joined #ruby
[08:38:12] olivier__: has joined #ruby
[08:38:32] kke: what kind of pattern/composition would you use for something like Food.new(state: :ordered) that requires several steps before reaching state == :finished, such as obtain_ingredients, cook, put_on_a_plate, etc? the steps can take some time and are performed by some background workers.
[08:38:45] CGibsonmm: has joined #ruby
[08:40:19] DoubleMalt: has joined #ruby
[08:44:06] tomphp: has joined #ruby
[08:45:25] roamingdog: has joined #ruby
[08:48:57] olivier__: has joined #ruby
[08:49:37] mim1k: has joined #ruby
[08:50:06] olivier__: has joined #ruby
[08:51:30] patarr: has joined #ruby
[08:51:40] bmurt: has joined #ruby
[08:52:36] sonOfRa: has joined #ruby
[08:53:22] Bish: Cannot link to a non running container: /pg_main AS /console/pg_main
[08:53:30] Bish: ah, sorry
[08:55:36] ljarvis: kke: just update the state inside those methods? unsure exactly what you're looking for
[08:56:21] ljarvis: e.g. the last step updates the state assuming the state is correct (the state returned by the penultimate step)
[08:57:11] ljarvis: if state == :cooked; put_on_a_plate; state = :finished etc
[08:57:25] lxsameer: has joined #ruby
[09:00:10] marr: has joined #ruby
[09:00:59] olivier__: has joined #ruby
[09:01:41] chichou: has joined #ruby
[09:02:08] olivier__: has joined #ruby
[09:03:19] bsartek: has joined #ruby
[09:10:22] bkxd: has joined #ruby
[09:11:25] aupadhye: has joined #ruby
[09:11:30] snickers: has joined #ruby
[09:12:59] olivier__: has joined #ruby
[09:13:07] tomphp: has joined #ruby
[09:13:27] cdg_: has joined #ruby
[09:14:09] olivier__: has joined #ruby
[09:20:54] kke: that's what i'm trying to avoid. i think i'm going to use AASM or statesman, but i think what i actually would like is a workflow engine, but seems like there aren't any good candidates
[09:21:03] mim1k: has joined #ruby
[09:23:44] cschneid_: has joined #ruby
[09:25:00] olivier__: has joined #ruby
[09:26:09] olivier__: has joined #ruby
[09:26:18] ljarvis: sounds overly complicated, but im sure your example was just heavily simplified
[09:27:51] tristanp: has joined #ruby
[09:32:40] cfec0b8d: has joined #ruby
[09:32:56] CGibsonmm: has joined #ruby
[09:35:11] workmad3: has joined #ruby
[09:37:01] olivier__: has joined #ruby
[09:37:36] cyphase: has joined #ruby
[09:38:11] olivier__: has joined #ruby
[09:40:16] rc48: has joined #ruby
[09:40:22] sonOfRa: has joined #ruby
[09:44:59] im0nde: has joined #ruby
[09:46:50] roamingdog: has joined #ruby
[09:48:59] olivier__: has joined #ruby
[09:50:07] olivier__: has joined #ruby
[09:56:38] biberu: has joined #ruby
[10:00:54] roshanavand: has joined #ruby
[10:01:00] olivier__: has joined #ruby
[10:02:10] olivier__: has joined #ruby
[10:04:21] ur5us: has joined #ruby
[10:07:13] Mia: has joined #ruby
[10:07:13] Mia: has joined #ruby
[10:07:29] chichou: has joined #ruby
[10:10:25] jenrzzz: has joined #ruby
[10:10:28] jenrzzz: has joined #ruby
[10:13:01] olivier__: has joined #ruby
[10:14:10] olivier__: has joined #ruby
[10:16:29] xall: has joined #ruby
[10:19:56] patarr: has joined #ruby
[10:21:22] Azure|dc: has joined #ruby
[10:21:31] ikopico: has joined #ruby
[10:22:15] t-recx: has joined #ruby
[10:23:33] tomphp: has joined #ruby
[10:24:42] olivier__: has joined #ruby
[10:25:12] olivier__: has joined #ruby
[10:26:46] CGibsonmm: has joined #ruby
[10:28:28] aupadhye: has joined #ruby
[10:30:38] rc48: has joined #ruby
[10:33:00] charliesome: has joined #ruby
[10:33:06] gregf_: has joined #ruby
[10:35:59] olivier__: has joined #ruby
[10:37:10] olivier__: has joined #ruby
[10:38:46] ferr: has joined #ruby
[10:43:14] jamesaxl: has joined #ruby
[10:43:44] ur5us: has joined #ruby
[10:44:59] ikopico: has joined #ruby
[10:46:50] zylo: has joined #ruby
[10:47:36] roamingdog: has joined #ruby
[10:47:59] olivier__: has joined #ruby
[10:49:09] olivier__: has joined #ruby
[10:51:48] tomphp: has joined #ruby
[10:52:29] pb122: has joined #ruby
[10:57:18] bkxd: has joined #ruby
[10:57:34] qba73: has joined #ruby
[10:59:57] olivier__: has joined #ruby
[11:01:12] olivier__: has joined #ruby
[11:01:21] teclator: has joined #ruby
[11:04:01] Fernando-Basso: has joined #ruby
[11:06:27] ikopico: has joined #ruby
[11:07:33] pb122-two: has joined #ruby
[11:09:27] roshanavand: has left #ruby: ()
[11:11:11] cschneid_: has joined #ruby
[11:11:59] olivier__: has joined #ruby
[11:13:12] olivier__: has joined #ruby
[11:15:40] qba73: has joined #ruby
[11:16:28] pb122: has joined #ruby
[11:18:01] im0nde: has joined #ruby
[11:20:51] CGibsonmm: has joined #ruby
[11:21:06] Polysics: has joined #ruby
[11:25:44] olivier__: has joined #ruby
[11:26:09] olivier__: has joined #ruby
[11:26:51] withasmile: has joined #ruby
[11:27:35] pb122: has joined #ruby
[11:30:58] kthibodeaux: has joined #ruby
[11:31:25] rc48: has joined #ruby
[11:31:55] LukyCZ: has joined #ruby
[11:34:24] bmurt: has joined #ruby
[11:34:32] ecuanaso: has joined #ruby
[11:36:44] qba73: has joined #ruby
[11:36:58] olivier__: has joined #ruby
[11:38:08] olivier__: has joined #ruby
[11:46:01] bsartek: has joined #ruby
[11:48:32] olivier__: has joined #ruby
[11:49:06] olivier__: has joined #ruby
[11:52:34] kthibodeaux: has joined #ruby
[12:00:58] Pumukel: has joined #ruby
[12:02:16] jaruga: has joined #ruby
[12:03:16] GodFather: has joined #ruby
[12:03:56] bkxd: has joined #ruby
[12:09:17] romank: has joined #ruby
[12:09:47] bkxd: has joined #ruby
[12:10:11] kke: looks like i don't like AASM or statesman either
[12:10:23] gnufied: has joined #ruby
[12:12:36] jaruga________: has joined #ruby
[12:13:50] qba73: has joined #ruby
[12:14:40] hashrocket: has joined #ruby
[12:15:21] CGibsonmm: has joined #ruby
[12:16:41] Vile`: has joined #ruby
[12:18:05] nhhc: has joined #ruby
[12:18:32] olivier__: has joined #ruby
[12:19:00] apeiros: I think my znc's time is off… did ljarvis reply to that 9h ago or just 2h?
[12:19:10] uZiel: has joined #ruby
[12:19:30] roamingdog: has joined #ruby
[12:19:40] nertzy: has joined #ruby
[12:20:01] apeiros: kke: using threads for those background workers? if so, make sure either AASM/statesman is thread safe, or how to properly use them with threads.
[12:20:24] kke: aasm readme claims it's thread safe
[12:21:11] kke: i was planning to use sucker_punch to run concurrent-ruby based workers
[12:21:39] pupsicle: has joined #ruby
[12:23:13] kke: i thought it would be a pretty common problem and would have been solved a zillion times already
[12:25:15] apeiros: I'd say it is
[12:25:32] apeiros: I only glossed over what you asked, though.
[12:25:46] apeiros: but state machines + worker queues are a common recipe.
[12:25:58] kke: something to script a multi stage job
[12:27:03] olivier__: has joined #ruby
[12:31:51] _moep_: has left #ruby: ()
[12:34:13] dionysus69: https://gist.github.com/anonymous/6f0869c4bf5624946fdf03ee17e44b29
[12:34:14] dionysus69: I am unable to pass command line argument to this script starting up firefox, in gist i provided 3 examples with comments, I am trying to pass headless command line argument to the selenium driver starting up firefox, but I am unable to :\ please any hints appreciated
[12:42:43] ecuanaso: has joined #ruby
[12:45:03] grymmjack: has joined #ruby
[12:47:18] bruce_lee: has joined #ruby
[12:47:18] bruce_lee: has joined #ruby
[12:50:23] jenrzzz: has joined #ruby
[12:50:24] jenrzzz: has joined #ruby
[12:50:50] centrx: has joined #ruby
[12:55:01] rc48: has joined #ruby
[12:55:23] yqt: has joined #ruby
[13:03:36] ntt: has joined #ruby
[13:03:52] anisha: has joined #ruby
[13:04:14] oleo: has joined #ruby
[13:04:43] ntt: Hi, I'm searching a way to read the name of interfaces on a linux centos 7 box with ruby 1.9. Someone can help me? I'm able to read IP with Socket::getaddrinfo(Socket.gethostname, "echo", Socket::AF_INET).map { |x| x[3] } but I don't understand how to read the interface name
[13:07:24] haylon: has joined #ruby
[13:08:22] Mon_Ouie: has joined #ruby
[13:09:19] anisha_: has joined #ruby
[13:10:58] mim1k: has joined #ruby
[13:13:30] qba73: has joined #ruby
[13:15:39] ddffg: has joined #ruby
[13:17:30] cdg: has joined #ruby
[13:17:45] uZiel: has joined #ruby
[13:18:15] uZiel: can I pass a function as a parameter?
[13:19:10] adam12: uZiel: kinda?
[13:20:14] roamingdog: has joined #ruby
[13:20:29] adam12: uZiel: you'd pass a lambda or proc, or get a reference to a method using the `method` method and then passing that.
[13:20:29] apeiros: uZiel: you can use Object#method to create an object from a method (no functions in ruby, sorry), you can pass the name of a method as a Symbol (or String) and invoke it using Object#send
[13:20:47] apeiros: uZiel: additionally methods take a special argument, the block argument, which is similar to a function
[13:21:14] apeiros: oh, and you can always create procs/lambdas using Kernel#proc and Kernel#lambda and pass those (they're objects)
[13:21:25] apeiros: so pick your poison :)
[13:23:08] ghormoon: has joined #ruby
[13:24:30] rippa: has joined #ruby
[13:25:40] uZiel: will look into the options
[13:25:44] uZiel: thanks adam12 apeiros
[13:26:30] apeiros: uZiel: you can always put your code on gist.github.com and ask again. will make it easier to give a sensible answer.
[13:29:11] houhoulis: has joined #ruby
[13:30:46] pb122-two: has joined #ruby
[13:31:54] dionysus69: btw I figured out.
[13:32:59] dionysus69: anyone who wants to know how to run <real>headless firefox with selenium webdriver gem, ask me ;) (without xvfb package)
[13:37:05] olivier__: has joined #ruby
[13:39:01] CGibsonmm: has joined #ruby
[13:39:28] DLSteve: has joined #ruby
[13:40:01] cam27: has joined #ruby
[13:48:03] TheBrayn: has joined #ruby
[13:51:52] mim1k: has joined #ruby
[13:52:19] railswebdev: has joined #ruby
[13:58:05] spheric: has joined #ruby
[13:58:14] __Yiota: has joined #ruby
[14:00:53] dionysus69: anyways, I posted the answer here https://stackoverflow.com/questions/39647629/ruby-selenium-how-to-pass-arguments-to-browser/44202928#44202928 I am going home now :P
[14:01:38] Jameser: has joined #ruby
[14:05:42] chouhoulis: has joined #ruby
[14:08:01] houhoulis: has joined #ruby
[14:09:32] jrafanie: has joined #ruby
[14:10:48] psmolen: has joined #ruby
[14:11:09] bsartek: has joined #ruby
[14:12:08] Polysics: has joined #ruby
[14:14:11] __Yiota: has joined #ruby
[14:14:17] patarr: has joined #ruby
[14:16:06] jaruga________: has joined #ruby
[14:16:56] jaruga________: has joined #ruby
[14:17:56] etehtsea: has joined #ruby
[14:20:21] apparition: has joined #ruby
[14:22:43] MrBusiness: has joined #ruby
[14:25:29] sepp2k: has joined #ruby
[14:26:37] kelseynz__: has joined #ruby
[14:28:33] kelseynz__: Is there a way to specify (as a gem author) which file should be required by default by Bundler, in place of GEMNAME.rb (on the gem side)?
[14:28:49] shakes: has joined #ruby
[14:29:33] ascheel: has left #ruby: ()
[14:35:26] Polysics: has joined #ruby
[14:38:17] bkxd: has joined #ruby
[14:44:56] Jameser: has joined #ruby
[14:48:35] mim1k: has joined #ruby
[14:48:46] etehtsea: has joined #ruby
[14:53:30] jenrzzz: has joined #ruby
[14:54:35] djbkd: has joined #ruby
[14:57:01] theunraveler: has joined #ruby
[14:57:53] mark_66: has left #ruby: ("PART #elixir-lang :PART #crystal-lang :PONG :wolfe.freenode.net")
[14:58:20] cbyrda: has joined #ruby
[15:05:15] adgtl: has joined #ruby
[15:05:15] adgtl: has joined #ruby
[15:07:35] shakes: has joined #ruby
[15:11:29] cschneid_: has joined #ruby
[15:14:30] Jameser: has joined #ruby
[15:14:54] daed: https://i.redd.it/w3p5xx111tzy.jpg
[15:17:31] jgnagy: has joined #ruby
[15:17:51] raspado: has joined #ruby
[15:20:57] roamingdog: has joined #ruby
[15:22:21] uZiel: has joined #ruby
[15:23:51] mdw: has joined #ruby
[15:25:10] cjhowe: has joined #ruby
[15:31:56] djbkd: has joined #ruby
[15:32:19] ruby-lang457: has joined #ruby
[15:49:16] __Yiota: has joined #ruby
[15:49:57] bgray: has joined #ruby
[15:51:06] bgray: has left #ruby: ()
[15:52:47] tomphp: has joined #ruby
[15:57:30] shinnya: has joined #ruby
[15:58:08] brent__: has joined #ruby
[15:59:12] centrx: has joined #ruby
[15:59:13] centrx: has joined #ruby
[16:01:37] tomphp: has joined #ruby
[16:11:37] Guest35378: has joined #ruby
[16:14:27] HoierM_: has joined #ruby
[16:15:31] gusrub: has joined #ruby
[16:15:38] konsolebox: has joined #ruby
[16:15:48] hobodave: has joined #ruby
[16:19:32] dionysus69: has joined #ruby
[16:20:18] mim1k: has joined #ruby
[16:21:23] nitric: has joined #ruby
[16:22:10] danman: has joined #ruby
[16:24:39] hplar: has joined #ruby
[16:31:59] djbkd: has joined #ruby
[16:33:05] nadir: has joined #ruby
[16:33:15] rgr: has joined #ruby
[16:33:55] HoierM: has joined #ruby
[16:34:38] ddffg: has joined #ruby
[16:36:08] roamingdog: has joined #ruby
[16:39:33] jrafanie: has joined #ruby
[16:50:02] postmodern: has joined #ruby
[16:52:13] LastWhisper____: has joined #ruby
[16:55:13] MetaMutt: has joined #ruby
[16:59:11] Cohedrin: has joined #ruby
[17:01:47] gothicsouth: has joined #ruby
[17:02:12] stormbytes: probably not the right place to ask but if I already have curl installed on a system and run apt-get install curl will it just install the uprgraded version?
[17:03:22] SeepingN: has joined #ruby
[17:06:26] baweaver: https://askubuntu.com/questions/94102/what-is-the-difference-between-apt-get-update-and-upgrade
[17:06:43] nicoulaj46: has joined #ruby
[17:08:08] eightlimbed: has joined #ruby
[17:08:40] faces: has joined #ruby
[17:13:58] dviola: has joined #ruby
[17:14:27] MetaMutt: has joined #ruby
[17:14:39] chouhoulis: has joined #ruby
[17:15:17] MetaMutt: has joined #ruby
[17:16:12] postmodern: has joined #ruby
[17:17:30] MetaMutt: has joined #ruby
[17:17:55] Cohedrin: has joined #ruby
[17:18:11] postmodern: has joined #ruby
[17:20:12] postmodern: has joined #ruby
[17:22:41] postmodern: has joined #ruby
[17:24:12] MetaMutt: has joined #ruby
[17:26:15] jusa: has joined #ruby
[17:26:51] MetaMutt: has joined #ruby
[17:26:56] haylon: has joined #ruby
[17:28:10] eightlimbed: has joined #ruby
[17:29:37] enterprisey: has joined #ruby
[17:33:34] __Yiota: has joined #ruby
[17:34:48] ecuanaso: has joined #ruby
[17:35:17] duderonomy: has joined #ruby
[17:35:25] bsartek: has joined #ruby
[17:36:15] bsartek: has joined #ruby
[17:36:20] BTRE: has joined #ruby
[17:36:34] dionysus69: hey when I do system call it automatically puts it to console
[17:36:47] roamingdog: has joined #ruby
[17:36:49] dionysus69: how do I just save it to variable
[17:36:59] dionysus69: like system "firefox -v"
[17:37:19] dionysus69: should be saved in variable instead of printing out on a new line
[17:37:30] bsartek: has joined #ruby
[17:38:33] brent__: has joined #ruby
[17:38:47] bsartek: has joined #ruby
[17:38:47] mikecmpbll: has joined #ruby
[17:42:26] haylon: has joined #ruby
[17:43:49] Guest35378: has left #ruby: ("Leaving")
[17:45:57] borodin: has joined #ruby
[17:46:33] Cohedrin: has joined #ruby
[17:46:37] brent__: has joined #ruby
[17:48:35] hobodave: has joined #ruby
[17:50:23] havenwood: dionysus69 = `firefox -v`
[17:54:56] mdw: has joined #ruby
[17:56:07] jenrzzz: has joined #ruby
[17:56:07] jenrzzz: has joined #ruby
[17:58:39] mikecmpbll: has joined #ruby
[17:58:39] dionysus69: havenwood: it needed a chomp or strip at the end too, added a new line :) but thanks!
[18:00:04] muelleme: has joined #ruby
[18:01:04] gothicsouth: has joined #ruby
[18:01:24] beyonder: has joined #ruby
[18:03:31] ghormoon: has joined #ruby
[18:04:34] Cohedrin: has joined #ruby
[18:05:48] beyonder: has joined #ruby
[18:08:08] herwin: please, don't call that a system call, that term is used for something pretty different
[18:09:21] beyonder: has joined #ruby
[18:10:11] beyonder: has joined #ruby
[18:10:22] beyonder: hello there
[18:10:54] SeepingN: I use `linux stuff`.strip often
[18:13:27] centrx: has joined #ruby
[18:13:34] jaruga________: has joined #ruby
[18:14:58] dlitvak: has joined #ruby
[18:15:07] beyonder: has joined #ruby
[18:15:23] dionysus69: herwin: what is a system call then ? just cuious
[18:15:32] dtzuzu: has joined #ruby
[18:15:51] beyonder: has joined #ruby
[18:15:54] dionysus69: and what would I call this? whatever I called :)
[18:16:31] gusrub: has joined #ruby
[18:18:05] benlieb: has joined #ruby
[18:18:38] kegster: has joined #ruby
[18:21:21] Mon_Ouie: Calling a subprocess, executing a shell command. System calls are the interface applications use to interact with the operating system (e.g. to open a file, to allocate memory, etc.)
[18:22:20] benlieb: Recently saw this question in prep for job interviews:
[18:22:21] benlieb: What is the return value for:
[18:22:22] benlieb: ABC::new::xyz
[18:22:23] benlieb: ABC::new.xyz
[18:22:24] benlieb: ABC.new::xyz
[18:22:25] benlieb: ABC.new.xyz
[18:22:35] benlieb: apparently they're all the same?
[18:22:48] benlieb: I've never seen this syntax used for the 1st 3...
[18:23:43] havenwood: benlieb: You see some of that syntax in things like _why's poignant guide to Ruby, but it's dated. Of course just use: ABC.new.xyz
[18:24:26] beyonder: has joined #ruby
[18:24:32] alveric1: has joined #ruby
[18:25:27] Cohedrin_: has joined #ruby
[18:31:26] eightlimbed: has joined #ruby
[18:32:21] ecuanaso: has joined #ruby
[18:32:59] gusrub: has joined #ruby
[18:38:16] Dimik: has joined #ruby
[18:41:26] brent__: has joined #ruby
[18:42:56] roamingdog: has joined #ruby
[18:43:09] lxsameer: has joined #ruby
[18:43:20] resnik2: has joined #ruby
[18:49:36] br0d1n: has joined #ruby
[18:59:07] havenwood: beyonder: indeed
[19:01:55] mdw: has joined #ruby
[19:05:49] roamingdog: has joined #ruby
[19:07:12] centrx: has joined #ruby
[19:07:12] centrx: has joined #ruby
[19:11:23] roamingdog: has joined #ruby
[19:11:58] Cohedrin: has joined #ruby
[19:13:08] ledestin: has joined #ruby
[19:17:07] kies: has joined #ruby
[19:19:57] borodin: has joined #ruby
[19:21:54] gothicsouth: has joined #ruby
[19:24:26] mim1k: has joined #ruby
[19:25:59] dionysus69: thanks Mon_Ouie
[19:26:28] kegster: has joined #ruby
[19:26:57] bsartek: has joined #ruby
[19:27:28] Xakotu: has joined #ruby
[19:40:20] cdg: has joined #ruby
[19:46:06] mim1k: has joined #ruby
[19:47:08] ur5us: has joined #ruby
[19:49:24] gusrub_: has joined #ruby
[19:49:37] muelleme: has joined #ruby
[19:50:11] sniffer: has joined #ruby
[19:50:24] rfoust: has joined #ruby
[19:56:06] agent_white: has joined #ruby
[19:56:45] redaudit: has joined #ruby
[20:01:53] mim1k: has joined #ruby
[20:03:36] jackjackdripper: has joined #ruby
[20:04:09] gnufied: has joined #ruby
[20:05:56] shinnya: has joined #ruby
[20:09:38] mim1k: has joined #ruby
[20:09:55] bsartek: has joined #ruby
[20:10:14] roamingdog: has joined #ruby
[20:15:29] enterprisey: has joined #ruby
[20:15:31] Ove_: has joined #ruby
[20:17:14] gusrub: has joined #ruby
[20:23:26] govg: has joined #ruby
[20:23:33] cdg: has joined #ruby
[20:24:41] Ove_: trying to log as different program_names and then match on the program name in syslog.
[20:24:52] Ove_: Seems ruby still sames everything through the same programname.
[20:27:57] Cohedrin: has joined #ruby
[20:28:24] yeticry_: has joined #ruby
[20:28:25] oleo: has joined #ruby
[20:32:45] JoshS: has joined #ruby
[20:33:03] jenrzzz: has joined #ruby
[20:33:17] bsartek: has joined #ruby
[20:33:21] workmad3: has joined #ruby
[20:33:29] baweaver: cjohnson: also gist is nice.
[20:33:57] ecuanaso: has joined #ruby
[20:34:08] cjohnson: >> map = {'G' => 'C', 'C' => 'G', 'T' => 'A', 'A' => 'U'}; myKey = 'F'; map.has_key? myKey
[20:34:09] ruby[bot]: cjohnson: # => false (https://eval.in/806013)
[20:34:53] baweaver: has_key? isn't entirely needed here
[20:35:21] cjohnson: https://gist.github.com/chrisjohnson/371b1152c4d36374147a62a79806d46f
[20:35:25] baweaver: >> h = {'G' => 'C'}; [h['G'], h['Nope']]
[20:35:26] ruby[bot]: baweaver: # => ["C", nil] (https://eval.in/806014)
[20:35:29] baweaver: nil is falsy
[20:35:41] cjohnson: I am wanting to throw an error if the input is bad
[20:35:53] baweaver: So invalid if it's there?
[20:35:58] baweaver: you probably want `unless`
[20:36:04] cjohnson: oh woops yeah
[20:36:23] baweaver: and a strand is a set of characters, no?
[20:36:34] cjohnson: Yes this isn't done, I'm just on the find_complement method
[20:36:38] baweaver: >> 'GCTA'.chars
[20:36:39] ruby[bot]: baweaver: # => ["G", "C", "T", "A"] (https://eval.in/806015)
[20:36:45] cjohnson: which will take 1 char, check it, if it's bad, error, if it's good, return the complement
[20:36:50] cjohnson: then the of_dna will map that
[20:37:07] baweaver: do you need to have an error catch there?
[20:37:14] baweaver: or can you just ignore it?
[20:37:31] cjohnson: Well if of_dna gets bad input I would hope the erorr in find_complement will bubble up
[20:38:19] agundy_: has joined #ruby
[20:38:31] baweaver: Then there's an easier way there :)
[20:38:36] baweaver: &ri String#delete
[20:38:37] `derpy: http://ruby-doc.org/core-2.4.1/String.html#method-i-delete
[20:38:37] cjohnson: how do you mean
[20:38:53] cjohnson: no, that would silently discard bad input
[20:38:53] baweaver: what if you check what happens when you delete all the valid characters from the input string?
[20:38:55] baweaver: delete doesn't mutate
[20:38:57] cjohnson: which isn't what I wanted
[20:39:07] cjohnson: sure, that's one approach
[20:39:09] sp4rrow: has joined #ruby
[20:39:14] cjohnson: could use regex too
[20:39:23] cjohnson: seems more logical to me to only do one pass
[20:39:44] cjohnson: so anyway, I need unless not if. but can you explain why
[20:39:49] cjohnson: has_key? nucleotide
[20:39:55] cjohnson: doesn't work how I think it should?
[20:39:57] cjohnson: but :nucleotide
[20:40:12] baweaver: You want it to raise if it finds it
[20:40:23] baweaver: it won't ever find :nucleotide
[20:40:32] cjohnson: what is :nucleotide
[20:40:34] baweaver: :nucleotide is what's called a symbol
[20:40:40] cjohnson: like JS Symbol?
[20:40:41] baweaver: think a very barebones string
[20:40:43] baweaver: like a label
[20:40:57] cjohnson: where do you use a symbol
[20:41:00] baweaver: ACTION needs to look up JS symbol
[20:41:04] baweaver: mainly for object keys
[20:41:11] baweaver: hash keys in Ruby
[20:41:17] ruby[bot]: baweaver: # => {:a=>1} (https://eval.in/806016)
[20:41:24] baweaver: that's just sugar for that
[20:41:35] cjohnson: ok so it uses the symbol of a string as the key, not the string itself
[20:41:40] cjohnson: what's hte practical impact?
[20:41:58] baweaver: >> :string == 'string'
[20:41:59] ruby[bot]: baweaver: # => false (https://eval.in/806017)
[20:42:20] baweaver: symbols can be a bit dense to get the first pass.
[20:42:34] cjohnson: >> foo = {a: 1}; foo['a']
[20:42:35] ruby[bot]: cjohnson: # => nil (https://eval.in/806018)
[20:42:54] agundy_: has joined #ruby
[20:43:06] baweaver: especially if you come from high JS land
[20:43:14] baweaver: you don't get foo.a either
[20:43:28] cjohnson: Ok so I would want to define it as {'a': 1} if I want to read it back with 'a'
[20:43:37] cjohnson: the question is, in what real world scenario do you prefer a symbol?
[20:43:53] baweaver: >> {'a': 1}
[20:43:54] ruby[bot]: baweaver: # => {:a=>1} (https://eval.in/806019)
[20:43:58] baweaver: fair warning
[20:44:03] baweaver: >> {'a' => 1}
[20:44:04] ruby[bot]: baweaver: # => {"a"=>1} (https://eval.in/806020)
[20:44:23] baweaver: temperamental thing it is.
[20:44:25] cjohnson: nice. ok that's what I meant but I'm used to typing JS
[20:44:40] baweaver: Most Ruby types tend to use symbols for everything, if only because less typing
[20:44:54] cjohnson: >> x = {'a' => 1}; x['a']
[20:44:55] ruby[bot]: cjohnson: # => 1 (https://eval.in/806021)
[20:44:56] baweaver: that, and symbols are immutable. :foo is always :foo
[20:45:00] bougyman: it's not only because of typing.
[20:45:05] cjohnson: but 'foo' is not always 'foo'?
[20:45:08] bougyman: less object creation.
[20:45:09] centrx: a symbol represents a key, immutable
[20:45:13] baweaver: could be mutated
[20:45:27] cjohnson: oh ok, so it's not like JS where changing a string just re-assigns the new string to the variable
[20:45:42] mim1k: has joined #ruby
[20:45:44] baweaver: a = 'a'; hash[a]; a = 'bar'
[20:45:52] agundy_: has joined #ruby
[20:45:58] baweaver: yeah, feel free to chime in if I miss something on this
[20:46:38] gnufied: has joined #ruby
[20:46:49] baweaver: Also, there's this fun method
[20:46:54] baweaver: &ri String#tr
[20:46:54] `derpy: http://ruby-doc.org/core-2.4.1/String.html#method-i-tr
[20:47:19] baweaver: Assuming you always have valid input
[20:47:38] spk_: has joined #ruby
[20:48:13] baweaver: >> 'CTCTAGCG'.tr('GCTA', 'CGAU')
[20:48:14] ruby[bot]: baweaver: # => "GAGAUCGC" (https://eval.in/806025)
[20:49:07] baweaver: coffee time for me, be back in a bit
[20:49:32] baweaver: Enumerable, String, and Array are good reads in the docs
[20:49:36] baweaver: lots of fun stuff
[20:49:54] bsartek: has joined #ruby
[20:52:49] ecuanaso: has joined #ruby
[20:53:24] eightlimbed: has joined #ruby
[20:58:09] blackmesa: has joined #ruby
[21:00:27] minimalism: has joined #ruby
[21:01:14] roamingdog: has joined #ruby
[21:01:26] cjohnson: Alright, so if I instead chose to ignore invalid input and return an empty string if the input contained any invalid chars
[21:01:29] cjohnson: http://exercism.io/submissions/e830a3ef9d0f48e0a7245e9022c4fdfb
[21:01:34] cjohnson: this is what I end up with
[21:01:36] spk_: has joined #ruby
[21:02:41] physikoi: has joined #ruby
[21:03:51] physikoi: Hello #ruby. Can someone point me to a detailed explanation of gem config options for gems installed machine wide?
[21:04:15] physikoi: IDK why but I can't seem to find a clear explanation online.
[21:04:53] ledestin: what config options?
[21:05:36] physikoi: ledestin: hello. namely, where gem will install stuff.
[21:05:44] physikoi: prefix, i think it's called
[21:06:49] ledestin: ah, well, dunno. it can be set I guess, looking at rbenv
[21:07:05] gnufied: has joined #ruby
[21:08:09] physikoi: that's a starting point. thanks
[21:08:17] ecuanaso: has joined #ruby
[21:09:36] spk_: has joined #ruby
[21:09:58] eightlimbed: has joined #ruby
[21:11:55] physikoi: has left #ruby: ("ty")
[21:13:07] baweaver: cjohnson: Looks good to me.
[21:13:19] nofxxxx: has joined #ruby
[21:13:42] baweaver: otherwise just use the hash and each_char.map { |v| hash[v] }.join
[21:14:08] gothicsouth: has joined #ruby
[21:14:52] baweaver: well, or chars.map
[21:17:18] dionysus69: can anyone point me to whats wrong with this ? https://gist.github.com/anonymous/2ebdc8b9da227b59a6c23bca1c53b470
[21:17:26] dionysus69: second rescue block won't fire
[21:18:54] mikecmpbll: has joined #ruby
[21:20:27] futilegames: has joined #ruby
[21:22:18] centrx: dionysus69: Why are there two rescue blocks?
[21:23:11] dionysus69: centrx: just to handle two failures
[21:23:44] dionysus69: if one method fails I want to automatically do second one, and if that one also fails I want to ensure third block executes
[21:24:48] dionysus69: anyways i have seen online the use of rescue blocks , i just dont understand what's wrong with mine
[21:26:11] centrx: dionysus69: Probably multiple rescue blocks is only if they have different exception types
[21:26:32] centrx: dionysus69: It sounds like you want a second rescue within the rescue block, in which case it should have its own begin..rescue..end
[21:26:40] dionysus69: what do i do in case if I dont care about exception type
[21:26:45] dionysus69: i just know the script might break
[21:27:04] centrx: dionysus69: If you're planning to have your script break through multiple layers of errors, that sounds like a design flaw
[21:27:15] dionysus69: oh I see, but still vague on why the second rescue block wont just work :D
[21:27:30] centrx: dionysus69: Ultimately, don't use errors for control flow, check results and use if-statements, etc.
[21:27:32] dionysus69: well the second block is just for insurance, for fun
[21:27:52] dionysus69: i am building a website scraper and in case design structure changes i am implementing a fallback
[21:27:58] centrx: dionysus69: What's the error message?
[21:28:17] dionysus69: ok let me try rerun i ll post in a sek
[21:30:06] roamingdog: has joined #ruby
[21:30:19] dionysus69: first rescue, Unable to locate element: .navHeader_yr446gasd
[21:30:32] agundy: has joined #ruby
[21:30:56] roamingdog: has joined #ruby
[21:31:26] dionysus69: `assert_ok': Unable to locate element: #someelement (Selenium::WebDriver::Error::NoSuchElementError)
[21:31:56] dionysus69: centrx: do I do `rescue Selenium::WebDriver::Error::NoSuchElementError => error_message` ?
[21:31:57] roamingdog: has joined #ruby
[21:32:58] roamingdog: has joined #ruby
[21:32:59] GodFather: has joined #ruby
[21:33:20] jenrzzz: has joined #ruby
[21:33:20] jenrzzz: has joined #ruby
[21:33:24] dionysus69: well I just did it , and still didnt work
[21:33:29] skweek: has joined #ruby
[21:33:52] dionysus69: I have puts "*** warning second name fetching method failed"
[21:33:52] dionysus69: in second rescue block
[21:34:13] dionysus69: just to tell user that the script broke here
[21:34:43] dionysus69: my first rescue says: rescue StandardError => e
[21:34:50] dionysus69: and second rescue Selenium::WebDriver::Error::NoSuchElementError => error_message
[21:37:24] centrx: dionysus69: define "didn't work"
[21:37:38] dionysus69: instead of giving a second warning message
[21:38:06] dionysus69: it gave this error again Selenium::WebDriver::Error::NoSuchElementError
[21:38:13] dionysus69: with lots of other boilerplate error
[21:38:43] dionysus69: I want it to put a specific warning text with puts statement instead of crashing and puking all over terminal :D
[21:38:50] havenwood: dionysus69: In general, use `warn` rather than `puts` for error messages.
[21:39:10] havenwood: dionysus69: And there's `abort msg` instead of `warn msg; exit 1` as well
[21:40:19] havenwood: dionysus69: Like: abort 'Keyboard on fire.'
[21:40:40] havenwood: dionysus69: https://ruby-doc.org/core/Kernel.html#method-i-abort
[21:40:55] havenwood: dionysus69: https://ruby-doc.org/core/Kernel.html#method-i-warn
[21:41:05] dionysus69: abort wont execute either
[21:41:07] gizmore: has joined #ruby
[21:41:14] dionysus69: thing is it is not reaching second rescue block at all
[21:41:20] dionysus69: or else puts lines would execute
[21:41:27] gusrub: has joined #ruby
[21:41:30] havenwood: I'm just pointing out warn and abort as an aside.
[21:42:29] havenwood: dionysus69: the second rescue would rescue only from within the first
[21:43:34] dionysus69: now i get it stupid me
[21:43:42] dionysus69: i thought it would go like if else if else
[21:43:48] havenwood: dionysus69: you can nest begin within begin, but think about whether you need to
[21:43:59] havenwood: keep it as simple as you can
[21:44:07] dionysus69: now i get that if first block fails it jumps to the end
[21:46:00] mim1k: has joined #ruby
[21:47:00] zenspider: fucking hell... does rspec really do their own bullshit inspect code to introspect a failing expect/to/eq ???
[21:47:08] zenspider: it isn't using my inspect method OR my pretty_print method
[21:51:07] MetaQED: has joined #ruby
[21:54:44] MrBusiness: has joined #ruby
[21:55:26] weathermaker: has joined #ruby
[21:56:54] zenspider: holy hell... they do. So if you subclass array or hash, you're just screwed
[21:57:20] MetaQED: has left #ruby: ("Be back later...")
[22:00:51] tenderlove: has joined #ruby
[22:00:59] flaf: has joined #ruby
[22:04:42] _sfiguser: has joined #ruby
[22:06:34] ColeHub: has joined #ruby
[22:07:31] Str|ker: has joined #ruby
[22:07:34] Str|ker: has left #ruby: ()
[22:09:20] yxhuvud: that is true in many situations as calling methods on a subsclassed array or hash is more or less a tombola when it comes to what class the instance you get back is. hence few people do it and hence rspec can get away with it
[22:12:53] ecuanaso: has joined #ruby
[22:15:36] Dimik: has joined #ruby
[22:16:07] zenspider: Yxhuvud: no. just no. they implemented their own inspect, hardcoded 2 classes, and fall back to walking through INSPECTOR_CLASSES to see if any are applicable
[22:16:27] zenspider: you know what they could have done? not hardcoded any classes and put 2 more inspectors in the collection.
[22:16:30] gothicsouth: has joined #ruby
[22:16:53] zenspider: and WHY THE HELL DO THEY REIMPLEMENT (and externalize?!?) #inspect?!?
[22:16:56] jrm: has joined #ruby
[22:17:35] zenspider: (answer: because they *have* to reinvent the wheel)
[22:18:02] Rich_Morin_: has joined #ruby
[22:20:42] zenspider: https://github.com/rspec/rspec-support/blob/master/lib/rspec/support/object_formatter.rb#L56-L66
[22:25:35] bpmedley: has joined #ruby
[22:27:00] zenspider: fuuuuck I'm so pissed. how stupid
[22:27:41] Cohedrin: has joined #ruby
[22:27:43] zenspider: and I'm running this in docker, so I can't just go hack up the method
[22:27:48] zenspider: I guess I can do it in my test
[22:27:52] rfoust: has joined #ruby
[22:28:38] Rich_Morin__: has joined #ruby
[22:33:50] cschneid_: has joined #ruby
[22:38:31] bambanx: has joined #ruby
[22:39:54] jenrzzz: has joined #ruby
[22:39:55] jenrzzz: has joined #ruby
[22:52:55] mim1k: has joined #ruby
[22:55:33] ecuanaso: has joined #ruby
[22:56:30] HoierM: has joined #ruby
[22:59:01] howdoi: has joined #ruby
[23:06:06] bokayio: has joined #ruby
[23:08:56] mim1k: has joined #ruby
[23:12:51] Cohedrin: has joined #ruby
[23:13:09] centrx: has joined #ruby
[23:20:04] solos2: has joined #ruby
[23:22:22] gothicsouth: has joined #ruby
[23:24:01] raspado: has joined #ruby
[23:27:26] roamingdog: has joined #ruby
[23:30:15] solos2: has joined #ruby
[23:30:19] mim1k: has joined #ruby
[23:30:43] Cohedrin: has joined #ruby
[23:34:06] centrx: has joined #ruby
[23:34:07] centrx: has joined #ruby
[23:38:07] solos: has joined #ruby
[23:39:00] redaudit: has joined #ruby
[23:39:17] eightlimbed: has joined #ruby
[23:44:21] ur5us: has joined #ruby
[23:50:51] mim1k: has joined #ruby
[23:53:04] niao: has joined #ruby
[23:53:10] gja: has joined #ruby
[23:53:58] alveric1: has joined #ruby