Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle file between spec and code #2

Open
dinshaw opened this issue Feb 4, 2013 · 4 comments
Open

Toggle file between spec and code #2

dinshaw opened this issue Feb 4, 2013 · 4 comments

Comments

@dinshaw
Copy link

dinshaw commented Feb 4, 2013

Seems this is the cleanest implementation of this func that is out there. Thank you.
The two other things i'd love to see/help out with, are

  • going back and forth between the files
  • creating the file, if it doesn't exist

I haven't done any python, but always wanted to. If you are still working on this and willing to offre some guidance, i'll take a stab.
Thanks again

@temochka
Copy link
Contributor

Hey,

I pushed a few updates today. The plugin now allows you to toggle between the class and its spec. Searching for a file by a name of its spec may take some time on big projects though. The approach used there is not quite efficient. I hope that wouldn't be a problem.

The problem with creating files automatically is I don't see a good solution for naming problem. For example, while the spec for lib/brainfuck_parser.rb should probably be located in spec/lib/brainfuck_parser_spec.rb, the spec for app/models/user.rb is usually stored in spec/models/user.rb (skipping app). Also people don't always follow standard naming conventions. What do you think?

@nLight
Copy link
Member

nLight commented Feb 25, 2013

MB we should open an input field with suggested path and filename? So users will be able change it if they want to.

@Suor
Copy link
Member

Suor commented Feb 25, 2013

Or we can generate a list of feasible variants and show them in a drop-down.

@dinshaw
Copy link
Author

dinshaw commented Feb 26, 2013

thanks for the updates @temochka. i think the omission of the app dir maybe the only big inconsistency; otherwise it would always be spec plus the relative path.
the open-related https://github.com/vojtajina/sublime-OpenRelated has a really cool idea that lets you define patterns. Unfortunately it seems to have some implementation problems. That might be an interesting path, all the same.
For creation, the rspec (https://github.com/SublimeText/RSpec) plugin offers you a dialog with a best guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants