File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 869869
870870## Rake Tasks
871871
872+ There are a few Rake tasks available out of the box:
873+
872874 * ` rake dynamoid:create_tables `
873875 * ` rake dynamoid:ping `
874876
877+ In order to use them in non-Rails application they should be required explicitly:
878+
879+ ``` ruby
880+ # Rakefile
881+
882+ Rake ::Task .define_task(:environment )
883+ require ' dynamoid/tasks'
884+ ```
885+
886+ The Rake tasks depend on ` :environment ` task so it should be declared
887+ as well.
888+
875889## Test Environment
876890
877891In test environment you will most likely want to clean the database between test runs to keep tests completely isolated. This can be achieved like so
Original file line number Diff line number Diff line change 1+ load "dynamoid/tasks/database.rake"
Original file line number Diff line number Diff line change @@ -30,12 +30,12 @@ namespace :dynamoid do
3030 end
3131
3232 msg = "Connection to DynamoDB #{ success ? 'OK' : 'FAILED' } "
33- msg << if Dynamoid . config . endpoint
33+ msg += if Dynamoid . config . endpoint
3434 " at local endpoint '#{ Dynamoid . config . endpoint } '"
3535 else
3636 ' at remote AWS endpoint'
3737 end
38- msg << ", reason being '#{ failure_reason } '" unless success
38+ msg += ", reason being '#{ failure_reason } '" unless success
3939 puts msg
4040 end
4141end
You can’t perform that action at this time.
0 commit comments