readlines 1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/gem-push.yml +45 -0
- data/.gitignore +46 -0
- data/.rspec +0 -0
- data/CHANGELOG.md +36 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +30 -0
- data/LICENSE +21 -0
- data/README.md +349 -0
- data/Rakefile +9 -0
- data/examples/example1.rb +13 -0
- data/examples/example10.rb +13 -0
- data/examples/example11.rb +13 -0
- data/examples/example12.rb +13 -0
- data/examples/example13.rb +13 -0
- data/examples/example14.rb +13 -0
- data/examples/example15.rb +13 -0
- data/examples/example16.rb +13 -0
- data/examples/example17.rb +13 -0
- data/examples/example18.rb +13 -0
- data/examples/example19.rb +13 -0
- data/examples/example2.rb +13 -0
- data/examples/example20.rb +13 -0
- data/examples/example21.rb +13 -0
- data/examples/example22.rb +13 -0
- data/examples/example23.rb +13 -0
- data/examples/example24.rb +13 -0
- data/examples/example25.rb +13 -0
- data/examples/example26.rb +13 -0
- data/examples/example27.rb +13 -0
- data/examples/example28.rb +13 -0
- data/examples/example29.rb +13 -0
- data/examples/example3.rb +13 -0
- data/examples/example30.rb +13 -0
- data/examples/example31.rb +13 -0
- data/examples/example32.rb +13 -0
- data/examples/example33.rb +13 -0
- data/examples/example34.rb +13 -0
- data/examples/example35.rb +13 -0
- data/examples/example36.rb +13 -0
- data/examples/example37.rb +13 -0
- data/examples/example38.rb +13 -0
- data/examples/example4.rb +13 -0
- data/examples/example5.rb +13 -0
- data/examples/example6.rb +13 -0
- data/examples/example7.rb +13 -0
- data/examples/example8.rb +13 -0
- data/examples/example9.rb +13 -0
- data/lib/read.rb +9 -0
- data/lib/readlines/read.rb +263 -0
- data/lib/readlines/readlines/check.rb +16 -0
- data/lib/readlines/readlines/content.rb +45 -0
- data/lib/readlines/readlines/convert.rb +43 -0
- data/lib/readlines/readlines/count.rb +58 -0
- data/lib/readlines/readlines/delete.rb +89 -0
- data/lib/readlines/readlines/error.rb +13 -0
- data/lib/readlines/readlines/file.rb +20 -0
- data/lib/readlines/readlines/info.rb +48 -0
- data/lib/readlines/readlines/merge.rb +38 -0
- data/lib/readlines/readlines/pattern.rb +22 -0
- data/lib/readlines/readlines/replace.rb +50 -0
- data/lib/readlines/readlines/search.rb +62 -0
- data/lib/readlines/readlines/sort.rb +18 -0
- data/lib/readlines/readlines/split.rb +79 -0
- data/lib/readlines/readlines/version.rb +7 -0
- data/readlines.gemspec +25 -0
- metadata +182 -0
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|