Last active
August 29, 2016 03:15
-
-
Save jsteiner/5556217 to your computer and use it in GitHub Desktop.
Example .vimrc projections, including projections for Active Model Serializers, Draper, and FactoryGirl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:rails_projections = { | |
\ "config/projections.json": { | |
\ "command": "projections" | |
\ }, | |
\ "spec/features/*_spec.rb": { | |
\ "command": "feature", | |
\ "template": "require 'spec_helper'\n\nfeature '%h' do\n\nend", | |
\ }} | |
let g:rails_gem_projections = { | |
\ "active_model_serializers": { | |
\ "app/serializers/*_serializer.rb": { | |
\ "command": "serializer", | |
\ "affinity": "model", | |
\ "test": "spec/serializers/%s_spec.rb", | |
\ "related": "app/models/%s.rb", | |
\ "template": "class %SSerializer < ActiveModel::Serializer\nend" | |
\ } | |
\ }, | |
\ "draper": { | |
\ "app/decorators/*_decorator.rb": { | |
\ "command": "decorator", | |
\ "affinity": "model", | |
\ "test": "spec/decorators/%s_spec.rb", | |
\ "related": "app/models/%s.rb", | |
\ "template": "class %SDecorator < Draper::Decorator\nend" | |
\ } | |
\ }, | |
\ "factory_girl_rails": { | |
\ "spec/factories.rb": { | |
\ "command": "factories", | |
\ "template": "FactoryGirl.define do\nend" | |
\ } | |
\ }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@pjg Does
"related": "db/schema.rb#%s"
work as expected? I assume it's meant to jump to that line.I'm trying
because I want custom test paths. :R opens schema.rb but doesn't jump to any line in particular.