Created
June 28, 2016 19:31
-
-
Save iCHAIT/9167a047a4be5e5454eaa61160ec35d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### GET METHODS | |
# ==================== | |
print("\n\n########get_activities()########\n\n") | |
puts ts.get_activities | |
print("\n\n########get_projects()########\n\n") | |
puts ts.get_projects | |
print("\n\n########get_times()########\n\n") | |
puts ts.get_times | |
print("\n\n########get_users()########\n\n") | |
puts ts.get_users | |
# ====================================================== | |
### CREATE METHODS | |
# ==================== | |
print("\n\n########create_activity()########\n\n") | |
activity = Hash[ | |
"name" => "coding on project", | |
"slug" => "codi" | |
] | |
puts ts.create_activity(activity=activity) | |
print("\n\n########create_project()########\n\n") | |
project = Hash[ | |
"uri": "https://code.osuosl.org/projects/random", | |
"name": "random", | |
"slugs": ["rand"], | |
] | |
puts ts.create_project(project = project) | |
print("\n\n########create_time()########\n\n") | |
time = Hash[ | |
'duration' => 120, | |
'user' => 'ichait', | |
'project' => 'random', | |
'activities' => ['docs'], | |
'notes' => 'Worked on documentation.', | |
'issue_uri' => 'https://github.com/osuosl/random/issues', | |
'date_worked' => '2014-04-17' | |
] | |
puts ts.create_time(time) | |
print("\n\n########create_user()########\n\n") | |
user = Hash[ | |
"username" => "test", | |
"password" => "passw", | |
"display_name" => "testuser", | |
"email" => "[email protected]" | |
] | |
puts ts.create_user(user) | |
### UPDATE METHODS | |
# ======================= | |
print("\n\n########update_activity()########\n\n") | |
activity = Hash["name" => "other"] | |
print ts.update_activity(activity = activity, slug="codi") | |
print("\n\n########update_project()########\n\n") | |
project = Hash[ | |
"uri" => "https://code.osuosl.org/another", | |
"name" => "random 2.0", | |
] | |
print ts.update_project(project=project, slug="rand") | |
print("\n\n########update_time()########\n\n") | |
time = Hash[ | |
"duration" => 30, | |
"user" => "ichait", | |
"activities" => ["docs"], | |
] | |
print ts.update_time(time=time, uuid="b466f28b-a0ae-4927-b079-1e3eccf2ccd3") | |
print("\n\n########update_user()########\n\n") | |
user = Hash[ | |
"username" => "random user", | |
"email" => "[email protected]" | |
] | |
print ts.update_user(user=user, username="test") | |
### DELETE METHODS | |
# ==================== | |
print("\n\n########delete_activity()########\n\n") | |
puts ts.delete_activity(slug="codi") | |
print("\n\n########delete_project()########\n\n") | |
print ts.delete_project(slug="rand") | |
print("\n\n########delete_times()########\n\n") | |
puts ts.delete_time(uuid="9018ffab-2bbb-4b70-9363-84ab3e85038e") | |
print("\n\n########delete_user()########\n\n") | |
puts ts.delete_user(username="random user") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment