Permalink
Browse files

Merge remote-tracking branch 'hanami/develop' into generators-minites…

…t-fix

Up to date develop
  • Loading branch information...
sovetnik committed Jul 31, 2017
2 parents 599215d + 5f9267d commit fab4f173b8c0832084e46ea13406533057611235
Showing with 3,826 additions and 3,122 deletions.
  1. +2 −1 Gemfile
  2. +3 −0 README.md
  3. +3 −3 bin/hanami
  4. +1 −1 hanami.gemspec
  5. +0 −154 lib/hanami/cli.rb
  6. +45 −0 lib/hanami/cli/commands.rb
  7. +11 −0 lib/hanami/cli/commands/assets.rb
  8. +35 −0 lib/hanami/cli/commands/assets/precompile.rb
  9. +129 −0 lib/hanami/cli/commands/command.rb
  10. +93 −0 lib/hanami/cli/commands/console.rb
  11. +25 −0 lib/hanami/cli/commands/db.rb
  12. +26 −0 lib/hanami/cli/commands/db/apply.rb
  13. +35 −0 lib/hanami/cli/commands/db/console.rb
  14. +26 −0 lib/hanami/cli/commands/db/create.rb
  15. +26 −0 lib/hanami/cli/commands/db/drop.rb
  16. +33 −0 lib/hanami/cli/commands/db/migrate.rb
  17. +26 −0 lib/hanami/cli/commands/db/prepare.rb
  18. +26 −0 lib/hanami/cli/commands/db/version.rb
  19. +21 −0 lib/hanami/cli/commands/destroy.rb
  20. +109 −0 lib/hanami/cli/commands/destroy/action.rb
  21. +133 −0 lib/hanami/cli/commands/destroy/app.rb
  22. +62 −0 lib/hanami/cli/commands/destroy/mailer.rb
  23. +43 −0 lib/hanami/cli/commands/destroy/migration.rb
  24. +70 −0 lib/hanami/cli/commands/destroy/model.rb
  25. +23 −0 lib/hanami/cli/commands/generate.rb
  26. +179 −0 lib/hanami/cli/commands/generate/action.rb
  27. +8 −0 lib/hanami/cli/commands/generate/action/action.erb
  28. +11 −0 lib/hanami/cli/commands/generate/action/action_spec.minitest.erb
  29. +1 −3 ...ami/{generators/action/action_spec.rspec.tt → cli/commands/generate/action/action_spec.rspec.erb}
  30. +9 −0 lib/hanami/cli/commands/generate/action/action_without_view.erb
  31. +5 −0 lib/hanami/cli/commands/generate/action/view.erb
  32. +15 −0 lib/hanami/cli/commands/generate/action/view_spec.minitest.erb
  33. +2 −4 lib/hanami/{generators/action/view_spec.rspec.tt → cli/commands/generate/action/view_spec.rspec.erb}
  34. +189 −0 lib/hanami/cli/commands/generate/app.rb
  35. +6 −6 lib/hanami/{generators/app/application.rb.tt → cli/commands/generate/app/application.erb}
  36. BIN lib/hanami/{generators → cli/commands/generate}/app/favicon.ico
  37. 0 lib/hanami/{generators/action/template.tt → cli/commands/generate/app/gitkeep.erb}
  38. +7 −0 lib/hanami/cli/commands/generate/app/layout.erb
  39. +11 −0 lib/hanami/cli/commands/generate/app/layout_spec.minitest.erb
  40. +11 −0 lib/hanami/cli/commands/generate/app/layout_spec.rspec.erb
  41. 0 lib/hanami/{generators/app/config/routes.rb.tt → cli/commands/generate/app/routes.erb}
  42. +1 −1 ...i/{generators/app/templates/application.html.erb.tt → cli/commands/generate/app/template.erb.erb}
  43. +1 −1 ...{generators/app/templates/application.html.haml.tt → cli/commands/generate/app/template.haml.erb}
  44. +1 −1 ...{generators/app/templates/application.html.slim.tt → cli/commands/generate/app/template.slim.erb}
  45. +76 −0 lib/hanami/cli/commands/generate/mailer.rb
  46. +7 −0 lib/hanami/cli/commands/generate/mailer/mailer.erb
  47. +7 −0 lib/hanami/cli/commands/generate/mailer/mailer_spec.minitest.erb
  48. +5 −0 lib/hanami/cli/commands/generate/mailer/mailer_spec.rspec.erb
  49. +35 −0 lib/hanami/cli/commands/generate/migration.rb
  50. 0 lib/hanami/{generators/migration/migration.rb.tt → cli/commands/generate/migration/migration.erb}
  51. +82 −0 lib/hanami/cli/commands/generate/model.rb
  52. +2 −0 lib/hanami/cli/commands/generate/model/entity.erb
  53. +1 −1 ...{generators/model/entity_spec.minitest.tt → cli/commands/generate/model/entity_spec.minitest.erb}
  54. +3 −0 lib/hanami/cli/commands/generate/model/entity_spec.rspec.erb
  55. +1 −1 lib/hanami/{generators/model/migration.rb.tt → cli/commands/generate/model/migration.erb}
  56. +2 −0 lib/hanami/cli/commands/generate/model/repository.erb
  57. +1 −1 ...ors/model/repository_spec.minitest.tt → cli/commands/generate/model/repository_spec.minitest.erb}
  58. +3 −0 lib/hanami/cli/commands/generate/model/repository_spec.rspec.erb
  59. +42 −0 lib/hanami/cli/commands/generate/secret.rb
  60. +457 −0 lib/hanami/cli/commands/new.rb
  61. +1 −1 ...mi/{generators/application/container/.env.development.tt → cli/commands/new/.env.development.erb}
  62. +1 −1 lib/hanami/{generators/application/container/.env.test.tt → cli/commands/new/.env.test.erb}
  63. 0 lib/hanami/{generators/app/config/initializers/.gitkeep → cli/commands/new/.gitkeep.erb}
  64. +9 −9 lib/hanami/{generators/application/container/Gemfile.tt → cli/commands/new/Gemfile.erb}
  65. +35 −0 lib/hanami/cli/commands/new/README.md.erb
  66. 0 lib/hanami/{generators/application/container/config.ru.tt → cli/commands/new/config.ru.erb}
  67. 0 lib/hanami/{generators/application/container/config/boot.rb.tt → cli/commands/new/config/boot.erb}
  68. +7 −7 ...erators/application/container/config/environment.rb.tt → cli/commands/new/config/environment.erb}
  69. 0 lib/hanami/{generators/application/container/gitignore.tt → cli/commands/new/gitignore.erb}
  70. 0 ...tors/application/container/gitignore_with_sqlite.tt → cli/commands/new/gitignore_with_sqlite.erb}
  71. +4 −0 lib/hanami/cli/commands/new/hanamirc.erb
  72. +2 −0 lib/hanami/cli/commands/new/lib/project.erb
  73. 0 .../{generators/application/container/Rakefile.minitest.tt → cli/commands/new/minitest/Rakefile.erb}
  74. 0 ...ication/container/features_helper.rb.minitest.tt → cli/commands/new/minitest/features_helper.erb}
  75. 0 ...ors/application/container/spec_helper.rb.minitest.tt → cli/commands/new/minitest/spec_helper.erb}
  76. 0 ...hanami/{generators/application/container/Rakefile.rspec.tt → cli/commands/new/rspec/Rakefile.erb}
  77. 0 ...ami/{generators/application/container/capybara.rb.rspec.tt → cli/commands/new/rspec/capybara.erb}
  78. 0 ...s/application/container/features_helper.rb.rspec.tt → cli/commands/new/rspec/features_helper.erb}
  79. 0 lib/hanami/{generators/application/container/rspec.rspec.tt → cli/commands/new/rspec/rspec.erb}
  80. 0 ...enerators/application/container/spec_helper.rb.rspec.tt → cli/commands/new/rspec/spec_helper.erb}
  81. 0 lib/hanami/{generators/application/container/.gitignore → cli/commands/new/schema.sql.erb}
  82. +282 −0 lib/hanami/cli/commands/project.rb
  83. +17 −0 lib/hanami/cli/commands/routes.rb
  84. +35 −0 lib/hanami/cli/commands/server.rb
  85. +23 −0 lib/hanami/cli/commands/templates.rb
  86. +15 −0 lib/hanami/cli/commands/version.rb
  87. +0 −49 lib/hanami/cli_base.rb
  88. +0 −24 lib/hanami/cli_sub_commands/assets.rb
  89. +0 −138 lib/hanami/cli_sub_commands/db.rb
  90. +0 −115 lib/hanami/cli_sub_commands/destroy.rb
  91. +0 −150 lib/hanami/cli_sub_commands/generate.rb
  92. +0 −4 lib/hanami/commands/apps.rb
  93. +0 −26 lib/hanami/commands/assets/precompile.rb
  94. +0 −77 lib/hanami/commands/command.rb
  95. +0 −107 lib/hanami/commands/console.rb
  96. +0 −19 lib/hanami/commands/db/apply.rb
  97. +0 −41 lib/hanami/commands/db/console.rb
  98. +0 −19 lib/hanami/commands/db/create.rb
  99. +0 −19 lib/hanami/commands/db/drop.rb
  100. +0 −30 lib/hanami/commands/db/migrate.rb
  101. +0 −19 lib/hanami/commands/db/prepare.rb
  102. +0 −19 lib/hanami/commands/db/version.rb
  103. +0 −76 lib/hanami/commands/generate/abstract.rb
  104. +0 −322 lib/hanami/commands/generate/action.rb
  105. +0 −154 lib/hanami/commands/generate/app.rb
  106. +0 −131 lib/hanami/commands/generate/mailer.rb
  107. +0 −75 lib/hanami/commands/generate/migration.rb
  108. +0 −132 lib/hanami/commands/generate/model.rb
  109. +0 −37 lib/hanami/commands/generate/secret_token.rb
  110. +0 −178 lib/hanami/commands/new/abstract.rb
  111. +0 −129 lib/hanami/commands/new/app.rb
  112. +0 −119 lib/hanami/commands/new/container.rb
  113. +0 −26 lib/hanami/commands/routes.rb
  114. +0 −32 lib/hanami/commands/server.rb
  115. +39 −1 lib/hanami/components.rb
  116. +36 −1 lib/hanami/components/components.rb
  117. +16 −14 lib/hanami/environment.rb
  118. +0 −8 lib/hanami/generators/action/action.rb.tt
  119. +0 −12 lib/hanami/generators/action/action_spec.minitest.tt
  120. +0 −9 lib/hanami/generators/action/action_without_view.rb.tt
  121. +0 −5 lib/hanami/generators/action/view.rb.tt
  122. +0 −16 lib/hanami/generators/action/view_spec.minitest.tt
  123. +0 −1 lib/hanami/generators/app/.gitkeep.tt
  124. +0 −7 lib/hanami/generators/app/views/application_layout.rb.tt
  125. +0 −1 lib/hanami/generators/application/container/.gitkeep
  126. 0 lib/hanami/generators/application/container/config/initializers/.gitkeep
  127. +0 −1 lib/hanami/generators/application/container/db/.gitkeep
  128. +0 −4 lib/hanami/generators/application/container/hanamirc.tt
  129. +0 −1 lib/hanami/generators/application/container/lib/chirp/entities/.gitkeep
  130. 0 lib/hanami/generators/application/container/lib/chirp/mailers/.gitkeep
  131. 0 lib/hanami/generators/application/container/lib/chirp/mailers/templates/.gitkeep
  132. +0 −1 lib/hanami/generators/application/container/lib/chirp/repositories/.gitkeep
  133. +0 −2 lib/hanami/generators/application/container/lib/project.rb.tt
  134. 0 lib/hanami/generators/application/container/schema.sql.tt
  135. +0 −114 lib/hanami/generators/database_config.rb
  136. +0 −69 lib/hanami/generators/generatable.rb
  137. +0 −52 lib/hanami/generators/generator.rb
  138. +0 −7 lib/hanami/generators/mailer/mailer.rb.tt
  139. +0 −7 lib/hanami/generators/mailer/mailer_spec.rb.minitest.tt
  140. +0 −5 lib/hanami/generators/mailer/mailer_spec.rb.rspec.tt
  141. 0 lib/hanami/generators/mailer/template.html.tt
  142. 0 lib/hanami/generators/mailer/template.txt.tt
  143. +0 −2 lib/hanami/generators/model/entity.rb.tt
  144. +0 −3 lib/hanami/generators/model/entity_spec.rspec.tt
  145. +0 −2 lib/hanami/generators/model/repository.rb.tt
  146. +0 −3 lib/hanami/generators/model/repository_spec.rspec.tt
  147. +0 −44 lib/hanami/generators/template_engine.rb
  148. +0 −55 lib/hanami/generators/test_framework.rb
  149. +1 −1 script/setup
  150. +1 −1 script/teardown
  151. +24 −3 spec/integration/cli/assets/precompile_spec.rb
  152. +12 −0 spec/integration/cli/assets_spec.rb
  153. +50 −0 spec/integration/cli/console_spec.rb
  154. +20 −0 spec/integration/cli/db/apply_spec.rb
  155. +20 −0 spec/integration/cli/db/console_spec.rb
  156. +11 −5 spec/integration/cli/db/create_spec.rb
  157. +20 −0 spec/integration/cli/db/drop_spec.rb
  158. +31 −0 spec/integration/cli/db/migrate_spec.rb
  159. +20 −0 spec/integration/cli/db/prepare_spec.rb
  160. +22 −1 spec/integration/cli/db/version_spec.rb
  161. +18 −0 spec/integration/cli/db_spec.rb
  162. +60 −49 spec/integration/cli/destroy/action_spec.rb
  163. +85 −23 spec/integration/cli/destroy/app_spec.rb
  164. +72 −0 spec/integration/cli/destroy/mailer_spec.rb
  165. +34 −6 spec/integration/cli/destroy/migration_spec.rb
  166. +65 −18 spec/integration/cli/destroy/model_spec.rb
  167. +16 −0 spec/integration/cli/destroy_spec.rb
  168. +41 −14 spec/integration/cli/generate/action_spec.rb
  169. +43 −1 spec/integration/cli/generate/app_spec.rb
  170. +36 −4 spec/integration/cli/generate/mailer_spec.rb
  171. +32 −2 spec/integration/cli/generate/migration_spec.rb
  172. +31 −3 spec/integration/cli/generate/model_spec.rb
  173. +31 −0 spec/integration/cli/generate/secret_spec.rb
  174. +17 −0 spec/integration/cli/generate_spec.rb
  175. +49 −2 spec/integration/cli/new/test_spec.rb
  176. +72 −40 spec/integration/cli/new_spec.rb
  177. +21 −1 spec/integration/cli/routes_spec.rb
  178. +35 −0 spec/integration/cli/server_spec.rb
  179. +78 −2 spec/integration/cli/version_spec.rb
  180. +1 −1 spec/integration/rake/with_minitest_spec.rb
  181. +1 −1 spec/integration/rake/with_rspec_spec.rb
  182. +24 −0 spec/isolation/components/logger/with_arguments_spec.rb
  183. +12 −0 spec/isolation/components/logger/with_custom_logger_spec.rb
  184. +0 −23 spec/isolation/components/logger_spec.rb
  185. +2 −2 spec/isolation/rake/environment_spec.rb
  186. +2 −2 spec/support/hanami_commands.rb
  187. +6 −6 spec/support/shared_examples/cli/generate/app.rb
  188. +1 −1 spec/support/shared_examples/cli/generate/model.rb
