spinal_tap 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -25,7 +25,11 @@ Start spinal at the beginning of your long running process:
25
25
 
26
26
  By default it will listen for TCP connections on 127.0.0.1:9000.
27
27
  You can then telnet into your process and type 'help' to view the default list of commands.
28
- Spinal Tap uses threads to run in the background of your process.
28
+ Currently, 'eval' is the main command you will use.
29
+ For example, you can execute code such as 'eval 5 + 5' and it will return 10.
30
+ The command set is limited, but in the future I will make it easy to add your own commands.
31
+ For now you'll have to make your own helper class and execute them via 'eval'.
32
+ Spinal Tap uses threads to run in the background of your process, but aware that you have full access to your processes's memory via 'eval'.
29
33
 
30
34
  SpinalTap.start accepts the following options:
31
35
 
@@ -40,7 +44,7 @@ You can stop the spinal tap server at any time:
40
44
 
41
45
  With great power comes great responsibility.
42
46
  Currently no authentication exists so anyone who can connect to Spinal Tap has complete control over your process.
43
- This includes changing memory, reloading classes, killing the process, and pretty much any other nasty thing you can with Ruby's 'eval' method.
47
+ This includes changing memory, reloading classes, killing the process, and pretty much any other nasty thing you can do with Ruby's 'eval' method.
44
48
  Use at your own risk! You have been warned!
45
49
 
46
50
  # Contributing to Spinal Tap:
@@ -57,6 +57,8 @@ module SpinalTap
57
57
  if @buffer.length > 0 && @cursor_pos > 1
58
58
  @cursor_pos -= 1
59
59
  @buffer.slice!(@cursor_pos - 1)
60
+ else
61
+ bell
60
62
  end
61
63
 
62
64
  # Null Char.
@@ -72,20 +74,28 @@ module SpinalTap
72
74
  @history_pos -= 1
73
75
  @buffer = @history[@history_pos].to_s
74
76
  @cursor_pos = @buffer.length + 1
77
+ else
78
+ bell
75
79
  end
76
80
  when 66 # B Char - Down Arrow.
77
81
  if @history_pos < @history.length
78
82
  @history_pos += 1
79
83
  @buffer = @history[@history_pos].to_s
80
84
  @cursor_pos = @buffer.length + 1
85
+ else
86
+ bell
81
87
  end
82
88
  when 67 # C Char - Right Arrow.
83
- if @cursor_pos < @buffer.length
89
+ if @cursor_pos < @buffer.length + 1
84
90
  @cursor_pos += 1
91
+ else
92
+ bell
85
93
  end
86
94
  when 68 # D Char - Left Arrow.
87
- if @cursor_pos > 0
95
+ if @cursor_pos > 0 + 1
88
96
  @cursor_pos -= 1
97
+ else
98
+ bell
89
99
  end
90
100
  end
91
101
  end
@@ -118,6 +128,10 @@ module SpinalTap
118
128
  end
119
129
  end
120
130
 
131
+ def bell
132
+ write([7].pack('C'))
133
+ end
134
+
121
135
  def redraw_cmd_line
122
136
  write("\e[2K\r>\e[s #{@buffer}\e[u\e[#{@cursor_pos}C")
123
137
  end
@@ -1,3 +1,3 @@
1
1
  module SpinalTap
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spinal_tap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  segments:
142
142
  - 0
143
- hash: 1112740283553525583
143
+ hash: -1111823406379054715
144
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  none: false
146
146
  requirements:
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  segments:
151
151
  - 0
152
- hash: 1112740283553525583
152
+ hash: -1111823406379054715
153
153
  requirements: []
154
154
  rubyforge_project:
155
155
  rubygems_version: 1.8.23