openproject_api 0.1.1 → 0.2.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
  SHA256:
3
- metadata.gz: 68cc46b14855c5f876562d29894f8178743f53d3b4b4b69aadbefac7122e1d3a
4
- data.tar.gz: f82e5b462670ba24fadc94df44d5b48d5911d4fa9126448ddf6994d9ce3fb807
3
+ metadata.gz: 9e768f366dd71718524170e9b4e5610a54aed63c35d86cd19772cd73c5a69e11
4
+ data.tar.gz: 5bcedaf082f3648bbeabab546e3b440c2e54dd59ea99b923e8b1b10f9837f50a
5
5
  SHA512:
6
- metadata.gz: e574c9fbcd7aa834ef87f1cd1a247bddbeb41d78525644a69fffb7101e2d6b7cc3d8c2c01999483a028c7a743f42dbc92081808d546adcac08eaca5f9aa19a03
7
- data.tar.gz: 653926c310c30d04a4eeacdf11f58de21903182d6ff42a935c9833e4f2049da65539f2dfd329e0b82f450d0206f61683a62cf21a3e96bacf0e166e97b08f7944
6
+ metadata.gz: c20f19f58e497d47eb2e219f7750a4d080a13c079a36fed2477c6f57a877b9147e034317e3ba62248e67bbd85249f31eed1c962eee5d7622ef40992a5ab3e1ec
7
+ data.tar.gz: 50befd7303f7ff119c6019741b01b4b36c5b37e79a4332e2d01ea71bfaad12f26bbac4528312af1eefa582cd812c70abbca2016d59613eb9b0c9df17dc3a8cab
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openproject_api (0.1.1)
4
+ openproject_api (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/Rakefile CHANGED
@@ -5,6 +5,6 @@ RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
7
 
8
- task :generate_files do
9
- File.write(File.expand_path('files.txt', __dir__), Dir['lib/**/*', 'Gemfile', 'Gemfile.lock', 'openproject-api.gemspec', 'Rakefile', 'files.txt'].join("\n"))
8
+ task :update_manifest do
9
+ File.write(File.expand_path('manifest', __dir__), Dir['lib/**/*', 'Gemfile', 'Gemfile.lock', 'openproject-api.gemspec', 'Rakefile', 'manifest'].join("\n"))
10
10
  end
@@ -7,9 +7,13 @@ module OpenprojectApi
7
7
  end
8
8
 
9
9
  include Projects
10
+ include Relations
11
+ include Root
10
12
  include Statuses
11
13
  include TimeEntries
12
14
  include Types
15
+ include UserPreferences
16
+ include Users
13
17
  include WorkPackages
14
18
  end
15
19
  end
@@ -9,7 +9,7 @@ module OpenprojectApi
9
9
  get("/api/v3/projects/#{project_id}", *args)
10
10
  end
11
11
 
12
- def patch_project(project_id, body, *args)
12
+ def update_project(project_id, body, *args)
13
13
  patch("/api/v3/projects/#{project_id}", body, *args)
14
14
  end
15
15
 
@@ -0,0 +1,21 @@
1
+ module OpenprojectApi
2
+ class Client
3
+ module Relations
4
+ def relations(*args)
5
+ get('/api/v3/relations', *args)
6
+ end
7
+
8
+ def relation(relation_id, *args)
9
+ get("/api/v3/relations/#{relation_id}", *args)
10
+ end
11
+
12
+ def update_relation(relation_id, body, *args)
13
+ patch("/api/v3/relations/#{relation_id}", body, *args)
14
+ end
15
+
16
+ def delete_relation(relation_id, *args)
17
+ delete("/api/v3/relations/#{relation_id}", *args)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,9 @@
1
+ module OpenprojectApi
2
+ class Client
3
+ module Root
4
+ def root(*args)
5
+ get('/api/v3', *args)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -9,7 +9,7 @@ module OpenprojectApi
9
9
  get("/api/v3/time_entries/#{time_entry_id}", *args)
10
10
  end
11
11
 
12
- def patch_time_entry(time_entry_id, body, *args)
12
+ def update_time_entry(time_entry_id, body, *args)
13
13
  patch("/api/v3/time_entries/#{time_entry_id}", body, *args)
14
14
  end
15
15
 
@@ -0,0 +1,13 @@
1
+ module OpenprojectApi
2
+ class Client
3
+ module UserPreferences
4
+ def my_preferences(*args)
5
+ get('/api/v3/my_preferences', *args)
6
+ end
7
+
8
+ def update_my_preferences(body, *args)
9
+ patch('/api/v3/my_preferences', body, *args)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,33 @@
1
+ module OpenprojectApi
2
+ class Client
3
+ module Users
4
+ def users(*args)
5
+ get('/api/v3/users', *args)
6
+ end
7
+
8
+ def user(user_id, *args)
9
+ get("/api/v3/users/#{user_id}", *args)
10
+ end
11
+
12
+ def update_user(user_id, body, *args)
13
+ patch("/api/v3/users/#{user_id}", body, *args)
14
+ end
15
+
16
+ def create_user(body, *args)
17
+ post("/api/v3/users", body, *args)
18
+ end
19
+
20
+ def delete_user(user_id, *args)
21
+ delete("/api/v3/users/#{user_id}", *args)
22
+ end
23
+
24
+ def lock_user(user_id, *args)
25
+ post("/api/v3/users/#{user_id}/lock", *args)
26
+ end
27
+
28
+ def unlock_user(user_id, *args)
29
+ delete("/api/v3/users/#{user_id}/lock", *args)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -9,7 +9,7 @@ module OpenprojectApi
9
9
  get("/api/v3/work_packages/#{work_package_id}", *args)
10
10
  end
11
11
 
12
- def patch_work_package(work_package_id, body, *args)
12
+ def update_work_package(work_package_id, body, *args)
13
13
  patch("/api/v3/work_packages/#{work_package_id}", body, *args)
14
14
  end
15
15
 
@@ -1,3 +1,3 @@
1
1
  module OpenprojectApi
2
- VERSION = '0.1.1'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -1,17 +1,20 @@
1
1
  lib/openproject_api
2
- lib/openproject_api/version.rb
3
2
  lib/openproject_api/client
4
- lib/openproject_api/client/time_entries.rb
5
- lib/openproject_api/client/work_packages.rb
6
3
  lib/openproject_api/client/statuses.rb
7
4
  lib/openproject_api/client/types.rb
5
+ lib/openproject_api/client/work_packages.rb
6
+ lib/openproject_api/client/users.rb
7
+ lib/openproject_api/client/time_entries.rb
8
8
  lib/openproject_api/client/projects.rb
9
+ lib/openproject_api/client/user_preferences.rb
10
+ lib/openproject_api/client/root.rb
11
+ lib/openproject_api/client/relations.rb
9
12
  lib/openproject_api/objectified_hash.rb
10
13
  lib/openproject_api/api.rb
14
+ lib/openproject_api/version.rb
11
15
  lib/openproject_api/client.rb
12
16
  lib/openproject_api.rb
13
17
  Gemfile
14
18
  Gemfile.lock
15
- openproject_api.gemspec
16
19
  Rakefile
17
- files.txt
20
+ manifest
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openproject_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - expeehaa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-22 00:00:00.000000000 Z
11
+ date: 2020-10-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -20,18 +20,21 @@ files:
20
20
  - Gemfile
21
21
  - Gemfile.lock
22
22
  - Rakefile
23
- - files.txt
24
23
  - lib/openproject_api.rb
25
24
  - lib/openproject_api/api.rb
26
25
  - lib/openproject_api/client.rb
27
26
  - lib/openproject_api/client/projects.rb
27
+ - lib/openproject_api/client/relations.rb
28
+ - lib/openproject_api/client/root.rb
28
29
  - lib/openproject_api/client/statuses.rb
29
30
  - lib/openproject_api/client/time_entries.rb
30
31
  - lib/openproject_api/client/types.rb
32
+ - lib/openproject_api/client/user_preferences.rb
33
+ - lib/openproject_api/client/users.rb
31
34
  - lib/openproject_api/client/work_packages.rb
32
35
  - lib/openproject_api/objectified_hash.rb
33
36
  - lib/openproject_api/version.rb
34
- - openproject_api.gemspec
37
+ - manifest
35
38
  homepage:
36
39
  licenses: []
37
40
  metadata:
@@ -1,20 +0,0 @@
1
- require_relative 'lib/openproject_api/version'
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = 'openproject_api'
5
- spec.version = OpenprojectApi::VERSION
6
- spec.authors = ['expeehaa']
7
- spec.email = ['expeehaa@outlook.com']
8
-
9
- spec.summary = %q{Ruby interface for the OpenProject API.}
10
- spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
11
-
12
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
13
-
14
- # Specify which files should be added to the gem when it is released.
15
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
16
- spec.files = File.read(File.expand_path('files.txt', __dir__)).split("\n")
17
- spec.bindir = 'exe'
18
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
- spec.require_paths = ['lib']
20
- end