Skip to content

Commit 279a5ac

Browse files
committed
Updated rake tests
1 parent 678a428 commit 279a5ac

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ gem 'bootswatch-rails'
3838

3939
gem 'nokogiri'
4040

41+
gem 'whenever', require: false
42+
4143
group :development, :test do
4244
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
4345
gem 'byebug'

Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ GEM
5656
rack (>= 1.0.0)
5757
rack-test (>= 0.5.4)
5858
xpath (~> 2.0)
59+
chronic (0.10.2)
5960
coderay (1.1.0)
6061
coffee-rails (4.1.0)
6162
coffee-script (>= 2.2.0)
@@ -179,6 +180,8 @@ GEM
179180
binding_of_caller (>= 0.7.2)
180181
railties (>= 4.0)
181182
sprockets-rails (>= 2.0, < 4.0)
183+
whenever (0.9.4)
184+
chronic (>= 0.6.3)
182185
xpath (2.0.0)
183186
nokogiri (~> 1.3)
184187

@@ -207,6 +210,7 @@ DEPENDENCIES
207210
turbolinks
208211
uglifier (>= 1.3.0)
209212
web-console (~> 2.0)
213+
whenever
210214

211215
BUNDLED WITH
212216
1.10.6

config/schedule.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
set :environment, "development "
2+
set :output, "log/cron.log"
3+
4+
every 2.hours do
5+
rake "db:drop db:create db:migrate update_commits"
6+
puts "Mary is the best mentor"
7+
end

lib/tasks/drop_heroku.rake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
desc "drops heroku database"
2+
task :drop_heroku => :environment do
3+
puts "Dropping Heroku Database"
4+
`heroku pg:reset DATABASE_URL`
5+
end

lib/tasks/update_commits.rake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ task :update_commits => :environment do
44
require 'nokogiri'
55
require 'open-uri'
66

7+
Stat.delete_all
8+
79
@urls = GlobalConstants::URLS
810

911
@names = @urls.map do |url|

0 commit comments

Comments
 (0)