jalalidate 0.3.2 → 0.3.3

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1c097cf5e328c8380b18584ec04d7ac780248a00
4
+ data.tar.gz: 064323d76a56fd571027d1f8b109255da5995425
5
+ SHA512:
6
+ metadata.gz: 3550c83d0e8983ba941610277619390db58a2d316c47411bccc277423b4e1ee686dbb5a33ba641a5f174486073b0668661ea8b02e1fcfbc6c22137bda0f3c81b
7
+ data.tar.gz: 20f6931d20fbcfd6e42123a6b8ea24844894ef42dee18874977925d6bb1501a0e60270bd7d911d86adc6e1d0d8153b8cf283442f135faed2fb9ca97478bc0158
data/README.md CHANGED
@@ -5,6 +5,9 @@
5
5
 
6
6
  ## History
7
7
 
8
+ #### 0.3.3 - 17.SEP.2013
9
+ * added %n formatter for numeric representation of a month, with leading zeros, courtesy of [Mohsen Alizadeh](https://github.com/m0h3n)
10
+
8
11
  #### 0.3.2 - 8.APR.2013
9
12
  * Making JalaliDate class thread safe, courtesy of [Jahangir Zinedine](https://github.com/jzinedine)
10
13
 
@@ -1,3 +1,3 @@
1
1
  module Jalalidate
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
data/lib/jalalidate.rb CHANGED
@@ -232,6 +232,7 @@ class JalaliDate
232
232
  # [%e] Day of the month (1..31)
233
233
  # [%j] Day of the year (1..366)
234
234
  # [%m] Month of the year (1..12)
235
+ # [%n] Month of the year (01..12)
235
236
  # [%w] Day of the week (Sunday is 0, 0..6)
236
237
  # [%x] Preferred representation for the date alone, no time in format YY/M/D
237
238
  # [%y] Year without a century (00..99)
@@ -257,6 +258,7 @@ class JalaliDate
257
258
  gsub(/%d/, ("%02d" % @day).to_s).
258
259
  gsub(/%e/, @day.to_s).
259
260
  gsub(/%m/, @month.to_s).
261
+ gsub(/%n/, ("%02d" % @month).to_s).
260
262
  gsub(/%Y/, @year.to_s).
261
263
  gsub(/%y/, @year.to_s.slice(2,2)).
262
264
  gsub(/%j/, yday.to_s).
@@ -358,4 +360,4 @@ class JalaliDate
358
360
  [gy,gm,gd]
359
361
  end
360
362
 
361
- end
363
+ end
@@ -140,8 +140,10 @@ describe JalaliDate do
140
140
  JalaliDate.new(1388,2,15,15,50,10).strftime("%X").should === "15:50:10"
141
141
  JalaliDate.new(1388,2,15,15,50,10).strftime("%X").should === "15:50:10"
142
142
  JalaliDate.new(1388,2,15,15,50,10,"CET",3600).strftime("%Z").should === "CET"
143
+ JalaliDate.new(1388,2,2,5,50,10).strftime("%n").should === "02"
144
+ JalaliDate.new(1388,2,2,5,50,10).strftime("%m").should === "2"
143
145
  time = Time.now
144
146
  JalaliDate.new(time).strftime("%Z").should == time.zone
145
147
  end
146
148
 
147
- end
149
+ end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jalalidate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
5
- prerelease:
4
+ version: 0.3.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Allen A. Bargi
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-08 00:00:00.000000000 Z
11
+ date: 2013-09-17 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: bundler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -70,28 +65,27 @@ files:
70
65
  - spec/spec_helper.rb
71
66
  homepage: http://github.com/aziz/jalalidate
72
67
  licenses: []
68
+ metadata: {}
73
69
  post_install_message:
74
70
  rdoc_options:
75
71
  - --charset=UTF-8
76
72
  require_paths:
77
73
  - lib
78
74
  required_ruby_version: !ruby/object:Gem::Requirement
79
- none: false
80
75
  requirements:
81
- - - ! '>='
76
+ - - '>='
82
77
  - !ruby/object:Gem::Version
83
78
  version: '0'
84
79
  required_rubygems_version: !ruby/object:Gem::Requirement
85
- none: false
86
80
  requirements:
87
- - - ! '>='
81
+ - - '>='
88
82
  - !ruby/object:Gem::Version
89
83
  version: '0'
90
84
  requirements: []
91
85
  rubyforge_project: jalalidate
92
- rubygems_version: 1.8.25
86
+ rubygems_version: 2.0.6
93
87
  signing_key:
94
- specification_version: 3
88
+ specification_version: 4
95
89
  summary: A library for working with Jalali Calendar (a.k.a Persian Calendar)
96
90
  test_files:
97
91
  - spec/jalalidate_spec.rb