42 comments

[ 2.7 ms ] story [ 99.5 ms ] thread
Great! Also see Thoughtbot Suspenders, https://github.com/thoughtbot/suspenders

It also uses Bourbon, HAML, RSpec, etc. as well as many more gems. Overall I like and recommend what Thoughtbot creates.

Cool, thanks. I hadn't heard of suspenders. I'll check it out (and maybe steal some of their stuff... ;))
So, I did something similar, and I found that one of my least favorite things was going into the browser to create and link the github repo. Using the octokit gem, I automated that part. Feel free to swipe some code from my gist:

https://gist.github.com/BrainScraps/5952463

Rock on.

That's great, thanks! I hate creating the github repo as well (sometimes I skip that part and just use Heroku). If you don't mind I'll copy some of your code and make creating a github repo another optional prompt.
Absolutely!

I noticed that suspenders(thoughtbot) also had that option. They used hub, which I think is a bit more intrusive than just installing the octokit gem. I'm interested to see what you come up with! :)

Why Haml instead of Slim?
Why Haml at all? You will be changing all of your html in a browser anyways. Why not write html/erb?
I know this would become a debate, haha. HAML has definitely disadvantages, ERB is indeed nicer if you need to write a lot of nested tags, or stuff like strong, small, etc. Still I've found it's more pleasant to work with... But that's just personal taste and I should probably make it optional.
Coffeescript is really nice, though it can sometimes be a pain to debug. Haml is more succinct than HTML and I like the forced tab alignment. The problem is I almost never write view code that does not need to immediately be debugged in the browser. So I have to pay a mental tax to transform it nearly every time I write it.
You can mix them.

    %p Here is a Haml paragraph with a <strong>bold</strong> word.
Personal preference, but I find haml infinitely more productive and easier to manage.
In my opinion Slim is superior to Haml. I used to love Haml, but Slim takes it to the next level. A syntax with less control characters and a higher performance [1] made me switch.

I still haven't heard a single argument for writing pure HTML instead of Haml/Slim. Even for static HTML I use Slim.

[1] https://travis-ci.org/slim-template/slim/jobs/9676072

Slim also supports HTML streaming. Not sure if Haml have fixed this yet.
> Remove the require_tree directives from the sass and JS files. It's better design to import or require things manually.

I'm sorry, what?

Personal taste I guess, I'm always happy to specify my requires manually so I have a better idea and more control over what's going on, makes things more obvious for other developers reading your code too.
You know you can require another file at the top and the asset pipeline will ensure it is loaded first right?
Yeah, personal choice, but I've had a lot of problems with rails "require_tree" in the past. Some gems add files to your code that shouldn't be required. ActiveAdmin is an example of that (though I think they've fixed that lately). To clarify, this is not about the "require" directives, only the "require_tree"
That sounds like an issue with the gems and not using require_tree
Yeah, but IMHO it's a lot cleaner if you actually know what's included instead of having 30 files in a kind of random order in there.
You can view the files in the html script includes while in development mode. It just feels wrong to me to do this manually. I have written the infrastructure code to handle javascript minification and compression. Not having to manage a script order file is one of the best parts of the asset pipeline.
Yeah, maybe I should give the asset pipeline another try. I started the habit of including files manually when it was first launched and was quite buggy. Ryan Bates from Railscasts also seems to prefer including his assets manually, he mentioned that in some of his screencasts. I kinda stole the habit from him.

I'll give the asset pipeline another try the next time...

No guard or similar? Do you run tests and reload pages manually or use something else?
Yeah, I usually use guard. Indeed, I forgot to put that in there. Thanks for noticing!
For development I have become cracked out on these for all of my apps

    group :development do
      gem 'better_errors' #literally what it says
      gem 'binding_of_caller' #adds REPL to better_errors
      gem 'quiet_assets' #prevent asset pipeline log doesnt go to console
      gem 'guard-livereload' #adds live reload
      gem 'rack-livereload'
      gem 'meta_request' #chrome rails panel extension 
    end
Ah, I like better_errors as well. I will probably add that! I think quiet_assets is no longer necessary, you can just change that in the config file.

I don't know the other, but will take a look at them! Thanks!

Oh cool thanks! Been in such a habit i never noticed:

    config.assets.logger = false
I just love GitHub. Followed the link, noticed that certain links were highlighted as links but not working. Went to the README, edited the broken links, sent a pull request [1], and now it works as expected. Everything done without having to leave "browsing mode", i.e. no cloning, no terminal, no editor.

[1] https://github.com/dennybritz/rails_startup_template/pull/3

Rather than Haml, at this point, I'd use Slim. Slim is cleaner (I'd say nicer) and faster than haml.

http://slim-lang.com/

Do you have any side-by-side benchmark comparisons of haml and slim? Not saying you're mistaken, but I'd be interested in those metrics.
Why not make a switch gems, in case someone doesn't want them? In other words, something like:

ENV['dont_include']='bourbon,analytics-ruby' rails new [app-name] -m template.rb

Allow SECURE_TOKEN to be set via environment variable and it to be rotate-able.