File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
lib/rails/generators/rails/plugin Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change
1
+ * Run ` git init ` when generating plugins.
2
+
3
+ Opt out with ` --skip-git ` .
4
+
5
+ * OKURA Masafumi*
6
+
1
7
* Add benchmark generator
2
8
3
9
Introduce benchmark generator to benchmark Rails applications.
Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ def gitignore
57
57
template "gitignore" , ".gitignore"
58
58
end
59
59
60
+ def version_control
61
+ if !options [ :skip_git ] && !options [ :pretend ]
62
+ run "git init" , capture : options [ :quiet ] , abort_on_failure : false
63
+ end
64
+ end
65
+
60
66
def lib
61
67
template "lib/%namespaced_name%.rb"
62
68
template "lib/tasks/%namespaced_name%_tasks.rake"
@@ -161,12 +167,6 @@ def gemfile_entry
161
167
append_file gemfile_in_app_path , entry
162
168
end
163
169
end
164
-
165
- def version_control
166
- if !options [ :skip_git ] && !options [ :pretend ]
167
- run "git init" , capture : options [ :quiet ] , abort_on_failure : false
168
- end
169
- end
170
170
end
171
171
172
172
module Generators
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ def test_correct_file_in_lib_folder_of_camelcase_plugin_name
64
64
end
65
65
66
66
def test_generating_without_options
67
- output = run_generator
67
+ run_generator
68
68
assert_file "README.md" , /Bukkits/
69
69
assert_no_file "config/routes.rb"
70
70
assert_no_file "app/assets/config/bukkits_manifest.js"
@@ -79,7 +79,11 @@ def test_generating_without_options
79
79
assert_file "test/bukkits_test.rb" , /assert_kind_of Module, Bukkits/
80
80
assert_file "bin/test"
81
81
assert_no_file "bin/rails"
82
- assert_match ( /run git init/ , output )
82
+ end
83
+
84
+ def test_initializes_git_repo
85
+ run_generator
86
+ assert_directory ".git"
83
87
end
84
88
85
89
def test_generating_in_full_mode_with_almost_of_all_skip_options
@@ -607,6 +611,7 @@ def test_no_details_from_git_when_skip_git
607
611
assert_match name , contents
608
612
assert_match email , contents
609
613
end
614
+ assert_no_directory ".git"
610
615
end
611
616
612
617
def test_skipping_useless_folders_generation_for_api_engines
You can’t perform that action at this time.
0 commit comments