/** * Get the path to the root folder of the application. * * @return string */ public function getHomeFolder() { $rootDirectory = $this->rocketeer->getOption('remote.root_directory'); $rootDirectory = Str::finish($rootDirectory, '/'); $appDirectory = $this->rocketeer->getOption('remote.app_directory') ?: $this->rocketeer->getApplicationName(); return $rootDirectory . $appDirectory; }
public function testStringFinish() { $str1 = 'Laravel is really awesome'; $str2 = Str::finish($str1, ' and superb'); $this->assertEquals($str2, 'Laravel is really awesome and superb'); $str1 = 'http://home/'; $str2 = Str::finish($str1, '/'); $this->assertEquals($str2, 'http://home/'); }
/** * Cap a string with a single instance of a given value. * * @param string $value * @param string $cap * @return string */ function str_finish($value, $cap) { return Str::finish($value, $cap); }
/** * Get the stub path. * * @param string $path * * @return string */ protected function stubPath($path) { return Str::finish(__DIR__ . '/../../../stubs', '/') . $path; }
/** * Cap a string with a single instance of a given pattern **/ public function finish($cap) { $this->value = Str::finish($this->value, $cap); return $this; }
/** * Generate view with give resource name. * * @param string $view * * @return void */ protected function generateView($view) { $path = $this->getPath($this->getPathInput()); $stub = $this->files->get($this->getStubPath($view . '.stub')); $this->replaceResourceName($stub, $this->getNameInput()); $this->files->put(Str::finish($path, '/') . $view . '.blade.php', $stub); }