youtrack_on_rails 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTI5MzlhNTJiZWQ0YmFiOGY0YTJhY2Q3ZWIxYjQ4NTc0N2ExNDFmYw==
4
+ MTA0ZTFjNmM5MWMwZDk3ZTk4OGE3ZGZhZGIwOGE0YmQxZTU0NTIxZg==
5
5
  data.tar.gz: !binary |-
6
- MmM2ZmIyNGFkMzVmYmFlMjM1ZWJjMjIwYjk2NDBkNjVjM2M2NzM1MQ==
6
+ ZTg2ZjVjNzU2ODNiOTc1ZThlZDY1YjZmOGU4OTA3Nzk5OGJkNzI5YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzIyYjliMjlkY2FkZThkMmUwZWI1YmI1NTY5MjFiNGEwNTM0MGMyY2Y0OTUz
10
- NDM0MmU1ZWEwNTVjMjJkOWI5NGUwZWZmNGZkMGQ3NTM4NzJhYzFhMTMwMDJh
11
- ZTUxYTQ1MmUxMWE1MWU0ZDhkY2YzMzY3YTA0ODkyNmNkYzBkMzI=
9
+ OWIwMmQxZWY2NDQ2ODUzMWQyMjIxYWVkZWFmNTU3YzBhZTRmYzA0OTQ2YmZi
10
+ ZjhhODdjMTBkOTIwNjU1MGJkOTZkZWQ0YzYwZmMyMjJjYjAyMzkzY2U0MGNm
11
+ NGY0NDBlYzZkZDA5YmU2NzcxNTE1NmYzMWYxYmY4MTcwNjM4ZjU=
12
12
  data.tar.gz: !binary |-
13
- ODgxYTk4ZGMzMWU1MmU4OTY3OTQ1YzAyMzA0OTA2OWYzYTU2NjhlMjUzNzNh
14
- MWE2YTUwZjI1MTY5NGNlYjZhOTIyMDE0ZTkxYjhjYjAyOGUyMDg4OThjNzFk
15
- ODFjN2U4YmMwZjYxMTA1OWMzYjUwZTMyODMxOWM1MGUxNzhkNjQ=
13
+ ZDg5MGJlNzVmMzczODQwZWQ1M2UwZWI1YjliNmY0ZjU3NjliMGU0MWUyYzFm
14
+ NDU3NmFhZjZkYzdlNzI1NjZmMzhlZDA5NDgwMTc2OTY5YTgxYWQyNjc2Zjk1
15
+ ZGZjZjIxNTVkY2ViODIyZTM3ZjYyMmZiNDVmNzJmM2UzMWQ4NGQ=
@@ -6,6 +6,8 @@ module YoutrackOnRails
6
6
  autoload :Post, 'youtrack_on_rails/requests/post'
7
7
  autoload :Put, 'youtrack_on_rails/requests/put'
8
8
 
9
+ autoload :GetVersionBundle, 'youtrack_on_rails/requests/get_version_bundle'
10
+ autoload :GetCustomField, 'youtrack_on_rails/requests/get_custom_field'
9
11
  autoload :ApplyCommand, 'youtrack_on_rails/requests/apply_command'
10
12
  autoload :CreateIssue, 'youtrack_on_rails/requests/create_issue'
11
13
  autoload :ListProjects, 'youtrack_on_rails/requests/list_projects'
@@ -48,7 +48,7 @@ module YoutrackOnRails
48
48
 
49
49
  def endpoint_uri
50
50
  @endpoint_uri ||= (connection_uri.path + processed_url).tap do |_endpoint_uri|
51
- _endpoint_uri << "?#{encoded_params}" if http_method == 'get'
51
+ _endpoint_uri << "?#{encoded_params}" if http_method == 'get' && encoded_params.present?
52
52
  end
53
53
  end
54
54
 
@@ -0,0 +1,9 @@
1
+ module YoutrackOnRails
2
+ module Requests
3
+ class GetCustomField < Get
4
+ def url
5
+ '/rest/admin/project/:project/customfield/:custom_field_name'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module YoutrackOnRails
2
+ module Requests
3
+ class GetVersionBundle < Get
4
+ def url
5
+ '/rest/admin/customfield/versionBundle/:bundle_name'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -2,9 +2,13 @@ module YoutrackOnRails
2
2
  module Responses
3
3
  autoload :Base, 'youtrack_on_rails/responses/base'
4
4
 
5
+ autoload :EnumerationResponse, 'youtrack_on_rails/responses/enumeration_response'
6
+ autoload :ResourceResponse, 'youtrack_on_rails/responses/resource_response'
5
7
  autoload :SimpleResponse, 'youtrack_on_rails/responses/simple_response'
6
8
  autoload :CollectionResponse, 'youtrack_on_rails/responses/collection_response'
7
9
 
10
+ autoload :GetVersionBundle, 'youtrack_on_rails/responses/get_version_bundle'
11
+ autoload :GetCustomField, 'youtrack_on_rails/responses/get_custom_field'
8
12
  autoload :ApplyCommand, 'youtrack_on_rails/responses/apply_command'
9
13
  autoload :CreateIssue, 'youtrack_on_rails/responses/create_issue'
10
14
  autoload :ListProjects, 'youtrack_on_rails/responses/list_projects'
@@ -17,10 +17,6 @@ module YoutrackOnRails
17
17
 
18
18
  private
19
19
 
20
- def resource_name
21
- 'project'
22
- end
23
-
24
20
  def collection_name
25
21
  resource_name.pluralize
26
22
  end
@@ -0,0 +1,17 @@
1
+ module YoutrackOnRails
2
+ module Responses
3
+ class EnumerationResponse < CollectionResponse
4
+ def process(&block)
5
+ super do |hash, enumeration_node|
6
+ hash['value'] = enumeration_node.text
7
+ end
8
+ end
9
+
10
+ private
11
+
12
+ def xpath
13
+ "//#{enumeration_name}"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ module YoutrackOnRails
2
+ module Responses
3
+ class GetCustomField < ResourceResponse
4
+ def process
5
+ super do |hash, issue_node|
6
+ attributes = issue_node.xpath('param').map { |field| field['name'] }
7
+ attributes.each_with_object(hash) do |attribute, _hash|
8
+ _hash[attribute.downcase] = issue_node.xpath("param[@name='#{attribute}']").first['value']
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ module YoutrackOnRails
2
+ module Responses
3
+ class GetVersionBundle < EnumerationResponse
4
+ private
5
+
6
+ def enumeration_name
7
+ 'version'
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,19 @@
1
+ module YoutrackOnRails
2
+ module Responses
3
+ class ResourceResponse < CollectionResponse
4
+ def process(&block)
5
+ super.first
6
+ end
7
+
8
+ private
9
+
10
+ def resource_name
11
+ 'projectCustomField'
12
+ end
13
+
14
+ def xpath
15
+ "//#{resource_name}"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module YoutrackOnRails
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.10'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: youtrack_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - stevo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-25 00:00:00.000000000 Z
12
+ date: 2014-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -53,6 +53,8 @@ files:
53
53
  - lib/youtrack_on_rails/requests/base.rb
54
54
  - lib/youtrack_on_rails/requests/create_issue.rb
55
55
  - lib/youtrack_on_rails/requests/get.rb
56
+ - lib/youtrack_on_rails/requests/get_custom_field.rb
57
+ - lib/youtrack_on_rails/requests/get_version_bundle.rb
56
58
  - lib/youtrack_on_rails/requests/list_issues.rb
57
59
  - lib/youtrack_on_rails/requests/list_projects.rb
58
60
  - lib/youtrack_on_rails/requests/post.rb
@@ -63,8 +65,12 @@ files:
63
65
  - lib/youtrack_on_rails/responses/base.rb
64
66
  - lib/youtrack_on_rails/responses/collection_response.rb
65
67
  - lib/youtrack_on_rails/responses/create_issue.rb
68
+ - lib/youtrack_on_rails/responses/enumeration_response.rb
69
+ - lib/youtrack_on_rails/responses/get_custom_field.rb
70
+ - lib/youtrack_on_rails/responses/get_version_bundle.rb
66
71
  - lib/youtrack_on_rails/responses/list_issues.rb
67
72
  - lib/youtrack_on_rails/responses/list_projects.rb
73
+ - lib/youtrack_on_rails/responses/resource_response.rb
68
74
  - lib/youtrack_on_rails/responses/sign_in.rb
69
75
  - lib/youtrack_on_rails/responses/simple_response.rb
70
76
  - lib/youtrack_on_rails/version.rb