This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://domain.harvestapp.com/daily/add/ -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u user@domain.com:password --data-urlencode "<request><notes>Test api support</notes><hours>3</hours><project_id type='integer'>1078833</project_id><task_id type='integer'>26711</task_id><spent_at type='date'>Fri, 25 Mar 2011</spent_at></request>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Entry < ActiveRecord::Base | |
validates :first_name, :presence => true, :length => {:maximum => 50}, :if => :condition? | |
def condition? | |
return true | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'csv_validator' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
attr_accessor :my_csv_file | |
validates :my_csv_file, :csv => true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validates :my_csv_file, :csv => { | |
:columns => 3, # an exact number of columns | |
:max_columns => 10, # a maximum number of columns | |
:min_columns => 1, # a minimum number of columns | |
:rows => 20, # an exact number of rows | |
:max_rows => 30, # a maximum number of rows | |
:min_rows => 2, # a minimum number of rows | |
:email => 0, # will check to make sure all emails in specified column are valid email addresses | |
:numericality => 0, # will check to make sure all values in specified column are numerical | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
capify . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Capfile | |
config/deploy.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'railsless-deploy' | |
load 'config/deploy' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/my_project: cap -T | |
cap deploy # Deploys your project. | |
cap deploy:check # Test deployment dependencies. | |
cap deploy:cleanup # Clean up old releases. | |
cap deploy:cold # Deploys and starts a `cold' application. | |
cap deploy:pending # Displays the commits since your last deploy. | |
cap deploy:pending:diff # Displays the `diff' since your last deploy. | |
cap deploy:rollback # Rolls back to a previous version and restarts. | |
cap deploy:rollback:code # Rolls back to the previously deployed version. |
OlderNewer