kieran_gem 0.0.0 → 1.0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kieran_gem.rb +41 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ef4eee80f08c015ef53dadca89c5020553e2411bb12ba40141186424a8a115f
4
- data.tar.gz: 060f0ac0d47738e0e22f87d680d4940a3fbd16dc2c9ce93c4223fce649804dba
3
+ metadata.gz: 0f2551a55af67a075f4182ac711bd6b7305406701ea8a2607d840084e8dcbd34
4
+ data.tar.gz: 4d8a6d01ab318854e7b4607630eba829710b6e7df320abb688167983b0fe4c79
5
5
  SHA512:
6
- metadata.gz: 0716b972f49197610e12d98fda743aa05d9598c7bb76e5dd4bc9a932d5fd2f5730f6a9a4f36e560cc93fabed5121672370206002ed0bae6e9d71f184edf9ae6b
7
- data.tar.gz: f0165ad886f2eee6394384f7bd1c411ec8dca6a0e0c759965a89f2fbcceaf64434dc69ce9cc83af76aa57df876b6ca325ece505da2341548a1105cb4994e04e4
6
+ metadata.gz: f2bc8316bb9a184b65d2e83bec9bd1826a5ee7a24e0688d6e85b9a0a6b99ef92c2813e3632b8d20a93fb124680365860678897b7f802579428822ef471f77848
7
+ data.tar.gz: 25f7996957223594fe95e6fd931c1d849bbdcc6523447c28fab98c4ef625494e9666861c2b863c81f7cf07f668fc9bd3a79ea196e36079188bcc2591ccc95483
data/lib/kieran_gem.rb CHANGED
@@ -1,5 +1,44 @@
1
1
  class Kieran_gem
2
- def self.hi
3
- puts "Hello world!"
2
+
3
+ def self.hi(text ={})
4
+
5
+ @result = Hash[*text.flatten]
6
+
7
+
8
+ @words = []
9
+ @cleanWords =[]
10
+
11
+ @result.each do |x|
12
+ #words = []
13
+ #@cleanWords =[]
14
+ #get the values only from the hash
15
+ values = x.values
16
+
17
+ #convert it to string
18
+ strValue = values.to_s
19
+ #to utf 8
20
+ encodedValue = strValue.gsub(160.chr("UTF-8"),"") # this beautiful little function removes   -> LIFE SAVER
21
+ #puts encodedValue
22
+ # remove html tags
23
+ rmvHtml = encodedValue.gsub(/(<[^>]*>)|\n|\t/s) {""}
24
+
25
+ # remove additional chars
26
+ rmvExtraChars = rmvHtml.tr('[]',"")
27
+ # still some chars left, gotta get rid of them
28
+ again = rmvExtraChars.delete('\\"')
29
+ #split each by white space
30
+ #word = again.split(' ')
31
+ #word is an array covert back to string
32
+ newWord =again.to_s
33
+ @words.push(newWord)
34
+ end
35
+ #p @words
36
+ @words.each do |ugh|
37
+ dog = ugh.split(" ")
38
+ dog.each do |mouse|
39
+ @cleanWords.push(mouse)
40
+ p @cleanWords
41
+ end
42
+ end
4
43
  end
5
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kieran_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kieran_Gem