lotusrb 0.6.0 → 0.6.1

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
  SHA1:
3
- metadata.gz: 14dca86469ca5f5042c6bc2ea9e31ebaad01d19a
4
- data.tar.gz: 0f6cbdd53e4f2c60a666fe1d691e4fda872a4f95
3
+ metadata.gz: a931d2f52487797eb662bea70ae481e1d542a3ca
4
+ data.tar.gz: c2196ffd93716d30eddda44e75a90972ac72728a
5
5
  SHA512:
6
- metadata.gz: b134692103f23248c496e9f4bdac72c1cd3d1b8b31961c0aa1823da8c9d25e13351f57200ac81ebed0b66361e51990b1ab5497945b79529b9d0f65e887d262c7
7
- data.tar.gz: d47a47dd5fa20eeb449c5ee48d0e3c712f3e4eeaa62929e2329e4fb413a31ed15a1b4562ad357f936d6e56a1eaeb17e122144261579b8f4a9fc7b9eb4add653c
6
+ metadata.gz: ce8c51b74f48615ef9c9efd5a8b78b5d259877bc23381af72dc427603b67b8ba2335f02b754041ad3ed01ff91171b6d53794ce147d76c31b3568572b59b922ba
7
+ data.tar.gz: efcc502bd4366499ddca11100877fc9e38d2e1a44ee808e7b2367836ef3707eaecc87480fc068bf5331e6b5bbd393755335c98aaafb8bca21ff71cbb35436815
@@ -1,6 +1,15 @@
1
1
  # Lotus
2
2
  A complete web framework for Ruby
3
3
 
4
+ ## v0.6.1 - 2016-01-19
5
+ ### Fixed
6
+ - [Anton Davydov] Show the current app name in Welcome page (eg. `/admin` shows instructions on how to generate an action for `Admin` app)
7
+ - [Anton Davydov] Fix project creation when name contains dashes (eg. `"awesome-project" => "AwesomeProject"`)
8
+ - [Anton Davydov] Ensure to add assets related entries to `.gitignore` when a project is generated with the `--database` flag
9
+ - [deepj] Avoid blank lines in generated `Gemfile`
10
+ - [trexnix] Fix for `lotus destroy app`: it doesn't cause a syntax error in `config/application.rb` anymore
11
+ - [Serg Ikonnikov & Trung Lê] Ensure console to use the bundled engine
12
+
4
13
  ## v0.6.0 - 2016-01-12
5
14
  ### Added
6
15
  - [Luca Guidi] Introduced configurable assets compressors
@@ -3,6 +3,8 @@
3
3
 
4
4
  ## Features
5
5
 
6
+ ## v0.6.1 - 2016-01-19
7
+
6
8
  ## v0.6.0 - 2016-01-12
7
9
 
8
10
  - Assets preprocessors support (eg. Sass, ES6, Opal, Less, CoffeScript..)
@@ -51,7 +51,7 @@ module Lotus
51
51
  $ > lotus console --engine=pry
52
52
  EOS
53
53
  method_option :environment, desc: 'path to environment configuration (config/environment.rb)'
54
- method_option :engine, desc: "choose a specific console engine: (#{Lotus::Commands::Console::ENGINES.keys.join('/')})", default: Lotus::Commands::Console::DEFAULT_ENGINE
54
+ method_option :engine, desc: "choose a specific console engine: (#{Lotus::Commands::Console::ENGINES.keys.join('/')})"
55
55
  method_option :help, desc: 'displays the usage method'
56
56
  def console
57
57
  if options[:help]
@@ -59,7 +59,7 @@ module Lotus
59
59
 
60
60
  def add_require_app
61
61
  # Add "require_relative '../apps/web/application'"
62
- generator.inject_into_file base_path.join('config/environment.rb'), after: /require_relative '\.\.\/lib\/(.*)'/ do
62
+ generator.inject_into_file base_path.join('config/environment.rb'), after: /require_relative '\.\.\/lib\/.*'/ do
63
63
  "\nrequire_relative '../apps/#{ app_name }/application'"
64
64
  end
65
65
  end
@@ -96,7 +96,7 @@ module Lotus
96
96
  end
97
97
 
98
98
  def classified_app_name
99
- Utils::String.new(app_name).classify
99
+ Utils::String.new(app_name).classify.tr('::', '')
100
100
  end
101
101
 
102
102
  def assert_application_name!(value)
@@ -62,7 +62,7 @@ module Lotus
62
62
  def add_git_templates
63
63
  return if git_dir_present?
64
64
 
