fontana_client_support 0.8.3 → 0.8.4

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
  SHA1:
3
- metadata.gz: 7af75a6d013efb9a724ee1d8441de8d32b16051f
4
- data.tar.gz: 91e4f38c29d0fcea7be9fb71a2c778b94d686428
3
+ metadata.gz: 23117e178e3c27bfe84c8424e154d9c3753932f7
4
+ data.tar.gz: ce6c6ff7e9b08ad1ccec5b87a90c4ab3a4187808
5
5
  SHA512:
6
- metadata.gz: abf62ca19207aef50433a567e3d011108bc39536ec53f9485892f195ddb751bbf7f378c818e616dcde0c8f2d3f1aca377f8c44c229834a741ce3b5988c822229
7
- data.tar.gz: c6cff3ad9313a31e5e4fbf395860f22a663ea6b56b4a6a6394831075e57e2ef455f7036dcfb350a4de2f70a079d0c9be48b0a3e71244c2881d24264f0fca3b4a
6
+ metadata.gz: bbe19aad2db515a4cb543c33e4ee81c85e217a66714669adcd6c8599a4c25ee372c30e7207c2e5814f61e0fa05219e614a1b3fdc0998f1023803bee29c7044fe
7
+ data.tar.gz: 11749ad9c57046156fbe99963f35f0ee3f4292b12cc577de2045f3040bc691873eacaab1289d2c2e69a02a8382cee6eed1c9afe9ed90bd6ad033d4de48768bdf
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ idx = ARGV.index("--")
4
+ unless idx
5
+ raise "%s [port_env1] [port_env2]... -- <command>" % File.basename(__FILE__)
6
+ end
7
+
8
+ targets = ARGV[0, idx]
9
+ command = ARGV[(idx + 1)..-1].join(" ")
10
+
11
+ port_range = 10000..60000
12
+ len = (port_range.max - port_range.min)
13
+
14
+ targets.each do |target|
15
+ ENV[target] = (rand(len) + port_range.min).to_s
16
+ end
17
+
18
+ require File.expand_path("../../lib/fontana/command_utils", __FILE__)
19
+
20
+ Fontana::CommandUtils.system!(command)
data/lib/fontana.rb CHANGED
@@ -62,5 +62,25 @@ module Fontana
62
62
  end
63
63
  private :load_fontana_version_file
64
64
 
65
+ def development_http_server_port
66
+ (ENV["FONTANA_DEVELOPMENT_HTTP_SERVER_PORT" ] || 3000).to_i
67
+ end
68
+
69
+ def development_https_server_port
70
+ (ENV["FONTANA_DEVELOPMENT_HTTPS_SERVER_PORT"] || 3001).to_i
71
+ end
72
+
73
+ def test_http_server_port
74
+ (ENV["FONTANA_TEST_HTTP_SERVER_PORT" ] || 4000).to_i
75
+ end
76
+
77
+ def test_https_server_port
78
+ (ENV["FONTANA_TEST_HTTPS_SERVER_PORT"] || 4001).to_i
79
+ end
80
+
81
+ def test_server_url(hostname = "localhost")
82
+ "http://#{hostname}:#{test_http_server_port}"
83
+ end
84
+
65
85
  end
66
86
  end
@@ -13,8 +13,14 @@ def build_env_str(env)
13
13
  end
14
14
 
15
15
  {
16
- development: {http_port: 3000, https_port: 3001 },
17
- test: {http_port: 4000, https_port: 4001 },
16
+ development: {
17
+ http_port: Fontana.development_http_server_port,
18
+ https_port: Fontana.development_https_server_port,
19
+ },
20
+ test: {
21
+ http_port: Fontana.test_http_server_port,
22
+ https_port: Fontana.test_https_server_port,
23
+ },
18
24
  }.each do |app_mode, config|
19
25
  namespace app_mode.to_sym do
20
26
 
@@ -1,3 +1,3 @@
1
1
  module FontanaClientSupport
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontana_client_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - akima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-30 00:00:00.000000000 Z
11
+ date: 2013-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,6 +84,7 @@ description: gem to support development and testing with GSS/fontana
84
84
  email:
85
85
  - t-akima@groovenauts.jp
86
86
  executables:
87
+ - assign_port_to_env
87
88
  - fontana_config_server
88
89
  - fontana_fixture
89
90
  extensions: []
@@ -95,6 +96,7 @@ files:
95
96
  - LICENSE.txt
96
97
  - README.md
97
98
  - Rakefile
99
+ - bin/assign_port_to_env
98
100
  - bin/fontana_config_server
99
101
  - bin/fontana_fixture
100
102
  - fontana_client_support.gemspec