Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to inject lines into existing code #9

Open
derks opened this issue Jun 22, 2012 · 1 comment
Open

Ability to inject lines into existing code #9

derks opened this issue Jun 22, 2012 · 1 comment

Comments

@derks
Copy link
Member

derks commented Jun 22, 2012

Having a larger project broken out into smaller pieces is a useful usecase for Boss. For example and existing Django project from template, and django-app template that pastes into the existing django app. Adding a line to the 'INSTALLED_APPS' list in a django settings.py would be nice. For example:

Existing project settings.py:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    # boss.mark:installed_apps
)

Template boss.json:

{
    "injections": [
        ["installed_apps", "'@[email protected].@app_name@',"]
    ]
}

Using a '#boss.mark' allows us to drop a line of code after the marking point. Might be nice to make the changes, and then present a 'diff' to the user making them accept the change... but maybe that is overkill.

@ghost ghost assigned derks Jun 22, 2012
@derks
Copy link
Member Author

derks commented Jul 11, 2012

This was committed, just needs documentation.

@derks derks modified the milestones: 0.9.16 Beta, 0.9.18 Beta Dec 6, 2014
@derks derks added the 1 - Ready label Mar 5, 2015
@derks derks modified the milestones: 0.9.18 Beta, 0.9.20 Beta Mar 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant