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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e03b5fbcad7831986b704d75c798fc85ea1874b5e63a8970ef876db89841978f
4
- data.tar.gz: 1cb64c7f6c9b14c8fdcc31e0e841813c5eb92bb707899187053f4af534327136
3
+ metadata.gz: 5c22151c8712cbc374521e061d5c91e5b4dae3b55ab5d55fc3227fbf57ef49c6
4
+ data.tar.gz: 31f190125960494423689e00f70fe16fb32c05da6ea5a5c356fa33b99792d8f3
5
5
  SHA512:
6
- metadata.gz: 9abfe5001b17316fb5ddd00d0f568b96b7b028c96e41a49d6696523d6397965ebd46acd980c3e4d918ff69c5d9aaf6032a155b0fb7736970ed64f78342a6a709
7
- data.tar.gz: ad3464a71e558d327e0492b0c4e56f06bf82c7ae524d8767a99b03a7ca0408aaf9f814cb71a8b17c5e0077b9d06499980fe296f8302aec96bfbcc7ffc19ce362
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 ||= begin
100
- if %w[module class].include?(@args[0].to_s.downcase)
101
- { type: @args[0].to_s.downcase, name: @args[1].to_s }
102
- else
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
 
@@ -21,8 +21,8 @@ loader.collapse("#{__dir__}/services")
21
21
  # end
22
22
  loader.setup
23
23
 
24
- require "debug" if NOT_PRODUCTION
25
-
26
24
  Oj.mimic_JSON
27
25
 
26
+ require "debug" if NOT_PRODUCTION
27
+
28
28
  require_relative "app"
@@ -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 "/"<% if context.rodauth? %>
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 %><% 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
@@ -0,0 +1,9 @@
1
+ require_relative "../../spec_helper"
2
+
3
+ describe "Routes for foo" do
4
+ it "responds to GET /foo/bar" do
5
+ get "/foo/bar"<% if context.rodauth? %>
6
+ _(last_response.status).must_equal 302<% else %>
7
+ _(last_response.status).must_equal 200<% end %>
8
+ end
9
+ end
@@ -11,7 +11,7 @@ class Minitest::HooksSpec
11
11
  include Rack::Test::Methods
12
12
 
13
13
  def app
14
- <%= context.const_project_name %>.freeze.app
14
+ <%= context.const_project_name %>.app
15
15
  end
16
16
  end
17
17
 
@@ -2,12 +2,12 @@ require_relative "../spec_helper"
2
2
 
3
3
  describe "hello" do
4
4
  it "test requests" do
5
- get "/"<% if context.rodauth? %>
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 %><% 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
 
@@ -0,0 +1,9 @@
1
+ require_relative "../../spec_helper"
2
+
3
+ describe "Routes for foo" do
4
+ it "responds to GET /foo/bar" do
5
+ get "/foo/bar"<% if context.rodauth? %>
6
+ expect(last_response.status).to eq(302)<% else %>
7
+ expect(last_response.status).to eq(200)<% end %>
8
+ end
9
+ end
@@ -14,6 +14,6 @@ RSpec.configure do |config|
14
14
  end
15
15
  <% end %>
16
16
  def app
17
- <%= context.const_project_name %>.freeze.app
17
+ <%= context.const_project_name %>.app
18
18
  end
19
19
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Roda
4
4
  module Project
5
- VERSION = "0.1.14"
5
+ VERSION = "0.1.15"
6
6
  end
7
7
  end
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.14
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
@@ -1,8 +0,0 @@
1
- require_relative "../../spec_helper"
2
-
3
- describe "Routes for foo" do
4
- it "responds to GET /foo/bar" do
5
- get "/foo/bar"
6
- _(last_response.status).must_equal 200
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- require_relative "../../spec_helper"
2
-
3
- describe "Routes for foo" do
4
- it "responds to GET /foo/bar" do
5
- get "/foo/bar"
6
- expect(last_response.status).to eq(200)
7
- end
8
- end