focuslight 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/focuslight.gemspec +2 -2
- data/lib/focuslight/rrd.rb +3 -3
- data/lib/focuslight/version.rb +1 -1
- data/spec/cli_spec.rb +4 -4
- data/spec/validator_predefined_rules_spec.rb +61 -61
- data/spec/validator_result_spec.rb +3 -3
- data/spec/validator_rule_spec.rb +8 -8
- data/spec/validator_spec.rb +8 -8
- data/view/view.erb +2 -0
- metadata +48 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51b11a9f7f6bda320667d5ae7b21209d5191653d
|
4
|
+
data.tar.gz: c03705eec5c79ba6a0a958c60081dc8d8140cf9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d121500a5835a361d07d43dd8a43a5547fb3fa3b00df0a538ba292a18cb0fc563a5029d2061c2834a5beedccd4bbbfc8803b1e0d9f3a31c205d77696c9e35cb3
|
7
|
+
data.tar.gz: b580aee081ec57efd5dd17b5f7e74e43db9f59c55f41fb46c2969dde3ff5591e44afda6585bc7c261a6a45cad02cbaa2940367dc4b47709cd57d8093fe3b08a2
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/focuslight.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'focuslight/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "focuslight"
|
8
8
|
spec.version = Focuslight::VERSION
|
9
|
-
spec.authors = ["TAGOMORI Satoshi", "Naotoshi Seo", "Shota Fukumori (sora_h)"]
|
10
|
-
spec.email = ["tagomoris@gmail.com", "sonots@gmail.com", "her@sorah.jp"]
|
9
|
+
spec.authors = ["TAGOMORI Satoshi", "Naotoshi Seo", "Shota Fukumori (sora_h)", "Koichiro Ohba"]
|
10
|
+
spec.email = ["tagomoris@gmail.com", "sonots@gmail.com", "her@sorah.jp", "koichiro@meadowy.org"]
|
11
11
|
spec.description = %q{Lightning Fast Graphing/Visualization, built on RRDTool}
|
12
12
|
spec.summary = %q{Lightning Fast Graphing/Visualization, built on RRDTool}
|
13
13
|
spec.homepage = "https://github.com/tagomoris/focuslight"
|
data/lib/focuslight/rrd.rb
CHANGED
@@ -330,7 +330,7 @@ class Focuslight::RRD
|
|
330
330
|
|
331
331
|
rrdoptions.push(
|
332
332
|
'DEF:%s%dt=%s:%s:%s' % [gdata, i, file, gdata, cf],
|
333
|
-
'CDEF:%s%d=%s%dt,%s,%s,LIMIT,%d,%s' % [gdata, i, gdata, i, llimit, ulimit, data.
|
333
|
+
'CDEF:%s%d=%s%dt,%s,%s,LIMIT,%d,%s' % [gdata, i, gdata, i, llimit, ulimit, data.adjustval, data.adjust],
|
334
334
|
'XPORT:%s%d:%s' % [gdata, i, _escape(data.graph)]
|
335
335
|
)
|
336
336
|
defs << ('%s%d' % [gdata, i])
|
@@ -361,10 +361,10 @@ class Focuslight::RRD
|
|
361
361
|
start_timestamp = ret.first.first
|
362
362
|
end_timestamp = ret.last.first
|
363
363
|
step = ret[1].first - ret[0].first
|
364
|
-
|
365
364
|
rows = []
|
366
365
|
ret.each do |values|
|
367
|
-
|
366
|
+
# GrowthForecast compatibility NaN to nil
|
367
|
+
rows << values[1..-1].map {|v| v.nan? ? nil : v}
|
368
368
|
end
|
369
369
|
|
370
370
|
{
|
data/lib/focuslight/version.rb
CHANGED
data/spec/cli_spec.rb
CHANGED
@@ -7,11 +7,11 @@ describe Focuslight::CLI do
|
|
7
7
|
context "#new" do
|
8
8
|
before { cli.invoke(:new) }
|
9
9
|
it {
|
10
|
-
expect(Dir.exists?(Focuslight::CLI::BASE_DIR)).to
|
11
|
-
expect(Dir.exists?(Focuslight::CLI::LOG_DIR)).to
|
10
|
+
expect(Dir.exists?(Focuslight::CLI::BASE_DIR)).to be_truthy
|
11
|
+
expect(Dir.exists?(Focuslight::CLI::LOG_DIR)).to be_truthy
|
12
12
|
expect(File.read(Focuslight::CLI::ENV_FILE)).to eql(Focuslight::CLI::DEFAULT_DOTENV)
|
13
13
|
expect(File.read(Focuslight::CLI::PROCFILE)).to eql(Focuslight::CLI::DEFAULT_PROCFILE)
|
14
|
-
expect(File.exists?(Focuslight::CLI::CONFIGRU_FILE)).to
|
14
|
+
expect(File.exists?(Focuslight::CLI::CONFIGRU_FILE)).to be_truthy
|
15
15
|
}
|
16
16
|
after { FileUtils.remove_dir(Focuslight::CLI::BASE_DIR) }
|
17
17
|
end
|
@@ -23,7 +23,7 @@ describe Focuslight::CLI do
|
|
23
23
|
cli.invoke(:init)
|
24
24
|
}
|
25
25
|
}
|
26
|
-
it { expect(Dir.exists?(Focuslight::CLI::DATA_DIR)).to
|
26
|
+
it { expect(Dir.exists?(Focuslight::CLI::DATA_DIR)).to be_truthy }
|
27
27
|
after { FileUtils.remove_dir(Focuslight::CLI::BASE_DIR) }
|
28
28
|
end
|
29
29
|
end
|
@@ -6,10 +6,10 @@ describe Focuslight::Validator do
|
|
6
6
|
describe '.rule' do
|
7
7
|
it 'returns not_blank predefined rule' do
|
8
8
|
r = Focuslight::Validator.rule(:not_blank)
|
9
|
-
expect(r.check(nil)).to
|
10
|
-
expect(r.check("")).to
|
11
|
-
expect(r.check(" ")).to
|
12
|
-
expect(r.check("a")).to
|
9
|
+
expect(r.check(nil)).to be_falsey
|
10
|
+
expect(r.check("")).to be_falsey
|
11
|
+
expect(r.check(" ")).to be_falsey
|
12
|
+
expect(r.check("a")).to be_truthy
|
13
13
|
|
14
14
|
expect(r.format("a")).to eql("a")
|
15
15
|
expect(r.format(" a ")).to eql("a")
|
@@ -19,30 +19,30 @@ describe Focuslight::Validator do
|
|
19
19
|
|
20
20
|
it 'returns choice predefined rule' do
|
21
21
|
r1 = Focuslight::Validator.rule(:choice, "x", "y", "z")
|
22
|
-
expect(r1.check("a")).to
|
23
|
-
expect(r1.check("x")).to
|
24
|
-
expect(r1.check("z")).to
|
22
|
+
expect(r1.check("a")).to be_falsey
|
23
|
+
expect(r1.check("x")).to be_truthy
|
24
|
+
expect(r1.check("z")).to be_truthy
|
25
25
|
|
26
26
|
expect(r1.format("x")).to eql("x")
|
27
27
|
|
28
28
|
expect(r1.message).to eql("invalid value")
|
29
29
|
|
30
30
|
r2 = Focuslight::Validator.rule(:choice, ["x", "y", "z"])
|
31
|
-
expect(r2.check("a")).to
|
32
|
-
expect(r2.check("x")).to
|
33
|
-
expect(r2.check("z")).to
|
31
|
+
expect(r2.check("a")).to be_falsey
|
32
|
+
expect(r2.check("x")).to be_truthy
|
33
|
+
expect(r2.check("z")).to be_truthy
|
34
34
|
|
35
35
|
expect(r2.format("x")).to eql("x")
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'returns int predefined rule' do
|
39
39
|
r = Focuslight::Validator.rule(:int)
|
40
|
-
expect(r.check("0")).to
|
41
|
-
expect(r.check("100")).to
|
42
|
-
expect(r.check("-21")).to
|
43
|
-
expect(r.check("1.0")).to
|
44
|
-
expect(r.check("-3e10")).to
|
45
|
-
expect(r.check("xyz")).to
|
40
|
+
expect(r.check("0")).to be_truthy
|
41
|
+
expect(r.check("100")).to be_truthy
|
42
|
+
expect(r.check("-21")).to be_truthy
|
43
|
+
expect(r.check("1.0")).to be_falsey
|
44
|
+
expect(r.check("-3e10")).to be_falsey
|
45
|
+
expect(r.check("xyz")).to be_falsey
|
46
46
|
|
47
47
|
expect(r.format("0")).to eql(0)
|
48
48
|
expect(r.format("100")).to eql(100)
|
@@ -53,12 +53,12 @@ describe Focuslight::Validator do
|
|
53
53
|
|
54
54
|
it 'returns uint predefined rule' do
|
55
55
|
r = Focuslight::Validator.rule(:uint)
|
56
|
-
expect(r.check("0")).to
|
57
|
-
expect(r.check("100")).to
|
58
|
-
expect(r.check("-21")).to
|
59
|
-
expect(r.check("1.0")).to
|
60
|
-
expect(r.check("-3e10")).to
|
61
|
-
expect(r.check("xyz")).to
|
56
|
+
expect(r.check("0")).to be_truthy
|
57
|
+
expect(r.check("100")).to be_truthy
|
58
|
+
expect(r.check("-21")).to be_falsey
|
59
|
+
expect(r.check("1.0")).to be_falsey
|
60
|
+
expect(r.check("-3e10")).to be_falsey
|
61
|
+
expect(r.check("xyz")).to be_falsey
|
62
62
|
|
63
63
|
expect(r.format("0")).to eql(0)
|
64
64
|
expect(r.format("100")).to eql(100)
|
@@ -68,12 +68,12 @@ describe Focuslight::Validator do
|
|
68
68
|
|
69
69
|
it 'returns natural predefined rule' do
|
70
70
|
r = Focuslight::Validator.rule(:natural)
|
71
|
-
expect(r.check("0")).to
|
72
|
-
expect(r.check("100")).to
|
73
|
-
expect(r.check("-21")).to
|
74
|
-
expect(r.check("1.0")).to
|
75
|
-
expect(r.check("-3e10")).to
|
76
|
-
expect(r.check("xyz")).to
|
71
|
+
expect(r.check("0")).to be_falsey
|
72
|
+
expect(r.check("100")).to be_truthy
|
73
|
+
expect(r.check("-21")).to be_falsey
|
74
|
+
expect(r.check("1.0")).to be_falsey
|
75
|
+
expect(r.check("-3e10")).to be_falsey
|
76
|
+
expect(r.check("xyz")).to be_falsey
|
77
77
|
|
78
78
|
expect(r.format("0")).to eql(0)
|
79
79
|
expect(r.format("100")).to eql(100)
|
@@ -86,15 +86,15 @@ describe Focuslight::Validator do
|
|
86
86
|
r2 = Focuslight::Validator.rule(:double)
|
87
87
|
r3 = Focuslight::Validator.rule(:real)
|
88
88
|
[r1, r2, r3].each do |r|
|
89
|
-
expect(r.check("0")).to
|
90
|
-
expect(r.check("0.0")).to
|
91
|
-
expect(r.check("1.0")).to
|
92
|
-
expect(r.check("1e+10")).to
|
93
|
-
expect(r.check("2e-10")).to
|
94
|
-
expect(r.check("-2e-10")).to
|
95
|
-
expect(r.check("e")).to
|
96
|
-
expect(r.check("xyz")).to
|
97
|
-
expect(r.check("")).to
|
89
|
+
expect(r.check("0")).to be_truthy
|
90
|
+
expect(r.check("0.0")).to be_truthy
|
91
|
+
expect(r.check("1.0")).to be_truthy
|
92
|
+
expect(r.check("1e+10")).to be_truthy
|
93
|
+
expect(r.check("2e-10")).to be_truthy
|
94
|
+
expect(r.check("-2e-10")).to be_truthy
|
95
|
+
expect(r.check("e")).to be_falsey
|
96
|
+
expect(r.check("xyz")).to be_falsey
|
97
|
+
expect(r.check("")).to be_falsey
|
98
98
|
|
99
99
|
expect(r.format("0")).to eql(0.0)
|
100
100
|
expect(r.format("0.0")).to eql(0.0)
|
@@ -109,20 +109,20 @@ describe Focuslight::Validator do
|
|
109
109
|
|
110
110
|
it 'returns int_range predefined rule' do
|
111
111
|
r1 = Focuslight::Validator.rule(:int_range, 0..3)
|
112
|
-
expect(r1.check("0")).to
|
113
|
-
expect(r1.check("1")).to
|
114
|
-
expect(r1.check("3")).to
|
115
|
-
expect(r1.check("-1")).to
|
112
|
+
expect(r1.check("0")).to be_truthy
|
113
|
+
expect(r1.check("1")).to be_truthy
|
114
|
+
expect(r1.check("3")).to be_truthy
|
115
|
+
expect(r1.check("-1")).to be_falsey
|
116
116
|
|
117
117
|
expect(r1.format("0")).to eql(0)
|
118
118
|
|
119
119
|
expect(r1.message).to eql("invalid number in range 0..3")
|
120
120
|
|
121
121
|
r2 = Focuslight::Validator.rule(:int_range, 1..3)
|
122
|
-
expect(r2.check("0")).to
|
123
|
-
expect(r2.check("1")).to
|
124
|
-
expect(r2.check("3")).to
|
125
|
-
expect(r2.check("-1")).to
|
122
|
+
expect(r2.check("0")).to be_falsey
|
123
|
+
expect(r2.check("1")).to be_truthy
|
124
|
+
expect(r2.check("3")).to be_truthy
|
125
|
+
expect(r2.check("-1")).to be_falsey
|
126
126
|
|
127
127
|
expect(r2.format("1")).to eql(1)
|
128
128
|
|
@@ -131,14 +131,14 @@ describe Focuslight::Validator do
|
|
131
131
|
|
132
132
|
it 'returns bool predefined rule, which parse numeric 1/0 as true/false' do
|
133
133
|
r = Focuslight::Validator.rule(:bool)
|
134
|
-
expect(r.check("0")).to
|
135
|
-
expect(r.check("1")).to
|
136
|
-
expect(r.check("true")).to
|
137
|
-
expect(r.check("True")).to
|
138
|
-
expect(r.check("false")).to
|
139
|
-
expect(r.check("nil")).to
|
140
|
-
expect(r.check("maru")).to
|
141
|
-
expect(r.check("")).to
|
134
|
+
expect(r.check("0")).to be_truthy
|
135
|
+
expect(r.check("1")).to be_truthy
|
136
|
+
expect(r.check("true")).to be_truthy
|
137
|
+
expect(r.check("True")).to be_truthy
|
138
|
+
expect(r.check("false")).to be_truthy
|
139
|
+
expect(r.check("nil")).to be_falsey
|
140
|
+
expect(r.check("maru")).to be_falsey
|
141
|
+
expect(r.check("")).to be_falsey
|
142
142
|
|
143
143
|
expect(r.format("0")).to equal(false)
|
144
144
|
expect(r.format("1")).to equal(true)
|
@@ -151,11 +151,11 @@ describe Focuslight::Validator do
|
|
151
151
|
|
152
152
|
it 'return regexp predefined rule' do
|
153
153
|
r = Focuslight::Validator.rule(:regexp, /^[0-9a-f]{4}$/i)
|
154
|
-
expect(r.check("000")).to
|
155
|
-
expect(r.check("0000")).to
|
156
|
-
expect(r.check("00000")).to
|
157
|
-
expect(r.check("a0a0")).to
|
158
|
-
expect(r.check("FFFF")).to
|
154
|
+
expect(r.check("000")).to be_falsey
|
155
|
+
expect(r.check("0000")).to be_truthy
|
156
|
+
expect(r.check("00000")).to be_falsey
|
157
|
+
expect(r.check("a0a0")).to be_truthy
|
158
|
+
expect(r.check("FFFF")).to be_truthy
|
159
159
|
|
160
160
|
str = "FfFf"
|
161
161
|
expect(r.format(str)).to equal(str)
|
@@ -165,9 +165,9 @@ describe Focuslight::Validator do
|
|
165
165
|
|
166
166
|
it 'returns rule instance whatever we want with "lambda" rule name' do
|
167
167
|
r = Focuslight::Validator.rule(:lambda, ->(v){ v == 'kazeburo' }, "kazeburo only permitted", :to_sym)
|
168
|
-
expect(r.check("kazeburo")).to
|
169
|
-
expect(r.check(" ")).to
|
170
|
-
expect(r.check("tagomoris")).to
|
168
|
+
expect(r.check("kazeburo")).to be_truthy
|
169
|
+
expect(r.check(" ")).to be_falsey
|
170
|
+
expect(r.check("tagomoris")).to be_falsey
|
171
171
|
|
172
172
|
expect(r.format("kazeburo")).to eql(:kazeburo)
|
173
173
|
|
@@ -5,12 +5,12 @@ require 'focuslight/validator'
|
|
5
5
|
describe Focuslight::Validator::Result do
|
6
6
|
it 'indicate that it has errors or not' do
|
7
7
|
r = Focuslight::Validator::Result.new
|
8
|
-
expect(r.has_error?).to
|
8
|
+
expect(r.has_error?).to be_falsey
|
9
9
|
r.error(:key, "error 1")
|
10
|
-
expect(r.has_error?).to
|
10
|
+
expect(r.has_error?).to be_truthy
|
11
11
|
expect(r.errors).to eql({key: "key: error 1"})
|
12
12
|
r.error(:key2, "error 2")
|
13
|
-
expect(r.has_error?).to
|
13
|
+
expect(r.has_error?).to be_truthy
|
14
14
|
expect(r.errors).to eql({key:"key: error 1", key2:"key2: error 2"})
|
15
15
|
end
|
16
16
|
|
data/spec/validator_rule_spec.rb
CHANGED
@@ -13,20 +13,20 @@ describe Focuslight::Validator::Rule do
|
|
13
13
|
describe '#check' do
|
14
14
|
it 'can validate value with first argument lambda' do
|
15
15
|
r1 = Focuslight::Validator::Rule.new(->(v){ v.nil? }, "only nil")
|
16
|
-
expect(r1.check(nil)).to
|
17
|
-
expect(r1.check("str")).to
|
16
|
+
expect(r1.check(nil)).to be_truthy
|
17
|
+
expect(r1.check("str")).to be_falsey
|
18
18
|
|
19
19
|
r2 = Focuslight::Validator::Rule.new(->(v){ v.to_i == 1 }, "one")
|
20
|
-
expect(r2.check("0")).to
|
21
|
-
expect(r2.check("1.00")).to
|
22
|
-
expect(r2.check("1")).to
|
23
|
-
expect(r2.check("2")).to
|
20
|
+
expect(r2.check("0")).to be_falsey
|
21
|
+
expect(r2.check("1.00")).to be_truthy
|
22
|
+
expect(r2.check("1")).to be_truthy
|
23
|
+
expect(r2.check("2")).to be_falsey
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'can receive 2 or more values for lambda arguments if specified' do
|
27
27
|
r1 = Focuslight::Validator::Rule.new(->(v1,v2,v3){ v1.to_i > v2.to_i && v2.to_i > v3.to_i }, "order by desc")
|
28
|
-
expect(r1.check("1","2","3")).to
|
29
|
-
expect(r1.check("3","2","1")).to
|
28
|
+
expect(r1.check("1","2","3")).to be_falsey
|
29
|
+
expect(r1.check("3","2","1")).to be_truthy
|
30
30
|
expect{ r1.check("3") }.to raise_error(ArgumentError)
|
31
31
|
|
32
32
|
r2 = Focuslight::Validator::Rule.new(->(v1){ v1.to_i > 0 }, "greater than zero")
|
data/spec/validator_spec.rb
CHANGED
@@ -21,7 +21,7 @@ describe Focuslight::Validator do
|
|
21
21
|
Focuslight::Validator.validate_single(result1, params, :key1, spec1)
|
22
22
|
Focuslight::Validator.validate_single(result1, params, :key2, spec1)
|
23
23
|
Focuslight::Validator.validate_single(result1, params, :keyx, spec1)
|
24
|
-
expect(result1.has_error?).to
|
24
|
+
expect(result1.has_error?).to be_falsey
|
25
25
|
expect(result1[:key1]).to eql("1")
|
26
26
|
expect(result1[:key2]).to eql("2")
|
27
27
|
expect(result1[:keyx]).to eql("x")
|
@@ -31,7 +31,7 @@ describe Focuslight::Validator do
|
|
31
31
|
Focuslight::Validator.validate_single(result2, params, :key1, spec2)
|
32
32
|
Focuslight::Validator.validate_single(result2, params, :key2, spec2)
|
33
33
|
Focuslight::Validator.validate_single(result2, params, :keyx, spec2)
|
34
|
-
expect(result2.has_error?).to
|
34
|
+
expect(result2.has_error?).to be_truthy
|
35
35
|
expect(result2[:key1]).to eql(1)
|
36
36
|
expect(result2[:key2]).to eql(2)
|
37
37
|
expect(result2[:keyx]).to be_nil
|
@@ -56,7 +56,7 @@ describe Focuslight::Validator do
|
|
56
56
|
Focuslight::Validator.validate_array(result1, params, :key1, spec1)
|
57
57
|
Focuslight::Validator.validate_array(result1, params, :key2, spec1)
|
58
58
|
Focuslight::Validator.validate_array(result1, params, :key3, spec1)
|
59
|
-
expect(result1.has_error?).to
|
59
|
+
expect(result1.has_error?).to be_falsey
|
60
60
|
expect(result1[:key1]).to eql(["0", "1", "2"])
|
61
61
|
expect(result1[:key2]).to eql([])
|
62
62
|
expect(result1[:key3]).to eql(["kazeburo"])
|
@@ -66,7 +66,7 @@ describe Focuslight::Validator do
|
|
66
66
|
Focuslight::Validator.validate_array(result2, params, :key1, spec2)
|
67
67
|
Focuslight::Validator.validate_array(result2, params, :key2, spec2)
|
68
68
|
Focuslight::Validator.validate_array(result2, params, :key3, spec2)
|
69
|
-
expect(result2.has_error?).to
|
69
|
+
expect(result2.has_error?).to be_truthy
|
70
70
|
expect(result2[:key1]).to be_nil
|
71
71
|
expect(result2[:key2]).to be_nil
|
72
72
|
expect(result2[:key3]).to eql(["kazeburo"])
|
@@ -80,7 +80,7 @@ describe Focuslight::Validator do
|
|
80
80
|
Focuslight::Validator.validate_array(result1, params, :key1, spec1)
|
81
81
|
Focuslight::Validator.validate_array(result1, params, :key2, spec1)
|
82
82
|
Focuslight::Validator.validate_array(result1, params, :key3, spec1)
|
83
|
-
expect(result1.has_error?).to
|
83
|
+
expect(result1.has_error?).to be_falsey
|
84
84
|
expect(result1[:key1]).to eql(["0", "1", "2"])
|
85
85
|
expect(result1[:key2]).to eql([])
|
86
86
|
expect(result1[:key3]).to eql(["kazeburo"])
|
@@ -90,7 +90,7 @@ describe Focuslight::Validator do
|
|
90
90
|
Focuslight::Validator.validate_array(result2, params, :key1, spec2)
|
91
91
|
Focuslight::Validator.validate_array(result2, params, :key2, spec2)
|
92
92
|
Focuslight::Validator.validate_array(result2, params, :key3, spec2)
|
93
|
-
expect(result2.has_error?).to
|
93
|
+
expect(result2.has_error?).to be_truthy
|
94
94
|
expect(result2[:key1]).to eql([0, 1, 2])
|
95
95
|
expect(result2[:key2]).to eql([])
|
96
96
|
expect(result2[:key3]).to be_nil
|
@@ -110,11 +110,11 @@ describe Focuslight::Validator do
|
|
110
110
|
|
111
111
|
r1 = Focuslight::Validator::Result.new
|
112
112
|
Focuslight::Validator.validate_multi_key(r1, params, [:key1, :key2, :key3], spec)
|
113
|
-
expect(r1.has_error?).to
|
113
|
+
expect(r1.has_error?).to be_falsey
|
114
114
|
|
115
115
|
r2 = Focuslight::Validator::Result.new
|
116
116
|
Focuslight::Validator.validate_multi_key(r2, params, [:key1, :key2, :key4], spec)
|
117
|
-
expect(r2.has_error?).to
|
117
|
+
expect(r2.has_error?).to be_truthy
|
118
118
|
expect(r2.errors).to eql({:'key1,key2,key4' => "key1,key2,key4: too large"})
|
119
119
|
end
|
120
120
|
end
|
data/view/view.erb
CHANGED
@@ -15,8 +15,10 @@
|
|
15
15
|
<% if graph.complex? %>
|
16
16
|
<a class="label label-success" style="cursor: pointer" href="<%= url_for "/edit_complex/#{graph.id}" %>"><span class="glyphicon glyphicon-wrench"></span> Setting</a>
|
17
17
|
<span class="label label-warning">Complex Graph</span>
|
18
|
+
<a class="label label-info" style="cursor: pointer" href="<%= url_for("/xport/#{graph.complex_graph}", t: current_term, sumup: graph.sumup) %>"><span class="glyphicon glyphicon-share"></span> JSON</a>
|
18
19
|
<% else %>
|
19
20
|
<a class="label label-success" style="cursor: pointer" href="<%= url_for linkpath(graph.path, '/edit') %>"><span class="glyphicon glyphicon-wrench"></span> Setting</a>
|
21
|
+
<a class="label label-info" style="cursor: pointer" href="<%= url_for("/xport/#{graph.service}/#{graph.section}/#{graph.graph}") %>"><span class="glyphicon glyphicon-share"></span> JSON</a>
|
20
22
|
<span class="label label-default">current</span> <%= format_number graph.number %>
|
21
23
|
<span class="label label-default">mode</span> <%= graph.mode %>
|
22
24
|
<% end %>
|
metadata
CHANGED
@@ -1,281 +1,282 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: focuslight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
8
|
- Naotoshi Seo
|
9
9
|
- Shota Fukumori (sora_h)
|
10
|
+
- Koichiro Ohba
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date: 2014-
|
14
|
+
date: 2014-06-11 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: bundler
|
17
18
|
requirement: !ruby/object:Gem::Requirement
|
18
19
|
requirements:
|
19
|
-
- - ~>
|
20
|
+
- - "~>"
|
20
21
|
- !ruby/object:Gem::Version
|
21
22
|
version: '1.3'
|
22
23
|
type: :development
|
23
24
|
prerelease: false
|
24
25
|
version_requirements: !ruby/object:Gem::Requirement
|
25
26
|
requirements:
|
26
|
-
- - ~>
|
27
|
+
- - "~>"
|
27
28
|
- !ruby/object:Gem::Version
|
28
29
|
version: '1.3'
|
29
30
|
- !ruby/object:Gem::Dependency
|
30
31
|
name: rspec
|
31
32
|
requirement: !ruby/object:Gem::Requirement
|
32
33
|
requirements:
|
33
|
-
- -
|
34
|
+
- - ">="
|
34
35
|
- !ruby/object:Gem::Version
|
35
36
|
version: '0'
|
36
37
|
type: :development
|
37
38
|
prerelease: false
|
38
39
|
version_requirements: !ruby/object:Gem::Requirement
|
39
40
|
requirements:
|
40
|
-
- -
|
41
|
+
- - ">="
|
41
42
|
- !ruby/object:Gem::Version
|
42
43
|
version: '0'
|
43
44
|
- !ruby/object:Gem::Dependency
|
44
45
|
name: pry
|
45
46
|
requirement: !ruby/object:Gem::Requirement
|
46
47
|
requirements:
|
47
|
-
- -
|
48
|
+
- - ">="
|
48
49
|
- !ruby/object:Gem::Version
|
49
50
|
version: '0'
|
50
51
|
type: :development
|
51
52
|
prerelease: false
|
52
53
|
version_requirements: !ruby/object:Gem::Requirement
|
53
54
|
requirements:
|
54
|
-
- -
|
55
|
+
- - ">="
|
55
56
|
- !ruby/object:Gem::Version
|
56
57
|
version: '0'
|
57
58
|
- !ruby/object:Gem::Dependency
|
58
59
|
name: pry-nav
|
59
60
|
requirement: !ruby/object:Gem::Requirement
|
60
61
|
requirements:
|
61
|
-
- -
|
62
|
+
- - ">="
|
62
63
|
- !ruby/object:Gem::Version
|
63
64
|
version: '0'
|
64
65
|
type: :development
|
65
66
|
prerelease: false
|
66
67
|
version_requirements: !ruby/object:Gem::Requirement
|
67
68
|
requirements:
|
68
|
-
- -
|
69
|
+
- - ">="
|
69
70
|
- !ruby/object:Gem::Version
|
70
71
|
version: '0'
|
71
72
|
- !ruby/object:Gem::Dependency
|
72
73
|
name: rake
|
73
74
|
requirement: !ruby/object:Gem::Requirement
|
74
75
|
requirements:
|
75
|
-
- -
|
76
|
+
- - ">="
|
76
77
|
- !ruby/object:Gem::Version
|
77
78
|
version: '0'
|
78
79
|
type: :development
|
79
80
|
prerelease: false
|
80
81
|
version_requirements: !ruby/object:Gem::Requirement
|
81
82
|
requirements:
|
82
|
-
- -
|
83
|
+
- - ">="
|
83
84
|
- !ruby/object:Gem::Version
|
84
85
|
version: '0'
|
85
86
|
- !ruby/object:Gem::Dependency
|
86
87
|
name: octorelease
|
87
88
|
requirement: !ruby/object:Gem::Requirement
|
88
89
|
requirements:
|
89
|
-
- -
|
90
|
+
- - ">="
|
90
91
|
- !ruby/object:Gem::Version
|
91
92
|
version: '0'
|
92
93
|
type: :development
|
93
94
|
prerelease: false
|
94
95
|
version_requirements: !ruby/object:Gem::Requirement
|
95
96
|
requirements:
|
96
|
-
- -
|
97
|
+
- - ">="
|
97
98
|
- !ruby/object:Gem::Version
|
98
99
|
version: '0'
|
99
100
|
- !ruby/object:Gem::Dependency
|
100
101
|
name: dotenv
|
101
102
|
requirement: !ruby/object:Gem::Requirement
|
102
103
|
requirements:
|
103
|
-
- -
|
104
|
+
- - ">="
|
104
105
|
- !ruby/object:Gem::Version
|
105
106
|
version: '0'
|
106
107
|
type: :runtime
|
107
108
|
prerelease: false
|
108
109
|
version_requirements: !ruby/object:Gem::Requirement
|
109
110
|
requirements:
|
110
|
-
- -
|
111
|
+
- - ">="
|
111
112
|
- !ruby/object:Gem::Version
|
112
113
|
version: '0'
|
113
114
|
- !ruby/object:Gem::Dependency
|
114
115
|
name: foreman
|
115
116
|
requirement: !ruby/object:Gem::Requirement
|
116
117
|
requirements:
|
117
|
-
- -
|
118
|
+
- - ">="
|
118
119
|
- !ruby/object:Gem::Version
|
119
120
|
version: '0'
|
120
121
|
type: :runtime
|
121
122
|
prerelease: false
|
122
123
|
version_requirements: !ruby/object:Gem::Requirement
|
123
124
|
requirements:
|
124
|
-
- -
|
125
|
+
- - ">="
|
125
126
|
- !ruby/object:Gem::Version
|
126
127
|
version: '0'
|
127
128
|
- !ruby/object:Gem::Dependency
|
128
129
|
name: thor
|
129
130
|
requirement: !ruby/object:Gem::Requirement
|
130
131
|
requirements:
|
131
|
-
- -
|
132
|
+
- - ">="
|
132
133
|
- !ruby/object:Gem::Version
|
133
134
|
version: '0'
|
134
135
|
type: :runtime
|
135
136
|
prerelease: false
|
136
137
|
version_requirements: !ruby/object:Gem::Requirement
|
137
138
|
requirements:
|
138
|
-
- -
|
139
|
+
- - ">="
|
139
140
|
- !ruby/object:Gem::Version
|
140
141
|
version: '0'
|
141
142
|
- !ruby/object:Gem::Dependency
|
142
143
|
name: sinatra
|
143
144
|
requirement: !ruby/object:Gem::Requirement
|
144
145
|
requirements:
|
145
|
-
- -
|
146
|
+
- - ">="
|
146
147
|
- !ruby/object:Gem::Version
|
147
148
|
version: '0'
|
148
149
|
type: :runtime
|
149
150
|
prerelease: false
|
150
151
|
version_requirements: !ruby/object:Gem::Requirement
|
151
152
|
requirements:
|
152
|
-
- -
|
153
|
+
- - ">="
|
153
154
|
- !ruby/object:Gem::Version
|
154
155
|
version: '0'
|
155
156
|
- !ruby/object:Gem::Dependency
|
156
157
|
name: sinatra-contrib
|
157
158
|
requirement: !ruby/object:Gem::Requirement
|
158
159
|
requirements:
|
159
|
-
- -
|
160
|
+
- - ">="
|
160
161
|
- !ruby/object:Gem::Version
|
161
162
|
version: '0'
|
162
163
|
type: :runtime
|
163
164
|
prerelease: false
|
164
165
|
version_requirements: !ruby/object:Gem::Requirement
|
165
166
|
requirements:
|
166
|
-
- -
|
167
|
+
- - ">="
|
167
168
|
- !ruby/object:Gem::Version
|
168
169
|
version: '0'
|
169
170
|
- !ruby/object:Gem::Dependency
|
170
171
|
name: erubis
|
171
172
|
requirement: !ruby/object:Gem::Requirement
|
172
173
|
requirements:
|
173
|
-
- -
|
174
|
+
- - ">="
|
174
175
|
- !ruby/object:Gem::Version
|
175
176
|
version: '0'
|
176
177
|
type: :runtime
|
177
178
|
prerelease: false
|
178
179
|
version_requirements: !ruby/object:Gem::Requirement
|
179
180
|
requirements:
|
180
|
-
- -
|
181
|
+
- - ">="
|
181
182
|
- !ruby/object:Gem::Version
|
182
183
|
version: '0'
|
183
184
|
- !ruby/object:Gem::Dependency
|
184
185
|
name: unicorn
|
185
186
|
requirement: !ruby/object:Gem::Requirement
|
186
187
|
requirements:
|
187
|
-
- -
|
188
|
+
- - ">="
|
188
189
|
- !ruby/object:Gem::Version
|
189
190
|
version: '0'
|
190
191
|
type: :runtime
|
191
192
|
prerelease: false
|
192
193
|
version_requirements: !ruby/object:Gem::Requirement
|
193
194
|
requirements:
|
194
|
-
- -
|
195
|
+
- - ">="
|
195
196
|
- !ruby/object:Gem::Version
|
196
197
|
version: '0'
|
197
198
|
- !ruby/object:Gem::Dependency
|
198
199
|
name: unicorn-worker-killer
|
199
200
|
requirement: !ruby/object:Gem::Requirement
|
200
201
|
requirements:
|
201
|
-
- -
|
202
|
+
- - ">="
|
202
203
|
- !ruby/object:Gem::Version
|
203
204
|
version: '0'
|
204
205
|
type: :runtime
|
205
206
|
prerelease: false
|
206
207
|
version_requirements: !ruby/object:Gem::Requirement
|
207
208
|
requirements:
|
208
|
-
- -
|
209
|
+
- - ">="
|
209
210
|
- !ruby/object:Gem::Version
|
210
211
|
version: '0'
|
211
212
|
- !ruby/object:Gem::Dependency
|
212
213
|
name: sequel
|
213
214
|
requirement: !ruby/object:Gem::Requirement
|
214
215
|
requirements:
|
215
|
-
- -
|
216
|
+
- - ">="
|
216
217
|
- !ruby/object:Gem::Version
|
217
218
|
version: '0'
|
218
219
|
type: :runtime
|
219
220
|
prerelease: false
|
220
221
|
version_requirements: !ruby/object:Gem::Requirement
|
221
222
|
requirements:
|
222
|
-
- -
|
223
|
+
- - ">="
|
223
224
|
- !ruby/object:Gem::Version
|
224
225
|
version: '0'
|
225
226
|
- !ruby/object:Gem::Dependency
|
226
227
|
name: sqlite3
|
227
228
|
requirement: !ruby/object:Gem::Requirement
|
228
229
|
requirements:
|
229
|
-
- -
|
230
|
+
- - ">="
|
230
231
|
- !ruby/object:Gem::Version
|
231
232
|
version: '0'
|
232
233
|
type: :runtime
|
233
234
|
prerelease: false
|
234
235
|
version_requirements: !ruby/object:Gem::Requirement
|
235
236
|
requirements:
|
236
|
-
- -
|
237
|
+
- - ">="
|
237
238
|
- !ruby/object:Gem::Version
|
238
239
|
version: '0'
|
239
240
|
- !ruby/object:Gem::Dependency
|
240
241
|
name: mysql2
|
241
242
|
requirement: !ruby/object:Gem::Requirement
|
242
243
|
requirements:
|
243
|
-
- -
|
244
|
+
- - ">="
|
244
245
|
- !ruby/object:Gem::Version
|
245
246
|
version: '0'
|
246
247
|
type: :runtime
|
247
248
|
prerelease: false
|
248
249
|
version_requirements: !ruby/object:Gem::Requirement
|
249
250
|
requirements:
|
250
|
-
- -
|
251
|
+
- - ">="
|
251
252
|
- !ruby/object:Gem::Version
|
252
253
|
version: '0'
|
253
254
|
- !ruby/object:Gem::Dependency
|
254
255
|
name: librrd
|
255
256
|
requirement: !ruby/object:Gem::Requirement
|
256
257
|
requirements:
|
257
|
-
- -
|
258
|
+
- - ">="
|
258
259
|
- !ruby/object:Gem::Version
|
259
260
|
version: '0'
|
260
261
|
type: :runtime
|
261
262
|
prerelease: false
|
262
263
|
version_requirements: !ruby/object:Gem::Requirement
|
263
264
|
requirements:
|
264
|
-
- -
|
265
|
+
- - ">="
|
265
266
|
- !ruby/object:Gem::Version
|
266
267
|
version: '0'
|
267
268
|
- !ruby/object:Gem::Dependency
|
268
269
|
name: rrd-ffi
|
269
270
|
requirement: !ruby/object:Gem::Requirement
|
270
271
|
requirements:
|
271
|
-
- -
|
272
|
+
- - ">="
|
272
273
|
- !ruby/object:Gem::Version
|
273
274
|
version: '0'
|
274
275
|
type: :runtime
|
275
276
|
prerelease: false
|
276
277
|
version_requirements: !ruby/object:Gem::Requirement
|
277
278
|
requirements:
|
278
|
-
- -
|
279
|
+
- - ">="
|
279
280
|
- !ruby/object:Gem::Version
|
280
281
|
version: '0'
|
281
282
|
description: Lightning Fast Graphing/Visualization, built on RRDTool
|
@@ -283,14 +284,15 @@ email:
|
|
283
284
|
- tagomoris@gmail.com
|
284
285
|
- sonots@gmail.com
|
285
286
|
- her@sorah.jp
|
287
|
+
- koichiro@meadowy.org
|
286
288
|
executables:
|
287
289
|
- focuslight
|
288
290
|
extensions: []
|
289
291
|
extra_rdoc_files: []
|
290
292
|
files:
|
291
|
-
- .env
|
292
|
-
- .gitignore
|
293
|
-
- .travis.yml
|
293
|
+
- ".env"
|
294
|
+
- ".gitignore"
|
295
|
+
- ".travis.yml"
|
294
296
|
- CHANGELOG.md
|
295
297
|
- Gemfile
|
296
298
|
- LICENSE.txt
|
@@ -350,17 +352,17 @@ require_paths:
|
|
350
352
|
- lib
|
351
353
|
required_ruby_version: !ruby/object:Gem::Requirement
|
352
354
|
requirements:
|
353
|
-
- -
|
355
|
+
- - ">="
|
354
356
|
- !ruby/object:Gem::Version
|
355
357
|
version: '0'
|
356
358
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
357
359
|
requirements:
|
358
|
-
- -
|
360
|
+
- - ">="
|
359
361
|
- !ruby/object:Gem::Version
|
360
362
|
version: '0'
|
361
363
|
requirements: []
|
362
364
|
rubyforge_project:
|
363
|
-
rubygems_version: 2.
|
365
|
+
rubygems_version: 2.2.2
|
364
366
|
signing_key:
|
365
367
|
specification_version: 4
|
366
368
|
summary: Lightning Fast Graphing/Visualization, built on RRDTool
|