ruco 0.2.18 → 0.2.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE.txt +20 -0
  3. data/bin/ruco +24 -30
  4. data/lib/ruco.rb +1 -3
  5. data/lib/ruco/command_bar.rb +1 -1
  6. data/lib/ruco/core_ext/range.rb +1 -1
  7. data/lib/ruco/core_ext/string.rb +2 -15
  8. data/lib/ruco/editor/colors.rb +2 -2
  9. data/lib/ruco/status_bar.rb +1 -1
  10. data/lib/ruco/syntax_parser.rb +1 -1
  11. data/lib/ruco/version.rb +1 -1
  12. data/lib/ruco/window.rb +1 -1
  13. metadata +34 -64
  14. data/.gitignore +0 -2
  15. data/.travis.yml +0 -7
  16. data/Gemfile +0 -8
  17. data/Gemfile.lock +0 -39
  18. data/Rakefile +0 -32
  19. data/Readme.md +0 -164
  20. data/lib/ruco/keyboard.rb +0 -206
  21. data/lib/ruco/screen.rb +0 -148
  22. data/lib/ruco/style_map.rb +0 -108
  23. data/playground/benchmark_syntax_parser.rb +0 -23
  24. data/ruco.gemspec +0 -22
  25. data/spec/fixtures/slow.js +0 -4
  26. data/spec/fixtures/test.tmTheme +0 -186
  27. data/spec/ruco/application_spec.rb +0 -433
  28. data/spec/ruco/array_processor_spec.rb +0 -46
  29. data/spec/ruco/command_bar_spec.rb +0 -127
  30. data/spec/ruco/core_ext/array_spec.rb +0 -31
  31. data/spec/ruco/core_ext/range_spec.rb +0 -37
  32. data/spec/ruco/core_ext/string_spec.rb +0 -36
  33. data/spec/ruco/editor_spec.rb +0 -1261
  34. data/spec/ruco/file_store_spec.rb +0 -102
  35. data/spec/ruco/form_spec.rb +0 -83
  36. data/spec/ruco/history_spec.rb +0 -143
  37. data/spec/ruco/keyboard_spec.rb +0 -136
  38. data/spec/ruco/option_accessor_spec.rb +0 -26
  39. data/spec/ruco/screen_spec.rb +0 -52
  40. data/spec/ruco/status_bar_spec.rb +0 -49
  41. data/spec/ruco/style_map_spec.rb +0 -124
  42. data/spec/ruco/syntax_parser_spec.rb +0 -78
  43. data/spec/ruco/text_area_spec.rb +0 -183
  44. data/spec/ruco/tm_theme_spec.rb +0 -14
  45. data/spec/ruco/window_spec.rb +0 -170
  46. data/spec/ruco_spec.rb +0 -7
  47. data/spec/spec_helper.rb +0 -36
@@ -1,14 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Ruco::TMTheme do
4
- let(:theme){ Ruco::TMTheme.new('spec/fixtures/test.tmTheme') }
5
-
6
- it "parses foreground/background" do
7
- theme.foreground.should == '#4D4D4C'
8
- theme.background.should == '#FFFFFF'
9
- end
10
-
11
- it "parses rules" do
12
- theme.styles["keyword.operator.class"].should == ['#666969', nil]
13
- end
14
- end
@@ -1,170 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Ruco::Window do
4
- let(:window){ Ruco::Window.new(10,10) }
5
-
6
- describe :crop do
7
- let(:window){
8
- Ruco::Window.new(2,4,
9
- :line_scroll_threshold => 0, :line_scroll_offset => 1,
10
- :column_scroll_threshold => 0, :column_scroll_offset => 1
11
- )
12
- }
13
-
14
- it "does not modify given lines" do
15
- original = ['1234','1234']
16
- window.crop(original)
17
- original.should == ['1234','1234']
18
- end
19
-
20
- it "removes un-displayable chars" do
21
- result = window.crop(['12345','12345','12345'])
22
- result.should == ['1234','1234']
23
- end
24
-
25
- it "does not add whitespace" do
26
- result = window.crop(['1','',''])
27
- result.should == ['1','']
28
- end
29
-
30
- it "creates lines if necessary" do
31
- result = window.crop(['1234'])
32
- result.should == ['1234','']
33
- end
34
-
35
- it "stays inside frame as long as position is in frame" do
36
- window.position = Ruco::Position.new(1,3)
37
- result = window.crop(['12345678','12345678'])
38
- result.should == ['1234','1234']
39
- end
40
-
41
- it "can display empty lines" do
42
- window.crop([]).should == ['','']
43
- end
44
-
45
- describe 'scrolled' do
46
- it "goes out of frame if line is out of frame" do
47
- window = Ruco::Window.new(6,1, :line_scroll_offset => 0, :line_scroll_threshold => 0)
48
- window.position = Ruco::Position.new(6,0)
49
- result = window.crop(['1','2','3','4','5','6','7','8','9'])
50
- result.should == ['2','3','4','5','6','7']
51
- end
52
-
53
- it "goes out of frame if column is out of frame" do
54
- window = Ruco::Window.new(1,6, :column_scroll_offset => 0, :column_scroll_threshold => 0)
55
- window.position = Ruco::Position.new(0,6)
56
- result = window.crop(['1234567890'])
57
- result.should == ['234567']
58
- end
59
- end
60
- end
61
-
62
- describe :top do
63
- let(:window){ Ruco::Window.new(10,10, :line_scroll_threshold => 1, :line_scroll_offset => 3) }
64
-
65
- it "does not change when staying in frame" do
66
- window.top.should == 0
67
- window.position = Ruco::Position.new(8,0)
68
- window.top.should == 0
69
- end
70
-
71
- it "changes by offset when going down out of frame" do
72
- window.position = Ruco::Position.new(9,0)
73
- window.top.should == 3
74
- end
75
-
76
- it "stays at bottom when going down out of frame" do
77
- window.position = Ruco::Position.new(20,0)
78
- window.top.should == 20 - 10 + 3 + 1
79
- end
80
-
81
- it "stays at top when going up out of frame" do
82
- window.position = Ruco::Position.new(20,0)
83
- window.position = Ruco::Position.new(7,0)
84
- window.top.should == 7 - 3
85
- end
86
-
87
- it "changes to 0 when going up to 1" do
88
- window.position = Ruco::Position.new(20,0)
89
- window.position = Ruco::Position.new(1,0)
90
- window.top.should == 0
91
- end
92
-
93
- it "does not change when staying in changed frame" do
94
- window.position = Ruco::Position.new(9,0)
95
- window.top.should == 3
96
- window.position = Ruco::Position.new(11,0)
97
- window.top.should == 3
98
- end
99
- end
100
-
101
- describe :left do
102
- let(:window){ Ruco::Window.new(10,10, :column_scroll_threshold => 1, :column_scroll_offset => 3) }
103
-
104
- it "does not change when staying in frame" do
105
- window.left.should == 0
106
- window.position = Ruco::Position.new(0,8)
107
- window.left.should == 0
108
- end
109
-
110
- it "changes by offset when going vertically out of frame" do
111
- window.position = Ruco::Position.new(0,8)
112
- window.position = Ruco::Position.new(0,9)
113
- window.left.should == 3
114
- end
115
-
116
- it "stays right when going right out of frame" do
117
- window.position = Ruco::Position.new(0,20)
118
- window.left.should == 20 - 10 + 3 + 1
119
- end
120
-
121
- it "stays left when going left out of frame" do
122
- window.position = Ruco::Position.new(0,20)
123
- window.position = Ruco::Position.new(0,7)
124
- window.left.should == 7 - 3
125
- end
126
-
127
- it "changes to 0 when going left out of frame to 1" do
128
- window.position = Ruco::Position.new(0,20)
129
- window.position = Ruco::Position.new(0,1)
130
- window.left.should == 0
131
- end
132
-
133
- it "does not change when staying in changed frame" do
134
- window.position = Ruco::Position.new(0,8)
135
- window.position = Ruco::Position.new(0,9)
136
- window.left.should == 3
137
- window.position = Ruco::Position.new(0,11)
138
- window.left.should == 3
139
- end
140
- end
141
-
142
- describe :set_top do
143
- it "sets" do
144
- window.set_top 1, 20
145
- window.top.should == 1
146
- end
147
-
148
- it "does not allow negative" do
149
- window.set_top -1, 20
150
- window.top.should == 0
151
- end
152
-
153
- it "does not go above maximum top" do
154
- window.set_top 20, 20
155
- window.top.should == 20 - 10 + 3 - 1
156
- end
157
- end
158
-
159
- describe :left= do
160
- it "sets" do
161
- window.left = 1
162
- window.left.should == 1
163
- end
164
-
165
- it "does not allow negative" do
166
- window.left = -1
167
- window.left.should == 0
168
- end
169
- end
170
- end
@@ -1,7 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Ruco do
4
- it "has a VERSION" do
5
- Ruco::OLD_VERSION.should =~ /^\d+\.\d+\.\d+(\.[a-z\d]+)?$/
6
- end
7
- end
@@ -1,36 +0,0 @@
1
- $LOAD_PATH.unshift 'lib'
2
- $ruco_colors = true
3
-
4
- require 'ruco'
5
- require 'timeout'
6
- require 'tempfile'
7
-
8
- silence_warnings do
9
- Ruco::Editor::Colors::DEFAULT_THEME = 'spec/fixtures/test.tmTheme'
10
- Ruco::OLD_VERSION = Ruco::VERSION
11
- Ruco::VERSION = '0.0.0' # so tests dont fail if version gets longer
12
- end
13
-
14
- class Tempfile
15
- def self.string_as_file(data)
16
- result = nil
17
- Tempfile.open('foo') do |f|
18
- f.print data
19
- f.close
20
- result = yield(f.path)
21
- end
22
- result
23
- end
24
- end
25
-
26
- class Time
27
- def self.benchmark
28
- t = Time.now.to_f
29
- yield
30
- Time.now.to_f - t
31
- end
32
- end
33
-
34
- def log(text)
35
- puts "LOG: #{text}"
36
- end