rails_caddy_dev 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6731cf32e6419b5637b8a1764a06e045f6487af31ced9245e61b7c597d560774
4
- data.tar.gz: '0898b5cc6acc282a396d581934c9f53a308d9387c1ac6027d3be9517b1ea65ad'
3
+ metadata.gz: 7582dcb4c27a58a8bfc19966a8faeaf55ff65af7bb2833a49e2982a4c8107ebb
4
+ data.tar.gz: 1611241404ceb557cae40f39b5a704a0b165b794dcd3f34b6939174502160039
5
5
  SHA512:
6
- metadata.gz: e1e435b65fd2211860ae00652ea4c5557ae992c490810bcf3975864e965eef2cf98af9d22e8155e74220d8dc6fcfccfc4009eaa24b642bbbc2dca5eb36fc4f4a
7
- data.tar.gz: ffffa2e702d9d2b30bb394b95965dc44e80ab134a9682ddefb6aeab39d781ee6168c7077db94c9deab802207aa967e96c546ebccb0a6e2455a70405650b074ec
6
+ metadata.gz: 315440bc4de9560a21572b305d9b1bfcae9df7480e07d5574d310a97aee2b30e7ca6be318ecc942aaa1dc7ee072bf8692a1efae4e2749a5e601a6069884123d8
7
+ data.tar.gz: 3e241c92e93ec16d7e5d5896a0087dfafe81015d61e3561d5a1d3c68fac03ce2fbcaf399e2870257719ee0918a34e4ca01116aaaae6120deba3fd71ef930157f
data/README.md CHANGED
@@ -59,10 +59,10 @@ This will configure Caddy to proxy `myapp.localhost` to your Rails server, acces
59
59
 
60
60
  ### Dynamic Port Allocation
61
61
 
62
- The gem also provides a CLI command to find an available TCP port, which can be useful if you want to run multiple Rails servers without port conflicts:
62
+ The gem includes a standalone executable to find an available TCP port, which can be useful if you want to run multiple Rails servers without port conflicts:
63
63
 
64
64
  ```bash
65
- export PORT=$(bundle exec rails rails_caddy_dev:available_port)
65
+ export PORT=$(bundle exec rails_caddy_dev port)
66
66
  ```
67
67
 
68
68
  RailsCaddyDev will then configure Caddy to proxy to the dynamically allocated port, and start your Rails server on that port.
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ if ARGV[0] == 'port'
4
+ require 'socket';
5
+ puts Addrinfo.tcp('', 0).bind { |s| s.local_address.ip_port }
6
+ exit 0
7
+ else
8
+ puts "Usage: `rails_caddy_dev port` to get an available port number."
9
+ exit 1
10
+ end
@@ -5,9 +5,5 @@ require 'rails'
5
5
  module RailsCaddyDev
6
6
  class Railtie < ::Rails::Engine
7
7
  isolate_namespace RailsCaddyDev
8
-
9
- rake_tasks do
10
- load 'rails_caddy_dev/railties/available_port.rake'
11
- end
12
8
  end
13
9
  end
@@ -48,9 +48,7 @@ PROJECT_NAME = ENV.fetch('PROJECT_NAME')&.downcase
48
48
 
49
49
  domains = [
50
50
  "#{PROJECT_NAME}.localhost",
51
- "admin.#{PROJECT_NAME}.localhost",
52
- "clients.#{PROJECT_NAME}.localhost",
53
- "therapists.#{PROJECT_NAME}.localhost"
51
+ "*.#{PROJECT_NAME}.localhost"
54
52
  ]
55
53
 
56
54
  # Check if config already exists via Caddy API
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsCaddyDev
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_caddy_dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
@@ -31,15 +31,16 @@ dependencies:
31
31
  version: '9.0'
32
32
  email:
33
33
  - joel@developwithstyle.com
34
- executables: []
34
+ executables:
35
+ - rails_caddy_dev
35
36
  extensions: []
36
37
  extra_rdoc_files: []
37
38
  files:
38
39
  - README.md
40
+ - bin/rails_caddy_dev
39
41
  - lib/rails_caddy_dev.rb
40
42
  - lib/rails_caddy_dev/commands.rb
41
43
  - lib/rails_caddy_dev/railtie.rb
42
- - lib/rails_caddy_dev/railties/available_port.rake
43
44
  - lib/rails_caddy_dev/update_config.rb
44
45
  - lib/rails_caddy_dev/version.rb
45
46
  homepage: https://github.com/joelmoss/rails_caddy_dev
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- namespace :rails_caddy_dev do
4
- desc 'Find and return an available TCP port on localhost'
5
- task available_port: :environment do
6
- require 'socket'
7
- puts(Addrinfo.tcp('', 0).bind { |s| s.local_address.ip_port })
8
- end
9
- end