oas_core 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '019372235c3a772e19f7e7c60b15b3409130efbd8a16d9a75a5c7c9a1a9ecd09'
4
- data.tar.gz: 694f56c8a25feeb710a0a431ae44e3975a8b8b23a72d2433570f944de1b002f0
3
+ metadata.gz: fee642cbd4064b2d7fb2685bb4ef2ff66163ec98349aabc2bbbe932c0370577b
4
+ data.tar.gz: b247d663506673b1c214eba736d70645ff83d6c93bf1c24df06c500590b08afd
5
5
  SHA512:
6
- metadata.gz: cb19a595ad1d2031eb0872b5c2d795b63e113ae7920fd74fafec502193a71e5c1b900c4edaecdbacd8951721dd8b419eec82c80dfcf8ee5102d5e947d7889cf6
7
- data.tar.gz: 59f273f6e638a37d54bd010e79faff713d3df1713f494dc4dec752fae1bbfdd1276bbad5eb87115e787a80e01af129f7f7f56d451d20df152bd4fc6f7f2e73c3
6
+ metadata.gz: b53a2347828d9842eaf1a8ff836c4049152c74130e0717f25573a840c07dd0e7cc5ca73dc171e962d1b6ff928548f87ff57b73be9c465227213c591753c18904
7
+ data.tar.gz: 5a6ade5f6ab47fb0ada36832f7615026238766fcec56dc068e74a2bccc2f85db19c636a395bfc0c366fe2c1fd9f128f2718f615d9516096d4e8d80ca5416be1a
@@ -31,8 +31,7 @@ module OasCore
31
31
 
32
32
  def extract_summary(oas_route:)
33
33
  summary_tag = oas_route.tags(:summary).first
34
- summary_tag&.text || generate_crud_name(oas_route.method_name,
35
- oas_route.controller.downcase) || "#{oas_route.verb} #{oas_route.path}"
34
+ summary_tag&.text || generate_crud_name(oas_route.method_name) || "#{oas_route.verb} #{oas_route.path}"
36
35
  end
37
36
 
38
37
  def extract_operation_id(oas_route:)
@@ -74,21 +73,14 @@ module OasCore
74
73
  end
75
74
  end
76
75
 
77
- def generate_crud_name(method, controller)
78
- controller_name = controller.to_s.underscore.humanize.downcase.pluralize
79
-
80
- case method.to_sym
81
- when :index
82
- "List #{controller_name}"
83
- when :show
84
- "View #{controller_name.singularize}"
85
- when :create
86
- "Create new #{controller_name.singularize}"
87
- when :update
88
- "Update #{controller_name.singularize}"
89
- when :destroy
90
- "Delete #{controller_name.singularize}"
91
- end
76
+ def generate_crud_name(method)
77
+ {
78
+ index: 'List',
79
+ show: 'View',
80
+ create: 'Create',
81
+ update: 'Update',
82
+ destroy: 'Delete'
83
+ }.fetch(method.to_sym)
92
84
  end
93
85
  end
94
86
  end
@@ -2,9 +2,7 @@
2
2
 
3
3
  module OasCore
4
4
  class OasRoute
5
- # TODO: Check what variables are in use and remove the ones that are not.
6
- attr_accessor :controller_class, :controller_action, :controller, :controller_path, :method_name, :verb, :path,
7
- :docstring, :source_string
5
+ attr_accessor :controller, :method_name, :verb, :path, :docstring, :source_string
8
6
  attr_writer :tags
9
7
 
10
8
  def initialize(attributes = {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OasCore
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.2'
5
5
  end
data/lib/oas_core.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'yard'
4
4
  require 'method_source'
5
- require 'oas_core/string'
5
+ require 'active_support/all'
6
6
 
7
7
  module OasCore
8
8
  require 'oas_core/version'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oas_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - a-chacon
@@ -9,6 +9,20 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: activesupport
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '7.0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '7.0'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: method_source
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +94,6 @@ files:
80
94
  - lib/oas_core/spec/specable.rb
81
95
  - lib/oas_core/spec/specification.rb
82
96
  - lib/oas_core/spec/tag.rb
83
- - lib/oas_core/string.rb
84
97
  - lib/oas_core/utils.rb
85
98
  - lib/oas_core/version.rb
86
99
  - lib/oas_core/yard/example_tag.rb
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class String
4
- def squish
5
- dup.squish!
6
- end
7
-
8
- def squish!
9
- gsub!(/[[:space:]]+/, ' ')
10
- strip!
11
- self
12
- end
13
- end