ten_thousand_feet 0.1.4 → 0.2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 423d27319bef89916735e7e67ec1be6c35b65f0b
4
- data.tar.gz: 17ff7544b560258eb31f9f029bfe2be68dce4afc
3
+ metadata.gz: 157001c2b5953ba3cdff13aec21c6f8e6e514928
4
+ data.tar.gz: 2ca53877b2f78aeb4caa023761cedcb614d54d88
5
5
  SHA512:
6
- metadata.gz: deb48924831e7dd0a4aa484a90d2fa337d6c495bd32e5ed581bf446682a11a7e36c3946f40f42335b97f80dd9b2cd1917289b9be7063c45381ee703d9ec17797
7
- data.tar.gz: dc3483357fbef8a7008bef3e2f42e51e02fc170d540c2ba46fab0ee4f151e282394267799f9c45e6e2b529e66fe37996edcf04f61e6fe29c5a77dcdcb7082457
6
+ metadata.gz: f512bfea7f2865f83d62d77fe512d85e902fa34cbdbf9fe640ac25389e170c19da9e63d27b585bb0eb3dd779172e3302e1e1b09b00387285fa8cad3117c1a8ed
7
+ data.tar.gz: f2505d2da2dc4603d1df3672836561ec2a77c7c66eff05c4b2aa76066f53ac7f99244f46b333fdd018cd7005e31da3d170bbef8199296149c0b0ed2a4139ea35
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ Documentation:
2
+ Enabled: false
3
+
4
+ LineLength:
5
+ Max: 120
6
+
7
+ Style/FileName:
8
+ Enabled: false
9
+
10
+ Metrics/AbcSize: # this appears to be broken
11
+ Enabled: false
12
+
13
+ Metrics/MethodLength:
14
+ Max: 25
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ ten_thousand_feet
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ ### Changelog ###
2
+ - 0.2.0.0
3
+ - Ownership transferred to SpinDance from TackMobile
4
+ - Add 2 methods to retrieve bill rates
5
+ - Add method to retrieve all time entries
6
+
7
+ - 0.1.4 and prior
8
+ - Owned and developed by different company (TackMobile)
data/README.md CHANGED
@@ -48,7 +48,7 @@ Note: 'options' will be different for each method. Check the official API docume
48
48
  client.create_user_status(user_id, options)
49
49
 
50
50
  ## Assignments
51
-
51
+
52
52
  client.get_assignments(user_id, options)
53
53
  client.show_assignment(assignment_id, user_id, options)
54
54
  client.create_assignment(user_id, options)
@@ -65,7 +65,7 @@ Note: 'options' will be different for each method. Check the official API docume
65
65
  client.get_project_users(project_id, options)
66
66
 
67
67
  ## Phases
68
-
68
+
69
69
  client.get_phases(project_id, options)
70
70
  client.create_phases(project_id, options)
71
71
  client.update_phases(project_id, phase_id, options)
@@ -77,12 +77,18 @@ Note: 'options' will be different for each method. Check the official API docume
77
77
  client.update_time_entry(time_entry_id, user_id, options)
78
78
  client.create_time_entry(user_id, options)
79
79
  client.delete_time_entry(time_entry_id, user_id, project_id, options)
80
+ client.get_all_time_entries(options)
80
81
 
81
82
  ## Leave Types
82
83
 
83
84
  client.get_leave_types(options)
84
85
  client.show_leave_types(leave_type_id, options)
85
86
 
87
+ ## Bill Rates
88
+
89
+ client.get_bill_rate(project_id, bill_rate_id, options)
90
+ client.get_bill_rates(project_id, options)
91
+
86
92
  ## To-Do
87
93
 
88
94
  * Budget Items
@@ -1,8 +1,8 @@
1
- require "ten_thousand_feet/version"
1
+ require 'ten_thousand_feet/version'
2
2
  require 'ten_thousand_feet/client'
3
3
 
4
4
  module TenThousandFeet
5
- def self.new(options={})
5
+ def self.new(options = {})
6
6
  TenThousandFeet::Client.new(options)
7
7
  end
8
8
  end
@@ -1,23 +1,21 @@
1
1
  module TenThousandFeet
2
2
  module API
3
3
  module Assignments
4
-
5
- def get_assignments(user_id, options={})
4
+ def get_assignments(user_id, options = {})
6
5
  get("/users/#{user_id}/assignments", options)
7
6
  end
8
7
 
9
- def show_assignment(id, user_id, options={})
8
+ def show_assignment(id, user_id, options = {})
10
9
  get("/users/#{user_id}/assignments/#{id}", options)
11
10
  end
12
11
 
13
- def create_assignment(user_id, options={})
12
+ def create_assignment(user_id, options = {})
14
13
  post("/users/#{user_id}/assignments", options)
15
14
  end
16
15
 
17
- def delete_assignment(id, user_id, options={})
16
+ def delete_assignment(id, user_id, options = {})
18
17
  delete("/users/#{user_id}/assignments/#{id}", options)
19
18
  end
20
-
21
19
  end
22
20
  end
23
21
  end
@@ -0,0 +1,13 @@
1
+ module TenThousandFeet
2
+ module API
3
+ module BillRates
4
+ def get_bill_rate(project_id, bill_rate_id, options = {})
5
+ get("/projects/#{project_id}/bill_rates/#{bill_rate_id}", options)
6
+ end
7
+
8
+ def get_bill_rates(project_id, options = {})
9
+ get("/projects/#{project_id}/bill_rates", options)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,15 +1,13 @@
1
1
  module TenThousandFeet
2
2
  module API
3
3
  module LeaveTypes
4
-
5
- def get_leave_types(options={})
6
- get("/leave_types", options)
4
+ def get_leave_types(options = {})
5
+ get('/leave_types', options)
7
6
  end
8
7
 
9
- def show_leave_type(id, options={})
8
+ def show_leave_type(id, options = {})
10
9
  get("/leave_types/#{id}", options)
11
10
  end
12
-
13
11
  end
14
12
  end
15
13
  end
@@ -1,19 +1,17 @@
1
1
  module TenThousandFeet
2
2
  module API
3
3
  module Phases
4
-
5
- def get_phases(project_id, options={})
4
+ def get_phases(project_id, options = {})
6
5
  get("/projects/#{project_id}/phases", options)
7
6
  end
8
7
 
9
- def create_phase(project_id, options={})
8
+ def create_phase(project_id, options = {})
10
9
  post("/projects/#{project_id}/phases", options)
11
10
  end
12
11
 
13
- def update_phase(project_id, phase_id, options={})
12
+ def update_phase(project_id, phase_id, options = {})
14
13
  put("/projects/#{project_id}/phases/#{phase_id}", options)
15
14
  end
16
-
17
15
  end
18
16
  end
19
- end
17
+ end
@@ -1,35 +1,33 @@
1
1
  module TenThousandFeet
2
2
  module API
3
3
  module Projects
4
-
5
- def get_projects(options={})
6
- get("/projects", options)
4
+ def get_projects(options = {})
5
+ get('/projects', options)
7
6
  end
8
7
 
9
- def show_project(id, options={})
8
+ def show_project(id, options = {})
10
9
  get("/projects/#{id}", options)
11
10
  end
12
11
 
13
- def create_project(options={})
14
- post("/projects", options)
12
+ def create_project(options = {})
13
+ post('/projects', options)
15
14
  end
16
15
 
17
- def update_project(id, options={})
16
+ def update_project(id, options = {})
18
17
  put("/projects/#{id}", options)
19
18
  end
20
19
 
21
- def delete_project(id, options={})
20
+ def delete_project(id, options = {})
22
21
  delete("/projects/#{id}", options)
23
22
  end
24
23
 
25
- def get_project_time_entries(id, options={})
24
+ def get_project_time_entries(id, options = {})
26
25
  get("/projects/#{id}/time_entries", options)
27
26
  end
28
27
 
29
- def get_project_users(id, options={})
28
+ def get_project_users(id, options = {})
30
29
  get("/projects/#{id}/users", options)
31
30
  end
32
-
33
31
  end
34
32
  end
35
- end
33
+ end
@@ -1,27 +1,29 @@
1
1
  module TenThousandFeet
2
2
  module API
3
3
  module TimeEntries
4
-
5
- def get_time_entries(user_id, options={})
4
+ def get_time_entries(user_id, options = {})
6
5
  get("/users/#{user_id}/time_entries", options)
7
6
  end
8
7
 
9
- def show_time_entry(id, user_id, options={})
8
+ def show_time_entry(id, user_id, options = {})
10
9
  get("/users/#{user_id}/time_entries/#{id}", options)
11
10
  end
12
11
 
13
- def create_time_entry(user_id, options={})
12
+ def create_time_entry(user_id, options = {})
14
13
  post("/users/#{user_id}/time_entries", options)
15
14
  end
16
15
 
17
- def update_time_entry(id, user_id, options={})
16
+ def update_time_entry(id, user_id, options = {})
18
17
  put("/users/#{user_id}/time_entries/#{id}", options)
19
18
  end
20
19
 
21
- def delete_time_entry(id, user_id, project_id, options={})
20
+ def delete_time_entry(id, user_id, project_id, options = {})
22
21
  delete("projects/#{project_id}/users/#{user_id}/time_entries/#{id}", options)
23
22
  end
24
-
23
+
24
+ def get_all_time_entries(options = {})
25
+ get('/time_entries', options)
26
+ end
25
27
  end
