roda-project 0.1.14 → 0.1.15
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/roda/project/bin/generators/service.rb +4 -6
- data/lib/roda/project/templates/base/minimal/boot.rb +2 -2
- data/lib/roda/project/templates/base/scaffold/boot.rb.erb +2 -2
- data/lib/roda/project/templates/tests/minitest/spec/app/app_spec.rb.erb +3 -3
- data/lib/roda/project/templates/tests/minitest/spec/app/routes/foo_spec.rb.erb +9 -0
- data/lib/roda/project/templates/tests/minitest/spec/spec_helper.rb.erb +1 -1
- data/lib/roda/project/templates/tests/rspec/spec/app/app_spec.rb.erb +3 -3
- data/lib/roda/project/templates/tests/rspec/spec/app/routes/foo_spec.rb.erb +9 -0
- data/lib/roda/project/templates/tests/rspec/spec/spec_helper.rb.erb +1 -1
- data/lib/roda/project/version.rb +1 -1
- metadata +3 -3
- data/lib/roda/project/templates/tests/minitest/spec/app/routes/foo_spec.rb +0 -8
- data/lib/roda/project/templates/tests/rspec/spec/app/routes/foo_spec.rb +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c22151c8712cbc374521e061d5c91e5b4dae3b55ab5d55fc3227fbf57ef49c6
|
|
4
|
+
data.tar.gz: 31f190125960494423689e00f70fe16fb32c05da6ea5a5c356fa33b99792d8f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5533eef1235cbbf17bdee8305595a2eee7b32f298960a2b70b080f3ef633f329115d96ae8dcad13490cdfcbc03e092b1ed4559df1fb696604b482e3283ac0ef1
|
|
7
|
+
data.tar.gz: 74c4da7361e380d5eb8af1c16f61f06c7540e5fd5464b9df12c184aa4bea4b171f9903e8800bba8c99fcca5f792b67b1b914c1a9a65a86a360fb49c7ec6e586f
|
|
@@ -96,12 +96,10 @@ class Roda
|
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
def parse_args
|
|
99
|
-
@parse_args ||=
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
{ type: "class", name: @args[0].to_s }
|
|
104
|
-
end
|
|
99
|
+
@parse_args ||= if %w[module class].include?(@args[0].to_s.downcase)
|
|
100
|
+
{type: @args[0].to_s.downcase, name: @args[1].to_s}
|
|
101
|
+
else
|
|
102
|
+
{type: "class", name: @args[0].to_s}
|
|
105
103
|
end
|
|
106
104
|
end
|
|
107
105
|
|
|
@@ -22,7 +22,6 @@ loader.collapse("#{__dir__}/app/models")<% end %>
|
|
|
22
22
|
# loader.push_dir("#{__dir__}/app/#{path}")
|
|
23
23
|
# end
|
|
24
24
|
loader.setup
|
|
25
|
-
require "debug" if Config.not_production?
|
|
26
25
|
|
|
27
26
|
Oj.mimic_JSON
|
|
28
27
|
|
|
@@ -34,8 +33,9 @@ Providers::Logger.boot
|
|
|
34
33
|
# Consts<% if context.database %>
|
|
35
34
|
DB = Providers::DB::Conn.get
|
|
36
35
|
|
|
37
|
-
# Automatic models annotations in dev environment
|
|
38
36
|
if Config.not_production?
|
|
37
|
+
require "debug"
|
|
38
|
+
# Automatic models annotations in dev environment
|
|
39
39
|
require 'sequel/annotate'
|
|
40
40
|
Sequel::Annotate.annotate(Dir['app/models/*.rb'], position: :before, border: true) rescue nil
|
|
41
41
|
end<% end %>
|
|
@@ -2,13 +2,13 @@ require_relative "../spec_helper"
|
|
|
2
2
|
|
|
3
3
|
describe "hello" do
|
|
4
4
|
it "test requests" do
|
|
5
|
-
get "/"
|
|
6
|
-
_(last_response.status).must_equal 302<% else %>
|
|
5
|
+
get "/"
|
|
7
6
|
_(last_response.status).must_equal 200<% if context.fullstack? %>
|
|
8
|
-
_(last_response.body).must_include "Hello world"<% end
|
|
7
|
+
_(last_response.body).must_include "Hello world"<% end %>
|
|
9
8
|
end
|
|
10
9
|
<% if context.rodauth? %>
|
|
11
10
|
it "test models" do
|
|
11
|
+
# run "RACK_ENV=test bin/roda db migrate" to make this spec pass
|
|
12
12
|
Account.create(email: "foo@bar.com")
|
|
13
13
|
|
|
14
14
|
_(Account.count).must_equal 1
|
|
@@ -2,12 +2,12 @@ require_relative "../spec_helper"
|
|
|
2
2
|
|
|
3
3
|
describe "hello" do
|
|
4
4
|
it "test requests" do
|
|
5
|
-
get "/"
|
|
6
|
-
expect(last_response.status).to eq(302)<% else %>
|
|
5
|
+
get "/"
|
|
7
6
|
expect(last_response.status).to eq(200)<% if context.fullstack? %>
|
|
8
|
-
expect(last_response.body).to include("Hello world")<% end
|
|
7
|
+
expect(last_response.body).to include("Hello world")<% end %>
|
|
9
8
|
end
|
|
10
9
|
<% if context.rodauth? %>
|
|
10
|
+
# run "RACK_ENV=test bin/roda db migrate" to make this spec pass
|
|
11
11
|
it "test models" do
|
|
12
12
|
Account.create(email: "foo@bar.com")
|
|
13
13
|
|
data/lib/roda/project/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.1.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Henrique F. Teixeira
|
|
@@ -142,12 +142,12 @@ files:
|
|
|
142
142
|
- lib/roda/project/templates/tests/minimal/rspec/spec/app_spec.rb
|
|
143
143
|
- lib/roda/project/templates/tests/minimal/rspec/spec/spec_helper.rb
|
|
144
144
|
- lib/roda/project/templates/tests/minitest/spec/app/app_spec.rb.erb
|
|
145
|
-
- lib/roda/project/templates/tests/minitest/spec/app/routes/foo_spec.rb
|
|
145
|
+
- lib/roda/project/templates/tests/minitest/spec/app/routes/foo_spec.rb.erb
|
|
146
146
|
- lib/roda/project/templates/tests/minitest/spec/app/routes/test_branch_spec.rb
|
|
147
147
|
- lib/roda/project/templates/tests/minitest/spec/app/views/html_spec.rb
|
|
148
148
|
- lib/roda/project/templates/tests/minitest/spec/spec_helper.rb.erb
|
|
149
149
|
- lib/roda/project/templates/tests/rspec/spec/app/app_spec.rb.erb
|
|
150
|
-
- lib/roda/project/templates/tests/rspec/spec/app/routes/foo_spec.rb
|
|
150
|
+
- lib/roda/project/templates/tests/rspec/spec/app/routes/foo_spec.rb.erb
|
|
151
151
|
- lib/roda/project/templates/tests/rspec/spec/app/routes/test_branch_spec.rb
|
|
152
152
|
- lib/roda/project/templates/tests/rspec/spec/app/views/html_spec.rb
|
|
153
153
|
- lib/roda/project/templates/tests/rspec/spec/spec_helper.rb.erb
|