horoscope 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ repo_token: ZLzc8t6n6gcdnQrIjxWcECewCBBQl8AmF
2
+ service_name: travis-ci
data/Gemfile CHANGED
@@ -7,4 +7,6 @@ gem 'rmagick'
7
7
 
8
8
  group :development, :test do
9
9
  gem 'rake'
10
- end
10
+ end
11
+
12
+ gem 'coveralls', require: false
data/README.md CHANGED
@@ -4,6 +4,8 @@ Calculate the accurate horoscope of a person using Vedic Horoscope technique giv
4
4
 
5
5
  [![Travis CI ](https://api.travis-ci.org/bragboy/horoscope.png) ](https://travis-ci.org/bragboy/horoscope)
6
6
  [![Code Climate](https://codeclimate.com/github/bragboy/horoscope.png)](https://codeclimate.com/github/bragboy/horoscope)
7
+ [![Gemnasium ](https://gemnasium.com/bragboy/horoscope.png) ](https://gemnasium.com/bragboy/horoscope)
8
+ [![Coveralls ](https://coveralls.io/repos/bragboy/horoscope/badge.png)](https://coveralls.io/r/bragboy/horoscope)
7
9
 
8
10
  ## Installation
9
11
 
@@ -30,6 +32,8 @@ Then you can start using this by passing a Time object along with latitude and l
30
32
  => {"As"=>4, "Su"=>0, "Mo"=>8, "Ma"=>9, "Me"=>11, "Ju"=>9, "Ve"=>0, "Sa"=>1, "Ra"=>8, "Ke"=>2}
31
33
 
32
34
  h.create_chart #This will generate the horoscope chart to your working directory
35
+
36
+ ![Sachin Tendulkar's horoscope](http://i.imgur.com/theTdBg.png)
33
37
 
34
38
  ## Contributing
35
39
 
@@ -42,4 +46,4 @@ Then you can start using this by passing a Time object along with latitude and l
42
46
 
43
47
  ## Future Development
44
48
 
45
- I am currently adding features to generate charts (both South and North Indian). Also show more data like Birth Star, Dasha Directions etc., Follow this page for more updates
49
+ Need to add North Indian Chart type. Also show more data like Birth Star, Dasha Directions etc., Follow this page for more updates
@@ -14,6 +14,8 @@ module Horoscope
14
14
  YBIAS = 15
15
15
  PADDING = 15
16
16
 
17
+ CENTER_PADDING = 40
18
+
17
19
  ERRORS = {
18
20
  :Date => "Error: Invalid Date. Enter a valid date between years 1600 AD and 2300 AD",
19
21
  :Zone => "Error: Please pass a valid time zone ranging from -12.0 to +12.0",
@@ -95,6 +97,14 @@ module Horoscope
95
97
  end
96
98
  end
97
99
  end
100
+
101
+ text.gravity = Magick::CenterGravity
102
+ text.pointsize = 18
103
+ text.fill = 'black'
104
+ text.annotate(canvas, 0, 0, 0, -CENTER_PADDING, @datetime.strftime('%d %b %Y'))
105
+ text.annotate(canvas, 0, 0, 0, 0, @datetime.strftime('%I:%M %p'))
106
+ text.annotate(canvas, 0, 0, 0, CENTER_PADDING, "Lat: #{@lat.round(1)}, Lon: #{@lon.round(1)}")
107
+
98
108
  x = canvas.write('output.png')
99
109
  end
100
110
 
@@ -1,21 +1,5 @@
1
1
  # Equivalent Java methods overriden for Ruby
2
2
  module Math
3
- def self.IEEEremainder(x, y)
4
- begin
5
- regularMod = Math.java_mod(x,y) #DO NOT use Ruby Mod operator here as -1%13 yields different results for Java and Ruby
6
- return 0.0 if (regularMod == 0)
7
- alternativeResult = regularMod - (y.abs * Math.signum(x))
8
- if alternativeResult.abs == regularMod.abs
9
- divisionResult = x/y
10
- roundedResult = divisionResult.round
11
- return roundedResult.abs > divisionResult.abs ? alternativeResult : regularMod
12
- end
13
- return alternativeResult.abs < regularMod.abs ? alternativeResult : regularMod
14
- rescue ZeroDivisionError
15
- return 0.0/0.0 #NaN
16
- end
17
- end
18
-
19
3
  def self.toRadians(angdeg)
20
4
  angdeg / 180.0 * Math::PI
21
5
  end
@@ -24,10 +8,6 @@ module Math
24
8
  angrad * 180.0 / Math::PI
25
9
  end
26
10
 
27
- def self.signum(num)
28
- num > 0 ? 1 : (num == 0? 0 : -1)
29
- end
30
-
31
11
  def self.java_mod(x,y)
32
12
  return 0 if x == 0 && y != 0
33
13
  return x%y if (x > 0 && y > 0) || (x<0 && y<0)
@@ -1,3 +1,3 @@
1
1
  module Horoscope
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -69,7 +69,7 @@ describe Horoscope do
69
69
  end
70
70
 
71
71
  it "can generate chart" do
72
- h = Horoscope::Horo.new(:datetime => Time.mktime(1973, 4, 24, 14, 25).getlocal("+05:30"), :lat => 18.60, :lon => -72.50)
72
+ h = Horoscope::Horo.new(:datetime => Time.utc(1973, 4, 24, 14, 25), :zone => 5.5, :lat => 18.60, :lon => -72.50)
73
73
  h.compute
74
74
  h.create_chart
75
75
  expect(File).to exist("output.png")
@@ -1 +1,3 @@
1
- require 'horoscope'
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+ require 'horoscope'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: horoscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -66,6 +66,7 @@ executables: []
66
66
  extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
+ - .coveralls.yml
69
70
  - .gitignore
70
71
  - .rspec
71
72
  - .travis.yml