65
- source = database_config.filesystem? ? 'gitignore.tt' : '.gitignore'
65
+ source = database_config.filesystem? ? 'gitignore_with_db.tt' : 'gitignore.tt'
66
66
  target = '.gitignore'
67
67
  add_mapping(source, target)
68
68
  end
@@ -104,7 +104,7 @@ module Lotus
104
104
  end
105
105
 
106
106
  def classified_app_name
107
- Utils::String.new(app_name).classify
107
+ Utils::String.new(app_name).classify.tr('::', '')
108
108
  end
109
109
 
110
110
  # def application_base_path
@@ -19,7 +19,7 @@ gem 'lotusrb', '<%= Lotus::VERSION %>'
19
19
  gem 'lotus-model', '<%= config[:lotus_model_version] %>'
20
20
  <%- end -%>
21
21
 
22
- <%- if config[:database_config][:gem] %>
22
+ <%- if config[:database_config][:gem] -%>
23
23
  gem '<%= config[:database_config][:gem] %>'
24
24
  <%- end -%>
25
25
 
@@ -1,4 +1,2 @@
1
- /db/<%= config[:app_name] %>_development
2
- /db/<%= config[:app_name] %>_test
3
1
  /public/assets*
4
2
  /tmp
@@ -0,0 +1,4 @@
1
+ /db/<%= config[:app_name] %>_development
2
+ /db/<%= config[:app_name] %>_test
3
+ /public/assets*
4
+ /tmp
@@ -1,4 +1,2 @@
1
- /db/<%= config[:app_name] %>_development
2
- /db/<%= config[:app_name] %>_test
3
1
  /public/assets*
4
2
  /tmp
@@ -0,0 +1,4 @@
1
+ /db/<%= config[:app_name] %>_development
2
+ /db/<%= config[:app_name] %>_test
3
+ /public/assets*
4
+ /tmp
@@ -2,5 +2,5 @@ module Lotus
2
2
  # Defines the version
3
3
  #
4
4
  # @since 0.1.0
5
- VERSION = '0.6.0'.freeze
5
+ VERSION = '0.6.1'.freeze
6
6
  end
@@ -7,10 +7,12 @@ module Lotus
7
7
  class Welcome
8
8
  def initialize(app)
9
9
  @root = Pathname.new(__dir__).join('templates').realpath
10
- @body = [ERB.new(@root.join('welcome.html.erb').read).result(binding)]
11
10
  end
12
11
 
13
12
  def call(env)
13
+ @request_path = env['REQUEST_PATH'] || ''
14
+ @body = [ERB.new(@root.join('welcome.html.erb').read).result(binding)]
15
+
14
16
  [200, {}, @body]
15
17
  end
16
18
 
@@ -24,10 +26,15 @@ module Lotus
24
26
  Environment.new.container?
25
27
  end
26
28
 
29
+ def application_class
30
+ applications = Lotus::Application.applications.to_a
31
+ applications.select do |app|
32
+ @request_path.include? app.configuration.path_prefix.to_s
33
+ end.first
34
+ end
35
+
27
36
  def app
28
- Utils::String.new(
29
- Application.applications.first
30
- ).namespace.downcase
37
+ Utils::String.new(application_class).namespace.downcase
31
38
  end
32
39
  end
33
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lotusrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-01-12 00:00:00.000000000 Z
13
+ date: 2016-01-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: lotus-utils
@@ -322,6 +322,7 @@ files:
322
322
  - lib/lotus/generators/application/app/features_helper.rb.minitest.tt
323
323
  - lib/lotus/generators/application/app/features_helper.rb.rspec.tt
324
324
  - lib/lotus/generators/application/app/gitignore.tt
325
+ - lib/lotus/generators/application/app/gitignore_with_db.tt
325
326
  - lib/lotus/generators/application/app/lib/app_name.rb.tt
326
327
  - lib/lotus/generators/application/app/lib/chirp/entities/.gitkeep
327
328
  - lib/lotus/generators/application/app/lib/chirp/repositories/.gitkeep
@@ -349,6 +350,7 @@ files:
349
350
  - lib/lotus/generators/application/container/features_helper.rb.minitest.tt
350
351
  - lib/lotus/generators/application/container/features_helper.rb.rspec.tt
351
352
  - lib/lotus/generators/application/container/gitignore.tt
353
+ - lib/lotus/generators/application/container/gitignore_with_db.tt
352
354
  - lib/lotus/generators/application/container/lib/app_name.rb.tt
353
355
  - lib/lotus/generators/application/container/lib/chirp/entities/.gitkeep
354
356
  - lib/lotus/generators/application/container/lib/chirp/mailers/.gitkeep