appscrolls icon indicating copy to clipboard operation
appscrolls copied to clipboard

add --save NAME option to save your chosen scrolls when creating an app

Open jackdempsey opened this issue 12 years ago • 12 comments

Simple way to save your selections. Considering how to implement pulling them back out and using them when generating.

On one hand, I thought about overloading the scrolls option to let you do -s saved_name, rather than creating yet another option. At the same time another option would be cleaner and likely more obvious...so maybe I'll spike on that and see how it goes.

Also, yeah, didn't include tests. Happy to give them a go if you have some guidance on it--I always find testing code like this to sometimes get a bit awkward and unhelpful.

jackdempsey avatar Apr 29 '12 04:04 jackdempsey

Seems like a ~/.scrolls dir might be desired from other pull requests? Maybe makes sense to standardize that, and then the file that stores this data can go in there?

jackdempsey avatar Apr 29 '12 05:04 jackdempsey

Perhaps a "saved scroll" is just another scroll with dependencies? (the scrolls you originally selected)

drnic avatar Apr 29 '12 18:04 drnic

Then we don't need --use, rather you just select your custom scroll "my-scrolls" normally: scrolls new myapp2 -s my-scrolls.

Thoughts?

drnic avatar Apr 29 '12 18:04 drnic

Yep, definitely like that style of use. You could even publish scrolls that represent common configs, etc.

So, how do we build this? It would seem that if scrolls had a way of depending on other scrolls, you could easy save one that just depends on those you selected. I don't believe they currently have this functionality though? Seems a basic version of this wouldn't be hard to build.

jackdempsey avatar Apr 29 '12 22:04 jackdempsey

Ahh, just found the require option after looking through source. Seems this would do it. I'm going to give this idea a go and see how it turns out.

jackdempsey avatar Apr 29 '12 23:04 jackdempsey

Ok, code is ugly (partial copy/paste from rake task), but is proof-of-concept ready. I like this strategy. Would probably want to combine with other efforts to write out scroll file to ~/.scrolls/{name}.rb or something similar.

jackdempsey avatar Apr 29 '12 23:04 jackdempsey

I'm trying to think through the UX here.

  1. You generate an app with some scrolls.
  2. You realize you missed some scrolls, so you generate it again (happens to me)
  3. Later, you want to generate a new app with the scrolls you previously used; or a co-worker is creating a new app and wants to use those scrolls

Perhaps --save isn't in their mind? Perhaps we offer a new command scrolls save and it shows you your previous history, you select one, and give it a name.

Thoughts?

drnic avatar Apr 30 '12 03:04 drnic

Ok so it automatically writes a history file that you then select from? I can see that working nicely.

  1. Every time you run scrolls we add to a history log
  2. You can call scrolls history to see that list. You can then --save or --use directly from it?

I think I like the history command, pure in what it does, and then the options give you both saving as a new scroll for future use, as well as ability to just reuse easily without worrying about generating a new scroll.

What you think?

jackdempsey avatar Apr 30 '12 06:04 jackdempsey

Yeah that sounds good.

drnic avatar Apr 30 '12 14:04 drnic

Ok, spiked out functionality as described above, take a peek and let me know what you think.

jackdempsey avatar May 01 '12 07:05 jackdempsey

Thoughts? If looks good, will take a look at writing some tests for this.

jackdempsey avatar May 13 '12 23:05 jackdempsey

The idea looks great. Continue!

drnic avatar May 15 '12 05:05 drnic