youtrack_on_rails 0.0.6 → 0.0.8

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
- YjExNTNjODc3NzE1ZTIzNThiYjMyZTAyNzQxYTEwNjE4ZGRmMGVkNw==
4
+ MTI5MzlhNTJiZWQ0YmFiOGY0YTJhY2Q3ZWIxYjQ4NTc0N2ExNDFmYw==
5
5
  data.tar.gz: !binary |-
6
- ZDgwNTE2Y2E0MDk4MjEzMGY3ODJmZjk2NDA2ODQ0ZGE0ODc1ZTZlZg==
6
+ MmM2ZmIyNGFkMzVmYmFlMjM1ZWJjMjIwYjk2NDBkNjVjM2M2NzM1MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YmFhYmFmNWZhNmJhNDZiZDQ2OGZiZGIwMGRhNzMxOGJhMGUzMzU4ODg5YTJk
10
- MmVmOTgwMzViMmM5ZGI2OGNkZWQyZjliM2Y5OWE4N2MyMTA3MWMwMTY3NTQw
11
- N2FkMTQ2NTJhM2U5Y2MwYzM3ZWMyMGFhYmFjNTA3NWVjNjJjMTU=
9
+ MzIyYjliMjlkY2FkZThkMmUwZWI1YmI1NTY5MjFiNGEwNTM0MGMyY2Y0OTUz
10
+ NDM0MmU1ZWEwNTVjMjJkOWI5NGUwZWZmNGZkMGQ3NTM4NzJhYzFhMTMwMDJh
11
+ ZTUxYTQ1MmUxMWE1MWU0ZDhkY2YzMzY3YTA0ODkyNmNkYzBkMzI=
12
12
  data.tar.gz: !binary |-
13
- M2NlNzlkMmQ3ZDIxYmUxNTgwMzg5ZGFiZDNhYjczYjg1NjJjMzNmNWI4Zjcy
14
- MDU4OGYyMjlhNjhhMTEwMzY2ZTJhNWZkN2E2YzY0NWE2NjM4NDljYmQ2Nzg0
15
- YTkyNDI3YzZlMDBlZTZkYTY3MTgzNzA0MmE0YTM1YzEzYjVhNWE=
13
+ ODgxYTk4ZGMzMWU1MmU4OTY3OTQ1YzAyMzA0OTA2OWYzYTU2NjhlMjUzNzNh
14
+ MWE2YTUwZjI1MTY5NGNlYjZhOTIyMDE0ZTkxYjhjYjAyOGUyMDg4OThjNzFk
15
+ ODFjN2U4YmMwZjYxMTA1OWMzYjUwZTMyODMxOWM1MGUxNzhkNjQ=
@@ -0,0 +1,13 @@
1
+ module YoutrackOnRails
2
+ module Requests
3
+ class ApplyCommand < Post
4
+ def url
5
+ '/rest/issue/:issue/execute'
6
+ end
7
+
8
+ def default_params
9
+ super.merge(disableNotifications: true)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -7,7 +7,7 @@ module YoutrackOnRails
7
7
 
8
8
  def initialize(connection, params={})
9
9
  @connection = connection
10
- @params = params
10
+ @params = params.reverse_merge(default_params)
11
11
  @content_type = @params.delete(:content_type)
12
12
  @raw_body = @params.delete(:raw_body)
13
13
  end
@@ -22,6 +22,10 @@ module YoutrackOnRails
22
22
 
23
23
  private
24
24
 
25
+ def default_params
26
+ {}
27
+ end
28
+
25
29
  def response_class
26
30
  "YoutrackOnRails::Responses::#{self.class.name.demodulize}".constantize
27
31
  end
@@ -43,7 +47,7 @@ module YoutrackOnRails
43
47
  end
44
48
 
45
49
  def endpoint_uri
46
- (connection_uri.path + processed_url).tap do |_endpoint_uri|
50
+ @endpoint_uri ||= (connection_uri.path + processed_url).tap do |_endpoint_uri|
47
51
  _endpoint_uri << "?#{encoded_params}" if http_method == 'get'
48
52
  end
49
53
  end
@@ -1,6 +1,6 @@
1
1
  module YoutrackOnRails
2
2
  module Requests
3
- class CreateIssue < Post
3
+ class CreateIssue < Put
4
4
  def url
5
5
  '/rest/issue'
6
6
  end
@@ -0,0 +1,9 @@
1
+ module YoutrackOnRails
2
+ module Requests
3
+ class Put < Base
4
+ def http_method
5
+ 'put'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -4,7 +4,9 @@ module YoutrackOnRails
4
4
 
5
5
  autoload :Get, 'youtrack_on_rails/requests/get'
6
6
  autoload :Post, 'youtrack_on_rails/requests/post'
7
+ autoload :Put, 'youtrack_on_rails/requests/put'
7
8
 
9
+ autoload :ApplyCommand, 'youtrack_on_rails/requests/apply_command'
8
10
  autoload :CreateIssue, 'youtrack_on_rails/requests/create_issue'
9
11
  autoload :ListProjects, 'youtrack_on_rails/requests/list_projects'
10
12
  autoload :ListIssues, 'youtrack_on_rails/requests/list_issues'
@@ -0,0 +1,6 @@
1
+ module YoutrackOnRails
2
+ module Responses
3
+ class ApplyCommand < SimpleResponse
4
+ end
5
+ end
6
+ end
@@ -1,6 +1,13 @@
1
1
  module YoutrackOnRails
2
2
  module Responses
3
3
  class CreateIssue < SimpleResponse
4
+ def process
5
+ if success?
6
+ http_response['location']
7
+ else
8
+ false
9
+ end
10
+ end
4
11
  end
5
12
  end
6
13
  end
@@ -5,6 +5,7 @@ module YoutrackOnRails
5
5
  autoload :SimpleResponse, 'youtrack_on_rails/responses/simple_response'
6
6
  autoload :CollectionResponse, 'youtrack_on_rails/responses/collection_response'
7
7
 
8
+ autoload :ApplyCommand, 'youtrack_on_rails/responses/apply_command'
8
9
  autoload :CreateIssue, 'youtrack_on_rails/responses/create_issue'
9
10
  autoload :ListProjects, 'youtrack_on_rails/responses/list_projects'
10
11
  autoload :ListIssues, 'youtrack_on_rails/responses/list_issues'
@@ -1,3 +1,3 @@
1
1
  module YoutrackOnRails
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.8'
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.6
4
+ version: 0.0.8
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-21 00:00:00.000000000 Z
12
+ date: 2014-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -49,14 +49,17 @@ files:
49
49
  - lib/youtrack_on_rails.rb
50
50
  - lib/youtrack_on_rails/connection.rb
51
51
  - lib/youtrack_on_rails/requests.rb
52
+ - lib/youtrack_on_rails/requests/apply_command.rb
52
53
  - lib/youtrack_on_rails/requests/base.rb
53
54
  - lib/youtrack_on_rails/requests/create_issue.rb
54
55
  - lib/youtrack_on_rails/requests/get.rb
55
56
  - lib/youtrack_on_rails/requests/list_issues.rb
56
57
  - lib/youtrack_on_rails/requests/list_projects.rb
57
58
  - lib/youtrack_on_rails/requests/post.rb
59
+ - lib/youtrack_on_rails/requests/put.rb
58
60
  - lib/youtrack_on_rails/requests/sign_in.rb
59
61
  - lib/youtrack_on_rails/responses.rb
62
+ - lib/youtrack_on_rails/responses/apply_command.rb
60
63
  - lib/youtrack_on_rails/responses/base.rb
61
64
  - lib/youtrack_on_rails/responses/collection_response.rb
62
65
  - lib/youtrack_on_rails/responses/create_issue.rb