Skip to content

Commit

Permalink
#81 add .editorconfig file
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur Ozgur OZKAN committed Sep 5, 2013
1 parent e7ebf06 commit c4da36f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
cybele (0.7.0)
cybele (0.9.0)
bundler (~> 1.3)
rails (~> 4.0.0)

Expand Down Expand Up @@ -33,17 +33,17 @@ GEM
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.0)
atomic (1.1.10)
atomic (1.1.13)
builder (3.1.4)
erubis (2.7.0)
hike (1.2.3)
i18n (0.6.4)
i18n (0.6.5)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.23)
mime-types (1.25)
minitest (4.7.5)
multi_json (1.7.7)
multi_json (1.7.9)
polyglot (0.3.3)
rack (1.5.2)
rack-test (0.6.2)
Expand Down Expand Up @@ -75,7 +75,7 @@ GEM
thread_safe (0.1.2)
atomic
tilt (1.4.1)
treetop (1.4.14)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.37)
Expand Down
4 changes: 4 additions & 0 deletions lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def replace_gemfile
copy_file 'cybele_Gemfile', 'Gemfile'
end

def add_editorconfig
copy_file 'editorconfig', '.editorconfig'
end

def replace_application_rb_file
remove_file 'config/application.rb'
copy_file 'config/application.rb', 'config/application.rb'
Expand Down
6 changes: 6 additions & 0 deletions lib/cybele/generators/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def finish_template

def customization
invoke :customize_gemfile
invoke :setup_editorconfig
invoke :setup_database
invoke :remove_files_we_dont_need
invoke :replace_files
Expand All @@ -40,6 +41,11 @@ def customize_gemfile
bundle_command 'install --binstubs=bin/stubs'
end

def setup_editorconfig
say 'Add .editorconfig file'
build :add_editorconfig
end

def remove_files_we_dont_need
say 'Remove files we don\'t need'
build :remove_readme_rdoc
Expand Down
31 changes: 31 additions & 0 deletions templates/editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://EditorConfig.org

root = true

; Use 2 spaces for indentation in all Ruby files

[*.rb]
indent_style = space
indent_size = 2

[Rakefile]
indent_style = space
indent_size = 2

[Gemfile*]
indent_style = space
indent_size = 2

[config.ru]
indent_style = space
indent_size = 2

# Tab indentation (no size specified)
[*.js]
indent_style = space

# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2

1 comment on commit c4da36f

@tayfunoziserikan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.