Sha256: 83a12bc23e1630b305314843765fa994a241e76a85c27e462136dba8bcbe9134

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

#!/usr/bin/env ruby

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'letsfreckle'

# Configure the API credentials.
LetsFreckle.configure do
  account_host "apitest"
  username "apitest@letsfreckle.com"
  token "lx3gi6pxdjtjn57afp8c2bv1me7g89j"
end

puts "Fetch all entries:"
LetsFreckle::Entry.all.each do |entry|
  puts "Entry #{entry.description} - #{entry.minutes} minutes"
end

puts "Search for entries from a specific start date and tags:"
LetsFreckle::Entry.find(:from => '2010-07-10', :tags => ['development', 'design']).each do |entry|
  puts entry.description
end

puts "Fetch all projects and associated entries:"
LetsFreckle::Project.all.each do |project|
  puts "Project #{project.name} has #{project.entries.size} entries"
end

puts "Fetch all tags and associated entries:"
LetsFreckle::Tag.all.each do |tag|
  puts "Tag #{tag.name} has #{tag.entries.size} entries"
end

puts "Fetch all users and associated permissions:"
LetsFreckle::User.all.each do |user|
  puts "User #{user.email} has following permissions: #{user.permissions}"
end





Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
letsfreckle-client-0.2.1 bin/run-examples
letsfreckle-client-0.2.0 bin/run-examples