Sha256: e0d2e9a70b838dbf8e831aef37ed83370178a96523bb11ab2fd25853252486ce

Contents?: true

Size: 1.28 KB

Versions: 2

Compression:

Stored size: 1.28 KB

Contents

namespace :orthoses do
  task :rails do
    # Phase to load libraries
    require Rails.root / "config/application"
    require 'orthoses/rails'

    # You can choose logger level
    Orthoses.logger.level = :warn

    # DSL for Orthoses.
    Orthoses::Builder.new do
      use Orthoses::CreateFileByName,
        to: 'sig/orthoses', # Write to this dir. (require)
        depth: 1,           # Group files by module name path depth. (default: nil)
        rmtree: true        # Remove all `to` dir before generation. (default: false)

      # Complement missing const name.
      use Orthoses::MissingName

      # You can use other publicly available middleware.
      # `Orthoses::YARD` is available at https://github.com/ksss/orthoses-yard.
      # By using this middleware, you can add the capability
      # to generate type information from YARD documentation.
      # use Orthoses::YARD,
      #   parse: ['{app/lib}/**/*.rb']

      # You can load hand written RBS.
      # use Orthoses::LoadRBS,
      #   paths: Dir.glob(Rails.root / "sig/hand-written/**/*.rbs")

      # Middleware package for rails application.
      use Orthoses::Rails::Application

      # Application code loaded here is the target of the analysis.
      run Orthoses::Rails::Application::Loader.new
    end.call
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
orthoses-rails-1.4.0 lib/generators/orthoses/rails/templates/rails.rake
orthoses-rails-1.3.0 lib/generators/orthoses/rails/templates/rails.rake