際際滷

際際滷Share a Scribd company logo
Episode #2.0.1 (2016-10-24) Level: Beginner
OctoLab Cookbook
How to use composer.yml
and stop creating issues about
The context
OctoLab Cookbook: how to use composer.yml and stop creating issues about
The problem
 composer/composer#159
 composer/composer#440
 composer/composer#1778
 composer/composer#1988
 composer/composer#5364
is:issue is:closed yaml
The solution
Installation
 https://www.python.org/downloads/ (but most cases it
is already exists)
 pip install pyyaml
 or apt-get install python-yaml
 or yum install python-yaml
 etc.
Requirements
 Python
 PyYAML
- 鍖rst: imports
import sys, yaml, json;
- second: suppress traceback
sys.tracebacklimit = 0;
- third: print it
print(json.dumps(yaml.load(open(sys.argv[1]).read())))
- fourth: integrate all together
<command> = python -c 
"import sys, yaml, json; 
sys.tracebacklimit = 0; 
print(json.dumps(yaml.load(open(sys.argv[1]).read()), indent=2))"
# ~/.bash_pro鍖le
alias yaml2json = <command>
# use it
yaml2json composer.yml > composer.json
The bene鍖ts
OctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues about
COMMENTS!!!
OctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues about
Bonus: PhpStorm integration
OctoLab Cookbook: how to use composer.yml and stop creating issues about
 Convert YAML to JSON Online with related
tools on different languages for console
 composer-yaml
 Example of usage
 package.meta initiative
Useful links
Thank you for your attention!
Have questions?
Kamil Samigullin
a some developer
kamil@samigullin.info
@ikamilsk
github.com/kamilsk
linkedin.com/in/kamilsk

More Related Content

OctoLab Cookbook: how to use composer.yml and stop creating issues about