rspec_starter 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/exe/rspec_starter +1 -1
- data/lib/rspec_starter/tasks/remove_tmp_folder.rb +45 -4
- data/lib/rspec_starter/version.rb +1 -1
- data/lib/templates/rails_engine_start_rspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7a2a86b983cbb4231b3ee5e0df34039dc24d60ec93da40f0ac33c8ca45489bc
|
4
|
+
data.tar.gz: 74ad3cc39ccb76534796183a0a1000ed26bb8cadbb1f9fe58266cb55348753e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e514511743c4c243ce522a0ee318855de398a3c495fcfe503761cead264f63de1bdae3ccf6a70f353d9b64a6c6bb31d9fc9249e7b75c540376574cc0af460ca1
|
7
|
+
data.tar.gz: 34b4fbf5a1e2e71d0b45606fcd8b6e4bc8343725050aebd7cc7ed07115c1f23e5cfafc61e136e42e2c71852c7a6f9e1519911f3bb6816745b33896fd946adf19
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
Issues marked as **(Internal)** mark internal development work. Issues are tracked at https://github.com/roberts1000/rspec_starter/issues.
|
4
4
|
|
5
|
+
## 1.7.0 (Dec 12, 2019)
|
6
|
+
|
7
|
+
1. [#74](../../issues/74) Make `rspec_starter --init` detect Rails engines correctly.
|
8
|
+
1. [#75](../../issues/75) Let `remove_tmp_folder` task remove the tmp folder from `dummy` apps.
|
9
|
+
|
5
10
|
## 1.6.0 (Dec 09, 2019)
|
6
11
|
|
7
12
|
1. [#56](../../issues/56) Move old starter code to a `legacy` folder so it can still be used. **(Internal)**
|
data/exe/rspec_starter
CHANGED
@@ -47,7 +47,7 @@ command = Cri::Command.define do
|
|
47
47
|
template_path =
|
48
48
|
if helpers.project_is_rails_app?
|
49
49
|
File.expand_path('../lib/templates/rails_start_rspec', __dir__)
|
50
|
-
elsif helpers.
|
50
|
+
elsif helpers.project_is_rails_engine?
|
51
51
|
File.expand_path('../lib/templates/rails_engine_start_rspec', __dir__)
|
52
52
|
else
|
53
53
|
File.expand_path('../lib/templates/start_rspec', __dir__)
|
@@ -4,6 +4,15 @@ class RemoveTmpFolder < RspecStarterTask
|
|
4
4
|
"Remove the #{'tmp'.colorize(:light_blue)} folder from the project."
|
5
5
|
end
|
6
6
|
|
7
|
+
def self.register_options
|
8
|
+
register_option name: "remove_dummy_tmp",
|
9
|
+
default: false,
|
10
|
+
description: "true/false to remove the tmp folder for the dummy app too."
|
11
|
+
register_option name: "dummy_path",
|
12
|
+
default: "spec/dummy",
|
13
|
+
description: "Relative path to the dummy folder."
|
14
|
+
end
|
15
|
+
|
7
16
|
# Let subsequent steps run if this task runs into a problem deleting the tmp folder. This value can be overridden in
|
8
17
|
# the applications bin/start_rspec file if the user adds 'stop_on_problem: true' to the task line.
|
9
18
|
def self.default_stop_on_problem
|
@@ -11,18 +20,50 @@ class RemoveTmpFolder < RspecStarterTask
|
|
11
20
|
end
|
12
21
|
|
13
22
|
def starting_message
|
14
|
-
|
23
|
+
if options.remove_dummy
|
24
|
+
"Removing #{'tmp/'.highlight} and #{relative_dummy_tmp_folder_path.highlight} folders"
|
25
|
+
else
|
26
|
+
"Removing #{'tmp/'.highlight} folder"
|
27
|
+
end
|
15
28
|
end
|
16
29
|
|
17
30
|
def execute
|
18
|
-
|
31
|
+
remove_tmp_folder
|
32
|
+
remove_dummy_tmp_folder
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def remove_tmp_folder
|
38
|
+
return unless tmp_folder_exists?
|
39
|
+
|
19
40
|
system "rm -rf tmp/"
|
20
41
|
problem "the tmp folder could not be removed." if tmp_folder_exists?
|
21
42
|
end
|
22
43
|
|
23
|
-
|
44
|
+
def remove_dummy_tmp_folder
|
45
|
+
return unless options.remove_dummy
|
46
|
+
return unless dummy_tmp_folder_exists?
|
47
|
+
|
48
|
+
system "rm -rf #{absolute_dummy_tmp_folder_path}"
|
49
|
+
problem "the #{relative_dummy_tmp_folder_path} folder could not be removed." if dummy_tmp_folder_exists?
|
50
|
+
end
|
24
51
|
|
25
52
|
def tmp_folder_exists?
|
26
|
-
|
53
|
+
Dir.exist?(File.join(Dir.pwd, "tmp"))
|
54
|
+
end
|
55
|
+
|
56
|
+
def relative_dummy_tmp_folder_path
|
57
|
+
File.join(options.dummy_path, "tmp/")
|
58
|
+
end
|
59
|
+
|
60
|
+
def absolute_dummy_tmp_folder_path
|
61
|
+
File.join(Dir.pwd, options.dummy_path, "tmp/")
|
62
|
+
end
|
63
|
+
|
64
|
+
def dummy_tmp_folder_exists?
|
65
|
+
return false if options.dummy_path.nil?
|
66
|
+
|
67
|
+
Dir.exist?(absolute_dummy_tmp_folder_path)
|
27
68
|
end
|
28
69
|
end
|
@@ -32,7 +32,7 @@ APP_ROOT = Pathname.new File.expand_path('../', __dir__)
|
|
32
32
|
# Tasks are run from the top down.
|
33
33
|
RspecStarter.start do
|
34
34
|
task :verify_display_server
|
35
|
-
task :remove_tmp_folder
|
35
|
+
task :remove_tmp_folder, remove_dummy_tmp: true
|
36
36
|
task :rebuild_rails_app_database
|
37
37
|
task :start_rspec
|
38
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_starter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|