Skip to content

Commit b774b28

Browse files
committed
rbui -> ruby_ui
1 parent a816b21 commit b774b28

111 files changed

Lines changed: 529 additions & 423 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,26 @@ RubyUI is a UI component library designed to let Ruby developers create modern,
2828
### 1. Install the gem
2929

3030
```bash
31-
bundle add rbui
31+
bundle add ruby_ui
3232
```
3333

3434
or add it to your Gemfile:
3535

3636
```ruby
37-
gem "rbui"
37+
gem "ruby_ui"
3838
```
3939

4040
### 2. Run the installer:
4141

4242
```bash
43-
bin/rails g rbui:install
43+
bin/rails g ruby_ui:install
4444
```
4545

4646
### 3. Done! 🎉
4747

4848
## Documentation 📖
4949

50-
Visit https://rbui.dev/docs/introduction to view the full documentation, including:
50+
Visit https://ruby_ui.dev/docs/introduction to view the full documentation, including:
5151

5252
- Detailed component guides
5353
- Themes

bin/console

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env ruby
22

33
require "bundler/setup"
4-
require "rbui"
4+
require "ruby_ui"
55

66
Bundler.require(:development)
77

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module RubyUI
44
module Generators
55
class BaseGenerator < defined?(Rails::Generators::Base) ? Rails::Generators::Base : Object
6-
namespace "rbui:base"
6+
namespace "ruby_ui:base"
77

88
source_root File.join(__dir__, "templates")
99

lib/generators/rbui/component_generator.rb renamed to lib/generators/ruby_ui/component_generator.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module RubyUI
22
module Generators
33
class ComponentGenerator < RubyUI::Generators::BaseGenerator
4-
namespace "rbui:component"
4+
namespace "ruby_ui:component"
55

66
source_root File.expand_path("../../..", __dir__)
77
argument :component_name, type: :string, required: true
@@ -21,7 +21,7 @@ def copy_common_files
2121
end
2222

2323
def copy_component_files
24-
puts "Component #{component} not found in rbui gem" if component_source.empty?
24+
puts "Component #{component} not found in ruby_ui gem" if component_source.empty?
2525

2626
component_files = Dir.glob("#{component_source}/*")
2727

@@ -32,22 +32,22 @@ def copy_component_files
3232
end
3333

3434
def update_index_file
35-
index_path = File.join(destination_root, "app/components/rbui/index.js")
35+
index_path = File.join(destination_root, "app/components/ruby_ui/index.js")
3636

37-
rbui_index_content = File.read(index_path)
37+
ruby_ui_index_content = File.read(index_path)
3838

39-
updated_rbui_index_content = add_controller_registration(rbui_index_content)
39+
updated_ruby_ui_index_content = add_controller_registration(ruby_ui_index_content)
4040

41-
File.write(index_path, updated_rbui_index_content)
41+
File.write(index_path, updated_ruby_ui_index_content)
4242
end
4343

44-
def add_controller_registration(rbui_index_content)
44+
def add_controller_registration(ruby_ui_index_content)
4545
valid_controllers = get_valid_controllers
4646

47-
rbui_index_content = update_imports(rbui_index_content, valid_controllers)
48-
update_registrations(rbui_index_content, valid_controllers)
47+
ruby_ui_index_content = update_imports(ruby_ui_index_content, valid_controllers)
48+
update_registrations(ruby_ui_index_content, valid_controllers)
4949
# Uncomment the following line if you want to update exports
50-
# rbui_index_content = update_exports(rbui_index_content, valid_controllers)
50+
# ruby_ui_index_content = update_exports(ruby_ui_index_content, valid_controllers)
5151
end
5252

5353
def get_valid_controllers
@@ -74,8 +74,8 @@ def controller_info(controller_file)
7474
# Build the new import path
7575
new_import_path = new_import_path("./#{relative_path.dirname}/#{file_name}")
7676

77-
# Create the registration name by dasherizing the component name and prefixing with 'rbui--'
78-
registration_name = "rbui--#{component_name.dasherize}"
77+
# Create the registration name by dasherizing the component name and prefixing with 'ruby_ui--'
78+
registration_name = "ruby_ui--#{component_name.dasherize}"
7979

