oas_core 0.5.1 → 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: 202ef79c5565fcd8d1c8443267f718d006dc8daa4abb8dd50b08863e8c06af80
4
- data.tar.gz: 0b0c223a44e635e63f28e4e0e268ebba99efde363d2f83fad7446af3a299d8f6
3
+ metadata.gz: fee642cbd4064b2d7fb2685bb4ef2ff66163ec98349aabc2bbbe932c0370577b
4
+ data.tar.gz: b247d663506673b1c214eba736d70645ff83d6c93bf1c24df06c500590b08afd
5
5
  SHA512:
6
- metadata.gz: 2dcd7323e5ce3566d7292790bff07e84a33a608c181d70cf9bbf822cb15a362ea98dcdc85496145a5e1187d3a1b765a52e6a51e4215cc4da7ec40bce9c04ad5d
7
- data.tar.gz: 871a04fe56856868ce4d8927ddfd62e3a20dcd8cf87af11e276ccc7c132d2884876edeaf536fee251b5e57f6a4b5f2bc9a4c31bde6459fc5a4235426782fa573
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.1'
4
+ VERSION = '0.5.2'
5
5
  end
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.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - a-chacon