planning_client 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjRkYTQ4MTc2ZDI0OGJkYjlkZjVkMmY0YTlmNGUwZmE0ZTkyN2VhYw==
4
+ ZDY4YTc1ZDFhNjMwZTI1MDYwOTE0N2QzNzFiNTJmOWNhNjJjMDZkYg==
5
5
  data.tar.gz: !binary |-
6
- NTJlMTc4NDY2ZWEzNmU3YzY3OWJkOTNiZjY4ZjRhOTljZWE3OTU4Yg==
6
+ NTgwNWUxN2U0ZjQ2YWRkMWRhNDNkNjA3ZTI1NWNmNmM1OGUxODI0Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NGNhNThkZjIxZTQxNDE4YzBhNjhmMzA2NzI3NGVmZTRmMTExYWQ3YWEzZTFk
10
- OGYzMDAwZThlMmIzM2ZhYmI1ZTM1ZGM5NmMxNThmNGRhZDA3MDU2OWY2MGZh
11
- Mzc4ZGQ3YzdjMTQyYjkzYTZhNWM4NjI5YTAzMTQ5ZDlhYmRhMDY=
9
+ MTk0Y2NjMDZjMjRkNzkzZmU2NDUxNjg0ZmU3N2U3ZTA4OWNmZGZiMDVmMzFh
10
+ YWE2ZjY2ZTBjMjNiN2ViMDQyOGVlMDdhMTU1MDdiNmM2YWM5ZTBjYjk2Mzky
11
+ YjkzYThmYTk1OWFmMGE4MTNiNjBlYThhZDk2N2ZiNDhjYmExMDU=
12
12
  data.tar.gz: !binary |-
13
- NGM3MWM4YTIzYWJiZDNmYzBkZDUzYmEwOWM5ZjhmZTkwMGY2ZTQ5MGIxMWYz
14
- ZjVlOTRiMWY3OWYxNTg0NDkzYWM0ZTY3M2M3Nzg1ZTAzNjY4YzBhMDQyMmUw
15
- MTc5ZGNjMWE0MmVjOGI3ZTIxMDAyNGEwYTA2NmFhNzViMWExYWE=
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
- set_resource_path '/v0/checklists'
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
- set_resource_path '/v0/checklist_items'
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
- set_resource_path '/v0/to_dos'
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 :context_type
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.3
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: 2014-05-07 00:00:00.000000000 Z
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.1.11
74
+ rubygems_version: 2.4.6
74
75
  signing_key:
75
76
  specification_version: 4
76
77
  summary: Client library for padma-planning-ws