radar-app 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/analyzer_controller.rb +29 -9
- data/lib/radar/app/fund_service_factory.rb +2 -1
- data/lib/radar/app/index_service_factory.rb +2 -1
- data/lib/radar/app/security_service_factory.rb +2 -1
- data/lib/radar/app/version.rb +1 -1
- data/radar-app.gemspec +3 -1
- data/templates/Gemfile +4 -3
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3da9a048534d30b8d563d779a92dce4f81763d23
|
4
|
+
data.tar.gz: d3ad691cfb07c05a584fcfc1e7929ff15c7537ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 472a1c6e7debe843d596e84b89d559f7c4f77cc3d5fefd9354a2f6a12f961a68d47d37d7e074b388a1436a10c3b474c598d479c4d4fb1630be60f942edb331b2
|
7
|
+
data.tar.gz: 61dca7186749496cf2628a65bcb5a3a93c09fe0d2939113950ed768a0b6fb913b6fd4d5534c01318a2551f9bd99d6cee53704c926a81eac449a9baa716cd428c
|
data/lib/analyzer_controller.rb
CHANGED
@@ -8,7 +8,9 @@ module Radar
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def analyzers
|
11
|
-
|
11
|
+
handle_error do
|
12
|
+
@@analyzers.values.map { |analyzer_class| analyzer_class.new.config }
|
13
|
+
end
|
12
14
|
end
|
13
15
|
|
14
16
|
def self.register_analyzer(analyzer_id, analyzer_class)
|
@@ -16,25 +18,41 @@ module Radar
|
|
16
18
|
end
|
17
19
|
|
18
20
|
def on_each_day(session_id, portfolio)
|
19
|
-
|
21
|
+
handle_error do
|
22
|
+
@sessions[session_id].on_each_day(portfolio)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def on_each_month(session_id, portfolio)
|
27
|
+
handle_error do
|
28
|
+
@sessions[session_id].on_each_month(portfolio)
|
29
|
+
end
|
20
30
|
end
|
21
31
|
|
22
32
|
def on_finish(session_id, portfolio)
|
23
|
-
|
33
|
+
handle_error do
|
34
|
+
@sessions[session_id].on_finish(portfolio)
|
35
|
+
end
|
24
36
|
end
|
25
37
|
|
26
38
|
def create_session(session_id, analyzer_id)
|
27
|
-
|
28
|
-
|
29
|
-
|
39
|
+
handle_error do
|
40
|
+
analyzer = @@analyzers[analyzer_id].new
|
41
|
+
@sessions[session_id] = analyzer
|
42
|
+
analyzer.config
|
43
|
+
end
|
30
44
|
end
|
31
45
|
|
32
46
|
def dump(session_id)
|
33
|
-
|
47
|
+
handle_error do
|
48
|
+
@sessions[session_id].dump
|
49
|
+
end
|
34
50
|
end
|
35
51
|
|
36
52
|
def resume(session_id, data)
|
37
|
-
|
53
|
+
handle_error do
|
54
|
+
@sessions[session_id].resume(data)
|
55
|
+
end
|
38
56
|
end
|
39
57
|
|
40
58
|
def result(session_id)
|
@@ -44,7 +62,9 @@ module Radar
|
|
44
62
|
end
|
45
63
|
|
46
64
|
def destroy_session(session_id)
|
47
|
-
|
65
|
+
handle_error do
|
66
|
+
@sessions.delete(session_id)
|
67
|
+
end
|
48
68
|
end
|
49
69
|
|
50
70
|
protected
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class Radar::App::FundServiceFactory
|
2
2
|
def self.create
|
3
|
-
|
3
|
+
host = ENV['RADAR_HOST'] || '127.0.0.1'
|
4
|
+
transport = Thrift::BufferedTransport.new(Thrift::Socket.new(host, 9791))
|
4
5
|
protocol = Thrift::BinaryProtocol.new(transport)
|
5
6
|
transport.open
|
6
7
|
Radar::API::FundService::Client.new(protocol)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class Radar::App::IndexServiceFactory
|
2
2
|
def self.create
|
3
|
-
|
3
|
+
host = ENV['RADAR_HOST'] || '127.0.0.1'
|
4
|
+
transport = Thrift::BufferedTransport.new(Thrift::Socket.new(host, 9792))
|
4
5
|
protocol = Thrift::BinaryProtocol.new(transport)
|
5
6
|
transport.open
|
6
7
|
Radar::API::IndexService::Client.new(protocol)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class Radar::App::SecurityServiceFactory
|
2
2
|
def self.create
|
3
|
-
|
3
|
+
host = ENV['RADAR_HOST'] || '127.0.0.1'
|
4
|
+
transport = Thrift::BufferedTransport.new(Thrift::Socket.new(host, 9790))
|
4
5
|
protocol = Thrift::BinaryProtocol.new(transport)
|
5
6
|
transport.open
|
6
7
|
Radar::API::SecurityService::Client.new(protocol)
|
data/lib/radar/app/version.rb
CHANGED
data/radar-app.gemspec
CHANGED
@@ -22,5 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "guard-rake", "0.0.9"
|
23
23
|
|
24
24
|
spec.add_dependency "thor", "~> 0.19"
|
25
|
-
spec.add_dependency "radar-api", "0.1
|
25
|
+
spec.add_dependency "radar-api", "~> 0.1"
|
26
|
+
spec.add_dependency "thin", "1.6.2"
|
27
|
+
|
26
28
|
end
|
data/templates/Gemfile
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radar-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonardo Mendonca
|
@@ -54,18 +54,32 @@ dependencies:
|
|
54
54
|
version: '0.19'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: radar-api
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: thin
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - '='
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
75
|
+
version: 1.6.2
|
62
76
|
type: :runtime
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - '='
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
82
|
+
version: 1.6.2
|
69
83
|
description: generates and run a radar-app.
|
70
84
|
email:
|
71
85
|
- leonardo.mendonca@investtools.com.br
|