radar-app 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0973a848c5d14d307ac3b84c049cd70c3f2fac9e
4
- data.tar.gz: 849428f58bd852a97514dc671b33a328974f3c11
3
+ metadata.gz: 6451827404096a8f8f291cc24caf8867d54b25fa
4
+ data.tar.gz: 725711585095dc1590354482f30194453ad2d0df
5
5
  SHA512:
6
- metadata.gz: 0a80449d607c94910577a7bf899277aecb478105bf1db5bee755a2a00547414564319f57ab41ff16c698b5b6d2ca934060f3d3e83c9978d0c056b1a6af1605ee
7
- data.tar.gz: 201d9b2232280d2a8f3ef762ad71a4c6fb98514e429ecda2bcd327f4dacc9462169806bf70486f18d78b3c3f0e50ab2053c860f04be80f1ca9f654449edf8894
6
+ metadata.gz: 433ce29ab89088d662b38a5886655024fa2e19e8bff212a6cde5e99f0de6160e5e719ed3456a68bbb7ee937b95cd00e7f6af16fbc85825af0187468734188a06
7
+ data.tar.gz: c7d4039612a9de7835173a6cfcc4bbf3db8797b99365e464cb6f1732ff92895cc7a3443561107003cad3a304b2f87a9d62f3ac601fd84fcabbc087650f57eed3
@@ -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(Radar::API::SecurityService::Client, 9790)
25
+ @security_service ||= connection_pool('SecurityService')
25
26
  end
26
27
 
27
28
  def self.fund_service
28
- @fund_service ||= connection_pool(Radar::API::FundService::Client, 9791)
29
+ @fund_service ||= connection_pool('FundService')
29
30
  end
30
31
 
31
32
  def self.index_service
32
- @index_service ||= connection_pool(Radar::API::IndexService::Client, 9792)
33
+ @index_service ||= connection_pool('IndexService')
33
34
  end
34
35
 
35
36
  protected
36
37
 
37
- def self.connection_pool(client_class, port)
38
- ConnectionPool.new { connection(client_class, port) }
38
+ def self.connection_pool(client_class)
39
+ ConnectionPool.new { connection(client_class) }
39
40
  end
40
41
 
41
- def self.connection(client_class, port)
42
- ThriftClient.new(client_class, "#{host}:#{port}",
43
- protocol: Thrift::BinaryProtocolAccelerated, retries: 1, server_retry_period: 0)
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
@@ -1,5 +1,5 @@
1
1
  module Radar
2
2
  module App
3
- VERSION = "0.1.4"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -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 on_month_day(portfolio)
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.1.4
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: 2016-09-01 00:00:00.000000000 Z
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
  - - "~>"