planning_client 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDY4YTc1ZDFhNjMwZTI1MDYwOTE0N2QzNzFiNTJmOWNhNjJjMDZkYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTgwNWUxN2U0ZjQ2YWRkMWRhNDNkNjA3ZTI1NWNmNmM1OGUxODI0Nw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTk0Y2NjMDZjMjRkNzkzZmU2NDUxNjg0ZmU3N2U3ZTA4OWNmZGZiMDVmMzFh
|
10
|
+
YWE2ZjY2ZTBjMjNiN2ViMDQyOGVlMDdhMTU1MDdiNmM2YWM5ZTBjYjk2Mzky
|
11
|
+
YjkzYThmYTk1OWFmMGE4MTNiNjBlYThhZDk2N2ZiNDhjYmExMDU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTVhMzRhOWZlOGM3MWZiZmY0YmRjZGYzYjQ5NDdmY2EzZDFjNjA1MjRiOTQ3
|
14
|
+
ZDBlZDdhNzliZDMwNDJhM2IyMzM3OTk4N2IxOTlhMTY4YTU3OWQ2OGZlZjBl
|
15
|
+
YzVmMmFhM2Q1NWQ0NTAyNjM4MGI5NDBjMzI3YmJjOGE0MGFkZjU=
|
@@ -4,7 +4,7 @@ module PlanningClient
|
|
4
4
|
class Checklist < LogicalModel
|
5
5
|
include PlanningClient::ServiceConfiguration
|
6
6
|
|
7
|
-
|
7
|
+
set_resource_url PlanningClient::HOST, '/v0/checklists'
|
8
8
|
|
9
9
|
attribute :id
|
10
10
|
attribute :name
|
@@ -12,30 +12,6 @@ module PlanningClient
|
|
12
12
|
|
13
13
|
has_many :items, class: 'PlanningClient::ChecklistItem'
|
14
14
|
|
15
|
-
|
16
|
-
# Copies checklists items as to_dos
|
17
|
-
#
|
18
|
-
# @param options [Hash]
|
19
|
-
# @option options [String] responsible_username
|
20
|
-
# @option options [String] requester_username
|
21
|
-
#
|
22
|
-
# @example @checklist.assign(responsible_username: 'dwayne', requester_username: 'lucia')
|
23
|
-
#
|
24
|
-
# @return [Boolean]
|
25
|
-
def assign_to(options={})
|
26
|
-
resp = Typhoeus::Request.get("#{self.class.resource_uri(self.id)}/assign",
|
27
|
-
params: self.class.merge_key(options))
|
28
|
-
if resp.code == 200
|
29
|
-
log_ok(resp)
|
30
|
-
true
|
31
|
-
else
|
32
|
-
log_failed(resp)
|
33
|
-
false
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def json_root
|
38
|
-
'checklist'
|
39
|
-
end
|
15
|
+
# TODO assign_to -- we need to add support for responsible/requester username on checklist assignment
|
40
16
|
end
|
41
17
|
end
|
@@ -4,7 +4,7 @@ module PlanningClient
|
|
4
4
|
class ChecklistItem < LogicalModel
|
5
5
|
include PlanningClient::ServiceConfiguration
|
6
6
|
|
7
|
-
|
7
|
+
set_resource_url PlanningClient::HOST, '/v0/checklist_items'
|
8
8
|
|
9
9
|
attribute :id
|
10
10
|
|
@@ -20,5 +20,6 @@ module PlanningClient
|
|
20
20
|
def json_root
|
21
21
|
'checklist_item'
|
22
22
|
end
|
23
|
+
|
23
24
|
end
|
24
25
|
end
|
@@ -4,14 +4,14 @@ module PlanningClient
|
|
4
4
|
class ToDo < LogicalModel
|
5
5
|
include PlanningClient::ServiceConfiguration
|
6
6
|
|
7
|
-
|
7
|
+
set_resource_url PlanningClient::HOST, '/v0/to_dos'
|
8
8
|
|
9
9
|
attribute :id
|
10
10
|
|
11
11
|
attribute :state
|
12
12
|
|
13
13
|
attribute :context_id
|
14
|
-
attribute :
|
14
|
+
attribute :contact_type
|
15
15
|
|
16
16
|
attribute :requester_username
|
17
17
|
attribute :responsible_username
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'planning_client/service_configuration'
|
2
|
+
|
3
|
+
module PlanningClient
|
4
|
+
class User < LogicalModel
|
5
|
+
|
6
|
+
include PlanningClient::ServiceConfiguration
|
7
|
+
|
8
|
+
set_resource_url PlanningClient::HOST, '/v0/users'
|
9
|
+
|
10
|
+
attribute :id
|
11
|
+
attribute :daily_email_reminder_enabled
|
12
|
+
attribute :username
|
13
|
+
|
14
|
+
def set_email_options(value)
|
15
|
+
if daily_email_reminder_enabled != value
|
16
|
+
self.daily_email_reminder_enabled = value
|
17
|
+
self.save
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.find_by_name (username)
|
22
|
+
self.find(1, {username: username})
|
23
|
+
end
|
24
|
+
|
25
|
+
def json_root
|
26
|
+
'user'
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
@@ -3,14 +3,6 @@ module PlanningClient
|
|
3
3
|
def self.included(base)
|
4
4
|
base.send('use_hydra', PlanningClient::HYDRA)
|
5
5
|
|
6
|
-
host = case ENV['RACK_ENV']
|
7
|
-
when 'development'
|
8
|
-
PlanningClient::HOST
|
9
|
-
when 'production'
|
10
|
-
'padma-planning.heroku.com'
|
11
|
-
end
|
12
|
-
|
13
|
-
base.send('set_resource_host', host)
|
14
6
|
base.send('configure_index_response', {collection: 'collection', total: 'total'})
|
15
7
|
|
16
8
|
base.send('set_api_key','app_key',ENV['planning_api_key'])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: planning_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dwayne Macgowan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -45,12 +45,13 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- app/models/planning_client/checklist_item.rb
|
49
48
|
- app/models/planning_client/checklist.rb
|
49
|
+
- app/models/planning_client/checklist_item.rb
|
50
50
|
- app/models/planning_client/to_do.rb
|
51
|
+
- app/models/planning_client/user.rb
|
52
|
+
- lib/planning_client.rb
|
51
53
|
- lib/planning_client/railties.rb
|
52
54
|
- lib/planning_client/service_configuration.rb
|
53
|
-
- lib/planning_client.rb
|
54
55
|
homepage: ''
|
55
56
|
licenses: []
|
56
57
|
metadata: {}
|
@@ -70,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
71
|
version: '0'
|
71
72
|
requirements: []
|
72
73
|
rubyforge_project:
|
73
|
-
rubygems_version: 2.
|
74
|
+
rubygems_version: 2.4.6
|
74
75
|
signing_key:
|
75
76
|
specification_version: 4
|
76
77
|
summary: Client library for padma-planning-ws
|