hijri 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b39edec389003c4f6316089abb8d05064dc358e0
4
- data.tar.gz: a5b1e9d6c3befcf5c844d45e16a84ba05c0882e5
3
+ metadata.gz: e6c03b308b3dc9f76fe9c48033d795dfa43735ef
4
+ data.tar.gz: cb39d5115d8ab13f2f3d2a5f2751461e544cccb7
5
5
  SHA512:
6
- metadata.gz: 84c845014dfa450e82fe2e249577bf22a15f1a115c38a64591149fda133bdee8d13bd773d7c5b9ad957129d07b330978e16a4852748abc6a06d7dd5c444f3eb0
7
- data.tar.gz: 87df415c8902d0c828ba5f5afb78d41c28b19eaeb27e097489ddb0776d86cac1f8816ef2a1d49b5a03f649a856f14e0fe95fb49141bd3bd3f2d43d76a33ac9ea
6
+ metadata.gz: 2ddcb00c583ae8a0c083d5e638d2ed33f77d6aa825d706f58b16b1796b314257a5b50fdaf665eab56884c4765da5b8b7d1804f4d5aa621181706f2231575b82a
7
+ data.tar.gz: ba9cac95f86778db5c9049be96a221e4a4d1a6231016e6ccf3567d42385fbb498147a3fd5c1237982687a35508929adba7af904aefeda4963cc6b69b1ae4c18c
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.8.7"
4
+ - "1.9.2"
5
+ - "1.9.3"
6
+ - "2.0.0"
7
+ - "2.1.1"
8
+ - jruby-18mode # JRuby in 1.8 mode
9
+ - jruby-19mode # JRuby in 1.9 mode
10
+ - rbx
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.2.0 / 2014-12-09
2
+
3
+ * hijri now tested and run in all major Ruby implementations and versions.
4
+
1
5
  === 0.1.0 / 2014-12-09
2
6
 
3
7
  * Add Hijri::DateTime class.
data/Gemfile CHANGED
@@ -1,3 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ if RUBY_VERSION < '1.8.8'
6
+ gem 'minitest'
7
+ end
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Hijri
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/hijri.svg)](http://badge.fury.io/rb/hijri)
4
+ [![Build Status](https://travis-ci.org/ecleel/hijri.svg?branch=master)](https://travis-ci.org/ecleel/hijri)
5
+
3
6
  #####Hijri Date library for Ruby.
4
7
  hijri is full Islamic Hijri calendar lib for ruby. The way it work is to convert Gregorian date to absolute date then convert it to Hijri date.
5
8
  ### Hijri Calendar (from Wikipedia)
@@ -23,21 +26,33 @@ Or install it yourself as:
23
26
 
24
27
  $ gem install hijri
25
28
 
29
+ ###hijri tested and worked in:
30
+ - Ruby MRI:
31
+ - "1.8.7"
32
+ - "1.9.2"
33
+ - "1.9.3"
34
+ - "2.0.0"
35
+ - "2.1.1"
36
+ - JRuby 1.7.16.1
37
+ - jruby-18mode
38
+ - jruby-19mode
39
+ - Rubinius 2.4.1
40
+
26
41
  ## Usage
27
42
 
28
43
  ```ruby
29
44
  require 'hijri'
30
45
 
31
46
  # you can create hijri date from stdlib Date class.
32
- h = Date.today.to_hijri
47
+ h = Date.today.to_hijri # => #<Hijri::Date:0x007f875e8c84e8 @year=1436, @month=2, @day=16>
33
48
  # or you can initialize new one.
34
- hijri = Hijri::Date.new 1430, 1, 3
49
+ hijri = Hijri::Date.new 1430, 1, 3 # => #<Hijri::Date:0x007f875e8dbb38 @year=1430, @month=1, @day=3>
35
50
  # or you get today hijri date directly.
36
- toady = Hijri::Date.today
51
+ toady = Hijri::Date.today # => #<Hijri::Date:0x007f875e8d8410 @year=1436, @month=2, @day=16>
37
52
  # and you can convert hijri date to greogian date.
38
- hijri.to_greo
53
+ hijri.to_greo # => #<Date: 2009-01-01 ((2454833j,0s,0n),+0s,2299161j)>
39
54
  # and there is DateTime too
40
- date_and_time = Hijri::DateTime.now
55
+ date_and_time = Hijri::DateTime.now # => #<Hijri::DateTime:0x007f875e8eac00 @year=1436, @month=2, @day=16, @hour=14, @minute=14, @second=39, @zone="+03:00">
41
56
  ```
42
57
 
43
58
 
data/Rakefile CHANGED
@@ -14,3 +14,5 @@ end
14
14
  require 'yard'
15
15
  YARD::Rake::YardocTask.new
16
16
  task :doc => :yard
17
+
18
+ task :default => 'test'
@@ -1,3 +1,5 @@
1
+ require 'date'
2
+
1
3
  module Hijri
2
4
  ISLAMIC_EPOCH = 227014
3
5
  end
@@ -27,7 +27,7 @@ module Hijri
27
27
  def now
28
28
  datetime = ::DateTime.now
29
29
  hijri = datetime.to_hijri
30
- hijri.change hour: datetime.hour, minute: datetime.minute, second: datetime.second
30
+ hijri.change :hour => datetime.hour, :minute => datetime.minute, :second => datetime.second
31
31
  hijri
32
32
  end
33
33
  end
@@ -25,4 +25,10 @@ class DateTime
25
25
  def to_hijri
26
26
  Hijri::DateTime.new *Hijri::Converter.greo_to_hijri(self)
27
27
  end
28
+
29
+ if RUBY_VERSION < '1.8.8'
30
+ alias :minute :min
31
+ alias :second :sec
32
+ end
33
+
28
34
  end
@@ -1,3 +1,3 @@
1
1
  module Hijri
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -16,6 +16,10 @@ rescue Bundler::BundlerError => e
16
16
  exit e.status_code
17
17
  end
18
18
 
19
+ if RUBY_VERSION < '1.8.8'
20
+ require 'minitest/autorun'
21
+ end
22
+
19
23
  require 'minitest/unit'
20
24
 
21
25
  class MiniTest::Unit::TestCase
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hijri
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdulaziz AlShetwi
@@ -60,6 +60,7 @@ extra_rdoc_files: []
60
60
  files:
61
61
  - ".document"
62
62
  - ".gitignore"
63
+ - ".travis.yml"
63
64
  - ".yardopts"
64
65
  - CHANGELOG
65
66
  - Gemfile