Module: Rails::Annotate::Solargraph
- Extended by:
- TerminalColors
- Defined in:
- lib/rails/annotate/solargraph.rb,
lib/rails/annotate/solargraph/model.rb,
lib/rails/annotate/solargraph/scope.rb,
lib/rails/annotate/solargraph/version.rb,
lib/rails/annotate/solargraph/configuration.rb,
lib/rails/annotate/solargraph/terminal_colors.rb
Defined Under Namespace
Modules: TerminalColors Classes: Configuration, Error, Model, Scope
Constant Summary collapse
- MODEL_DIR =
'app/models'
- RAKEFILE_NAME =
'rails_annotate_solargraph.rake'
- CONFIG =
Configuration.new
- VALID_MODIFICATION_METHODS =
::Set[:annotate, :remove_annotation].freeze
- SCHEMA_CLASS_NAME =
'AnnotateSolargraphSchema'
- SOLARGRAPH_FILE_NAME =
'.solargraph.yml'
- SOLARGRAPH_FILE_PATH =
SOLARGRAPH_FILE_NAME
- SCHEMA_FILE_NAME =
'.annotate_solargraph_schema'
- SCHEMA_RAILS_PATH =
SCHEMA_FILE_NAME
- VERSION =
'0.5.5'
Constants included from TerminalColors
Class Method Summary collapse
- .configure {|| ... } ⇒ Object
-
.generate ⇒ Array<String>
(also: call)
Array of changed files.
- .model_classes ⇒ Array<ActiveRecord::Base>
-
.remove ⇒ Array<String>
Array of changed files.
Methods included from TerminalColors
error, error_string, title, title_string, with_style, with_styles
Class Method Details
.configure {|| ... } ⇒ Object
56 57 58 |
# File 'lib/rails/annotate/solargraph.rb', line 56 def configure yield(CONFIG) end |
.generate ⇒ Array<String> Also known as: call
Returns Array of changed files.
43 44 45 46 47 |
# File 'lib/rails/annotate/solargraph.rb', line 43 def generate title 'Generating model schema annotations' create_schema_file modify_models :annotate end |
.model_classes ⇒ Array<ActiveRecord::Base>
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/rails/annotate/solargraph.rb', line 63 def model_classes @model_classes ||= begin base_abstract_class = begin ::ApplicationRecord rescue ::ActiveRecord::Base end extract_subclasses(base_abstract_class).sort_by(&:name) end end |
.remove ⇒ Array<String>
Returns Array of changed files.
50 51 52 53 |
# File 'lib/rails/annotate/solargraph.rb', line 50 def remove title 'Removing model schema annotations' modify_models :remove_annotation end |