Skip to content

Commit 72932e4

Browse files
authored
Merge pull request #14 from webfactor/3.1
add Opener classes for sublime and VS Code
2 parents 199ef9d + b67a035 commit 72932e4

File tree

5 files changed

+43
-3
lines changed

5 files changed

+43
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
2121
### Security
2222
- Nothing
2323

24+
## 3.1.0 - 2018-06-25
25+
26+
### Added
27+
28+
- Opener classes for Sublime and VS Code
29+
2430
## 3.0.0 - 2018-06-24 - Complete Refactoring
2531

2632
The Refactoring is supposed to provide new functions more easily in the future.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ With `{--git}` option all generated files will be added to git automatically. In
136136

137137
## Open files in IDE
138138

139-
With `{--ide=}` option you can define your preferred IDE to open all automatically generated files. This package comes with an implementation for PhpStorm (`Webfactor\Laravel\Generators\RecipesPhpStormOpener`) which is defined in `generators.php`. The keys in the `ides`-Array are possible values for the command option. You can add other IDE-Opener classes, they have to implement `Webfactor\Laravel\Generators\Contracts\OpenInIdeInterface`.
139+
With `{--ide=}` option you can define your preferred IDE to open all automatically generated files. The keys in the `ides`-Array of the config file are possible values for the command option. You can add other IDE-Opener classes, they have to implement `Webfactor\Laravel\Generators\Contracts\OpenInIdeInterface`. This package comes with implementations for PhpStorm (`pstorm`), Sublime (`sublime`) and VS Code (`vscode`).
140140

141141
In your service class you have to add the generated file to a stack (see "Add files to git" section)
142142

config/generators.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
*/
88
'services' => [
99
Webfactor\Laravel\Generators\Services\MigrationService::class,
10-
Webfactor\Laravel\Generators\Services\LanguageFileService::class,
10+
/*Webfactor\Laravel\Generators\Services\LanguageFileService::class,
1111
Webfactor\Laravel\Generators\Services\BackpackCrudModelService::class,
1212
Webfactor\Laravel\Generators\Services\BackpackCrudRequestService::class,
1313
Webfactor\Laravel\Generators\Services\BackpackCrudControllerService::class,
1414
Webfactor\Laravel\Generators\Services\FactoryService::class,
1515
Webfactor\Laravel\Generators\Services\SeederService::class,
1616
Webfactor\Laravel\Generators\Services\RouteService::class,
17-
Webfactor\Laravel\Generators\Services\SidebarService::class,
17+
Webfactor\Laravel\Generators\Services\SidebarService::class,*/
1818
],
1919

2020
/*
@@ -23,6 +23,8 @@
2323
*/
2424
'ides' => [
2525
'pstorm' => Webfactor\Laravel\Generators\Recipes\PhpStormOpener::class,
26+
'sublime' => Webfactor\Laravel\Generators\Recipes\SublimeOpener::class,
27+
'vscode' => Webfactor\Laravel\Generators\Recipes\VSCodeOpener::class,
2628
],
2729

2830
'naming' => [

src/Recipes/SublimeOpener.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Webfactor\Laravel\Generators\Recipes;
4+
5+
use Webfactor\Laravel\Generators\Contracts\OpenInIdeAbstract;
6+
use Webfactor\Laravel\Generators\Contracts\OpenInIdeInterface;
7+
8+
class SublimeOpener extends OpenInIdeAbstract implements OpenInIdeInterface
9+
{
10+
public function open()
11+
{
12+
foreach ($this->files as $file) {
13+
exec('subl ' . $file->getPathname());
14+
}
15+
}
16+
}

src/Recipes/VSCodeOpener.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Webfactor\Laravel\Generators\Recipes;
4+
5+
use Webfactor\Laravel\Generators\Contracts\OpenInIdeAbstract;
6+
use Webfactor\Laravel\Generators\Contracts\OpenInIdeInterface;
7+
8+
class VSCodeOpener extends OpenInIdeAbstract implements OpenInIdeInterface
9+
{
10+
public function open()
11+
{
12+
foreach ($this->files as $file) {
13+
exec('code ' . $file->getPathname());
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)