redmine_rest 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +2 -0
- data/lib/redmine_rest/models/collections/tracker.rb +14 -0
- data/lib/redmine_rest/models/issue.rb +4 -9
- data/lib/redmine_rest/models/tracker.rb +22 -0
- data/lib/redmine_rest/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48c83e8cd8b95eda110d312a81120070f76b8178
|
4
|
+
data.tar.gz: c488561848255e6913dfafe166804ace1d772bcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e80080d2a9414b8836da70c9182fd49a1706471c70754853a576019fcf69919825b309013f40c401803a15cdaa2062e649630349339fa24fe50e2fcf3de7682d
|
7
|
+
data.tar.gz: 766c6756120983d751e8396c3e06745cbb30b3d2bb4f83fec810f0a975266eb9fb5dd046a4d4e106125000c56f657a4bddffcc383dafbd8eff8d6bf93bc35823
|
data/bin/console
CHANGED
@@ -24,6 +24,8 @@ module RedmineRest
|
|
24
24
|
has_many :watchers, class_name: User
|
25
25
|
has_many :relations, class_name: Relation
|
26
26
|
|
27
|
+
validates :subject, :tracker_id, presence: true
|
28
|
+
|
27
29
|
#
|
28
30
|
# Adds journals, relations, children and watchers to request.
|
29
31
|
#
|
@@ -43,15 +45,8 @@ module RedmineRest
|
|
43
45
|
super(what, options)
|
44
46
|
end
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
-
#
|
49
|
-
# I guess it's equal to `.<attribute>?`
|
50
|
-
#
|
51
|
-
[:author, :assigned_to, :project, :version, :children, :watchers, :relations, :parent].each do |attr|
|
52
|
-
define_method(attr) do
|
53
|
-
attributes[attr]
|
54
|
-
end
|
48
|
+
def method_missing(method, *args)
|
49
|
+
args.empty? && !block_given? ? attributes[method] : super
|
55
50
|
end
|
56
51
|
end
|
57
52
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'active_resource'
|
2
|
+
|
3
|
+
require_relative 'collections/tracker'
|
4
|
+
|
5
|
+
module RedmineRest
|
6
|
+
module Models
|
7
|
+
#
|
8
|
+
# Tracker model
|
9
|
+
#
|
10
|
+
class Tracker < ActiveResource::Base
|
11
|
+
self.format = :xml
|
12
|
+
self.collection_parser = Collections::Tracker
|
13
|
+
|
14
|
+
def self.find(*args)
|
15
|
+
fail('Trackers can be loaded as :all only') unless args.size == 1 && args.first == :all
|
16
|
+
|
17
|
+
return @trackers if @trackers
|
18
|
+
@trackers = super
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/redmine_rest/version.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.5.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-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -116,12 +116,14 @@ files:
|
|
116
116
|
- lib/redmine_rest/models/collections/issue.rb
|
117
117
|
- lib/redmine_rest/models/collections/issue_status.rb
|
118
118
|
- lib/redmine_rest/models/collections/project.rb
|
119
|
+
- lib/redmine_rest/models/collections/tracker.rb
|
119
120
|
- lib/redmine_rest/models/collections/version.rb
|
120
121
|
- lib/redmine_rest/models/issue.rb
|
121
122
|
- lib/redmine_rest/models/issue_status.rb
|
122
123
|
- lib/redmine_rest/models/project.rb
|
123
124
|
- lib/redmine_rest/models/relation.rb
|
124
125
|
- lib/redmine_rest/models/time_entry.rb
|
126
|
+
- lib/redmine_rest/models/tracker.rb
|
125
127
|
- lib/redmine_rest/models/user.rb
|
126
128
|
- lib/redmine_rest/models/version.rb
|
127
129
|
- lib/redmine_rest/version.rb
|