universities 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +7 -0
- data/.rubocop.yml +1 -6
- data/.travis.yml +11 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +43 -7
- data/README.md +7 -4
- data/Rakefile +6 -4
- data/bin/console +4 -4
- data/lib/universities/entity.rb +11 -9
- data/lib/universities/request.rb +3 -3
- data/lib/universities/version.rb +3 -1
- data/universities.gemspec +8 -3
- metadata +61 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1429ebeda856f5deb9664551ddf751fc6fd0aff3
|
4
|
+
data.tar.gz: 634c00d6b85b6162d798a5eb47fa978e05b6b891
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90b3cda8ef69c73fca7ccd72f9976addc6634e01db546f6961516afcfadf2679646bf1e3e2033c13ebfab762ecf223fbe5797ed35c22cb42fd4ff6299c2fe67b
|
7
|
+
data.tar.gz: 874f9a62e6e458a967918bb22ecd9a47ec40cb4b2b41549315b1c36b86fddccad3fb493bcd2f8cbc0f4576f8f06f6f4f74a1778e9ec394ff31e7886f040bba57
|
data/.codeclimate.yml
ADDED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
sudo: false
|
2
|
+
env:
|
3
|
+
global:
|
4
|
+
- CC_TEST_REPORTER_ID=6727774317142f42ffb6d3c2ea8764c3ef7e639ac7bff13a30d16a484439c1b9
|
2
5
|
language: ruby
|
3
6
|
rvm:
|
4
7
|
- 2.4.3
|
5
8
|
before_install: gem install bundler -v 1.16.1
|
9
|
+
before_script:
|
10
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
11
|
+
- chmod +x ./cc-test-reporter
|
12
|
+
- ./cc-test-reporter before-build
|
13
|
+
script:
|
14
|
+
- bundle exec rspec
|
15
|
+
after_script:
|
16
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
3
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in universities.gemspec
|
6
6
|
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
universities (0.1.
|
4
|
+
universities (0.1.1)
|
5
5
|
activesupport
|
6
6
|
httparty
|
7
7
|
|
@@ -15,28 +15,39 @@ GEM
|
|
15
15
|
tzinfo (~> 1.1)
|
16
16
|
addressable (2.6.0)
|
17
17
|
public_suffix (>= 2.0.2, < 4.0)
|
18
|
+
ansi (1.5.0)
|
19
|
+
ast (2.4.0)
|
18
20
|
coderay (1.1.2)
|
19
21
|
concurrent-ruby (1.1.4)
|
20
22
|
crack (0.4.3)
|
21
23
|
safe_yaml (~> 1.0.0)
|
22
24
|
diff-lcs (1.3)
|
25
|
+
docile (1.3.1)
|
23
26
|
hashdiff (0.3.8)
|
27
|
+
hirb (0.7.3)
|
24
28
|
httparty (0.16.4)
|
25
29
|
mime-types (~> 3.0)
|
26
30
|
multi_xml (>= 0.5.2)
|
27
|
-
i18n (1.
|
31
|
+
i18n (1.6.0)
|
28
32
|
concurrent-ruby (~> 1.0)
|
29
|
-
|
33
|
+
jaro_winkler (1.5.2)
|
34
|
+
json (2.2.0)
|
35
|
+
method_source (0.9.2)
|
30
36
|
mime-types (3.2.2)
|
31
37
|
mime-types-data (~> 3.2015)
|
32
38
|
mime-types-data (3.2018.0812)
|
33
39
|
minitest (5.11.3)
|
34
40
|
multi_xml (0.6.0)
|
35
|
-
|
41
|
+
parallel (1.14.0)
|
42
|
+
parser (2.6.0.0)
|
43
|
+
ast (~> 2.4.0)
|
44
|
+
powerpack (0.1.2)
|
45
|
+
pry (0.12.2)
|
36
46
|
coderay (~> 1.1.0)
|
37
|
-
method_source (~> 0.
|
38
|
-
|
47
|
+
method_source (~> 0.9.0)
|
48
|
+
psych (3.1.0)
|
39
49
|
public_suffix (3.0.3)
|
50
|
+
rainbow (3.0.0)
|
40
51
|
rake (10.5.0)
|
41
52
|
rspec (3.8.0)
|
42
53
|
rspec-core (~> 3.8.0)
|
@@ -51,11 +62,32 @@ GEM
|
|
51
62
|
diff-lcs (>= 1.2.0, < 2.0)
|
52
63
|
rspec-support (~> 3.8.0)
|
53
64
|
rspec-support (3.8.0)
|
65
|
+
rubocop (0.65.0)
|
66
|
+
jaro_winkler (~> 1.5.1)
|
67
|
+
parallel (~> 1.10)
|
68
|
+
parser (>= 2.5, != 2.5.1.1)
|
69
|
+
powerpack (~> 0.1)
|
70
|
+
psych (>= 3.1.0)
|
71
|
+
rainbow (>= 2.2.2, < 4.0)
|
72
|
+
ruby-progressbar (~> 1.7)
|
73
|
+
unicode-display_width (~> 1.4.0)
|
74
|
+
rubocop-rspec (1.32.0)
|
75
|
+
rubocop (>= 0.60.0)
|
76
|
+
ruby-progressbar (1.10.0)
|
54
77
|
safe_yaml (1.0.5)
|
55
|
-
|
78
|
+
simplecov (0.16.1)
|
79
|
+
docile (~> 1.1)
|
80
|
+
json (>= 1.8, < 3)
|
81
|
+
simplecov-html (~> 0.10.0)
|
82
|
+
simplecov-console (0.4.2)
|
83
|
+
ansi
|
84
|
+
hirb
|
85
|
+
simplecov
|
86
|
+
simplecov-html (0.10.2)
|
56
87
|
thread_safe (0.3.6)
|
57
88
|
tzinfo (1.2.5)
|
58
89
|
thread_safe (~> 0.1)
|
90
|
+
unicode-display_width (1.4.1)
|
59
91
|
vcr (4.0.0)
|
60
92
|
webmock (3.5.1)
|
61
93
|
addressable (>= 2.3.6)
|
@@ -70,6 +102,10 @@ DEPENDENCIES
|
|
70
102
|
pry
|
71
103
|
rake (~> 10.0)
|
72
104
|
rspec (~> 3.0)
|
105
|
+
rubocop
|
106
|
+
rubocop-rspec
|
107
|
+
simplecov
|
108
|
+
simplecov-console
|
73
109
|
universities!
|
74
110
|
vcr
|
75
111
|
webmock
|
data/README.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
[![Build Status](https://travis-ci.org/laurentzziu/universities.svg?branch=master)](https://travis-ci.org/laurentzziu/universities)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/universities.svg)](https://rubygems.org/gems/universities)
|
3
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/06e863f836bf7faeaeb5/maintainability)](https://codeclimate.com/github/laurentzziu/universities/maintainability)
|
4
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/06e863f836bf7faeaeb5/test_coverage)](https://codeclimate.com/github/laurentzziu/universities/test_coverage)
|
2
5
|
|
3
6
|
# Universities
|
4
7
|
|
@@ -37,25 +40,25 @@ Available filters: `country`, `name`.
|
|
37
40
|
#### Filter by *country*
|
38
41
|
```ruby
|
39
42
|
Universities.get.country('Romania').fetch
|
40
|
-
# alias_method:
|
43
|
+
# alias_method:
|
41
44
|
Universities.get.by_country('Romania').fetch
|
42
45
|
```
|
43
46
|
|
44
47
|
#### Filter by *name*
|
45
48
|
```ruby
|
46
49
|
Universities.get.name('Politehnica').fetch
|
47
|
-
# alias_method:
|
50
|
+
# alias_method:
|
48
51
|
Universities.get.by_name('Politehnica').fetch
|
49
52
|
```
|
50
53
|
|
51
54
|
#### Filter by *country* and *name*
|
52
55
|
```ruby
|
53
56
|
Universities.get.country('Romania').name('Politehnica').fetch
|
54
|
-
# alias_method:
|
57
|
+
# alias_method:
|
55
58
|
Universities.get.by_country('Romania').by_name('Politehnica').fetch
|
56
59
|
```
|
57
60
|
|
58
|
-
#### University::Entity
|
61
|
+
#### University::Entity
|
59
62
|
Example
|
60
63
|
|
61
64
|
```ruby
|
data/Rakefile
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rspec/core/rake_task'
|
3
5
|
|
4
6
|
RSpec::Core::RakeTask.new(:spec)
|
5
7
|
|
6
8
|
task :console do
|
7
|
-
exec
|
9
|
+
exec 'pry -r universities -I ./lib'
|
8
10
|
end
|
9
11
|
|
10
|
-
task :
|
12
|
+
task default: :spec
|
data/bin/console
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'universities'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
8
8
|
|
9
9
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require
|
10
|
+
# require 'pry'
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start(__FILE__)
|
data/lib/universities/entity.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'active_support/core_ext/hash'
|
3
4
|
|
4
5
|
module Universities
|
@@ -10,16 +11,17 @@ module Universities
|
|
10
11
|
country: 'country',
|
11
12
|
domains: 'domains',
|
12
13
|
name: 'name'
|
13
|
-
}
|
14
|
+
}.freeze
|
15
|
+
|
16
|
+
attr_reader(*ATTRIBUTES_MAPPING.keys)
|
14
17
|
|
15
18
|
def initialize(web_pages: nil, alpha_two_code: nil, state_province: nil, country: nil, domains: nil, name: nil)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
19
|
+
@web_pages = web_pages
|
20
|
+
@alpha_two_code = alpha_two_code
|
21
|
+
@state_province = state_province
|
22
|
+
@country = country
|
23
|
+
@domains = domains
|
24
|
+
@name = name
|
23
25
|
end
|
24
26
|
|
25
27
|
def self.build(hash)
|
@@ -33,4 +35,4 @@ module Universities
|
|
33
35
|
end.to_h
|
34
36
|
end
|
35
37
|
end
|
36
|
-
end
|
38
|
+
end
|
data/lib/universities/request.rb
CHANGED
@@ -23,17 +23,17 @@ module Universities
|
|
23
23
|
dup_and_update(country: word)
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
alias by_country country
|
27
27
|
|
28
28
|
def name(word)
|
29
29
|
dup_and_update(name: word)
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
alias by_name name
|
33
33
|
|
34
34
|
private
|
35
35
|
|
36
|
-
BASE_URL = 'http://universities.hipolabs.com/search'
|
36
|
+
BASE_URL = 'http://universities.hipolabs.com/search'.freeze
|
37
37
|
|
38
38
|
def params
|
39
39
|
hash = {}
|
data/lib/universities/version.rb
CHANGED
data/universities.gemspec
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
@@ -9,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
9
10
|
spec.authors = ['Florinel Gorgan']
|
10
11
|
spec.email = ['florin@floringorgan.com']
|
11
12
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
13
|
+
spec.summary = 'Ruby gem for Hipo/university-domains-list.'
|
14
|
+
spec.description = 'Ruby gem for Hipo/university-domains-list.'
|
14
15
|
spec.homepage = 'https://github.com/laurentzziu/universities'
|
15
16
|
spec.license = 'MIT'
|
16
17
|
|
@@ -21,13 +22,17 @@ Gem::Specification.new do |spec|
|
|
21
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
23
|
spec.require_paths = ['lib']
|
23
24
|
|
24
|
-
spec.add_runtime_dependency 'httparty'
|
25
25
|
spec.add_runtime_dependency 'activesupport'
|
26
|
+
spec.add_runtime_dependency 'httparty'
|
26
27
|
|
27
28
|
spec.add_development_dependency 'bundler'
|
28
29
|
spec.add_development_dependency 'pry'
|
29
30
|
spec.add_development_dependency 'rake', '~> 10.0'
|
30
31
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
32
|
+
spec.add_development_dependency 'rubocop'
|
33
|
+
spec.add_development_dependency 'rubocop-rspec'
|
34
|
+
spec.add_development_dependency 'simplecov'
|
35
|
+
spec.add_development_dependency 'simplecov-console'
|
31
36
|
spec.add_development_dependency 'vcr'
|
32
37
|
spec.add_development_dependency 'webmock'
|
33
38
|
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: universities
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florinel Gorgan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: httparty
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -94,6 +94,62 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: simplecov
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov-console
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
97
153
|
- !ruby/object:Gem::Dependency
|
98
154
|
name: vcr
|
99
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,6 +185,7 @@ executables: []
|
|
129
185
|
extensions: []
|
130
186
|
extra_rdoc_files: []
|
131
187
|
files:
|
188
|
+
- ".codeclimate.yml"
|
132
189
|
- ".gitignore"
|
133
190
|
- ".rspec"
|
134
191
|
- ".rubocop.yml"
|