asanghi-fiscali 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.6
1
+ 1.2.1
data/fiscali.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{fiscali}
5
- s.version = "1.2.0"
5
+ s.version = "1.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Aditya Sanghi"]
@@ -29,6 +29,10 @@ module RisingSun
29
29
  write_inheritable_attribute(:zone, nil)
30
30
  write_inheritable_attribute(:start_month,month)
31
31
  end
32
+
33
+ def financial_year_start(year=Date.today.year)
34
+ Date.new(year,fy_start_month,1)
35
+ end
32
36
  end
33
37
 
34
38
  module InstanceMethods
data/test/fiscali_test.rb CHANGED
@@ -9,6 +9,10 @@ class FiscaliTest < ActiveSupport::TestCase
9
9
  assert_equal(Date.fy_start_month,2)
10
10
 
11
11
  Date.fiscal_zone = :india
12
+
13
+ d = Date.financial_year_start(2009)
14
+ assert_equal(d,Date.new(2009,4,1),'Financial Year start not correct')
15
+
12
16
  d = Date.new(2009,1,1)
13
17
  assert_equal(d.financial_year,2008,'Financial Year is not correct')
14
18
  assert_equal(d.beginning_of_financial_year,Date.new(2008,4,1),'Beginning of FY is not correct')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asanghi-fiscali
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aditya Sanghi