standalone-ruby 1.4 → 1.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d95467fb6126c24e1901048ce619fece73112dee058dfe3afd5f27cb8556eeda
4
- data.tar.gz: 6a1254e64cb04b5fe90e9b7710ec743e0ee4b2068af0e336e55faa86de96923b
3
+ metadata.gz: fe559b571044132ebcebf950af268390f5009c482bdb015854f72b632e42c3da
4
+ data.tar.gz: a64e59f677a1748f79e297ac3b6070bde2b061e07dd2c7aabf206f081bb8687a
5
5
  SHA512:
6
- metadata.gz: 5e946a3e1f7253a5a9c1f4307403a8055298011f19839362eda189ed45f290da0a7201cf57823978f1253310228bc245c4a47c81836206409c4d55e6414c3857
7
- data.tar.gz: 2afdb56601f91741a9e27d1759ed3436019e547466a461a51bf03405192b6e621da7ad74874ff0bdf497652f8c868eff993bbd7cbb279e5636f32b6152f94a5c
6
+ metadata.gz: 5d8deff562c776976cfec36842691c02c1c2bac027af1cd6a53cc4d6eed966e4679500737e8618b754b0a19d30cdfcd1566654800d7939ec08e93b8cfc80bba7
7
+ data.tar.gz: 9ed83514709d966dfea42547053c59b1de8cd67df2c3988110cf328fd513e85b4539ce55d69d3aa13743ef3d1fbe9ce7e4b68b3833fa8664ea893992e0295250
data/CHANGELOG.md CHANGED
@@ -24,4 +24,11 @@
24
24
 
25
25
  ## [1.4] - 2025-04-06
26
26
  - Added exe support!
27
- - Improvements have been made for non-GUI programs.
27
+ - Improvements have been made for non-GUI programs.
28
+
29
+ ## [1.4.1] - 2025-04-06
30
+ - Displayer outputs changed.
31
+
32
+ ## [1.4.2] - 2025-04-08
33
+ - The text output of the Robocopy operation is removed from the screen
34
+ - Help message edited
data/bin/standalone-ruby CHANGED
@@ -1,4 +1,4 @@
1
1
  require File.expand_path('../lib/standalone_ruby', __dir__)
2
2
 
3
- standalone_ruby = StandaloneRuby.new
3
+ standalone_ruby = Program.new
4
4
  standalone_ruby.run
@@ -1,30 +1,25 @@
1
1
  #include <windows.h>
2
2
 
