picky-client 4.20.2 → 4.21.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2057c881f60aa7725bf5f3ec38cff2ec2e8fcc67
|
4
|
+
data.tar.gz: 285b4ff712cc628558f7598998f0b2a82ea5de14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9f744c5d209f661d7a6131dd6ad6bd5f638352ff262e99189e4f42a5f069aa343b832a16fe3b738e36152e6d04a3461f50f79318ea533dae20160f3188df803
|
7
|
+
data.tar.gz: a4b7e5393a9df7da258c66898ad12ddeb49ffda9cf1a708c4382440e0a3b624df4f3854a1f72e3fd06e986b11198ae8b0afb3a0c49442983ea19769f19660b94
|
File without changes
|
File without changes
|
@@ -5,146 +5,146 @@ require 'spec_helper'
|
|
5
5
|
# We need to load the Statistics file explicitly as the Statistics
|
6
6
|
# are not loaded with the Loader (not needed in the server, only for script runs).
|
7
7
|
#
|
8
|
-
require File.expand_path '../../../../lib/picky-client/
|
8
|
+
require File.expand_path '../../../../lib/picky-client/tools/terminal', __FILE__
|
9
9
|
|
10
10
|
describe Picky::Terminal do
|
11
|
-
|
11
|
+
|
12
12
|
let(:terminal) { described_class.new('/some/url') }
|
13
|
-
|
13
|
+
|
14
14
|
describe 'backspace' do
|
15
15
|
it 'works correctly' do
|
16
16
|
terminal.should_receive(:chop_text).once.ordered.with()
|
17
17
|
terminal.should_receive(:print).once.ordered.with "\e[1D \e[1D"
|
18
18
|
terminal.should_receive(:flush).once.ordered.with()
|
19
|
-
|
19
|
+
|
20
20
|
terminal.backspace
|
21
21
|
end
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
describe 'write_results' do
|
25
25
|
it 'works correctly' do
|
26
26
|
terminal.should_receive(:move_to).once.ordered.with 0
|
27
27
|
terminal.should_receive(:write).once.ordered.with " 0"
|
28
28
|
terminal.should_receive(:move_to).once.ordered.with 10
|
29
|
-
|
29
|
+
|
30
30
|
terminal.write_results nil
|
31
31
|
end
|
32
32
|
it 'works correctly' do
|
33
33
|
terminal.should_receive(:move_to).once.ordered.with 0
|
34
34
|
terminal.should_receive(:write).once.ordered.with "123456789"
|
35
35
|
terminal.should_receive(:move_to).once.ordered.with 10
|
36
|
-
|
36
|
+
|
37
37
|
terminal.write_results stub(:results, :total => 123456789)
|
38
38
|
end
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
describe 'search' do
|
42
42
|
before(:each) do
|
43
43
|
@client = stub :client
|
44
44
|
terminal.stub! :client => @client
|
45
|
-
|
45
|
+
|
46
46
|
terminal.add_text 'hello'
|
47
47
|
end
|
48
48
|
it 'searches full correctly' do
|
49
49
|
@client.should_receive(:search).once.with 'hello', :ids => 20
|
50
|
-
|
50
|
+
|
51
51
|
terminal.search true
|
52
52
|
end
|
53
53
|
it 'searches full correctly' do
|
54
54
|
terminal = described_class.new('/some/url', 33)
|
55
55
|
terminal.stub! :client => @client
|
56
|
-
|
56
|
+
|
57
57
|
@client.should_receive(:search).once.with '', :ids => 33
|
58
|
-
|
58
|
+
|
59
59
|
terminal.search true
|
60
60
|
end
|
61
61
|
it 'searches live correctly' do
|
62
62
|
@client.should_receive(:search).once.with 'hello', :ids => 0
|
63
|
-
|
63
|
+
|
64
64
|
terminal.search
|
65
65
|
end
|
66
66
|
it 'searches live correctly' do
|
67
67
|
@client.should_receive(:search).once.with 'hello', :ids => 0
|
68
|
-
|
68
|
+
|
69
69
|
terminal.search false
|
70
70
|
end
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
describe 'clear_ids' do
|
74
74
|
it 'moves to the ids, then clears all' do
|
75
75
|
terminal.should_receive(:move_to_ids).once.with()
|
76
76
|
terminal.should_receive(:write).once.with " "*200
|
77
|
-
|
77
|
+
|
78
78
|
terminal.clear_ids
|
79
79
|
end
|
80
80
|
end
|
81
|
-
|
81
|
+
|
82
82
|
describe 'write_ids' do
|
83
83
|
it 'writes the result\'s ids' do
|
84
84
|
terminal.should_receive(:move_to_ids).once.with()
|
85
85
|
terminal.should_receive(:write).once.with "=> []"
|
86
|
-
|
86
|
+
|
87
87
|
terminal.write_ids stub(:results, :total => nil)
|
88
88
|
end
|
89
89
|
it 'writes the result\'s ids' do
|
90
90
|
terminal.should_receive(:move_to_ids).once.with()
|
91
91
|
terminal.should_receive(:write).once.with "=> [1, 2, 3]"
|
92
|
-
|
92
|
+
|
93
93
|
terminal.write_ids stub(:results, :total => 3, :ids => [1, 2, 3])
|
94
94
|
end
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
describe 'move_to_ids' do
|
98
98
|
it 'moves to a specific place' do
|
99
99
|
terminal.should_receive(:move_to).once.with 12
|
100
|
-
|
100
|
+
|
101
101
|
terminal.move_to_ids
|
102
102
|
end
|
103
103
|
it 'moves to a specific place' do
|
104
104
|
terminal.add_text 'test'
|
105
|
-
|
105
|
+
|
106
106
|
terminal.should_receive(:move_to).once.with 16
|
107
|
-
|
107
|
+
|
108
108
|
terminal.move_to_ids
|
109
109
|
end
|
110
110
|
end
|
111
|
-
|
111
|
+
|
112
112
|
describe 'left' do
|
113
113
|
it 'moves by amount' do
|
114
114
|
terminal.should_receive(:print).once.ordered.with "\e[13D"
|
115
115
|
terminal.should_receive(:flush).once.ordered
|
116
|
-
|
116
|
+
|
117
117
|
terminal.left 13
|
118
118
|
end
|
119
119
|
it 'default is 1' do
|
120
120
|
terminal.should_receive(:print).once.ordered.with "\e[1D"
|
121
121
|
terminal.should_receive(:flush).once.ordered
|
122
|
-
|
122
|
+
|
123
123
|
terminal.left
|
124
124
|
end
|
125
125
|
end
|
126
|
-
|
126
|
+
|
127
127
|
describe 'right' do
|
128
128
|
it 'moves by amount' do
|
129
129
|
terminal.should_receive(:print).once.ordered.with "\e[13C"
|
130
130
|
terminal.should_receive(:flush).once.ordered
|
131
|
-
|
131
|
+
|
132
132
|
terminal.right 13
|
133
133
|
end
|
134
134
|
it 'default is 1' do
|
135
135
|
terminal.should_receive(:print).once.ordered.with "\e[1C"
|
136
136
|
terminal.should_receive(:flush).once.ordered
|
137
|
-
|
137
|
+
|
138
138
|
terminal.right
|
139
139
|
end
|
140
140
|
end
|
141
|
-
|
141
|
+
|
142
142
|
describe 'flush' do
|
143
143
|
it 'flushes STDOUT' do
|
144
144
|
STDOUT.should_receive(:flush).once.with()
|
145
|
-
|
145
|
+
|
146
146
|
terminal.flush
|
147
147
|
end
|
148
148
|
end
|
149
|
-
|
149
|
+
|
150
150
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picky-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Hanke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yajl-ruby
|
@@ -52,8 +52,6 @@ files:
|
|
52
52
|
- javascripts/picky.min.js
|
53
53
|
- javascripts/spec_helper.js
|
54
54
|
- lib/picky-client.rb
|
55
|
-
- lib/picky-client/aux/cursed.rb
|
56
|
-
- lib/picky-client/aux/terminal.rb
|
57
55
|
- lib/picky-client/client.rb
|
58
56
|
- lib/picky-client/client/active_record.rb
|
59
57
|
- lib/picky-client/client_index.rb
|
@@ -67,7 +65,9 @@ files:
|
|
67
65
|
- lib/picky-client/tasks.rb
|
68
66
|
- lib/picky-client/tasks/javascripts.rb
|
69
67
|
- lib/picky-client/tasks/update.rake
|
70
|
-
-
|
68
|
+
- lib/picky-client/tools/cursed.rb
|
69
|
+
- lib/picky-client/tools/terminal.rb
|
70
|
+
- spec/picky-client/auxiliary/terminal_spec.rb
|
71
71
|
- spec/picky-client/client/active_record_spec.rb
|
72
72
|
- spec/picky-client/client_index_spec.rb
|
73
73
|
- spec/picky-client/client_spec.rb
|
@@ -97,12 +97,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
99
|
rubyforge_project: http://rubyforge.org/projects/picky
|
100
|
-
rubygems_version: 2.2.
|
100
|
+
rubygems_version: 2.2.0
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: Picky Ruby Search Engine Client
|
104
104
|
test_files:
|
105
|
-
- spec/picky-client/
|
105
|
+
- spec/picky-client/auxiliary/terminal_spec.rb
|
106
106
|
- spec/picky-client/client/active_record_spec.rb
|
107
107
|
- spec/picky-client/client_index_spec.rb
|
108
108
|
- spec/picky-client/client_spec.rb
|
@@ -111,3 +111,4 @@ test_files:
|
|
111
111
|
- spec/picky-client/helper_spec.rb
|
112
112
|
- spec/picky-client/spec/test_client_integration_spec.rb
|
113
113
|
- spec/picky-client/spec/test_client_spec.rb
|
114
|
+
has_rdoc: false
|