redmine_rest 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 +4 -4
- data/README.md +14 -4
- data/lib/redmine_rest/models/collections/issue.rb +24 -0
- data/lib/redmine_rest/models/issue.rb +3 -0
- data/lib/redmine_rest/models/user.rb +8 -0
- data/lib/redmine_rest/version.rb +1 -1
- data/lib/redmine_rest.rb +3 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac3d0294a5bcc3ee1ce3fc8ff6f9c2236379280d
|
4
|
+
data.tar.gz: 26fa8199cbabbadcb4c78e109bf9662d2b082307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28dcb1ab6e507c794361c0d0bc06d0469925c9e93230217353a457074d5edca73486dd4172db2ffa671d5ae459a33dc08bd64b934404201929f18ccf06ab3432
|
7
|
+
data.tar.gz: 1e64494ef73ea5e3fe78a4442bf299320f5ce9235151f8f93982295f0a2dc5d5d6d3904c2078d6ad077ca31b3bf5c2514fd12c08747b74c8eb7cd8b95fe464b0
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# RedmineRest
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/redmine_rest.svg)](https://badge.fury.io/rb/redmine_rest)
|
2
3
|
|
3
4
|
This is gem with some ActiveResource models for Redmine.
|
4
5
|
|
@@ -21,10 +22,19 @@ Or install it yourself as:
|
|
21
22
|
|
22
23
|
## Usage
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
```ruby
|
26
|
+
RedmineRest::Models.configure_models user: 'user', password: 'password', site: 'URL'
|
27
|
+
# or by using apikey:
|
28
|
+
RedmineRest::Models.configure_models apikey: 'apikey', site: 'URL'
|
29
|
+
|
30
|
+
include RedmineRest::Models
|
31
|
+
issues_by_project = Issue.all.group_by_project
|
32
|
+
issues_by_project.each do |project, issues|
|
33
|
+
puts project.name
|
34
|
+
issues.each { |i| puts i.subject }
|
35
|
+
puts
|
36
|
+
end
|
37
|
+
```
|
28
38
|
|
29
39
|
|
30
40
|
## Contributing
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'active_resource'
|
2
|
+
|
3
|
+
module RedmineRest
|
4
|
+
module Models
|
5
|
+
module Collections
|
6
|
+
#
|
7
|
+
# Methods for issue collections
|
8
|
+
#
|
9
|
+
class Issue < ActiveResource::Collection
|
10
|
+
def group_by_project
|
11
|
+
group_by(&:project)
|
12
|
+
end
|
13
|
+
|
14
|
+
def group_by_author
|
15
|
+
group_by(&:author)
|
16
|
+
end
|
17
|
+
|
18
|
+
def group_by_assigned_to
|
19
|
+
group_by(&:assigned_to)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -3,6 +3,7 @@ require 'active_resource'
|
|
3
3
|
require_relative 'user'
|
4
4
|
require_relative 'project'
|
5
5
|
require_relative 'version'
|
6
|
+
require_relative 'collections/issue'
|
6
7
|
|
7
8
|
module RedmineRest
|
8
9
|
module Models
|
@@ -11,6 +12,8 @@ module RedmineRest
|
|
11
12
|
#
|
12
13
|
class Issue < ActiveResource::Base
|
13
14
|
self.format = :xml
|
15
|
+
self.collection_parser = Collections::Issue
|
16
|
+
|
14
17
|
has_one :author, class_name: User
|
15
18
|
has_one :assigned_to, class_name: User
|
16
19
|
has_one :project, class_name: Project
|
@@ -8,6 +8,14 @@ module RedmineRest
|
|
8
8
|
class User < ActiveResource::Base
|
9
9
|
self.format = :xml
|
10
10
|
|
11
|
+
def self.find_by_name_or_mail(str)
|
12
|
+
all_by_name_or_mail(str).first
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.all_by_name_or_mail(str)
|
16
|
+
find :all, params: { name: str }
|
17
|
+
end
|
18
|
+
|
11
19
|
def issues(params = {})
|
12
20
|
params[:assigned_to_id] = id
|
13
21
|
Issue.all params: params
|
data/lib/redmine_rest/version.rb
CHANGED
data/lib/redmine_rest.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitriy Non
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- bin/setup
|
99
99
|
- lib/redmine_rest.rb
|
100
100
|
- lib/redmine_rest/models.rb
|
101
|
+
- lib/redmine_rest/models/collections/issue.rb
|
101
102
|
- lib/redmine_rest/models/issue.rb
|
102
103
|
- lib/redmine_rest/models/issue_status.rb
|
103
104
|
- lib/redmine_rest/models/project.rb
|