forex_date 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/forex_date.gemspec CHANGED
@@ -14,4 +14,5 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "forex_date"
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = ForexDate::VERSION
17
+ gem.add_dependency('tzinfo')
17
18
  end
@@ -1,3 +1,3 @@
1
1
  module ForexDate
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/forex_date.rb CHANGED
@@ -1,5 +1,14 @@
1
1
  require "forex_date/version"
2
2
 
3
3
  module ForexDate
4
- # Your code goes here...
4
+
5
+ require 'tzinfo'
6
+
7
+ def ForexDate.now
8
+ t = Time.now.in_time_zone("Eastern Time (US & Canada)")
9
+ date = t.date
10
+ date += 1.day if t.hour > 17
11
+ return ( date.wday == 6 || date.wday == 7 ) ? nil : date
12
+ end
13
+
5
14
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forex_date
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Javier Vidal
@@ -16,8 +16,21 @@ bindir: bin
16
16
  cert_chain: []
17
17
 
18
18
  date: 2012-05-25 00:00:00 Z
19
- dependencies: []
20
-
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: tzinfo
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :runtime
33
+ version_requirements: *id001
21
34
  description: Calculate the date of the current forex day
22
35
  email:
23
36
  - javier.vidal@bolsanova.com
@@ -65,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
78
  requirements: []
66
79
 
67
80
  rubyforge_project:
68
- rubygems_version: 1.7.2
81
+ rubygems_version: 1.8.10
69
82
  signing_key:
70
83
  specification_version: 3
71
84
  summary: Calculate the date of the current forex day