Thin_Upstreams 0.1.3 → 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.
@@ -30,7 +30,7 @@ class Thin_Upstreams
30
30
 
31
31
  def port_to_array raw_port, raw_num
32
32
  port = Integer(raw_port)
33
- q = Integer(raw_num)
33
+ q = Integer(raw_num || 1)
34
34
  (0...q).to_a.map { |i| port + i }
35
35
  end
36
36
 
@@ -1,3 +1,3 @@
1
1
  class Thin_Upstreams
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -0,0 +1,12 @@
1
+ ---
2
+ chdir: /tmp/
3
+ environment: production
4
+ address: 0.0.0.0
5
+ port: 7020
6
+ timeout: 4
7
+ log: log/thin.log
8
+ pid: tmp/pids/thin.pid
9
+ max_conns: 1024
10
+ max_persistent_conns: 512
11
+ require: []
12
+ wait: 30
data/spec/main.rb CHANGED
@@ -21,6 +21,9 @@ def reset_dir
21
21
 
22
22
  Exit_0 "mkdir -p #{DIR}/Hello/config"
23
23
  Exit_0 "mkdir -p #{DIR}/Hello/custom"
24
+ Exit_0 "mkdir -p #{DIR}/No_Servers"
25
+
26
+ File.write "#{DIR}/No_Servers/thin.yml", File.read("spec/files/no_servers.yml")
24
27
 
25
28
  chdir {
26
29
  Exit_0 "cd Hi/config && bundle exec thin config -C thin.yml --port 3010 --servers 2"
data/spec/tests/create.rb CHANGED
@@ -67,5 +67,14 @@ describe "Thin_Upstreams" do
67
67
  }
68
68
  end
69
69
 
70
+ it "accepts thin.yml files without :servers as a key" do
71
+ chdir {
72
+ Thin_Upstreams "*/thin.yml"
73
+ %w{ 7020 }.each { |port|
74
+ File.read('upstreams.conf')[":7020"].should == ":7020"
75
+ }
76
+ }
77
+ end
78
+
70
79
  end # === Thin_Upstreams
71
80
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Thin_Upstreams
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-27 00:00:00.000000000 Z
12
+ date: 2012-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: Exit_0
@@ -125,6 +125,7 @@ files:
125
125
  - bin/Thin_Upstreams
126
126
  - lib/Thin_Upstreams.rb
127
127
  - lib/Thin_Upstreams/version.rb
128
+ - spec/files/no_servers.yml
128
129
  - spec/helper.rb
129
130
  - spec/main.rb
130
131
  - spec/tests/bin.rb