seydar avatar seydar committed 7416b19 Draft

starting work

Comments (0)

Files changed (4)

-FUTURE:
-*   set local variables in config, have them appear in shell
-*   getting the menu to NOT have leading quotes
-*   remove/edit history
-    -> important for removing passwords if accidentally typed
-*   improve library usage of executables
-*   interprocess communication
-    -> sharing of variables between chitin processes
-*   remove trailing whitespace from lines somehow. maybe as a final transformation when you hit enter?
-*   `other_ls = method(:ls)` would be cool. note that ls is mapped to a binary and is not actually a method
-*   pass environment to child processes
-*   tab complete ruby/shell things
-*   post_processing for shell commands
-    -> make it asynchronous and use pipes
+o fill in Runnable#secure_run and #secure_raw_run
 
-QUIRKS:
-*   menu doesn't erase itself sometimes
-    -> cat and tabcomplete a file that is empty. output is correct but confusing
-*   does not play nice with GDB if it is called within the bash profile file
-
-FAILURES:
-*   ^C on running ruby programs kills the whole interpreter... womp.
-*   slashes in filenames
-*   `include Math; sin(5)` fails
-
-Questions:
-*   Why do you have to do @line = '' in Coolline in order to not affect the
-    history? History calls el.dup which creates a new object. It shouldn't
-    matter if I do @line.clear on the original.
-
-RELEASE
-*   failures
-

lib/chitin/commands/executable.rb

           end
         else
           # I'm leaving this here so that I know what went down in this
-          # battlefield. I tried automatically expanding globs, but that
-          # in conjunction with * means things get expanded twice, resulting
-          # in a lot of duplicates.
+          # battlefield. I tried automatically expanding FileObject globs, but
+          # that in conjunction with * means things get expanded twice,
+          # resulting in a lot of duplicates.
           #
           # Maybe an answer is to get rid of * and only do automatic expansion
           # for executables.

lib/chitin/commands/runnable.rb

     def raw_run
       run
     end
+
+    def secure_run
+      verify_permissions
+      run
+    end
+
+    def secure_raw_run
+      verify_permissions
+      raw_run
+    end
   end
 end
 

lib/chitin/session.rb

         res = [res] unless Array === res
   
         res.each do |res|
-          res[:run]
+          res[:secure_run]
           res[:wait] unless res[:bg]
         end
   
       else # else it's a standard ruby type (or a pipe returning as such)
   
         if Pipe === res || StringMethod === res
-          val = res[:raw_run]
+          val = res[:secure_raw_run]
         else
           val = res
         end
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.