├── .gitignore ├── README.md └── template.rb /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Ruby template 3 | *.gem 4 | *.rbc 5 | /.config 6 | /coverage/ 7 | /InstalledFiles 8 | /pkg/ 9 | /spec/reports/ 10 | /test/tmp/ 11 | /test/version_tmp/ 12 | /tmp/ 13 | 14 | ## Specific to RubyMotion: 15 | .dat* 16 | .repl_history 17 | build/ 18 | 19 | ## Documentation cache and generated files: 20 | /.yardoc/ 21 | /_yardoc/ 22 | /doc/ 23 | /rdoc/ 24 | 25 | ## Environment normalisation: 26 | /.bundle/ 27 | /vendor/bundle 28 | /lib/bundler/man/ 29 | 30 | # for a library or gem, you might want to ignore these files since the code is 31 | # intended to run in multiple environments; otherwise, check them in: 32 | # Gemfile.lock 33 | # .ruby-version 34 | # .ruby-gemset 35 | 36 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: 37 | .rvmrc 38 | 39 | 40 | ### JetBrains template 41 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 42 | 43 | *.iml 44 | 45 | ## Directory-based project format: 46 | .idea/ 47 | # if you remove the above rule, at least ignore the following: 48 | 49 | # User-specific stuff: 50 | # .idea/workspace.xml 51 | # .idea/tasks.xml 52 | # .idea/dictionaries 53 | 54 | # Sensitive or high-churn files: 55 | # .idea/dataSources.ids 56 | # .idea/dataSources.xml 57 | # .idea/sqlDataSources.xml 58 | # .idea/dynamic.xml 59 | # .idea/uiDesigner.xml 60 | 61 | # Gradle: 62 | # .idea/gradle.xml 63 | # .idea/libraries 64 | 65 | # Mongo Explorer plugin: 66 | # .idea/mongoSettings.xml 67 | 68 | ## File-based project format: 69 | *.ipr 70 | *.iws 71 | 72 | ## Plugin-specific files: 73 | 74 | # IntelliJ 75 | /out/ 76 | 77 | # mpeltonen/sbt-idea plugin 78 | .idea_modules/ 79 | 80 | # JIRA plugin 81 | atlassian-ide-plugin.xml 82 | 83 | # Crashlytics plugin (for Android Studio and IntelliJ) 84 | com_crashlytics_export_strings.xml 85 | crashlytics.properties 86 | crashlytics-build.properties 87 | 88 | 89 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Rails template 2 | ============== 3 | 4 | My Rails 4 application template 5 | 6 | ## Requirement 7 | * Ruby >=2.2.0 8 | * Rails >=4.2.0 9 | * gibo
(for creating gitignore file) 10 | ``` 11 | $ brew install gibo 12 | ``` 13 | 14 | ## Usage 15 | ``` 16 | rails new appname -BT -m https://raw.githubusercontent.com/kadoppe/rails-template/master/template.rb 17 | ``` 18 | 19 | ## Author 20 | 21 | [kadoppe](https://github.com/kadoppe) 22 | -------------------------------------------------------------------------------- /template.rb: -------------------------------------------------------------------------------- 1 | # .gitignore 2 | run 'gibo OSX Ruby Rails JetBrains > .gitignore' rescue nil 3 | gsub_file '.gitignore', /^config\/initializers\/secret_token.rb\n/, '' 4 | gsub_file '.gitignore', /^config\/secrets.yml\n/, '' 5 | 6 | # Gemfile 7 | gsub_file 'Gemfile', /gem 'turbolinks'\n/, '' 8 | gsub_file 'Gemfile', /gem 'jquery-rails'\n/, '' 9 | 10 | add_source 'https://rails-assets.org' 11 | 12 | gem_group :default do 13 | gem 'active_decorator' 14 | gem 'slim-rails' 15 | gem 'rails-assets-bootstrap-sass-official' 16 | gem 'rails-assets-fontawesome' 17 | end 18 | 19 | gem_group :development do 20 | gem 'better_errors' 21 | gem 'binding_of_caller' 22 | gem 'bullet' 23 | gem 'html2slim' 24 | gem 'meta_request' 25 | end 26 | 27 | gem_group :development, :test do 28 | gem 'awesome_print', require: 'ap' 29 | gem 'factory_girl_rails' 30 | gem 'guard' 31 | gem 'guard-rubocop' 32 | gem 'guard-rspec' 33 | gem 'hirb' 34 | gem 'hirb-unicode' 35 | gem 'pry-byebug' 36 | gem 'pry-coolline' 37 | gem 'pry-rails' 38 | gem 'quiet_assets' 39 | gem 'rspec-rails' 40 | gem 'spring-commands-rspec' 41 | gem 'turnip' 42 | end 43 | 44 | gem_group :test do 45 | gem 'capybara' 46 | gem 'database_rewinder' 47 | gem 'webmock' 48 | gem 'vcr' 49 | end 50 | 51 | gem_group :production do 52 | gem 'pg' 53 | gem 'rails_12factor' 54 | end 55 | 56 | # install gems 57 | run 'bundle install --path vendor/bundle --jobs=4' 58 | 59 | # convert erb file to slim 60 | run 'bundle exec erb2slim -d app/views' 61 | 62 | # install locales 63 | remove_file 'config/locales/en.yml' 64 | run 'wget https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/en.yml -P config/locales/' 65 | run 'wget https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/ja.yml -P config/locales/' 66 | 67 | # config/application.rb 68 | application do 69 | %q{ 70 | config.time_zone = 'Tokyo' 71 | 72 | I18n.enforce_available_locales = true 73 | config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s] 74 | config.i18n.default_locale = :en 75 | 76 | config.generators do |g| 77 | g.orm :active_record 78 | g.template_engine :slim 79 | g.test_framework :rspec, :fixture => true 80 | g.fixture_replacement :factory_girl, :dir => "spec/factories" 81 | g.view_specs false 82 | g.controller_specs true 83 | g.routing_specs false 84 | g.helper_specs false 85 | g.request_specs false 86 | g.assets false 87 | g.helper false 88 | end 89 | 90 | config.autoload_paths += %W(#{config.root}/lib) 91 | config.autoload_paths += Dir["#{config.root}/lib/**/"] 92 | } 93 | end 94 | 95 | # config/environments/development.rb 96 | insert_into_file 'config/environments/development.rb', <