meiou 0.1.8 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a05e3f64df21c58543921438076e8c92e88f68664c015d0d9e41f41c57b8e3f5
4
- data.tar.gz: 9101e1f410c11c4469537a364a034d40c414bb0ca99b070c800b5b7bcbfe9d5f
3
+ metadata.gz: 71b0a38f33da63854964273e98ed536b508551e2a0cf1d0cfc71fba8b01a3510
4
+ data.tar.gz: fe10713642e986101c80c3e8fe51358153d740d7c914704f4d8e55f1c1cfc9cf
5
5
  SHA512:
6
- metadata.gz: e9dea2101cd9275e8859375de05667d687a64b27decf9d045c0a80de836989a7913562ff1a8ac8d7f2786b4d9a59ed49d78ab3ec4dd94a7e5e4b034b55271f05
7
- data.tar.gz: 1cef052922ec47d8a45025bbe2394af350e40e76c4783753edd2c14bb2a3cdef151c4ac0c30f87dc91de44a7a25fd9dcdc466ca55642e59dc05c6c35894fe0ff
6
+ metadata.gz: 39463935d64f4aeae7471a6e564aea40944391b69c329fe8410259522c08c6df701f2235b07340679d667d253e3653c0ad902c70955d09c1d6df21f7946c6af1
7
+ data.tar.gz: f07dea2c243c30d078d61e71b91856d238cde8dbd1febd6feeaffa67a55499a4090ddf6dfceb60d1f04ba86f15e08910c671b87ae4da24d1289d68be6c1f5c94
@@ -38,9 +38,9 @@ module ASTRO
38
38
 
39
39
  @@ASTRO.categories.each { |e| @@C[e] }
40
40
 
41
- def self.zodiac
42
- [ :cancer,:leo,:capricorn,:gemini,:aquarius,:libra,:taurus,:aries,:pisces ]
43
- end
41
+ # def self.zodiac
42
+ # [ :cancer,:leo,:capricorn,:gemini,:aquarius,:libra,:taurus,:aries,:pisces ]
43
+ # end
44
44
  def self.movements
45
45
  [ :rising, :falling, 'at rest' ]
46
46
  end
@@ -62,10 +62,117 @@ module ASTRO
62
62
 
63
63
  end
64
64
 
65
+ module ZODIAC
66
+
67
+ def self.[] k
68
+ d = Meiou.date(k)
69
+ month = d.month
70
+ day = d.day
71
+
72
+ if month == 12
73
+ if day < 22
74
+ astro_sign = "Sagittarius";
75
+ else
76
+ astro_sign ="capricorn";
77
+ end
78
+
79
+ elsif month == 1
80
+ if day < 20
81
+ astro_sign = "Capricorn";
82
+ else
83
+ astro_sign = "aquarius";
84
+ end
85
+
86
+ elsif month == 2
87
+ if day < 19
88
+ astro_sign = "Aquarius";
89
+ else
90
+ astro_sign = "pisces";
91
+ end
92
+
93
+ elsif month == 3
94
+ if day < 21
95
+ astro_sign = "Pisces";
96
+ else
97
+ astro_sign = "aries";
98
+ end
99
+
100
+ elsif month == 4
101
+ if day < 20
102
+ astro_sign = "Aries";
103
+ else
104
+ astro_sign = "taurus";
105
+ end
106
+
107
+ elsif month == 5
108
+ if day < 21
109
+ astro_sign = "Taurus";
110
+ else
111
+ astro_sign = "gemini";
112
+ end
113
+
114
+ elsif month == 6
115
+ if day < 21
116
+ astro_sign = "Gemini";
117
+ else
118
+ astro_sign = "cancer";
119
+ end
120
+
121
+ elsif month == 7
122
+ if day < 23
123
+ astro_sign = "Cancer";
124
+ else
125
+ astro_sign = "leo";
126
+ end
127
+
128
+ elsif month == 8
129
+ if day < 23
130
+ astro_sign = "Leo";
131
+ else
132
+ astro_sign = "virgo";
133
+ end
134
+
135
+ elsif month == 9
136
+ if day < 23
137
+ astro_sign = "Virgo";
138
+ else
139
+ astro_sign = "libra";
140
+ end
141
+
142
+ elsif month == 10
143
+ if day < 23
144
+ astro_sign = "Libra";
145
+ else
146
+ astro_sign = "scorpio";
147
+ end
148
+
149
+ elsif month == 11
150
+ if day < 22
151
+ astro_sign = "scorpio";
152
+ else
153
+ astro_sign = "sagittarius";
154
+ end
155
+ end
156
+ return { sign: astro_sign, wiki: WIKIPEDIA["#{astro_sign.capitalize} (astrology)"] }
157
+ end
158
+
159
+ end
160
+
65
161
  module Meiou
66
162
  def self.astronomy
67
163
  ASTRO
68
164
  end
165
+
166
+ @@Z = Hash.new { |h,k| h[k] = ZODIAC[k] }
167
+
168
+ def self.zodiac
169
+ @@Z
170
+ end
171
+
172
+ def self.date k
173
+ m = /(?<date>(?<year>\d+)\/(?<month>\d+)\/(?<day>\d+))(?<time> (?<hour>\d+):(?<minute>\d+))?/.match(k)
174
+ DateTime.new(m[:year].to_i,m[:month].to_i,m[:day].to_i,m[:hour].to_i || 0,m[:minute].to_i || 0,0).to_time
175
+ end
69
176
  end
70
177
 
71
178
  Meiou.init(:astro) { |h| ASTRO.init! }
data/lib/meiou/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Meiou
4
- VERSION = "0.1.8"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meiou
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Olson
@@ -135,31 +135,6 @@ files:
135
135
  - LICENSE.txt
136
136
  - README.md
137
137
  - Rakefile
138
- - _books/Anarchism.txt
139
- - _books/Applied_Psychology_for_Nurses.txt
140
- - _books/Common_Sense.txt
141
- - _books/Considerations_on_Representative_Government.txt
142
- - _books/Crystallizing_Public_Opinion.txt
143
- - _books/Doctor_and_Patient.txt
144
- - _books/Increasing_Human_Efficiency_in_Business.txt
145
- - _books/Marriage_and_Love.txt
146
- - _books/Mutual_Aid.txt
147
- - _books/Natural_Faculties.txt
148
- - _books/Other_People's_Money.txt
149
- - _books/Philosophy_of_Misery.txt
150
- - _books/Playwrights_on_Playmaking.txt
151
- - _books/Principles_of_Scientific_Management.txt
152
- - _books/Psychology_of_Management.txt
153
- - _books/Psychopathology_of_Everyday_Life.txt
154
- - _books/Roman_Farm_Management.txt
155
- - _books/Sexual_Neuroses.txt
156
- - _books/Social_Organization.txt
157
- - _books/Three_Contributions_to_the_Theory_of_Sex.txt
158
- - _books/interpretation_of_dreams.txt
159
- - _books/principals_of_political_economy.txt
160
- - _books/the_Social_Contract.txt
161
- - _books/the_individual_in_society.txt
162
- - _books/the_prince.txt
163
138
  - books/Anarchism.txt
164
139
  - books/Applied_Psychology_for_Nurses.txt
165
140
  - books/Crystallizing_Public_Opinion.txt