[Rails] What is the question mark inside this regex doing?

2014-08-14 Thread 'John Merlino' via Ruby on Rails: Talk
I thought the ? matches zero or one occurrence of a pattern. However in this example: def show_regexp(string, pattern) match = pattern.match(string) if match "#{match.pre_match}->#{match[0]}<-#{match.post_match}" else "no match" end end a = "The moon is made of cheese" show_regex

[Rails] staging server unexpectedly started installing gems during staging deploy

2014-05-01 Thread &#x27;John Merlino&#x27; via Ruby on Rails: Talk
I have a production server and a staging server and a production git branch and a staging git branch for the same repository on github. The production git branch and staging git branch are identical. I got my staging server running and during the second deploy, something unexpected started hap

[Rails] capistrano: deploying production and staging to same database

2014-04-30 Thread &#x27;John Merlino&#x27; via Ruby on Rails: Talk
I have the production and staging site on two different server ips. But the database, another server ip, is the same database used by both production and staging. When i set up the capistrano deploy task for both the production and staging, should I keep the db role in deploy.rb like this: depl