Skip to content

Instantly share code, notes, and snippets.

@tatat
Last active December 12, 2015 08:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatat/4746409 to your computer and use it in GitHub Desktop.
Save tatat/4746409 to your computer and use it in GitHub Desktop.
こんな感じで行こうと思う
#!/bin/bash
jquery_version="1.9.1"
jquery_name="jquery-${jquery_version}.min.js"
jquery_url="http://code.jquery.com/$jquery_name"
mkdir -p haml coffee sass vendor public/{javascripts,stylesheets,images,lib}
touch vendor/.gitkeep
curl -L "$jquery_url" > "public/lib/$jquery_name"
echo 'Hi!' > README.md
cat > .gitignore <<EOS
.DS_Store
/.sass-cache
/.bundle
/vendor/bundle
EOS
cat > Gemfile <<EOS
source :rubygems
group :development do
gem 'rb-fsevent'
gem 'guard-compass'
gem 'guard-coffeescript'
gem 'guard-haml'
gem 'guard-livereload'
end
EOS
cat > Guardfile <<EOS
guard 'coffeescript', input: 'coffee', output: 'public/javascripts'
guard 'compass' do
watch(%r{^sass/(.*)\.s[ac]ss$})
end
guard 'haml', input: 'haml', output: 'public', haml_options: {attr_wrapper: '"'} do
watch(%r{^haml/.+(\.html\.haml)$})
end
guard 'livereload' do
watch(%r{^public/.+\.(css|js|html)$})
end
EOS
cat > config.rb <<EOS
http_path = "/"
css_dir = "public/stylesheets"
sass_dir = "sass"
images_dir = "public/images"
javascripts_dir = "public/javascripts"
EOS
cat > coffee/main.coffee <<EOS
$ ->
console?.log? 'Hi!'
EOS
cat > sass/screen.scss <<EOS
@import "compass/reset";
@import "compass";
body {
font-family: "ヒラギノ角ゴ Pro W3","Hiragino Kaku Gothic Pro", Osaka, "メイリオ", Meiryo, "MS Pゴシック", sans-serif;
}
EOS
cat > haml/index.html.haml <<EOS
!!! 5
%html{html_attrs("ja")}
%head
%meta{charset: "UTF-8"}
%title Hi!
%link{rel: "stylesheet", href: "/stylesheets/screen.css"}
%script{src: "/lib/${jquery_name}"}
%script{src: "/javascripts/main.js"}
%body
%p Hi!
EOS
bundle install --path vendor/bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment