radar-app 0.1.4 → 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.
- checksums.yaml +4 -4
- data/lib/radar/app.rb +15 -8
- data/lib/radar/app/version.rb +1 -1
- data/radar-app.gemspec +1 -1
- data/templates/analyzers/analyzer.rb.erb +2 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6451827404096a8f8f291cc24caf8867d54b25fa
|
4
|
+
data.tar.gz: 725711585095dc1590354482f30194453ad2d0df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 433ce29ab89088d662b38a5886655024fa2e19e8bff212a6cde5e99f0de6160e5e719ed3456a68bbb7ee937b95cd00e7f6af16fbc85825af0187468734188a06
|
7
|
+
data.tar.gz: c7d4039612a9de7835173a6cfcc4bbf3db8797b99365e464cb6f1732ff92895cc7a3443561107003cad3a304b2f87a9d62f3ac601fd84fcabbc087650f57eed3
|
data/lib/radar/app.rb
CHANGED
@@ -13,6 +13,7 @@ require 'radar-api'
|
|
13
13
|
require 'connection_pool'
|
14
14
|
require 'thrift_client'
|
15
15
|
require 'active_support/string_inquirer'
|
16
|
+
require 'active_support/inflector'
|
16
17
|
|
17
18
|
module Radar
|
18
19
|
module App
|
@@ -21,26 +22,32 @@ module Radar
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def self.security_service
|
24
|
-
@security_service ||= connection_pool(
|
25
|
+
@security_service ||= connection_pool('SecurityService')
|
25
26
|
end
|
26
27
|
|
27
28
|
def self.fund_service
|
28
|
-
@fund_service ||= connection_pool(
|
29
|
+
@fund_service ||= connection_pool('FundService')
|
29
30
|
end
|
30
31
|
|
31
32
|
def self.index_service
|
32
|
-
@index_service ||= connection_pool(
|
33
|
+
@index_service ||= connection_pool('IndexService')
|
33
34
|
end
|
34
35
|
|
35
36
|
protected
|
36
37
|
|
37
|
-
def self.connection_pool(client_class
|
38
|
-
ConnectionPool.new { connection(client_class
|
38
|
+
def self.connection_pool(client_class)
|
39
|
+
ConnectionPool.new { connection(client_class) }
|
39
40
|
end
|
40
41
|
|
41
|
-
def self.connection(
|
42
|
-
ThriftClient.new(
|
43
|
-
|
42
|
+
def self.connection(service)
|
43
|
+
ThriftClient.new(
|
44
|
+
ActiveSupport::Inflector.constantize("Radar::API::#{service}::Client"),
|
45
|
+
"#{host}:9790",
|
46
|
+
multiplexed_protocol: service,
|
47
|
+
protocol: Thrift::BinaryProtocolAccelerated,
|
48
|
+
retries: 1,
|
49
|
+
server_retry_period: 0
|
50
|
+
)
|
44
51
|
end
|
45
52
|
|
46
53
|
def self.host
|
data/lib/radar/app/version.rb
CHANGED
data/radar-app.gemspec
CHANGED
@@ -28,5 +28,5 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency "thin", "1.6.2"
|
29
29
|
spec.add_dependency "connection_pool", "~> 2.0"
|
30
30
|
spec.add_dependency "activesupport", "~> 4.1"
|
31
|
-
spec.add_dependency "thrift_client", "~> 0.9"
|
31
|
+
spec.add_dependency "RaymondChou-thrift_client", "~> 0.9"
|
32
32
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'radar-api'
|
2
2
|
|
3
3
|
class <%= @class_name %>
|
4
|
+
include Radar::App::Analyzer
|
4
5
|
|
5
6
|
def config
|
6
7
|
Thrift::Builder.new(Radar::API::AnalyzerConfig).build(
|
@@ -14,18 +15,12 @@ class <%= @class_name %>
|
|
14
15
|
def on_each_day(portfolio)
|
15
16
|
end
|
16
17
|
|
17
|
-
def
|
18
|
+
def on_each_month(portfolio)
|
18
19
|
end
|
19
20
|
|
20
21
|
def on_finish(portfolio)
|
21
22
|
end
|
22
23
|
|
23
|
-
def dump
|
24
|
-
end
|
25
|
-
|
26
|
-
def resume(data)
|
27
|
-
end
|
28
|
-
|
29
24
|
def example_result
|
30
25
|
end
|
31
26
|
|
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonardo Mendonca
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '4.1'
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
|
-
name: thrift_client
|
141
|
+
name: RaymondChou-thrift_client
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
144
|
- - "~>"
|