wrata_api 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b6f5e6d8b1c1348e759420dbf9ecfa2a78cfdbe221acbbe28361c411548d0e9
4
- data.tar.gz: 0a1eea0e1a4d92b5eae11bab9b643123558ccec754f15273cf09b7611083dc62
3
+ metadata.gz: 49b985a93eed2d3018c26f251184ed8a6114c375de393b94a9c9c782a8a99b26
4
+ data.tar.gz: b1730d2ac002a66092b555773113f9cb842f15d80e25a34ae95d1c42b70883e6
5
5
  SHA512:
6
- metadata.gz: e6761e1c0e5605e7849c3302131b23b6ecfc224ecbde4e4b3c7851671db2df8812c8aea0966e9af25c28191eca5fa50343ccf767d74b5e53c6a5ca0414cfde58
7
- data.tar.gz: f3b90d3f076cda0ae189b320c3370607103333e6d104e1bfd60f6cedf41600199a92efc6ca3d55eedab087cfc3be0b236eb656f22d258cdc1aaab89a8909c08c
6
+ metadata.gz: 8807f18c845bf79867495012e399dedea3c0eff35571776ace95b9bc3d606441cab089f6c512f02d3ad96725c31e5ffee649cf0fa88f79cd52dd582928869f6c
7
+ data.tar.gz: 7ed42f27c95fe35b1795d2c36594f4f0d91e37e1eeb3cae63c20be2e4947606129047100172ca29b52a693065c63f747fefac45e78290dd2a7d2e6d830c26f52
@@ -3,6 +3,10 @@
3
3
  module WrataApi
4
4
  # Methods to work with file tree
5
5
  module FileListMethods
6
+ # Return list of files in specific project
7
+ # @param project [String] name of project
8
+ # @param ref [String] branch or hash of commit to get list of files
9
+ # @return [Array<String>] list of files
6
10
  def file_list(project, ref = 'master')
7
11
  uri = URI.parse("#{@uri}/runner/file_tree")
8
12
  body = {
@@ -4,6 +4,6 @@ module WrataApi
4
4
  # This module holds the WrataApi version information.
5
5
  module Version
6
6
  # @return [String] current gem version
7
- STRING = '0.1.1'
7
+ STRING = '0.1.2'
8
8
  end
9
9
  end
@@ -16,10 +16,9 @@ module WrataApi
16
16
  # @param body [Hash] body of request
17
17
  # @return [JSON] result of request
18
18
  def perform_get(uri, body = {})
19
- http = Net::HTTP.new(uri.host, uri.port)
20
19
  request = Net::HTTP::Get.new(uri.request_uri, default_header)
21
20
  request.set_form_data(body)
22
- body = http.request(request).body
21
+ body = http_object(uri).request(request).body
23
22
  @logger.info("Get request: #{uri} answered: #{body}")
24
23
  return {} if body.empty?
25
24
 
@@ -31,7 +30,7 @@ module WrataApi
31
30
  # @param body [Hash] body of request
32
31
  # @return [JSON] result of request
33
32
  def perform_post(uri, body = {})
34
- http = Net::HTTP.new(uri.host, uri.port)
33
+ http = http_object(uri)
35
34
  request = Net::HTTP::Post.new(uri.request_uri, default_header)
36
35
  request.set_form_data(body)
37
36
  http.read_timeout = 500
@@ -41,5 +40,13 @@ module WrataApi
41
40
 
42
41
  JSON.parse(body)
43
42
  end
43
+
44
+ # @param uri [URI] url of server
45
+ # @return [Net:HTTP] http instance
46
+ def http_object(uri)
47
+ http = Net::HTTP.new(uri.host, uri.port)
48
+ http.use_ssl = true if uri.scheme == 'https'
49
+ http
50
+ end
44
51
  end
45
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrata_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ONLYOFFICE
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-05-26 00:00:00.000000000 Z
12
+ date: 2020-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -25,6 +25,62 @@ dependencies:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '13.0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rubocop
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '='
33
+ - !ruby/object:Gem::Version
34
+ version: 0.85.0
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '='
40
+ - !ruby/object:Gem::Version
41
+ version: 0.85.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: rubocop-performance
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '='
47
+ - !ruby/object:Gem::Version
48
+ version: 1.6.0
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '='
54
+ - !ruby/object:Gem::Version
55
+ version: 1.6.0
56
+ - !ruby/object:Gem::Dependency
57
+ name: rubocop-rake
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '='
61
+ - !ruby/object:Gem::Version
62
+ version: 0.5.1
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '='
68
+ - !ruby/object:Gem::Version
69
+ version: 0.5.1
70
+ - !ruby/object:Gem::Dependency
71
+ name: rubocop-rspec
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '='
75
+ - !ruby/object:Gem::Version
76
+ version: 1.39.0
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - '='
82
+ - !ruby/object:Gem::Version
83
+ version: 1.39.0
28
84
  description: Wrapper around wrata API
29
85
  email:
30
86
  - shockwavenn@gmail.com