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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb15781bf76b459409f3b668f47a91dccc70dfd4a63e509c5dcd31aae43bb182
4
- data.tar.gz: 7c153d39a196b593626cc981c0859fd932f1d366e4cd5f1009a5b9d81d2dd97c
3
+ metadata.gz: 03af86ee565e361f05a02908203f132f44c2e897d5b5bacf97d69d6b2856399c
4
+ data.tar.gz: 9d1cf27fc856d40fe10c057521f17be4916e840999babfa6797a64827b53a053
5
5
  SHA512:
6
- metadata.gz: 53d83d13a2dc1a9e1937d343b460e480706a27a0dae7f4836bd1d4268db7ad8633f82a5cbccda82e25ad1a0b84d66633212e8972834839f4e6a8be27c8c70006
7
- data.tar.gz: 474ce9040cbcff8c6a61f6d61c1615bfeba6ce3fc7b72565c25b27f4dae333e4c4dd285839cddba2b699ec612bbfe7a5b8a79c7e2a4abb9cb0fe517bfb4a6c9f
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 required for your app (e.g., build tools for gems like pg, etc.)
8
- RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
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
- # Initialize the database (make sure this script exists in your project structure)
24
- RUN ./com/db init
31
+ # init react app
32
+ RUN rubee react prepare
25
33
 
26
- RUN ./com/db run:create_users
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 8080
39
+ EXPOSE 7000
30
40
 
31
41
  # Run the app (ensure this command correctly starts your app)
32
- CMD ./com/rubee start:8080
42
+ CMD rubee start
@@ -16,8 +16,10 @@ LOGO
16
16
  end
17
17
 
18
18
  def start(argv)
19
- _, port = argv.first&.split(':')
20
- jit = argv[1]
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
- _, port = argv.first&.split(':')
32
- jit = argv[1]
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
@@ -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] || 'replace_with_table_name'
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.5'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ru.Bee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.5
4
+ version: 1.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Saltykov