forked from kanet77/togglv8
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tk
committed
Aug 18, 2015
1 parent
f866bfc
commit 9e2e50e
Showing
18 changed files
with
595 additions
and
612 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
faraday.log | ||
toggl_entities.txt | ||
me.json | ||
/doc/ | ||
/pkg/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--require spec_helper |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'faraday', '~> 0.8.7' | ||
gem 'awesome_print', '~> 1.1.0' | ||
gem 'json', '~> 1.8.0' | ||
gem 'logger', '~> 1.2.8' | ||
gem 'jazor', '~> 0.1.8' | ||
# Specify your gem's dependencies in togglv8.gemspec | ||
gemspec |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,43 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
togglv8 (0.2.0) | ||
faraday (~> 0.9) | ||
oj (~> 2.12) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
awesome_print (1.1.0) | ||
faraday (0.8.7) | ||
multipart-post (~> 1.1) | ||
jazor (0.1.8) | ||
json | ||
term-ansicolor | ||
json (1.8.0) | ||
logger (1.2.8) | ||
multipart-post (1.2.0) | ||
term-ansicolor (1.2.1) | ||
tins (~> 0.8) | ||
tins (0.8.0) | ||
awesome_print (1.6.1) | ||
diff-lcs (1.2.5) | ||
faraday (0.9.1) | ||
multipart-post (>= 1.2, < 3) | ||
multipart-post (2.0.0) | ||
oj (2.12.12) | ||
rake (10.4.2) | ||
rspec (3.3.0) | ||
rspec-core (~> 3.3.0) | ||
rspec-expectations (~> 3.3.0) | ||
rspec-mocks (~> 3.3.0) | ||
rspec-core (3.3.2) | ||
rspec-support (~> 3.3.0) | ||
rspec-expectations (3.3.1) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.3.0) | ||
rspec-mocks (3.3.2) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.3.0) | ||
rspec-support (3.3.0) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
awesome_print (~> 1.1.0) | ||
faraday (~> 0.8.7) | ||
jazor (~> 0.1.8) | ||
json (~> 1.8.0) | ||
logger (~> 1.2.8) | ||
awesome_print (~> 1.6) | ||
bundler (~> 1.7) | ||
rake (~> 10.4) | ||
rspec (~> 3.3) | ||
togglv8! | ||
|
||
BUNDLED WITH | ||
1.10.6 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Copyright (c) 2013-2015 Tom Kane | ||
|
||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,60 @@ | ||
# Toggl API v8 | ||
|
||
[Toggl](http://www.toggl.com) is a time tracking tool. | ||
|
||
[togglv8](/) is a Ruby Wrapper for [Toggl API v8](https://github.com/toggl/toggl_api_docs). It is designed to mirror the Toggl API as closely as possible. | ||
|
||
**Note:** Currently togglv8 only includes calls to [Toggl API](https://github.com/toggl/toggl_api_docs/blob/master/toggl_api.md), not the [Reports API](https://github.com/toggl/toggl_api_docs/blob/master/reports.md) | ||
|
||
# Usage | ||
- See [test.rb](test.rb) and [atest.rb](atest.rb) for examples of calling the Toggl API with Ruby. | ||
- See [API calls.md](API calls.md) for examples of calling the Toggl API with resty (like curl) on the command line. | ||
## Installation | ||
|
||
Add this line to your application's Gemfile: | ||
|
||
```ruby | ||
gem 'togglv8' | ||
``` | ||
|
||
And then execute: | ||
|
||
$ bundle | ||
|
||
Or install it yourself as: | ||
|
||
$ gem install togglv8 | ||
|
||
## Usage | ||
|
||
This short example shows one way to create a time entry for the first workspace of the user identified by `<API_TOKEN>`: | ||
|
||
```ruby | ||
require 'togglv8' | ||
|
||
toggl = Toggl::V8.new(<API_TOKEN>) | ||
user = toggl.me(all=true) | ||
workspaces = toggl.my_workspaces(user) | ||
workspace_id = workspaces.first['id'] | ||
toggl.create_time_entry({description: "Workspace time entry", | ||
wid: workspace_id, | ||
duration: 1200, | ||
start: "2015-08-18T01:13:40.000Z", | ||
created_with: "My awesome Ruby application"}) | ||
``` | ||
|
||
See specs for more examples. | ||
|
||
## Acknowledgements | ||
|
||
# Acknowledgements | ||
- Thanks to [Koen Van der Auwera](https://github.com/atog) for the [Ruby Wrapper for Toggl API v6](https://github.com/atog/toggl) | ||
- Thanks to the Toggl team for exposing the API. | ||
|
||
# License | ||
Copyright (c) 2013 Tom Kane. Released under the [MIT License](http://opensource.org/licenses/mit-license.php). See [LICENSE](LICENSE) for details. | ||
## Contributing | ||
|
||
1. Fork it ( https://github.com/[my-github-username]/togglv8/fork ) | ||
2. Create your feature branch (`git checkout -b my-new-feature`) | ||
3. Commit your changes (`git commit -am 'Add some feature'`) | ||
4. Push to the branch (`git push origin my-new-feature`) | ||
5. Create a new Pull Request | ||
|
||
## License | ||
|
||
Copyright (c) 2013-2015 Tom Kane. Released under the [MIT License](http://opensource.org/licenses/mit-license.php). See [LICENSE.txt](LICENSE.txt) for details. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require "bundler/gem_tasks" | ||
|
Oops, something went wrong.