landmarks-of-st-petersburg 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/landmarks/version.rb +1 -1
- metadata +18 -14
- data/.gitignore +0 -9
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -8
- data/LICENSE.txt +0 -21
- data/README.md +0 -39
- data/Rakefile +0 -2
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/landmarks-of-st-petersburg-0.1.0.gem +0 -0
- data/landmarks.gemspec +0 -39
- data/spec.md +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8046157cd1eaa5e53b9972ab18620266673e956c
|
4
|
+
data.tar.gz: 9dc7a608f28dc0941604c82a76a4b1c4f99e62d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b84f215ee90313765c8b79ec1483d484ce34e71a792d89791d0755abbfc7d669e347c6e3d0a76562c0fee6eb184c89627efc51bd844aad23809364444f16392
|
7
|
+
data.tar.gz: 44b1d9a87a2219a6933bab41633c6ae8539dfbf0edb09c8dafbde6e0aa98682109b0ed86bb913e871dba0e22c262c8edc40f7e917d957a62c95b20c531350a46
|
data/lib/landmarks/version.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: landmarks-of-st-petersburg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "'Igor Eskin'"
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
@@ -38,34 +38,38 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: nokogiri
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: |-
|
42
56
|
This gem allows to scrape a website of top 20 architectural attractions of St. Petersburg, Russia,
|
43
57
|
and by the user's choice display an eloquent description of each individual attraction as well as some useful details (if available),
|
44
58
|
such as location, directions, names of other attractions located nearby, business hours and possible admission fee.
|
45
59
|
email:
|
46
60
|
- "'eskinhd@gmail.com'"
|
47
|
-
executables:
|
61
|
+
executables:
|
62
|
+
- landmarks
|
48
63
|
extensions: []
|
49
64
|
extra_rdoc_files: []
|
50
65
|
files:
|
51
|
-
- ".gitignore"
|
52
|
-
- CODE_OF_CONDUCT.md
|
53
|
-
- Gemfile
|
54
|
-
- LICENSE.txt
|
55
|
-
- README.md
|
56
|
-
- Rakefile
|
57
|
-
- bin/console
|
58
66
|
- bin/landmarks
|
59
|
-
- bin/setup
|
60
67
|
- config/environment.rb
|
61
|
-
- landmarks-of-st-petersburg-0.1.0.gem
|
62
|
-
- landmarks.gemspec
|
63
68
|
- lib/landmarks.rb
|
64
69
|
- lib/landmarks/cli.rb
|
65
70
|
- lib/landmarks/landmark.rb
|
66
71
|
- lib/landmarks/scraper.rb
|
67
72
|
- lib/landmarks/version.rb
|
68
|
-
- spec.md
|
69
73
|
homepage: https://github.com/igoreskin/landmarks-of-st-petersburg-cli-app
|
70
74
|
licenses:
|
71
75
|
- MIT
|
data/.gitignore
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
-
orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at 'eskinhd@gmail.com'. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2017 'Igor Eskin'
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# Landmarks of St. Petersburg
|
2
|
-
|
3
|
-
This Ruby Gem provides a CLI to view the top 20 architectural landmarks of St. Petersburg with detailed description and other useful information.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'landmarks-of-st-petersburg'
|
11
|
-
```
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
$ gem install landmarks-of-st-petersburg
|
20
|
-
|
21
|
-
## Usage
|
22
|
-
|
23
|
-
To run this gem as a local application, please run ./bin/landmarks from the command line.
|
24
|
-
If you have already installed the gem, please enter landmarks in the command line and follow the on-screen prompts.
|
25
|
-
|
26
|
-
## Development
|
27
|
-
|
28
|
-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
29
|
-
|
30
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
31
|
-
|
32
|
-
## Contributing
|
33
|
-
|
34
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/igoreskin/landmarks-of-st-petersburg-cli-app. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
35
|
-
|
36
|
-
|
37
|
-
## License
|
38
|
-
|
39
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "landmarks"
|
5
|
-
|
6
|
-
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
9
|
-
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
-
# require "pry"
|
12
|
-
# Pry.start
|
13
|
-
|
14
|
-
require "irb"
|
15
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
Binary file
|
data/landmarks.gemspec
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'landmarks/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "landmarks-of-st-petersburg"
|
8
|
-
spec.version = Landmarks::VERSION
|
9
|
-
spec.authors = ["'Igor Eskin'"]
|
10
|
-
spec.email = ["'eskinhd@gmail.com'"]
|
11
|
-
|
12
|
-
spec.summary = %q{Top 20 architectural landmarks of St. Petersburg with descriptions and other useful information.}
|
13
|
-
spec.description = %q{This gem allows to scrape a website of top 20 architectural attractions of St. Petersburg, Russia,
|
14
|
-
and by the user's choice display an eloquent description of each individual attraction as well as some useful details (if available),
|
15
|
-
such as location, directions, names of other attractions located nearby, business hours and possible admission fee.}
|
16
|
-
spec.homepage = "https://github.com/igoreskin/landmarks-of-st-petersburg-cli-app"
|
17
|
-
spec.license = "MIT"
|
18
|
-
|
19
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
20
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
21
|
-
=begin
|
22
|
-
if spec.respond_to?(:metadata)
|
23
|
-
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
24
|
-
else
|
25
|
-
raise "RubyGems 2.0 or newer is required to protect against " \
|
26
|
-
"public gem pushes."
|
27
|
-
end
|
28
|
-
=end
|
29
|
-
|
30
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
31
|
-
f.match(%r{^(test|spec|features)/})
|
32
|
-
end
|
33
|
-
spec.bindir = "exe"
|
34
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
35
|
-
spec.require_paths = ["lib"]
|
36
|
-
|
37
|
-
spec.add_development_dependency "bundler", "~> 1.14"
|
38
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
39
|
-
end
|
data/spec.md
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
# Specifications for the CLI Assessment
|
2
|
-
|
3
|
-
Specs:
|
4
|
-
|
5
|
-
- [x] Have a CLI for interfacing with the application
|
6
|
-
|
7
|
-
The CLI interfaces with the application by interacting with the Landmarks::Landmark class, whereas
|
8
|
-
all the logic of the interaction between the Landmarks::Landmark class and Landmarks::Scraper class
|
9
|
-
is fully encapsulated in the instance and class methods of the Landmarks::Landmark class. First the CLI
|
10
|
-
assigns a property of the Landmark class called scraper (which is essentially a newly instantiated
|
11
|
-
object of the Scraper class, and we only need one object of this class) to a variable called scraper,
|
12
|
-
which then allows us to call an instance method of the Scraper class directly on this variable and to
|
13
|
-
scrape and print a numbered list of all our landmarks. After that, inside of the #start method defined
|
14
|
-
below, which contains the entire logic of the interaction between the program and the user, the CLI
|
15
|
-
is then calling reader instance methods of the Landmark class to display landmarks' properties at the user's
|
16
|
-
request. This design actually allows us to adhere to the principle of single responsibility in terms of
|
17
|
-
the CLI only interacting with the Landmark class - even the one and only object of the Scraper class is,
|
18
|
-
from the point of view of the CLI, just a property of the Landmark class.
|
19
|
-
|
20
|
-
- [x] Pull data from an external source
|
21
|
-
|
22
|
-
The first instance method in the Landmarks::Scraper class called #get_page returns the contents of the website
|
23
|
-
we are scraping in the form of a set of nested nodes. The following method in the same class called #scrape_landmarks_index
|
24
|
-
iterates through the return value of the previous method, instantiates new objects of the Landmarks::Landmark class
|
25
|
-
and uses the appropriate CSS selectors to scrape the data, which is then assigned to these objects as their properties.
|
26
|
-
It is worth noting that the principle of single responsibility is being adhered to here as well, since each method
|
27
|
-
in the Scraper class is on responsible for a single clearly defined action.
|
28
|
-
|
29
|
-
- [x] Implement both list and detail views
|
30
|
-
|
31
|
-
The logic of implementation of the list view is contained inside of the method called #call in the CLI class, where
|
32
|
-
the #print_the_title method is called on the scraper variable, which, being a property of the Landmark class,
|
33
|
-
actually is a newly instantiated object of the Scraper class assigned to the Landmark class as its property
|
34
|
-
in the form of a class variable and a reader method. The next method, #print_landmarks_index, is also called on the
|
35
|
-
same variable to print the numbered list of the landmarks. Although both #print_the_title and #print_landmarks_index
|
36
|
-
methods are instance methods of the Scraper class, from the point of view of the CLI they are called on the variable
|
37
|
-
representing a property of the Landmark class.
|
38
|
-
|
39
|
-
The detailed view of each landmark is implemented through two instance methods of the Landmark class, #description
|
40
|
-
(which provides a detailed description of the landmark selected by the user) and, if the user chooses so, #directions
|
41
|
-
(which in turn displays some useful information about the landmark, such as directions, business hours, possible
|
42
|
-
admission fees etc., if available). The entire logic of this process is encapsulated in the #start method of the CLI
|
43
|
-
class. The #start method then calls itself twice (if, after displaying either the description or the details of the
|
44
|
-
selected landmark, the user wishes to find out more about another landmark), and is therefore recursive.
|