… but more like black magic. The one where you have to sacrifice kittens to get anything done.
I want to do a simple thing using devise: authenticated users go to a page on the root of the site, and unauthenticated users go to another.
I’ve been banging my head for days on this. Between the various ways to do it, the different ruby, rails and devise versions that use different methods, it’s a mess. Nobody seems to agree on the best way to do it.
Well, I’ve found the way that I believe is the most simple.
devise_scope :user do
authenticated :user do
root to: 'dashboard#index', as: 'dashboard'
unauthenticated :user do
root to: 'devise/sessions#new', as: 'unauthenticated'
Things to remember :
- “devise_scope” is necessary. I do not understand why, nor what it does.
- the “as: xxx” parts are necessary, too. It looks like Rails is fine with creating two routes pointing to the same URL, but wants different names for them. I would have tought that it would create these routes only at run-time.
- do not modify several things at once and hope to understand what went wrong when everything crashes down, as long as you don’t understand the language and framework.
We have a Windows (WPF) app distributed to end users (general public).
I am changing the build process to simplify it. It is currently comprised of these steps :
- A SVN commit runs a Jenkins build
- Jenkins runs a few NAnt scripts
- NAnt builds the application through MSBuild
- It then launches a custom application that does several things:
- It downloads a few infos through a webservice, updates a DB, etc
- It modifies InnoSetup scripts with a few dynamic informations, like the version number
- It signs the binaries with a SSL certificate
- It launches the InnoSetup scripts to create the setup packages
- It signs the setup packages with the SSL certificate
- It then changes a few things before running the custom app again, in order to generate a different setup package
That’s quite a complicated and convoluted solution to a not-so-complicated problem. And, most importantly, it uses too much different technologies : I believe both the NAnt scripts and the custom application can be removed from the process.
So, I’m looking for a suitable replacement. I’ve had my eyes on Albacore for a few weeks, which looks very fun, and would allow me to use Ruby, which I might need to learn for later projects. But it has important problems:
- It’s very light on documentation: the official wiki documents the V1, but it’s incompatible with the current V2, which is better. You have to look at the sources to see what’s available to you, and how to use it.
- Help is hard to come by on the net.
- It uses Ruby
- it’s yet another layer in the build stack
- it won’t allow me to get rid of the custom app (good luck updating an Access DB through a SOAP webservice)
- runnig Ruby on Windows is easy, but many gems are not available (some of them very useful)
So now I’m looking at FAKE, which also looks promising. It has the huge advantage of allowing me to easily migrate the custom app (or simply reuse its components), because it’s .NET. But it also has problems:
- Documentation does not seem much better, even though I haven’t yet started using it, so maybe it’s enough
- Help seems to be even harder to come by, there seems to be even less FAKE questions on Stackoverflow than Albacore
- It uses F#, which I don’t know at all, and won’t need in the future, but it’s always interesting to learn a new language (and apparently it’s the new kid on the block in .NET)
That being said, I will try FAKE anyway. It will allow me to remove build layers, and maybe remove the custom app. It will also probably be more easily adopted by the .NET community, especially since Scott Hanselman posted about it a few weeks ago.
Looking from the comments there, if FAKE does not work for me, I might want to try PSake: it’s in PowerShell, wich is a great scripting language, and I know pretty well already.