kaze 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c65dc7f1acffb3ae6d361fbd4f1172fb46b857611dc0cc96b9229219869a3576
4
- data.tar.gz: 5fa72ea32080be5c77a451bbc9cf24d6e8ff1c83af914c0b97004086cfd76e14
3
+ metadata.gz: d4c1c801693af9fede14200800169897e887342421d94b5910436217b4aac242
4
+ data.tar.gz: 8468cd9b25d02154257e3e049400e76aceef199e452ed78f3cfe043afe8578dd
5
5
  SHA512:
6
- metadata.gz: 51c93d3f462be29745003941d34a1d8d42da5ff6ab8127c59ae4fc9c3ab001cf23094cc5f298262b63d661507bb5e79d93657fce24ea1fd1c82d8de7d7e5ac7f
7
- data.tar.gz: 3abcbcda1957bf7415d10fc5c142183ca0227925843b6a1aeebd9c5a158fc5eeed0b855963c60cd785ce4201ac13dcbc169d27cdfe6d3dd12d9b41798d0e7931
6
+ metadata.gz: 01d69cf3549d24c7aa3d70af1e5ef6cf8fbca90a34bf4cb0aa2fab64809e8cdc8ce16641256af10e988d267a3cb82f9bdd1b85218db2e72bd91916101dd0c710
7
+ data.tar.gz: 55e0a82ff2f5bbfcac353c0b43ba798b5fbe0fb842cc53ebb5ade893777f3cbadfc9e857c9e1108627785a65c8de5ad7aac19321c2722b3251fb0e8d4bef946f
data/bin/kaze CHANGED
@@ -3,7 +3,7 @@
3
3
  require "kaze"
4
4
 
5
5
  begin
6
- Kaze::Commands::InstallCommand.start(ARGV)
6
+ Kaze::Commands::App.start(ARGV)
7
7
  rescue => e
8
8
  puts " \e[31mERROR (#{e.class}): #{e.message}\e[0m"
9
9
  puts e.backtrace if ENV["VERBOSE"]
@@ -1,25 +1,4 @@
1
- require 'bundler'
2
- require 'fileutils'
3
- require 'open3'
4
- require 'thor'
5
-
6
- class Kaze::Commands::InstallCommand < Thor
7
- include Kaze::Commands::InstallsHotwireStack
8
- include Kaze::Commands::InstallsInertiaStacks
9
-
10
- desc 'install [STACK]', 'Install the Kaze controllers and resources. Supported stacks: hotwire, react, vue.'
11
- def install(stack = 'hotwire')
12
- return say 'Kaze must be run in a new Rails application.', :red unless File.exist?("#{Dir.pwd}/bin/rails")
13
-
14
- return install_hotwire_stack if stack == 'hotwire'
15
-
16
- return install_inertia_react_stack if stack == 'react'
17
-
18
- return install_inertia_vue_stack if stack == 'vue'
19
-
20
- say 'Invalid stack. Supported stacks are [hotwire], [react], [vue].', :red
21
- end
22
-
1
+ module Kaze::Commands::Utils
23
2
  private
24
3
 
25
4
  def install_gems(gems = [], group = nil)
data/lib/kaze/commands.rb CHANGED
@@ -1,2 +1,38 @@
1
+ require 'bundler'
2
+ require 'fileutils'
3
+ require 'open3'
4
+ require 'thor'
5
+
1
6
  module Kaze::Commands
7
+ class App < Thor
8
+ include InstallsHotwireStack
9
+ include InstallsInertiaStacks
10
+ include Utils
11
+
12
+ def self.exit_on_failure?() true end
13
+
14
+ desc 'install [STACK]', 'Install the Kaze controllers and resources. Supported stacks: hotwire, react, vue.'
15
+ def install(stack = 'hotwire')
16
+ return say 'Kaze must be run in a new Rails application.', :red unless File.exist?("#{Dir.pwd}/bin/rails")
17
+
18
+ return say "Invalid stack. Supported stacks are #{available_stacks.keys.map { |k| "[#{k}]" }.join(', ')}.", :red unless available_stacks.key?(stack.to_sym)
19
+
20
+ send("install_#{available_stacks[stack.to_sym]}_stack")
21
+ end
22
+
23
+ desc 'version', 'Show Kaze version'
24
+ def version
25
+ puts Kaze::VERSION
26
+ end
27
+
28
+ private
29
+
30
+ def available_stacks
31
+ {
32
+ hotwire: 'hotwire',
33
+ react: 'inertia_react',
34
+ vue: 'inertia_vue'
35
+ }
36
+ end
37
+ end
2
38
  end
data/lib/kaze/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kaze
2
- VERSION = '0.12.0'
2
+ VERSION = '0.13.0'
3
3
  end
@@ -29,6 +29,6 @@
29
29
  <p>Regards,<br>
30
30
  <%= ENV.fetch("APP_NAME", "Rails") %></p>
31
31
  <!-- Subcopy -->
32
- <% content_for :subcopy do %>
32
+ <% content_for(:subcopy) do %>
33
33
  <p>If you're having trouble clicking the "Reset Password" button, copy and paste the URL below into your web browser: <span class="break-all"><%= link_to @reset_url, @reset_url %><span></p>
34
34
  <% end %>
@@ -28,6 +28,6 @@
28
28
  <p>Regards,<br>
29
29
  <%= ENV.fetch("APP_NAME", "Rails") %></p>
30
30
  <!-- Subcopy -->
31
- <% content_for :subcopy do %>
31
+ <% content_for(:subcopy) do %>
32
32
  <p>If you're having trouble clicking the "Verify Email Address" button, copy and paste the URL below into your web browser: <span class="break-all"><%= link_to @verification_url, @verification_url %><span></p>
33
33
  <% end %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaze
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cuong Giang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-28 00:00:00.000000000 Z
11
+ date: 2024-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -65,10 +65,9 @@ files:
65
65
  - bin/kaze
66
66
  - lib/kaze.rb
67
67
  - lib/kaze/commands.rb
68
- - lib/kaze/commands/install_command.rb
69
68
  - lib/kaze/commands/installs_hotwire_stack.rb
70
69
  - lib/kaze/commands/installs_inertia_stacks.rb
71
- - lib/kaze/commands/version_command.rb
70
+ - lib/kaze/commands/utils.rb
72
71
  - lib/kaze/version.rb
73
72
  - stubs/default/Procfile.dev
74
73
  - stubs/default/app/assets/stylesheets/application.css
@@ -1,6 +0,0 @@
1
- class Kaze::Commands::VersionCommand < Thor
2
- desc 'version', 'Show Kaze version'
3
- def version
4
- puts Kaze::VERSION
5
- end
6
- end