picky 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/picky/cli.rb +1 -1
- data/lib/picky/query/token.rb +3 -1
- data/spec/lib/cli_spec.rb +1 -1
- data/spec/lib/query/token_spec.rb +14 -0
- metadata +4 -14
data/lib/picky/cli.rb
CHANGED
@@ -90,7 +90,7 @@ module Picky
|
|
90
90
|
# Maps commands to the other gem's command.
|
91
91
|
#
|
92
92
|
@@mapping = {
|
93
|
-
:generate => [Generate, :'
|
93
|
+
:generate => [Generate, :'{sinatra_client,unicorn_server,empty_unicorn_server}', :'app_directory_name'],
|
94
94
|
:help => [Help],
|
95
95
|
:stats => [Statistics, :'logfile (e.g. log/search.log)', 'port (default: 4567)'],
|
96
96
|
:live => [Live, 'host:port/path (default: localhost:8080/admin)', 'port (default: 4568)']
|
data/lib/picky/query/token.rb
CHANGED
@@ -129,8 +129,10 @@ module Query
|
|
129
129
|
end
|
130
130
|
# Sets and returns the next similar word.
|
131
131
|
#
|
132
|
+
# Note: Also overrides the original.
|
133
|
+
#
|
132
134
|
def next_similar bundle
|
133
|
-
@text = (similarity(bundle).shift || return) if similar?
|
135
|
+
@text = @original = (similarity(bundle).shift || return) if similar?
|
134
136
|
end
|
135
137
|
# Lazy similar reader.
|
136
138
|
#
|
data/spec/lib/cli_spec.rb
CHANGED
@@ -19,7 +19,7 @@ describe Picky::CLI do
|
|
19
19
|
@cli.executor_class_for.should == [Picky::CLI::Help]
|
20
20
|
end
|
21
21
|
it 'returns Generator for generate' do
|
22
|
-
@cli.executor_class_for(:generate).should == [Picky::CLI::Generate, :
|
22
|
+
@cli.executor_class_for(:generate).should == [Picky::CLI::Generate, :'{sinatra_client,unicorn_server,empty_unicorn_server}', :"app_directory_name"]
|
23
23
|
end
|
24
24
|
it 'returns Help for help' do
|
25
25
|
@cli.executor_class_for(:help).should == [Picky::CLI::Help]
|
@@ -31,6 +31,20 @@ describe Query::Token do
|
|
31
31
|
before(:each) do
|
32
32
|
@bundle = stub :bundle
|
33
33
|
end
|
34
|
+
describe 'original' do
|
35
|
+
context 'with stub' do
|
36
|
+
before(:each) do
|
37
|
+
@bundle.stub! :similar => [:array, :of, :similar]
|
38
|
+
|
39
|
+
@token = Query::Token.processed 'similar~'
|
40
|
+
end
|
41
|
+
it 'should have a certain original text' do
|
42
|
+
@token.next_similar @bundle
|
43
|
+
|
44
|
+
@token.original.should == :array
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
34
48
|
context 'similar' do
|
35
49
|
context 'with stub' do
|
36
50
|
before(:each) do
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 1
|
7
|
-
- 3
|
8
|
-
- 2
|
9
|
-
version: 1.3.2
|
4
|
+
prerelease:
|
5
|
+
version: 1.3.3
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Florian Hanke
|
@@ -14,7 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
13
|
+
date: 2011-02-12 00:00:00 +01:00
|
18
14
|
default_executable: picky
|
19
15
|
dependencies:
|
20
16
|
- !ruby/object:Gem::Dependency
|
@@ -25,8 +21,6 @@ dependencies:
|
|
25
21
|
requirements:
|
26
22
|
- - ">="
|
27
23
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 0
|
30
24
|
version: "0"
|
31
25
|
type: :development
|
32
26
|
version_requirements: *id001
|
@@ -241,21 +235,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
241
235
|
requirements:
|
242
236
|
- - ">="
|
243
237
|
- !ruby/object:Gem::Version
|
244
|
-
segments:
|
245
|
-
- 0
|
246
238
|
version: "0"
|
247
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
248
240
|
none: false
|
249
241
|
requirements:
|
250
242
|
- - ">="
|
251
243
|
- !ruby/object:Gem::Version
|
252
|
-
segments:
|
253
|
-
- 0
|
254
244
|
version: "0"
|
255
245
|
requirements: []
|
256
246
|
|
257
247
|
rubyforge_project: http://rubyforge.org/projects/picky
|
258
|
-
rubygems_version: 1.
|
248
|
+
rubygems_version: 1.5.0
|
259
249
|
signing_key:
|
260
250
|
specification_version: 3
|
261
251
|
summary: "Picky: Helps you find your data."
|