stress_release_yoga 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c6620d44767833f6d3191d4ac4de5d54e009454d02157ca0754e2abf269d56c6
4
+ data.tar.gz: 65dfc6ac4a9efdb6ad4c20173fb32024a3f90c85e815d257f099c121a57de092
5
+ SHA512:
6
+ metadata.gz: bea2daec745e0281e7c3440fefcf3634616cd55f27f7ba90b5aed5ee750f7d1b21deb44a8c772ccb764f3c515644e96f19859fb83da3e4d1b4c0544729c16e16
7
+ data.tar.gz: 0be752963ee2a5c9ed0be5a086dd3ac6aad3d8ea4911ebcafa9e20aaa342bf8fed5a0bcbfbeb7ca9d38042d8cb4247a0be65be90c59922ecad5d75d87a4bd80a
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
@@ -0,0 +1,75 @@
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 'denali.balser167@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/
75
+
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "nokogiri", ">= 1.11.0"
4
+ gem "pry"
5
+
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,33 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ stress_release_yoga (0.1.0)
5
+ nokogiri
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ coderay (1.1.3)
11
+ method_source (1.0.0)
12
+ mini_portile2 (2.5.0)
13
+ nokogiri (1.11.3)
14
+ mini_portile2 (~> 2.5.0)
15
+ racc (~> 1.4)
16
+ pry (0.14.1)
17
+ coderay (~> 1.1)
18
+ method_source (~> 1.0)
19
+ racc (1.5.2)
20
+ rake (13.0.3)
21
+
22
+ PLATFORMS
23
+ ruby
24
+
25
+ DEPENDENCIES
26
+ bundler (~> 2.0)
27
+ nokogiri (>= 1.11.0)
28
+ pry
29
+ rake (>= 12.3.3)
30
+ stress_release_yoga!
31
+
32
+ BUNDLED WITH
33
+ 2.1.4
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 'Denali Balser'
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.
22
+
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # StressReleaseYoga
2
+
3
+ <img width="1043" alt="Screen Shot 2021-04-26 at 11 11 17 AM" src="https://user-images.githubusercontent.com/46694709/116123480-46df5c00-a680-11eb-9196-3fa1c6d564d5.png">
4
+
5
+ This Ruby Gem provides a CLI to view the 6 yoga poses targeted at relieving stress from the mind and body derived from an article posted by self.com on de-stressing with yoga.
6
+
7
+ ## Installation
8
+
9
+ $ gem install stress_release_yoga
10
+
11
+ ## Usage
12
+
13
+ Type the below and follow the on screen/in terminal prompts.
14
+
15
+ $ bin/console
16
+
17
+ ## Development
18
+
19
+ 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.
20
+
21
+ 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).
22
+
23
+ ## Dependencies
24
+ * ruby
25
+ * bundler (~> 2.0)
26
+ * nokogiri (>= 1.11.0)
27
+ * pry
28
+ * rake (>= 12.3.3)
29
+ * stress_release_yoga!
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/'denalibalser'/stress_release_yoga. 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.
34
+
35
+ ## License
36
+
37
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
38
+
39
+ ## Code of Conduct
40
+
41
+ Everyone interacting in the StressReleaseYoga project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/'denalibalser'/stress_release_yoga/blob/master/CODE_OF_CONDUCT.md).
42
+
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
3
+
data/bin/console ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+
4
+ require_relative "../lib/environment.rb"
5
+
6
+ CLI.new.start
7
+
8
+
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "stress_release_yoga"
data/lib/cli.rb ADDED
@@ -0,0 +1,60 @@
1
+ class CLI
2
+
3
+ def start
4
+ puts "Welcome. Learning how to become a software engineer can be very stressful, not to mention life in general. It is very important to take care of your mind and body in times of stress, which is usually when you feel the least like doing so. Yoga is an accessible and effective way to both destress the mind and move the body after hours of sitting at the computer learning how to code."
5
+ puts ""
6
+ Scraper.scrape_website_poses
7
+ list_poses
8
+ select_pose
9
+ end
10
+
11
+ def list_poses
12
+ puts "Here is a list of 6 yoga poses targeted at destressing the mind and body:"
13
+ puts ""
14
+ @poses = YogaPose.all
15
+ @poses.each.with_index(1) do |pose, i|
16
+ puts "#{i}. #{pose.name}"
17
+ end
18
+ end
19
+
20
+ def select_pose
21
+ input = nil
22
+
23
+ while input != "exit"
24
+ puts ""
25
+ puts "Please select a yoga pose 1-6 to learn more about it, type 'list' to see the list of poses again, type 'create' to add your own yoga pose, or type 'exit' to exit:"
26
+ puts ""
27
+ input = gets.strip.downcase
28
+ puts ""
29
+
30
+ if input.to_i > 0 && input.to_i <= YogaPose.all.length
31
+ the_pose = @poses[input.to_i-1]
32
+ puts "#{the_pose.name}: #{the_pose.description}"
33
+ elsif input == "list"
34
+ list_poses
35
+ elsif input == "create"
36
+ puts "Name:"
37
+ name = gets.chomp
38
+ puts "Description:"
39
+ description = gets.chomp
40
+ create_new_pose(name, description)
41
+ elsif input == "exit"
42
+ goodbye
43
+ else
44
+ puts "Invalid input, refer back to directions to find your pose!"
45
+ end
46
+ end
47
+ end
48
+
49
+ def create_new_pose(name, description)
50
+ YogaPose.new(name, description)
51
+ puts "Your new yoga pose, #{name}, was created."
52
+ list_poses
53
+ end
54
+
55
+ def goodbye
56
+ puts ""
57
+ puts "~Namaste~"
58
+ puts ""
59
+ end
60
+ end
@@ -0,0 +1,8 @@
1
+ require 'open-uri'
2
+ require 'nokogiri'
3
+
4
+ require_relative "./cli"
5
+ require_relative "./yoga_poses"
6
+ require_relative "./scraper"
7
+
8
+
data/lib/scraper.rb ADDED
@@ -0,0 +1,18 @@
1
+ class Scraper
2
+
3
+ def self.scrape_website_poses
4
+ doc = Nokogiri::HTML(open("https://www.self.com/gallery/de-stressing-yoga-poses-to-help-you-calm-down"))
5
+
6
+ names = doc.css("figcaption h2.gallery-slide-caption__hed span.gallery-slide-caption__hed-text").map do |pose_el|
7
+ pose_el.text
8
+ end
9
+
10
+ descriptions = doc.css("figcaption div.gallery-slide-caption__dek-container div.gallery-slide-caption__dek div").map do |caption_el|
11
+ caption_el.text
12
+ end
13
+
14
+ names.each_with_index do |name, index|
15
+ YogaPose.new(name, descriptions[index])
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,4 @@
1
+ module StressReleaseYoga
2
+ VERSION = "0.1.0"
3
+
4
+ end
data/lib/yoga_poses.rb ADDED
@@ -0,0 +1,16 @@
1
+ class YogaPose
2
+ attr_accessor :name, :description
3
+
4
+ @@all = []
5
+
6
+ def initialize(name=nil, description=nil)
7
+ @name = name
8
+ @description = description
9
+ @@all << self
10
+ end
11
+
12
+ def self.all
13
+ @@all
14
+ end
15
+ end
16
+
@@ -0,0 +1,29 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "stress_release_yoga/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "stress_release_yoga"
8
+ spec.version = StressReleaseYoga::VERSION
9
+ spec.authors = ["Denali Balser"]
10
+ spec.email = ["denali.balser167@gmail.com"]
11
+
12
+ spec.summary = "Stress Release Yoga CLI"
13
+ spec.description = "A simple CLI application that scrapes yoga poses and displays them to user."
14
+ spec.homepage = "https://rubygems.org/gems/stress_release_yoga" #may need to change this, depending on what i name it
15
+ spec.license = "MIT"
16
+
17
+
18
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ end
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_development_dependency "bundler", "~> 2.0"
26
+ spec.add_development_dependency "rake", ">= 12.3.3"
27
+
28
+ spec.add_dependency "nokogiri"
29
+ end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stress_release_yoga
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Denali Balser
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-04-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 12.3.3
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 12.3.3
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: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: A simple CLI application that scrapes yoga poses and displays them to
56
+ user.
57
+ email:
58
+ - denali.balser167@gmail.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - CODE_OF_CONDUCT.md
65
+ - Gemfile
66
+ - Gemfile.lock
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - bin/console
71
+ - bin/setup
72
+ - bin/stress_release_yoga
73
+ - lib/cli.rb
74
+ - lib/environment.rb
75
+ - lib/scraper.rb
76
+ - lib/stress_release_yoga/version.rb
77
+ - lib/yoga_poses.rb
78
+ - stress_release_yoga.gemspec
79
+ homepage: https://rubygems.org/gems/stress_release_yoga
80
+ licenses:
81
+ - MIT
82
+ metadata: {}
83
+ post_install_message:
84
+ rdoc_options: []
85
+ require_paths:
86
+ - lib
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ requirements: []
98
+ rubygems_version: 3.0.8
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: Stress Release Yoga CLI
102
+ test_files: []