spacemacs/layers/+frameworks/ruby-on-rails
syl20bnr 1c4f685b13 core: refactor layer system
TL;DR Should get 20~25% speed improvement on startup, should get a big
improvement when using ivy or helm SPC h SPC. Users with layers.el files
in their layers must use `configuration-layer/declare-used-layer`
instead of `configuration-layer/declare-layer`

The implementation of the layer system made heavy use of `object-assoc`
and `object-assoc-list` functions which are not efficient. This PR
mainly replaces those object lists with hash maps in order to index the
objects by their name and achieve an O(1) access time.

The old object lists `configuration-layer--layers` and
`configuration-layer--packages` have been each by two variables each:
- `configuration-layer--indexed-layers` which is a hash-map of all the
layer objects and `configuration-layer--used-layers` which is a list of
all _used_ layers symbols,
- symmetrically `configuration-layer--indexed-packages` which is a
hash-map of all the package objects and
`configuration-layer--used-packages` which is a list of all _used_
packages symbols.

The hash map `configuration-layer--layer-paths` is gone, now we create
directly layer objects when discovering the layers and set the :dir
property. Note that previously the layer paths were the parent directory
of the layer, now :dir is the layer path.

The function `configuration-layer//make-layer` is now similar to its
counterpart `configuration-layer//make-package` in the sense that it
takes an optional `obj` to be able to override its properties.

The functions `configuration-layer/declare-layer` and
`configuration-layer/declare-layers` now takes an optional parameter
`usedp` in order to declare used or not used layers. For convenience
new functions have been added: `configuration-layer/declare-used-layer`
and `configuration-layer/declare-used-layers`, users _must_ update all
occurrences of `configuration-layer/declare-layer` by
`configuration-layer/declare-used-layers` in their `layers.el` files.

`helm-spacemacs-help` and `ivy-spacemacs-help` are updated to match the
changes in `core-configuration-layer.el`.

Rename some variables to make them more explicit:
`configuration-layer-no-layer` -> `configuration-layer-exclude-all-layers`
`configuration-layer-distribution` -> `configuration-layer-force-distribution`
2016-07-28 23:26:54 -04:00
..
img
layers.el
packages.el
README.org

Ruby on Rails layer

/TakeV/spacemacs/media/commit/1c4f685b13ab606f7ad71299547d22cf3eec6cc2/layers/+frameworks/ruby-on-rails/img/ror.png

Description

This layer aims at providing support for the Ruby on Rails framework.

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add ruby-on-rails to the existing dotspacemacs-configuration-layers list in this file.

Key bindings

Code Navigation

Key binding Description
SPC m r f a find localization file
SPC m r f c find controller
SPC m r f e find environment file
SPC m r f f find feature
SPC m r f h find helper
SPC m r f i find initializer
SPC m r f j find javascript file
SPC m r f l find library
SPC m r f m find model
SPC m r f n find migration
SPC m r f o find log
SPC m r f p find spec file
SPC m r f r find rake task
SPC m r f s find stylesheet file
SPC m r f t find test
SPC m r f u find fixture
SPC m r f v find view
SPC m r f y find layout
SPC m r f @ find mailer
SPC m r g c go to current controller
SPC m r g d go to DB schema
SPC m r g e go to DB seeds
SPC m r g h go to current helper
SPC m r g j go to current javascript
SPC m r g g go to Gemfile
SPC m r g m go to current model
SPC m r g n go to current migration
SPC m r g p go to current spec
SPC m r g r go to routes
SPC m r g s go to current stylesheet
SPC m r g t go to current test
SPC m r g u go to current fixture
SPC m r g v go to current view
SPC m r g z go to spec helper
SPC m r g . go to file at point (faster but less powerful than SPC m g g)

Refactoring

Key binding Description
SPC m r R x extract region into partial

RUN commands

Key binding Description
SPC m r : run rake task
SPC m r c c run rails generator
SPC m r i start rails console
SPC m r s r reload Rails project
SPC m r x s start rails server

Ex-commands

Key binding Description
:A Switch between implementation and tests