Skip to content

Commit

Permalink
Convert to gem.
Browse files Browse the repository at this point in the history
  • Loading branch information
tk committed Aug 18, 2015
1 parent f866bfc commit 9e2e50e
Show file tree
Hide file tree
Showing 18 changed files with 595 additions and 612 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
faraday.log
toggl_entities.txt
me.json
/doc/
/pkg/
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
7 changes: 2 additions & 5 deletions Gemfile
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
52 changes: 35 additions & 17 deletions Gemfile.lock
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
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

22 changes: 22 additions & 0 deletions LICENSE.txt
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.
55 changes: 49 additions & 6 deletions README.md
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.
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require "bundler/gem_tasks"

1 change: 0 additions & 1 deletion VERSION

This file was deleted.

22 changes: 0 additions & 22 deletions atest.rb

This file was deleted.

Loading

0 comments on commit 9e2e50e

Please sign in to comment.