Page 1 of 1
[07:31:48] ksinkar: Hello guys has anyone used stubbing extensively here with rspec? I am trying to create a stub a method onto my object that takes parameters and I do not know how to do that. I only how to stub methods onto objects.
[07:51:37] ksinkar: Just read a function signature similar to `def some_function(param_a:, param_b:, param_c:)` Any idea what is the meaning of these params with a colon at the end of the identifier. In the function body they are simply being accessed as `param_a` and there seems to be nothing special about `param_a:` in the the argument list.
[12:38:23] ksinkar: Is there any way to detect a yield block has been provided to a ruby method? Similar to the way count works, with a block passed to it, without a block passed to it.
[08:04:34] ksinkar: has anyone here used the Ruby Shell library recently? I am using it, but other than echo, I cannot access any other shell commands which are available in my shell through my PATH.
[12:55:25] ksinkar: is there any existing helper method or predefined method in ruby or rails to display a number 1 as 1st and 2 as 2nd and 3 as 3rd and 4 as 4th correctly?
[13:04:59] ksinkar: I am using ruby-saml for SAML authentication for my RoR app. Now ruby-saml does not have support for encryption. There are a couple of forks out there that support encryption. I want to know if any of you have used that and could share your experiences?
[06:06:14] ksinkar: sevenseacat: https://gist.github.com/5715306e467caf742ae6 https://gist.github.com/be9b3c2aa38a4778d2c7 https://gist.github.com/a80fef2093d68e8adfd4 ; these are the $bin/rake routes o/p, routes.rb file, and the spec/integration file where I am getting errors of path not found
[06:12:37] ksinkar: Radar: I am using the gist gem commandline. hence the multiple gists. The error is when I run the integration spec, it gives me unknown method or variable error for my routes. I am not able to explain why.
[06:14:32] ksinkar: Radar: I though prefer gist so that they can clone the code from their command line rather than having to use the browser.
[06:23:18] ksinkar: Radar: I had run these tests 6 months back and they ran without including the rails_helper. Why do I have to do it now?
[06:23:54] ksinkar: tmoore: thanks for the advice. I had done that earlier but did not know about the rspec3 upgrade and hence the mistaken assumption.
[07:24:53] ksinkar: hello people, I am running rspec tests which are all giving errors (not failing). These tests are not able to identify the path like root_path, signin_path and so on. while rake routes shows all these paths. rspec throws an error saying 'undefined local variable or method'. Any ideas of what could be the problem? BTW I have already set the cache_store to NULL in my test.rb
[07:38:09] ksinkar: sevenseacat: http://ur1.ca/ipmz3 http://ur1.ca/ipmyo http://ur1.ca/ipmye, here are the three files
[06:05:07] ksinkar: hello, I am using the mysql2 gem as the db connector for my RoR application. The mysql server on my machine is not listening to the TCP/IP port yet I am able to run rake db:migrate in spite of NOT having specified where the unix socket file is.....
[06:10:43] ksinkar: Shuttle: I just looked at config/environments/development.rb and I do not see any special settings that will connect the ROR to MySQL over UNIX socket; do you have anything specific in your mind? Can you help me understand what is happening?
[06:18:26] ksinkar: kp666, Shuttle: also JDBC is not able to connect to MySQL due to the TCP being down
[06:35:36] ksinkar: Shuttle: thanks for hearing me out. I am just trying to understand this particular behavior. If you stumble across the answer, send me a memo.
[09:26:08] ksinkar: hello, I have started using rails dbconsole recently to connect to the SQL client of my DB. But I am perplexed by the fact that I am asked the password to access the SQL client inspite of having stored the password in the config/database.yml . Why "$ rails dbconsole" not provide for the password from the configuration file?
[09:30:49] ksinkar: rhizome: it worked. But I distinctly remember that it used to work without the -p option earlier. IMHO it should supply the password without any flag as it is a natural expectation and more intuitive given the way other "$ rails console" or "$ rails server" works.
[09:43:53] ksinkar: rhizome: I guess then the -p behaviour was for an account with postgres db with full trust
[09:59:14] ksinkar: why does omniauth have separate strategies for twitter, facebook and linkedin inspite of the fact that all of them follow the OAuth2.0 specification?
[10:16:34] ksinkar: workmad3: I am talking as an application service provider and not an identity provider.
[10:17:52] ksinkar: workmad3: I have read that post about oauth2.0. I think SAML2.0 has done a better job.
[07:01:02] ksinkar: sevenseacat: on the staging server, not production. The problem is that I am building something that needs a public facing DNS entry which is accessible from the internet outside our intranet. It is a configuration with an API service that needs the URL endpoints on both the sides. I am trying to make it work and hence I need a debugger on my staging environment which is running phusion passenger builtin as apache module
[05:31:14] ksinkar: I am looking at the devise gem and am trying to understand its structure. It has lib/devise/controllers/*.rb as well app/controllers/*.rb . I am trying to understand the structure behind the gem? How are files getting included? Can anyone help?
[05:36:04] ksinkar: sevenseacat, rvanlieshout: I got that point. Now I am not able to figure out how is the code in app/controllers and app/helpers being included in a Rails app that uses the Devise gem?
[10:01:30] ksinkar: Does it where in our class definition or module definition we include external classes or modules?
[10:01:54] ksinkar: Pardon me, I meant "Does it matter where in our class definition or module definition we include external classes or modules?"
[12:51:41] ksinkar: I am writing the yaffle rails plugin as illusrated on http://guides.rubyonrails.org/plugins.html and at the end of the tutorial when I am running tests for the instance methods of the Hickwill and Wickwill class, I get an error saying that no such tables exist. But go to the dummy directory and start rails console there, I get the tables, objects etc. as expected. Any pointers?
[05:20:44] ksinkar: I am compiling ruby from source. Do I have to pass any specific flags to the ./compile if I want to compile my ruby with readline support?
[05:29:08] ksinkar: havenwood: after having installed ruby and then deployed a rails application, I found that $rails console will not work because of readline errors
[05:31:23] ksinkar: havenwood: I am not sure if it was installed the first time I compiled ruby. Hence, compiling it again. Will keep you posted
[13:49:56] ksinkar: has anyone done here a multitenant installation of a rails application and a nodejs application with passenger?
[06:16:54] ksinkar: when I am using post and get methods in my rspec tests, why can I not use the default capybara methods?
[06:44:17] ksinkar: If I have called delete or get or post (ActionController::TestCase::Behavior methods) etc in my before block, should Capybara kick in if I check for pages to be shown as a result of those HTTP methods being sent to my server?
[07:03:33] ksinkar: helpa: https://gist.github.com/ksinkar/9778078#file-user_pages_spec-rb-L52 why does that line fail?
[07:04:01] ksinkar: Radar: https://gist.github.com/ksinkar/9778078#file-user_pages_spec-rb-L52 why does that line fail?
[15:03:19] ksinkar: I just read matz post which advices to commit your Gemfile.lock if you are doing an application. But most of use rails developers always have a set of gems that are specific to our development machine, which get listed in our Gemfile.lock. In that case how do we propagate a production only Gemfile.lock? Is there an standard procedure that is followed in this regard?
[15:05:39] ksinkar: Hates_: gems like wirble, debugger, pry etc are dev gems which are not required in production.
[15:07:06] ksinkar: ok, got it. But it still leaves the problem that different developers may have different preferences to the kind of specific gems that they use.
[09:38:37] ksinkar: I am trying to build an XML file. Now if one use Nokogiri or builder the common usage pattern seems to be creating an XML string first and then writing it to a file. In case of large data that needs to be converted in XML this can bloat the memory especially the XML string. How can one write to an XML file periodically while without bloating up the memory too much?
[13:12:42] ksinkar: I am using the sanitize method to sanitize all user input that is going to be displayed. The problem is that user defined html pages are also being passed throught the sanitize filter
[11:16:30] ksinkar: with redis version 2.2.2 and above and resque version 1.25.1, is anyone facing reconnection issues after forking from the parent process?
[05:47:40] ksinkar: how does one identify if our resque-scheduler process is on or not? I cannot see any resque-scheduler process in my ps -ef.
[13:47:15] ksinkar: With the resque scheduler, when you schedule a job to run after every 5 minutes in the cronjob format, why does the job schedule for one hour and five minutes? cron: "5 * * * *"
[13:49:39] ksinkar: maloik_: is this how cron works, or is this rufus-scheduler/resque-scheduler specific?
[17:57:33] ksinkar: I am using RVM on my development machine and want to test some scheduled running of tasks with cronjob. Now the dilemma I am facing is that how do I have all the gems and my bundle and my ruby in the included in the cronjob environment, as the cron does not read your .bash_rc file.
[13:35:38] ksinkar: Is the Rails cache that is created a presistent store common across different instances of the same application on the same machine, or is it different per Rails process. Example Can I access the same Rails cache from my console that is available to my web application running locally?
[11:33:01] ksinkar: I am currently using delayed jobs as the scheduler in my application. I had used it first because it seemed to be the default choice. Now that I have started facing problems with Delayed Jobs, especially jobs not mysteriously being executed, I am now looking at other options namely redis-resque, beanstalkd etc. I was wondering why is nobody in the rails world using cron jobs as their scheduler? Or is it that cron jobs is a scheduler
[06:20:39] ksinkar: how does one access fixtures data in a before(:all) block? I tried the normal method -- users(:david) -- to return objects, which works for individual 'it' blocks but it does not work for before(:all) block. Is it even possible to access fixtures from the before(:all) block?
[06:26:36] ksinkar: parndt, sarmiena: yes, does not the fact that I am loading the fixtures before the before all code make a difference?
[06:27:45] ksinkar: sevenseacat: I am usring before(:all) for my controller tests, to sign in the user
[06:28:39] ksinkar: parndt: wouldn't before(:all) be better, instead of signing in the user at each individual test?
[15:22:11] ksinkar: michael_mbp: usually to alias routes, we use controller names, if I do that for mounting engines, it will try to mount the engine twice and then that is not allowed, right?
[12:56:07] ksinkar: Current the Action Dispatch cookie class only allows me to access root path cookies like this 'cookies[<cookie_name>]'
[15:04:36] ksinkar: Currently the Action Dispatch cookie class only allows me to access root path cookies like this 'cookies[<cookie_name>]'. Does anyone know how to access a cookie with a given path?
[06:08:35] ksinkar: where are the rake tasks that come by default in rails located in the rails source code?
[06:25:15] ksinkar: I am trying to dump some of the tables in existing database to fixtures. Is there any easy way to do this with Rails 3?
[13:08:57] ksinkar: When I run tests for my rails application, using $ rake test, the tests run the development enviroment and not the test environment. Aren't the tests supposed to run by default in the test environment
[13:25:32] ksinkar: universa1: that is what I am trying to figure out where that hardcoding has happened. Have looked at boot.rb, application.rb and going by http://guides.rubyonrails.org/initialization.html, I have not found the hard coding anywhere
[06:37:51] ksinkar: I have noticed that when I try to access my mysql console through rails dbconsole, it asks me for the database password, which has already been provided in the config/database.yml. Any idea why does it ask for the password? It did not ask for password previously on other applications that I have worked on.
[10:38:26] ksinkar: I am using the truncate helper method to truncate lines of text. Now these lines of text also have html links embedded in them. These links should not be truncated. Has this problem been solved before?
[13:50:56] ksinkar: I have installed the debugger gem in my global gemset but while I try to require the debugger gem in my rails application, it gives me a LoadError. Where could I be going wrong?
[04:19:41] ksinkar: i have added the devise gem and still i get method_missing error for authenticate_user! and I am not able to figure out what is the bug. I have worked with devise before and it worked out of the box. Unable to debug the problem. Any hints as to how to proceed?
[04:26:14] ksinkar: Paradox: so if we are doing something fancy like ffmpeg, then we can do that with openshift? Because we cannot do that with Heroku.
[08:25:20] ksinkar: for a model with relationships, how do I implement the checking for validations on the dependent objects as well?
[08:33:09] ksinkar: pacso: well I have two models, with a many to many relationship between them. What I want is when an object1 which is an instance of model1 changes and is saved to the database, I want validations to be run on the child models as well. I come from the world of DataMapper where this is possible using the ORM DSL itself. I was wondering if I could do that in Active Record as well.
[12:22:00] ksinkar: elaptics: to test if the attribute is present, if it is a database column, and if yes, if it is of the correct data type
[12:26:42] ksinkar: pi3r: yes you can say that, but I need to know if certain attributes that which I have written in my specs are actually present in the model/class
[12:34:43] ksinkar: elaptics: actually I am not testing whether the database has been correctly created or not, but just testing if the developer has created those fields and their datatype values are the same as the specification, which is nothing but my test
[12:47:52] ksinkar: elaptics: http://pastie.org/7278806, now in this code I just want to reduce the length of the first three tests
[12:44:10] ksinkar: I am trying to do some data import from csv files into a postgres database through a rake task. I am using the standard csv library of ruby. Now after some time the process just comes to a halt inexplicably. After I look at the logs I can see a SQL stmt being fired and is frozen in time
[08:47:15] ksinkar: how do I enable the display of backtrace when I run my rake tasks, '$rake --backtrace stdout' does not work
[08:59:18] ksinkar: Antiarc: --trace does not display the database actions that are taking place in the background
[08:59:45] ksinkar: Antiarc: --trace only displays once there it encounters an error and not before that
[04:11:21] ksinkar: I am trying to skip a validates_attachment_presence using the skip_callback method on the class, but I am getting a method missing error
[11:20:27] ksinkar: hello, when you are using fixture_file_upload() as a part of your test suite, how do you close all the file handles that were opened?
[07:51:10] ksinkar: namaste, how does one create a set of data to randomly pick up from in Fabricator gem, the way we do it in FactoryGirl gem..
[14:39:25] ksinkar: how do we debug devise, I am using the devise gem for authentication and I am unable to login to as the user
[15:37:46] ksinkar: do I need to add anything on my Procfile to enable web solr index on heroku app if I have already added the addon?
[12:54:08] ksinkar: I am facing this wierd problem in my app, if I do require 'open-uri' in my console and run open(<weblink>). It works
[12:55:05] ksinkar: inspite of having require 'open-uri' stated at the beginning of the class definition, I am unable to run open(<weblink>) properly