Sergei Smagin
Sergei Smagin
see, sshfs is so simple and pretty, I think I'll use it. https://help.ubuntu.com/community/SSHFS
Is there a ruby way to do this? ``` λ → home.ls # this would return String λ → home.ls.split("\n").select { |x| x =~ /Do/ } ["Documents", "Downloads"] # this...
I think it's more suitable to lisp :) Plus it's more ugly than in bash. How pipes work in bash? There is stdout from one process that is adding to...
http://stackoverflow.com/a/9834134/1685746 ah, it pushes that data to stdin. Oookay, I'll think how to implement that in ruby. ``` # for example home.pipe :ls, %w(grep hello), :less # this maybe work...
Now I'm really thinking about how clojure deals with all that braces. They have threading macro that work like this: https://clojuredocs.org/clojure.core/-%3E What if we could do the same in ruby...
Hi, I'm back. FYI, ruby supports pipelines via Open3 lib: http://ruby-doc.org/stdlib-2.0.0/libdoc/open3/rdoc/Open3.html So one possible solution is just use Open3.pipeline, but it's not very convenient. Another way is build my own...
``` λ → Open3.capture2("grep 'opensource'", stdin_data: home.ls('-lah')) ["drwxr-xr-x 44 s s 4,0K окт. 16 18:20 opensource\n", #] ``` Example with Open3
So I'd monkeypatch String class method_missing method, but it causes errors (I've just tried). Maybe I should create my own class and wrap every command output? Or is there more...
@lostinblue Why not file.write 'string' ? https://github.com/s-mage/rush/wiki/Handbook%3A-File-Contents
On Sunday, November 08, 2015 05:31:56 PM electricface wrote: > /usr/local/share/gems/gems/rush2-0.8.0/lib/rush/string_ext.rb:1:in > `require_relative': cannot load such file -- > /usr/local/share/gems/gems/rush2-0.8.0/lib/rush/path (LoadError) from > /usr/local/share/gems/gems/rush2-0.8.0/lib/rush/string_ext.rb:1:in` (required)>' from /usr/local/share/gems/gems/rush2-0.8.0/lib/rush.rb:83:in > `require_relative' from...