diff --git a/LICENSE.txt b/LICENSE.txt index 1979663..97fb044 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Erik Jonsson Thorén +Copyright (c) 2015 Erik Jonsson Thorén Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 4886fab..15213ea 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Tool for generating a Postman collection from the Apiary API, or Blueprint JSON Supports * Blueprint API Markup - * Blueprint API JSON from Snowcrash + * Blueprint API JSON from Drafter (Snowcrash) * Fetching Blueprint API Markup from Apiary API # Installation @@ -47,9 +47,9 @@ It's also possible to specify the output file using the `--output`. # Prerequisites -[Snowcrash](https://github.com/apiaryio/snowcrash#install) is required if you want to use Blueprint API markup/Apiary API. +[Drafter](https://github.com/apiaryio/drafter) is required if you want to use Blueprint API markup/Apiary API. To install on OS X: - brew install --HEAD https://raw.github.com/apiaryio/snowcrash/master/tools/homebrew/snowcrash.rb - + brew install --HEAD https://raw.github.com/apiaryio/drafter/master/tools/homebrew/drafter.rb + diff --git a/apiary2postman/apiary2postman.py b/apiary2postman/apiary2postman.py index b625005..f86c9f9 100755 --- a/apiary2postman/apiary2postman.py +++ b/apiary2postman/apiary2postman.py @@ -13,17 +13,17 @@ def readInput(): return content -def check_snowcrash(): +def check_drafter(): try: - subprocess.check_output(['which', 'snowcrash']) + subprocess.check_output(['which', 'drafter']) except: - print 'Please install snowcrash:' + print 'Please install drafter:' print '' print 'By using brew:' - print '\tbrew install --HEAD https://raw.github.com/apiaryio/snowcrash/master/tools/homebrew/snowcrash.rb' + print '\tbrew install --HEAD https://raw.github.com/apiaryio/drafter/master/tools/homebrew/drafter.rb' print '' print 'By source, see:' - print '\thttps://github.com/apiaryio/snowcrash#build' + print '\thttps://github.com/apiaryio/drafter' exit(3) def main(): @@ -38,12 +38,12 @@ def main(): subparsers = parser.add_subparsers(help='',title='subcommands', description='valid subcommands') - parser_blueprint = subparsers.add_parser('blueprint', description='blueprint: Read Blueprint API markup, then convert it using snowcrash, then generate Postman collection JSON.', - help='Read Blueprint API markup, then convert it using snowcrash, then generate Postman collection JSON. Use "blueprint -h" for more help.') + parser_blueprint = subparsers.add_parser('blueprint', description='blueprint: Read Blueprint API markup, then convert it using drafter, then generate Postman collection JSON.', + help='Read Blueprint API markup, then convert it using drafter, then generate Postman collection JSON. Use "blueprint -h" for more help.') parser_json = subparsers.add_parser('json', description='json: Use prepared JSON to generate the Postman collection.',help='Use prepared JSON. Use "json -h" for more help.') - parser_api = subparsers.add_parser('api', description='api: Use the Apiary API to fetch the Blueprint markup, then convert it using snowcrash, then generate Postman collection JSON.', + parser_api = subparsers.add_parser('api', description='api: Use the Apiary API to fetch the Blueprint markup, then convert it using drafter, then generate Postman collection JSON.', help='Use the Apiary API to fetch the JSON. Use "api -h" for more help.') parser.add_argument('--pretty', dest='pretty', action='store_true', default=False, @@ -70,11 +70,11 @@ def main(): input = args.input.read() elif hasattr(args, 'blueprint_input'): # blueprint mode - check_snowcrash() + check_drafter() input = blueprint2json(args.blueprint_input.read()) else: # API mode - check_snowcrash() + check_drafter() apikey = None if args.key != None: diff --git a/apiary2postman/blueprint.py b/apiary2postman/blueprint.py index fe1ec09..f546098 100644 --- a/apiary2postman/blueprint.py +++ b/apiary2postman/blueprint.py @@ -11,7 +11,7 @@ def fetch_blueprint(name, key): return response_body['code'] def blueprint2json(blueprint): - p = Popen(['snowcrash', '--format', 'json'], stdin=PIPE, stdout=PIPE, stderr=PIPE) + p = Popen(['drafter', '--format', 'json'], stdin=PIPE, stdout=PIPE, stderr=PIPE) out, err = p.communicate(blueprint) return out \ No newline at end of file diff --git a/setup.py b/setup.py index 5ac110c..d964f03 100644 --- a/setup.py +++ b/setup.py @@ -2,12 +2,12 @@ setup( name = 'apiary2postman', packages = ['apiary2postman'], # this must be the same as the name above - version = '0.4.4', + version = '0.4.6', description = 'A tool for converting Blueman API markup from Apiary.io to Postman collection/dumps', author = 'Erik Jonsson Thoren', author_email = 'thecopy@gmail.com', url = 'https://github.com/thecopy/apiary2postman', # use the URL to the github repo - download_url = 'https://github.com/thecopy/apiary2postman/tarball/0.4.4', # I'll explain this in a second + download_url = 'https://github.com/thecopy/apiary2postman/tarball/0.4.6', # I'll explain this in a second keywords = ['apiary', 'blueman', 'postman'], # arbitrary keywords classifiers = [], entry_points={