rubyfox-server 2.9.1.0 → 2.9.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/Gemfile +2 -0
- data/Rakefile +9 -0
- data/lib/rubyfox/server/cli.rb +1 -1
- data/lib/rubyfox/server/data/lib/sfs2x.jar +0 -0
- data/lib/rubyfox/server/data/www/sfs2x-ws.war +0 -0
- data/lib/rubyfox/server/environment.rb +5 -6
- data/lib/rubyfox/server/version.rb +1 -1
- data/rubyfox-server.gemspec +2 -0
- data/spec/rubyfox/server/environment_spec.rb +71 -0
- data/spec/spec_helper.rb +7 -0
- metadata +22 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3bb678fae2e675f459165d628cc3bd9e7fb9cb7
|
4
|
+
data.tar.gz: 130373c54d93698b37a6d762e043e41b3e10bd6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccb44e8b886654c2feb311dd74057706e576ded30e0aabb101b0368aa38abc4345a46d99380986b3ea6881b51a527f359d6fae004f5e373f50a7be63f7646d57
|
7
|
+
data.tar.gz: e990b19c2e0bd6b00c38872db9d3bcdb24c2643e79347c2a54cce0665aede5c6d5fc6fb27467084c032e498d032690a7ebddc42086c11fec48dc6ddaebe2257d
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/rubyfox/server/cli.rb
CHANGED
Binary file
|
Binary file
|
@@ -1,11 +1,10 @@
|
|
1
1
|
module Rubyfox
|
2
2
|
module Server
|
3
3
|
class Environment
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
@
|
8
|
-
@local = {}
|
4
|
+
def initialize(env, asker)
|
5
|
+
@env = env
|
6
|
+
@asker = asker
|
7
|
+
@local = {}
|
9
8
|
end
|
10
9
|
|
11
10
|
def [](name)
|
@@ -14,7 +13,7 @@ module Rubyfox
|
|
14
13
|
value || begin
|
15
14
|
msg = "Specify env #{name}:"
|
16
15
|
loop do
|
17
|
-
answer = ask(msg)
|
16
|
+
answer = @asker.ask(msg)
|
18
17
|
unless answer.empty?
|
19
18
|
self[name] = answer
|
20
19
|
break answer
|
data/rubyfox-server.gemspec
CHANGED
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'rubyfox/server/environment'
|
4
|
+
|
5
|
+
class TestAsker
|
6
|
+
attr_reader :answers, :asked
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@asked = []
|
10
|
+
@answers = []
|
11
|
+
end
|
12
|
+
|
13
|
+
def ask(message)
|
14
|
+
@asked << message
|
15
|
+
@answers.shift or fail "no answers left"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe Rubyfox::Server::Environment do
|
20
|
+
let(:env) { Hash.new }
|
21
|
+
let(:asker) { TestAsker.new }
|
22
|
+
let(:environment) { Rubyfox::Server::Environment.new(env, asker) }
|
23
|
+
|
24
|
+
context "[]" do
|
25
|
+
it "returns predefined value" do
|
26
|
+
env["foo"] = 23
|
27
|
+
assert_equal 23, environment["foo"]
|
28
|
+
end
|
29
|
+
|
30
|
+
it "asks for missing value" do
|
31
|
+
asker.answers << "23"
|
32
|
+
|
33
|
+
assert_equal "23", environment["foo"]
|
34
|
+
assert_equal "23", environment["foo"]
|
35
|
+
|
36
|
+
assert_asked "foo", 1
|
37
|
+
end
|
38
|
+
|
39
|
+
it "keep asking for empty values" do
|
40
|
+
asker.answers << ""
|
41
|
+
asker.answers << "23"
|
42
|
+
|
43
|
+
assert_equal "23", environment["foo"]
|
44
|
+
assert_asked "foo", 2
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context "[]=" do
|
49
|
+
it "sets env" do
|
50
|
+
environment["foo"] = 23
|
51
|
+
|
52
|
+
assert_equal 23, environment["foo"]
|
53
|
+
end
|
54
|
+
|
55
|
+
it "stringifies when setting env" do
|
56
|
+
environment[:foo] = 23
|
57
|
+
|
58
|
+
assert_equal 23, environment["foo"]
|
59
|
+
assert_equal 23, environment[:foo]
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def assert_asked(key, amount=1)
|
66
|
+
expected = ["Specify env #{key}:"] * amount
|
67
|
+
|
68
|
+
assert_equal expected, asker.asked
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyfox-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Suschlik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 5.4.2
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 5.4.2
|
41
55
|
description: SmartFox Server bundled as a gem
|
42
56
|
email:
|
43
57
|
- ps@neopoly.de
|
@@ -47,6 +61,7 @@ extensions: []
|
|
47
61
|
extra_rdoc_files: []
|
48
62
|
files:
|
49
63
|
- ".gitignore"
|
64
|
+
- ".travis.yml"
|
50
65
|
- Gemfile
|
51
66
|
- LICENSE.txt
|
52
67
|
- README.rdoc
|
@@ -1102,6 +1117,8 @@ files:
|
|
1102
1117
|
- lib/rubyfox/server/environment.rb
|
1103
1118
|
- lib/rubyfox/server/version.rb
|
1104
1119
|
- rubyfox-server.gemspec
|
1120
|
+
- spec/rubyfox/server/environment_spec.rb
|
1121
|
+
- spec/spec_helper.rb
|
1105
1122
|
homepage: https://github.com/neopoly/rubyfox-server
|
1106
1123
|
licenses:
|
1107
1124
|
- MIT
|
@@ -1126,4 +1143,6 @@ rubygems_version: 2.2.2
|
|
1126
1143
|
signing_key:
|
1127
1144
|
specification_version: 4
|
1128
1145
|
summary: ''
|
1129
|
-
test_files:
|
1146
|
+
test_files:
|
1147
|
+
- spec/rubyfox/server/environment_spec.rb
|
1148
|
+
- spec/spec_helper.rb
|