gem-search 0.3.1 → 0.3.2
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 +3 -0
- data/README.md +1 -0
- data/circle.yml +1 -1
- data/lib/gem_search/request.rb +1 -6
- data/lib/gem_search/version.rb +1 -1
- data/spec/commands/run_spec.rb +3 -3
- data/spec/helpers/dummy_data.rb +4 -4
- 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: a981697c5985c3862a2523e34f3f93d155a6b2f4
|
4
|
+
data.tar.gz: 7eec693d8a091e8b99d475f7821142caaaf8b033
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c67d2c7267b4ff0dbb450296f9466e8fc1f6a5ce9a0a256947fdb59ca673118b08e03d1713ec21941225acf38e7a86a47fd1bb8cc161b3adb22ad30bec6a9ab
|
7
|
+
data.tar.gz: 49ec264843d9070156572789e073be75847bb024e8245323cd0689ad61da447f7ce69a015ea43032c14ef35da101b63a07c0f7ac25a25ad8b8f337d76d4ac494
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -54,6 +54,7 @@ webkit2-gtk (3.0.7) 421 2178 http://rub
|
|
54
54
|
bitium-capybara-webkit (1.1.1) 1208 1208 http://github.com/thoughtbot/capybara-webkit
|
55
55
|
imseng-capybara-webkit (0.12.1) 1199 1199 http://github.com/imseng/capybara-webkit
|
56
56
|
node-webkit-bootstrap (1.0.0) 873 873 https://github.com/audiosocket/node-webkit-bootstrap```
|
57
|
+
```
|
57
58
|
|
58
59
|
### Sorted by gem name
|
59
60
|
|
data/circle.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
dependencies:
|
2
2
|
pre:
|
3
|
-
- case $CIRCLE_NODE_INDEX in 0) rvm use 2.
|
3
|
+
- case $CIRCLE_NODE_INDEX in 0) rvm use 2.2.0 --default ;;1) rvm use 2.3.0 --default ;; 2) rvm use 2.4.0 --default ;; esac
|
4
4
|
test:
|
5
5
|
override:
|
6
6
|
- ruby -v ; bundle exec rspec: {parallel: true}
|
data/lib/gem_search/request.rb
CHANGED
@@ -7,7 +7,6 @@ module GemSearch
|
|
7
7
|
GEM_API = "#{RUBYGEMS_URL}/api/v1/gems/%s.json"
|
8
8
|
|
9
9
|
MAX_REQUEST_COUNT = 20
|
10
|
-
MAX_GEMS_PER_PAGE = 30 # It has been determined by Rubygems API
|
11
10
|
|
12
11
|
def search(query, use_exact_match = false, &post_hook)
|
13
12
|
gems = []
|
@@ -24,7 +23,7 @@ module GemSearch
|
|
24
23
|
else
|
25
24
|
gems += results
|
26
25
|
end
|
27
|
-
break if
|
26
|
+
break if results.size.zero?
|
28
27
|
end
|
29
28
|
gems
|
30
29
|
rescue Interrupt
|
@@ -38,10 +37,6 @@ module GemSearch
|
|
38
37
|
|
39
38
|
private
|
40
39
|
|
41
|
-
def search_ended?(size)
|
42
|
-
size < MAX_GEMS_PER_PAGE || size.zero?
|
43
|
-
end
|
44
|
-
|
45
40
|
def request_ruby_gems_api(url)
|
46
41
|
option = {}
|
47
42
|
proxy = URI.parse(url).find_proxy
|
data/lib/gem_search/version.rb
CHANGED
data/spec/commands/run_spec.rb
CHANGED
@@ -57,7 +57,7 @@ RSpec.describe Commands::Run do
|
|
57
57
|
context "with no sort option" do
|
58
58
|
it "display rubygems ordering by DL(all)" do
|
59
59
|
res = <<-'EOS'.unindent
|
60
|
-
|Searching
|
60
|
+
|Searching ..
|
61
61
|
|NAME DL(ver) DL(all)
|
62
62
|
|-------------------------------------------------- -------- ---------
|
63
63
|
|factory_girl (3.6.0) 541 2042859
|
@@ -190,7 +190,7 @@ RSpec.describe Commands::Run do
|
|
190
190
|
it "is 50 characters" do
|
191
191
|
# rubocop:disable Metrics/LineLength, Style/TrailingWhitespace
|
192
192
|
res = <<-'EOS'.unindent
|
193
|
-
|Searching
|
193
|
+
|Searching ..
|
194
194
|
|NAME DL(ver) DL(all) HOMEPAGE
|
195
195
|
|-------------------------------------------------- -------- --------- ------------------------------------------------------------
|
196
196
|
|size_is_42_2345678901234567890123456789012 (0.0.1) 100 1000
|
@@ -210,7 +210,7 @@ RSpec.describe Commands::Run do
|
|
210
210
|
it "is 51 characters" do
|
211
211
|
# rubocop:disable Metrics/LineLength, Style/TrailingWhitespace
|
212
212
|
res = <<-'EOS'.unindent
|
213
|
-
|Searching
|
213
|
+
|Searching ..
|
214
214
|
|NAME DL(ver) DL(all) HOMEPAGE
|
215
215
|
|--------------------------------------------------- -------- --------- ------------------------------------------------------------
|
216
216
|
|size_is_43_23456789012345678901234567890123 (0.0.2) 200 2000
|
data/spec/helpers/dummy_data.rb
CHANGED
@@ -4,7 +4,7 @@ module DummyData
|
|
4
4
|
|
5
5
|
def dummy_search_result_sorted_by_all
|
6
6
|
<<-'EOS'.unindent
|
7
|
-
|Searching
|
7
|
+
|Searching ..
|
8
8
|
|NAME DL(ver) DL(all) HOMEPAGE
|
9
9
|
|-------------------------------------------------- -------- --------- ------------------------------------------------------------
|
10
10
|
|factory_girl (3.6.0) 541 2042859 https://github.com/thoughtbot/factory_girl
|
@@ -15,7 +15,7 @@ module DummyData
|
|
15
15
|
|
16
16
|
def dummy_search_result_sorted_by_ver
|
17
17
|
<<-'EOS'.unindent
|
18
|
-
|Searching
|
18
|
+
|Searching ..
|
19
19
|
|NAME DL(ver) DL(all) HOMEPAGE
|
20
20
|
|-------------------------------------------------- -------- --------- ------------------------------------------------------------
|
21
21
|
|factory_girl_rails (3.5.0) 39724 1238780 http://github.com/thoughtbot/factory_girl_rails
|
@@ -26,7 +26,7 @@ module DummyData
|
|
26
26
|
|
27
27
|
def dummy_search_result_sorted_by_name
|
28
28
|
<<-'EOS'.unindent
|
29
|
-
|Searching
|
29
|
+
|Searching ..
|
30
30
|
|NAME DL(ver) DL(all) HOMEPAGE
|
31
31
|
|-------------------------------------------------- -------- --------- ------------------------------------------------------------
|
32
32
|
|factory_girl (3.6.0) 541 2042859 https://github.com/thoughtbot/factory_girl
|
@@ -37,7 +37,7 @@ module DummyData
|
|
37
37
|
|
38
38
|
def dummy_search_results_multiple_pages
|
39
39
|
<<-'EOS'.unindent
|
40
|
-
|Searching
|
40
|
+
|Searching ....
|
41
41
|
|NAME DL(ver) DL(all) HOMEPAGE
|
42
42
|
|-------------------------------------------------- -------- --------- ------------------------------------------------------------
|
43
43
|
|autotest-cucumber-notification (0.0.6) 1027 3607 https://github.com/evrone/autotest-cucumber-notification
|
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.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rochefort
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slop
|