r2-oas 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,9 +29,10 @@ module R2OAS
29
29
 
30
30
  def generate_docs_from_schema_files
31
31
  result_before_squeeze = schema_files_paths.each_with_object({}) do |path, data|
32
+ file_manager = FileManager.new(path)
32
33
  yaml = YAML.load_file(path)
33
34
  data.deep_merge!(yaml)
34
- logger.info " Use schema file: \t#{path}"
35
+ logger.info " Use schema file: \t#{file_manager.save_file_path(type: :relative)}"
35
36
  end
36
37
 
37
38
  result = if many_paths_file_paths.present?
@@ -51,7 +51,7 @@ module R2OAS
51
51
 
52
52
  path_item_file_manager.save(result.to_yaml) unless path_item_file_manager.skip_save?
53
53
 
54
- yield path_item_file_manager.save_file_path if block_given?
54
+ yield path_item_file_manager.save_file_path(type: :relative) if block_given?
55
55
  end
56
56
  end
57
57
 
@@ -68,7 +68,7 @@ module R2OAS
68
68
  file_manager = FileManager.new(field_name, :relative)
69
69
  file_manager.save(result.to_yaml)
70
70
 
71
- yield file_manager.save_file_path if block_given?
71
+ yield file_manager.save_file_path(type: :relative) if block_given?
72
72
  end
73
73
  end
74
74
  end
@@ -31,11 +31,18 @@ module R2OAS
31
31
  save(result.to_yaml)
32
32
  end
33
33
 
34
- def save_file_path
35
- File.expand_path(@relative_save_file_path).tap do |abs_path|
34
+ def save_file_path(type: :full)
35
+ file_path = File.expand_path(@relative_save_file_path).tap do |abs_path|
36
36
  abs_dir = File.dirname(abs_path)
37
37
  FileUtils.mkdir_p(abs_dir) unless FileTest.exists?(abs_dir)
38
38
  end
39
+
40
+ case type
41
+ when :relative
42
+ file_path.sub(%r{^#{Dir.getwd}/?}, '')
43
+ else
44
+ file_path
45
+ end
39
46
  end
40
47
 
41
48
  def load_data
@@ -6,7 +6,7 @@ module R2OAS
6
6
  class Ls < Base
7
7
  def print
8
8
  Dir.glob("#{schema_save_dir_path}/paths/**/**.yml").each do |path|
9
- puts path
9
+ puts path.sub(%r{^#{Dir.getwd}/?}, '')
10
10
  end
11
11
  end
12
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module R2OAS
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
data/r2-oas.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.email = ['te108186@gmail.com']
12
12
 
13
13
  spec.summary = 'Provide rake tasks to management API Docment (OpenAPI)'
14
- spec.description = "Let's intuitively write API documentation with Swagger Editor in your Rails Project! 😊"
14
+ spec.description = "Let's intuitively write API documentation with Swagger Editor in your Rails Project! 😊 Provide rake tasks to management API Docment (OpenAPI) 🎉"
15
15
 
16
16
  spec.homepage = 'https://yukihirop.github.io/r2-oas'
17
17
  spec.license = 'MIT'
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_runtime_dependency 'paint'
33
33
  spec.add_runtime_dependency 'rails', '>= 4.2.5'
34
34
  spec.add_runtime_dependency 'terminal-table', '~> 1.6.0'
35
- spec.add_runtime_dependency 'watir', '~> 6.0'
35
+ spec.add_runtime_dependency 'watir', '~> 6.16.5'
36
36
  spec.add_development_dependency 'bundler', '~> 1.17'
37
37
  spec.add_development_dependency 'coveralls'
38
38
  spec.add_development_dependency 'pry'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r2-oas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - yukihirop
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-22 00:00:00.000000000 Z
11
+ date: 2020-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '6.0'
103
+ version: 6.16.5
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '6.0'
110
+ version: 6.16.5
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: bundler
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -193,7 +193,8 @@ dependencies:
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  description: "Let's intuitively write API documentation with Swagger Editor in your
196
- Rails Project! \U0001F60A"
196
+ Rails Project! \U0001F60A Provide rake tasks to management API Docment (OpenAPI)
197
+ \U0001F389"
197
198
  email:
198
199
  - te108186@gmail.com
199
200
  executables: []
@@ -220,6 +221,7 @@ files:
220
221
  - docs/.nojekyll
221
222
  - docs/README.md
222
223
  - docs/_sidebar.md
224
+ - docs/attention/if_clash.md
223
225
  - docs/index.html
224
226
  - docs/schema/3.0.0.md
225
227
  - docs/setting/COC.md