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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8776feab6a112626034d430d295f49b8c5993dfc
4
- data.tar.gz: c371fb96d7464cc919676bdf0487c4940de54fb4
3
+ metadata.gz: 3da9a048534d30b8d563d779a92dce4f81763d23
4
+ data.tar.gz: d3ad691cfb07c05a584fcfc1e7929ff15c7537ec
5
5
  SHA512:
6
- metadata.gz: ae91b2750ebc7e8e751fc116c1a7c46b957e04aaad52c767d3f954d6e3e72853bf56b116fb26c282ec4747ba10dfc4030341e1105790832c9325ab22ece52b5c
7
- data.tar.gz: 33524399edf7af6b738eb670c8b5fd974e24671adb1d190b93f4d895a025bad706e778ab77307a5172a088ce09e813681c19b452403118641368e436698f380b
6
+ metadata.gz: 472a1c6e7debe843d596e84b89d559f7c4f77cc3d5fefd9354a2f6a12f961a68d47d37d7e074b388a1436a10c3b474c598d479c4d4fb1630be60f942edb331b2
7
+ data.tar.gz: 61dca7186749496cf2628a65bcb5a3a93c09fe0d2939113950ed768a0b6fb913b6fd4d5534c01318a2551f9bd99d6cee53704c926a81eac449a9baa716cd428c
@@ -8,7 +8,9 @@ module Radar
8
8
  end
9
9
 
10
10
  def analyzers
11
- @@analyzers.values.map { |analyzer_class| analyzer_class.new.config }
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
- @sessions[session_id].on_each_day(portfolio)
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
- @sessions[session_id].on_finish(portfolio)
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
- analyzer = @@analyzers[analyzer_id].new
28
- @sessions[session_id] = analyzer
29
- analyzer.config
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
- @sessions[session_id].dump
47
+ handle_error do
48
+ @sessions[session_id].dump
49
+ end
34
50
  end
35
51
 
36
52
  def resume(session_id, data)
37
- @sessions[session_id].resume(data)
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
- @sessions.delete(session_id)
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
- transport = Thrift::BufferedTransport.new(Thrift::Socket.new('127.0.0.1', 9791))
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
- transport = Thrift::BufferedTransport.new(Thrift::Socket.new('127.0.0.1', 9792))
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
- transport = Thrift::BufferedTransport.new(Thrift::Socket.new('127.0.0.1', 9790))
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)
@@ -1,5 +1,5 @@
1
1
  module Radar
2
2
  module App
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
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.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
@@ -2,11 +2,12 @@
2
2
  source "https://rubygems.org"
3
3
 
4
4
  gem 'radar-app'
5
- gem 'thin'
6
- gem 'i18n'
7
- gem 'active_support'
8
5
 
9
6
  group :test do
10
7
  gem 'rspec'
11
8
  end
12
9
 
10
+ group :development do
11
+ gem 'rake'
12
+ end
13
+
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
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: 0.1.1
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: 0.1.1
82
+ version: 1.6.2
69
83
  description: generates and run a radar-app.
70
84
  email:
71
85
  - leonardo.mendonca@investtools.com.br