ru.Bee 1.9.5 → 1.9.7
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/lib/Dockerfile +24 -14
- data/lib/rubee/cli/server.rb +7 -4
- data/lib/rubee/generator.rb +2 -1
- data/lib/rubee.rb +1 -1
- data/lib/tests/rubee_generator_test.rb +0 -1
- data/lib/tests/test.db +0 -0
- data/readme.md +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03af86ee565e361f05a02908203f132f44c2e897d5b5bacf97d69d6b2856399c
|
4
|
+
data.tar.gz: 9d1cf27fc856d40fe10c057521f17be4916e840999babfa6797a64827b53a053
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1375122c1165ede82010e967be939d884064b45290947ab68a109e94d7cd218f5e479aa6cae6cbf86e592765c223e422a500a8e8959cb7ee94514ab10175dc2e
|
7
|
+
data.tar.gz: 1509444ec809f496adf8a9e4552de7b96769845db2e68574876d0f90a7311a0765de62ec222c5ee2a3a937ad259b83b1de84a5ea75ed1ace5715a038413dc2fb
|
data/lib/Dockerfile
CHANGED
@@ -1,32 +1,42 @@
|
|
1
1
|
# Use an official Ruby runtime as a parent image
|
2
|
-
FROM ruby:3.4.1
|
2
|
+
FROM docker.io/library/ruby:3.4.1
|
3
3
|
|
4
4
|
# Set the working directory inside the container
|
5
5
|
WORKDIR /app
|
6
6
|
|
7
|
-
# Install system dependencies
|
8
|
-
RUN apt-get update -qq && apt-get install -y
|
7
|
+
# Install system dependencies + Node 20 via n
|
8
|
+
RUN apt-get update -qq && apt-get install -y \
|
9
|
+
curl \
|
10
|
+
build-essential \
|
11
|
+
libpq-dev \
|
12
|
+
python3 \
|
13
|
+
make \
|
14
|
+
g++ \
|
15
|
+
&& curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n | bash -s 20 \
|
16
|
+
&& npm install -g npm
|
9
17
|
|
10
|
-
# Copy Gemfile and Gemfile.lock, then install dependencies
|
11
|
-
COPY ../Gemfile Gemfile.lock ./
|
12
|
-
RUN bundle install
|
13
18
|
|
14
19
|
# Copy the rest of the application files into the container
|
15
|
-
COPY
|
20
|
+
COPY . .
|
21
|
+
|
22
|
+
# Remove Gemfile.lock to make sure it's re-downloaded and install dependencies
|
23
|
+
RUN rm -f Gemfile.lock \
|
24
|
+
&& bundle lock --add-platform ruby \
|
25
|
+
&& bundle install --redownload
|
16
26
|
|
17
|
-
# Ensure scripts are executable (after the files are copied)
|
18
|
-
RUN chmod +x ./bin/rubee
|
19
27
|
|
20
28
|
# Set the environment variable RACK_ENV to production
|
21
29
|
ENV RACK_ENV=production
|
22
30
|
|
23
|
-
#
|
24
|
-
RUN
|
31
|
+
# init react app
|
32
|
+
RUN rubee react prepare
|
25
33
|
|
26
|
-
|
34
|
+
# Initialize the database
|
35
|
+
RUN rubee db init
|
36
|
+
RUN rubee db run:all
|
27
37
|
|
28
38
|
# Expose the port the app will run on
|
29
|
-
EXPOSE
|
39
|
+
EXPOSE 7000
|
30
40
|
|
31
41
|
# Run the app (ensure this command correctly starts your app)
|
32
|
-
CMD
|
42
|
+
CMD rubee start
|
data/lib/rubee/cli/server.rb
CHANGED
@@ -16,8 +16,10 @@ LOGO
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def start(argv)
|
19
|
-
|
20
|
-
|
19
|
+
# get params
|
20
|
+
options = argv.select { _1.start_with?('--') }
|
21
|
+
port = options.find { _1.start_with?('--port') }&.split('=')&.last
|
22
|
+
jit = options.find { _1.start_with?('--jit') }&.split('=')&.last
|
21
23
|
|
22
24
|
port ||= '7000'
|
23
25
|
print_logo
|
@@ -28,8 +30,9 @@ LOGO
|
|
28
30
|
end
|
29
31
|
|
30
32
|
def start_dev(argv)
|
31
|
-
|
32
|
-
|
33
|
+
options = argv.select { _1.start_with?('--') }
|
34
|
+
port = options.find { _1.start_with?('--port') }&.split('=')&.last
|
35
|
+
jit = options.find { _1.start_with?('--jit') }&.split('=')&.last
|
33
36
|
|
34
37
|
port ||= '7000'
|
35
38
|
print_logo
|
data/lib/rubee/generator.rb
CHANGED
@@ -124,13 +124,14 @@ module Rubee
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def generate_sequel_schema(attribute)
|
127
|
+
prefix = @namespace == "" ? "" : "#{@app_name.snakeize}_"
|
127
128
|
type = attribute[:type]
|
128
129
|
name = if attribute[:name].is_a?(Array)
|
129
130
|
attribute[:name].map { |nom| ":#{nom}" }.join(", ").prepend('[') + ']'
|
130
131
|
else
|
131
132
|
":#{attribute[:name]}"
|
132
133
|
end
|
133
|
-
table = attribute[:table] || '
|
134
|
+
table = attribute[:table] || name.gsub(/_id$/, '').gsub(':', '').pluralize
|
134
135
|
options = attribute[:options] || {}
|
135
136
|
|
136
137
|
lookup_hash = {
|
data/lib/rubee.rb
CHANGED
@@ -16,7 +16,7 @@ module Rubee
|
|
16
16
|
JS_DIR = File.join(APP_ROOT, LIB, 'js') unless defined?(JS_DIR)
|
17
17
|
CSS_DIR = File.join(APP_ROOT, LIB, 'css') unless defined?(CSS_DIR)
|
18
18
|
ROOT_PATH = File.expand_path(File.join(__dir__, '..')) unless defined?(ROOT_PATH)
|
19
|
-
VERSION = '1.9.
|
19
|
+
VERSION = '1.9.7'
|
20
20
|
|
21
21
|
require_relative 'rubee/router'
|
22
22
|
require_relative 'rubee/logger'
|
@@ -124,7 +124,6 @@ describe 'Rubee::Generator' do
|
|
124
124
|
_(lines.include?('return if Rubee::SequelObject::DB.tables.include?(:apples)')).must_equal(true)
|
125
125
|
_(lines.include?('Rubee::SequelObject::DB.create_table(:apples) do')).must_equal(true)
|
126
126
|
_(lines.include?('foreign_key :blue_id')).must_equal(true)
|
127
|
-
_(lines.include?(':replace_with_table_name')).must_equal(true)
|
128
127
|
_(lines.include?('end')).must_equal(true)
|
129
128
|
end
|
130
129
|
end
|
data/lib/tests/test.db
CHANGED
Binary file
|
data/readme.md
CHANGED
@@ -102,9 +102,9 @@ bundle install
|
|
102
102
|
rubee start # or rubee start_dev for development
|
103
103
|
|
104
104
|
# Sarting from veriosn 1.8.0, you can also start you rubee server with yjit compiler and enjoy speed boost.
|
105
|
-
rubee start --yjit
|
105
|
+
rubee start --jit=yjit
|
106
106
|
# Option is available for dev environment too
|
107
|
-
rubee start_dev --yjit
|
107
|
+
rubee start_dev --jit=yjit
|
108
108
|
```
|
109
109
|
|
110
110
|
5. Open your browser and go to http://localhost:7000
|
@@ -648,6 +648,10 @@ end
|
|
648
648
|
|
649
649
|
```bash
|
650
650
|
rubee start
|
651
|
+
# It will start to server on port 7000 (default)
|
652
|
+
# You can change it by
|
653
|
+
|
654
|
+
rubee start --port=3000
|
651
655
|
```
|
652
656
|
|
653
657
|
3. Open your browser and navigate to http://localhost:3000/home
|