rspec_starter 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07651d1f45ae7e33bb3d5de51c198c87f6be0749803084eeae6ed4e2e2a2dfdb
4
- data.tar.gz: '00769c37402ced8b3ce2c3d362bd6277d348d77e9f50d20c639ec2921425a47d'
3
+ metadata.gz: b7a2a86b983cbb4231b3ee5e0df34039dc24d60ec93da40f0ac33c8ca45489bc
4
+ data.tar.gz: 74ad3cc39ccb76534796183a0a1000ed26bb8cadbb1f9fe58266cb55348753e4
5
5
  SHA512:
6
- metadata.gz: a06b48f11b0e5240dcc51761de9304e342d67e7d1d194823b1d3f64af98ad65499bcfafcefef8d2b1903f80e51ee9ad4bc39cd8fa12d2e29a90cdbd5b3c9ddc7
7
- data.tar.gz: 5dc317a2c50d27d56bae0a2e7d556d803fe2c913fae7ed9aad9b9645e2ba0363cc111e83d5ff900a65e2237db941c5562358e34edb2293774fe5c8802c19d14c
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.project_is_rails_app?
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
- "Removing #{'tmp'.highlight} folder"
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
- success "the tmp folder didn't exist" unless tmp_folder_exists?
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
- private
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
- File.exist?(File.join(Dir.pwd, "tmp"))
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
@@ -1,3 +1,3 @@
1
1
  module RspecStarter
2
- VERSION = "1.6.0".freeze
2
+ VERSION = "1.7.0".freeze
3
3
  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.6.0
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-09 00:00:00.000000000 Z
11
+ date: 2019-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler