wahy 1.3.3 → 1.3.4

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
  SHA1:
3
- metadata.gz: 46e87301d8abd7098864b3addb490d4ecbc582a9
4
- data.tar.gz: 2e6fa82725fbfa4f045a625bfb73f098f87f2e4a
3
+ metadata.gz: 27c561ebad0e8c980fcdf1fc11c7814b43210fb0
4
+ data.tar.gz: 57f62cf6489c8469fcb3237e383f2d535225a2be
5
5
  SHA512:
6
- metadata.gz: c5ea63b25361bdb85e48c94c51d2eda78b69f14505f27e190794dc70141c3d3da749764a313fe64a1aaf1be4c9a32d7bab065df36ec65f28576d0ba37157820d
7
- data.tar.gz: 538df13b1f1de2a06132b05582d01e0952b68327726d56dbf256f2112b70040b26d150c4a47cf8e57addac43616c3a7114a97f9e3c47196891d1fe568c4689b3
6
+ metadata.gz: 7902db0898bbe5085d6d678adb3f24e43e75c6640b18cd753a761c49c4a7570a3aa777b1ffb3d7901d13cf8778736d4da763450863625827e66859b3c89f25f7
7
+ data.tar.gz: a8648eea5c92cd73b328122f4111a8332986c8ec60f84ae12f7d05ec6d685bfb35d5740050ab5a1863a6245265363c047755aae1da59b75446611ebe34dfb9e9
data/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  Welcome to my Wahy gem repo! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/wahy`. To experiment with that code, run `bin/console` for an interactive prompt.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
5
  ## Installation
8
6
 
9
7
  Add this line to your application's Gemfile:
@@ -23,16 +21,17 @@ Or install it yourself as:
23
21
  ## Usage
24
22
 
25
23
  ```shell
26
- Just install gem and use wahy command
24
+ # Just install gem and use wahy command
27
25
  # For help:
28
26
  wahy -h
29
27
 
30
28
  There is the argument's options:
31
- # -l => to pick language ('eng'|'tur') # Default: tur (English)
29
+ # If you want to see English results you don't need to call -l argument (English is default)
30
+ # -l => to pick language ('eng'|'tur') # Default: (English)
32
31
  # -s => to pick scripture (also can use scripture's number) # between 1-114 # Default: 1
33
32
  # -a => to pick sign number (also can use all) # Default: all
34
33
 
35
- # User can call only wahy command then will see all sings of first scripture in Turkish.
34
+ # User can call only wahy command then will see all sings of first scripture in Engish.
36
35
 
37
36
  # The Cow Scripture and its all signs
38
37
  wahy -l 'eng' -s 'The Cow' # alias to: wahy -l 'eng' -s 'The Cow' -a 'all'
@@ -42,12 +41,27 @@ wahy -l 'tur' -s 'The Cow' # alias to: wahy -l 'eng' -s 'The Cow' -a 'all'
42
41
  wahy -l 'eng' -s 'The Cow' -a 2
43
42
  wahy -l 'tur' -s 'The Cow' -a 2
44
43
 
45
- # Gem includes two XML files
44
+ # There is a little terminal trick to save output to a file:
45
+ wahy -l 'eng' -s 'The Cow' > fileName.txt # :)
46
+
47
+ # Also in lib directory : wahy.rb is a executable file
48
+
49
+ # Also you can use that gem as source of your own project
50
+ require 'wahy'
51
+
52
+ data = Wahy.new_data 'tur' # or data = Wahy.new_data 'eng'
53
+ quran = Wahy.chapters_data data
54
+ the_opening = Wahy.scripture_data quran, 'the opening' # a nokogiri object
55
+ signs = Wahy.sign_data the_opening # an array
56
+ sign_one = signs[0] # or sign_one = signs.firsr # it's array
57
+ # OR
58
+ sing_two = Wahy.take_specific_sign signs, 1
59
+
60
+
61
+ # Gem includes two XML data
46
62
  # English Quran Tranlation(eng.xml): Written by Yusuf Ali
47
63
  # Turkish Quran Tranlation(tur.xml): Written by Elmalılı Hamdi Yazır
48
64
  # Special Thanks to: http://www.qurandatabase.org/Database.aspx
