wrike3 0.2.1 → 0.3.1

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: b991c3ff24d08f39bf230931835ed0efa6910fca
4
- data.tar.gz: d9101ba5aedc1c31884e8862c2317ceccd6d858c
3
+ metadata.gz: 9d7e84172998b74ac2cce6fb4fa87f0200de1f6a
4
+ data.tar.gz: 0cb6b2379ab099e26a1e53a1d7d60dc92561f414
5
5
  SHA512:
6
- metadata.gz: 91149181a03c3f0c21faef0be928387ac70e191fb9de1fd89d8d0c71a8f380c615c8cebbbc8b4fe15c3cd8ae37fe482d76a524da0fc807f2e0f2df39dedf2644
7
- data.tar.gz: 720ff6a6bfa6dfac5a0f6ee85915790d08796e0dc5bbd7fbac5c1b9763d4d6f372619ae6c36da90bcd5bb744b99415a03d296117bae8e61c5c9392182efe6085
6
+ metadata.gz: 1b011b66f19404620f9be9ec30da226e422f53cb48b99700a67001ae46a0064bbe71cdcf3dbfc0e5883633c2cd85a377b7577dd170fbab8906538918cfdefa41
7
+ data.tar.gz: 75ca30cfbf73e0bfbb77ddc44c3810e5d2815cf81a6753b33eccd1824a20fb3514b1a61dc2f51f86fc0c1e5e3080dbd41d0e6fba382df037b84ca38aefff3f04
@@ -12,5 +12,15 @@ module Wrike3
12
12
  path = "#{type}/#{id}/#{path}" if type.present? && id.present?
13
13
  path
14
14
  end
15
+
16
+ def to_j(parameters = {})
17
+ parameters.each do |item|
18
+ if item.last.is_a?(Hash) || item.last.is_a?(Array)
19
+ parameters[item.first.to_s] = item.last.to_json
20
+ end
21
+ end
22
+
23
+ parameters
24
+ end
15
25
  end
16
26
  end
@@ -11,19 +11,23 @@ module Wrike3
11
11
  end
12
12
 
13
13
  # Get folder data
14
- def details(ids, options={})
15
- wrike.execute(:get, api_url("folders/#{ids}"), options)
14
+ def details(ids, params={})
15
+ wrike.execute(:get, api_url("folders/#{ids}"), to_j(params))
16
+ end
17
+
18
+ # create a folder
19
+ def create(id, params = {})
20
+ wrike.execute(:post, api_url("/folders/#{id}/folders"), to_j(params))
16
21
  end
17
22
 
18
23
  # Update a folder
19
- def update(id, data = {}, options={})
20
- wrike.execute(:put, api_url("folders/#{id}"), options.merge(data))
24
+ def update(id, params = {})
25
+ wrike.execute(:put, api_url("folders/#{id}"), to_j(params))
21
26
  end
22
27
 
23
28
  # Delete folders and all descendants
24
- def delete(id, options={})
25
- wrike.execute(:delete, api_url("folders/#{id}"), options)
29
+ def delete(id, params={})
30
+ wrike.execute(:delete, api_url("folders/#{id}"), to_j(params))
26
31
  end
27
-
28
32
  end
29
33
  end
@@ -1,3 +1,3 @@
1
1
  module Wrike3
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrike3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morshed Alam
@@ -14,62 +14,62 @@ dependencies:
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.13.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.13.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mime-types
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.99'
34
- - - '>='
34
+ - - ">="
35
35
  - !ruby/object:Gem::Version
36
36
  version: 2.99.1
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ~>
41
+ - - "~>"
42
42
  - !ruby/object:Gem::Version
43
43
  version: '2.99'
44
- - - '>='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.99.1
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: shoulda
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ~>
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
53
  version: '3.5'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ~>
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '3.5'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: mocha
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ~>
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
67
  version: '1.1'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ~>
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '1.1'
75
75
  description: Ruby client to access Wrike API V3.
@@ -80,7 +80,7 @@ extra_rdoc_files:
80
80
  - README.md
81
81
  - LICENSE
82
82
  files:
83
- - .gitignore
83
+ - ".gitignore"
84
84
  - Gemfile
85
85
  - LICENSE
86
86
  - README.md
@@ -110,23 +110,23 @@ licenses:
110
110
  metadata: {}
111
111
  post_install_message:
112
112
  rdoc_options:
113
- - --inline-source
114
- - --charset=UTF-8
113
+ - "--inline-source"
114
+ - "--charset=UTF-8"
115
115
  require_paths:
116
116
  - lib
117
117
  required_ruby_version: !ruby/object:Gem::Requirement
118
118
  requirements:
119
- - - '>='
119
+ - - ">="
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - '>='
124
+ - - ">="
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements: []
128
128
  rubyforge_project: wrike3
129
- rubygems_version: 2.4.5
129
+ rubygems_version: 2.5.1
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Wrike API extension