random_methods 0.0.5 → 0.0.6

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/random_methods.rb +22 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 615014c092f1dde4d4764e37709516a0dd175848
4
- data.tar.gz: 1d3a33028af8567e80d9e697876b9f0297397a83
3
+ metadata.gz: 8f834edccec8d3bc7e95b6ab42536495b3d02e2e
4
+ data.tar.gz: f12c2412d6363affefddcdd8ae1edf20c63ed4a5
5
5
  SHA512:
6
- metadata.gz: 04051f5bc702f98ac2864378f03d30ad6504081f2e0b6860a9ddc174b7b212e7c4deb8069654bcf909dbbab2773553dfe4cae7ce0d6f1233f69057ab497b6e85
7
- data.tar.gz: 7826d88a6810c158bb1b8ca8508260e25f7be6a1b68a59bbd57c7fb02229f66ddca0f1cfb05a4161c64db48b5d9e6d7757842b301ad2265646decf2f5778b2b9
6
+ metadata.gz: 7ab4a9fe7a52c90efe15fa1b85da0c2d2a43925ccbbf4c610f0465469bbc0a3332a607df1ea73d2c3651ce443d7237441da42a399e9b2cb39dfa6bd1200aee6e
7
+ data.tar.gz: 7e0c4c4d9c0df862704e58e7e628a949453d451fc4e310da00d8b54c6c02e6078c154ebca835fb9f611f41bf76854136adf0fa2b85c39cb82acbc69f4fb12091
@@ -6,6 +6,18 @@ def quickWrite(file, item)
6
6
  somefile.close
7
7
  end
8
8
 
9
+ def scan_file(file, thing) # fix this thing
10
+ somefile = open(file, 'r')
11
+ somefile.each_line do |line|
12
+ if line[thing] then
13
+ return true
14
+ break
15
+ else
16
+ return false
17
+ end
18
+ end
19
+ somefile.close
20
+ end
9
21
 
10
22
  class Array
11
23
  def puts_all
@@ -42,9 +54,9 @@ class Array
42
54
  end
43
55
 
44
56
  class String
45
- #VITAL FOR LINK CLASS
57
+ #VITAL FOR LINKS
46
58
  # used for my webcrawling needs
47
- domainEnd = ['.com', '.org', '.gov', '.mil', '.net', '.de', '.cr', '.cz', '.to', '.ca/'] # for some reason, 'gov' does not work
59
+ domainEnd = ['.com/', '.org/', '.gov/', '.mil/', '.net/', '.de/', '.cr/', '.cz/', '.to/', '.ca/'] # for some reason, 'gov' does not work
48
60
  @@Domains = Regexp.union(domainEnd)
49
61
  def half
50
62
  strL = self.length
@@ -67,6 +79,13 @@ class String
67
79
  return newString
68
80
  end
69
81
 
82
+ def test_for(item)
83
+ if self[item] then
84
+ return true
85
+ else
86
+ return false
87
+ end
88
+ end
70
89
  # made for link class
71
90
  def index_domain # gives index of the domain ending
72
91
  domainIndex = self.index(@@Domains)
@@ -82,10 +101,9 @@ class String
82
101
  if domainIndex == nil then
83
102
  return nil
84
103
  else
85
- domainEnd = domainIndex + 2
104
+ domainEnd = domainIndex + 3
86
105
  domainName = self[0..domainEnd]
87
106
  return domainName
88
107
  end
89
108
  end
90
-
91
109
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: random_methods
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chandler Lofland