« Back to channel list

#ruby - 29 June 2017

« Back 1 day Forward 1 day »
[00:00:48] Psy-Q: has joined #ruby
[00:06:07] amperry: pabs: https://gist.github.com/amp108/b070d190dac640dc6069bb9d1c11a2b2
[00:06:11] _whitelogger: has joined #ruby
[00:06:34] tfitts: has joined #ruby
[00:13:36] pabs: amperry: i'm looking at it now, do you have an example of the generated query?
[00:14:19] pabs: amperry: or is that what "sample.psql" is supposed to be?
[00:14:33] amperry: pabs: yeah, sample.psql
[00:14:44] amperry: it's a truncated version of the file, but you get the idea
[00:15:22] pabs: amperry: what i see in sample.psql is the quoted table name, if the table name is created unquoted elsewhere that will cause problems
[00:16:03] amperry: how do I get postgres to recognize it's all uppercase without the quotes?
[00:16:20] pabs: amperry: postgres implicitly lower-cases un-double-quoted identifer names, but if they are double-quoted then it leaves them alone
[00:16:42] pabs: amperry: i was going to suggest tweaking the queries to do one or the other, but not both
[00:17:03] pabs: amperry: (maybe adding another gsub in your patch-up gsub list)
[00:18:43] pabs: amperry: like i think you've got a CREATE TABLE OCCUPANTS ... somewhere in your source psql, and then later, the INSERT INTO "OCCUPANTS"
[00:19:49] amperry: pabs: that file actually says 'CREATE TABLE "OCCUPANTS" ( ...'
[00:19:54] pabs: amperry: without the double quotes the identifier in the CREATE TABLE statement will get implicitly lower-cased by postgres, but because of the double quotes in the INSERT statement the identifier won't be implicitly lower-cased, and you'd end up with the error above
[00:21:12] pabs: amperry: hey, uh
[00:21:14] pabs: what's up with this: pg.exec('set search_path to public;')
[00:21:52] Rodya_: has joined #ruby
[00:21:53] pabs: amperry: you're resetting the search path before executing each command
[00:22:05] amperry: grrr... I was testing something, but I think it's the same either way. Let me take that out and see.
[00:22:16] pabs: amperry: ok
[00:22:20] jenrzzz: has joined #ruby
[00:22:27] amperry: nope, taking that out changes nothing.
[00:23:29] amperry: the schema and the tables were created by calling '$ psql -u <user> < file.psql'
[00:25:27] pabs: amperry: is it just creates and inserts in teh source file, like could you do a .gsub(/(create table|insert into) "[^"]+"/, '\1 \2') to strip the quotes?
[00:25:30] amperry: I'm trying to write something that reads the files and creates/switches to the schema based on a command-line switch, so I don't have to manually go in to the (many) files and prepend 'create schema/set search_path' to them.
[00:26:13] amperry: well, since it's early in this project, I don't see any harm in trying that.
[00:27:42] amperry: (It's actually very late in the project, but early in this stage :)
[00:28:18] pabs: i missed a /i on my example:
[00:28:18] pabs: >> ['CREATE TABLE "foo"', 'insert into "foo"'].map { |v| v.gsub(/(create table|insert into) "([^"]+)"/i, '\1 \2') }
[00:28:19] ruby[bot]: pabs: # => ["CREATE TABLE foo", "insert into foo"] (https://eval.in/824038)
[00:28:21] pabs: => ["CREATE TABLE foo", "insert into foo"]
[00:28:52] jottr: has joined #ruby
[00:28:58] amperry: yeah, and a back reference... I'm fixing it :)
[00:31:11] pabs: amperry: also if you're looking for a replacement for mysql's AUTO_INCREMENT, you can use a serial in postgres
[00:31:24] pabs: amperry: (i just noticed the gsub(/AUTO_INCREMENT/, '')
[00:31:27] amperry: and, of course, some of the tables have spaces in their names; they're actually dumped from MS-access files. So that dies
[00:31:34] pabs: amperry: ugh
[00:31:41] amperry: pabs: you said it
[00:31:49] brent__: has joined #ruby
[00:32:03] pabs: amperry: well you can keep the names and just lower-case them
[00:32:54] Kug3lis: has joined #ruby
[00:32:57] amperry: yeah, and I suppose put underscores where the spaces are
[00:33:04] r3vDev: has joined #ruby
[00:33:06] pabs: that works too
[00:33:25] brent__: has joined #ruby
[00:33:35] SeepingN: spaces in table names is ridiculous
[00:33:57] amperry: but it still seems odd and frustrating that I can't get it to work with the quotes.
[00:34:06] amperry: but I guess I'll have to work around it
[00:34:10] SeepingN: it's like intentionally making things just a little more fragile
[00:34:34] pabs: amperry: they "work" with the double quotes, but with them postgres assumes you don't want it to implicitly lower case the identifier
[00:35:06] pabs: amperry: so the issue is mixing and matching, it either has to be double quotes everywhere (and consistent case in the table names), or not
[00:35:35] umaaji: has joined #ruby
[00:35:49] amperry: right, but in that case (quoting uppercase) it still says the relation doesn't exist, when it clearly does.
[00:36:34] amperry: but if I use the script to force lowercase, hrm... I have another utility that'll need that case-slamming .gsub as well.
[00:36:37] pabs: this should do what you want:
[00:36:38] pabs: >> ['CREATE TABLE "bar foo"', 'insert into "foo bar"'].map { |v| v.gsub(/(create table|insert into)\s+"([^"]+)"/i) { '%s %s' % [$1, $2.downcase.gsub(/\s+/, '_')] } }
[00:36:39] ruby[bot]: pabs: # => ["CREATE TABLE bar_foo", "insert into foo_bar"] (https://eval.in/824039)
[00:39:51] amperry: drat. I don't think it's going to work, unless I can find every 'SELECT ... FROM "TABLE NAME"/INNER JOIN "TABLE NAME"/LEFT JOIN "TABLE NAME"' and fix it.
[00:40:39] pabs: amperry: probably not, unless you want to go the other direction and make sure everything is using the exact same case for the table names
[00:40:53] pabs: amperry: i'll see if i can find an option to turn off that behavior, but i'm not aware of one
[00:41:25] Dimik: has joined #ruby
[00:41:29] amperry: that shouldn't be a problem. If I could use the uppercase names (loathsome thought they are), I would prefer that.
[00:42:03] railswebdev: has joined #ruby
[00:43:21] pabs: amperry: i don't see an option to disable that behavior in pg, i think you'll have to patch up the generated sql
[00:45:24] amperry: might be easier to write something that just sticks the right 'create schema/set search_path' statements at the front of these files and just run them through '$ psql -u <user> < file.psql'
[00:45:54] pabs: possibly, yeah
[00:49:49] Trynemjoel: has joined #ruby
[00:55:23] qakqed: has joined #ruby
[00:58:34] bkxd: has joined #ruby
[00:59:18] bkxd_: has joined #ruby
[00:59:30] amperry: aaaaand somehow, through all of that massaging of my stage_legacy.rb file, it now works with double-quoted uppercase table names with spaces. So who knows?
[01:01:09] __Yiota: has joined #ruby
[01:01:58] johnny56: has joined #ruby
[01:14:29] patarr: has joined #ruby
[01:15:20] ur5us: has joined #ruby
[01:18:29] railswebdev: has joined #ruby
[01:18:59] mydog2: has joined #ruby
[01:22:52] rfoust: has joined #ruby
[01:23:59] brent__: has joined #ruby
[01:26:20] mim1k: has joined #ruby
[01:28:15] caral: has joined #ruby
[01:28:23] isBEKaml: has joined #ruby
[01:29:49] jottr: has joined #ruby
[01:29:54] cyphase: has joined #ruby
[01:38:06] FastJack: has joined #ruby
[01:39:08] grymmjack: has joined #ruby
[01:43:54] jak: has joined #ruby
[01:44:00] d^sh_: has joined #ruby
[01:48:51] Cohedrin_: has joined #ruby
[01:52:23] railswebdev: has joined #ruby
[01:53:03] gizmore: has joined #ruby
[01:55:08] FastJack: has joined #ruby
[01:58:01] cdg: has joined #ruby
[01:58:09] comet23: has joined #ruby
[01:58:33] comet23: what method can i use to see if the input is an integer besides to_i?
[01:59:33] comet23: basically, i'm working with a string that's being inputed as a number, this is for a tic tac toe game, but the problem i'm having is that if the input is a letter converting it using to_i will output an integer of 0 and i'm working with arrays and this method is supposed to take a number and subtract 1 from it to return the correct index
[01:59:54] elomatreb: Kernel#Integer is your friend, it will error on invalid strings
[02:00:40] comet23: so Integer(input, base)?
[02:00:59] elomatreb: base is optional and defaults to 10, but yes
[02:01:16] elomatreb: Or, rather, it does heuristics with base prefixes
[02:01:19] comet23: def input_to_index(input)
[02:03:23] mydog2: has joined #ruby
[02:04:59] comet23: how can i make it not error out but give me a negative value like -1?
[02:05:03] uZiel: has joined #ruby
[02:07:15] elomatreb: comet23: Use a rescue block
[02:13:01] comet23: so just use a rescue keyword before the variable?
[02:13:14] comet23: rescue index = Integer(input)
[02:13:57] swills: has joined #ruby
[02:16:07] elomatreb: comet23: https://ruby-doc.org/core-2.4.1/doc/syntax/exceptions_rdoc.html
[02:16:48] V1s1ble: has joined #ruby
[02:17:49] umaaji: has joined #ruby
[02:18:37] comet23: https://repl.it/JGcO/1
[02:18:45] comet23: is that a good method?
[02:20:34] elomatreb: comet23: This is how you can simplify it: https://gist.github.com/elomatreb/d35c4f6882a0653a0e5a134240b697c2
[02:20:53] elomatreb: 1. Methods have an implicit begin block, so you can just use rescue without at that level
[02:21:04] elomatreb: 2. Return is optional, the last evaluated value will be returned
[02:21:21] comet23: no i need to subtract 1 from the input
[02:21:24] comet23: to get the array index
[02:21:33] elomatreb: 3. You should always specificy what exception you want to handle, since otherwise you might end up silencing other errors from your code
[02:21:49] comet23: but the last thing evaluated will be returned yes, but if i use the return explicitly i won't have the code that's at the bottom of the method run
[02:22:01] V1s1ble: So I'm trying to figure out how to do this functionally: https://gist.github.com/sumdog/e4b556af98a8ce0f902b6a158b60159a
[02:22:39] elomatreb: comet23: So you want a method that given a string converts it to an Integer and subtracts 1 from it. What should it do on invalid input?
[02:26:44] comet23: on invalid input it should return -1
[02:26:59] elomatreb: V1s1ble: Take a look at Enumerable#group_by
[02:27:04] comet23: on valid input it should subtract 1 and return the new value
[02:27:13] havenwood: >> Integer 'comet23' rescue -1
[02:27:15] ruby[bot]: havenwood: # => -1 (https://eval.in/824061)
[02:27:39] havenwood: comet23: Wouldn't that then work with #to_i? Since 0 minus 1 is -1?
[02:27:51] havenwood: comet23: Just subtract one, since you do it in both cases?
[02:28:00] elomatreb: ^ that's an elegant solution
[02:28:17] comet23: that's not elegant at all
[02:28:22] comet23: puts "#{$!} (#{$!.class})"
[02:28:22] comet23: $stdout.flush
[02:28:27] comet23: what's all that junk?
[02:28:45] havenwood: comet23: You tell us?
[02:28:49] comet23: i don't know
[02:28:53] elomatreb: That's from the bot. Only the part in the begin is interesting to you.
[02:30:16] havenwood: >> comet23 = ->(s) { s.to_i.pred }; [comet23.('nerp'), comet23.('42')]
[02:30:17] ruby[bot]: havenwood: # => [-1, 41] (https://eval.in/824062)
[02:30:56] jottr: has joined #ruby
[02:31:04] matthewd: I'm not sure I'd call anything that returns -1 on invalid input an elegant solution, but that's a higher level concern ¯\_(ツ)_/¯
[02:31:37] elomatreb: semi-related: I wish you could specify an error class with the modifier rescue, so often a rescue block is just "return this value instead"
[02:31:48] elomatreb: But I don't feel comfortable just rescuing everything
[02:32:10] havenwood: matthewd: rails blarg; echo $? #=> 1
[02:32:14] havenwood: matthewd: ;-)
[02:32:21] charliesome: has joined #ruby
[02:32:55] matthewd: havenwood: See? Rails does it, ergo not elegant. QED. ;)
[02:33:03] havenwood: matthewd: haha, touche
[02:33:13] uZiel: has joined #ruby
[02:36:29] railswebdev: has joined #ruby
[02:37:08] Jameser: has joined #ruby
[02:45:49] FastJack: has joined #ruby
[02:46:51] patarr: has joined #ruby
[02:48:28] perniciouscaffei: has joined #ruby
[02:49:09] astrobunny: has joined #ruby
[03:03:49] shinnya: has joined #ruby
[03:08:45] DrCode: has joined #ruby
[03:09:55] railswebdev: has joined #ruby
[03:11:59] rubylegend_: has joined #ruby
[03:12:05] ledestin: has joined #ruby
[03:13:27] jak: has joined #ruby
[03:13:44] nobitanobi: has joined #ruby
[03:15:50] enterprisey: has joined #ruby
[03:21:33] cam27: has joined #ruby
[03:23:48] V1s1ble: elomatreb, cool thanks. So I can get to this: [{"example.net"=>"brit"}, {"example.net"=>"foo.brit"}, {"bob.com"=>""}]
[03:24:46] V1s1ble: if I take that and use group_by { |o| o }, I get the entire dictionary as what it's grouped by, o[0] gives me a nil pointing to an array of hashes
[03:26:13] elomatreb: I'm not sure I follow, I'd start with something like this: https://eval.in/824067
[03:26:45] elomatreb: Then I'd probably use transform_values and map to remove the domain suffix from the entries in the array
[03:26:47] mim1k: has joined #ruby
[03:27:16] __Yiota: has joined #ruby
[03:28:54] zacts: has joined #ruby
[03:31:34] Tau: has joined #ruby
[03:31:41] jottr: has joined #ruby
[03:33:12] cyphase: has joined #ruby
[03:34:06] mydog2: has joined #ruby
[03:34:19] elomatreb: V1s1ble: Not exactly beautiful but it meets your spec: https://eval.in/824077
[03:34:41] __Yiota: has joined #ruby
[03:38:27] elomatreb: Cleaner version: https://eval.in/824079
[03:39:20] jakk: has joined #ruby
[03:40:36] johnny56: has joined #ruby
[03:47:56] agent_white: has joined #ruby
[03:50:06] railswebdev: has joined #ruby
[03:55:52] gix: has joined #ruby
[04:13:40] pecan: has joined #ruby
[04:14:11] kies: has joined #ruby
[04:15:28] GinoMan2440: has joined #ruby
[04:16:27] comet23_: has joined #ruby
[04:30:11] _whitelogger: has joined #ruby
[04:32:21] cdg_: has joined #ruby
[04:32:25] jottr: has joined #ruby
[04:34:02] charliesome: has joined #ruby
[04:38:59] mim1k: has joined #ruby
[04:41:34] mogaj: has joined #ruby
[04:43:27] jakk: has joined #ruby
[04:44:58] cadillac_: has joined #ruby
[04:47:34] perniciouscaffei: has joined #ruby
[04:47:45] patarr: has joined #ruby
[04:50:42] mogaj: has joined #ruby
[04:52:18] domgetter: has joined #ruby
[04:54:23] jakk: has joined #ruby
[05:00:52] arescorpio: has joined #ruby
[05:02:38] ddddddd: has joined #ruby
[05:07:42] DrCode: has joined #ruby
[05:10:29] beilabs_: has joined #ruby
[05:23:51] agrecascino: has joined #ruby
[05:23:54] cdg: has joined #ruby
[05:24:10] agrecascino: is it possible to run bootsnap as a non-root user
[05:24:35] agrecascino: or maybe this is a danbooru related issue
[05:25:31] agrecascino: the point is that bootsnap-cache is in a place the user i'm currently running as can't access
[05:28:18] charliesome: has joined #ruby
[05:33:10] jottr: has joined #ruby
[05:39:05] anisha: has joined #ruby
[05:40:47] brent__: has joined #ruby
[05:41:18] brent__: has joined #ruby
[05:42:11] enterprisey: has joined #ruby
[05:43:07] brent__: has joined #ruby
[05:43:43] gothicsouth: has joined #ruby
[05:48:48] brent__: has joined #ruby
[05:50:43] TomyLobo: has joined #ruby
[06:00:18] Rodya_: has joined #ruby
[06:09:58] cyphase: has joined #ruby
[06:14:17] uZiel: has joined #ruby
[06:16:37] Mortomes|Work: has joined #ruby
[06:20:33] dionysus69: has joined #ruby
[06:27:09] r3vDev: has joined #ruby
[06:28:46] conta: has joined #ruby
[06:33:39] iMadper: has joined #ruby
[06:33:55] jottr: has joined #ruby
[06:35:51] mogaj: has joined #ruby
[06:37:43] V1s1ble: elomatreb, That is awesome man. Works perfectly.
[06:39:34] ascarter: has joined #ruby
[06:43:28] jakk: has joined #ruby
[06:44:28] charliesome: has joined #ruby
[06:44:38] valentin: has joined #ruby
[06:44:41] rgr: has joined #ruby
[06:48:13] patarr: has joined #ruby
[06:49:47] R11: has joined #ruby
[06:50:57] aufi: has joined #ruby
[06:51:56] al2o3-cr: has joined #ruby
[06:58:25] jottr: has joined #ruby
[07:00:04] cdg_: has joined #ruby
[07:00:34] umaaji: has joined #ruby
[07:01:02] TomyWork: has joined #ruby
[07:01:26] jakk: has joined #ruby
[07:02:02] gwilkes: has joined #ruby
[07:02:34] Rodya_: has joined #ruby
[07:03:28] Mia: has joined #ruby
[07:03:28] Mia: has joined #ruby
[07:09:44] Silthias: has joined #ruby
[07:12:08] bkxd_: has joined #ruby
[07:13:36] psychicist__: has joined #ruby
[07:15:01] sysvalve: has joined #ruby
[07:15:12] nobitanobi: has joined #ruby
[07:17:37] Ishido: has joined #ruby
[07:20:00] dyjakan: has joined #ruby
[07:22:22] aupadhye: has joined #ruby
[07:25:51] ByronJohnson: has joined #ruby
[07:26:01] charliesome: has joined #ruby
[07:27:29] Stan: has joined #ruby
[07:28:14] nofxxx: has joined #ruby
[07:28:46] andikr: has joined #ruby
[07:29:36] DrCode: has joined #ruby
[07:32:47] antgel: has joined #ruby
[07:36:44] zenspider_: has joined #ruby
[07:39:46] Stan: has joined #ruby
[07:40:44] zapata: has joined #ruby
[07:43:45] charliesome: has joined #ruby
[07:47:11] mogaj: has joined #ruby
[07:48:14] ascarter: has joined #ruby
[07:53:34] tAn: has joined #ruby
[07:56:06] bkxd: has joined #ruby
[07:56:16] bkxd_: has joined #ruby
[07:57:00] nixmaniack: has joined #ruby
[07:59:19] dangerousdave: has joined #ruby
[07:59:49] mikecmpbll: has joined #ruby
[08:00:36] jottr: has joined #ruby
[08:01:04] postmodern_: has joined #ruby
[08:02:51] adgtl: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[08:03:04] Rodya_: has joined #ruby
[08:08:29] alex``: has joined #ruby
[08:08:46] MasterNayru_: has joined #ruby
[08:09:03] syndikate: has joined #ruby
[08:09:54] znz_jp: has joined #ruby
[08:11:20] djbkd: has joined #ruby
[08:13:31] cdg: has joined #ruby
[08:17:19] mim1k: has joined #ruby
[08:21:33] aufi: has joined #ruby
[08:24:47] ferr: has joined #ruby
[08:25:03] marr: has joined #ruby
[08:26:19] rrawlins: has joined #ruby
[08:26:53] kruppm: has joined #ruby
[08:28:25] quobo: has joined #ruby
[08:29:19] im314ous: has joined #ruby
[08:29:20] charliesome: has joined #ruby
[08:32:07] lxsameer: has joined #ruby
[08:36:48] dminuoso: elomatreb: I have spent the entire evening thinking about it.
[08:37:05] elomatreb: About the Range thing?
[08:37:32] mim1k: has joined #ruby
[08:37:34] elomatreb: Any ideas? I gave up pretty quickly
[08:37:35] dminuoso: Couldn't find a way to cut even a single instruction away.
[08:38:08] Serpent7776: has joined #ruby
[08:39:04] dminuoso: elomatreb: I did it!
[08:39:11] dminuoso: It just hit me, one instruction less.
[08:39:16] dminuoso: elomatreb: https://eval.in/824261
[08:40:56] elomatreb: I didn't even think in that direction
[08:41:51] dminuoso: elomatreb: Hehe. I spent all evening trying to avoid the extra stack frame which seemed impossible.
[08:42:09] dminuoso: (And thus avoiding an unnecessary trace and leave ins)
[08:42:18] dminuoso: But I couldnt make it work in that few instructions
[08:43:23] jakk: has joined #ruby
[08:43:34] dminuoso: elomatreb: Of course it can be argued that sprintf will be slower since it has to dispatch an actual method first (whereas "a#{b}c" has optimized instructions) - but the goal was to reduce the number of instructions.
[08:44:55] nobitanobi: has joined #ruby
[08:49:00] dangerousdave: has joined #ruby
[08:49:12] patarr: has joined #ruby
[08:51:01] TheBloke: has joined #ruby
[08:54:33] aufi: has joined #ruby
[08:56:10] TheBloke: has joined #ruby
[08:56:30] sjums: has joined #ruby
[08:56:44] Beams: has joined #ruby
[08:57:06] jaruga_________: has joined #ruby
[09:00:23] elsevero: has joined #ruby
[09:01:23] jottr: has joined #ruby
[09:03:51] Rodya_: has joined #ruby
[09:07:26] Asher: has joined #ruby
[09:08:58] pandaant: has joined #ruby
[09:14:27] cdg: has joined #ruby
[09:21:57] im0nde: has joined #ruby
[09:24:19] sepp2k: has joined #ruby
[09:25:21] Beams: has joined #ruby
[09:31:54] Aloy: has joined #ruby
[09:32:00] ionte_: has joined #ruby
[09:40:09] piyush: has joined #ruby
[09:41:01] piyush: i am working on a project dealing with code smells in ruby
[09:41:30] piyush: can someone please tell me where the syntax rules for the ruby compiler can be found?
[09:42:24] dminuoso: piyush: https://github.com/ruby/ruby/blob/trunk/parse.y
[09:42:31] dminuoso: piyush: Pick the proper commit for your revision.
[09:44:03] dminuoso: piyush: The bison part in the first half of it mostly. The second half in that file is just the hackish lexer.
[09:44:42] dminuoso: Unsure how that related to code smells though
[09:48:23] astrobunny: has joined #ruby
[09:51:12] piyush: thanks @dminuoso
[09:53:37] tgragnato: has joined #ruby
[09:56:24] ascarter: has joined #ruby
[09:57:10] jaruga________: has joined #ruby
[09:57:32] tgragnato_: has joined #ruby
[10:01:55] czerasz: has joined #ruby
[10:02:06] jottr: has joined #ruby
[10:04:49] Rodya_: has joined #ruby
[10:15:11] cdg: has joined #ruby
[10:23:01] czerasz: has joined #ruby
[10:23:38] Fernando-Basso: has joined #ruby
[10:30:41] nixmaniack: has joined #ruby
[10:32:11] zenspider_: piyush: have you seen reek and other similar projects?
[10:32:12] nixmaniack: has joined #ruby
[10:32:32] zenspider: has joined #ruby
[10:32:39] anisha: has joined #ruby
[10:33:10] rohitpaulk: has joined #ruby
[10:41:23] charliesome: has joined #ruby
[10:43:24] jakk: has joined #ruby
[10:43:59] mogaj: has joined #ruby
[10:46:00] rohitpaulk: has joined #ruby
[10:46:43] octomancer: hi, i have an array, a1, and i want to append the values from another array, b1. the best i can come up with after looking at the docs for the Array Class is this: a1.push(b1).flatten!
[10:46:54] octomancer: but that seems inelegant
[10:47:12] octomancer: i think there is a more ruby way to do it, can anyone elighten me please?
[10:47:25] elomatreb: octomancer: a1.concat b1
[10:47:46] octomancer: how did i miss concat?! dur
[10:50:11] patarr: has joined #ruby
[10:51:31] bkxd_: has joined #ruby
[10:57:31] kruppm: has joined #ruby
[11:00:30] vali: has left #ruby: ()
[11:02:50] jottr: has joined #ruby
[11:05:24] Rodya_: has joined #ruby
[11:05:29] charliesome: has joined #ruby
[11:09:14] gwilkes: has joined #ruby
[11:15:44] mim1k: has joined #ruby
[11:20:35] ged: has joined #ruby
[11:25:40] minimalism: has joined #ruby
[11:26:36] mahlon: has joined #ruby
[11:29:30] OS-28295: has joined #ruby
[11:30:24] OS-28295: Hello guys : when i try to install a packet i have this error : ] exec: gem install ruby-oci8
[11:30:24] OS-28295: ERROR: Could not find a valid gem 'ruby-oci8' (>= 0), here is why:
[11:30:24] OS-28295: Unable to download data from https://rubygems.org - SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
[11:30:24] OS-28295: ; However when I type gem sources:
[11:30:24] OS-28295: https://rubygems.org
[11:30:26] OS-28295: it's present ! ... Any ideas quys ?
[11:31:55] agent_white: Update dudes allowed
[11:31:57] agent_white: http://guides.rubygems.org/ssl-certificate-update/
[11:34:55] OS-28295: thks agent_white i will have a look
[11:35:25] roshanavand: has joined #ruby
[11:35:28] runescape07rsps: has joined #ruby
[11:42:29] gnufied: has joined #ruby
[11:43:57] ldnunes: has joined #ruby
[11:43:58] VladGh: has joined #ruby
[11:47:10] patarr: has joined #ruby
[11:49:45] OS-28295: agent_white, thanks but still I have some trouble the ruby-oci8 don't want to install. Is there is any things that I should be aware ? why it does not work ?
[11:53:28] _2easy: has joined #ruby
[11:57:48] z3uS: has joined #ruby
[12:01:15] nixmaniack: has joined #ruby
[12:01:56] ascarter: has joined #ruby
[12:02:05] synthroid: has joined #ruby
[12:02:23] Patadas: has joined #ruby
[12:03:35] jottr: has joined #ruby
[12:06:07] Rodya_: has joined #ruby
[12:07:04] czerasz: has joined #ruby
[12:08:15] synthroid: has joined #ruby
[12:08:26] dionysus70: has joined #ruby
[12:09:22] antgel: has joined #ruby
[12:11:30] im0nde: has joined #ruby
[12:12:05] rohitpaulk: has joined #ruby
[12:13:27] jakk: has joined #ruby
[12:17:00] synthroid: has joined #ruby
[12:19:17] pavelz: has joined #ruby
[12:19:37] pavelz: how does one call @var when it is created in global space?
[12:19:45] pavelz: as opposed to var
[12:19:59] mniip: has joined #ruby
[12:20:21] pavelz: just curious
[12:21:39] charliesome: has joined #ruby
[12:24:20] Ishido: has joined #ruby
[12:24:44] elomatreb: pavelz: Methods you define and instance variables you set outside of a class are on Object
[12:24:57] elomatreb: So it's still an instance variable, just not a very useful one
[12:27:59] dropsh0t: has joined #ruby
[12:29:39] joast: has joined #ruby
[12:33:12] __Yiota: has joined #ruby
[12:35:18] OS-28295: has left #ruby: ("Leaving")
[12:37:19] dropsh0t: has joined #ruby
[12:37:55] millerti: has joined #ruby
[12:38:45] roamingdog: has joined #ruby
[12:41:09] dropsh0t: has left #ruby: ()
[12:42:58] TomyWork: has joined #ruby
[12:43:48] splitshot: has joined #ruby
[12:50:33] dminuoso: pavelz: Ruby has no global space.
[12:50:40] mim1k: has joined #ruby
[12:50:53] dminuoso: pavelz: To understand why would help you here.
[12:51:42] dminuoso: Well it does through $ variables.
[12:52:19] chimkan: has joined #ruby
[12:52:36] anisha: has joined #ruby
[12:56:10] nixmaniack: has joined #ruby
[12:58:43] Rodya_: has joined #ruby
[13:03:54] uZiel: has joined #ruby
[13:04:24] jottr: has joined #ruby
[13:05:56] anisha: has joined #ruby
[13:06:06] itsautomatisch: has joined #ruby
[13:08:42] tvw: has joined #ruby
[13:11:11] pier: has joined #ruby
[13:13:49] cseder: has joined #ruby
[13:15:10] nixmaniack: has joined #ruby
[13:15:19] rohitpaulk: has joined #ruby
[13:15:31] romank: has joined #ruby
[13:16:43] rfoust: has joined #ruby
[13:19:00] cam27: has joined #ruby
[13:23:26] shinnya: has joined #ruby
[13:25:34] jphase: has joined #ruby
[13:25:42] mim1k: has joined #ruby
[13:27:25] charliesome: has joined #ruby
[13:27:53] simmaniac: has joined #ruby
[13:31:51] DLSteve: has joined #ruby
[13:35:31] cdg: has joined #ruby
[13:39:47] DoubleMalt: has joined #ruby
[13:41:32] skweek: has joined #ruby
[13:45:02] Mia: has joined #ruby
[13:45:03] Mia: has joined #ruby
[13:45:43] dionysus69: has joined #ruby
[13:47:12] ltem: has joined #ruby
[13:47:21] mogaj: has joined #ruby
[13:48:30] __Yiota: has joined #ruby
[13:49:52] Rodya_: has joined #ruby
[13:52:07] mogaj: has joined #ruby
[13:53:17] ujjain: has joined #ruby
[13:53:17] ujjain: has joined #ruby
[13:55:04] glcx: has joined #ruby
[13:55:13] roshanavand: has joined #ruby
[13:57:31] patarr: has joined #ruby
[13:59:41] railswebdev: has joined #ruby
[14:04:05] ascarter: has joined #ruby
[14:04:19] brent__: has joined #ruby
[14:05:10] brent__: has joined #ruby
[14:05:29] jottr: has joined #ruby
[14:08:43] dcunit3d: has joined #ruby
[14:08:50] chouhoulis: has joined #ruby
[14:13:23] jakk: has joined #ruby
[14:16:16] bkxd: has joined #ruby
[14:18:24] rohitpaulk: has joined #ruby
[14:19:39] Nahra: has joined #ruby
[14:24:46] ResidentBiscuit: has joined #ruby
[14:28:04] savoir-faire: has joined #ruby
[14:28:10] aglorei: has joined #ruby
[14:29:30] __Yiota: has joined #ruby
[14:31:15] Cork: i'm using bundler + rvm in system wide installation, but Gemfiles with github references doesn't work
[14:31:20] Cork: anyone know how to get around that?
[14:34:09] bkxd: has joined #ruby
[14:35:19] dminuoso: Cork: What does "doesn't work" mean
[14:36:12] Cork: dminuoso: every user other then root gets The git source <url> is not yet checked out. Please run `bundle install` before trying to start your application
[14:36:30] Cork: the normal gems works but none of the git or github link ones
[14:38:22] brent__: has joined #ruby
[14:39:25] dminuoso: Cork: what does your bundle env look like?
[14:39:32] brent__: has joined #ruby
[14:40:18] Cork: dminuoso: it lists GIT ... and the git repos if that is what you mean
[14:40:31] canton7: ah, wrong channel
[14:40:31] dminuoso: Cork: !gist
[14:40:36] ruby[bot]: Cork: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[14:40:38] gizmore: has joined #ruby
[14:41:34] Cork: heh ya working on it https://paste.debian.net/plain/973932
[14:41:58] Cork: thats just one of the projects though
[14:42:01] Cork: this is cross the board
[14:42:10] Cork: similar gemfiles and setup though
[14:42:25] dminuoso: Cork: What happens if you replace the github with a plain git reference?
[14:42:33] Cork: let me try
[14:42:48] Cork: it didn't work last time i tried, but i'm updated bundler since then
[14:43:49] dminuoso: Cork: And please also give the same output of bundle env when you use root instead.
[14:44:46] Phage: has joined #ruby
[14:45:23] Cork: huh... insteresting
[14:45:29] Cork: git: links works
[14:45:48] dminuoso: Cork: file a bug report then.
[14:46:28] Cork: dminuoso: thx a bunch for the help messing around with this on and off for close to a month now
[14:46:48] dminuoso: Cork: Should have asked for a months salary before I helped.
[14:48:10] jottr: has joined #ruby
[14:51:19] mim1k: has joined #ruby
[14:52:00] nixmaniack: has joined #ruby
[14:52:00] nixmaniack: has joined #ruby
[14:52:09] kolgomorov: has joined #ruby
[14:54:03] snowcrshd: has joined #ruby
[14:55:06] antgel: has joined #ruby
[14:58:56] papelycarton: has joined #ruby
[15:00:32] papelycarton: Hello. What would be the difference between making a HTTP request setting OpenSSL::SSL::VERIFY_PEER on with and without a CA file?
[15:03:33] dminuoso: papelycarton: Depends, what interface are you using?
[15:04:50] papelycarton: dminuoso: I'm using Net::HTTP
[15:06:11] dminuoso: papelycarton: Okay. Can you give me a specific code example where you specify the "CA file" so that we're on the same page?
[15:07:21] oleo: has joined #ruby
[15:07:27] djbjd: has joined #ruby
[15:07:55] cseder: has joined #ruby
[15:08:04] papelycarton: dminuoso: here, for example https://www.theguild.nl/ruby-and-ssl-certificate-validation/.
[15:08:22] weinstein: has joined #ruby
[15:09:39] dminuoso: papelycarton: Ah, so "ca_path" is slightly misleading. Essentially TLS relies on a chain of certificates. But the root certificates must be implicitly trusted.
[15:10:47] dminuoso: papelycarton: All OS (and browsers can bring their own too) have a set of pre-installed root certificates. If you want to trust a specific (root) certificate without exposing it to the entire OS, you can use ca_file for this it looks like.
[15:10:59] dminuoso: (i.e. a specific (root) certificate that is _not_ on your OS)
[15:11:46] papelycarton: dminuoso: so if I don't specify a root CA Ruby will trust the certificates that are on the OS?
[15:12:09] dminuoso: papelycarton: Yeah.
[15:12:11] bkxd: has joined #ruby
[15:12:25] papelycarton: dminuoso: thank you :)
[15:12:41] centrx: has joined #ruby
[15:12:42] centrx: has joined #ruby
[15:14:18] tvw: has joined #ruby
[15:14:59] cschneid_: has joined #ruby
[15:16:00] enterprisey: has joined #ruby
[15:16:06] cevett: has joined #ruby
[15:16:56] mogaj: has joined #ruby
[15:21:17] hightower2: has joined #ruby
[15:22:41] anisha: has joined #ruby
[15:23:01] Rodya_: has joined #ruby
[15:26:32] nadir: has joined #ruby
[15:26:48] patarr: has joined #ruby
[15:35:33] bed7: has joined #ruby
[15:35:40] brent__: has joined #ruby
[15:36:12] anisha_: has joined #ruby
[15:37:38] mim1k: has joined #ruby
[15:39:32] cbyrda: has joined #ruby
[15:40:04] Brent___: has joined #ruby
[15:44:23] SteenJobs: has joined #ruby
[15:44:36] enterprisey: has joined #ruby
[15:44:55] SteenJobs: has joined #ruby
[15:47:02] chimkan: has joined #ruby
[15:47:05] t-recx: has joined #ruby
[15:48:43] perniciouscaffei: has joined #ruby
[15:49:39] rohitpaulk: has joined #ruby
[15:51:56] itsautomatisch: has joined #ruby
[15:54:34] troys: has joined #ruby
[15:55:13] jokke: i'm trying to install ruby 2.0.0 on arch
[15:55:20] jokke: but i'm having several issues
[15:55:41] jokke: openssl i figured out but now the build fails with parse.c:4720:16: error: too few arguments to function ‘yylex’
[15:56:58] jokke: any ideas?
[15:58:41] __Yiota: has joined #ruby
[16:00:37] ddddddd: has joined #ruby
[16:00:53] DaveTaboola: has joined #ruby
[16:01:19] yxhuvud: has joined #ruby
[16:04:36] mim1k: has joined #ruby
[16:06:51] bkxd: has joined #ruby
[16:07:05] dviola: has joined #ruby
[16:07:07] amclain: has joined #ruby
[16:07:09] ascarter: has joined #ruby
[16:07:23] skinnymg1: has joined #ruby
[16:07:57] conta: has joined #ruby
[16:09:39] dcunit3d: has joined #ruby
[16:12:28] Ryzokuken: has joined #ruby
[16:13:26] jakk: has joined #ruby
[16:16:07] griffindy: has joined #ruby
[16:17:44] isBEKaml: has joined #ruby
[16:19:39] GinoMan2440: has joined #ruby
[16:21:49] darix: jokke: now that is a quiet old version
[16:21:59] davidmichaelkarr: has joined #ruby
[16:22:02] marr: has joined #ruby
[16:22:06] darix: jokke: especially when you start using openssl 1.1 you will need to do a lot of backporting
[16:22:32] jokke: but it's not an openssl issue
[16:23:20] jokke: i'll just use my oldest 2.x version and hope for the best
[16:23:51] charliesome: has joined #ruby
[16:24:07] [Butch]: has joined #ruby
[16:24:39] WhatsGoi`: has joined #ruby
[16:26:22] tvw: has joined #ruby
[16:29:51] mhib: has joined #ruby
[16:30:39] weinstei1: has joined #ruby
[16:33:59] Tau: has joined #ruby
[16:34:52] HoierM: has joined #ruby
[16:35:43] WhatsGoi`: has joined #ruby
[16:37:37] blackwind_123: has joined #ruby
[16:37:41] Dimik: has joined #ruby
[16:38:52] uZiel: has joined #ruby
[16:39:53] Neptu: has joined #ruby
[16:41:49] konsolebox: has joined #ruby
[16:42:53] cadillac__: has joined #ruby
[16:43:20] turtlekitten: has joined #ruby
[16:49:05] gdonald: has left #ruby: ("Leaving")
[16:49:30] preisform: has joined #ruby
[16:50:15] turtlekitten: Hey, Rubyists. Having a little problem: I can't seem to deserialize a Rack::Utils::HeaderHash with my latest upgrade (Ruby 2.4.1 and Rack 2.0.3). It worked fine under 2.2.4. Any ideas?
[16:50:17] turtlekitten: https://gist.github.com/TurtleKitty/e129eb30fe3359229645a431cf9e1939
[16:52:51] preisfor2: has joined #ruby
[16:56:21] romain_t: has joined #ruby
[16:57:02] synthroid: has joined #ruby
[16:57:14] ericnw: has joined #ruby
[17:02:38] hkdsun: has joined #ruby
[17:03:26] preisfor3: has joined #ruby
[17:05:40] TomyLobo: has joined #ruby
[17:05:53] pavelz: is there a server ssh implementation for ruby ?
[17:06:04] pavelz: not the client ie net::ssh
[17:06:32] apeiros: you mean an sshd? I thought net/ssh had one.
[17:07:56] al2o3-cr: has joined #ruby
[17:09:03] apeiros: pavelz: else https://github.com/jammi/net-sshd looks like one
[17:09:31] apeiros: oh, "just a crude hack". well…
[17:09:47] GinoMan1423: has joined #ruby
[17:10:15] matthewd: Seems like the sort of thing I'd rather leave to a well-known implementation, personally
[17:11:08] apeiros: good point
[17:11:27] SeepingN: has joined #ruby
[17:11:29] apeiros: but I guess it depends on the intent. if it's to learn how the internals work it might be useful.
[17:11:52] turtlekitten: has left #ruby: ()
[17:12:06] preisfor4: has joined #ruby
[17:12:14] runescape07rsps: has joined #ruby
[17:14:52] agimenez: has joined #ruby
[17:16:18] kies: has joined #ruby
[17:19:36] turtlekitten: has joined #ruby
[17:19:45] turtlekitten: has left #ruby: ()
[17:24:34] turtlekitten2: has joined #ruby
[17:25:26] turtlekitten2: I'll leave this window open in case anyone has any ideas whilst I'm away. Kinda baffled by this one. https://gist.github.com/TurtleKitty/e129eb30fe3359229645a431cf9e1939
[17:25:28] N0ATN: has joined #ruby
[17:28:12] apeiros: turtlekitten2: are you trying to load a serialized hash from an earlier version in this version?
[17:28:25] apeiros: or did you serialize and deserialize with the current version?
[17:31:27] perniciouscaffei: has joined #ruby
[17:37:51] pavelz: apeiros: thanks!
[17:39:03] pavelz: apeiros: well a place to start I guess
[17:39:35] gix-: has joined #ruby
[17:39:44] Cohedrin_: has joined #ruby
[17:40:03] matthewd: pavelz: Are you trying to learn the protocol, or are you trying to implement a service? If the latter, I really recommend using openssh.
[17:40:33] Tau: has joined #ruby
[17:41:27] gix: has joined #ruby
[17:42:31] machinewar: has joined #ruby
[17:43:06] Ferdroid: has left #ruby: ()
[17:43:38] chimkan: has joined #ruby
[17:43:59] machinewar: has left #ruby: ()
[17:46:53] pavelz: matthewd: thanks!
[17:47:03] pavelz: yeah bit of both a pet project
[17:47:24] daed: has joined #ruby
[17:48:57] rohitpaulk: has joined #ruby
[17:55:09] ldnunes: has joined #ruby
[17:56:13] centrx: has joined #ruby
[18:00:26] chimkan: has joined #ruby
[18:01:21] simmaniac: has joined #ruby
[18:02:58] jottr: has joined #ruby
[18:05:26] haylon: has joined #ruby
[18:05:46] gix: has joined #ruby
[18:05:56] montanonic: has joined #ruby
[18:06:13] Cohedrin_: has joined #ruby
[18:07:15] bed1: has joined #ruby
[18:07:16] wilbert: has joined #ruby
[18:09:59] _sfiguser: has joined #ruby
[18:11:26] ascarter: has joined #ruby
[18:12:21] tvon: has joined #ruby
[18:12:35] BSaboia: has joined #ruby
[18:13:26] jakk: has joined #ruby
[18:13:47] GinoMan1423: has joined #ruby
[18:14:09] gix: has joined #ruby
[18:14:15] pancutan_: has joined #ruby
[18:17:13] _sfiguser: hello rubyers
[18:22:44] gix: has joined #ruby
[18:23:41] gix-: has joined #ruby
[18:24:15] domgetter: has joined #ruby
[18:24:38] bed7: has joined #ruby
[18:28:04] mogaj: has joined #ruby
[18:28:11] charliesome: has joined #ruby
[18:29:14] Ishido: has joined #ruby
[18:29:57] turtlekitten2: apeiros: The YAML was serialized by the old version (Ruby 2.2.4, Rack ~ 2.0.1). I'm getting that error when I try to marshal it with the new version (Ruby 2.4.1, Rack 2.0.3).
[18:30:30] turtlekitten2: I haven't tried serializing a HeaderHash with the new version... maybe I should
[18:31:39] alex``: has joined #ruby
[18:31:45] ujjain: has joined #ruby
[18:31:46] ujjain: has joined #ruby
[18:32:09] turtlekitten2: Nope... that didn't work either: https://gist.github.com/TurtleKitty/8c377723928ae88ffd1a2275027bd16f
[18:36:46] mogaj: has joined #ruby
[18:38:38] chimkan: has joined #ruby
[18:41:44] gix: has joined #ruby
[18:42:19] tvon: has joined #ruby
[18:43:23] gothicsouth: has joined #ruby
[18:44:10] charliesome: has joined #ruby
[18:44:30] blackwind_123: has joined #ruby
[18:44:48] charliesome: has joined #ruby
[18:44:51] MarkBilk: has joined #ruby
[18:44:57] apeiros: turtlekitten2: ok, across versions it's not surprising that it doesn't work. but that it doesn't work within the same version is unexpected
[18:45:34] mogaj: has joined #ruby
[18:46:39] TvL2386_: has joined #ruby
[18:47:11] Tau: has joined #ruby
[18:48:52] kitikonti: has joined #ruby
[18:50:37] hinbody: has joined #ruby
[18:51:34] mhib: has joined #ruby
[18:51:38] gix-: has joined #ruby
[18:51:41] chimkan: has joined #ruby
[18:53:43] turtlekitten2: apeiros: I wouldn't think it would break either way - is just YAML, neh? But I guess I don't know how that serialization works under the hood.
[18:55:29] cseder: has joined #ruby
[18:57:41] MarkBilk_: has joined #ruby
[18:58:14] gusrub: has joined #ruby
[18:59:24] ltem: has joined #ruby
[19:01:42] justizin: has joined #ruby
[19:03:44] jottr: has joined #ruby
[19:04:49] clemens3: has left #ruby: ("WeeChat 1.0.1")
[19:05:34] KeyJoo: has joined #ruby
[19:07:10] romank: has joined #ruby
[19:09:34] blackwind_123: has joined #ruby
[19:10:30] romank: has joined #ruby
[19:11:34] nobitanobi: has joined #ruby
[19:12:03] zacts: has joined #ruby
[19:15:58] mogaj: has joined #ruby
[19:16:19] chimkan: has joined #ruby
[19:17:14] DLSteve: has joined #ruby
[19:17:39] ledestin: has joined #ruby
[19:19:40] hahuang65: has joined #ruby
[19:20:17] romank: has joined #ruby
[19:22:58] mogaj: has joined #ruby
[19:23:37] preisfor5: has joined #ruby
[19:24:07] hightower2: has joined #ruby
[19:27:27] mogaj_: has joined #ruby
[19:28:30] sniptot: has joined #ruby
[19:30:06] TheBloke: has joined #ruby
[19:31:11] mogaj: has joined #ruby
[19:35:07] mogaj_: has joined #ruby
[19:35:28] [Butch]: has joined #ruby
[19:36:04] romank: has joined #ruby
[19:39:43] mogaj: has joined #ruby
[19:40:03] preisform: has joined #ruby
[19:40:05] preisfor2: has joined #ruby
[19:40:07] preisfor4: has joined #ruby
[19:40:27] gix: has joined #ruby
[19:41:07] red_manc: has joined #ruby
[19:42:12] plujon: has joined #ruby
[19:45:32] ur5us: has joined #ruby
[19:46:48] cschneid_: has joined #ruby
[19:46:51] brent__: has joined #ruby
[19:47:08] muelleme_: has joined #ruby
[19:48:15] conta: has joined #ruby
[19:52:44] Cohedrin_: has joined #ruby
[19:53:32] chmurifree: has joined #ruby
[20:01:06] andrzejku: has joined #ruby
[20:01:54] felipevolpone: has joined #ruby
[20:02:22] felipevolpone: has left #ruby: ("Leaving")
[20:02:22] tvon: has joined #ruby
[20:04:14] jenrzzz: has joined #ruby
[20:04:16] haylon_: has joined #ruby
[20:04:29] jottr: has joined #ruby
[20:04:32] jenrzzz: has joined #ruby
[20:04:53] lxsameer: has joined #ruby
[20:06:27] mogaj: has joined #ruby
[20:06:32] gix: has joined #ruby
[20:08:18] splitshot: has joined #ruby
[20:08:33] romank: has joined #ruby
[20:09:02] kariyaki: has joined #ruby
[20:09:25] kariyaki: ACTION inserts a 10mbit isa network card in bweston92
[20:09:29] kariyaki: has left #ruby: ()
[20:10:15] kt2: has joined #ruby
[20:10:54] mogaj: has joined #ruby
[20:11:34] romank: has joined #ruby
[20:13:26] jakk: has joined #ruby
[20:14:27] gusrub: has joined #ruby
[20:14:27] knight33: has joined #ruby
[20:14:28] ascarter: has joined #ruby
[20:15:47] montanonic: has joined #ruby
[20:16:24] MrBismuth: has joined #ruby
[20:16:38] tAn: has joined #ruby
[20:17:35] Cohedrin_: has joined #ruby
[20:18:40] nobitanobi: has joined #ruby
[20:19:56] mogaj: has joined #ruby
[20:19:57] Fysicus: has joined #ruby
[20:21:09] gix: has joined #ruby
[20:22:48] jenrzzz: has joined #ruby
[20:22:48] jenrzzz: has joined #ruby
[20:23:00] mikecmpbll: has joined #ruby
[20:24:15] mogaj_: has joined #ruby
[20:27:36] theunraveler: has joined #ruby
[20:29:00] gothicsouth: has joined #ruby
[20:30:33] patarr: Are there any standards on how to bundle native FFI code with Ruby gems/
[20:30:50] patarr: So one can simply bundle install, and get the required libs without having to use their OS package manager, etc?
[20:31:17] haylon: has joined #ruby
[20:33:04] mogaj: has joined #ruby
[20:34:12] stryek_: has joined #ruby
[20:34:31] montanonic: has joined #ruby
[20:34:50] cdg: has joined #ruby
[20:35:07] agent_white: has joined #ruby
[20:36:06] havenwood: patarr: you could take a look at how nokogiri does it
[20:36:34] havenwood: patarr: i'm not aware of a RubyGems-proffered standard practice
[20:36:42] cdg_: has joined #ruby
[20:37:29] havenwood: http://guides.rubygems.org/gems-with-extensions/
[20:37:57] ytti: has joined #ruby
[20:38:03] havenwood: patarr: https://github.com/sparklemotion/nokogiri
[20:41:36] im0nde: has joined #ruby
[20:46:52] Bock: has joined #ruby
[20:47:03] patarr: thanks havenwood i will take a look at those resources
[20:48:51] mogaj: has joined #ruby
[20:49:35] runescape07rsps: has joined #ruby
[20:50:57] patarr: Looks like there's a handy compilation gem, but looks like the method is to stuff a ton of .c files into a gem folder
[20:51:11] romank: has joined #ruby
[20:51:29] patarr: I'm a little worried about issues like upgrading the native library code, and also the fact that my native library depends on a bunch of other libraries. So many files to add :(
[20:54:17] romank: has joined #ruby
[20:55:36] AustinMatherne: has joined #ruby
[21:00:15] charliesome: has joined #ruby
[21:01:58] jcast: has joined #ruby
[21:02:53] gusrub: has joined #ruby
[21:02:55] jottr: has joined #ruby
[21:03:03] mikecmpbll: has joined #ruby
[21:03:31] nadir: has joined #ruby
[21:04:37] mogaj: has joined #ruby
[21:06:22] jackjackdripper: has joined #ruby
[21:07:24] s2013: has joined #ruby
[21:11:38] haylon: has joined #ruby
[21:13:25] mogaj: has joined #ruby
[21:16:12] charliesome: has joined #ruby
[21:16:37] enterprisey: has joined #ruby
[21:17:08] ur5us: has joined #ruby
[21:17:48] amperry: has joined #ruby
[21:20:50] GinoMan2440: has joined #ruby
[21:23:16] __Yiota: has joined #ruby
[21:26:08] Patadas: has joined #ruby
[21:26:52] romank: has joined #ruby
[21:30:16] dcluna: has joined #ruby
[21:31:28] jackjackdripper: has joined #ruby
[21:32:53] ryzokuken__: has joined #ruby
[21:34:32] mim1k: has joined #ruby
[21:35:13] DoubleMalt: has joined #ruby
[21:36:47] mogaj: has joined #ruby
[21:39:01] learningruby: has joined #ruby
[21:39:50] s4mmy: has joined #ruby
[21:40:22] __Yiota: has joined #ruby
[21:41:02] zacts: has joined #ruby
[21:42:02] poloych: has joined #ruby
[21:43:26] jakk: has joined #ruby
[21:44:10] learningruby: QUESTION: I'm trying to understand LITERALS. I'm reading a book that refers to a “hash literal” as being this: numbers = { "one" => 1, "two" => 2, "three" => 3 }. However, shouldn't a “literal” represent and actual value? This hash representation is not a value, but a sequence of symbols that represent a collection of values, right? I think that ac
[21:44:10] learningruby: tual LITERALS can only be written for strings, numbers and regular expressions, right? Because "some text", 1 and /regex/ are actual values and not a representation of something else. Am I right guys?
[21:44:44] Pepu: has joined #ruby
[21:45:47] ineb: definition of literal: represents a fixed value, whatever that might be.
[21:46:01] ineb: that hash literal you posted is also a fixed value
[21:47:05] gothicsouth: has joined #ruby
[21:47:35] havenwood: >> require 'ripper'; Ripper.sexp 'Hash.new'
[21:47:36] ruby[bot]: havenwood: # => [:program, [[:call, [:var_ref, [:@const, "Hash", [1, 0]]], :".", [:@ident, "new", [1, 5]]]]] (https://eval.in/824810)
[21:47:41] havenwood: >> require 'ripper'; Ripper.sexp '{}'
[21:47:42] ruby[bot]: havenwood: # => [:program, [[:hash, nil]]] (https://eval.in/824811)
[21:48:26] havenwood: >> RubyVM::InstructionSequence.compile('{}').to_a.last
[21:48:27] ruby[bot]: havenwood: # => [1, [:trace, 1], [:newhash, 0], [:leave]] (https://eval.in/824812)
[21:48:28] Papierkorb: learningRuby: That too is a literal. A string is also a bunch of codepoints in reality, and a number a bunch of digits. That's not important, what matters is that a literal creates an atomic entity for the reader
[21:49:08] learningruby: ineb thanks for replying.. I found a definition of “literals” in the book The Ruby Programming Language (by Matz). It says “Literals are values that appear directly in Ruby source code.”. So, according to this definition, I think the hash representation shouldn't be called a literal. Perhaps it depends on how one defines a literal then.
[21:50:17] learningruby: Papierkorb so a hash is an atomic entity? Isn't a hash a collection of atomic entities? How would you define an “atomic entity”?
[21:50:20] Papierkorb: learningRuby: Or in our case, a literal is a special syntax to construct a complex object out of less-complex terminals and non-terminals from the grammar. An Integer is more complex than the token `123`, `"foo"` is actually quite complex already, and { "foo" => "bar" } is even more complex
[21:50:53] havenwood: learningRuby: It might be a bit easier to understand a literal in Elixir, where it means a one-to-one mapping of the human code to the intermediate representation value. A `{}` is a `{}` simply in the AST itself.
[21:51:34] havenwood: It doesn't expand to something else.
[21:51:40] Jakub: has joined #ruby
[21:51:41] havenwood: When parsed.
[21:53:11] Papierkorb: learningRuby: Even in C, you can write: `int foo[] = { 1, 2, 3 };`. Again, we're constructing a more complex "object" using a special syntax.
[21:53:35] bkxd: has joined #ruby
[21:53:37] bkxd_: has joined #ruby
[21:53:42] Cohedrin_: has joined #ruby
[21:55:20] Ryzokuken: has joined #ruby
[21:56:18] learningruby: Papierkorb In the wikipedia definition for ‘value’ is: “a value is an expression which cannot be evaluated any further (a normal form)” Would you say that a literal is then a direct representation of a value?
[22:03:08] Papierkorb: learningRuby: Without digging through smart books, you could say that I think ;)
[22:05:31] learningruby: Papierkorb I think now I get it... I put together what you guys told me.. so a hash is actually a value (I didn't know that), because it cannot be evaluated any further. It's just a more complex value, like you said. And a literal is something that represents an actual value (as opposed to a variable which is not a value in itself, but references o
[22:06:08] learningruby: damn I feel smarter now :P
[22:06:27] Papierkorb: Yeah that description should work
[22:08:31] learningruby: thanks havenwood and ineb too
[22:14:20] learningruby: I realize that in programming, terminology is quite important, to make sense of concepts. Yet we can easily get caught up in terminology, because maybe we can never be as precise as we'd like with our abstractions. Perhaps to be really precise one must give up on abstraction and get down to the level of machine code.
[22:14:21] jackjackdripper: has joined #ruby
[22:14:48] cseder: has joined #ruby
[22:17:42] zacts: has joined #ruby
[22:17:46] Papierkorb: learningRuby: The thing is you have to look out what you're talking about. A literal is something the language cares about, the parser speaks about (non-)terminals, and the virtual machine now suddenly calls whatever the literal described an instance of a value.
[22:18:08] Papierkorb: learningRuby: Parsers are even more fun, where people came up with different names for the same thing.
[22:18:56] Jakub: has joined #ruby
[22:20:53] ascarter: has joined #ruby
[22:21:51] nobitanobi: has joined #ruby
[22:23:53] Ishido: has joined #ruby
[22:24:24] learningruby: Papierkorb When you say “terminals” do you mean tokens?
[22:24:50] Papierkorb: learningRuby: what a lexer ("scanner", "tokenizer") calls a token, a parser calls a terminal
[22:25:07] mostlybadfly: has joined #ruby
[22:26:26] gothicsouth: has joined #ruby
[22:26:32] learningruby: Papierkorb can you suggest me a book or resource to learn more about this? (parsing, etc.)
[22:29:23] ecuanaso: has joined #ruby
[22:31:25] Papierkorb: learningRuby: Never liked (technical) books much, you can find tons of good university courses (free) on those topics. What they explain badly, other sources may explain easier. Also, YouTube has a surprising amount of videos on CS stuff. If you want a book, among the all-time favorites are the famous "Dragon Books"
[22:32:27] Papierkorb: learningRuby: No matter the source of information, make sure to build a small program using whatever the source is describing. Ruby is an excellent language for this.
[22:33:01] montanonic: has joined #ruby
[22:33:04] Papierkorb: learningRuby: If you understand it, you can build it. If you can't build it, you didn't understand it. :)
[22:34:37] Papierkorb: well obviously, this doesn't cover 100% of possible misunderstandings, but it's better than nothin'. And much less painful than writing an exam (if you're an university student) and getting an F.
[22:35:28] learningruby: mm I like that.. sounds a bit like what Gillespie said about jazz “If you can hear it you can have it”
[22:37:35] learningruby: Papierkorb thx for the suggestions, I'll try those.. I agree that books often seem to complicate things, perhaps specially tech books.
[22:40:21] jackjackdripper: has joined #ruby
[22:40:40] railswebdev: has joined #ruby
[22:42:21] A124: has joined #ruby
[22:44:23] herbmillerjr: has joined #ruby
[22:46:07] jackjackdripper: has joined #ruby
[22:46:11] Guest15764: has joined #ruby
[22:48:18] fnodeuser: has joined #ruby
[22:50:25] fnodeuser: has left #ruby: ()
[22:54:37] enterprisey: has joined #ruby
[22:55:16] Derperperd: simple question. how can i turn the following string into an array?
[22:55:43] tgragnato: has joined #ruby
[22:55:48] Derperperd: test "this is also a test" test2 => [test, this is also a test, test2]
[22:55:57] SeepingN: try using eval
[22:56:10] Derperperd: SeepingN: how do i use eval
[22:56:11] SeepingN: oh wait. that's... unusual
[22:56:22] SeepingN: you'll have to do some custom parsing me thinks
[22:56:29] Derperperd: yeah i thought it would be easier but...its not..
[22:56:35] tgragnato: has joined #ruby
[22:56:36] tgragnato: has left #ruby: ()
[22:56:43] SeepingN: change the source ;)
[22:58:20] darix: has joined #ruby
[23:00:11] DLSteve: has joined #ruby
[23:00:54] jackjackdripper1: has joined #ruby
[23:00:56] al2o3-cr: Derperperd: shellsplit
[23:01:13] jordanm: has joined #ruby
[23:01:34] d5sx43: has joined #ruby
[23:04:34] tgragnato: has joined #ruby
[23:05:40] al2o3-cr: >> %(test "this is also a test" test2).shellsplit
[23:05:41] ruby[bot]: al2o3-cr: # => undefined method `shellsplit' for "test \"this is also a test\" test2":String (NoMethodError) ...check link for more (https://eval.in/824828)
[23:06:09] mrconfused: has joined #ruby
[23:06:28] al2o3-cr: >> require 'shellwords'; %(test "this is also a test" test2).shellsplit
[23:06:29] ruby[bot]: al2o3-cr: # => ["test", "this is also a test", "test2"] (https://eval.in/824829)
[23:07:00] Derperperd: you the man al2o3-cr thanks
[23:08:34] al2o3-cr: yw Derperperd
[23:09:53] mydog2: has joined #ruby
[23:10:37] jenrzzz: has joined #ruby
[23:10:37] jenrzzz: has joined #ruby
[23:14:20] jakk: has joined #ruby
[23:15:48] railswebdev: has joined #ruby
[23:21:40] kobain: has joined #ruby
[23:22:16] raul782: has joined #ruby
[23:26:06] ascarter: has joined #ruby
[23:26:29] gothicsouth: has joined #ruby
[23:31:47] runescape07rsps: has joined #ruby
[23:33:03] im0nde: has joined #ruby
[23:34:54] zacts|pi: has joined #ruby
[23:34:57] mim1k: has joined #ruby
[23:39:45] MrSamuel: has joined #ruby
[23:41:32] ghormoon: has joined #ruby
[23:42:54] s2013: has joined #ruby
[23:50:50] gothicsouth: has joined #ruby
[23:51:05] ioquatix: has joined #ruby
[23:54:12] brent__: has joined #ruby
[23:56:57] V1s1ble: has joined #ruby
[23:56:57] V1s1ble: has joined #ruby