8080
# Return a hash with import, registration, and export statements
8181
{
@@ -92,7 +92,7 @@ def controller_info(controller_file)
9292

9393
def new_import_path(relative_path)
9494
if using_importmap?
95-
"rbui/#{relative_path.sub(/^\.\//, "")}"
95+
"ruby_ui/#{relative_path.sub(/^\.\//, "")}"
9696
else
9797
relative_path
9898
end
@@ -118,11 +118,11 @@ def component
118118
end
119119

120120
def source_path
121-
@source_path ||= "lib/rbui"
121+
@source_path ||= "lib/ruby_ui"
122122
end
123123

124124
def destination_path
125-
@destination_path ||= "app/components/rbui"
125+
@destination_path ||= "app/components/ruby_ui"
126126
end
127127

128128
def component_source

lib/generators/rbui/install/install_generator.rb renamed to lib/generators/ruby_ui/install/install_generator.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module RubyUI
66
module Generators
77
class InstallGenerator < RubyUI::Generators::BaseGenerator
8-
namespace "rbui:install"
8+
namespace "ruby_ui:install"
99

1010
if defined?(Rails::Generators::Base)
1111
source_root File.expand_path("templates", __dir__)
@@ -62,8 +62,8 @@ def install_stuff
6262
say "Tailwind CSS is required for RubyUI", :red
6363
end
6464

65-
say "Add rbui initializer"
66-
template "base_store_initializer.rb", "config/initializers/rbui.rb"
65+
say "Add ruby_ui initializer"
66+
template "base_store_initializer.rb", "config/initializers/ruby_ui.rb"
6767

6868
if using_importmap?
6969
say "Using importmaps, adding tailwind-animate"
@@ -90,16 +90,16 @@ def install_stuff
9090
template "application.tailwind.css", "app/assets/stylesheets/application.tailwind.css", force: true
9191
end
9292

93-
def pin_rbui_js
93+
def pin_ruby_ui_js
9494
stimulus_path = Rails.root.join("app/javascript/application.js")
95-
package_name = "rbui-js"
95+
package_name = "ruby_ui-js"
9696

9797
say "Add RubyUI Stimulus controllers"
98-
# run "mkdir -p app/javascript/controllers/rbui-js"
99-
template "index.js", "app/components/rbui/index.js"
98+
# run "mkdir -p app/javascript/controllers/ruby_ui-js"
99+
template "index.js", "app/components/ruby_ui/index.js"
100100

101101
if using_importmap?
102-
gsub_file "app/components/rbui/index.js", /^import { application }.*$/ do
102+
gsub_file "app/components/ruby_ui/index.js", /^import { application }.*$/ do
103103
'import { application } from "controllers/application";'
104104
end
105105

@@ -109,29 +109,29 @@ def pin_rbui_js
109109

110110
say "Pin #{package_name}"
111111
append_to_file Rails.root.join("config/importmap.rb") do
112-
"pin_all_from \"app/components/rbui\", under: \"rbui\"\n"
112+
"pin_all_from \"app/components/ruby_ui\", under: \"ruby_ui\"\n"
113113
end
114114

115115
run "bin/importmap pin #{package_name}"
116-
append_to_file stimulus_path, "\nimport \"rbui\";\n"
116+
append_to_file stimulus_path, "\nimport \"ruby_ui\";\n"
117117

118118
manifest_path = Rails.root.join("app/assets/config/manifest.js")
119119
if File.exist?(manifest_path)
120-
append_to_file manifest_path, "\n//= link rbui/index.js\n"
120+
append_to_file manifest_path, "\n//= link ruby_ui/index.js\n"
121121
end
122122

123123
fix_import_maps!
124124
else
125-
say "Add rbui-js package"
125+
say "Add ruby_ui-js package"
126126
run "yarn add #{package_name}"
127127

128-
append_to_file stimulus_path, "\nimport \"../components/rbui\";\n"
128+
append_to_file stimulus_path, "\nimport \"../components/ruby_ui\";\n"
129129

130130
run "yarn build"
131131
end
132132
end
133133

134-
def include_rbui
134+
def include_ruby_ui
135135
message = "Include RubyUI in your global component layout?\n This allows to call RubyUI.Button {\"button\"} / RubyUI::Button.new {\"button\"} with Button {\"button\"} (y/n)"
136136
if yes?(message)
137137
say "Add RubyUI to your global component layout"
File renamed without changes.

lib/generators/rbui/install/templates/application.tailwind.css.tt renamed to lib/generators/ruby_ui/install/templates/application.tailwind.css.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
--ring: 240 5.9% 10%;
2626
--radius: 0.5rem;
2727

28-
/* rbui especific */
28+
/* ruby_ui especific */
2929
--warning: 38 92% 50%;
3030
--warning-foreground: 0 0% 100%;
3131
--success: 87 100% 37%;
@@ -53,7 +53,7 @@
5353
--input: 240 3.7% 15.9%;
5454
--ring: 240 4.9% 83.9%;
5555

56-
/* rbui especific */
56+
/* ruby_ui especific */
5757
--warning: 38 92% 50%;
5858
--warning-foreground: 0 0% 100%;
5959
--success: 84 81% 44%;

lib/generators/rbui/install/templates/base_store_initializer.rb.tt renamed to lib/generators/ruby_ui/install/templates/base_store_initializer.rb.tt

File renamed without changes.

lib/generators/rbui/install/templates/index.js.tt renamed to lib/generators/ruby_ui/install/templates/index.js.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { application } from "../../../app/javascript/controllers/application";
44
// import ComboboxController from "./combobox/combobox_controller";
55

66
// Register all controllers
7-
// application.register("rbui--combobox", ComboboxController);
7+
// application.register("ruby_ui--combobox", ComboboxController);
88

9-
import RubyUI from "rbui-js";
9+
import RubyUI from "ruby_ui-js";
1010
RubyUI.initialize(application);

lib/generators/rbui/install/templates/index_view.rb.tt renamed to lib/generators/ruby_ui/install/templates/index_view.rb.tt

File renamed without changes.

0 commit comments

Comments
 (0)