roda-project 0.1.6 → 0.1.8

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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/lib/roda/project/bin/generator.rb +11 -0
  3. data/lib/roda/project/bin/generators/migration.rb +51 -0
  4. data/lib/roda/project/bin/generators/routes.rb +107 -0
  5. data/lib/roda/project/bin/generators.rb +36 -0
  6. data/lib/roda/project/cli.rb +17 -31
  7. data/lib/roda/project/generator.rb +19 -0
  8. data/lib/roda/project/helpers/ids.rb +34 -1
  9. data/lib/roda/project/helpers/{input.rb → interactive_input.rb} +14 -2
  10. data/lib/roda/project/helpers/template.rb +9 -5
  11. data/lib/roda/project/{context.rb → main_context.rb} +27 -10
  12. data/lib/roda/{templates → project/templates}/base/app/app.rb.erb +10 -7
  13. data/lib/roda/{templates → project/templates}/base/minimal/Gemfile.erb +1 -1
  14. data/lib/roda/{templates → project/templates}/base/minimal/app.rb +4 -1
  15. data/lib/roda/project/templates/base/minimal/bin/roda.erb +47 -0
  16. data/lib/roda/{templates → project/templates}/base/scaffold/Gemfile.erb +8 -7
  17. data/lib/roda/{templates → project/templates}/base/scaffold/app/config/config.rb.erb +2 -13
  18. data/lib/roda/project/templates/base/scaffold/bin/roda.erb +153 -0
  19. data/lib/roda/project/templates/front-end/app/views/layout.erb +23 -0
  20. data/lib/roda/{templates → project/templates}/front-end/esbuild.js +6 -6
  21. data/lib/roda/project/version.rb +2 -2
  22. data/lib/roda/project.rb +23 -12
  23. metadata +79 -62
  24. data/lib/roda/templates/base/minimal/Rakefile.erb +0 -51
  25. data/lib/roda/templates/base/scaffold/Rakefile.erb +0 -210
  26. data/lib/roda/templates/front-end/app/views/foo/html.rb +0 -6
  27. data/lib/roda/templates/front-end/app/views/html.rb +0 -38
  28. data/lib/roda/templates/front-end/app/views/layout.erb +0 -15
  29. /data/lib/roda/{templates → project/templates}/base/minimal/AGENTS.md +0 -0
  30. /data/lib/roda/{templates → project/templates}/base/minimal/Gemfile.lock +0 -0
  31. /data/lib/roda/{templates → project/templates}/base/minimal/Guardfile +0 -0
  32. /data/lib/roda/{templates → project/templates}/base/minimal/README.md +0 -0
  33. /data/lib/roda/{templates → project/templates}/base/minimal/boot.rb +0 -0
  34. /data/lib/roda/{templates → project/templates}/base/minimal/config.ru +0 -0
  35. /data/lib/roda/{templates → project/templates}/base/minimal/public/exception_page.css +0 -0
  36. /data/lib/roda/{templates → project/templates}/base/scaffold/AGENTS.md +0 -0
  37. /data/lib/roda/{templates → project/templates}/base/scaffold/Guardfile +0 -0
  38. /data/lib/roda/{templates → project/templates}/base/scaffold/README.md +0 -0
  39. /data/lib/roda/{templates → project/templates}/base/scaffold/app/config/locales/en.yml +0 -0
  40. /data/lib/roda/{templates → project/templates}/base/scaffold/app/config/locales/foo/en.yml +0 -0
  41. /data/lib/roda/{templates → project/templates}/base/scaffold/app/config/locales/foo/pt-br.yml +0 -0
  42. /data/lib/roda/{templates → project/templates}/base/scaffold/app/config/locales/pt-br.yml +0 -0
  43. /data/lib/roda/{templates → project/templates}/base/scaffold/app/config/providers/logger.rb +0 -0
  44. /data/lib/roda/{templates → project/templates}/base/scaffold/app/config/providers/mailer.rb +0 -0
  45. /data/lib/roda/{templates → project/templates}/base/scaffold/app/routes/foo.rb.erb +0 -0
  46. /data/lib/roda/{templates → project/templates}/base/scaffold/boot.rb.erb +0 -0
  47. /data/lib/roda/{templates → project/templates}/base/scaffold/config.ru.erb +0 -0
  48. /data/lib/roda/{templates → project/templates}/base/scaffold/public/exception_page.css +0 -0
  49. /data/lib/roda/{templates → project/templates}/database/app/config/providers/db/conn.rb +0 -0
  50. /data/lib/roda/{templates → project/templates}/database/db/seeds.rb +0 -0
  51. /data/lib/roda/{templates → project/templates}/front-end/app/assets/css/app.css +0 -0
  52. /data/lib/roda/{templates → project/templates}/front-end/app/assets/js/app.js +0 -0
  53. /data/lib/roda/{templates → project/templates}/front-end/app/assets/js/some/foo.js +0 -0
  54. /data/lib/roda/{templates → project/templates}/front-end/app/views/foo/bar.erb +0 -0
  55. /data/lib/roda/{templates → project/templates}/front-end/app/views/index.erb +0 -0
  56. /data/lib/roda/{templates → project/templates}/front-end/package.json +0 -0
  57. /data/lib/roda/{templates → project/templates}/front-end/public/assets/app.css +0 -0
  58. /data/lib/roda/{templates → project/templates}/front-end/public/assets/app.js +0 -0
  59. /data/lib/roda/{templates → project/templates}/front-end/public/images/roda-project.png +0 -0
  60. /data/lib/roda/{templates → project/templates}/rodauth/app/models/account.rb +0 -0
  61. /data/lib/roda/{templates → project/templates}/rodauth/app/views/create-account.erb +0 -0
  62. /data/lib/roda/{templates → project/templates}/rodauth/db/migrations/001_add_rodauth.rb +0 -0
  63. /data/lib/roda/{templates → project/templates}/tests/minimal/minitest/spec/app_spec.rb +0 -0
  64. /data/lib/roda/{templates → project/templates}/tests/minimal/minitest/spec/spec_helper.rb.erb +0 -0
  65. /data/lib/roda/{templates → project/templates}/tests/minimal/rspec/spec/app_spec.rb +0 -0
  66. /data/lib/roda/{templates → project/templates}/tests/minimal/rspec/spec/spec_helper.rb +0 -0
  67. /data/lib/roda/{templates → project/templates}/tests/minitest/spec/app/app_spec.rb.erb +0 -0
  68. /data/lib/roda/{templates → project/templates}/tests/minitest/spec/app/routes/foo_spec.rb +0 -0
  69. /data/lib/roda/{templates → project/templates}/tests/minitest/spec/app/routes/test_branch_spec.rb +0 -0
  70. /data/lib/roda/{templates → project/templates}/tests/minitest/spec/app/views/html_spec.rb +0 -0
  71. /data/lib/roda/{templates → project/templates}/tests/minitest/spec/spec_helper.rb.erb +0 -0
  72. /data/lib/roda/{templates → project/templates}/tests/rspec/spec/app/app_spec.rb.erb +0 -0
  73. /data/lib/roda/{templates → project/templates}/tests/rspec/spec/app/routes/foo_spec.rb +0 -0
  74. /data/lib/roda/{templates → project/templates}/tests/rspec/spec/app/routes/test_branch_spec.rb +0 -0
  75. /data/lib/roda/{templates → project/templates}/tests/rspec/spec/app/views/html_spec.rb +0 -0
  76. /data/lib/roda/{templates → project/templates}/tests/rspec/spec/spec_helper.rb.erb +0 -0
