radar-app 0.0.3 → 0.0.4

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: bfa68551cb0b966589030147fd428918fb38c959
4
- data.tar.gz: 8c5c7dbfb83f4d77915853d1a76f335aa234e9aa
3
+ metadata.gz: 8776feab6a112626034d430d295f49b8c5993dfc
4
+ data.tar.gz: c371fb96d7464cc919676bdf0487c4940de54fb4
5
5
  SHA512:
6
- metadata.gz: 5619d0b7fde1f6ab9df1bcf1feeb246f0c9244abac97369d0ab9fda62478ccdcc209167c50db873f4ae8bfaf532cf69bfea76217b08a1ccbcf96e939bd5bbe19
7
- data.tar.gz: 1231aa3cc391341dc88c002ee0bad6c560e82531150244d0b173e34b9c26a425af6a2d56b45330fc2dacb166b7c60fa314d68d72e8c399f337ba8996196c5d79
6
+ metadata.gz: ae91b2750ebc7e8e751fc116c1a7c46b957e04aaad52c767d3f954d6e3e72853bf56b116fb26c282ec4747ba10dfc4030341e1105790832c9325ab22ece52b5c
7
+ data.tar.gz: 33524399edf7af6b738eb670c8b5fd974e24671adb1d190b93f4d895a025bad706e778ab77307a5172a088ce09e813681c19b452403118641368e436698f380b
data/Guardfile ADDED
@@ -0,0 +1,3 @@
1
+ guard 'rake', :task => 'install' do
2
+ watch(/\.rb$/)
3
+ end
@@ -7,6 +7,10 @@ module Radar
7
7
  @sessions = {}
8
8
  end
9
9
 
10
+ def analyzers
11
+ @@analyzers.values.map { |analyzer_class| analyzer_class.new.config }
12
+ end
13
+
10
14
  def self.register_analyzer(analyzer_id, analyzer_class)
11
15
  (@@analyzers ||= {})[analyzer_id] = analyzer_class
12
16
  end
@@ -34,12 +38,25 @@ module Radar
34
38
  end
35
39
 
36
40
  def result(session_id)
37
- @sessions[session_id].result
41
+ handle_error do
42
+ @sessions[session_id].result
43
+ end
38
44
  end
39
45
 
40
46
  def destroy_session(session_id)
41
47
  @sessions.delete(session_id)
42
48
  end
49
+
50
+ protected
51
+
52
+ def handle_error
53
+ begin
54
+ yield
55
+ rescue => e
56
+ puts "#{e.class}: #{e.message}"
57
+ puts e.backtrace
58
+ end
59
+ end
43
60
  end
44
61
  end
45
62
  end
@@ -0,0 +1,15 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ class Date
4
+ def to_i
5
+ to_utc_time.to_i
6
+ end
7
+
8
+ def self.on(unix_time)
9
+ Time.at(unix_time).utc.to_date
10
+ end
11
+
12
+ def to_utc_time
13
+ Time.utc(year, month, day)
14
+ end
15
+ end
@@ -0,0 +1,8 @@
1
+ class Radar::App::FundServiceFactory
2
+ def self.create
3
+ transport = Thrift::BufferedTransport.new(Thrift::Socket.new('127.0.0.1', 9791))
4
+ protocol = Thrift::BinaryProtocol.new(transport)
5
+ transport.open
6
+ Radar::API::FundService::Client.new(protocol)
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class Radar::App::IndexServiceFactory
2
+ def self.create
3
+ transport = Thrift::BufferedTransport.new(Thrift::Socket.new('127.0.0.1', 9792))
4
+ protocol = Thrift::BinaryProtocol.new(transport)
5
+ transport.open
6
+ Radar::API::IndexService::Client.new(protocol)
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class Radar::App::SecurityServiceFactory
2
+ def self.create
3
+ transport = Thrift::BufferedTransport.new(Thrift::Socket.new('127.0.0.1', 9790))
4
+ protocol = Thrift::BinaryProtocol.new(transport)
5
+ transport.open
6
+ Radar::API::SecurityService::Client.new(protocol)
7
+ end
8
+ end
@@ -1,5 +1,5 @@
1
1
  module Radar
2
2
  module App
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
data/radar-app.gemspec CHANGED
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.5"
22
- spec.add_development_dependency "rake"
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"
25
+ spec.add_dependency "radar-api", "0.1.1"
26
26
  end
@@ -15,9 +15,6 @@ class ClassName
15
15
  def on_finish(portfolio)
16
16
  end
17
17
 
18
- def create_session(analyzer_id)
19
- end
20
-
21
18
  def dump()
22
19
  end
23
20
 
@@ -27,7 +24,4 @@ class ClassName
27
24
  def result()
28
25
  end
29
26
 
30
- def destroy_session()
31
- end
32
-
33
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radar-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonardo Mendonca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-06 00:00:00.000000000 Z
11
+ date: 2014-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: guard-rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 0.0.9
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 0.0.9
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: thor
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: radar-api
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.1.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 0.1.1
69
69
  description: generates and run a radar-app.
70
70
  email:
71
71
  - leonardo.mendonca@investtools.com.br
@@ -76,6 +76,7 @@ extra_rdoc_files: []
76
76
  files:
77
77
  - ".gitignore"
78
78
  - Gemfile
79
+ - Guardfile
79
80
  - LICENSE.txt
80
81
  - README.md
81
82
  - Rakefile
@@ -83,6 +84,10 @@ files:
83
84
  - lib/analyzer_controller.rb
84
85
  - lib/radar-app.rb
85
86
  - lib/radar/app.rb
87
+ - lib/radar/app/core_ext/date.rb
88
+ - lib/radar/app/fund_service_factory.rb
89
+ - lib/radar/app/index_service_factory.rb
90
+ - lib/radar/app/security_service_factory.rb
86
91
  - lib/radar/app/version.rb
87
92
  - radar-app.gemspec
88
93
  - templates/Gemfile