vite_ruby 3.3.3 → 3.3.4

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: b261ed4c2d3d2653bc218492a4507b17e45d34a4988fe974b6f1f6b5cb1edce3
4
- data.tar.gz: ed8074ec0a226b8814b22b8dbc494c2a927acc0c08d96219bcee97e044b7de0d
3
+ metadata.gz: 579d77a9b6f100195112e6ee0fc66d445f35aca1d079c24c9548ea6b708af472
4
+ data.tar.gz: 13b18e4418675330c2d974b41a56b4dac97a4b4f3f10cffb1216d9370b386a52
5
5
  SHA512:
6
- metadata.gz: d49d7a773da0ad3f5766b045d333ac04e84f3fc61bfe94af473c45f1aeda1a2070dc6d8319fc4e051ed18b598286b35ff295e80d6c26d09c7485a2d6df4c41f6
7
- data.tar.gz: d1bce21f1be30d5beb653d73ff999475939affcd93db82734560979ca1a2a5413498ef9ec948ae036273bd1946ce9c0113e4607a38cc2e78f6d2f3f0e50309b9
6
+ metadata.gz: cf5e33d054b13211aeccbcccd96c2c03e8bae08c56c5ad52ffbac39a045b423a393b5e80fec15a7ad56929d4f8db09230b7d71260bd7fd0dd05478b0db661b54
7
+ data.tar.gz: 334056f48cbf9799e3522aaf575e657b6f7c6b7d825adf59ed602a45d1654d5d97a362b80aec578a836b4bd6ad084b740c4822ba1d99dab1c6ef2ce8a1343f2d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [3.3.4](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.3.3...vite_ruby@3.3.4) (2023-06-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * check only once per second when dev server is not running ([#377](https://github.com/ElMassimo/vite_ruby/issues/377)) ([fb33f0a](https://github.com/ElMassimo/vite_ruby/commit/fb33f0a28077f9912deed257b7be3a7e050c2d94))
7
+
8
+
9
+
1
10
  ## [3.3.3](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.3.2...vite_ruby@3.3.3) (2023-06-19)
2
11
 
3
12
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '3.3.3'
4
+ VERSION = '3.3.4'
5
5
 
6
6
  # Internal: Versions used by default when running `vite install`.
7
7
  DEFAULT_VITE_VERSION = '^4.3.0'
data/lib/vite_ruby.rb CHANGED
@@ -85,13 +85,16 @@ class ViteRuby
85
85
  # NOTE: Checks only once every second since every lookup calls this method.
86
86
  def dev_server_running?
87
87
  return false unless run_proxy?
88
- return true if @running_at && Time.now - @running_at < 1
89
-
90
- Socket.tcp(config.host, config.port, connect_timeout: config.dev_server_connect_timeout).close
91
- @running_at = Time.now
92
- true
93
- rescue StandardError
94
- @running_at = false
88
+ return @running if defined?(@running) && Time.now - @running_checked_at < 1
89
+
90
+ begin
91
+ Socket.tcp(config.host, config.port, connect_timeout: config.dev_server_connect_timeout).close
92
+ @running = true
93
+ rescue StandardError
94
+ @running = false
95
+ ensure
96
+ @running_checked_at = Time.now
97
+ end
95
98
  end
96
99
 
97
100
  # Public: Additional environment variables to pass to Vite.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vite_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.3
4
+ version: 3.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-19 00:00:00.000000000 Z
11
+ date: 2023-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -208,8 +208,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
208
208
  licenses:
209
209
  - MIT
210
210
  metadata:
211
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.3.3/vite_ruby
212
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.3.3/vite_ruby/CHANGELOG.md
211
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.3.4/vite_ruby
212
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.3.4/vite_ruby/CHANGELOG.md
213
213
  post_install_message: "Thanks for installing Vite Ruby!\n\nIf you upgraded the gem
214
214
  manually, please run:\n\tbundle exec vite upgrade"
215
215
  rdoc_options: []