@@ -10,17 +10,20 @@ gem "zeitwerk"
10
10
  # Authentication
11
11
  gem "rodauth"
12
12
  gem "jwt"
13
- <% end %>
13
+ <% end %><% if context.database? %>
14
14
  # Database
15
15
  gem "sequel"
16
- <%= "gem \"#{context.db_gem}\"" if context.database? %>
17
-
16
+ <%= "gem \"#{context.db_gem}\"" %>
17
+ <% end %>
18
18
  # Web Server
19
19
  gem "puma"
20
20
  # gem "falcon"
21
21
  # gem 'iodine'
22
- # gem 'thin'
22
+ # gem 'thin'<% if context.fullstack? %>
23
23
 
24
+ # Views
25
+ gem 'roda-assets_manifest'
26
+ <% end %>
24
27
  # Performance
25
28
  gem "oj"
26
29
  # gem 'async'
@@ -29,12 +32,11 @@ gem "oj"
29
32
  # gem "rack-attack"
30
33
 
31
34
  # Misc
32
- gem "html_slice"
33
35
  gem "mail"
34
36
  gem "bcrypt"
35
37
  gem "logger"
36
-
37
38
  group :development do
39
+ gem "thor"
38
40
  gem "guard-puma"
39
41
  gem "guard-livereload"
