gem-search 0.1.7 → 0.1.8
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -11
- data/README.md +7 -2
- data/lib/gem_search/commands/run.rb +3 -2
- data/lib/gem_search/version.rb +1 -1
- data/spec/commands/run_spec.rb +49 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 348c9b20914b9409de3a3fcf3284b1a6f08f9706
|
4
|
+
data.tar.gz: 65ff9dcbc7257820546d7062d8f8c04b70213e7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96dc3947fde43de747ecdd8d0cbb8105cc13b6878a472c0d287d4b72880f2f675d2d3df5bdedb95546d28ffe0a3bbe3f6652ca5fc0d14858cb2f62e1e0658f38
|
7
|
+
data.tar.gz: 9507652f04758b46fea9f6d90760d4b7cb93db5b7ba3d9ad1c6b33b7e2ce1f2b13205c287010042433894cfe676e49097705df603ed0da05f0c1785ac2151e5e
|
data/CHANGELOG.md
CHANGED
@@ -1,33 +1,39 @@
|
|
1
|
+
## v0.1.8
|
2
|
+
|
3
|
+
- Add variations of sort [9aed9e4]
|
4
|
+
variations: a/all/, n/name, v/ver/version
|
5
|
+
(not case-sensitive)
|
6
|
+
|
1
7
|
## v0.1.7
|
2
8
|
|
3
|
-
|
9
|
+
- Remove reduncancy dots [17ae8cd]
|
4
10
|
The request was one extra.
|
5
11
|
|
6
12
|
## v0.1.6
|
7
13
|
|
8
|
-
|
9
|
-
|
14
|
+
- Update gems [17ae8cd]
|
15
|
+
- Refactor tests
|
10
16
|
|
11
17
|
## v0.1.5
|
12
18
|
|
13
|
-
|
19
|
+
- Update slop for v4.0.0 and refactor. [94db668]
|
14
20
|
unsupported Ruby 1.9.0
|
15
21
|
|
16
22
|
## v0.1.4
|
17
23
|
|
18
|
-
|
24
|
+
- Fix cannot open gem url when gem has no homepage url. [b476b28]
|
19
25
|
|
20
26
|
## v0.1.3
|
21
27
|
|
22
|
-
|
28
|
+
- Implement a feature that is shown a homepage url when detail ooption is selected [f89d9c2]
|
23
29
|
|
24
30
|
## v0.1.2
|
25
31
|
|
26
|
-
|
27
|
-
|
32
|
+
- Correspond to linux with browse option [80bb881]
|
33
|
+
- Implement a feature that is to open homepage url by a default browser. [49d2924]
|
28
34
|
|
29
35
|
## v0.1.1
|
30
36
|
|
31
|
-
|
32
|
-
|
33
|
-
|
37
|
+
- Change default sort option from n[ame] to do a[ll] (download) [7041464]
|
38
|
+
- Fix default sort option doesn't work. [e404c6e]
|
39
|
+
- Fix proxy doesn't work by not using authentication [210ea37]
|
data/README.md
CHANGED
@@ -27,8 +27,8 @@ Use the gem-search as follows:
|
|
27
27
|
### Sorted by DL(all)
|
28
28
|
|
29
29
|
gem-search `keyword'
|
30
|
-
or
|
31
30
|
gem-search `keyword' -s a
|
31
|
+
gem-search `keyword' -s all
|
32
32
|
|
33
33
|
e.g.:
|
34
34
|
|
@@ -48,12 +48,14 @@ gtk-webkit-ruby (0.0.3) 289 289
|
|
48
48
|
```
|
49
49
|
|
50
50
|
### Sorted by gem name
|
51
|
+
|
51
52
|
gem-search `keyword' -s n
|
53
|
+
gem-search `keyword' -s name
|
52
54
|
|
53
55
|
e.g.:
|
54
56
|
|
55
57
|
```
|
56
|
-
$ gem-search webkit
|
58
|
+
$ gem-search webkit -s n
|
57
59
|
NAME DL(ver) DL(all)
|
58
60
|
-------------------------------------------------- -------- ---------
|
59
61
|
capybara-webkit (0.12.1) 24863 185214
|
@@ -68,7 +70,10 @@ webkit-rspec-formatter (2.0.2) 613 1573
|
|
68
70
|
```
|
69
71
|
|
70
72
|
### Sorted by DL(ver)
|
73
|
+
|
71
74
|
gem-search `keyword' -s v
|
75
|
+
gem-search `keyword' -s ver
|
76
|
+
gem-search `keyword' -s version
|
72
77
|
|
73
78
|
e.g.:
|
74
79
|
|
@@ -2,9 +2,9 @@ module GemSearch
|
|
2
2
|
module Commands
|
3
3
|
class Run < Base
|
4
4
|
ENABLE_SORT_OPTS = {
|
5
|
-
'v' => 'version_downloads',
|
6
5
|
'a' => 'downloads',
|
7
6
|
'n' => 'name',
|
7
|
+
'v' => 'version_downloads',
|
8
8
|
}
|
9
9
|
|
10
10
|
def call
|
@@ -28,8 +28,9 @@ module GemSearch
|
|
28
28
|
private
|
29
29
|
|
30
30
|
def setup_opts
|
31
|
+
sort = options['sort'] ? ENABLE_SORT_OPTS[options['sort'][0].downcase] : nil
|
31
32
|
{
|
32
|
-
sort:
|
33
|
+
sort: sort || 'downloads',
|
33
34
|
detail: options.detail?
|
34
35
|
}
|
35
36
|
end
|
data/lib/gem_search/version.rb
CHANGED
data/spec/commands/run_spec.rb
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
include GemSearch
|
2
2
|
|
3
3
|
RSpec.describe Commands::Run do
|
4
|
+
shared_examples 'sort example' do |expected_option, actual_option|
|
5
|
+
before { allow(options).to receive(:[]).with('sort').and_return(actual_option) }
|
6
|
+
it 'called Executor#search with sort option' do
|
7
|
+
expect_any_instance_of(Executor).to receive(:search).with(query, default_opts(sort: expected_option)).once
|
8
|
+
Commands::Run.new(options).call
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
4
12
|
describe '#call' do
|
5
13
|
before do
|
6
14
|
allow(options).to receive(:arguments).and_return([query])
|
@@ -12,18 +20,50 @@ RSpec.describe Commands::Run do
|
|
12
20
|
let(:query) { 'factory_girl' }
|
13
21
|
let(:options) { double('options') }
|
14
22
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
23
|
+
describe 'sort option' do
|
24
|
+
describe 'sort by all' do
|
25
|
+
context 'without sort option' do
|
26
|
+
include_examples 'sort example', 'downloads', nil
|
27
|
+
end
|
28
|
+
context 'with disalbe sort option' do
|
29
|
+
include_examples 'sort example', 'downloads', 'xyz'
|
30
|
+
end
|
31
|
+
context 'with a' do
|
32
|
+
include_examples 'sort example', 'downloads', 'a'
|
33
|
+
end
|
34
|
+
context 'with all' do
|
35
|
+
include_examples 'sort example', 'downloads', 'all'
|
36
|
+
end
|
37
|
+
context 'with ALL' do
|
38
|
+
include_examples 'sort example', 'downloads', 'ALL'
|
39
|
+
end
|
19
40
|
end
|
20
41
|
end
|
21
42
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
43
|
+
describe 'sort by name' do
|
44
|
+
context 'with n' do
|
45
|
+
include_examples 'sort example', 'name', 'n'
|
46
|
+
end
|
47
|
+
context 'with name' do
|
48
|
+
include_examples 'sort example', 'name', 'name'
|
49
|
+
end
|
50
|
+
context 'with NAME' do
|
51
|
+
include_examples 'sort example', 'name', 'NAME'
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe 'sort by ver' do
|
56
|
+
context 'with v' do
|
57
|
+
include_examples 'sort example', 'version_downloads', 'v'
|
58
|
+
end
|
59
|
+
context 'with ver' do
|
60
|
+
include_examples 'sort example', 'version_downloads', 'ver'
|
61
|
+
end
|
62
|
+
context 'with version' do
|
63
|
+
include_examples 'sort example', 'version_downloads', 'version'
|
64
|
+
end
|
65
|
+
context 'with VER' do
|
66
|
+
include_examples 'sort example', 'version_downloads', 'VER'
|
27
67
|
end
|
28
68
|
end
|
29
69
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem-search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rochefort
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slop
|