fin 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +4 -0
- data/README.rdoc +5 -5
- data/Rakefile +3 -3
- data/VERSION +1 -1
- data/lib/fin.rb +2 -5
- data/lib/fin/book.rb +2 -2
- data/lib/fin/book_manager.rb +1 -1
- data/lib/fin/changed_list.rb +1 -1
- data/lib/fin/container_list.rb +10 -1
- data/lib/fin/deal_list.rb +2 -2
- data/lib/fin/models/deal.rb +44 -50
- data/lib/fin/models/instrument.rb +39 -57
- data/lib/fin/models/model.rb +112 -16
- data/lib/fin/models/money_limit.rb +29 -58
- data/lib/fin/models/order.rb +51 -26
- data/lib/fin/models/position.rb +13 -36
- data/lib/fin/models/quote.rb +40 -0
- data/lib/fin/quote_list.rb +17 -0
- data/lib/version.rb +1 -1
- data/spec/fin/book_spec.rb +17 -17
- data/spec/fin/deal_list_spec.rb +3 -3
- data/spec/fin/models/deal_spec.rb +49 -117
- data/spec/fin/models/instrument_spec.rb +32 -34
- data/spec/fin/models/model_spec.rb +215 -75
- data/spec/fin/models/money_limit_spec.rb +48 -119
- data/spec/fin/models/order_spec.rb +29 -48
- data/spec/fin/models/position_spec.rb +34 -55
- data/spec/fin/models/quote_spec.rb +73 -0
- data/spec/fin/models/shared_examples.rb +84 -3
- data/spec/fin/order_list_spec.rb +12 -12
- data/spec/fin/shared_examples.rb +1 -1
- data/tasks/common.rake +2 -2
- data/tasks/spec.rake +1 -1
- data/tasks/version.rake +7 -7
- metadata +6 -3
- data/lib/fin/order_list.rb +0 -17
data/tasks/version.rake
CHANGED
@@ -35,7 +35,7 @@ class Version
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def write(desc = nil)
|
38
|
-
CLASS_NAME::VERSION_FILE.open('w') {|file| file.puts to_s }
|
38
|
+
CLASS_NAME::VERSION_FILE.open('w') { |file| file.puts to_s }
|
39
39
|
(BASE_PATH + 'HISTORY').open('a') do |file|
|
40
40
|
file.puts "\n== #{to_s} / #{Time.now.strftime '%Y-%m-%d'}\n"
|
41
41
|
file.puts "\n* #{desc}\n" if desc
|
@@ -51,17 +51,17 @@ desc 'Set version: [x.y.z] - explicitly, [1/10/100] - bump major/minor/patch, [.
|
|
51
51
|
task :version, [:command, :desc] do |t, args|
|
52
52
|
version = Version.new(CLASS_NAME::VERSION)
|
53
53
|
case args.command
|
54
|
-
when /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/
|
54
|
+
when /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/ # Set version explicitly
|
55
55
|
version.update($1, $2, $3, $4)
|
56
|
-
when /^\.(.*?)$/
|
56
|
+
when /^\.(.*?)$/ # Set build
|
57
57
|
version.build = $1
|
58
|
-
when /^(\d{1})$/
|
58
|
+
when /^(\d{1})$/ # Bump patch
|
59
59
|
version.bump_patch $1
|
60
|
-
when /^(\d{1})0$/
|
60
|
+
when /^(\d{1})0$/ # Bump minor
|
61
61
|
version.bump_minor $1
|
62
|
-
when /^(\d{1})00$/
|
62
|
+
when /^(\d{1})00$/ # Bump major
|
63
63
|
version.bump_major $1
|
64
|
-
else
|
64
|
+
else # Unknown command, just display VERSION
|
65
65
|
puts "#{NAME} #{version}"
|
66
66
|
next
|
67
67
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: fin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- arvicco
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-05-08 00:00:00 +04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -69,7 +69,8 @@ files:
|
|
69
69
|
- lib/fin/models/money_limit.rb
|
70
70
|
- lib/fin/models/order.rb
|
71
71
|
- lib/fin/models/position.rb
|
72
|
-
- lib/fin/
|
72
|
+
- lib/fin/models/quote.rb
|
73
|
+
- lib/fin/quote_list.rb
|
73
74
|
- lib/fin.rb
|
74
75
|
- lib/legacy.rb
|
75
76
|
- lib/version.rb
|
@@ -84,6 +85,7 @@ files:
|
|
84
85
|
- spec/fin/models/money_limit_spec.rb
|
85
86
|
- spec/fin/models/order_spec.rb
|
86
87
|
- spec/fin/models/position_spec.rb
|
88
|
+
- spec/fin/models/quote_spec.rb
|
87
89
|
- spec/fin/models/shared_examples.rb
|
88
90
|
- spec/fin/order_list_spec.rb
|
89
91
|
- spec/fin/shared_examples.rb
|
@@ -149,6 +151,7 @@ test_files:
|
|
149
151
|
- spec/fin/models/money_limit_spec.rb
|
150
152
|
- spec/fin/models/order_spec.rb
|
151
153
|
- spec/fin/models/position_spec.rb
|
154
|
+
- spec/fin/models/quote_spec.rb
|
152
155
|
- spec/fin/models/shared_examples.rb
|
153
156
|
- spec/fin/order_list_spec.rb
|
154
157
|
- spec/fin/shared_examples.rb
|
data/lib/fin/order_list.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'fin/models/order'
|
2
|
-
require 'fin/book_manager'
|
3
|
-
|
4
|
-
module Fin
|
5
|
-
# Represents list of ALL Orders, indexed by id (replId)
|
6
|
-
# Its @books is a set of OrderBooks by isin. Each OrderBook lists Orders by price.
|
7
|
-
class OrderList < ContainerList
|
8
|
-
|
9
|
-
include BookManager
|
10
|
-
|
11
|
-
def initialize
|
12
|
-
super :item_type => Fin::Order
|
13
|
-
@book_index = proc { |item| item.price }
|
14
|
-
@book_condition = proc { |item| item.price > 0 }
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|