26
28
  end
27
- end
29
+ end
@@ -1,15 +1,13 @@
1
1
  module TenThousandFeet
2
2
  module API
3
3
  module UserStatus
4
-
5
- def get_user_statuses(user_id, options={})
4
+ def get_user_statuses(user_id, options = {})
6
5
  get("/users/#{user_id}/statuses", options)
7
6
  end
8
7
 
9
- def create_user_status(user_id, options={})
8
+ def create_user_status(user_id, options = {})
10
9
  post("/users/#{user_id}/statuses", options)
11
10
  end
12
-
13
11
  end
14
12
  end
15
- end
13
+ end
@@ -1,23 +1,21 @@
1
1
  module TenThousandFeet
2
2
  module API
3
3
  module Users
4
-
5
- def get_users(options={})
6
- get("/users", options)
4
+ def get_users(options = {})
5
+ get('/users', options)
7
6
  end
8
7
 
9
- def show_user(id, options={})
8
+ def show_user(id, options = {})
10
9
  get("/users/#{id}", options)
11
10
  end
12
11
 
13
- def create_user(options={})
14
- post("/users", options)
12
+ def create_user(options = {})
13
+ post('/users', options)
15
14
  end
16
15
 
17
- def update_user(id, options={})
16
+ def update_user(id, options = {})
18
17
  put("/users/#{id}", options)
19
18
  end
20
-
21
19
  end
22
20
  end
23
- end
21
+ end
@@ -9,10 +9,10 @@ require 'ten_thousand_feet/api/user_status'
9
9
  require 'ten_thousand_feet/api/assignments'
10
10
  require 'ten_thousand_feet/api/time_entries'
11
11
  require 'ten_thousand_feet/api/leave_types'
12
+ require 'ten_thousand_feet/api/bill_rates'
12
13
 
13
14
  module TenThousandFeet
14
15
  class Client
15
-
16
16
  attr_reader :auth
17
17
  attr_reader :api_url
18
18
 
@@ -23,10 +23,11 @@ module TenThousandFeet
23
23
  include API::Assignments
24
24
  include API::TimeEntries
25
25
  include API::LeaveTypes
26
-
27
- def initialize(options={})
26
+ include API::BillRates
27
+
28
+ def initialize(options = {})
28
29
  @auth = options[:auth]
29
- @api_url = options[:api_url] || "https://api.10000ft.com/api/v1"
30
+ @api_url = options[:api_url] || 'https://api.10000ft.com/api/v1'
30
31
  end
31
32
 
32
33
  def default_options
@@ -35,13 +36,13 @@ module TenThousandFeet
35
36
 
36
37
  def query_string(options)
37
38
  nodes = (options.count - 1)
38
- params = "?"
39
+ params = '?'
39
40
 
40
41
  options.each_with_index do |(key, value), index|
41
42
  if index == nodes
42
- params += key.to_s + "=" + URI.encode(value)
43
+ params += "#{key}=#{URI.encode(value)}"
43
44
  else
44
- params += key.to_s + "=" + URI.encode(value) + "&"
45
+ params += "#{key}=#{URI.encode(value)}&"
45
46
  end
46
47
  end
47
48
 
@@ -57,7 +58,7 @@ module TenThousandFeet
57
58
  end
58
59
 
59
60
  def get(path, options = {})
60
- response = RestClient.get(full_url(path), {params: default_options.merge(options) })
61
+ response = RestClient.get(full_url(path), params: default_options.merge(options))
61
62
 
62
63
  JSON.parse(response)
63
64
  end
@@ -1,3 +1,3 @@
1
1
  module TenThousandFeet
2
- VERSION = "0.1.4"
2
+ VERSION = '0.2.0.0'
3
3
  end
@@ -0,0 +1,43 @@
1
+ require 'spec_helper'
2
+
3
+ module TenThousandFeet
4
+ module API
5
+ describe BillRates do
6
+
7
+ let!(:client) { TenThousandFeet.new(auth: $AUTH) }
8
+ let!(:projects) {
9
+ VCR.use_cassette('projects') do
10
+ client.get_projects
11
+ end
12
+ }
13
+ let!(:project) { projects['data'][0] }
14
+ let!(:bill_rates) {
15
+ VCR.use_cassette('get_bill_rates') do
16
+ client.get_bill_rates(project['id'])
17
+ end
18
+ }
19
+ let!(:bill_rate) { bill_rates['data'][0] }
20
+
21
+ describe '#get_bill_rates' do
22
+ it 'retrieves all bill rates for given project' do
23
+ VCR.use_cassette('get_bill_rates') do
24
+ id = bill_rates['data'][0]['id']
25
+ bill_rate = client.get_bill_rates(project['id'])
26
+ expect(bill_rate['data'][0]['id']).to eq id
27
+ end
28
+ end
29
+ end
30
+
31
+ describe '#get_bill_rate' do
32
+ it 'retrieves a bill rate by id from a given project' do
33
+ VCR.use_cassette('get_bill_rate') do
34
+ id = bill_rates['data'][0]['id']
35
+ test_bill_rate = client.get_bill_rate(project['id'], bill_rate['id'])
36
+ expect(test_bill_rate['id']).to eq id
37
+ end
38
+ end
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -71,6 +71,15 @@ module TenThousandFeet
71
71
  end
