1. 15 Nov, 2017 1 commit
  2. 14 Nov, 2017 4 commits
    • Mark's avatar
      Add ms to auth generated migration timestamped file name (#390) · 62370c4e
      Mark authored
      
      
      Former-commit-id: 2a14521fdf9c0951cc105383c3cf8c230494dfcf
      62370c4e
    • Elias Perez's avatar
      Updates the Amber Gitter channel URL · f66a0c2c
      Elias Perez authored
      Currently the Amber Channel URL has the wrong domain extension
      this correct the URL with the correct domain extension
      
      Former-commit-id: 7933082149c34d125aae959d3bafa806f64ae732
      f66a0c2c
    • Elias Perez's avatar
      Ep/move properties to server (#386) · 5d09a1ce
      Elias Perez authored
      * [Server] Moves Router and Handler out off Settings
      
      - Moves the Pipeline instance from Amber::Settings into the Server instance
      - Moves the Router instance from Amber::Settings into the Server instance
      Signed-off-by: 's avatarElias Perez <eliasjpr@gmail.com>
      
      * [Server] Moves WebSocketAdapter and Removes Settings class method
      Signed-off-by: 's avatarElias Perez <eliasjpr@gmail.com>
      
      * [Server] Move websockets from Configuration to Server
      
      - Replace settings.handler with just handler
      
      Former-commit-id: 604d6329de20f694a4e4296a499fc0d7c3ac2d81
      5d09a1ce
    • Elias Perez's avatar
      Ep/master build (#381) · 4127dcde
      Elias Perez authored
      * Move build test to its own file and test more aspects of build
      
      * Move build test to its own file and test more aspects of build
      
      * Update Dockerfile to run build tests
      
      * Modify integration tests
      
      * Modify integration tests
      
      * [Master Build] Fix Master Build Spec
      
      * [Master Build] Run Shard Update and Crystal Spec
      
      * [Rename Method] Renames create_method to create_{model_name}
      
      * [Cleanup] Cleans up method names in generators
      
      * [Master Build] Ensure cleanup of test app
      
      * [Garnet Spec] Renames Amber Spec to Garnet Spec
      
      * [Scaffold] Renames Spec:: to GarnetSpec::
      
      * Update based on code review
      
      
      Former-commit-id: 1883e4fc26095b251d88f903466d6183274aeb24
      4127dcde
  3. 12 Nov, 2017 2 commits
    • Faustino Aguilar's avatar
      Fixes front-end dependencies for Amber Framework (#372) · 3325dfa4
      Faustino Aguilar authored
      * Fixes front-end dependencies for Amber Framework
      
      - Add node_modules and package.lock to .gitignore
      - Add let keyword on amber.js applying #361
      - Generate amber.min.js
      - Add babel-loader and env preset to webpack config
      
      * Change description
      
      * Add instructions to buid amber.min.js
      
      
      Former-commit-id: 88327c684ecb10655f160afeef2c68dd8590fdc7
      3325dfa4
    • Isaac Sloan's avatar
      Set ENV["PORT"] to be used by default if defined. (#377) · 09405e33
      Isaac Sloan authored
      * added envport by default
      
      * allowed ENV["PORT"] to be used by default if defined.
      
      * added env override to settings files.
      
      
      Former-commit-id: ea8021abb7ea4f3286b39db30ac20a62a8412ac6
      09405e33
  4. 11 Nov, 2017 5 commits
    • Isaac Sloan's avatar
      Trying again to get the tests to pass predictably on linux. (#383) · 1a649965
      Isaac Sloan authored
      * Got travis tests to pass every time. Ended up being an issue of timestamp resolution on files for linux.
      * trying again 😢
      
      * Update environment_loader.cr
      
      * changed timestamp to milliseconds
      
      * one last push to make sure travis still passes 4 times in a row
      
      
      Former-commit-id: b80812775cb295457d6050e345b118549fb2dd3f
      1a649965
    • Isaac Sloan's avatar
      Revert "cli: add "amber exec" command for executing one-liners (#352) (#371)" (#382) · a730d150
      Isaac Sloan authored
      This reverts commit 137c95ba8b2bedd1c934599627c7e9ce5373b1bd [formerly 8dce363d6cb8eb0d18e6f17e78df1e9c2faef9cd].
      
      Former-commit-id: af11eeb7e4a19d86ea4bc02c374a0202de1849ad
      a730d150
    • Sam Johnson's avatar
      cli: add "amber exec" command for executing one-liners (#352) (#371) · c2250f90
      Sam Johnson authored
      * cli: add "amber exec" command for executing one-liners (#352)
      
      * this now behaves as close to a console as we can make it
      
      * finishing touches for amber exec
      
      * do not run editor unless in editor mode
      * always return a result
      * minor wording change in error message
      
      * amber exec specs
      
      * cleaned up code a bit and copied existing file to new temp file for edits
      
      * specs pass yay. MainCommand.run always returns nil which makes testing hard
      
      * new push to see if travis passes. Pass locally so I'm confused.
      
      * debugging to figure out why travis doesn't pass
      
      * added sleeps to see if that works
      
      * one last thing
      
      * what the what?
      
      * i hope this will clear it up
      
      * weird hack that i think fixes specs on linux
      
      * commented weird hack
      
      * native ls had better work
      
      * formatted and fixed tests probably
      
      * removed some vestigual code.
      
      * removed macro flag for now
      
      * test47 of travis
      
      * namespaces specs
      
      * sorted ls results
      
      
      Former-commit-id: 3a55d2a2872d55a91ad1130f10efd11ba5b5c979
      c2250f90
    • Isaac Sloan's avatar
      emergency fix · 6f18bd42
      Isaac Sloan authored
      
      Former-commit-id: bb5612ec0df9461850421c1f276dd7853e79071f
      6f18bd42
    • Isaac Sloan's avatar
      fixed bug where body was getting parsed when it didn't exist. · 56ca09bb
      Isaac Sloan authored
      Former-commit-id: 3dda27bbec1801512bd53090279e7fd8aa076233
      56ca09bb
  5. 10 Nov, 2017 1 commit
  6. 09 Nov, 2017 5 commits
    • Mark's avatar
      Allow multiple pipelines to be added with one block (#359) · 9189dead
      Mark authored
      * Allow multiple pipelines to be added with one block
      
      * Add tests to DSL::Server pipeline
      
      * Fix bug where `key?` was return `nil` - creating a false negative
      
      * Refactor some Amber::DSL::Server tests
      
      * Switch server_spec to use `instance` and `settings`
      - Using Amber::Server.new was breaking and Amber::Server.configure will be deprecated in favor of settings
      - Also added some nil checks to get failures in test suite instead of errors
      
      
      Former-commit-id: aeef4994c509852f881f50d197e62a1e60fad7bc
      9189dead
    • Dru Jensen's avatar
      Add missing let on amber.js (#361) · 957e8b4d
      Dru Jensen authored
      
      
      Former-commit-id: 765f8fca5ec99ccd9ef9ef917786a413422b8ddc
      957e8b4d
    • Faustino Aguilar's avatar
      Fix and update dependencies (#370) · d232198e
      Faustino Aguilar authored
      * Fixes #333 
      * Update crystal databases libraries.
      * Update Kilt dependency
      * Update Cli dependency
      
      
      Former-commit-id: f20150769b9915283bc98e621f5c18cd9794e3d7
      d232198e
    • Faustino Aguilar's avatar
      Fix dependencies for amber projects using default app template (#373) · a95a155d
      Faustino Aguilar authored
      Fix dependencies for amber projects using default app template
      
      Former-commit-id: 1e96ab791182d43dc47a2bc936950787b8f62f09
      a95a155d
    • Isaac Sloan's avatar
      Created params object that can parse json when asked too. (#369) · 89db9e96
      Isaac Sloan authored
      * params work fine but validations seem messed up. I played with them a bit but not much progress
      
      * Makes params validation to use the new Amber::Router::Params
      
      - Removes previous implementation and uses the implementation.
      - Updates specs
      Signed-off-by: 's avatarElias J. Perez <elias.perez@harrys.com>
      
      * do tests still pass here?
      
      Former-commit-id: a3cd3d893ca6be4c19c4c9a7e5c754e0f1ce591f
      89db9e96
  7. 08 Nov, 2017 5 commits
    • Elias Perez's avatar
      [Redirect] Allows for Class and Symbol Controller name (#363) · 3d4d52ca
      Elias Perez authored
      * [REDIRECT] Allows for Class and Symbol Full Controller name
      
      Issue: https://github.com/amberframework/amber/issues/353
      
      > As a developer I would like to pass and full controller name to a
      redirect as a class or symbol and allow for the redirection to happen
      
      Example
      
      `redirect_to controller: :HomeController, action: :index`
      
      - Would be nice to accept HelloController::Index or
      Admin::UserController:Index
      
      * fixup! [REDIRECT] Allows for Class and Symbol Full Controller name
      
      * Adds Hash Table Lookup for Routes
      
      
      Looking up routes base on controller and action in a radix tree causes On2
      many cases because of the radix tree.
      
      To avoid that pain this adds hash table to perform lookups by conntroller
      name and action while this might consume more memory it performs better and
      makes the code cleaner and lookups based on controller#action are now more reliable
      Signed-off-by: 's avatarElias Perez <eliasjpr@gmail.com>
      
      * Removes Redirect Exception
      
      Since it is now using hash table lookup for redirects there is no need for
      raising errors, if the controller action combination does not exists it throws
      KeyError exception.
      Signed-off-by: 's avatarElias Perez <eliasjpr@gmail.com>
      
      * Cleanup and fixes specs
      Signed-off-by: 's avatarElias Perez <eliasjpr@gmail.com>
      
      * Cleanup
      
      Former-commit-id: 656c3f6013da546db1711c23d975503bac9c8e2a
      3d4d52ca
    • Nathan Jones's avatar
      cli: implement `db create/drop` for sqlite3 (#351) · fa7a1cc6
      Nathan Jones authored
      When running `amber db create` for an sqlite3 database, amber displays
      the error:
      
        could not determine database name
      
      This can be confusing to the user who doesn't know that `amber db
      create` does not need to be run for sqlite3 databases. Display a
      friendlier message.
      
      Also implement `amber db drop` to delete the database.
      
      Former-commit-id: 3253ec9582e5f83111b04867bd455083baebd817
      fa7a1cc6
    • Elias Perez's avatar
      [Controller] Adds Route Helper Methods to Controller (#362) · 48ca462c
      Elias Perez authored
      * Adds Route Helper Methods to Controller
      
      
      > As a developer I want to have access to the current matched
      route information such as the Action, Controller, Resource
      and Scope accessed.
      
      This adds a Route helper file
      - Includes the following methods route_action, route_controller,
      route_resource, route_scope in the controller
      
      ### Alternate Design
      
      I thought of using a different name such as action_name, controller_name
      but it seemed more explicit to have `route_` prefix to hint the user where is
      this information is coming from.
      
      * fixup! Adds Route Helper Methods to Controller
      
      
      Former-commit-id: 3df8c1e66acf82c2ff4484675ca402d38b86767b
      48ca462c
    • Faustino Aguilar's avatar
      Update font-end dependencies on app template (#366) · 76420ea0
      Faustino Aguilar authored
      * Update font-end dependencies
      
      * Update babel presets
      
      
      Former-commit-id: fc697f7bbfdfb1350749dc9288d76e84f1ef7f49
      76420ea0
    • Isaac Sloan's avatar
      Respond_with uri extensions path.[json|xml|text|txt|html] (#367) · 8bf9b838
      Isaac Sloan authored
      * works but reveals another issue with params... :{
      
      * handled extensions for respond_with
      
      * added tests and made video demo
      
      * changed from response back to content
      
      * modified some code as requested
      
      * accidentally undid something before my last commit
      
      * fixed requested changes
      
      * changed unacceptable response
      
      * refactored a bit more
      
      * done
      
      * added content-type and status_code to tests
      
      
      Former-commit-id: 8362a6266ee0c1b88b1591892e7d2856b788d1a1
      8bf9b838
  8. 07 Nov, 2017 2 commits
    • Isaac Sloan's avatar
      Improved settings and fixed tests (#364) · b8cd34fb
      Isaac Sloan authored
      * Fixed session so that it could be tested without previous tests
      effecting it's state randomly. Also conforms to best practices.
      
      * resolved logging level settings with instance variables
      
      * added settings to configure with block since it's probably clear than configure.
      
      * added requested test change
      
      
      Former-commit-id: 232ab29db5d1936b35455bf80d357acd559ab948
      b8cd34fb
    • Faustino Aguilar's avatar
      Add community section (#368) · e8bca650
      Faustino Aguilar authored
      
      
      Former-commit-id: 39a36d01328351d012bdd82d22846bf5f513b238
      e8bca650
  9. 05 Nov, 2017 1 commit
    • Mark's avatar
      Update tagline (#360) · 6384a970
      Mark authored
      
      
      Former-commit-id: 421845219207b7bd8eb5a45bc561da94df357218
      6384a970
  10. 04 Nov, 2017 5 commits
    • Elias Perez's avatar
      Organizes Controllers Helper Methods (#357) · b1226eeb
      Elias Perez authored
      * Organizes Controllers Helper Methods
      
      - Moves redirect into the Helpers subdirectory in controller
      - Updates require path
      - Renames Helper::Tags to Helpers::CSRF
      
      * Rename tags.cr to csrf.cr
      
      * Remove  include RedirectMethods
      
      
      Former-commit-id: d5f143d234d695c16290e0372309886afd6be328
      b1226eeb
    • Faustino Aguilar's avatar
      Centered logo README (#355) · 07718026
      Faustino Aguilar authored
      * Update design of README heading
      
      * Remove old links
      
      * Update slogan and paragraph
      
      * Update slogan
      
      
      Former-commit-id: aea08f5dc75695018f8ee14cb1101ccda265183c
      07718026
    • Dru Jensen's avatar
      merge docker files (#350) · cba13088
      Dru Jensen authored
      
      
      Former-commit-id: 83ea7e3ba8c2e39ee96b58e1e12fe85c62b9a9a3
      cba13088
    • Faustino Aguilar's avatar
      Update dependencies (#349) · fbbae072
      Faustino Aguilar authored
      * Update dependencies
      
      * Remove branch comment
      
      * Fix shard build
      
      * Use test app name instead of path
      
      * More explicit build command to see failures
      
      * Downgrade mosop/cli
      
      * Try previous version of kilt
      
      
      Former-commit-id: edb4bb119e079559abf1d2cf0d312b7d09c6a001
      fbbae072
    • Isaac Sloan's avatar
      Methods to set content type and content (#313) · e25ea0a3
      Isaac Sloan authored
      * methods to set content type and content
      
      * respond_with
      
      * respond with works
      
      * organized methods better
      
      * allow hash or json for json response
      
      * formatting
      
      * small changes
      
      * moved content_types out to constant
      
      * tested IRL
      
      * refactored file structure
      
      * works after many hours
      
      * good for now, got it working as good as it used to.
      
      * added tests
      
      * tests work and fixes empty headers'
      
      * removed vestigul code
      
      
      Former-commit-id: 6d2d14d5babcbe787326a360ddb607589c055766
      e25ea0a3
  11. 02 Nov, 2017 1 commit
  12. 01 Nov, 2017 1 commit
    • Elias Perez's avatar
      Clean Up and Dry Tests (#344) · 7e87df94
      Elias Perez authored
      * Organize Factories into Fixtures
      
      * Organizes Helpers into submodules
      
      * Cleans up the CLI Commands Specs
      
      This organizes and cleans up and DRY the CLI specs making it more
      readable and cohesive.
      
      * Updates
      
      * fixup! Organize Factories into Fixtures
      
      * fixup! Organize Factories into Fixtures
      
      * fixup! Organize Factories into Fixtures
      
      
      Former-commit-id: b6f0459a162c67c0738aa7f145f0cb143dc69e94
      7e87df94
  13. 31 Oct, 2017 3 commits
    • Mark's avatar
      Use table name as part of database index name (#336) (#340) · 678cb939
      Mark authored
      * Write tests for CREATE INDEX line in migrations template (#336)
      
      * Implement including table name in CREATE INDEX line in migrations template
      
      * Refactor generating CREATE INDEX sql statements for reference fields (#336)
      
      * Refactor generating migrations
      
      * Refactor tests for migration cli templates
      
      
      Former-commit-id: fc551c54a9c625dee92b99c76564e3bcb978d9ef
      678cb939
    • Faustino Aguilar's avatar
      Format comments using JSDoc pattern (#338) · 394d5248
      Faustino Aguilar authored
      
      
      Former-commit-id: 853be71fecc7789ba50575bfcb675c6366dec228
      394d5248
    • Mark's avatar
      Fix postgresql database naming convention (#332) · d459d7e6
      Mark authored
      * Add test for generating and app with postgres
      
      * Add test for database url in environment yaml files
      
      * Add tests for database urls and names generated for docker-compose.yml
      
      * Replace '-' with '_' for postgresql database names
      
      * Switch default postgresql username to postgres in database.yml
      
      * Name databases consistently for pg, mysql, sqlite
      
      * Test Amber::CLI::App directly for database naming
      
      * Use 'database_name_base' property in all parts of docker-compose.yml
      
      
      Former-commit-id: 69716c4e3658e049b0a822b28d1916f7943c1b5a
      d459d7e6
  14. 30 Oct, 2017 1 commit
    • Mark's avatar
      Have generators handle multi-word names (#316) (#330) · 40816391
      Mark authored
      * Add tests for generating file names and class names correctly (#316)
      
      * No longer downcase name when instantiating a Template (#316)
      
      * Switch all cases of `@name.capitalize` to `@name.camelcase` (#316)
      
      * Switch from `@name.camelcase` everywhere to `class_name` instance method (#316)
      
      * Add `display_name` method and use it in generators
      
      * Incorporate class naming convention in route generators (#316)
      
      * Incorporate table naming convention in crecto and granite generators (#316)
      
      * Delete files in a better way in generator_spec
      
      
      Former-commit-id: 7e422db0edd739c41623e91984fe485fb426de2b
      40816391
  15. 28 Oct, 2017 1 commit
    • Elias Perez's avatar
      Fix missing require for task runner (#335) · 045285f3
      Elias Perez authored
      Currently Amber is not compiling on master because of missing requires.
      
      This adds require to the correct places.
      
      Amber compiles successfully after.
      
      Former-commit-id: e2d7a128c5ff047fe41b2cc2441ed1e2624d7d40
      045285f3
  16. 27 Oct, 2017 2 commits
    • Dru Jensen's avatar
      Better Request Parsing Parameters (#331) · 09f02e7d
      Dru Jensen authored
      * Better Request Parsing Parameters
      
      Issue: https://github.com/amberframework/amber/issues/310
      
      The framework should be able to parse JSON request body appropriately by
      returning a `JSON::Any` object.
      
      Currently, there is a bug when trying to parse JSON parameters from the
      body of a request where nested JSON payload is not being parsed correctly
      
      ```crystal
      { "test": "test", "address": { "city": "New York" }
      params["address"].as(Hash)["city"]
      ```
      Params is now a custom Hash of the following signature
      `Hash(String | Symbol, Amber::Router::ParamsType)` or
      `Amber::Router::ParamsHash.new`
      
      To give more context all parameters where being parsed using the
      **HTTP::Params.parse** method which returns an object of type
      **Hash(String, Array(String))** this caused issues when parsing
      JSON params from the body, It turns out that nested JSON keys where
      being parsed as a string. Basically, all `params` values are currently
      returning as a string.
      
      With the changes presented in this PR users can now define model objects
      with JSON mapping that should be evaluated correctly based on the mapping
      defined. So for instance:
      
      ```crystal
      params["user_id"].as(Int64) => 123
      params["address"].as(Hash).each ...
      params["user"].as(User) => User.name
      User.from_json(params["user"]) => User.name
      ```
      **Controller**
      The controller now generates the app using params.validation similar to
      Rails strong params. It adds a method to the Controller and overloads the
      Granite initializer and set_attributes methods.
      
      ```crystal
      private def animal_params
        params.validation do
          required("name") { |v| v.str? & !v.empty? }
        end
      end
      animal = Animal.new(animal_params.validate!)
      ```
      
      Model
      Models generate for the Granite::ORM now includes the following line include
      Amber::Models::Granite this will allow models to be populated with the controller
      params using the params.validations. The reason this is added here and not to the
      Granite::ORM repo is to keep Granite loosely coupled from any framework since the
      params.validation is specific to amber.
      
      ```crystal
      class Animal < Granite::ORM
        include Amber::Models::Granite
      end
      ```
      
      * fixup! Better Request Parsing Parameters
      
      Former-commit-id: 9d9ccd6d4418ed0f6c512378a29017d09b593ac0
      09f02e7d
    • Faustino Aguilar's avatar
      Fix version numbers (#319) · 7251dfd2
      Faustino Aguilar authored
      * Add dependency badge
      
      * Update dependencies
      
      * Change CMD to CLI
      
      More accurate to Command Line Interface
      
      * Add sentry_command helper
      
      * Use local sentry command
      
      * Use local sentry command
      
      * Remove sentry fork
      
      * Add sentry dependency
      
      * Remove icr fork and use original repo
      
      * Update dependencies
      
      * Fix watch option
      
      * Add support for new options in Micrate::Cli
      
      * Fix wrong number of arguments for run_dbversion
      
      * Fix arguments for report_unordered_migrations
      
      * Fix & update ICR version
      
      * Update Micrate::Cli arguments
      
      * Fix micrate version
      
      * Remove parameter changes
      
      * Remove parameter changes
      
      * Moving file
      
      * Create sentry command helper
      
      * Fix require
      
      * Fix require
      
      * Update Kilt
      
      * Return old version
      
      because test_app still depends on Amber 0.3.0, which depends on kilt 0.3.3, so there is a dependency resolution problem. That test should be automatically fixed once you bump a version or prepare a new release.
      
      * Revert "Merge branch 'master' into fix-version-numbers"
      
      This reverts commit 943e0d1633040a06378ddf842c72e671fe13f839 [formerly 9b27a5eee5dd2f506bcf27092cb228bf2b5a9492], reversing
      changes made to 15722113768eef4b75d74060175a4637771e8372 [formerly b8a34f1f905dcab8578548a8892f6be95c1ed531].
      
      * Revert "Revert "Merge branch 'master' into fix-version-numbers""
      
      This reverts commit 5ce6ebccfd4e290766f0b29a1b225970410d7f7d [formerly 2bef54663aefc59b60e6653663d0b9ed0e48a852].
      
      * Return old version of mosop/cli
      
      
      Former-commit-id: 9f605f85faf32d8da1e84005c33223df421146b1
      7251dfd2