readlines 1.3 → 1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- metadata +4 -53
- data/.github/workflows/gem-push.yml +0 -45
- data/.gitignore +0 -46
- data/.rspec +0 -0
- data/CHANGELOG.md +0 -36
- data/CODE_OF_CONDUCT.md +0 -0
- data/Gemfile +0 -5
- data/Gemfile.lock +0 -30
- data/LICENSE +0 -21
- data/Rakefile +0 -9
- data/examples/example1.rb +0 -13
- data/examples/example10.rb +0 -13
- data/examples/example11.rb +0 -13
- data/examples/example12.rb +0 -13
- data/examples/example13.rb +0 -13
- data/examples/example14.rb +0 -13
- data/examples/example15.rb +0 -13
- data/examples/example16.rb +0 -13
- data/examples/example17.rb +0 -13
- data/examples/example18.rb +0 -13
- data/examples/example19.rb +0 -13
- data/examples/example2.rb +0 -13
- data/examples/example20.rb +0 -13
- data/examples/example21.rb +0 -13
- data/examples/example22.rb +0 -13
- data/examples/example23.rb +0 -13
- data/examples/example24.rb +0 -13
- data/examples/example25.rb +0 -13
- data/examples/example26.rb +0 -13
- data/examples/example27.rb +0 -13
- data/examples/example28.rb +0 -13
- data/examples/example29.rb +0 -13
- data/examples/example3.rb +0 -13
- data/examples/example30.rb +0 -13
- data/examples/example31.rb +0 -13
- data/examples/example32.rb +0 -13
- data/examples/example33.rb +0 -13
- data/examples/example34.rb +0 -13
- data/examples/example35.rb +0 -13
- data/examples/example36.rb +0 -13
- data/examples/example37.rb +0 -13
- data/examples/example38.rb +0 -13
- data/examples/example4.rb +0 -13
- data/examples/example5.rb +0 -13
- data/examples/example6.rb +0 -13
- data/examples/example7.rb +0 -13
- data/examples/example8.rb +0 -13
- data/examples/example9.rb +0 -13
- data/readlines.gemspec +0 -25
- /data/lib/{read.rb → readlines.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b5fb4edb74d65584c625105a679e4a9d7523bdd5437ef733932c46b888723b5
|
4
|
+
data.tar.gz: 9608ee45bc3e1f89f684f37edd1c69ef9d901918d09a0b5bc404aca13aafcfc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c5df729b5497190c5aa8ad6fb880d96fdd50e6f17cd94f3cee9380cf7b420808f4855603387880a854a76ae0420dde7bddf1d26a682383a4d1b578b810dfe19
|
7
|
+
data.tar.gz: 1ec0f06aa5b3851f15bbf65b888888e38672cf3ab3dde593564f0a55f589c99e687ad25194f8c8275a855c98132ef4b07e91aa1fbea73a37adebfb8836433258
|
data/README.md
CHANGED
@@ -244,7 +244,7 @@ puts is_valid
|
|
244
244
|
```
|
245
245
|
```ruby
|
246
246
|
# Remove duplicate lines from the file
|
247
|
-
unique_content = read.
|
247
|
+
unique_content = read.delete_duplicate_lines
|
248
248
|
puts unique_content
|
249
249
|
```
|
250
250
|
```ruby
|
@@ -340,11 +340,11 @@ The Readlines library is open-source and released under the [MIT License](https:
|
|
340
340
|
If you have any questions, suggestions, or feedback regarding the Readlines library, please feel free to contact the maintainer:
|
341
341
|
|
342
342
|
- Name: Maven
|
343
|
-
- Email: qppn@hotmail.com
|
344
343
|
- GitHub: [Maven's GitHub](https://github.com/abo5)
|
345
344
|
|
346
345
|
We appreciate your interest in the Readlines library and look forward to your contributions and feedback!
|
347
346
|
|
348
347
|
|
349
348
|
|
349
|
+
# readlines
|
350
350
|
# readlines
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: readlines
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maven
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -84,61 +84,13 @@ description: Readlines is a Ruby library offering advanced tools for reading, wr
|
|
84
84
|
and manipulating text files. It supports searching, replacing, sorting, splitting,
|
85
85
|
merging, handling CSVs, encryption, and more. Perfect for developers needing efficient
|
86
86
|
and complex file operations.
|
87
|
-
email:
|
88
|
-
- qppn@hotmail.com
|
87
|
+
email:
|
89
88
|
executables: []
|
90
89
|
extensions: []
|
91
90
|
extra_rdoc_files: []
|
92
91
|
files:
|
93
|
-
- ".github/workflows/gem-push.yml"
|
94
|
-
- ".gitignore"
|
95
|
-
- ".rspec"
|
96
|
-
- CHANGELOG.md
|
97
|
-
- CODE_OF_CONDUCT.md
|
98
|
-
- Gemfile
|
99
|
-
- Gemfile.lock
|
100
|
-
- LICENSE
|
101
92
|
- README.md
|
102
|
-
-
|
103
|
-
- examples/example1.rb
|
104
|
-
- examples/example10.rb
|
105
|
-
- examples/example11.rb
|
106
|
-
- examples/example12.rb
|
107
|
-
- examples/example13.rb
|
108
|
-
- examples/example14.rb
|
109
|
-
- examples/example15.rb
|
110
|
-
- examples/example16.rb
|
111
|
-
- examples/example17.rb
|
112
|
-
- examples/example18.rb
|
113
|
-
- examples/example19.rb
|
114
|
-
- examples/example2.rb
|
115
|
-
- examples/example20.rb
|
116
|
-
- examples/example21.rb
|
117
|
-
- examples/example22.rb
|
118
|
-
- examples/example23.rb
|
119
|
-
- examples/example24.rb
|
120
|
-
- examples/example25.rb
|
121
|
-
- examples/example26.rb
|
122
|
-
- examples/example27.rb
|
123
|
-
- examples/example28.rb
|
124
|
-
- examples/example29.rb
|
125
|
-
- examples/example3.rb
|
126
|
-
- examples/example30.rb
|
127
|
-
- examples/example31.rb
|
128
|
-
- examples/example32.rb
|
129
|
-
- examples/example33.rb
|
130
|
-
- examples/example34.rb
|
131
|
-
- examples/example35.rb
|
132
|
-
- examples/example36.rb
|
133
|
-
- examples/example37.rb
|
134
|
-
- examples/example38.rb
|
135
|
-
- examples/example4.rb
|
136
|
-
- examples/example5.rb
|
137
|
-
- examples/example6.rb
|
138
|
-
- examples/example7.rb
|
139
|
-
- examples/example8.rb
|
140
|
-
- examples/example9.rb
|
141
|
-
- lib/read.rb
|
93
|
+
- lib/readlines.rb
|
142
94
|
- lib/readlines/read.rb
|
143
95
|
- lib/readlines/readlines/check.rb
|
144
96
|
- lib/readlines/readlines/content.rb
|
@@ -155,7 +107,6 @@ files:
|
|
155
107
|
- lib/readlines/readlines/sort.rb
|
156
108
|
- lib/readlines/readlines/split.rb
|
157
109
|
- lib/readlines/readlines/version.rb
|
158
|
-
- readlines.gemspec
|
159
110
|
homepage: https://github.com/Abo5/readlines
|
160
111
|
licenses:
|
161
112
|
- MIT
|
@@ -1,45 +0,0 @@
|
|
1
|
-
name: Ruby Gem
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches: [ "main" ]
|
6
|
-
pull_request:
|
7
|
-
branches: [ "main" ]
|
8
|
-
|
9
|
-
jobs:
|
10
|
-
build:
|
11
|
-
name: Build + Publish
|
12
|
-
runs-on: ubuntu-latest
|
13
|
-
permissions:
|
14
|
-
contents: read
|
15
|
-
packages: write
|
16
|
-
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v4
|
19
|
-
|
20
|
-
- name: Set up Ruby
|
21
|
-
uses: ruby/setup-ruby@v1
|
22
|
-
with:
|
23
|
-
ruby-version: 3.1.0
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- name: Check Ruby version
|
28
|
-
run: ruby --version
|
29
|
-
|
30
|
-
- name: Check gem version
|
31
|
-
run: gem --version
|
32
|
-
|
33
|
-
- name: Install Bundler with verbose output
|
34
|
-
run: gem install bundler --no-document --verbose
|
35
|
-
|
36
|
-
- name: Verify Bundler installation
|
37
|
-
run: bundler --version
|
38
|
-
|
39
|
-
- name: Build the gem
|
40
|
-
run: gem build *.gemspec
|
41
|
-
|
42
|
-
- name: Push to RubyGems
|
43
|
-
run: gem push *.gem
|
44
|
-
env:
|
45
|
-
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
data/.gitignore
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# Ignore Ruby and Rails specific files
|
2
|
-
*.rbc
|
3
|
-
*.log
|
4
|
-
*.gem
|
5
|
-
*.rdoc
|
6
|
-
db/*.sqlite3
|
7
|
-
db/*.sqlite3-journal
|
8
|
-
tmp/
|
9
|
-
coverage/
|
10
|
-
|
11
|
-
# Ignore all logfiles and tempfiles.
|
12
|
-
/log/*
|
13
|
-
/tmp/*
|
14
|
-
!/log/.keep
|
15
|
-
!/tmp/.keep
|
16
|
-
|
17
|
-
# Ignore files related to version control systems
|
18
|
-
.git/
|
19
|
-
.svn/
|
20
|
-
.hg/
|
21
|
-
|
22
|
-
# Ignore bundler config and installed gems
|
23
|
-
/.bundle
|
24
|
-
/vendor/bundle
|
25
|
-
|
26
|
-
# Ignore specific environment configuration files
|
27
|
-
.env
|
28
|
-
.secret
|
29
|
-
|
30
|
-
# Ignore IDE-specific files (e.g., for VSCode, RubyMine, SublimeText)
|
31
|
-
.idea/
|
32
|
-
*.swp
|
33
|
-
*.swo
|
34
|
-
*.sublime-workspace
|
35
|
-
*.sublime-project
|
36
|
-
.vscode/
|
37
|
-
|
38
|
-
# Other common ignore patterns
|
39
|
-
.DS_Store
|
40
|
-
Thumbs.db
|
41
|
-
test_file-copy.json
|
42
|
-
read.rb
|
43
|
-
proxy.txt
|
44
|
-
main.rb
|
45
|
-
info_spec.rb
|
46
|
-
create.rb
|
data/.rspec
DELETED
File without changes
|
data/CHANGELOG.md
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
- Read the entire file content or specific parts of it.
|
2
|
-
- Search for specific values in the file and display matching line numbers.
|
3
|
-
- Count the number of lines in the file based on a keyword or delimiter.
|
4
|
-
- Replace specific patterns in the file with replacement text.
|
5
|
-
- Remove empty lines from the file.
|
6
|
-
- Sort the lines of the file alphabetically.
|
7
|
-
- Split the file into a specified number of parts.
|
8
|
-
- Merge multiple files into a single file.
|
9
|
-
- Convert the encoding of the file from one encoding to another.
|
10
|
-
- Replace special characters in the file with a replacement string.
|
11
|
-
- Remove unwanted characters from the file.
|
12
|
-
- Split the file by a specified size.
|
13
|
-
- Convert the file to a specified format (txt, csv, json).
|
14
|
-
- Search for multiple patterns in the file and count occurrences of each pattern.
|
15
|
-
- Replace multiple patterns in the file in a single operation.
|
16
|
-
- Split the file based on a specified delimiter.
|
17
|
-
- Merge multiple files into a single file with a specified separator between each file's content.
|
18
|
-
- Check if a specific pattern exists in the file.
|
19
|
-
- Delete specific lines from the file with the option to remove resulting empty lines.
|
20
|
-
- Reverse the order of the file contents.
|
21
|
-
- Search for a pattern within a specified range of lines.
|
22
|
-
- Count the number of characters in the file or in a specific line.
|
23
|
-
- Count the number of words in the file or in a specific line.
|
24
|
-
- Extract specific patterns from the file.
|
25
|
-
- Convert the file contents into an array of lines.
|
26
|
-
- Validate the file contents against a set of rules.
|
27
|
-
- Remove duplicate lines from the file.
|
28
|
-
- Get statistics about the file (number of lines, characters, words).
|
29
|
-
- Search for logical patterns in the file using AND and OR operators.
|
30
|
-
- Split the file based on a specified pattern.
|
31
|
-
- Delete specific columns from a CSV file.
|
32
|
-
- Replace a specific value in a CSV column.
|
33
|
-
- Check for spelling errors in the file using a dictionary.
|
34
|
-
- Encrypt the file contents using a key.
|
35
|
-
- Decrypt the encrypted file contents using a key.
|
36
|
-
- Get the file size in different units (bytes, kilobytes, megabytes, gigabytes).
|
data/CODE_OF_CONDUCT.md
DELETED
File without changes
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
diff-lcs (1.5.1)
|
5
|
-
fileutils (1.7.2)
|
6
|
-
json (2.7.2)
|
7
|
-
rspec (3.13.0)
|
8
|
-
rspec-core (~> 3.13.0)
|
9
|
-
rspec-expectations (~> 3.13.0)
|
10
|
-
rspec-mocks (~> 3.13.0)
|
11
|
-
rspec-core (3.13.0)
|
12
|
-
rspec-support (~> 3.13.0)
|
13
|
-
rspec-expectations (3.13.1)
|
14
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
15
|
-
rspec-support (~> 3.13.0)
|
16
|
-
rspec-mocks (3.13.1)
|
17
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
18
|
-
rspec-support (~> 3.13.0)
|
19
|
-
rspec-support (3.13.1)
|
20
|
-
|
21
|
-
PLATFORMS
|
22
|
-
arm64-darwin-23
|
23
|
-
|
24
|
-
DEPENDENCIES
|
25
|
-
fileutils
|
26
|
-
json
|
27
|
-
rspec
|
28
|
-
|
29
|
-
BUNDLED WITH
|
30
|
-
2.5.14
|
data/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2024 MAVEN
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
data/Rakefile
DELETED
data/examples/example1.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the line_count method
|
8
|
-
begin
|
9
|
-
result = obj.line_count
|
10
|
-
puts "Result of line_count: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example10.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the replace method
|
8
|
-
begin
|
9
|
-
result = obj.replace
|
10
|
-
puts "Result of replace: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example11.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the replace_special_characters method
|
8
|
-
begin
|
9
|
-
result = obj.replace_special_characters
|
10
|
-
puts "Result of replace_special_characters: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example12.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the replace_multiple_patterns method
|
8
|
-
begin
|
9
|
-
result = obj.replace_multiple_patterns
|
10
|
-
puts "Result of replace_multiple_patterns: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example13.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the replace_csv_value method
|
8
|
-
begin
|
9
|
-
result = obj.replace_csv_value
|
10
|
-
puts "Result of replace_csv_value: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example14.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the delete_empty_lines method
|
8
|
-
begin
|
9
|
-
result = obj.delete_empty_lines
|
10
|
-
puts "Result of delete_empty_lines: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example15.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the delete_unwanted_characters method
|
8
|
-
begin
|
9
|
-
result = obj.delete_unwanted_characters
|
10
|
-
puts "Result of delete_unwanted_characters: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example16.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the delete_lines method
|
8
|
-
begin
|
9
|
-
result = obj.delete_lines
|
10
|
-
puts "Result of delete_lines: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example17.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the delete_duplicate_lines method
|
8
|
-
begin
|
9
|
-
result = obj.delete_duplicate_lines
|
10
|
-
puts "Result of delete_duplicate_lines: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example18.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the delete_csv_columns method
|
8
|
-
begin
|
9
|
-
result = obj.delete_csv_columns
|
10
|
-
puts "Result of delete_csv_columns: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example19.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the delete_right_left_separator method
|
8
|
-
begin
|
9
|
-
result = obj.delete_right_left_separator
|
10
|
-
puts "Result of delete_right_left_separator: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example2.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the character_count method
|
8
|
-
begin
|
9
|
-
result = obj.character_count
|
10
|
-
puts "Result of character_count: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example20.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the sort_alphabetically method
|
8
|
-
begin
|
9
|
-
result = obj.sort_alphabetically
|
10
|
-
puts "Result of sort_alphabetically: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example21.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the split_file method
|
8
|
-
begin
|
9
|
-
result = obj.split_file
|
10
|
-
puts "Result of split_file: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example22.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the split_file_by_size method
|
8
|
-
begin
|
9
|
-
result = obj.split_file_by_size
|
10
|
-
puts "Result of split_file_by_size: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example23.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the split_by_delimiter method
|
8
|
-
begin
|
9
|
-
result = obj.split_by_delimiter
|
10
|
-
puts "Result of split_by_delimiter: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example24.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the split_by_pattern method
|
8
|
-
begin
|
9
|
-
result = obj.split_by_pattern
|
10
|
-
puts "Result of split_by_pattern: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example25.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the merge_files method
|
8
|
-
begin
|
9
|
-
result = obj.merge_files
|
10
|
-
puts "Result of merge_files: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example26.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the merge_files_with_specific_line method
|
8
|
-
begin
|
9
|
-
result = obj.merge_files_with_specific_line
|
10
|
-
puts "Result of merge_files_with_specific_line: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example27.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the convert_encoding method
|
8
|
-
begin
|
9
|
-
result = obj.convert_encoding
|
10
|
-
puts "Result of convert_encoding: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example28.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the convert_to_format method
|
8
|
-
begin
|
9
|
-
result = obj.convert_to_format
|
10
|
-
puts "Result of convert_to_format: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example29.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the convert_to_array method
|
8
|
-
begin
|
9
|
-
result = obj.convert_to_array
|
10
|
-
puts "Result of convert_to_array: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example3.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the word_count method
|
8
|
-
begin
|
9
|
-
result = obj.word_count
|
10
|
-
puts "Result of word_count: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example30.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the file_size method
|
8
|
-
begin
|
9
|
-
result = obj.file_size
|
10
|
-
puts "Result of file_size: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example31.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the file_statistics method
|
8
|
-
begin
|
9
|
-
result = obj.file_statistics
|
10
|
-
puts "Result of file_statistics: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example32.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the pattern_exists? method
|
8
|
-
begin
|
9
|
-
result = obj.pattern_exists?
|
10
|
-
puts "Result of pattern_exists?: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example33.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the extract_patterns method
|
8
|
-
begin
|
9
|
-
result = obj.extract_patterns
|
10
|
-
puts "Result of extract_patterns: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example34.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the reverse_content method
|
8
|
-
begin
|
9
|
-
result = obj.reverse_content
|
10
|
-
puts "Result of reverse_content: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example35.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the validate_content method
|
8
|
-
begin
|
9
|
-
result = obj.validate_content
|
10
|
-
puts "Result of validate_content: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example36.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the check_spelling method
|
8
|
-
begin
|
9
|
-
result = obj.check_spelling
|
10
|
-
puts "Result of check_spelling: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example37.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the encrypt_content method
|
8
|
-
begin
|
9
|
-
result = obj.encrypt_content
|
10
|
-
puts "Result of encrypt_content: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example38.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the decrypt_content method
|
8
|
-
begin
|
9
|
-
result = obj.decrypt_content
|
10
|
-
puts "Result of decrypt_content: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example4.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the read_lines method
|
8
|
-
begin
|
9
|
-
result = obj.read_lines
|
10
|
-
puts "Result of read_lines: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example5.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the info method
|
8
|
-
begin
|
9
|
-
result = obj.info
|
10
|
-
puts "Result of info: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example6.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the search_about method
|
8
|
-
begin
|
9
|
-
result = obj.search_about
|
10
|
-
puts "Result of search_about: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example7.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = ReadDuc.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the search_multiple_patterns method
|
8
|
-
begin
|
9
|
-
result = obj.search_multiple_patterns
|
10
|
-
puts "Result of search_multiple_patterns: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example8.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the search_in_range method
|
8
|
-
begin
|
9
|
-
result = obj.search_in_range
|
10
|
-
puts "Result of search_in_range: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/examples/example9.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'readlines'
|
2
|
-
|
3
|
-
# Create an instance of the ReadDuc
|
4
|
-
file_path = 'path/to/your/file.txt'
|
5
|
-
obj = Read.new(file_path)
|
6
|
-
|
7
|
-
# Example usage of the search_logical_patterns method
|
8
|
-
begin
|
9
|
-
result = obj.search_logical_patterns
|
10
|
-
puts "Result of search_logical_patterns: #{result}"
|
11
|
-
rescue => e
|
12
|
-
puts "Error: #{e.message}"
|
13
|
-
end
|
data/readlines.gemspec
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |spec|
|
2
|
-
spec.name = "readlines"
|
3
|
-
spec.version = "1.3"
|
4
|
-
spec.authors = ['Maven']
|
5
|
-
spec.email = ['qppn@hotmail.com']
|
6
|
-
|
7
|
-
spec.summary = "A Ruby library for advanced text file manipulation and processing."
|
8
|
-
spec.description = "Readlines is a Ruby library offering advanced tools for reading, writing, and manipulating text files. It supports searching, replacing, sorting, splitting, merging, handling CSVs, encryption, and more. Perfect for developers needing efficient and complex file operations."
|
9
|
-
spec.homepage = "https://github.com/Abo5/readlines"
|
10
|
-
spec.license = "MIT"
|
11
|
-
|
12
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
13
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
14
|
-
end
|
15
|
-
spec.bindir = "exe"
|
16
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
17
|
-
spec.require_paths = ["lib"]
|
18
|
-
|
19
|
-
spec.add_runtime_dependency 'json', '~> 2.0'
|
20
|
-
spec.add_runtime_dependency 'fileutils', '~> 1.7.2'
|
21
|
-
|
22
|
-
spec.add_development_dependency "bundler", "~> 2.0"
|
23
|
-
spec.add_development_dependency "rake", "~> 13.0"
|
24
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
25
|
-
end
|
File without changes
|