changeset 16:e577dac6c913 development

Simple test
author Luka Sitas <sitas.luka.97@gmail.com>
date Mon, 23 Sep 2024 20:32:05 -0400
parents 4bb4daa9e3f1
children
files .vimrc src/Test.php src/tmp.php src/tmp2.php
diffstat 4 files changed, 22 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/.vimrc	Wed Apr 24 19:52:35 2024 -0400
+++ b/.vimrc	Mon Sep 23 20:32:05 2024 -0400
@@ -28,46 +28,3 @@
 " Committing commands
 map <C-k> :wa<CR>:!hg addremove && hg commit <CR>
 
-" Git commands, for now don't port to hg
-" function! GitDiffCached()
-"   let files = system('git diff --cached --name-only')
-" 
-"   if v:shell_error
-"     echo "Error running git diff"
-"     return
-"   endif
-" 
-"   let filelist = split(files, "\n")
-"   let chosen_file = inputlist(filelist)
-" 
-"   if chosen_file != -1
-" 		let cmd = 'tabnew ' . filelist[chosen_file]
-"     execute cmd
-"   endif
-" endfunction
-" 
-" execute "set <M-d>=\033d"
-" map <M-d> :call GitDiffCached()<CR>
-"
-"
-"
-"
-
-
-function! SendBufferToProgram()
-    " Create a temporary file
-    let temp_file = tempname()
-    
-    " Write current buffer to the temporary file
-    exe "write! " . temp_file
-    
-    " Send the content of the temporary file to your program
-    " Replace <your_program> with the actual command to run your program
-    let command = "cat " . temp_file . " | <your_program>"
-    
-    " Execute the command
-    call system(command)
-    
-    " Optionally, delete the temporary file if not needed
-    call delete(temp_file)
-endfunction
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Test.php	Mon Sep 23 20:32:05 2024 -0400
@@ -0,0 +1,9 @@
+<?php
+
+
+require_once("Helpers/FileModifier.php");
+
+$fm = new Wizzard\MagicForger\Helpers\FileModifier(__DIR__ . "/tmp.php");
+$fm->insert("I HAVE BEEN INSERTED", "{{ INSERT_1 }}");
+$fm->replace("I HAVE BEEN REPLACED", "{{ REPLACE_1 }}");
+$fm->write_to_path(__DIR__ . "/tmp2.php");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/tmp.php	Mon Sep 23 20:32:05 2024 -0400
@@ -0,0 +1,6 @@
+<?php
+Test line 1
+Test line 2
+//{{ INSERT_1 }}
+NEW LINE
+//{{ REPLACE_1 }}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/tmp2.php	Mon Sep 23 20:32:05 2024 -0400
@@ -0,0 +1,7 @@
+<?php
+Test line 1
+Test line 2
+I HAVE BEEN INSERTED
+//{{ INSERT_1 }}
+NEW LINE
+//I HAVE BEEN REPLACED