lightning-source 1.1 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/lightning-source.rb +10 -5
- metadata +2 -2
data/lib/lightning-source.rb
CHANGED
@@ -5,7 +5,7 @@ class LightningSource
|
|
5
5
|
|
6
6
|
exceptions.each { |e| const_set(e+"Error", Class.new(StandardError)) }
|
7
7
|
|
8
|
-
VERSION = "1.
|
8
|
+
VERSION = "1.2"
|
9
9
|
attr_accessor :agent
|
10
10
|
|
11
11
|
def initialize(login, password)
|
@@ -25,14 +25,19 @@ class LightningSource
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def compensation(options = {})
|
28
|
-
|
29
|
-
|
28
|
+
markets = { "US" => { :ou => 0, :currency => 3 },
|
29
|
+
"UK" => { :ou => 1, :currency => 1 },
|
30
|
+
"AU" => { :ou => 2, :currency => 0 } }
|
31
|
+
if (!markets.has_key?(options[:market]))
|
32
|
+
throw "Unknown market "+options[:market]+" (:market should be "+markets.keys.join("/")+")"
|
33
|
+
end
|
34
|
+
market = markets[options[:market]]
|
30
35
|
page = @agent.get("https://www.lightningsource.com/LSISecure/FinancialReports/PubCompReportCriteria.aspx")
|
31
36
|
f = page.form
|
32
37
|
f.field_with(:name => /txtDate1/).value = options[:first].strftime("%d-%b-%y")
|
33
38
|
f.field_with(:name => /txtDate2/).value = options[:last].strftime("%d-%b-%y")
|
34
|
-
f.checkbox_with(:name => Regexp.new("optOrgID:"+market.to_s)).check
|
35
|
-
f.checkbox_with(:name => Regexp.new("optCurrency:"+currency.to_s)).check
|
39
|
+
f.checkbox_with(:name => Regexp.new("optOrgID:"+market[:ou].to_s)).check
|
40
|
+
f.checkbox_with(:name => Regexp.new("optCurrency:"+market[:currency].to_s)).check
|
36
41
|
f.checkbox_with(:name => /optCompensationType:0/).check
|
37
42
|
report = agent.submit(f, f.buttons.first)
|
38
43
|
# Do some checks here
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lightning-source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.2'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-03-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|