active_exchange 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +4 -5
- data/VERSION +1 -1
- data/active_exchange.gemspec +2 -3
- data/lib/active_exchange.rb +1 -1
- metadata +2 -3
- data/tasks/data_migration_exchange_rates.rake +0 -6
data/README.rdoc
CHANGED
@@ -13,12 +13,11 @@ I personally wouldn't use this if my model was, say an F/X trader on a big time
|
|
13
13
|
== Useage
|
14
14
|
|
15
15
|
* add config.gem 'active_exchange' to your environment.rb file
|
16
|
-
*
|
17
|
-
then you will have your migrations in place.
|
16
|
+
* For now: Copy the rake file and migration into your app's (for rake) lib/task directory and (for migration file)db/migrate
|
18
17
|
* Run "rake db:migrate" to migrate the migration files.
|
19
|
-
* Run the rake task : "sudo rake active_exchange:daily_seed" to get
|
18
|
+
* Run the rake task : "sudo rake active_exchange:daily_seed" to get yesterday's closing Exchange Rate data (When doing today's it's hit and miss).
|
20
19
|
|
21
|
-
You can now integrate
|
20
|
+
You can now integrate the data into your app as you see fit.
|
22
21
|
|
23
22
|
== Note on Patches/Pull Requests
|
24
23
|
|
@@ -33,4 +32,4 @@ You can now integrate this into your app as you see fit.
|
|
33
32
|
|
34
33
|
== Copyright
|
35
34
|
|
36
|
-
Copyright (c) 2009
|
35
|
+
Copyright (c) 2009 pjammer. See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/active_exchange.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{active_exchange}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["nerbie69"]
|
12
|
-
s.date = %q{2009-10-
|
12
|
+
s.date = %q{2009-10-27}
|
13
13
|
s.description = %q{Foreign Exchange for your Rails app.}
|
14
14
|
s.email = %q{philipjingram@yahoo.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -28,7 +28,6 @@ Gem::Specification.new do |s|
|
|
28
28
|
"db/migrate/20091021192708_create_exchange_rates.rb",
|
29
29
|
"lib/active_exchange.rb",
|
30
30
|
"tasks/daily_exchange_rates.rake",
|
31
|
-
"tasks/data_migration_exchange_rates.rake",
|
32
31
|
"test/helper.rb",
|
33
32
|
"test/test_active_exchange.rb"
|
34
33
|
]
|
data/lib/active_exchange.rb
CHANGED
@@ -9,7 +9,7 @@ module ActiveExchange
|
|
9
9
|
# The active_exchange gem is used to go out to XavierMedia and pull quotes for the currencies they offer.
|
10
10
|
|
11
11
|
# We'll need to have a task to look for new data and parse it into DB, to cut down calls.
|
12
|
-
def self.retrieve_data(date = Date.today)
|
12
|
+
def self.retrieve_data(date = Date.today - 1)
|
13
13
|
url = URI.parse("http://api.finance.xaviermedia.com/api/#{date.year}/#{date.strftime("%m")}/#{date.strftime("%d")}.xml")
|
14
14
|
resp = Net::HTTP.get(url)
|
15
15
|
xml = REXML::Document.new(resp)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_exchange
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nerbie69
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-27 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -34,7 +34,6 @@ files:
|
|
34
34
|
- db/migrate/20091021192708_create_exchange_rates.rb
|
35
35
|
- lib/active_exchange.rb
|
36
36
|
- tasks/daily_exchange_rates.rake
|
37
|
-
- tasks/data_migration_exchange_rates.rake
|
38
37
|
- test/helper.rb
|
39
38
|
- test/test_active_exchange.rb
|
40
39
|
has_rdoc: true
|