chitin 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/sample.txt ADDED
@@ -0,0 +1,187 @@
1
+ Script started on Sat Nov 3 15:03:39 2012
2
+ [ari: ~/src/chitin] bin/chitin
3
+ ari: ~/src/chitin (... # hey kids, let's talk about chitin
4
+ ari: ~/src/chitin (... # chitin is a shell
5
+ ari: ~/src/chitin (... # chitin is also ruby
6
+ ari: ~/src/chitin (... # everything you type in chitin is pure ruby
7
+ ari: ~/src/chitin (... 1 + 4
8
+ => 5
9
+ ari: ~/src/chitin (... # that said, this is a shell
10
+ ari: ~/src/chitin (... ls
11
+ FEATURES NOTES README TODO bin chitinrc lib sample.txt typescript
12
+ ari: ~/src/chitin (... # and it can do some fancy footwork, too
13
+ ari: ~/src/chitin (... strange = ls -:al
14
+ total 224
15
+ drwxr-xr-x 12 ari staff 408 Nov 3 15:03 .
16
+ drwxr-xr-x 66 ari staff 2244 Oct 31 15:36 ..
17
+ drwxr-xr-x 13 ari staff 442 Nov 3 14:54 .hg
18
+ -rw-r--r-- 1 ari staff 91 Jul 15 2011 FEATURES
19
+ -rw-r--r-- 1 ari staff 789 Sep 2 2011 NOTES
20
+ -rw-r--r-- 1 ari staff 5349 Jun 24 2011 README
21
+ -rw-r--r-- 1 ari staff 913 Oct 20 17:05 TODO
22
+ drwxr-xr-x 3 ari staff 102 Oct 22 17:31 bin
23
+ -rw-r--r-- 1 ari staff 1784 Feb 21 2012 chitinrc
24
+ drwxr-xr-x 4 ari staff 136 Oct 17 11:17 lib
25
+ -rw-r--r-- 1 ari staff 5767 Nov 3 14:54 sample.txt
26
+ -rw-r--r-- 1 ari staff 77935 Nov 3 15:05 typescript
27
+ ari: ~/src/chitin (... strange
28
+ total 224
29
+ drwxr-xr-x 12 ari staff 408 Nov 3 15:03 .
30
+ drwxr-xr-x 66 ari staff 2244 Oct 31 15:36 ..
31
+ drwxr-xr-x 13 ari staff 442 Nov 3 14:54 .hg
32
+ -rw-r--r-- 1 ari staff 91 Jul 15 2011 FEATURES
33
+ -rw-r--r-- 1 ari staff 789 Sep 2 2011 NOTES
34
+ -rw-r--r-- 1 ari staff 5349 Jun 24 2011 README
35
+ -rw-r--r-- 1 ari staff 913 Oct 20 17:05 TODO
36
+ drwxr-xr-x 3 ari staff 102 Oct 22 17:31 bin
37
+ -rw-r--r-- 1 ari staff 1784 Feb 21 2012 chitinrc
38
+ drwxr-xr-x 4 ari staff 136 Oct 17 11:17 lib
39
+ -rw-r--r-- 1 ari staff 5767 Nov 3 14:54 sample.txt
40
+ -rw-r--r-- 1 ari staff 77935 Nov 3 15:05 typescript
41
+ ari: ~/src/chitin (... # let's get funky now
42
+ ari: ~/src/chitin (... hg.stat
43
+ M lib/chitin/commands/builtins.rb
44
+ M lib/chitin/sandbox.rb
45
+ M lib/chitin/session.rb
46
+ ? typescript
47
+ ari: ~/src/chitin (... # that's the equivalent to "hg stat"
48
+ ari: ~/src/chitin (... # to supply arguments, -m becomes :m
49
+ ari: ~/src/chitin (... # because single-character symbols get a single "-" prepended
50
+ ari: ~/src/chitin (... # we can even use hash notation to make the meaning clearer!
51
+ ari: ~/src/chitin (... # esimerkki:
52
+ ari: ~/src/chitin (... hg.commit "lib/chitin :m => 'fixed the processing of comments'
53
+ ari: ~/src/chitin (... hg.commit "lib/chitin/commands/ :m => 'fixed the processing of comments'
54
+ ari: ~/src/chitin (... hg.commit "lib/chitin/commands/ :m => 'fixed the processing of comments'
55
+ ari: ~/src/chitin (... hg.commit "lib/chitin/sandbox.rb", "lib/chitin :m => 'fixed the processing of comments'
56
+ ari: ~/src/chitin (... hg.commit "lib/chitin/sandbox.rb", "lib/chitin/session.rb", :m => 'fixed the processing of comments'
57
+ ari: ~/src/chitin (... # we even used tab completion!
58
+ ari: ~/src/chitin (... hg.stat
59
+ M lib/chitin/commands/builtins.rb
60
+ ? typescript
61
+ ari: ~/src/chitin (... hg.commit :m => 'added shortcut for globbing all files in a directory
62
+ ari: ~/src/chitin (... # BOOM chitin automagically completes dangling quotes
63
+ ari: ~/src/chitin (... # single quotes get replaced by double quotes during tab completion. they otherwise are the same
64
+ ari: ~/src/chitin (... hg.outgoing
65
+ comparing with https://seydar:***@bitbucket.org/seydar/chitin
66
+ searching for changes
67
+ changeset: 95:ca86ab0ce282
68
+ user: seydar
69
+ date: Sat Nov 03 15:08:25 2012 -0400
70
+ summary: fixed the processing of comments
71
+
72
+ changeset: 96:02f78443e821
73
+ tag: tip
74
+ user: seydar
75
+ date: Sat Nov 03 15:08:51 2012 -0400
76
+ summary: added shortcut for globbing all files in a directory
77
+
78
+ ari: ~/src/chitin (... hg.push
79
+ pushing to https://seydar:***@bitbucket.org/seydar/chitin
80
+ searching for changes
81
+ remote: adding changesets
82
+ remote: adding manifests
83
+ remote: adding file changes
84
+ remote: added 2 changesets with 3 changes to 3 files
85
+ remote: bb/acl: seydar is allowed. accepted payload.
86
+ ari: ~/src/chitin (... cat "/Users/ari/.chitin
87
+ ari: ~/src/chitin (... cat "/Users/ari/.chitinrc"
88
+ include Math
89
+
90
+ module Aliases
91
+ def src; cd "#{ENV['HOME']}/src"; end
92
+ def school; cd "/Users/ari/School/Fall '12/"; end
93
+ def idea; vim '/Users/ari/src/IDEAS'; end
94
+ def ideas; less '/Users/ari/src/IDEAS'; end
95
+ def fixit; vim '/Users/ari/.chitinrc'; end
96
+ def ouvrez(*args)
97
+ Executable.new '/usr/bin/open', *args
98
+ end
99
+ end
100
+ include Aliases
101
+
102
+ module Shells
103
+ def wilma; ssh 'arizzle@wilma.eecs.umich.edu'; end
104
+ def caen; ssh 'arizzle@login.engin.umich.edu'; end
105
+ end
106
+ include Shells
107
+
108
+ def normal_prompt
109
+ "#{ENV['USER'].cyan}: #{short_pwd.yellow} (... "
110
+ end
111
+
112
+ def prompt
113
+ normal_prompt
114
+ end
115
+
116
+ def relax
117
+ def prompt
118
+ normal_prompt
119
+ end
120
+ end
121
+
122
+ def focus(string)
123
+ @todo = string
124
+ def prompt
125
+ @todo = @todo.to_s
126
+ "[ #{@todo.red} #{'-' * (STDIN.winsize[1].to_i - 4 - @todo.red.size)}]\n" +
127
+ "[ #{short_pwd.light_cyan} ] "
128
+ end
129
+ end
130
+
131
+ pre_process do |val|
132
+ val = val.strip == '.' ? 'exit' : val
133
+ val = val.strip == '..' ? 'cd ".."' : val
134
+ end
135
+
136
+ ari: ~/src/chitin (... # I've got a shortcut there that allows me to do this:
137
+ ari: ~/src/chitin (... ..
138
+ => "/Users/ari/src"
139
+ ari: ~/src (... # whoops i just printed a big directory... probs gonna cut that out of the final edit of this
140
+ ari: ~/src (... cd
141
+ => "/Users/ari"
142
+ ari: ~ (... cd "/tmp/
143
+ => "/private/tmp"
144
+ ari: /private/tmp (... ['hello', 'waddap', 'test'].each {|f| touch f }
145
+ => ["hello", "waddap", "test"]
146
+ ari: /private/tmp (... ll
147
+ total 0
148
+ -rw-r--r--@ 1 ari wheel 0B Oct 31 16:48 geplugin_introspect_install_mutex
149
+ srwxr-xr-x 1 ari wheel 0B Oct 26 18:10 ics1355
150
+ srwxr-xr-x 1 ari wheel 0B Oct 26 09:05 icssuis501
151
+ drwx------ 3 ari wheel 102B Oct 26 09:04 launch-dtJObz
152
+ drwx------ 3 ari wheel 102B Oct 26 09:04 launch-fpTAKt
153
+ drwx------ 3 ari wheel 102B Oct 26 09:04 launch-omlDku
154
+ drwx------ 3 ari wheel 102B Oct 26 09:04 launchd-100.Rcleky
155
+ drwx------ 3 ari wheel 102B Nov 3 11:51 tmux-501
156
+ ari: /private/tmp (... # oh no! no files! that's because a command is an executable that is only run if it is returned from the prompt.
157
+ ari: /private/tmp (... touch.inspect
158
+ => "#<Executable:0x000001008a5f60 @path="/usr/bin/touch", @args=[]>"
159
+ ari: /private/tmp (... # luckily, arrays of executables are also run. SOOOOOOOOOOOOO
160
+ ari: /private/tmp (... ['hello', 'waddap', 'test'].map {|f| touch f }
161
+ ari: /private/tmp (... ll
162
+ total 0
163
+ -rw-r--r--@ 1 ari wheel 0B Oct 31 16:48 geplugin_introspect_install_mutex
164
+ -rw-r--r-- 1 ari wheel 0B Nov 3 15:14 hello
165
+ srwxr-xr-x 1 ari wheel 0B Oct 26 18:10 ics1355
166
+ srwxr-xr-x 1 ari wheel 0B Oct 26 09:05 icssuis501
167
+ drwx------ 3 ari wheel 102B Oct 26 09:04 launch-dtJObz
168
+ drwx------ 3 ari wheel 102B Oct 26 09:04 launch-fpTAKt
169
+ drwx------ 3 ari wheel 102B Oct 26 09:04 launch-omlDku
170
+ drwx------ 3 ari wheel 102B Oct 26 09:04 launchd-100.Rcleky
171
+ -rw-r--r-- 1 ari wheel 0B Nov 3 15:14 test
172
+ drwx------ 3 ari wheel 102B Nov 3 11:51 tmux-501
173
+ -rw-r--r-- 1 ari wheel 0B Nov 3 15:14 waddap
174
+ ari: /private/tmp (... # and boom goes the dynamite
175
+ ari: /private/tmp (... hg.inspect
176
+ => "#<Executable:0x00000100a65328 @path="/usr/local/bin/hg", @args=[]>"
177
+ ari: /private/tmp (... hg.stat.inspect
178
+ => "#<Executable:0x00000100a49d58 @path="/usr/local/bin/hg", @args=["stat"]>"
179
+ ari: /private/tmp (... hg.commit(:m => 'my message').inspect
180
+ => "#<Executable:0x000001009e6e10 @path="/usr/local/bin/hg", @args=["commit", "-m", "my message"]>"
181
+ ari: ~/src/chitin (... f = open 'new_sample.txt.stripped', 'w'
182
+ => #<File:new_sample.txt.stripped>
183
+ ari: ~/src/chitin (... cat('new_sample.txt') | each_line {|line| f.puts line.rstrip }
184
+ ... <snipped> ...
185
+ ari: ~/src/chitin (... # and now let's turn up the heat to showcase chitin's power
186
+ ari: ~/src/chitin (... cat('sample.txt') | map_lines {|l| l.rstrip } > 'oot.txt'
187
+
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: chitin
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ari Brown
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-11-25 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: wirble
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: coolline
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: coderay
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: ! 'The point of Chitin is that you should be able to use Ruby in your
63
+ shell. Bash
64
+
65
+ is too old. Time for the new wave of shell environments.
66
+
67
+ '
68
+ email:
69
+ - ari@aribrown.com
70
+ executables:
71
+ - chitin
72
+ extensions: []
73
+ extra_rdoc_files: []
74
+ files:
75
+ - ANNOUNCEMENT
76
+ - README
77
+ - TODO
78
+ - bin/chitin
79
+ - chitin.gemspec
80
+ - chitinrc
81
+ - lib/chitin.rb
82
+ - lib/chitin/commands/builtins.rb
83
+ - lib/chitin/commands/executable.rb
84
+ - lib/chitin/commands/pipe.rb
85
+ - lib/chitin/commands/ruby.rb
86
+ - lib/chitin/commands/runnable.rb
87
+ - lib/chitin/core_ext/coolline.rb
88
+ - lib/chitin/core_ext/io.rb
89
+ - lib/chitin/core_ext/object.rb
90
+ - lib/chitin/core_ext/string.rb
91
+ - lib/chitin/core_ext/symbol.rb
92
+ - lib/chitin/file.rb
93
+ - lib/chitin/sandbox.rb
94
+ - lib/chitin/session.rb
95
+ - lib/chitin/support.rb
96
+ - lib/chitin/tools/csv.rb
97
+ - lib/chitin/tools/replay.rb
98
+ - lib/chitin/tools/string_methods.rb
99
+ - lib/chitin/version.rb
100
+ - sample.txt
101
+ homepage: http://bitbucket.org/seydar/chitin
102
+ licenses: []
103
+ post_install_message:
104
+ rdoc_options: []
105
+ require_paths:
106
+ - lib
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ! '>='
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ required_rubygems_version: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ requirements: []
120
+ rubyforge_project: chitin
121
+ rubygems_version: 1.8.24
122
+ signing_key:
123
+ specification_version: 3
124
+ summary: A shell! In Ruby!
125
+ test_files: []
126
+ has_rdoc: