redmine_api_helper 0.3.35

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.

Potentially problematic release.


This version of redmine_api_helper might be problematic. Click here for more details.

Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.gitattributes +2 -0
  3. data/.gitignore +11 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE +339 -0
  7. data/README.md +30 -0
  8. data/Rakefile +2 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/lib/date_helper/date.rb +311 -0
  12. data/lib/odf_writer/bookmark.rb +110 -0
  13. data/lib/odf_writer/bookmark_reader.rb +77 -0
  14. data/lib/odf_writer/document.rb +371 -0
  15. data/lib/odf_writer/field.rb +174 -0
  16. data/lib/odf_writer/field_reader.rb +78 -0
  17. data/lib/odf_writer/image.rb +176 -0
  18. data/lib/odf_writer/image_reader.rb +76 -0
  19. data/lib/odf_writer/images.rb +89 -0
  20. data/lib/odf_writer/list_style.rb +336 -0
  21. data/lib/odf_writer/nested.rb +156 -0
  22. data/lib/odf_writer/odf_helper.rb +57 -0
  23. data/lib/odf_writer/parser/default.rb +691 -0
  24. data/lib/odf_writer/path_finder.rb +114 -0
  25. data/lib/odf_writer/section.rb +120 -0
  26. data/lib/odf_writer/section_reader.rb +61 -0
  27. data/lib/odf_writer/style.rb +483 -0
  28. data/lib/odf_writer/table.rb +135 -0
  29. data/lib/odf_writer/table_reader.rb +61 -0
  30. data/lib/odf_writer/template.rb +234 -0
  31. data/lib/odf_writer/text.rb +97 -0
  32. data/lib/odf_writer/text_reader.rb +77 -0
  33. data/lib/odf_writer/version.rb +29 -0
  34. data/lib/redmine_api_helper/api_helper.rb +333 -0
  35. data/lib/redmine_api_helper/args_helper.rb +106 -0
  36. data/lib/redmine_api_helper/attachments_api_helper.rb +52 -0
  37. data/lib/redmine_api_helper/define_api_helpers.rb +78 -0
  38. data/lib/redmine_api_helper/document_categories_api_helper.rb +38 -0
  39. data/lib/redmine_api_helper/groups_api_helper.rb +80 -0
  40. data/lib/redmine_api_helper/helpers.rb +50 -0
  41. data/lib/redmine_api_helper/issue_priorities_api_helper.rb +38 -0
  42. data/lib/redmine_api_helper/issue_relations_api_helper.rb +66 -0
  43. data/lib/redmine_api_helper/issue_statuses_api_helper.rb +36 -0
  44. data/lib/redmine_api_helper/issues_api_helper.rb +124 -0
  45. data/lib/redmine_api_helper/my_account_api_helper.rb +45 -0
  46. data/lib/redmine_api_helper/news_api_helper.rb +73 -0
  47. data/lib/redmine_api_helper/project_memberships_api_helper.rb +77 -0
  48. data/lib/redmine_api_helper/projects_api_helper.rb +73 -0
  49. data/lib/redmine_api_helper/roles_api_helper.rb +52 -0
  50. data/lib/redmine_api_helper/scripts_api_helper.rb +87 -0
  51. data/lib/redmine_api_helper/search_api_helper.rb +38 -0
  52. data/lib/redmine_api_helper/time_entries_api_helper.rb +73 -0
  53. data/lib/redmine_api_helper/time_entry_activities_api_helper.rb +38 -0
  54. data/lib/redmine_api_helper/trackers_api_helper.rb +38 -0
  55. data/lib/redmine_api_helper/users_api_helper.rb +73 -0
  56. data/lib/redmine_api_helper/version.rb +24 -0
  57. data/lib/redmine_api_helper/wiki_pages_api_helper.rb +66 -0
  58. data/lib/redmine_api_helper.rb +88 -0
  59. data/redmine_api_helper.gemspec +36 -0
  60. metadata +162 -0
@@ -0,0 +1,50 @@
1
+ # encoding: utf-8
2
+ #
3
+ # aids creating fiddles for redmine_scripting_engine
4
+ #
5
+ # Copyright 2021 Stephan Wenzel <stephan.wenzel@drwpatent.de>
6
+ #
7
+ # This program is free software; you can redistribute it and/or
8
+ # modify it under the terms of the GNU General Public License
9
+ # as published by the Free Software Foundation; either version 2
10
+ # of the License, or (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU General Public License
18
+ # along with this program; if not, write to the Free Software
19
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
+ #
21
+
22
+ module RedmineAPIHelper
23
+ module Helpers
24
+
25
+ include RedmineAPIHelper::APIHelper
26
+ include RedmineAPIHelper::ArgsHelper
27
+ include RedmineAPIHelper::DefineAPIHelpers
28
+
29
+ include RedmineAPIHelper::AttachmentsAPIHelper
30
+ include RedmineAPIHelper::DocumentCategoriesAPIHelper
31
+ include RedmineAPIHelper::GroupsAPIHelper
32
+ include RedmineAPIHelper::IssuePrioritiesAPIHelper
33
+ include RedmineAPIHelper::IssueRelationsAPIHelper
34
+ include RedmineAPIHelper::IssueStatusesAPIHelper
35
+ include RedmineAPIHelper::IssuesAPIHelper
36
+ include RedmineAPIHelper::MyAccountAPIHelper
37
+ include RedmineAPIHelper::NewsAPIHelper
38
+ include RedmineAPIHelper::ProjectMembershipsAPIHelper
39
+ include RedmineAPIHelper::ProjectsAPIHelper
40
+ include RedmineAPIHelper::RolesAPIHelper
41
+ include RedmineAPIHelper::SearchAPIHelper
42
+ include RedmineAPIHelper::TimeEntriesAPIHelper
43
+ include RedmineAPIHelper::TimeEntryActivitiesAPIHelper
44
+ include RedmineAPIHelper::TrackersAPIHelper
45
+ include RedmineAPIHelper::UsersAPIHelper
46
+ include RedmineAPIHelper::WikiPagesAPIHelper
47
+ include RedmineAPIHelper::ScriptsAPIHelper
48
+
49
+ end
50
+ end
@@ -0,0 +1,38 @@
1
+ ##
2
+ # aids creating fiddles for redmine_scripting_engine
3
+ #
4
+ # Copyright 2021 Stephan Wenzel <stephan.wenzel@drwpatent.de>
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License
8
+ # as published by the Free Software Foundation; either version 2
9
+ # of the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
+ #
20
+ module RedmineAPIHelper
21
+ module IssuePrioritiesAPIHelper
22
+
23
+ ########################################################################################
24
+ # reads issue_priorities_url from args
25
+ ########################################################################################
26
+ def issue_priorities_url(**params)
27
+ url_path(args.urls.Home, "enumerations", "issue_priorities", params)
28
+ end #def
29
+
30
+ ########################################################################################
31
+ # lists issue_priorities, corresponds to controller#index
32
+ ########################################################################################
33
+ def list_issue_priorities(**params)
34
+ list_objects(:issue_priorities, params)
35
+ end #def
36
+
37
+ end #module
38
+ end #module
@@ -0,0 +1,66 @@
1
+ ##
2
+ # aids creating fiddles for redmine_scripting_engine
3
+ #
4
+ # Copyright 2021 Stephan Wenzel <stephan.wenzel@drwpatent.de>
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License
8
+ # as published by the Free Software Foundation; either version 2
9
+ # of the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
+ #
20
+ module RedmineAPIHelper
21
+ module IssueRelationsAPIHelper
22
+
23
+ ########################################################################################
24
+ # reads issue_relations_url from args
25
+ ########################################################################################
26
+ def issue_relations_url(issue_id, **params)
27
+ url_path(issue_url(issue_id), "relations", params)
28
+ end #def
29
+
30
+ ########################################################################################
31
+ # reads relations_url from args
32
+ ########################################################################################
33
+ def relation_url(id, **params)
34
+ url_path(args.urls.Home, "relations", id, params)
35
+ end #def
36
+
37
+ ########################################################################################
38
+ # lists issue_relations, corresponds to controller#index
39
+ ########################################################################################
40
+ def list_issue_relations(issue_id, **params)
41
+ jget(:url => issue_relations_url(issue_id), :params => params).relations
42
+ end #def
43
+
44
+ ########################################################################################
45
+ # reads issue having id, corresponds to controller#show
46
+ ########################################################################################
47
+ def read_relation(id, **params)
48
+ jget(:url => relation_url(id), :params => params).relation
49
+ end #def
50
+
51
+ ########################################################################################
52
+ # creates a new issue with params, corresponds to controller#create
53
+ ########################################################################################
54
+ def create_issue_relation(issue_id, **params)
55
+ jpost(params, :url => issue_relations_url(issue_id)).relation
56
+ end #def
57
+
58
+ ########################################################################################
59
+ # deletes an existing issue with params, corresponds to controller#destroy
60
+ ########################################################################################
61
+ def destroy_relation(id, **params)
62
+ jdel(:url => relation_url(id), :params => params)
63
+ end #def
64
+
65
+ end #module
66
+ end #module
@@ -0,0 +1,36 @@
1
+ ##
2
+ # aids creating fiddles for redmine_scripting_engine
3
+ #
4
+ # This program is free software; you can redistribute it and/or
5
+ # modify it under the terms of the GNU General Public License
6
+ # as published by the Free Software Foundation; either version 2
7
+ # of the License, or (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
+ #
18
+ module RedmineAPIHelper
19
+ module IssueStatusesAPIHelper
20
+
21
+ ########################################################################################
22
+ # reads issue_statuses_url from args
23
+ ########################################################################################
24
+ def issue_statuses_url(**params)
25
+ url_path(args.urls.Home, "issue_statuses", params)
26
+ end #def
27
+
28
+ ########################################################################################
29
+ # lists issue_statuses, corresponds to controller#index
30
+ ########################################################################################
31
+ def list_issue_statuses(**params)
32
+ list_objects(:issue_statuses, params)
33
+ end #def
34
+
35
+ end #module
36
+ end #module
@@ -0,0 +1,124 @@
1
+ ##
2
+ # aids creating fiddles for redmine_scripting_engine
3
+ #
4
+ # Copyright 2021 Stephan Wenzel <stephan.wenzel@drwpatent.de>
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License
8
+ # as published by the Free Software Foundation; either version 2
9
+ # of the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
+ #
20
+ module RedmineAPIHelper
21
+ module IssuesAPIHelper
22
+
23
+ ########################################################################################
24
+ # reads issues_url from args
25
+ ########################################################################################
26
+ def issues_url(**params)
27
+ url_path(args.urls.Home, "issues", params)
28
+ end #def
29
+
30
+ ########################################################################################
31
+ # creates issue_url
32
+ ########################################################################################
33
+ def issue_url(id, **params)
34
+ url_path(issues_url, id, params)
35
+ end #def
36
+
37
+ ########################################################################################
38
+ # reads issues_url from args
39
+ ########################################################################################
40
+ def project_issues_url(project_id, **params)
41
+ url_path(project_url(project_id), 'issues', params)
42
+ end #def
43
+
44
+ ########################################################################################
45
+ # creates project_issue_url
46
+ ########################################################################################
47
+ def project_issue_url(project_id, id, **params)
48
+ url_path(project_issues_url(project_id), id, params)
49
+ end #def
50
+
51
+ ########################################################################################
52
+ # lists issues, corresponds to controller#index
53
+ ########################################################################################
54
+ def list_issues(**params)
55
+ list_objects(:issues, params)
56
+ end #def
57
+
58
+ ########################################################################################
59
+ # lists project issues, corresponds to controller#index
60
+ ########################################################################################
61
+ def list_project_issues(project_id, **params)
62
+ list_project_objects(project_id, :issues, params)
63
+ end #def
64
+
65
+ ########################################################################################
66
+ # reads issue having id, corresponds to controller#show
67
+ ########################################################################################
68
+ def read_issue(id, **params)
69
+ read_object(:issue, id, params)
70
+ end #def
71
+
72
+ ########################################################################################
73
+ # creates a new issue with params, corresponds to controller#create
74
+ ########################################################################################
75
+ def create_issue(**params)
76
+ create_object(:issue, params)
77
+ end #def
78
+
79
+ ########################################################################################
80
+ # updates an existing issue with params, corresponds to controller#update
81
+ ########################################################################################
82
+ def update_issue(id, **params)
83
+ update_object(:issue, id, params)
84
+ end #def
85
+
86
+ ########################################################################################
87
+ # 'bulk_updates' existing issues with params, simulate controller#bulk_update
88
+ ########################################################################################
89
+ def update_issues(ids, **params)
90
+ ids.each do |id|
91
+ update_object(:issue, id, params)
92
+ end
93
+ end #def
94
+
95
+ ########################################################################################
96
+ # deletes an existing issue with params, corresponds to controller#destroy
97
+ ########################################################################################
98
+ def destroy_issue(id, **params)
99
+ destroy_object(:issue, id, params)
100
+ end #def
101
+
102
+ ########################################################################################
103
+ # reads watchers_url from args
104
+ ########################################################################################
105
+ def watchers_url(**params)
106
+ url_path(args.urls.Watch, params)
107
+ end #def
108
+
109
+ ########################################################################################
110
+ # creates a watcher with params, corresponds to watchers#create: params: user_id
111
+ ########################################################################################
112
+ def create_issue_watcher(issue_id, user_id, **params)
113
+ jpost(params.merge(:object_type => 'issue', :object_id => issue_id, :user_id => user_id), :url => watchers_url )
114
+ end #def
115
+
116
+ ########################################################################################
117
+ # deletes a watcher with params, corresponds to watchers#destroy
118
+ ########################################################################################
119
+ def destroy_issue_watcher(issue_id, user_id, **params)
120
+ jdel(:url => watchers_url, :params => params.merge(:object_type => 'issue', :object_id => issue_id, :user_id => user_id))
121
+ end #def
122
+
123
+ end #module
124
+ end #module
@@ -0,0 +1,45 @@
1
+ ##
2
+ # aids creating fiddles for redmine_scripting_engine
3
+ #
4
+ # Copyright 2021 Stephan Wenzel <stephan.wenzel@drwpatent.de>
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License
8
+ # as published by the Free Software Foundation; either version 2
9
+ # of the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
+ #
20
+ module RedmineAPIHelper
21
+ module MyAccountAPIHelper
22
+
23
+ ########################################################################################
24
+ # reads my_account_url from args
25
+ ########################################################################################
26
+ def my_account_url(**params)
27
+ url_path(args.urls.Home, "my", "account", params)
28
+ end #def
29
+
30
+ ########################################################################################
31
+ # reads my account, corresponds to controller#show
32
+ ########################################################################################
33
+ def read_my_account(**params)
34
+ jget(params.merge(:url => my_account_url)).user
35
+ end #def
36
+
37
+ ########################################################################################
38
+ # updates my account with params, corresponds to controller#update
39
+ ########################################################################################
40
+ def update_my_account(**params)
41
+ jput({:user => params}, :url => my_account_url)
42
+ end #def
43
+
44
+ end #module
45
+ end #module
@@ -0,0 +1,73 @@
1
+ ##
2
+ # aids creating fiddles for redmine_scripting_engine
3
+ #
4
+ # Copyright 2021 Stephan Wenzel <stephan.wenzel@drwpatent.de>
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License
8
+ # as published by the Free Software Foundation; either version 2
9
+ # of the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
+ #
20
+ module RedmineAPIHelper
21
+ module NewsAPIHelper
22
+
23
+ ########################################################################################
24
+ # reads news_url from args
25
+ ########################################################################################
26
+ def news_index_url(**params)
27
+ url_path(args.urls.Home, "news", params)
28
+ end #def
29
+
30
+ ########################################################################################
31
+ # creates new_url
32
+ ########################################################################################
33
+ def news_url(id, **params)
34
+ url_path(news_index_url, id, params)
35
+ end #def
36
+
37
+ ########################################################################################
38
+ # reads project_news_url from args
39
+ ########################################################################################
40
+ def project_news_index_url(project_id, **params)
41
+ url_path(project_url(project_id), "news", params)
42
+ end #def
43
+
44
+ ########################################################################################
45
+ # creates project_new_url
46
+ ########################################################################################
47
+ def project_news_url(project_id, id, **params)
48
+ url_path(project_news_index_url(project_id), id, params)
49
+ end #def
50
+
51
+ ########################################################################################
52
+ # list_news result, corresponds to controller#index
53
+ ########################################################################################
54
+ def list_news(**params)
55
+ jget(:url => news_index_url, :params => params ).news
56
+ end #def
57
+
58
+ ########################################################################################
59
+ # list_news result, corresponds to controller#index
60
+ ########################################################################################
61
+ def list_project_news(project_id, **params)
62
+ jget(:url => project_news_index_url(project_id), :params => params ).news
63
+ end #def
64
+
65
+ ########################################################################################
66
+ # read_news result, corresponds to controller#show
67
+ ########################################################################################
68
+ def read_news(id, **params)
69
+ read_object(:news, id, params)
70
+ end #def
71
+
72
+ end #module
73
+ end #module
@@ -0,0 +1,77 @@
1
+ ##
2
+ # aids creating fiddles for redmine_scripting_engine
3
+ #
4
+ # Copyright 2021 Stephan Wenzel <stephan.wenzel@drwpatent.de>
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License
8
+ # as published by the Free Software Foundation; either version 2
9
+ # of the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
+ #
20
+ module RedmineAPIHelper
21
+ module ProjectMembershipsAPIHelper
22
+
23
+ ########################################################################################
24
+ # reads projects_url from args
25
+ ########################################################################################
26
+ def project_memberships_url(project_id, **params)
27
+ url_path(project_url(project_id), "memberships", params)
28
+ end #def
29
+
30
+ def memberships_url(**params)
31
+ url_path(args.urls.Home, "memberships", params)
32
+ end #def
33
+
34
+ ########################################################################################
35
+ # creates a membership_url
36
+ ########################################################################################
37
+ def membership_url(id, **params)
38
+ url_path(memberships_url, id, params)
39
+ end #def
40
+
41
+ ########################################################################################
42
+ # lists projects, corresponds to controller#index
43
+ ########################################################################################
44
+ def list_project_memberships(project_id, **params)
45
+ list_project_objects(project_id, :memberships, params)
46
+ end #def
47
+
48
+ ########################################################################################
49
+ # reads project having id, corresponds to controller#show
50
+ ########################################################################################
51
+ def read_membership(id, **params)
52
+ read_object(:membership, id, params)
53
+ end #def
54
+
55
+ ########################################################################################
56
+ # creates a new project with params, corresponds to controller#create
57
+ ########################################################################################
58
+ def create_project_membership(project_id, **params)
59
+ create_project_object(project_id, :membership, params)
60
+ end #def
61
+
62
+ ########################################################################################
63
+ # updates an existing project with params, corresponds to controller#update
64
+ ########################################################################################
65
+ def update_membership(id, **params)
66
+ update_object(:membership, id, params)
67
+ end #def
68
+
69
+ ########################################################################################
70
+ # deletes an existing project with params, corresponds to controller#destroy
71
+ ########################################################################################
72
+ def destroy_membership(id, **params)
73
+ destroy_object(:membership, id, params)
74
+ end #def
75
+
76
+ end #module
77
+ end #module
@@ -0,0 +1,73 @@
1
+ ##
2
+ # aids creating fiddles for redmine_scripting_engine
3
+ #
4
+ # Copyright 2021 Stephan Wenzel <stephan.wenzel@drwpatent.de>
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License
8
+ # as published by the Free Software Foundation; either version 2
9
+ # of the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
+ #
20
+ module RedmineAPIHelper
21
+ module ProjectsAPIHelper
22
+
23
+ ########################################################################################
24
+ # reads projects_url from args
25
+ ########################################################################################
26
+ def projects_url(**params)
27
+ url_path(args.urls.Home, "projects", params)
28
+ end #def
29
+
30
+ ########################################################################################
31
+ # creates project_url
32
+ ########################################################################################
33
+ def project_url(id, **params)
34
+ url_path(projects_url, id, params)
35
+ end #def
36
+
37
+ ########################################################################################
38
+ # lists projects, corresponds to controller#index
39
+ ########################################################################################
40
+ def list_projects(**params)
41
+ list_objects(:projects, params)
42
+ end #def
43
+
44
+ ########################################################################################
45
+ # reads project having id, corresponds to controller#show
46
+ ########################################################################################
47
+ def read_project(id, **params)
48
+ read_object(:project, id, params)
49
+ end #def
50
+
51
+ ########################################################################################
52
+ # creates a new project with params, corresponds to controller#create
53
+ ########################################################################################
54
+ def create_project(**params)
55
+ create_object(:project, params)
56
+ end #def
57
+
58
+ ########################################################################################
59
+ # updates an existing project with params, corresponds to controller#update
60
+ ########################################################################################
61
+ def update_project(id, **params)
62
+ update_object(:project, id, params)
63
+ end #def
64
+
65
+ ########################################################################################
66
+ # deletes an existing project with params, corresponds to controller#destroy
67
+ ########################################################################################
68
+ def destroy_project(id, **params)
69
+ destroy_object(:project, id, params)
70
+ end #def
71
+
72
+ end #module
73
+ end #module
@@ -0,0 +1,52 @@
1
+ ##
2
+ # aids creating fiddles for redmine_scripting_engine
3
+ #
4
+ # Copyright 2021 Stephan Wenzel <stephan.wenzel@drwpatent.de>
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License
8
+ # as published by the Free Software Foundation; either version 2
9
+ # of the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
+ #
20
+ module RedmineAPIHelper
21
+ module RolesAPIHelper
22
+
23
+ ########################################################################################
24
+ # reads roles_url from args
25
+ ########################################################################################
26
+ def roles_url(**params)
27
+ url_path(args.urls.Home, "roles", params)
28
+ end #def
29
+
30
+ ########################################################################################
31
+ # creates a role_url
32
+ ########################################################################################
33
+ def role_url(id, **params)
34
+ url_path(roles_url, id, params)
35
+ end #def
36
+
37
+ ########################################################################################
38
+ # lists roles, corresponds to controller#index
39
+ ########################################################################################
40
+ def list_roles(**params)
41
+ list_objects(:roles, params)
42
+ end #def
43
+
44
+ ########################################################################################
45
+ # read role, corresponds to controller#show
46
+ ########################################################################################
47
+ def read_role(id, **params)
48
+ read_object(:role, id, params)
49
+ end #def
50
+
51
+ end #module
52
+ end #module