hanifx 0.1.0 → 0.1.2
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.
- checksums.yaml +4 -4
- data/LICENSE +26 -0
- data/README.md +23 -0
- data/lib/hanifx.rb +37 -18
- metadata +14 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d702059f0b114c09bf0c92b8f9462f4cb799bd0aa88d760c2236464f9b282be9
|
|
4
|
+
data.tar.gz: 83cd0587346bd7fbde453b4aa2fa5c2c3de99ce92be662bb6f2fa94617670c3e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a399a1c679d9816dfffedb806bfaef11fc29567cc167fc8bb94df351e1f16f64635e4ecd380b5a7a6b5e1e5d656490d0427d9ca507803ef410114d748b2df81
|
|
7
|
+
data.tar.gz: 90b9794b9abd5b5e5def4ae1f63cd0213f7639d7804e8a82cae2819d2605c40c5a8d2598123c4e94bba4a1c44556b77a3522c4a3962e993c1a092bded507470c
|
data/LICENSE
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
## 2️⃣ `LICENSE` (MIT)
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Hanif
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Hanifx
|
|
2
|
+
|
|
3
|
+
> **Ultimate Ruby Encoding Module** – Encode any text or file irreversibly, with script safety checks, user-friendly options, and Termux/SDCard support.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Encode **text** and **files** irreversibly
|
|
10
|
+
- Fully **interactive terminal script**
|
|
11
|
+
- Manual module imports
|
|
12
|
+
- **User-defined output path** for files
|
|
13
|
+
- **Overwrite control** and warning messages
|
|
14
|
+
- **Script safety check** for dangerous commands
|
|
15
|
+
- Compatible with **Termux / Linux / macOS**
|
|
16
|
+
- **Colorful & professional terminal output**
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
gem install hanifx
|
data/lib/hanifx.rb
CHANGED
|
@@ -1,45 +1,64 @@
|
|
|
1
|
-
# lib/hanifx.rb
|
|
2
|
-
|
|
3
1
|
module Hanifx
|
|
4
|
-
VERSION = "0.1.
|
|
2
|
+
VERSION = "0.1.1"
|
|
5
3
|
|
|
6
4
|
# Warning message
|
|
7
|
-
def self.warning
|
|
5
|
+
def self.warning(skip: false)
|
|
6
|
+
return if skip
|
|
8
7
|
puts "[WARNING] Once encoded, this data cannot be decoded. Proceed? (yes/no)"
|
|
9
8
|
answer = gets.chomp.downcase
|
|
10
9
|
exit unless answer == "yes"
|
|
11
10
|
end
|
|
12
11
|
|
|
13
|
-
# Irreversible encode for text
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
# Irreversible encode for text (options hash added)
|
|
13
|
+
# options: skip_warning: true/false, verbose: true/false
|
|
14
|
+
def self.encode_text(text, options = {}) # <-- এখানে default hash দিয়েছি
|
|
15
|
+
skip_warning = options[:skip_warning] || false
|
|
16
|
+
verbose = options[:verbose] || false
|
|
17
|
+
|
|
18
|
+
warning(skip: skip_warning)
|
|
19
|
+
encoded = text.chars.map { |c| ((c.ord + 7) * 3).to_s(16) }.join("-")
|
|
20
|
+
puts "[INFO] Text encoded successfully!" if verbose
|
|
21
|
+
encoded
|
|
18
22
|
end
|
|
19
23
|
|
|
20
24
|
# Irreversible encode for file
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
# options: skip_warning, overwrite, verbose, custom_suffix
|
|
26
|
+
def self.encode_file(file_path, options = {})
|
|
27
|
+
skip_warning = options[:skip_warning] || false
|
|
28
|
+
overwrite = options[:overwrite] || false
|
|
29
|
+
verbose = options[:verbose] || false
|
|
30
|
+
custom_suffix = options[:custom_suffix] || ".hanifx"
|
|
31
|
+
|
|
32
|
+
warning(skip: skip_warning)
|
|
23
33
|
unless File.exist?(file_path)
|
|
24
34
|
puts "File not found: #{file_path}"
|
|
25
35
|
return
|
|
26
36
|
end
|
|
37
|
+
|
|
27
38
|
content = File.read(file_path)
|
|
28
|
-
encoded = encode_text(content)
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
encoded = encode_text(content, options)
|
|
40
|
+
target_file = file_path + custom_suffix
|
|
41
|
+
|
|
42
|
+
if File.exist?(target_file) && !overwrite
|
|
43
|
+
puts "File already exists: #{target_file}. Use :overwrite => true to overwrite."
|
|
44
|
+
return
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
File.write(target_file, encoded)
|
|
48
|
+
puts "File encoded successfully: #{target_file}" if verbose
|
|
31
49
|
end
|
|
32
50
|
|
|
33
|
-
#
|
|
34
|
-
|
|
51
|
+
# Check script safety for GitHub push
|
|
52
|
+
# options: verbose
|
|
53
|
+
def self.check_script(file_path, options = {})
|
|
54
|
+
verbose = options[:verbose] || false
|
|
35
55
|
unless File.exist?(file_path)
|
|
36
56
|
puts "File not found: #{file_path}"
|
|
37
57
|
return
|
|
38
58
|
end
|
|
39
|
-
# Basic safety: ensure file can be required without error
|
|
40
59
|
begin
|
|
41
60
|
load file_path
|
|
42
|
-
puts "Script is safe to run on terminal/GitHub"
|
|
61
|
+
puts "Script is safe to run on terminal/GitHub" if verbose
|
|
43
62
|
rescue => e
|
|
44
63
|
puts "Error detected in script: #{e.message}"
|
|
45
64
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hanifx
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hanif
|
|
@@ -9,19 +9,26 @@ bindir: bin
|
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 2025-09-18 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
|
-
description:
|
|
13
|
-
|
|
12
|
+
description: |
|
|
13
|
+
Hanifx is a professional Ruby gem that allows you to encode text and files irreversibly.
|
|
14
|
+
It includes script safety checks, manual module import options, user-defined output paths,
|
|
15
|
+
overwrite controls, and colorful terminal output. Compatible with Termux, Linux, and macOS.
|
|
14
16
|
email:
|
|
15
17
|
- sajim4653@gmail.com
|
|
16
18
|
executables: []
|
|
17
19
|
extensions: []
|
|
18
20
|
extra_rdoc_files: []
|
|
19
21
|
files:
|
|
22
|
+
- LICENSE
|
|
23
|
+
- README.md
|
|
20
24
|
- lib/hanifx.rb
|
|
21
|
-
homepage: https://github.com/
|
|
25
|
+
homepage: https://github.com/hanif-540
|
|
22
26
|
licenses:
|
|
23
27
|
- MIT
|
|
24
|
-
metadata:
|
|
28
|
+
metadata:
|
|
29
|
+
homepage_uri: https://github.com/hanif-540
|
|
30
|
+
source_code_uri: https://github.com/hanif-540
|
|
31
|
+
changelog_uri: https://github.com/hanif-540/CHANGELOG.md
|
|
25
32
|
rdoc_options: []
|
|
26
33
|
require_paths:
|
|
27
34
|
- lib
|
|
@@ -29,7 +36,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
29
36
|
requirements:
|
|
30
37
|
- - ">="
|
|
31
38
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '0'
|
|
39
|
+
version: '3.0'
|
|
33
40
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
34
41
|
requirements:
|
|
35
42
|
- - ">="
|
|
@@ -38,5 +45,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
38
45
|
requirements: []
|
|
39
46
|
rubygems_version: 3.6.2
|
|
40
47
|
specification_version: 4
|
|
41
|
-
summary:
|
|
48
|
+
summary: Ultimate Ruby Encoding Module - Encode text and files irreversibly
|
|
42
49
|
test_files: []
|