3
3
  int main() {
4
- // VBS dosyasının yolu
5
4
  char command[] = "wscript.exe LAUNCHER_FILE";
6
5
 
7
- // CreateProcess için gerekli yapı
8
6
  STARTUPINFO si = {0};
9
7
  PROCESS_INFORMATION pi = {0};
10
8
 
11
- // CreateProcess fonksiyonu ile dış programı başlatıyoruz
12
9
  if (CreateProcess(
13
- NULL, // Uygulama adı (NULL olduğu için command parametresi kullanılır)
14
- command, // Çalıştırılacak komut
15
- NULL, // Güvenlik özellikleri
16
- NULL, // Güvenlik özellikleri
17
- FALSE, // Ebeveynin girdisini paylaşma
18
- 0, // Çalıştırma bayrakları
19
- NULL, // Çevre değişkenleri
20
- NULL, // Çalıştırılacak dizin
21
- &si, // Başlatma bilgisi
22
- &pi // Süreç bilgisi
10
+ NULL,
11
+ command,
12
+ NULL,
13
+ NULL,
14
+ FALSE,
15
+ 0,
16
+ NULL,
17
+ NULL,
18
+ &si,
19
+ &pi
23
20
  )) {
24
- // Başarılıysa, sürecin tamamlanmasını bekleyelim
25
21
  WaitForSingleObject(pi.hProcess, INFINITE);
26
22
 
27
- // Sürecin bitişiyle ilgili bilgileri temizleyelim
28
23
  CloseHandle(pi.hProcess);
29
24
  CloseHandle(pi.hThread);
30
25
  } else {
@@ -1,6 +1,6 @@
1
1
  require_relative 'utils/launcher'
2
2
 
3
- class StandaloneRuby
3
+ class Program
4
4
  def run
5
5
  Launcher.new.run
6
6
  end
@@ -1,4 +1,5 @@
1
1
  require_relative 'logger_helper'
2
+ require_relative '../version/version'
2
3
 
3
4
  class Displayer
4
5
  def initialize(params)
@@ -8,32 +9,33 @@ class Displayer
8
9
 
9
10
  def display_params
10
11
  begin
11
- display_text = []
12
-
13
- display_text << "Platform: #{@params[:platform]}" if @params[:platform]
14
- display_text << "Project Path: #{@params[:project_path]}" if @params[:project_path]
15
- display_text << "Exe File: #{@params[:exe]}" if @params[:exe]
16
- display_text << "Ruby Path: #{@params[:ruby_path]}" if @params[:ruby_path]
17
- display_text << "Compiler: TCC (Thanks! Credit: https://bellard.org/tcc/)"
18
- display_text << "Ruby Folder: #{File.basename(@params[:ruby_path])}" if @params[:ruby_path]
19
- display_text << "Main File: #{@params[:main_file]}" if @params[:main_file]
20
- display_text << "Launcher: #{@params[:launcher]}" if @params[:launcher]
21
- display_text << "Launcher Type: #{@params[:launcher_type]}" if @params[:launcher_type]
22
- display_text << "Template: #{@params[:template]}" if @params[:template]
23
- display_text << "Template: Default Template" unless @params[:template]
24
- display_text << "Log Path: Users Documents Directory"
12
+ display_map = {
13
+ "Platform" => @params[:platform],
14
+ "Project Path" => @params[:project_path],
15
+ "Exe File" => @params[:exe],
16
+ "Ruby Path" => @params[:ruby_path],
17
+ "Ruby Folder" => @params[:ruby_path] ? File.basename(@params[:ruby_path]) : nil,
18
+ "Main File" => @params[:main_file],
19
+ "Launcher" => @params[:launcher],
20
+ "Launcher Type" => @params[:launcher_type],
21
+ "Template" => @params[:template] || "Default Template",
22
+ "Log Path" => "Users Documents Directory"
23
+ }
24
+
25
+ display_text = display_map.map { |key, value| "#{key}: #{value}" if value }.compact
25
26
 
26
27
  puts display_text.join("\n") unless display_text.empty?
27
28
 
28
- rescue Exception => e
29
- print("Display Error: ".red); puts("#{e.message}".red)
29
+ rescue => e
30
+ print("Display Error: ".red); puts(e.message.red)
30
31
  @logger.error("Display Error: #{e.message}")
31
32
  end
32
33
  end
33
34
 
35
+
34
36
  def banner
35
- banner = -<<'BANNER'
36
- Standalone-Ruby v1.4 - Package your Ruby projects as exe!
37
+ banner = -<<"BANNER"
38
+ Standalone-Ruby v#{StandaloneRuby::VERSION} - Package your Ruby projects as exe!
37
39
  # Github: https://github.com/ardatetikbey/Standalone-Ruby
38
40
  # RubyGems: https://rubygems.org/gems/standalone-ruby
39
41
 
@@ -48,7 +48,7 @@ class ExePacker
48
48
  File.delete(stub_output)
49
49
  @logger.info("Stub file deleted successfully")
50
50
 
51
- puts("\nExe file has been generated!")
51
+ puts("\nExe file has been generated!".green_bold_dark)
52
52
  @logger.info("Exe file generated successfully at: #{exe_path}")
53
53
  rescue Exception => err
54
54
  @logger.error("Error occurred: #{err.message}")
@@ -65,4 +65,8 @@ class String
65
65
  def yellow
66
66
  "\e[33m#{self}\e[0m"
67
67
  end
68
+
69
+ def green_bold_dark
70
+ "\e[1m\e[38;5;28m#{self}\e[0m"
71
+ end
68
72
  end
@@ -55,7 +55,7 @@ class Launcher
55
55
  @exe_packer.pack
56
56
  @logger.info("Exe pack finished.")
57
57
 
58
- puts "\nThanks for using Standalone-Ruby!"
58
+ puts "Thanks for using Standalone-Ruby! Don't forget to star the project on Github."
59
59
 
60
60
  print("\nWARNING: ".yellow); puts("Instead of changing the path of the created exe file, create a shortcut. The same applies here as in every application.")
61
61
  @logger.info("Program finished.")
@@ -2,6 +2,7 @@ require 'fileutils'
2
2
  require 'optparse'
3
3
 
4
4
  require_relative 'logger_helper'
5
+ require_relative '../version/version'
5
6
 
6
7
  class ParameterParser
7
8
  def initialize
@@ -20,7 +21,7 @@ class ParameterParser
20
21
 
21
22
  def display_help
22
23
  help_text = <<~EOT
23
- Standalone-Ruby v1.4 - Package your Ruby projects as exe!
24
+ Standalone-Ruby v#{StandaloneRuby::VERSION} - Package your Ruby projects as exe!
24
25
 
25
26
  Usage: standalone-ruby [-h] [-p PROJECT_PATH] [-r RUBY_PATH] [-m MAIN_FILE] [-l LAUNCHER] [-t TEMPLATE] [-e EXE_FILE] [-c THREADS] [-g] [-v]
26
27
 
@@ -52,6 +53,10 @@ class ParameterParser
52
53
  -h, --help Show this help message.
53
54
 
54
55
  -v, --version Show program version.
56
+
57
+ Notes:
58
+ - Make sure that the Ruby interpreter you are using includes all the gems required for the target project.
59
+ - The Ruby interpreter uses Robocopy for copying, and the number of threads given affects the speed of this operation.
55
60
 
56
61
  For more details, please visit the documentation at:
57
62
  https://github.com/ardatetikbey/Standalone-Ruby
@@ -157,7 +162,7 @@ class ParameterParser
157
162
  end
158
163
 
159
164
  opts.on("-v", "--version") do
160
- puts "Standalone Ruby Gem Version 1.4"
165
+ puts "Standalone Ruby Gem Version #{StandaloneRuby::VERSION}"
161
166
  exit!
162
167
  end
163
168
 
@@ -15,7 +15,6 @@ class RubyCopy
15
15
  copy_output = `robocopy "#{@params[:ruby_path]}" "#{File.join(@params[:project_path].to_s, File.basename(@params[:ruby_path].to_s))}" /E /MT:#{@params[:threads].to_i} /V /ETA /NFL /NDL /R:1000000 /W:30 /NP`
16
16
  puts "Robocopy Command: robocopy \"#{@params[:ruby_path]}\" \"#{File.join(@params[:project_path], File.basename(@params[:ruby_path]))}\" /E /MT:#{@params[:threads].to_i} /V /ETA /NFL /NDL /R:1000000 /W:30 /NP"
17
17
 
18
- puts copy_output
19
18
  @logger.info("Robocopy output printed to screen.")
20
19
 
21
20
  puts("The Ruby interpreter copying process has been completed.")
@@ -0,0 +1,3 @@
1
+ module StandaloneRuby
2
+ VERSION = "1.4.2"
3
+ end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standalone-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.4'
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arda Tetik
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-06 00:00:00.000000000 Z
10
+ date: 2025-04-08 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Make your projects installation independent!
13
13
  email:
14
- - ardatetikruby@gmail.com
14
+ - ardatetik1881@gmail.com
15
15
  executables:
16
16
  - standalone-ruby
17
17
  extensions: []
@@ -104,6 +104,7 @@ files:
104
104
  - lib/utils/logger_helper.rb
105
105
  - lib/utils/parameter_parser.rb
106
106
  - lib/utils/ruby_copy.rb
107
+ - lib/version/version.rb
107
108
  homepage: https://github.com/ardatetikbey/Standalone-Ruby
108
109
  licenses:
109
110
  - MIT