40
42
  gem "rack-livereload"
@@ -44,7 +46,6 @@ group :development do
44
46
  gem "standard"<% if context.minitest? %>
45
47
  gem "minitest"
46
48
  gem "minitest-hooks"
47
- gem "rake"
48
49
  <% else %>
49
50
  gem "rspec"<% end %>
50
51
  end
@@ -11,23 +11,12 @@ module Config
11
11
  locale: ["en", "pt-br"]
12
12
  }<% end %><% if context.database? %>,
13
13
  db: {
14
- url: not_production? ? <%= context.dev_db_url %> : ENV["DATABASE_URL"]
15
- }<% end %><% if context.fullstack? %>,
16
- assets: {
17
- host: '/public/assets',
18
- manifest:
14
+ url: not_production? ? <%= context.default_db_url %> : ENV["DATABASE_URL"]
19
15
  }<% end %>
20
16
  }
21
17
  end
22
18
 
23
- def not_production? = environment != "production"<% if context.fullstack? %>
24
- def manifest
25
- manifest_path = File.expand_path("../../public/assets/manifest.json", __dir__)
26
- return JSON.parse(File.read(manifest_path)) if File.exist?(manifest_path)
27
-
28
- {}
29
- end
30
- <% end %>
19
+ def not_production? = environment != "production"
31
20
  def environment
32
21
  ENV["RACK_ENV"] || "development"
33
22
  end
