cypress-rails 0.1.2 → 0.1.3

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: b33dbd1979a98b1861627988fa032b18348f43c6f38844437026db52b2aa3811
4
- data.tar.gz: 90f192c528beda78245b68791e58ee91f7d0d24a4821d0dcd9a54f471ca00540
3
+ metadata.gz: 2044306eee0e5e184bd9c1166e2906648a05015c03a28290634374683ff49ff4
4
+ data.tar.gz: 3e3cc908007c231913778a3627864a40520edd6ef7e0de6a735d2fbf0597b820
5
5
  SHA512:
6
- metadata.gz: 80b6ac651dd318df4f95d243b50116e1a28db6afdde2c78fbb4d9b21c7e83785c6777afb346d24cae3a5f69baa1149dabe72e8fa227e118487b10fadba88c414
7
- data.tar.gz: e3b3a56a658d0f74c89011a1aa193b0e449c9db6ace90daf9cfcfa93f31b473497e6af9f6e3f5ef0e2a25f7869e14b5189be9b16298edbdc7d8f5aa3cbe83e65
6
+ metadata.gz: 81bb4a5648105bf5660dd55f3c77fc7a2cbbd4a0fb82e1f6b6cbc563aa8baa57f2e29d8018418e6b3649decdb5e249e6f31f2164df5a79b3c35deed16d12bedb
7
+ data.tar.gz: 9c25c2109428646b925254e85f5c893db6ef9ca5993a7cb31568f176e42c4b01c45011875521845bf280b6c7822eed2b8e55a7798ba5d704257f21cbadeaa1e1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.1.3
4
+
5
+ * Improve behavior of SIGINT (Ctrl-C) so a traceback isn't printed and stdout
6
+ isn't flushed after the program exits
7
+
3
8
  ## 0.1.2
4
9
 
5
10
  * Drop the hard deps on capybara and selenium-webdrivers (instead inlining
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cypress-rails (0.1.2)
4
+ cypress-rails (0.1.3)
5
5
  puma (>= 3.8.0)
6
6
  railties (>= 5.2.0)
7
7
 
@@ -24,16 +24,36 @@ module CypressRails
24
24
  transactional_server: config.transactional_server
25
25
  )
26
26
  bin = @finds_bin.call(config.dir)
27
- at_exit do
28
- if config.transactional_server
29
- @manages_transactions.rollback_transaction
30
- end
31
- @initializer_hooks.run(:before_server_stop)
32
- end
27
+
28
+ set_exit_hooks!(config)
33
29
 
34
30
  system <<~EXEC
35
31
  CYPRESS_BASE_URL=http://#{server.host}:#{server.port} #{bin} #{command} --project "#{config.dir}" #{config.cypress_cli_opts}
36
32
  EXEC
37
33
  end
34
+
35
+ private
36
+
37
+ def set_exit_hooks!(config)
38
+ at_exit do
39
+ run_exit_hooks_if_necessary!(config)
40
+ end
41
+ Signal.trap("INT") do
42
+ puts "Exiting cypress-rails…"
43
+ exit
44
+ end
45
+ end
46
+
47
+ def run_exit_hooks_if_necessary!(config)
48
+ @at_exit_hooks_have_fired ||= false # avoid warning
49
+ return if @at_exit_hooks_have_fired
50
+
51
+ if config.transactional_server
52
+ @manages_transactions.rollback_transaction
53
+ end
54
+ @initializer_hooks.run(:before_server_stop)
55
+
56
+ @at_exit_hooks_have_fired = true
57
+ end
38
58
  end
39
59
  end
@@ -8,10 +8,7 @@ end
8
8
 
9
9
  desc "Open interactive Cypress app for developing tests"
10
10
  task :"cypress:open" do
11
- trap("SIGINT") do
12
- puts "Exiting cypress:open"
13
- exit
14
- end
11
+ trap("SIGINT") {} # avoid traceback
15
12
  system "#{CLI} open"
16
13
  end
17
14
 
@@ -1,3 +1,3 @@
1
1
  module CypressRails
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cypress-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-08 00:00:00.000000000 Z
11
+ date: 2020-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties