fiscali 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,21 +11,21 @@ module RisingSun
11
11
  module ClassMethods
12
12
 
13
13
  def fiscal_zone=(zone)
14
- Thread.current[:fiscali_start_month] = FISCAL_ZONE[zone] || FY_START_MONTH
15
- Thread.current[:fiscali_zone] = zone
14
+ @fiscali_start_month = FISCAL_ZONE[zone] || FY_START_MONTH
15
+ @fiscali_zone = zone
16
16
  end
17
17
 
18
18
  def fy_start_month
19
- Thread.current[:fiscali_start_month] || FY_START_MONTH
19
+ @fiscali_start_month || FY_START_MONTH
20
20
  end
21
21
 
22
22
  def fiscal_zone
23
- Thread.current[:fiscali_zone]
23
+ @fiscali_zone
24
24
  end
25
25
 
26
26
  def fy_start_month=(month)
27
- Thread.current[:fiscali_zone] = nil
28
- Thread.current[:fiscali_start_month] = month
27
+ @fiscali_zone = nil
28
+ @fiscali_start_month = month
29
29
  end
30
30
 
31
31
  def financial_year_start(year=Date.today.year)
@@ -1,5 +1,5 @@
1
1
  module RisingSun
2
2
  module Fiscali
3
- VERSION = "2.0.0"
3
+ VERSION = "2.1.0"
4
4
  end
5
- end
5
+ end
data/spec/fiscali_spec.rb CHANGED
@@ -87,4 +87,11 @@ describe "fiscali" do
87
87
 
88
88
  end
89
89
 
90
+ it "should not rely on app being single threaded" do
91
+ Date.fiscal_zone = :india
92
+ thread = Thread.new { Thread.current["my_fiscal_zone"] = Date.fiscal_zone }
93
+ thread.join
94
+ thread["my_fiscal_zone"].should == :india
95
+ end
96
+
90
97
  end
metadata CHANGED
@@ -1,75 +1,71 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: fiscali
3
- version: !ruby/object:Gem::Version
4
- hash: 15
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.0
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 0
9
- - 0
10
- version: 2.0.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Aditya Sanghi
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-02-15 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-07-16 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: activesupport
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
32
22
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: rake
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
38
25
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
46
38
  type: :development
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: rspec
50
39
  prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
52
41
  none: false
53
- requirements:
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rspec
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
54
51
  - - ~>
55
- - !ruby/object:Gem::Version
56
- hash: 19
57
- segments:
58
- - 2
59
- - 8
60
- version: "2.8"
52
+ - !ruby/object:Gem::Version
53
+ version: '2.8'
61
54
  type: :development
62
- version_requirements: *id003
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.8'
63
62
  description: Fiscal Year Date Functions
64
- email:
63
+ email:
65
64
  - asanghi@me.com
66
65
  executables: []
67
-
68
66
  extensions: []
69
-
70
67
  extra_rdoc_files: []
71
-
72
- files:
68
+ files:
73
69
  - .document
74
70
  - .gitignore
75
71
  - .travis.yml
@@ -86,38 +82,28 @@ files:
86
82
  - spec/spec_helper.rb
87
83
  homepage: https://github.com/asanghi/fiscali
88
84
  licenses: []
89
-
90
85
  post_install_message:
91
86
  rdoc_options: []
92
-
93
- require_paths:
87
+ require_paths:
94
88
  - lib
95
- required_ruby_version: !ruby/object:Gem::Requirement
89
+ required_ruby_version: !ruby/object:Gem::Requirement
96
90
  none: false
97
- requirements:
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- hash: 3
101
- segments:
102
- - 0
103
- version: "0"
104
- required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
96
  none: false
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- hash: 3
110
- segments:
111
- - 0
112
- version: "0"
97
+ requirements:
98
+ - - ! '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
113
101
  requirements: []
114
-
115
102
  rubyforge_project:
116
- rubygems_version: 1.8.11
103
+ rubygems_version: 1.8.21
117
104
  signing_key:
118
105
  specification_version: 3
119
106
  summary: Fiscal Year Date Functions
120
- test_files:
107
+ test_files:
121
108
  - spec/fiscali_spec.rb
122
109
  - spec/spec_helper.rb
123
- has_rdoc: