finexclub 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/finexclub.gemspec +2 -2
- data/lib/finexclub/document.rb +11 -0
- data/lib/finexclub/signals/octopus.rb +1 -1
- data/lib/finexclub/signals/prognosis.rb +1 -1
- data/spec/finexclub/document_spec.rb +17 -0
- data/spec/finexclub/octopus_spec.rb +1 -1
- data/spec/finexclub/prognosis_spec.rb +1 -1
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/finexclub.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{finexclub}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alex Levin"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-09}
|
13
13
|
s.default_executable = %q{finexclub_updater}
|
14
14
|
s.description = %q{Finexclub gem stores and retrieves Forex signals and screenshots. It is the heart of the http://trendsonforex.com and http://finexclub.net}
|
15
15
|
s.email = %q{clubfinex@gmail.com}
|
data/lib/finexclub/document.rb
CHANGED
@@ -59,6 +59,17 @@ module Finexclub
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
+
def define_trade_action_fields(name)
|
63
|
+
define_attr_reader(name)
|
64
|
+
define_attr_writer(name, lambda{|x| x.to_s})
|
65
|
+
|
66
|
+
%w(buy sell hold_buy hold_sell stop).each do |action|
|
67
|
+
define_method "#{name}_#{action}?" do
|
68
|
+
send("#{name}") == action
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
62
73
|
def define_image_fields(name)
|
63
74
|
define_attr_reader(name)
|
64
75
|
define_attr_writer(name)
|
@@ -178,6 +178,23 @@ describe 'Finexclub::Document' do
|
|
178
178
|
end
|
179
179
|
end
|
180
180
|
|
181
|
+
# buy, sell, hold_buy, hold_sell, stop
|
182
|
+
describe 'trade_action field' do
|
183
|
+
before do
|
184
|
+
@object.apply_meta(:action => :trade_action)
|
185
|
+
end
|
186
|
+
|
187
|
+
%w(buy sell hold_buy hold_sell stop).each do |action|
|
188
|
+
it "should respond to action_#{action}? methods" do
|
189
|
+
@object.action = action
|
190
|
+
@object.send("action_#{action}?".to_sym).should == true
|
191
|
+
|
192
|
+
@object.action = "no_such_action"
|
193
|
+
@object.send("action_#{action}?".to_sym).should == false
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
181
198
|
describe 'image field' do
|
182
199
|
before do
|
183
200
|
@object.apply_meta({:screenshot => :image})
|
@@ -10,7 +10,7 @@ describe 'Finexclub::Signals::Octopus' do
|
|
10
10
|
Finexclub::Signals::Octopus.meta.should == {
|
11
11
|
:updated => :timestamp,
|
12
12
|
:symbol => :symbol,
|
13
|
-
:action => :
|
13
|
+
:action => :trade_action,
|
14
14
|
:take_profit => :float,
|
15
15
|
:profit => :integer,
|
16
16
|
:stop_loss => :float,
|
@@ -10,7 +10,7 @@ describe 'Finexclub::Signals::Prognosis' do
|
|
10
10
|
Finexclub::Signals::Prognosis.meta.should == {
|
11
11
|
:updated => :timestamp,
|
12
12
|
:symbol => :symbol,
|
13
|
-
:action => :
|
13
|
+
:action => :trade_action,
|
14
14
|
:take_profit => :float,
|
15
15
|
:profit => :integer,
|
16
16
|
:screenshot => :image
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
version: 0.3.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alex Levin
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-11-09 00:00:00 +07:00
|
18
18
|
default_executable: finexclub_updater
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|