@@ -0,0 +1,153 @@
1
+ #!/usr/bin/env ruby
2
+ require "thor"
3
+ require "roda/project/bin/generators"
4
+ <% if context.database? %>
5
+ class Db < Thor
6
+ desc "migrate", "Migrate the database. Optional: provide target version, e.g., 'roda db:migrate 1'"
7
+ option :target, type: :numeric, aliases: "-t", desc: "provide target version"
8
+ def migrate
9
+ require_db_deps
10
+ require_relative "../boot"
11
+
12
+ Sequel.extension :migration
13
+ db = Providers::DB::Conn.get
14
+ if options[:target]
15
+ Sequel::Migrator.run(db, "db/migrations", target: options[:target].to_i)
16
+ else
17
+ Sequel::Migrator.run(db, "db/migrations")
18
+ end
19
+ puts "* database migration complete."
20
+ end
21
+ <% if context.sqlite? %>
22
+ desc "create", "Create the database"
23
+ def create
24
+ require_db_deps
25
+ path = parse_sqlite_path(Config.get[:db][:url])
26
+ FileUtils.mkdir_p(File.dirname(path))
27
+ Sequel.connect("sqlite://#{path}") rescue nil
28
+ puts "* create database #{path} ✓"
29
+ end
30
+
31
+ desc "drop", "Drop the database"
32
+ def drop
33
+ require_db_deps
34
+ path = parse_sqlite_path(Config.get[:db][:url])
35
+ File.delete(path) if File.exist?(path)
36
+ puts "* drop database #{path} ✓"
37
+ end
38
+ <% else %>
39
+ [:drop, :create].each do |action|
40
+ desc action.to_s, "#{action.capitalize} the database"
41
+ define_method(action) do
42
+ require_db_deps
43
+ require_relative "../app/config/config"<% if context.postgresql? %>
44
+ db_config =
45
+ PG::Connection
46
+ .conninfo_parse(Config.get[:db][:url])
47
+ .each_with_object({}) { |h, o|
48
+ o[h[:keyword].to_sym] = h[:val] if h[:val]
49
+ }
50
+ ok = system("PGPASSWORD='#{db_config[:password]}' #{action}db -h #{db_config[:host]} -p #{db_config[:port]} -U #{db_confi
51
+ g[:user]} #{db_config[:dbname]}")<% end %><% if context.mysql? %>
52
+ uri = URI.parse(Config.get[:db][:url])
53
+ db_config = {
54
+ host: uri.host,
55
+ port: uri.port,
56
+ user: uri.user,
57
+ password: uri.password,
58
+ dbname: uri.path.tr('/', '') # removes leading slash
59
+ }
60
+ sql = action == :create ?
61
+ "CREATE DATABASE IF NOT EXISTS `#{db_config[:dbname]}`;" :
62
+ "DROP DATABASE IF EXISTS `#{db_config[:dbname]}`;"
63
+ flags = []
64
+ flags << "-h#{db_config[:host]}" if db_config[:host]
65
+ flags << "-P#{db_config[:port]}" if db_config[:port]
66
+ flags << "-u#{db_config[:user]}" if db_config[:user]
67
+ env = { "MYSQL_PWD" => db_config[:password] }.compact
68
+ ok = system(env, "mysql", *flags, "-e", sql)<% end %>
69
+ puts "* #{action} database #{db_config[:dbname]} ✓" if ok
70
+ end
71
+ end
72
+ <% end %>
73
+ private
74
+ <% if context.sqlite? %>
75
+ def parse_sqlite_path(url)
76
+ uri = URI.parse(url)
77
+ File.expand_path(uri.host ? File.join(uri.host, uri.path) : uri.path, Dir.pwd)
78
+ end
79
+ <% end %>
80
+ def require_db_deps
81
+ require_relative "../boot"
82
+ require "sequel"
83
+ require "sequel/extensions/migration"
84
+ require "<%= context.db_gem %>"<% if context.mysql? %>
85
+ require "uri"<% end %>
86
+ end
87
+ end
88
+ <% end %>
89
+ class CLI < Thor
90
+ desc "console", "Open a console with application context, alias: roda c"
91
+ def console
92
+ system("irb -r ./boot.rb")
93
+ end
94
+ map "c" => "console"
95
+
96
+ desc "lint", "Run lint"
97
+ option :fix, type: :boolean, aliases: "-w", desc: "Auto fix lint warnings"
98
+ def lint
99
+ if options[:fix]
100
+ system("bundle exec standardrb --fix")
101
+ else
102
+ system("bundle exec standardrb")
103
+ end
104
+ end
105
+
106
+ desc "test", "Run tests"
107
+ def test<% if context.rspec? %>
108
+ system("RACK_ENV=test bundle exec rspec")<% else %>
109
+ system("RACK_ENV=test bundle exec minitest spec/")<% end %>
110
+ end
111
+
112
+ desc "dev", "Exec development server watching for changes"
113
+ def dev
114
+ system("RACK_ENV=development bundle exec guard")
115
+ end
116
+ <% if context.fullstack? %>
117
+ desc "assets", "Compile assets (use -w flag to watch for changes)"
118
+ option :watch, type: :boolean, aliases: "-w", desc: "Watch for changes"
119
+ def assets
120
+ if options[:watch]
121
+ system("npm i && npm run build:watch")
122
+ else
123
+ system("npm i && npm run build")
124
+ end
125
+ end
126
+ <% end %>
127
+ desc "server", "Runs the project, alias roda s"
128
+ def server
129
+ if ENV["RACK_ENV"] == "production"<% if context.database? %>
130
+ if ENV["DATABASE_URL"].nil?
131
+ puts("DATABASE_URL is empty")
132
+ exit 1
133
+ end<% end %>
134
+ if ENV["SESSION_SECRET"].nil?
135
+ puts("SESSION_SECRET is empty")
136
+ exit 1
137
+ end
138
+ system("RUBYOPT=--yjit RUBY_YJIT_ENABLE=1 RACK_ENV=production bundle exec puma --port 4000")
139
+ else
140
+ system("RACK_ENV=development bundle exec puma --port 4000")
141
+ end
142
+ end
143
+ map "s" => "server"
144
+ <% if context.database? %>
145
+ desc "db", "Database functions"
146
+ subcommand "db", Db
147
+ <% end %>
148
+ desc "generate", "Commands to generate code"
149
+ <%= context.to_thor_option %>
150
+ subcommand "generate", Roda::Project::Bin::Generators
151
+ end
152
+
153
+ CLI.start(ARGV)
@@ -0,0 +1,23 @@
1
+ <html>
2
+ <head>
3
+ <meta charset='utf-8' />
4
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
5
+ <meta name="viewport"
6
+ content="width=device-width, initial-scale=1, shrink-to-fit=no">
7
+
8
+ <title>Roda project</title>
9
+
10
+ <%= css_entrypoint_tag(:app) %>
11
+ </head>
12
+ <body>
13
+ <img src='/public/images/roda-project.png' />
14
+ <br>
15
+ <div class="navbar">
16
+ <a href="/">home</a>
17
+ <a href="/foo/bar">foo/bar</a>
18
+ </div>
19
+
20
+ <%= yield %>
21
+ <%= js_entrypoint_tag(:app) %>
22
+ </body>
23
+ </html>
@@ -6,13 +6,13 @@ const isProduction = process.env.RACK_ENV === 'production';
6
6
  const cssEntryPoints = ['app']
