uni_rails 0.4.1 → 0.5.0.pre

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: 7fd4384d48263e99c4c7d16378ca8f9294c5effbca7f498d656de80f2618456d
4
- data.tar.gz: 52c6cbed8459c15fc9475460c398507f39e046d20e50657a586c2de6ceb2d00b
3
+ metadata.gz: '09bc97fa186f6e6762d25eb082edfae37a8bd78b494e6f74df1bb6511699848f'
4
+ data.tar.gz: b5091a90c8cfb8d4a58b962b0faab6530919eb61d7105ef1d8611e9eebcf3a46
5
5
  SHA512:
6
- metadata.gz: 2aa6a2c0d01f9ab5a7c3962934655d0251047bbc9d72dc771f501566917e9f83c2a1ebceb6dddebaad23526eb26a28553d543a6a7e16145ff40984bc206b2c4c
7
- data.tar.gz: a3616980a5dcbb57517232d2ad0986d4a08dc6fd924f977596e4330a612bad7f36703bf2f25b6c8c5b3d38275e05a8f9867db07a7ed6d161165fbf6e3134a276
6
+ metadata.gz: f14573fbfdb135eb107f10d764b154fd4ade4eb1435e6d0fb63b283025fdf47ff34954afd80ece74618f258ab03a272c96e6df6d1d6f5d91ade63435e266d7d0
7
+ data.tar.gz: cee9a854957769827e3ccb8c72a44a8fa3cabc5481a51effbb947ce096c84b3c67f16cfca3f389b0339f8acf4ecc726dda4032198dc79f27b667a3a81ee887e0
@@ -5,7 +5,7 @@ require "bundler/inline"
5
5
 
6
6
  gemfile do
7
7
  source "https://www.rubygems.org"
8
- gem "uni_rails"
8
+ gem "uni_rails", "~> 0.4.0"
9
9
  gem "sqlite3", "~> 1.7"
10
10
  gem "byebug"
11
11
  end
@@ -15,7 +15,7 @@ require "sqlite3"
15
15
  require "byebug"
16
16
 
17
17
  # ==== ROUTES ====
18
- UniRails::App.routes.append do
18
+ UniRails.routes do
19
19
  root "resource_names#new"
20
20
  resources :resource_names
21
21
  end
@@ -85,4 +85,5 @@ HTML
85
85
  UniRails.register_view "resource_names/show.html.erb", <<~HTML
86
86
  HTML
87
87
 
88
- UniRails.run(Port: 3000)
88
+ UniRails.run(Port: 3000)
89
+ # UniRails.run(Host: '0.0.0.0', Port: 3000) # when run in a docker container
@@ -10,7 +10,7 @@ end
10
10
 
11
11
  require 'uni_rails'
12
12
 
13
- UniRails::App.routes.append do
13
+ UniRails.routes do
14
14
  root 'pages#index'
15
15
  end
16
16
 
@@ -15,7 +15,7 @@ require 'rackup/handler/falcon'
15
15
 
16
16
  UniRails.rackup_handler = Rackup::Handler::Falcon
17
17
 
18
- UniRails::App.routes.append do
18
+ UniRails.routes do
19
19
  root 'pages#index'
20
20
  end
21
21
 
@@ -15,7 +15,7 @@ require 'rack/handler/puma'
15
15
 
16
16
  UniRails.rackup_handler = Rack::Handler::Puma
17
17
 
18
- UniRails::App.routes.append do
18
+ UniRails.routes do
19
19
  root 'pages#index'
20
20
  end
21
21
 
@@ -10,7 +10,7 @@ end
10
10
 
11
11
  require 'uni_rails'
12
12
 
13
- UniRails::App.routes.append do
13
+ UniRails.routes do
14
14
  root 'pages#index'
15
15
  end
16
16
 
@@ -23,7 +23,7 @@ ActiveRecord::Schema.define do
23
23
  end
24
24
  end
25
25
 
26
- UniRails::App.routes.append do
26
+ UniRails.routes do
27
27
  resources :todos do
28
28
  put :complete, on: :member
29
29
  end
@@ -27,7 +27,7 @@ end
27
27
 
28
28
  UniRails.enable_turbo_rails!
29
29
 
30
- UniRails::App.routes.append do
30
+ UniRails.routes do
31
31
  root 'todos#index'
32
32
  resources :todos do
33
33
  patch :change_status, on: :member
@@ -24,7 +24,7 @@ ActiveRecord::Schema.define do
24
24
  end
25
25
  end
26
26
 
27
- UniRails::App.routes.append do
27
+ UniRails.routes do
28
28
  root 'todos#index'
29
29
  resources :todos
30
30
  end
@@ -4,7 +4,7 @@ module UniRails
4
4
  include Singleton
5
5
 
6
6
  class << self
7
- delegate :imports,
7
+ delegate :imports,
8
8
  :dependencies, :dependencies=,
9
9
  :javascript, :javascript=,
10
10
  to: :instance
data/lib/uni_rails/app.rb CHANGED
@@ -8,20 +8,24 @@ require "action_controller/railtie"
8
8
  # require "action_mailer/railtie"
9
9
  # require "action_mailbox/engine"
10
10
  # require "action_text/engine"
11
- # require "action_view/railtie"
11
+ require "action_view/railtie"
12
12
  # require "action_cable/engine"
13
13
  # require "rails/test_unit/railtie"
14
14
  require "action_view/testing/resolvers"
15
15
 
16
16
  module UniRails
17
17
  class App < Rails::Application
18
- config.load_defaults 7.1
18
+ config.load_defaults 7.2
19
19
 
20
- config.eager_load = true
20
+ # config.eager_load = true
21
21
  config.logger = Logger.new(STDOUT)
22
22
  config.log_level = :debug
23
23
  config.secret_key_base = ENV.fetch('SECRET_KEY_BASE')
24
24
 
25
+ routes.draw do
26
+ resources :users
27
+ end
28
+
25
29
  config.after_initialize do
26
30
  ActionController::Base.view_paths = Views.view_paths
27
31
  ActionController::Base.include App.routes.url_helpers
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UniRails
4
- VERSION = "0.4.1"
4
+ VERSION = "0.5.0.pre"
5
5
  end
data/lib/uni_rails.rb CHANGED
@@ -42,6 +42,15 @@ module UniRails
42
42
  )
43
43
  end
44
44
 
45
+ def self.routes(&block)
46
+ App.initializer :add_uni_routes, before: :add_internal_routes do |app|
47
+ app.routes.prepend do
48
+ get "/rails/info/routes" => "rails/info#routes", internal: true
49
+ end
50
+ app.routes.prepend(&block)
51
+ end
52
+ end
53
+
45
54
  def self.rackup_handler=(handler)
46
55
  @@rackup_handler = handler
47
56
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uni_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Barret
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-20 00:00:00.000000000 Z
11
+ date: 2024-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 7.1.0
19
+ version: 7.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 7.1.0
26
+ version: 7.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rackup
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -97,14 +97,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
97
  requirements:
98
98
  - - ">="
99
99
  - !ruby/object:Gem::Version
100
- version: 2.6.0
100
+ version: 3.2.0
101
101
  required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ">="
103
+ - - ">"
104
104
  - !ruby/object:Gem::Version
105
- version: '0'
105
+ version: 1.3.1
106
106
  requirements: []
107
- rubygems_version: 3.4.21
107
+ rubygems_version: 3.4.19
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: A Ruby library to create single-file Rails application