diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 749aa86..d80fe73 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,7 @@ jobs: run: cd spec/dummy_rails && bundle exec rails db:migrate - name: Run tests - #env: - # RUBYOPT: '-rbundler/setup -rrbs/test/setup' - # RBS_TEST_TARGET: 'TinyAdmin::*' + env: + RUBYOPT: '-rbundler/setup -rrbs/test/setup' + RBS_TEST_TARGET: 'TinyAdmin::*' run: bin/rspec --profile diff --git a/sig/tiny_admin/field.rbs b/sig/tiny_admin/field.rbs index 7495024..5a64831 100644 --- a/sig/tiny_admin/field.rbs +++ b/sig/tiny_admin/field.rbs @@ -5,12 +5,12 @@ module TinyAdmin attr_reader title: String attr_reader type: Symbol - def initialize: (name: String, title: String, type: Symbol, options: Hash[Symbol, String]) -> void + def initialize: (name: String, title: String, type: Symbol, ?options: Hash[Symbol, String]) -> void def apply_call_option: (untyped) -> void - def translate_value: (untyped) -> String? + def translate_value: (untyped) -> untyped - def self.create_field: (name: String, ?title: String?, ?type: Symbol?, ?options: Hash[Symbol, untyped]) -> Field + def self.create_field: (name: String | Symbol, ?title: String?, ?type: Symbol?, ?options: Hash[Symbol, untyped]?) -> Field end end diff --git a/sig/tiny_admin/plugins/active_record_repository.rbs b/sig/tiny_admin/plugins/active_record_repository.rbs index dabe2ff..13ba8ec 100644 --- a/sig/tiny_admin/plugins/active_record_repository.rbs +++ b/sig/tiny_admin/plugins/active_record_repository.rbs @@ -5,15 +5,15 @@ module TinyAdmin def collection: () -> untyped - def fields: (options: Hash[untyped, untyped]?) -> Hash[String, Field] + def fields: (?options: Hash[untyped, untyped]?) -> Hash[String, Field] def find: (untyped) -> untyped - def index_record_attrs: (untyped, fields: Hash[untyped, untyped]?) -> Hash[untyped, untyped] + def index_record_attrs: (untyped, ?fields: Hash[untyped, untyped]?) -> Hash[untyped, untyped] def index_title: () -> String - def list: (page: Integer, limit: Integer, sort: untyped?, filters: untyped?) -> Array[untyped] + def list: (?page: Integer, ?limit: Integer, ?sort: untyped?, ?filters: untyped?) -> [Array[untyped], Integer] def show_title: (untyped) -> String diff --git a/sig/tiny_admin/section.rbs b/sig/tiny_admin/section.rbs index f673090..f935ffa 100644 --- a/sig/tiny_admin/section.rbs +++ b/sig/tiny_admin/section.rbs @@ -5,6 +5,6 @@ module TinyAdmin attr_reader path: String attr_reader slug: String? - def initialize: (name: String, ?slug: String?, ?path: String?, ?options: Hash[Symbol, String]) -> void + def initialize: (name: String, ?slug: String?, ?path: String?, ?options: Hash[Symbol, String]?) -> void end end diff --git a/sig/tiny_admin/store.rbs b/sig/tiny_admin/store.rbs index 23abcbf..cf86bf4 100644 --- a/sig/tiny_admin/store.rbs +++ b/sig/tiny_admin/store.rbs @@ -1,11 +1,11 @@ module TinyAdmin class Store - attr_reader navbar: Array[Section] + attr_reader navbar: Array[Section?] attr_reader pages: Hash[String, Hash[Symbol, untyped]] attr_reader resources: Hash[String, Hash[Symbol, untyped]] - attr_reader settings: Settings + attr_reader settings: untyped - def initialize: (Settings) -> void + def initialize: (untyped) -> void def prepare_sections: (Array[untyped], logout: TinyAdmin::Section?) -> void @@ -15,7 +15,7 @@ module TinyAdmin def add_page_section: (String, Hash[Symbol, untyped]) -> TinyAdmin::Section - def add_resource_section: (String, Hash[Symbol, untyped]) -> TinyAdmin::Section + def add_resource_section: (String, Hash[Symbol, untyped]) -> TinyAdmin::Section? def add_url_section: (String, Hash[Symbol, untyped]) -> TinyAdmin::Section end diff --git a/sig/tiny_admin/support.rbs b/sig/tiny_admin/support.rbs index e56a5a2..2c347ae 100644 --- a/sig/tiny_admin/support.rbs +++ b/sig/tiny_admin/support.rbs @@ -1,19 +1,19 @@ module TinyAdmin class Support - def self.call: (?untyped, options: Array[String]?) -> String? + def self.call: (?untyped, ?options: Array[String]) -> untyped - def self.downcase: (?untyped, options: Array[String]?) -> String? + def self.downcase: (?untyped, ?options: Array[String]) -> String? - def self.format: (?untyped, options: Array[String]?) -> String? + def self.format: (?untyped, ?options: Array[String]) -> String? - def self.label_for: (?untyped, options: Array[String]?) -> String? + def self.label_for: (?untyped, ?options: Array[String]) -> untyped - def self.round: (?untyped, options: Array[String]?) -> String? + def self.round: (?untyped, ?options: Array[String]) -> untyped - def self.strftime: (?untyped, options: Array[String]?) -> String? + def self.strftime: (?untyped, ?options: Array[String]) -> String? - def self.to_date: (?untyped, options: Array[String]?) -> String? + def self.to_date: (?untyped, ?options: Array[String]) -> String? - def self.upcase: (?untyped, options: Array[String]?) -> String? + def self.upcase: (?untyped, ?options: Array[String]) -> String? end end