7
7
  const jsEntryPoints = ['app']
8
8
 
9
- function config() {
10
- const assetsEntryPoints =
11
- cssEntryPoints.map((e) => `css/${e}.css`)
12
- .concat(
13
- jsEntryPoints.map((e) => `js/${e}.js`)
14
- )
9
+ const assetsEntryPoints =
10
+ cssEntryPoints.map((e) => `css/${e}.css`)
11
+ .concat(
12
+ jsEntryPoints.map((e) => `js/${e}.js`)
13
+ )
15
14
 
15
+ function config() {
16
16
  return {
17
17
  entryPoints: assetsEntryPoints.map((name) => `app/assets/${name}`),
18
18
  bundle: true,
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Roda
3
+ class Roda
4
4
  module Project
5
- VERSION = "0.1.6"
5
+ VERSION = "0.1.8"
6
6
  end
7
7
  end
data/lib/roda/project.rb CHANGED
@@ -1,17 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "tty-file"
4
- require "fileutils"
5
- require "tty-reader"
6
- require "pastel"
7
- require_relative "project/version"
8
- require_relative "project/helpers/ids"
9
- require_relative "project/context"
10
- require_relative "project/helpers/input"
11
- require_relative "project/helpers/template"
12
- require_relative "project/cli"
13
-
14
- module Roda
3
+ class Roda
15
4
  module Project
16
5
  class Error < StandardError; end
17
6
 
@@ -55,3 +44,25 @@ module Roda
55
44
  end
56
45
  end
57
46
  end
47
+
48
+ # Dependences
49
+ require "tty-file"
50
+ require "fileutils"
51
+ require "tty-reader"
52
+ require "pastel"
53
+ require "thor"
54
+ # Helpers
55
+ require_relative "project/helpers/ids"
56
+ require_relative "project/helpers/interactive_input"
57
+ require_relative "project/helpers/template"
58
+ # Base
59
+ require_relative "project/main_context"
60
+ require_relative "project/generator"
61
+ require_relative "project/cli"
62
+ # Generators
63
+ require_relative "project/bin/generator"
64
+ require_relative "project/bin/generators/migration"
65
+ require_relative "project/bin/generators/routes"
66
+ require_relative "project/bin/generators"
67
+ # Version
68
+ require_relative "project/version"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrique F. Teixeira
@@ -51,6 +51,20 @@ dependencies:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
+ - !ruby/object:Gem::Dependency
55
+ name: thor
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
54
68
  email:
55
69
  - hriqueft@gmail.com
56
70
  executables:
@@ -63,71 +77,74 @@ files:
63
77
  - bin/roda-project.rb
64
78
  - bin/setup
65
79
  - lib/roda/project.rb
80
+ - lib/roda/project/bin/generator.rb
81
+ - lib/roda/project/bin/generators.rb
82
+ - lib/roda/project/bin/generators/migration.rb
83
+ - lib/roda/project/bin/generators/routes.rb
66
84
  - lib/roda/project/cli.rb
67
- - lib/roda/project/context.rb
85
+ - lib/roda/project/generator.rb
68
86
  - lib/roda/project/helpers/ids.rb
69
- - lib/roda/project/helpers/input.rb
87
+ - lib/roda/project/helpers/interactive_input.rb
70
88
  - lib/roda/project/helpers/template.rb
89
+ - lib/roda/project/main_context.rb
90
+ - lib/roda/project/templates/base/app/app.rb.erb
91
+ - lib/roda/project/templates/base/minimal/AGENTS.md
92
+ - lib/roda/project/templates/base/minimal/Gemfile.erb
93
+ - lib/roda/project/templates/base/minimal/Gemfile.lock
94
+ - lib/roda/project/templates/base/minimal/Guardfile
95
+ - lib/roda/project/templates/base/minimal/README.md
96
+ - lib/roda/project/templates/base/minimal/app.rb
97
+ - lib/roda/project/templates/base/minimal/bin/roda.erb
98
+ - lib/roda/project/templates/base/minimal/boot.rb
99
+ - lib/roda/project/templates/base/minimal/config.ru
100
+ - lib/roda/project/templates/base/minimal/public/exception_page.css
101
+ - lib/roda/project/templates/base/scaffold/AGENTS.md
102
+ - lib/roda/project/templates/base/scaffold/Gemfile.erb
103
+ - lib/roda/project/templates/base/scaffold/Guardfile
104
+ - lib/roda/project/templates/base/scaffold/README.md
105
+ - lib/roda/project/templates/base/scaffold/app/config/config.rb.erb
106
+ - lib/roda/project/templates/base/scaffold/app/config/locales/en.yml
107
+ - lib/roda/project/templates/base/scaffold/app/config/locales/foo/en.yml
108
+ - lib/roda/project/templates/base/scaffold/app/config/locales/foo/pt-br.yml
109
+ - lib/roda/project/templates/base/scaffold/app/config/locales/pt-br.yml
110
+ - lib/roda/project/templates/base/scaffold/app/config/providers/logger.rb
111
+ - lib/roda/project/templates/base/scaffold/app/config/providers/mailer.rb
112
+ - lib/roda/project/templates/base/scaffold/app/routes/foo.rb.erb
113
+ - lib/roda/project/templates/base/scaffold/bin/roda.erb
114
+ - lib/roda/project/templates/base/scaffold/boot.rb.erb
115
+ - lib/roda/project/templates/base/scaffold/config.ru.erb
116
+ - lib/roda/project/templates/base/scaffold/public/exception_page.css
117
+ - lib/roda/project/templates/database/app/config/providers/db/conn.rb
118
+ - lib/roda/project/templates/database/db/seeds.rb
119
+ - lib/roda/project/templates/front-end/app/assets/css/app.css
120
+ - lib/roda/project/templates/front-end/app/assets/js/app.js
121
+ - lib/roda/project/templates/front-end/app/assets/js/some/foo.js
122
+ - lib/roda/project/templates/front-end/app/views/foo/bar.erb
123
+ - lib/roda/project/templates/front-end/app/views/index.erb
124
+ - lib/roda/project/templates/front-end/app/views/layout.erb
125
+ - lib/roda/project/templates/front-end/esbuild.js
126
+ - lib/roda/project/templates/front-end/package.json
127
+ - lib/roda/project/templates/front-end/public/assets/app.css
128
+ - lib/roda/project/templates/front-end/public/assets/app.js
129
+ - lib/roda/project/templates/front-end/public/images/roda-project.png
130
+ - lib/roda/project/templates/rodauth/app/models/account.rb
131
+ - lib/roda/project/templates/rodauth/app/views/create-account.erb
132
+ - lib/roda/project/templates/rodauth/db/migrations/001_add_rodauth.rb
133
+ - lib/roda/project/templates/tests/minimal/minitest/spec/app_spec.rb
134
+ - lib/roda/project/templates/tests/minimal/minitest/spec/spec_helper.rb.erb
135
+ - lib/roda/project/templates/tests/minimal/rspec/spec/app_spec.rb
136
+ - lib/roda/project/templates/tests/minimal/rspec/spec/spec_helper.rb
137
+ - lib/roda/project/templates/tests/minitest/spec/app/app_spec.rb.erb
138
+ - lib/roda/project/templates/tests/minitest/spec/app/routes/foo_spec.rb
139
+ - lib/roda/project/templates/tests/minitest/spec/app/routes/test_branch_spec.rb
140
+ - lib/roda/project/templates/tests/minitest/spec/app/views/html_spec.rb
141
+ - lib/roda/project/templates/tests/minitest/spec/spec_helper.rb.erb
142
+ - lib/roda/project/templates/tests/rspec/spec/app/app_spec.rb.erb
143
+ - lib/roda/project/templates/tests/rspec/spec/app/routes/foo_spec.rb
144
+ - lib/roda/project/templates/tests/rspec/spec/app/routes/test_branch_spec.rb
145
+ - lib/roda/project/templates/tests/rspec/spec/app/views/html_spec.rb
146
+ - lib/roda/project/templates/tests/rspec/spec/spec_helper.rb.erb
71
147
  - lib/roda/project/version.rb
72
- - lib/roda/templates/base/app/app.rb.erb
73
- - lib/roda/templates/base/minimal/AGENTS.md
74
- - lib/roda/templates/base/minimal/Gemfile.erb
75
- - lib/roda/templates/base/minimal/Gemfile.lock
76
- - lib/roda/templates/base/minimal/Guardfile
77
- - lib/roda/templates/base/minimal/README.md
78
- - lib/roda/templates/base/minimal/Rakefile.erb
79
- - lib/roda/templates/base/minimal/app.rb
80
- - lib/roda/templates/base/minimal/boot.rb
81
- - lib/roda/templates/base/minimal/config.ru
82
- - lib/roda/templates/base/minimal/public/exception_page.css
83
- - lib/roda/templates/base/scaffold/AGENTS.md
84
- - lib/roda/templates/base/scaffold/Gemfile.erb
85
- - lib/roda/templates/base/scaffold/Guardfile
86
- - lib/roda/templates/base/scaffold/README.md
87
- - lib/roda/templates/base/scaffold/Rakefile.erb
88
- - lib/roda/templates/base/scaffold/app/config/config.rb.erb
89
- - lib/roda/templates/base/scaffold/app/config/locales/en.yml
90
- - lib/roda/templates/base/scaffold/app/config/locales/foo/en.yml
91
- - lib/roda/templates/base/scaffold/app/config/locales/foo/pt-br.yml
92
- - lib/roda/templates/base/scaffold/app/config/locales/pt-br.yml
93
- - lib/roda/templates/base/scaffold/app/config/providers/logger.rb
94
- - lib/roda/templates/base/scaffold/app/config/providers/mailer.rb
95
- - lib/roda/templates/base/scaffold/app/routes/foo.rb.erb
96
- - lib/roda/templates/base/scaffold/boot.rb.erb
97
- - lib/roda/templates/base/scaffold/config.ru.erb
98
- - lib/roda/templates/base/scaffold/public/exception_page.css
99
- - lib/roda/templates/database/app/config/providers/db/conn.rb
100
- - lib/roda/templates/database/db/seeds.rb
101
- - lib/roda/templates/front-end/app/assets/css/app.css
102
- - lib/roda/templates/front-end/app/assets/js/app.js
103
- - lib/roda/templates/front-end/app/assets/js/some/foo.js
104
- - lib/roda/templates/front-end/app/views/foo/bar.erb
105
- - lib/roda/templates/front-end/app/views/foo/html.rb
106
- - lib/roda/templates/front-end/app/views/html.rb
107
- - lib/roda/templates/front-end/app/views/index.erb
108
- - lib/roda/templates/front-end/app/views/layout.erb
109
- - lib/roda/templates/front-end/esbuild.js
110
- - lib/roda/templates/front-end/package.json
111
- - lib/roda/templates/front-end/public/assets/app.css
112
- - lib/roda/templates/front-end/public/assets/app.js
113
- - lib/roda/templates/front-end/public/images/roda-project.png
114
- - lib/roda/templates/rodauth/app/models/account.rb
115
- - lib/roda/templates/rodauth/app/views/create-account.erb
116
- - lib/roda/templates/rodauth/db/migrations/001_add_rodauth.rb
117
- - lib/roda/templates/tests/minimal/minitest/spec/app_spec.rb
118
- - lib/roda/templates/tests/minimal/minitest/spec/spec_helper.rb.erb
119
- - lib/roda/templates/tests/minimal/rspec/spec/app_spec.rb
120
- - lib/roda/templates/tests/minimal/rspec/spec/spec_helper.rb
121
- - lib/roda/templates/tests/minitest/spec/app/app_spec.rb.erb
122
- - lib/roda/templates/tests/minitest/spec/app/routes/foo_spec.rb
123
- - lib/roda/templates/tests/minitest/spec/app/routes/test_branch_spec.rb
124
- - lib/roda/templates/tests/minitest/spec/app/views/html_spec.rb
125
- - lib/roda/templates/tests/minitest/spec/spec_helper.rb.erb
126
- - lib/roda/templates/tests/rspec/spec/app/app_spec.rb.erb
127
- - lib/roda/templates/tests/rspec/spec/app/routes/foo_spec.rb
128
- - lib/roda/templates/tests/rspec/spec/app/routes/test_branch_spec.rb
129
- - lib/roda/templates/tests/rspec/spec/app/views/html_spec.rb
130
- - lib/roda/templates/tests/rspec/spec/spec_helper.rb.erb
131
148
  homepage: https://github.com/roda-project
132
149
  licenses:
133
150
  - MIT
@@ -1,51 +0,0 @@
1
- # Rakefile
2
-
3
- require "fileutils"
4
-
5
- task :default do
6
- system("rake -T")
7
- end
8
-
9
- desc "Open a console with application context (alias: rake c)"
10
- task :console do
11
- system("irb -r ./boot.rb")
12
- end
13
- task c: :console
14
-
15
- desc "Run lint"
16
- task :lint do
17
- system("bundle exec standardrb")
18
- end
19
-
20
- desc "Auto fix lint warnings"
21
- task "lint:fix" do
22
- system("bundle exec standardrb --fix")
23
- end
24
-
25
- desc "Run tests"
26
- task :test do<% if context.rspec? %>
27
- system("RACK_ENV=test bundle exec rspec")<% else %>
28
- system("RACK_ENV=test bundle exec minitest spec/")<% end %>
29
- end
30
-
31
- desc "Exec development server"
32
- task :server do
33
- if ENV["RACK_ENV"] == "production"<% if context.database? %>
34
- if ENV["DATABASE_URL"].nil?
35
- puts("DATABASE_URL is empty")
36
- exit 1
37
- end<% end %>
38
- if ENV["SESSION_SECRET"].nil?
39
- puts("SESSION_SECRET is empty")
40
- exit 1
41
- end
42
- system("RUBYOPT=--yjit RUBY_YJIT_ENABLE=1 RACK_ENV=production bundle exec puma --port 4000")
43
- else
44
- system("RACK_ENV=development bundle exec puma --port 4000")
45
- end
46
- end
47
-
48
- desc "Exec development server watching for changes"
49
- task "dev" do
50
- system("RACK_ENV=development bundle exec guard")
51
- end