Skip to content

Commit

Permalink
Merged in feature/prepare_git_ignore (pull request #19)
Browse files Browse the repository at this point in the history
KBP-135 #time 25m - Prepare ignored files, folders etc. for git via gitignore file

Approved-by: Fatih Avsan <[email protected]>
Approved-by: Eşref VİDUŞLU <[email protected]>
  • Loading branch information
Hamdi Bayhan committed Nov 13, 2017
2 parents f83a9d1 + 438a06b commit 5abb135
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,26 @@ def configure_bullet
configure_environment 'development', template_content('bullet/bullet_settings.rb.erb')
end

def setup_gitignore_files
remove_file '.gitignore', force: true
copy_file 'cybele_gitignore', '.gitignore'
end

def setup_gitignore_folders
%w(
app/assets/images
db/migrate
spec/support
spec/lib
spec/models
spec/views
spec/controllers
spec/helpers
).each do |dir|
empty_directory_with_keep_file dir
end
end

private

def configure_environment(rails_env, config)
Expand Down
5 changes: 5 additions & 0 deletions lib/cybele/generators/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ def configure_mail_setting
build :setup_letter_opener
end

def gitignore_files_and_folders
build :setup_gitignore_files
build :setup_gitignore_folders
end

def goodbye
say 'Congratulations! That\'s all...', :green
end
Expand Down
43 changes: 43 additions & 0 deletions templates/cybele_gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal

# Ignore log
/log/*.log

/tmp
!.keep
*.swp
.env
bin/stubs
/.env.*
/.env.local
public/system
vendor/bundler_gems

# Ignore ide and text editor
.idea
.idea/
.idea/**/*
/dump.rdb

# Ignore pow files
.powrc

# Ignore mac files
.DS_Store

# Ignore config files
config/settings.local.yml
config/settings/*.local.yml
config/environments/*.local.yml
.secret

0 comments on commit 5abb135

Please sign in to comment.