Post AQ2TqD21eHOZ6uXZGS by _ka_@nrw.social
 (DIR) More posts by _ka_@nrw.social
 (DIR) Post #AQ2A8TYCyJ0CTN1gy8 by james@ruby.social
       2022-11-27T16:00:20Z
       
       0 likes, 0 repeats
       
       __DATA__ ? #ruby
       
 (DIR) Post #AQ2JwzekmFYU74Fe88 by kkuchta@ruby.social
       2022-11-27T17:50:13Z
       
       0 likes, 0 repeats
       
       @james It’ll make an appearance in my rubyconf talk this week!  :)
       
 (DIR) Post #AQ2NjlzcfLAXmxxqXQ by therabidbanana@notvery.social
       2022-11-27T18:32:44Z
       
       0 likes, 0 repeats
       
       @james I’d love to hear if anyone actually used it for something useful vs just joke applications (my case for checking “used it”)
       
 (DIR) Post #AQ2QXVxckO6WS9sLx2 by caius@ruby.social
       2022-11-27T18:50:07Z
       
       0 likes, 1 repeats
       
       @therabidbanana @james I’ve used it for years, and both written an ode to it https://caiustheory.com/why-i-love-data/ and at a previous job setup the engineering blog on dataread.cloud https://dataread.cloud/2019/hello-world/ (still kinda wish I’d used that domain for something better.) 🤪
       
 (DIR) Post #AQ2QboTNrRYt1gmTNw by james@ruby.social
       2022-11-27T19:04:53Z
       
       0 likes, 0 repeats
       
       @caius @therabidbanana I also have it in production - a model loads a bunch of non-DB data by parsing the data comment of its own file, formatted as CSV
       
 (DIR) Post #AQ2TqD21eHOZ6uXZGS by _ka_@nrw.social
       2022-11-27T19:41:09Z
       
       0 likes, 0 repeats
       
       @james Is there more information or docs about __DATA__?I never hear about it until now :D
       
 (DIR) Post #AQ2U6hx6SEJ3dt6a7U by james@ruby.social
       2022-11-27T19:44:08Z
       
       0 likes, 0 repeats
       
       @_ka_ my original post had a typo, it’s actually just “DATA”; the official documentation is here: https://ruby-doc.org/core-2.5.0/Object.html#DATA
       
 (DIR) Post #AQ2UuvNIp7xBkcIxeK by _ka_@nrw.social
       2022-11-27T19:53:13Z
       
       0 likes, 0 repeats
       
       @james thanks for the link I will read it :D and next time I can select "I know it" and not "Huh?" 😅
       
 (DIR) Post #AQ2dGzKjaN2c248S1I by henrik@ruby.social
       2022-11-27T21:26:42Z
       
       0 likes, 0 repeats
       
       I use it quite often if I have some plain text data file to parse as a one-off. Just slap an __END__ at the top and write the code right there.
       
 (DIR) Post #AQ2hgsjL9rXKtnFNQW by caius@ruby.social
       2022-11-27T22:16:18Z
       
       0 likes, 0 repeats
       
       @james @therabidbanana that joggled a vague recollection of using it in a test file somewhere. Think I had example output to compare to generated output in the test, stored the example output in __DATA__.Also reminds me I have multiple Sinatra apps with the templates in __DATA__. :inline_templates I think is the option to enable.
       
 (DIR) Post #AQA0fJSU4SQ6S230fA by caius@ruby.social
       2022-12-01T10:27:49Z
       
       0 likes, 0 repeats
       
       @therabidbanana @james just discovered I used it whilst spiking out the initial implementation of an XML parsing gem back in 2011! https://github.com/brightbox/burlap/commit/0e1b0876e125fbcdb7eddbbb7267d2adc22a9c83
       
 (DIR) Post #AQA0fJyk8WDy458lwe by james@ruby.social
       2022-12-01T10:51:52Z
       
       0 likes, 0 repeats
       
       @caius @therabidbanana alas I have nothing public except this syntax highlighting test for my site software https://github.com/lazyatom/interblah.net/blob/e1f7d4c74429fdbe8f0494e00ebb16297e5df9ca/soups/site/test-code.snip