raithon-cli 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d42d3361021adfa43ff5c8c43b053061cc9071e41fe5ec489783c49f7f19924d
4
+ data.tar.gz: f57edfd3012c06316567bbc1704635a5ea817bb34bf066fa006685ebc7ace432
5
+ SHA512:
6
+ metadata.gz: 24ab0ec74ffa00c1f4f42059f3dc501e8727b85f54c52d29d84dc50b669e554abdd6bc359aca7e7ca83c1a17d8a8c257b7a92a45c0fcedd126804d38ced1d605
7
+ data.tar.gz: c3c8db6d4d27e58768a94e0a40ed7d3c4ee8de1f0e49448074c6435ab754f26374a7b7e7149cbc294de24bb257dc985bcc3fa3dbea6157ba80d9fa9d69c3bd65
data/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # Raithon CLI
2
+
3
+ `raithon-cli` provides the `raithon` command.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ gem install raithon-cli
data/bin/raithon ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "raithon-cli"
5
+
6
+ Raithon::CLI.start(ARGV)
@@ -0,0 +1,132 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "thor"
4
+ require "fileutils"
5
+
6
+ module Raithon
7
+ class CLI < Thor
8
+ desc "new APP_NAME", "Create a new Raithon application"
9
+ def new(app_name)
10
+ @app_name = app_name
11
+
12
+ say "Creating Raithon app: #{app_name}"
13
+ create_structure
14
+ say "Application #{app_name} created successfully."
15
+ end
16
+
17
+ private
18
+
19
+ def app_path(*paths)
20
+ File.join(@app_name, *paths)
21
+ end
22
+
23
+ def create_structure
24
+ create_root
25
+ create_app_folders
26
+ create_config_files
27
+ create_lib_file
28
+ create_gitignore
29
+ create_gemfile
30
+ end
31
+
32
+ def create_root
33
+ FileUtils.mkdir_p(@app_name)
34
+ end
35
+
36
+ def create_app_folders
37
+ %w[
38
+ app/controllers
39
+ app/models
40
+ app/views
41
+ config
42
+ lib
43
+ ].each do |path|
44
+ FileUtils.mkdir_p(app_path(path))
45
+ end
46
+
47
+ File.write(
48
+ app_path("app/controllers/application_controller.rb"),
49
+ <<~RUBY
50
+ class ApplicationController
51
+ def index
52
+ "Welcome to Raithon!"
53
+ end
54
+ end
55
+ RUBY
56
+ )
57
+ end
58
+
59
+ def create_config_files
60
+ File.write(
61
+ app_path("config/application.rb"),
62
+ <<~RUBY
63
+ # frozen_string_literal: true
64
+
65
+ require "raithon-core"
66
+
67
+ module #{camelize(@app_name)}
68
+ class Application < Raithon::Core::Application
69
+ def boot
70
+ puts "Booting #{#{@app_name}.inspect}..."
71
+ end
72
+ end
73
+ end
74
+ RUBY
75
+ )
76
+
77
+ File.write(
78
+ app_path("config/routes.rb"),
79
+ <<~RUBY
80
+ # Define your routes here
81
+ #
82
+ # Example:
83
+ # get "/", to: "application#index"
84
+ RUBY
85
+ )
86
+ end
87
+
88
+ def create_lib_file
89
+ File.write(
90
+ app_path("lib/#{@app_name}.rb"),
91
+ <<~RUBY
92
+ # frozen_string_literal: true
93
+
94
+ module #{camelize(@app_name)}
95
+ # Your Raithon app code goes here
96
+ end
97
+ RUBY
98
+ )
99
+ end
100
+
101
+ def create_gitignore
102
+ File.write(
103
+ app_path(".gitignore"),
104
+ <<~TXT
105
+ /log/*
106
+ /tmp/*
107
+ .env
108
+ TXT
109
+ )
110
+ end
111
+
112
+ def create_gemfile
113
+ File.write(
114
+ app_path("Gemfile"),
115
+ <<~RUBY
116
+ # frozen_string_literal: true
117
+
118
+ source "https://rubygems.org"
119
+
120
+ gem "raithon-core", "~> 0.1.0"
121
+ RUBY
122
+ )
123
+ end
124
+
125
+ # ----------------------------
126
+ # Helpers
127
+ # ----------------------------
128
+ def camelize(str)
129
+ str.split("_").map(&:capitalize).join
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Raithon
4
+ module CLI
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "raithon/cli"
4
+ require "raithon/cli/version"
5
+
6
+ module Raithon
7
+ # Entry namespace for Raithon CLI gem
8
+ end
data/lib/raithon.rb ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "raithon/cli"
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: raithon-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sensei James
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-11-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: raithon-core
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.1.0
41
+ description: Provides commands like `raithon new` to scaffold Raithon applications.
42
+ email:
43
+ - delacruzjamesmartin@gmail.com
44
+ executables:
45
+ - raithon
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - README.md
50
+ - bin/raithon
51
+ - lib/raithon-cli.rb
52
+ - lib/raithon.rb
53
+ - lib/raithon/cli/cli.rb
54
+ - lib/raithon/cli/version.rb
55
+ homepage: https://rubygems.org/gems/raithon-cli
56
+ licenses:
57
+ - MIT
58
+ metadata: {}
59
+ post_install_message:
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubygems_version: 3.5.9
75
+ signing_key:
76
+ specification_version: 4
77
+ summary: Command Line Interface for the Raithon framework
78
+ test_files: []