72
72
  end
73
73
  end
74
+
75
+ describe '#get_all_time_entries' do
76
+ it 'retrieves all time entries' do
77
+ VCR.use_cassette('get_all_time_entries') do
78
+ hours = time_entries['data'][0]['hours']
79
+ expect(hours).to_not be_nil
80
+ end
81
+ end
82
+ end
74
83
  end
75
84
  end
76
- end
85
+ end
@@ -6,11 +6,11 @@ require 'ten_thousand_feet/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "ten_thousand_feet"
8
8
  spec.version = TenThousandFeet::VERSION
9
- spec.authors = ["Kyle Suss"]
10
- spec.email = ["susskyle@gmail.com"]
9
+ spec.authors = ["Kyle Suss", "Conor Livingston"]
10
+ spec.email = ["rubygems@spindance.com"]
11
11
  spec.description = %q{The 10,000ft Ruby API Client}
12
12
  spec.summary = %q{Provides Ruby wrappers for the 10,000ft API.}
13
- spec.homepage = "https://github.com/TackMobile/ten_thousand_feet"
13
+ spec.homepage = "https://github.com/spindance/ten_thousand_feet"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ten_thousand_feet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Suss
8
+ - Conor Livingston
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-02-06 00:00:00.000000000 Z
12
+ date: 2015-05-20 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rest-client
@@ -124,19 +125,24 @@ dependencies:
124
125
  version: 1.8.0
125
126
  description: The 10,000ft Ruby API Client
126
127
  email:
127
- - susskyle@gmail.com
128
+ - rubygems@spindance.com
128
129
  executables: []
129
130
  extensions: []
130
131
  extra_rdoc_files: []
131
132
  files:
132
133
  - ".gitignore"
133
134
  - ".rspec"
135
+ - ".rubocop.yml"
136
+ - ".ruby-gemset"
137
+ - ".ruby-version"
138
+ - CHANGELOG.md
134
139
  - Gemfile
135
140
  - LICENSE.txt
136
141
  - README.md
137
142
  - Rakefile
138
143
  - lib/ten_thousand_feet.rb
139
144
  - lib/ten_thousand_feet/api/assignments.rb
145
+ - lib/ten_thousand_feet/api/bill_rates.rb
140
146
  - lib/ten_thousand_feet/api/leave_types.rb
141
147
  - lib/ten_thousand_feet/api/phases.rb
142
148
  - lib/ten_thousand_feet/api/projects.rb
@@ -147,6 +153,7 @@ files:
147
153
  - lib/ten_thousand_feet/version.rb
148
154
  - spec/spec_helper.rb
149
155
  - spec/ten_thousand_feet/api/assignment_spec.rb
156
+ - spec/ten_thousand_feet/api/bill_rates_spec.rb
150
157
  - spec/ten_thousand_feet/api/phases_spec.rb
151
158
  - spec/ten_thousand_feet/api/projects_spec.rb
152
159
  - spec/ten_thousand_feet/api/time_entries_spec.rb
@@ -154,7 +161,7 @@ files:
154
161
  - spec/ten_thousand_feet/api/users_spec.rb
155
162
  - spec/ten_thousand_feet/client_spec.rb
156
163
  - ten_thousand_feet.gemspec
157
- homepage: https://github.com/TackMobile/ten_thousand_feet
164
+ homepage: https://github.com/spindance/ten_thousand_feet
158
165
  licenses:
159
166
  - MIT
160
167
  metadata: {}
@@ -174,13 +181,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
181
  version: '0'
175
182
  requirements: []
176
183
  rubyforge_project:
177
- rubygems_version: 2.4.5
184
+ rubygems_version: 2.4.6
178
185
  signing_key:
179
186
  specification_version: 4
180
187
  summary: Provides Ruby wrappers for the 10,000ft API.
181
188
  test_files:
182
189
  - spec/spec_helper.rb
183
190
  - spec/ten_thousand_feet/api/assignment_spec.rb
191
+ - spec/ten_thousand_feet/api/bill_rates_spec.rb
184
192
  - spec/ten_thousand_feet/api/phases_spec.rb
185
193
  - spec/ten_thousand_feet/api/projects_spec.rb
186
194
  - spec/ten_thousand_feet/api/time_entries_spec.rb