@@ -7,7 +7,7 @@ unless ENV['TRAVIS']
end
gem 'i18n'
gem 'hanami-utils', '~> 1.0', require: false, git: 'https://github.com/hanami/utils.git', branch: '1.0.x'
gem 'hanami-utils', '~> 1.0', require: false, git: 'https://github.com/hanami/utils.git', branch: 'develop'
gem 'hanami-validations', '~> 1.0', require: false, git: 'https://github.com/hanami/validations.git', branch: '1.0.x'
gem 'hanami-router', '~> 1.0', require: false, git: 'https://github.com/hanami/router.git', branch: '1.0.x'
gem 'hanami-controller', '~> 1.0', require: false, git: 'https://github.com/hanami/controller.git', branch: '1.0.x'
@@ -16,6 +16,7 @@ gem 'hanami-model', '~> 1.0', require: false, git: 'https://github.com/han
gem 'hanami-helpers', '~> 1.0', require: false, git: 'https://github.com/hanami/helpers.git', branch: '1.0.x'
gem 'hanami-mailer', '~> 1.0', require: false, git: 'https://github.com/hanami/mailer.git', branch: '1.0.x'
gem 'hanami-assets', '~> 1.0', require: false, git: 'https://github.com/hanami/assets.git', branch: '1.0.x'
gem 'hanami-cli', '~> 1.0', require: false, git: 'https://github.com/hanami/cli.git', branch: 'master'
platforms :ruby do
gem 'sqlite3'
@@ -25,6 +25,7 @@ which provides the glue that ties all the parts together:
* [**Hanami::Helpers**](https://github.com/hanami/helpers) - View helpers for Ruby applications
* [**Hanami::Mailer**](https://github.com/hanami/mailer) - Mail for Ruby applications
* [**Hanami::Assets**](https://github.com/hanami/assets) - Assets management for Ruby
* [**Hanami::Cli**](https://github.com/hanami/cli) - Ruby command line interface
* [**Hanami::Utils**](https://github.com/hanami/utils) - Ruby core extensions and class utilities
These components are designed to be used independently or together in a Hanami application.
@@ -52,7 +53,9 @@ You can give back to Open Source, by supporting Hanami development via a [donati
### Supporters
* [Trung Lê](https://github.com/joneslee85)
* [James Carlson](https://github.com/jxxcarlson)
* [Creditas](https://www.creditas.com.br/)
## Contact
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
require 'bundler'
require 'hanami/cli'
Hanami::Cli.start
require 'hanami/cli/commands'
Hanami::Cli.new(Hanami::Cli::Commands).call
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
spec.add_dependency 'hanami-helpers', '~> 1.0'
spec.add_dependency 'hanami-mailer', '~> 1.0'
spec.add_dependency 'hanami-assets', '~> 1.0'
spec.add_dependency 'hanami-cli', '~> 1.0'
spec.add_dependency 'concurrent-ruby', '~> 1.0'
spec.add_dependency 'thor', '~> 0.19'
spec.add_dependency 'bundler', '~> 1.13'
spec.add_development_dependency 'rspec', '~> 3.5'

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,45 @@
require 'hanami/cli'
require 'ostruct'
module Hanami
class Cli
def self.register(name, command = nil, aliases: [], &blk)
Commands.register(name, command, aliases: aliases, &blk)
end
module Commands
extend Hanami::Cli::Registry
class Context < OpenStruct
def initialize(data)
data = data.each_with_object({}) do |(k, v), result|
v = Utils::String.new(v) if v.is_a?(::String)
result[k] = v
end
super(data)
freeze
end
def with(data)
self.class.new(to_h.merge(data))
end
def binding
super
end
end
require 'hanami/cli/commands/command'
require 'hanami/cli/commands/assets'
require 'hanami/cli/commands/console'
require 'hanami/cli/commands/db'
require 'hanami/cli/commands/destroy'
require 'hanami/cli/commands/generate'
require 'hanami/cli/commands/new'
require 'hanami/cli/commands/routes'
require 'hanami/cli/commands/server'
require 'hanami/cli/commands/version'
end
end
end
@@ -0,0 +1,11 @@
module Hanami
class Cli
module Commands
module Assets
require "hanami/cli/commands/assets/precompile"
end
end
register "assets precompile", Commands::Assets::Precompile
end
end
@@ -0,0 +1,35 @@
module Hanami
class Cli
module Commands
module Assets
class Precompile < Command
requires "apps.assets.configurations"
desc "Precompile assets for deployment"
example [
" # Basic usage",
"HANAMI_ENV=production # Precompile assets for production environment"
]
def call(**options)
context = Context.new(options: options)
precompile_assets(context)
end
private
def precompile_assets(context)
Hanami::Assets.precompile(configurations)
end
# @api private
def configurations
requirements['apps.assets.configurations']
end
end
end
end
end
end
Oops, something went wrong.

0 comments on commit fab4f17

Please sign in to comment.