Sha256: d1827fc344b33462448067e6945e3fbbdfecaa65a858360e1d9617b9763c3e3c

Contents?: true

Size: 529 Bytes

Versions: 2

Compression:

Stored size: 529 Bytes

Contents

#!/usr/bin/env ruby

# Usage:
#
#   - Syncs reports since 31 days::
#       ruby scripts/sync.rb
#
#   - Sync reports since the specified date (use Ruby-parseable
#     format):
#       ruby scripts/sync.rb 2015-01-01

# Load dependencies
require 'rubygems'
require 'bundler/setup'

$LOAD_PATH.unshift File.expand_path('../..', __FILE__)
require 'config/boot'

date_since = (
  if ARGV[0].nil? || ARGV[0].empty?
    Time.now - 31 * 24 * 3600
  else
    Time.parse(ARGV[0])
  end
)
TogglCache.sync_reports(date_since: date_since)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
toggl_cache-0.2.1 scripts/sync.rb
toggl_cache-0.2.0 scripts/sync.rb