Skip to content

Commit

Permalink
Merge branch 'master' into fix-issue-453
Browse files Browse the repository at this point in the history
  • Loading branch information
trexnix committed Jan 15, 2016
2 parents ef47a2c + e71a7b0 commit 690f6a0
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/lotus/commands/new/abstract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def add_sql_templates
def add_git_templates
return if git_dir_present?

source = database_config.filesystem? ? 'gitignore.tt' : '.gitignore'
source = database_config.filesystem? ? 'gitignore_with_db.tt' : 'gitignore.tt'
target = '.gitignore'
add_mapping(source, target)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/lotus/generators/application/app/Gemfile.tt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gem 'lotusrb', '<%= Lotus::VERSION %>'
gem 'lotus-model', '<%= config[:lotus_model_version] %>'
<%- end -%>

<%- if config[:database_config][:gem] %>
<%- if config[:database_config][:gem] -%>
gem '<%= config[:database_config][:gem] %>'
<%- end -%>

Expand Down
2 changes: 0 additions & 2 deletions lib/lotus/generators/application/app/gitignore.tt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
/db/<%= config[:app_name] %>_development
/db/<%= config[:app_name] %>_test
/public/assets*
/tmp
4 changes: 4 additions & 0 deletions lib/lotus/generators/application/app/gitignore_with_db.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/db/<%= config[:app_name] %>_development
/db/<%= config[:app_name] %>_test
/public/assets*
/tmp
2 changes: 0 additions & 2 deletions lib/lotus/generators/application/container/gitignore.tt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
/db/<%= config[:app_name] %>_development
/db/<%= config[:app_name] %>_test
/public/assets*
/tmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/db/<%= config[:app_name] %>_development
/db/<%= config[:app_name] %>_test
/public/assets*
/tmp
15 changes: 11 additions & 4 deletions lib/lotus/welcome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ module Lotus
class Welcome
def initialize(app)
@root = Pathname.new(__dir__).join('templates').realpath
@body = [ERB.new(@root.join('welcome.html.erb').read).result(binding)]
end

def call(env)
@request_path = env['REQUEST_PATH'] || ''
@body = [ERB.new(@root.join('welcome.html.erb').read).result(binding)]

[200, {}, @body]
end

Expand All @@ -24,10 +26,15 @@ def container?
Environment.new.container?
end

def application_class
applications = Lotus::Application.applications.to_a
applications.select do |app|
@request_path.include? app.configuration.path_prefix.to_s
end.first
end

def app
Utils::String.new(
Application.applications.first
).namespace.downcase
Utils::String.new(application_class).namespace.downcase
end
end
end

0 comments on commit 690f6a0

Please sign in to comment.