Page 1 of 3 | Next »
[08:11:23] yuung: a while ago i found this really cool site that had Ruby's source code with annotations on the side describing the code, does anyone know/remember this site?
[08:11:28] yuung: a while ago i found this really cool site that had Ruby's source code with annotations on the side describing the code, does anyone know/remember this site?
[22:05:56] yuung: it's basically a codepen clone - a user writes html/js and there is an autorefreshing iframe that updates periodically
[22:06:22] yuung: there is also a /show path for the page that just uses an erb template to display the html/js in full
[20:08:08] yuung: i have a large csv file (~1 million lines) that i need to parse and transform with ruby. i don't want to read all of it into memory at once; rather i'd like to stream it. my question is, is there a method in IO that lets me read line-by-line, garbage collecting each old line after its been processed?
[20:09:50] yuung: jhass i see; maybe not line by line, but in the end i don't want to read the whole file into memory at once. does CSV::foreach do that?
[17:19:52] yuung: apeiros, toretore, mk. so i could theoretically create it, start it and stop it immediately
[18:27:12] yuung: silly q: why does ruby pass by reference? i always thought most scripting languages did pass by value.
[18:33:27] yuung: norc, that's so weird; i literally did the same thing in IRB (gist here https://gist.github.com/johnmarinelli/c45e5440a42c0e78f7853df33a62b19d) and i got something different
[17:14:39] yuung: i have a string and an array of words i'd like to replace within that string. does ruby have a method for this or am i going to have to iterate over the array?
[17:15:06] yuung: for ex, `"this is my string", ["is", "string"] should be replaced ["IS", "STRING"] respectively
[18:29:28] yuung: does anyone have experience connecting to salesforce marketing cloud via Net::SFTP? i can't connect due to their 'enhanced ftp' feature
[18:33:36] yuung: bougyman, when i connect via command line, i have to go through some partial authentication thing, then enter my password as normal
[18:35:41] yuung: but i've never seen this enhanced ftp before and net-sftp doesn't seem to handle it
[18:37:22] yuung: i'm trying to use VCR in my rails app, and in the method i'm trying to test, i use Hash#transform_keys which is a Rails method. it seems that when i test with VCR, this method isn't added. how can i amend this?
[18:39:27] yuung: i'm trying to use VCR in my rails app, and in the method i'm trying to test, i use Hash#transform_keys which is a Rails method. it seems that when i test with VCR, this method isn't added. how can i amend this?
[19:12:44] yuung: https://gist.github.com/johnmarinelli/0e72a3ffc72c6aed648a <--- link to VCR/Rails problem
[22:31:57] yuung: i'd like to test a method that returns an object in its `rescue` clause. how can i do this with rspec?
[22:33:52] yuung: Cohedrin, aegis3121, yeah - i want to know how i can raise this exception in a test?
[22:37:32] yuung: aegis3121, Cohedrin, hm - so i don't think i'll really be able to simulate the way i'd like. but i'll take what you said into consideration. thanks!
[22:37:57] yuung: SaintAardvark, http://stackoverflow.com/questions/15707940/rake-before-task-hook might help
[23:59:08] yuung: SaintAardvark, http://stackoverflow.com/questions/15707940/rake-before-task-hook might help
[00:07:37] yuung: pontiki, i was trying to create a helper function that does it for me: https://gist.github.com/johnmarinelli/cde642d098359968e3f4 however, in my yaml file, when i try to use create_applicants it gives me some cryptic syntax error
[00:08:00] yuung: if i could handroll a factory that would be much easier, because I haven't used factorygirl before
[00:21:43] yuung: so I don't understand how i'm supposed to generate fixtures with factorygirl; i used build() and tried assert_equal 1, Applicant.count but it's 0.
[00:22:06] yuung: googling doesn't really give me clear results for an intro to factorygirl with rails' default tests either :(
[00:23:45] yuung: err - nvm. create() instead of build(). i'll come back when i have questions that are more vague >>
[03:20:16] yuung: for some reason, i'm getting an html response with the following setup: https://gist.github.com/johnmarinelli/1617fae143eebb613849
[23:37:51] yuung: is there a way to dynamically create fixtures? something like, <%= create_user(created_at: '2014-01-01') %>
[23:53:43] yuung: pontiki, that's what I was considering, maybe I'll go that route. essentially i just need a way to generate X number of users within a date range, so it'd be like create_user(range, num_of_users)
[20:48:15] yuung: i'm working on a class that works with matrices, how can i call the  operator from within a class function?
[06:45:53] yuung: so i'm trying to use TravisCI with my project. it complains that there is no secret_key_base and to set it in config/secrets.yml; however i'd rather not upload the secrets.yml to my repo. how can i circumvent this?
[06:46:14] yuung: i've tried putting env: secret_key_base="$(bundle exec rake secret)" to no avail in .travis.yml
[06:47:38] yuung: sevenseacat, i'd do that but i can't edit my env vars on my production server (shared hosting)
[06:49:04] yuung: i just made a config/secrets.yml file on the server. sloppy, i know, but like i said - i can't set env vars
[06:50:09] yuung: because secrets.yml isn't in the repository, so it's complaining that it can't find a secret_key_base
[06:51:10] yuung: alright - i was trying to avoid that because wouldn't i have to remember to git checkout config/secrets.yml for every pull?
[23:17:48] yuung: [spoiler], https://gist.github.com/johnmarinelli/05881902ddf8f8deaf63. just wondering why i need to call Base.get instead of self.get
[02:13:03] yuung: xploshioon (tbh, i'd say that just making a quick user resource with devise would be easier if you're going to have relationships)
[02:16:13] yuung: xploshioon, set a :before_filter in your controllers to insert the user email in the url
[02:16:36] yuung: before_filter basically runs some function before your show, create, update, whatever you choose
[02:27:32] yuung: i'd really suggest just using devise and creating the relationships like that. if you don't want to do that, try just using resources :payments
[02:33:13] yuung: xploshioon, you could set up a rake task that would run every day/week whatever to query the API for deleted/new users, and update accordingly
[02:57:37] yuung: xploshioon, i have to go right now, first place i'd look is the controller though; I don't think it has anything to do with the routes