harvested 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +4 -1
- data/README.md +12 -8
- data/VERSION +1 -1
- data/harvested.gemspec +3 -3
- data/lib/harvest/user.rb +10 -9
- metadata +4 -4
data/HISTORY
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
0.5.2 - August 17, 2012
|
2
|
+
* Adding new field password_change_required to Users
|
3
|
+
0.5.1 - June 27, 2012
|
4
|
+
* Updating README and harvested_credentials.example.yml with warnings about normal accounts
|
1
5
|
0.5.0 - June 18, 2012
|
2
6
|
* Bugfixes on User: https://github.com/zmoazeni/harvested/pull/26
|
3
7
|
* Bugfixes on TimeEntry: https://github.com/zmoazeni/harvested/pull/25
|
@@ -32,4 +36,3 @@
|
|
32
36
|
* Added account information
|
33
37
|
* Added common errors
|
34
38
|
* Added Harvest#hardy_client
|
35
|
-
|
data/README.md
CHANGED
@@ -8,12 +8,14 @@ This is a Ruby wrapper for the [Harvest API](http://www.getharvest.com/).
|
|
8
8
|
|
9
9
|
## Examples
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
```ruby
|
12
|
+
harvest = Harvest.client('yoursubdomain', 'yourusername', 'yourpassword')
|
13
|
+
harvest.projects() # list out projects
|
14
|
+
|
15
|
+
client = Harvest::Client.new(:name => "Billable Company LTD.")
|
16
|
+
client = harvest.clients.create(client)
|
17
|
+
harvest.clients.find(client.id) # returns a Harvest::Client
|
18
|
+
```
|
17
19
|
|
18
20
|
You can find more examples in `/examples` and in the documentation for Harvest::Base
|
19
21
|
|
@@ -23,8 +25,10 @@ The guys at Harvest built a great API, but there are always dangers in writing c
|
|
23
25
|
|
24
26
|
Using `Harvested#client` your code needs to handle all these situations. However you can also use `Harvested#hardy_client` which will retry errors and wait for Rate Limit resets.
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
+
```ruby
|
29
|
+
harvest = Harvest.hardy_client('yoursubdomain', 'yourusername', 'yourpassword')
|
30
|
+
harvest.projects() # This will wait for the Rate Limit reset if you have gone over your limit
|
31
|
+
```
|
28
32
|
|
29
33
|
## Ruby support
|
30
34
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.2
|
data/harvested.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "harvested"
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Zach Moazeni"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-08-17"
|
13
13
|
s.description = "Harvested wraps the Harvest API concisely without the use of Rails dependencies. More information about the Harvest API can be found on their website (http://www.getharvest.com/api). For support hit up the Mailing List (http://groups.google.com/group/harvested)"
|
14
14
|
s.email = "zach.moazeni@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -102,7 +102,7 @@ Gem::Specification.new do |s|
|
|
102
102
|
]
|
103
103
|
s.homepage = "http://github.com/zmoazeni/harvested"
|
104
104
|
s.require_paths = ["lib"]
|
105
|
-
s.rubygems_version = "1.8.
|
105
|
+
s.rubygems_version = "1.8.23"
|
106
106
|
s.summary = "A Ruby Wrapper for the Harvest API http://www.getharvest.com/"
|
107
107
|
|
108
108
|
if s.respond_to? :specification_version then
|
data/lib/harvest/user.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Harvest
|
2
|
-
|
2
|
+
|
3
3
|
# The model that contains information about a task
|
4
4
|
#
|
5
5
|
# == Fields
|
@@ -17,7 +17,7 @@ module Harvest
|
|
17
17
|
# [+timezone+] the timezone for the user.
|
18
18
|
class User < Hashie::Dash
|
19
19
|
include Harvest::Model
|
20
|
-
|
20
|
+
|
21
21
|
api_path '/people'
|
22
22
|
property :id
|
23
23
|
property :email
|
@@ -53,25 +53,26 @@ module Harvest
|
|
53
53
|
property :timestamp_timers
|
54
54
|
property :weekly_digest_sent_on
|
55
55
|
property :wants_weekly_digest
|
56
|
-
|
56
|
+
property :password_change_required
|
57
|
+
|
57
58
|
alias_method :active?, :is_active
|
58
59
|
alias_method :admin?, :is_admin
|
59
60
|
alias_method :contractor?, :is_contractor
|
60
|
-
|
61
|
+
|
61
62
|
def initialize(args = {})
|
62
63
|
args = args.stringify_keys
|
63
64
|
args["is_admin"] = args.delete("admin") if args["admin"]
|
64
65
|
self.timezone = args.delete("timezone") if args["timezone"]
|
65
66
|
super
|
66
67
|
end
|
67
|
-
|
68
|
+
|
68
69
|
# Sets the timezone for the user. This can be done in a variety of ways.
|
69
|
-
#
|
70
|
+
#
|
70
71
|
# == Examples
|
71
72
|
# user.timezone = :cst # the easiest way. CST, EST, MST, and PST are supported
|
72
|
-
#
|
73
|
+
#
|
73
74
|
# user.timezone = 'america/chicago' # a little more verbose
|
74
|
-
#
|
75
|
+
#
|
75
76
|
# user.timezone = 'Central Time (US & Canada)' # the most explicit way
|
76
77
|
def timezone=(timezone)
|
77
78
|
tz = timezone.to_s.downcase
|
@@ -89,4 +90,4 @@ module Harvest
|
|
89
90
|
end
|
90
91
|
end
|
91
92
|
end
|
92
|
-
end
|
93
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: harvested
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -277,7 +277,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
277
277
|
version: '0'
|
278
278
|
segments:
|
279
279
|
- 0
|
280
|
-
hash:
|
280
|
+
hash: 1938561577439091912
|
281
281
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
282
282
|
none: false
|
283
283
|
requirements:
|
@@ -286,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
286
286
|
version: '0'
|
287
287
|
requirements: []
|
288
288
|
rubyforge_project:
|
289
|
-
rubygems_version: 1.8.
|
289
|
+
rubygems_version: 1.8.23
|
290
290
|
signing_key:
|
291
291
|
specification_version: 3
|
292
292
|
summary: A Ruby Wrapper for the Harvest API http://www.getharvest.com/
|