Skip to content

Commit

Permalink
Add whenever to run cron job
Browse files Browse the repository at this point in the history
  • Loading branch information
loganhasson committed Feb 13, 2014
1 parent 04bb504 commit d95acc6
Show file tree
Hide file tree
Showing 7 changed files with 8,344 additions and 2,754 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Expand Up @@ -2,4 +2,5 @@ source 'https://rubygems.org'

gem 'twitter'
gem 'graph'
gem 'pry'
gem 'pry'
gem 'whenever'
15 changes: 15 additions & 0 deletions Gemfile.lock
@@ -1,9 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.0.2)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
addressable (2.3.5)
atomic (1.1.14)
buftok (0.2.0)
chronic (0.10.2)
coderay (1.1.0)
equalizer (0.0.9)
faraday (0.9.0)
Expand All @@ -12,10 +19,13 @@ GEM
http (0.5.0)
http_parser.rb
http_parser.rb (0.6.0)
i18n (0.6.9)
json (1.8.1)
memoizable (0.4.0)
thread_safe (~> 0.1.3)
method_source (0.8.2)
minitest (4.7.5)
multi_json (1.8.4)
multipart-post (2.0.0)
naught (1.0.0)
pry (0.9.12.6)
Expand All @@ -37,6 +47,10 @@ GEM
memoizable (~> 0.4.0)
naught (~> 1.0)
simple_oauth (~> 0.2.0)
tzinfo (0.3.38)
whenever (0.9.0)
activesupport (>= 2.3.4)
chronic (>= 0.6.3)

PLATFORMS
ruby
Expand All @@ -45,3 +59,4 @@ DEPENDENCIES
graph
pry
twitter
whenever
2 changes: 1 addition & 1 deletion bin/twitter_link_chain
Expand Up @@ -16,7 +16,7 @@ ensure
chain.display_graph(chain.traveled_path)
end

binding.pry
# binding.pry
# start_tweet = Tweet.new("https://twitter.com/aviflombaum/status/433591949921366016", "aviflombaum", "https://twitter.com/_stevennunez/status/433591245471223808", 433591949921366016)
# chain = TwitterLinkChain.new(start_tweet)

Expand Down
26 changes: 26 additions & 0 deletions config/schedule.rb
@@ -0,0 +1,26 @@
# Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron

# Example:
#
# set :output, "/path/to/my/cron_log.log"
#
# every 2.hours do
# command "/usr/bin/some_great_command"
# runner "MyModel.some_method"
# rake "some:great:rake:task"
# end
#
# every 4.days do
# runner "AnotherModel.prune_old_records"
# end

# Learn more: http://github.com/javan/whenever

every 20.minutes do
command "mv /Users/loganhasson/Development/code/flatiron/curriculum/twitter-link-chain/test.dot /Users/loganhasson/Development/code/flatiron/curriculum/twitter-link-chain/test.dot.bak"
command "mv /Users/loganhasson/Development/code/flatiron/curriculum/twitter-link-chain/test.png /Users/loganhasson/Development/code/flatiron/curriculum/twitter-link-chain/test.png.bak"
command "ruby /Users/loganhasson/Development/code/flatiron/curriculum/twitter-link-chain/bin/twitter_link_chain"
end
224 changes: 224 additions & 0 deletions test.dot

Large diffs are not rendered by default.

Binary file modified test.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d95acc6

Please sign in to comment.