49
-
50
- # Also in same directory : wahy.rb is a executable file
51
65
  ```
52
66
 
53
67
  ## Development
@@ -66,4 +80,4 @@ The gem is available as open source under the terms of the [MIT License](http://
66
80
 
67
81
  ## Code of Conduct
68
82
 
69
- Everyone interacting in the Wahy project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/wahy/blob/master/CODE_OF_CONDUCT.md).
83
+ Everyone interacting in the Wahy project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/cptangry/wahy/blob/master/CODE_OF_CONDUCT.md).
@@ -12970,11 +12970,13 @@ module Wahy
12970
12970
  </Chapter>
12971
12971
  </HolyQuran>'
12972
12972
 
12973
+ SURELER = {
12974
+ :tur => ["Fatiha", "Bakara", "Ali İmran", "Nisa", "Maide", "Enam", "Araf", "Enfal", "Tevbe", "Yunus", "Hud", "Yusuf", "Rad", "İbrahim", "Hicr", "Nahl", "Isra", "Kehf", "Meryem", "Taha", "Enbiya", "Hac", "Muminun", "Nur", "Furkan", "Suara", "Neml", "Kasas", "Ankebut", "Rum", "Lukman", "Secde", "Ahzab", "Sebe", "Fatir", "Yasin", "Saffat", "Sad", "Zümer", "Mumin", "Fussilet", "Sura", "Zuhruf", "Duhan", "Casiye", "Ahkaf", "Muhammed", "Fetih", "Hucurat", "Kaf", "Zariyat", "Tur", "Necm", "Kamer", "Rahman", "Vakia", "Hadid", "Mücadele", "Hasr", "Mümtahine", "Saf", "Cuma", "Münafikun", "Tegabun", "Talak", "Tahrim", "Mülk", "Kalem", "Hakka", "Mearic", "Nuh", "Cin", "Müzzemmil", "Müddessir", "Kıyamet", "İnsan", "Murselat", "Nebe", "Naziat", "Abese", "Tekvir", "İnfitar", "Mutaffifin", "İnsikak", "Buruc", "Tarik", "Ala", "Gasiye", "Fecr", "Beled", "Şems", "Leyl", "Duha", "İnşirah", "Tin", "Alak", "Kadir", "Beyyine", "Zilzal", "Adiyat", "Karia", "Tekasür", "Asr", "Hümeze", "Fil", "Kureyş", "Maun", "Kevser", "Kafirun", "Nasr", "Leheb", "İhlas", "Felak", "Nas"],
12975
+ :eng => ["The Opening", "The Cow", "The Family Of Imran", "Women", "The Food", "The Cattle", "The Elevated Place", "The Spoils Of War", "Repentance", "Yunus", "Hud", "Yusuf", "The Thunder", "Ibrahim", "The Rock", "The Bee", "The Israelites", "The Cave", "Marium", "Ta Ha", "The Prophets", "The Pilgrimage", "The Believers", "The Light", "The Criterion", "The Poets", "The Ant", "The Narrative", "The Spider", "The Romans", "Luqman", "The Adoration", "The Allies", "Saba", "The Originator", "Ya Seen", "The Rangers", "Suad", "The Companies", "The Believer", "Ha Mim", "The Counsel", "The Embellishment", "The Evident Smoke", "The Kneeling", "The Sandhills", "Muhammad", "The Victory", "The Chambers", "Qaf", "The Scatterers", "The Mountain", "The Star", "The Moon", "The Beneficient", "The Great Event", "The Iron", "The Pleading One", "The Banishment", "The Examined One", "The Ranks", "Friday", "The Hypocrites", "Loss And Gain", "The Divorce", "The Prohibition", "The Kingdom", "The Pen", "The Sure Calamity", "The Ways Of Ascent", "Nuh", "The Jinn", "The Wrapped Up", "The Clothe Done", "The Resurrection", "The Man", "The Emissaries", "The Great Event", "Those Who Pull Out", "He Frowned", "The Covering Up", "The Cleaving Asund", "The Defrauders", "The Bursting Asund", "The Mansions Of The Stars", "The Night-Comer", "The Most High", "The Overwhelming", "The Daybreak", "The City", "The Sun", "The Night", "The Early Hours", "The Expansion", "The Fig", "The Clot", "The Majesty", "The Clear Evidence", "The Shaking", "The Assaulters", "The Terrible Calam", "The Multiplicatio", "Time", "The Slanderer", "The Elephant", "The Qureaish", "The Daily Necessar", "The Heavenly Fount", "The Unbelievers", "The Help", "The Flame", "The Unity", "The Dawn", "The Men"]
12976
+ }
12977
+
12973
12978
  module Opt_PARSER
12974
- SURELER = {
12975
- :tur => ["Fatiha", "Bakara", "Ali İmran", "Nisa", "Maide", "Enam", "Araf", "Enfal", "Tevbe", "Yunus", "Hud", "Yusuf", "Rad", "İbrahim", "Hicr", "Nahl", "Isra", "Kehf", "Meryem", "Taha", "Enbiya", "Hac", "Muminun", "Nur", "Furkan", "Suara", "Neml", "Kasas", "Ankebut", "Rum", "Lukman", "Secde", "Ahzab", "Sebe", "Fatir", "Yasin", "Saffat", "Sad", "Zümer", "Mumin", "Fussilet", "Sura", "Zuhruf", "Duhan", "Casiye", "Ahkaf", "Muhammed", "Fetih", "Hucurat", "Kaf", "Zariyat", "Tur", "Necm", "Kamer", "Rahman", "Vakia", "Hadid", "Mücadele", "Hasr", "Mümtahine", "Saf", "Cuma", "Münafikun", "Tegabun", "Talak", "Tahrim", "Mülk", "Kalem", "Hakka", "Mearic", "Nuh", "Cin", "Müzzemmil", "Müddessir", "Kıyamet", "İnsan", "Murselat", "Nebe", "Naziat", "Abese", "Tekvir", "İnfitar", "Mutaffifin", "İnsikak", "Buruc", "Tarik", "Ala", "Gasiye", "Fecr", "Beled", "Şems", "Leyl", "Duha", "İnşirah", "Tin", "Alak", "Kadir", "Beyyine", "Zilzal", "Adiyat", "Karia", "Tekasür", "Asr", "Hümeze", "Fil", "Kureyş", "Maun", "Kevser", "Kafirun", "Nasr", "Leheb", "İhlas", "Felak", "Nas"],
12976
- :eng => ["The Opening", "The Cow", "The Family Of Imran", "Women", "The Food", "The Cattle", "The Elevated Place", "The Spoils Of War", "Repentance", "Yunus", "Hud", "Yusuf", "The Thunder", "Ibrahim", "The Rock", "The Bee", "The Israelites", "The Cave", "Marium", "Ta Ha", "The Prophets", "The Pilgrimage", "The Believers", "The Light", "The Criterion", "The Poets", "The Ant", "The Narrative", "The Spider", "The Romans", "Luqman", "The Adoration", "The Allies", "Saba", "The Originator", "Ya Seen", "The Rangers", "Suad", "The Companies", "The Believer", "Ha Mim", "The Counsel", "The Embellishment", "The Evident Smoke", "The Kneeling", "The Sandhills", "Muhammad", "The Victory", "The Chambers", "Qaf", "The Scatterers", "The Mountain", "The Star", "The Moon", "The Beneficient", "The Great Event", "The Iron", "The Pleading One", "The Banishment", "The Examined One", "The Ranks", "Friday", "The Hypocrites", "Loss And Gain", "The Divorce", "The Prohibition", "The Kingdom", "The Pen", "The Sure Calamity", "The Ways Of Ascent", "Nuh", "The Jinn", "The Wrapped Up", "The Clothe Done", "The Resurrection", "The Man", "The Emissaries", "The Great Event", "Those Who Pull Out", "He Frowned", "The Covering Up", "The Cleaving Asund", "The Defrauders", "The Bursting Asund", "The Mansions Of The Stars", "The Night-Comer", "The Most High", "The Overwhelming", "The Daybreak", "The City", "The Sun", "The Night", "The Early Hours", "The Expansion", "The Fig", "The Clot", "The Majesty", "The Clear Evidence", "The Shaking", "The Assaulters", "The Terrible Calam", "The Multiplicatio", "Time", "The Slanderer", "The Elephant", "The Qureaish", "The Daily Necessar", "The Heavenly Fount", "The Unbelievers", "The Help", "The Flame", "The Unity", "The Dawn", "The Men"]
12977
- }
12979
+
12978
12980
 
12979
12981
 
12980
12982
  def self.opsiyonlar opts
@@ -13041,4 +13043,49 @@ module Wahy
13041
13043
  print "[#{SIGN + 1}]: ".red, "#{var.css('Verse')[SIGN].text}".green, "\n"
13042
13044
  end
13043
13045
  end
13046
+
13047
+ def self.new_data lang
13048
+ if lang == 'tur'
13049
+ doc = Nokogiri::XML(TUR)
13050
+ elsif lang == 'eng'
13051
+ doc = Nokogiri::XML(ENGLISH)
13052
+ else
13053
+ print 'Please, eelect a correct option ("tur" or "eng"): '
13054
+ selection = gets.chomp
13055
+ new_data selection
13056
+ end
13057
+ doc
13058
+ end
13059
+
13060
+ def self.chapters_data parsed_xml_data
13061
+ elements = parsed_xml_data.xpath("//*[@ChapterName]")
13062
+ elements
13063
+ end
13064
+
13065
+ def self.scripture_data parsed_chapter_data, scripture_name
13066
+ s_data = nil
13067
+ if scripture_name =~ /[[:digit:]]/
13068
+ s_data = parsed_chapter_data[scripture_name]
13069
+ else
13070
+ sc = scripture_name.include?(" ") ? scripture_name.split(" ").map {|i| i = i.capitalize}.join(" ") : scripture_name.capitalize
13071
+ SURELER.values.each do |v|
13072
+ s_data = v.index(sc) if v.include? sc
13073
+ end
13074
+ end
13075
+ scripture = parsed_chapter_data[(s_data || 0)]
13076
+ scripture
13077
+ end
13078
+
13079
+ def self.sign_data scripture_data
13080
+ sign = []
13081
+ scripture_data.css('Verse').each do |v|
13082
+ sign << v.text
13083
+ end
13084
+ sign
13085
+ end
13086
+
13087
+ def self.take_specific_sign sign_data, sign_number
13088
+ sign = sign_data[sign_number]
13089
+ sign
13090
+ end
13044
13091
  end
@@ -1,3 +1,3 @@
1
1
  module Wahy
2
- VERSION = "1.3.3"
2
+ VERSION = "1.3.4"
3
3
  end
@@ -9,8 +9,12 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Gökhan Çağlar"]
10
10
  spec.email = ["caglar.gokhan@gmail.com"]
11
11
 
12
- spec.summary = %q{You can read Quran's scriptures or signs from terminal. Version 1.1.8 Everything is working! REALLY! STABLE. Executable path issues fixed. It can run as a terminal command. Default Lang is English now.}
13
- spec.description = %q{This gem show user Quran's scriptures and signs in English and also in Turkish with sign number and colored. Executable path issues fixed. It can run as a terminal command. Default Lang is English now.}
12
+ spec.summary = %q{You can read Quran's scriptures or signs from terminal. Version 1.1.8 Everything is working! REALLY! STABLE.
13
+ Executable path issues fixed. It can run as a terminal command. Default Lang is English now. Also you can require
14
+ it and take Quran data with helpfull and easy to use methods.}
15
+ spec.description = %q{You can read Quran's scriptures or signs from terminal. Version 1.1.8 Everything is working! REALLY! STABLE.
16
+ Executable path issues fixed. It can run as a terminal command. Default Lang is English now. Also you can require
17
+ it and take Quran data with helpfull and easy to use methods.}
14
18
  spec.homepage = "https://github.com/cptangry/wahy"
15
19
  spec.license = "MIT"
16
20
  spec.executables << "wahy"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wahy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gökhan Çağlar
@@ -108,9 +108,10 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 0.8.1
111
- description: This gem show user Quran's scriptures and signs in English and also in
112
- Turkish with sign number and colored. Executable path issues fixed. It can run as
113
- a terminal command. Default Lang is English now.
111
+ description: |-
112
+ You can read Quran's scriptures or signs from terminal. Version 1.1.8 Everything is working! REALLY! STABLE.
113
+ Executable path issues fixed. It can run as a terminal command. Default Lang is English now. Also you can require
114
+ it and take Quran data with helpfull and easy to use methods.
114
115
  email:
115
116
  - caglar.gokhan@gmail.com
116
117
  executables:
@@ -158,5 +159,6 @@ signing_key:
158
159
  specification_version: 4
159
160
  summary: You can read Quran's scriptures or signs from terminal. Version 1.1.8 Everything
160
161
  is working! REALLY! STABLE. Executable path issues fixed. It can run as a terminal
161
- command. Default Lang is English now.
162
+ command. Default Lang is English now. Also you can require it and take Quran data
163
+ with helpfull and easy to use methods.
162
164
  test_files: []