redmine_rest 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/redmine_rest.rb +1 -6
- data/lib/redmine_rest/helpers/collection.rb +16 -0
- data/lib/redmine_rest/models/collections/issue_status.rb +14 -0
- data/lib/redmine_rest/models/collections/project.rb +14 -0
- data/lib/redmine_rest/models/collections/version.rb +14 -0
- data/lib/redmine_rest/models/issue_status.rb +10 -0
- data/lib/redmine_rest/models/project.rb +3 -0
- data/lib/redmine_rest/models/time_entry.rb +5 -0
- data/lib/redmine_rest/models/version.rb +4 -0
- data/lib/redmine_rest/version.rb +1 -1
- data/redmine_rest.gemspec +1 -0
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96164b1590935de3603154ab2fd0faae02670348
|
4
|
+
data.tar.gz: aeddb22e3a0bd3592c76e50762249889e66da880
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62be2a54cadea149d0eac4885ff729a4c2f3e36bfae5e7366f7b71a8ce4da7f036597f86948a4de6f65dd5d895bc1ec5e22171abbe9d8f257dd02d6e00edf5ac
|
7
|
+
data.tar.gz: ce47345536250edb7e5ff26ca95033a5c0de1e68fadcfc1e9bc761540e5b97f11214ddba22e9078fb3af3f4d111b242edc6a921545b0ae65cc5d40868ad32919
|
data/lib/redmine_rest.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'active_resource'
|
2
|
+
require 'unicode'
|
3
|
+
|
4
|
+
module RedmineRest
|
5
|
+
module Helpers
|
6
|
+
#
|
7
|
+
# some methods for ActiveResource collections
|
8
|
+
#
|
9
|
+
module Collection
|
10
|
+
def filter_by_name_substring(str)
|
11
|
+
str = Unicode.downcase(str)
|
12
|
+
self.class.new @elements.find_all { |e| Unicode.downcase(e.name).include? str }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'active_resource'
|
2
2
|
|
3
|
+
require_relative 'collections/issue_status'
|
4
|
+
|
3
5
|
module RedmineRest
|
4
6
|
module Models
|
5
7
|
#
|
@@ -7,6 +9,14 @@ module RedmineRest
|
|
7
9
|
#
|
8
10
|
class IssueStatus < ActiveResource::Base
|
9
11
|
self.format = :xml
|
12
|
+
self.collection_parser = Collections::IssueStatus
|
13
|
+
|
14
|
+
def self.find(*args)
|
15
|
+
fail('Issue statuses can be loaded as :all only') unless args.size == 1 && args.first == :all
|
16
|
+
|
17
|
+
return @statuses if @statuses
|
18
|
+
@statuses = super
|
19
|
+
end
|
10
20
|
end
|
11
21
|
end
|
12
22
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'active_resource'
|
2
2
|
|
3
|
+
require_relative 'collections/project'
|
4
|
+
|
3
5
|
module RedmineRest
|
4
6
|
module Models
|
5
7
|
#
|
@@ -7,6 +9,7 @@ module RedmineRest
|
|
7
9
|
#
|
8
10
|
class Project < ActiveResource::Base
|
9
11
|
self.format = :xml
|
12
|
+
self.collection_parser = Collections::Project
|
10
13
|
end
|
11
14
|
end
|
12
15
|
end
|
@@ -5,6 +5,11 @@ module RedmineRest
|
|
5
5
|
#
|
6
6
|
# TimeEntry model
|
7
7
|
#
|
8
|
+
# *WARNING:*
|
9
|
+
#
|
10
|
+
# You have to define activity_id if you wanna create TimeEntry.
|
11
|
+
# Or you should set default activity in Redmine administration.
|
12
|
+
#
|
8
13
|
class TimeEntry < ActiveResource::Base
|
9
14
|
self.format = :xml
|
10
15
|
end
|
@@ -1,11 +1,15 @@
|
|
1
1
|
require 'active_resource'
|
2
2
|
|
3
|
+
require_relative 'collections/version'
|
4
|
+
|
3
5
|
module RedmineRest
|
4
6
|
module Models
|
5
7
|
#
|
6
8
|
# Version model
|
7
9
|
#
|
8
10
|
class Version < ActiveResource::Base
|
11
|
+
self.format = :xml
|
12
|
+
self.collection_parser = Collections::Version
|
9
13
|
end
|
10
14
|
end
|
11
15
|
end
|
data/lib/redmine_rest/version.rb
CHANGED
data/redmine_rest.gemspec
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.4.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-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 4.0.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: unicode
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.4.4.2
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.4.4.2
|
83
97
|
description:
|
84
98
|
email:
|
85
99
|
- non.dmitriy@gmail.com
|
@@ -97,8 +111,12 @@ files:
|
|
97
111
|
- bin/console
|
98
112
|
- bin/setup
|
99
113
|
- lib/redmine_rest.rb
|
114
|
+
- lib/redmine_rest/helpers/collection.rb
|
100
115
|
- lib/redmine_rest/models.rb
|
101
116
|
- lib/redmine_rest/models/collections/issue.rb
|
117
|
+
- lib/redmine_rest/models/collections/issue_status.rb
|
118
|
+
- lib/redmine_rest/models/collections/project.rb
|
119
|
+
- lib/redmine_rest/models/collections/version.rb
|
102
120
|
- lib/redmine_rest/models/issue.rb
|
103
121
|
- lib/redmine_rest/models/issue_status.rb
|
104
122
|
- lib/redmine_rest/models/project.rb
|