Skip to content

Commit

Permalink
Merge branch 'develop' into add-multiple-route-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Sep 29, 2018
2 parents ce2a7a2 + ec6ab7d commit 61f9d8d
Show file tree
Hide file tree
Showing 16 changed files with 132 additions and 60 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ install:
- pip install -e .
- pip install -r requirements.txt

script: travis_retry coverage run -m pytest
script:
- travis_retry coverage run -m pytest
- flake8 masonite/ --ignore=E501,F401,E128,E402,E731,F821,E712

deploy:
provider: pypi
Expand Down
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Sentimental Versioning](http://sentimentalversioning.org/).

## [2.0.19](https://github.com/MasoniteFramework/core/releases/tag/v2.0.19) - 2018-09-02

### Fixed
- Fixed an issue where the reset migration command was not throwing `QueryExceptions`.

## [2.0.18](https://github.com/MasoniteFramework/core/releases/tag/v2.0.18) - 2018-08-30

### Fixed
- Fixed issue where route groups were overriding middleware

## [2.0.17](https://github.com/MasoniteFramework/core/releases/tag/v2.0.17) - 2018-08-28

### Fixed
- Fixed an issue where the autoloader was loading more directories than it was suppose to

## [2.0.16](https://github.com/MasoniteFramework/core/releases/tag/v2.0.16) - 2018-08-22
### Added
- Added docstrings to nearly all classes
Expand Down Expand Up @@ -147,4 +162,4 @@ and this project adheres to [Sentimental Versioning](http://sentimentalversionin

## [Older Releases](https://github.com/MasoniteFramework/core/releases?after=v2.0.1)



48 changes: 48 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic

address, without explicit permission

* Other conduct which could reasonably be considered inappropriate in a

professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at idmann509@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4/)
50 changes: 0 additions & 50 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,53 +139,3 @@ It's important to note that there should have exactly 75 `-` above and below the
4. You must add unit testing for any changes made. Of the three repositories listed above, only the `craft` and `core` repos require unit testing.
5. Increase the version numbers in any example files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/) for both `core` and `craft` or [RomVer](http://blog.legacyteam.info/2015/12/romver-romantic-versioning/) for the main Masonite repo.
6. The PR must pass the Travis CI build. The Pull Request can be merged in once you have a successful review from two other collaborators, or the feature maintainer for your specific feature improvement or the repo owner.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic

address, without explicit permission

* Other conduct which could reasonably be considered inappropriate in a

professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at idmann509@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4/)

2 changes: 1 addition & 1 deletion LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Joseph Mancuso
Copyright (c) 2017-present Joseph Mancuso

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions config/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
CacheProvider,
CsrfProvider,
)
from events.providers import EventProvider

"""
|--------------------------------------------------------------------------
Expand All @@ -40,6 +41,7 @@
StartResponseProvider,
WhitenoiseProvider,
ViewProvider,
EventProvider,

# Optional Framework Providers
SassProvider,
Expand Down
3 changes: 2 additions & 1 deletion masonite/commands/BaseScaffoldCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ class BaseScaffoldCommand(Command):
"""

scaffold_name = 'Example'
suffix = ""
base_directory = 'app/example/'
template = '/masonite/snippets/scaffold/model'

def handle(self):
class_name = self.argument('name')
view = View(App())
class_directory = self.base_directory + '{}.py'.format(class_name)
class_directory = self.base_directory + '{}{}.py'.format(class_name, self.suffix)

if not make_directory(class_directory):
return self.error('{0} Already Exists!'.format(self.scaffold_name))
Expand Down
4 changes: 2 additions & 2 deletions masonite/commands/JobCommand.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
""" New Job Command """
from cleo import Command
from masonite.commands import BaseScaffoldCommand


class JobCommand(Command):
class JobCommand(BaseScaffoldCommand):
"""
Creates a new Job
Expand Down
16 changes: 16 additions & 0 deletions masonite/commands/MiddlewareCommand.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
""" New Middleware Command """
from masonite.commands import BaseScaffoldCommand


class MiddlewareCommand(BaseScaffoldCommand):
"""
Creates a middleware
middleware
{name : Name of the middleware}
"""

scaffold_name = "Middleware"
suffix = "Middleware"
template = "/masonite/snippets/scaffold/middleware"
base_directory = "app/http/middleware/"
1 change: 1 addition & 0 deletions masonite/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .JobCommand import JobCommand
from .KeyCommand import KeyCommand
from .MakeMigrationCommand import MakeMigrationCommand
from .MiddlewareCommand import MiddlewareCommand
from .MigrateCommand import MigrateCommand
from .MigrateRefreshCommand import MigrateRefreshCommand
from .MigrateResetCommand import MigrateResetCommand
Expand Down
7 changes: 4 additions & 3 deletions masonite/providers/AppProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from masonite.autoload import Autoload
from masonite.commands import (AuthCommand, CommandCommand, ControllerCommand,
DownCommand, InfoCommand, InstallCommand,
JobCommand, KeyCommand, MakeMigrationCommand,
MigrateCommand, MigrateRefreshCommand, MigrateStatusCommand,
MigrateResetCommand, MigrateRollbackCommand,
JobCommand, KeyCommand, MiddlewareCommand,
MakeMigrationCommand, MigrateCommand, MigrateRefreshCommand,
MigrateStatusCommand, MigrateResetCommand, MigrateRollbackCommand,
ModelCommand, ProviderCommand, RoutesCommand,
SeedCommand, SeedRunCommand, ServeCommand,
TinkerCommand, UpCommand, ViewCommand, ValidatorCommand)
Expand Down Expand Up @@ -45,6 +45,7 @@ def register(self):
self.app.bind('MasoniteJobCommand', JobCommand())
self.app.bind('MasoniteKeyCommand', KeyCommand())
self.app.bind('MasoniteMakeMigrationCommand', MakeMigrationCommand())
self.app.bind('MasoniteMiddlewareCommand', MiddlewareCommand())
self.app.bind('MasoniteMigrateCommand', MigrateCommand())
self.app.bind('MasoniteMigrateRefreshCommand', MigrateRefreshCommand())
self.app.bind('MasoniteMigrateResetCommand', MigrateResetCommand())
Expand Down
Empty file.
29 changes: 29 additions & 0 deletions masonite/snippets/scaffold/middleware.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
""" {{ class }} Middleware """

from masonite.request import Request


class {{ class }}Middleware:
"""{{ class }} Middleware
"""

def __init__(self, request: Request):
"""Inject Any Dependencies From The Service Container

Arguments:
Request {masonite.request.Request} -- The Masonite request object
"""

self.request = request

def before(self):
"""Run This Middleware Before The Route Executes
"""

pass

def after(self):
"""Run This Middleware After The Route Executes
"""

pass
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ validator.py==1.2.5
waitress==1.1.0
whitenoise==4.0
wrapt==1.10.11
flake8==3.5.0
7 changes: 6 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
[metadata]
description-file = README.md
description-file = README.md
[flake8]
ignore=E501,F401,E128,E402,E731,F821,E712
include=masonite


1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
'orator==0.9.7',
'masonite-entry>=0.0.0,<=0.9.99',
'masonite-scheduler>=1.0.0,<=1.0.99',
'masonite-events==1.0.1',
'pendulum==1.5.1',
'cleo>=0.6,<=0.6.99',
'tabulate==0.8.2',
Expand Down

0 comments on commit 61f9d8d

Please sign in to comment.