overwatch_helper 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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c203f2a33bc5ce7159afaca547fe420bdc07fef9
4
+ data.tar.gz: 94579b6fc2ceb04aa85404f77f9dccde81f2c36e
5
+ SHA512:
6
+ metadata.gz: c9bd6c2234a104f3dd35e58261e33bc1d7d58c2fc8468be584ffa129f1df9a28a5759af01261583a734fb7b8d137cd8b32f0156921bbbc4ba3796fee41956d31
7
+ data.tar.gz: d3e09921f07597deb3d6b7612609860d8fdc4699acc129311f6834fc1686dc2d38088b456ae433c24f2d5d1aa36093348f36baedf3362910a6877aefb8afd5e3
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.3
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in overwatch_helper.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 krisnotchris
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.
@@ -0,0 +1,22 @@
1
+ # Overwatch Helper CLI Gem - v. 0.1.0
2
+
3
+ Welcome to my Overwatch CLI gem. With this gem, you can:
4
+ - Check the current list of characters.
5
+ - Check the current list of maps.
6
+
7
+ #### Installation
8
+ Add to your gemfile:
9
+
10
+ `gem 'overwatch_helper'`
11
+
12
+ or install from Rubygems:
13
+
14
+ `gem install 'overwatch_helper'`
15
+
16
+ #### Usage
17
+ After installing the gem, you will run it by typing:
18
+
19
+ `./bin/overwatch_helper`
20
+
21
+ Enjoy :)
22
+ Any questions or comments can be sent to krishenderson@gmail.com
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "overwatch_helper"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require './lib/overwatch_helper'
5
+
6
+ OverwatchHelper::CLI.new.call
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,7 @@
1
+ require_relative "overwatch_helper/version"
2
+ require_relative "./overwatch_helper/cli"
3
+ require_relative "./overwatch_helper/character"
4
+ require_relative "./overwatch_helper/map"
5
+ require 'nokogiri'
6
+ require 'pry'
7
+ require 'open-uri'
@@ -0,0 +1,21 @@
1
+ class OverwatchHelper::Character
2
+ attr_accessor :name
3
+ def self.all
4
+ # should list all the characters
5
+ self.scrape_characters
6
+ end
7
+
8
+ def self.scrape_characters
9
+ index_url = "http://overwatch.wikia.com"
10
+ doc = Nokogiri::HTML(open("http://overwatch.wikia.com/wiki/Overwatch_Wiki"))
11
+ @characters = doc.css("div#gallery-1 div.lightbox-caption").collect do |i|
12
+ {
13
+ :name=>i.text
14
+ }
15
+ end
16
+ @characters
17
+ end
18
+ end
19
+
20
+
21
+
@@ -0,0 +1,43 @@
1
+ class OverwatchHelper::CLI
2
+
3
+ def call
4
+ puts "Welcome to Overwatch Helper!"
5
+ menu
6
+ goodbye
7
+ end
8
+
9
+ def list_characters
10
+ @characters = OverwatchHelper::Character.all
11
+ @characters.each.with_index(1) do |i, index|
12
+ puts "#{index}."+ "#{i[:name]}"
13
+ end
14
+ end
15
+
16
+ def list_maps
17
+ @maps = OverwatchHelper::Map.all
18
+ @maps.each.with_index(1) do |i, index|
19
+ puts "#{index}."+"#{i[:name]}"
20
+ end
21
+ end
22
+
23
+ def menu
24
+
25
+ input = nil
26
+ while input != "exit"
27
+ puts "To see current characters type 1, to see current maps type 2. Type exit to quit."
28
+ input = gets.strip.downcase
29
+
30
+ if input.to_i == 1
31
+ list_characters
32
+ elsif input.to_i == 2
33
+ list_maps
34
+ else
35
+ puts "Not sure what you want. Type 1, 2, or exit."
36
+ end
37
+ end
38
+ end
39
+
40
+ def goodbye
41
+ puts "See you on the battelground!"
42
+ end
43
+ end
@@ -0,0 +1,20 @@
1
+ class OverwatchHelper::Map
2
+ attr_accessor :name
3
+ def self.all
4
+ # should list all the maps
5
+ self.scrape_maps
6
+ end
7
+
8
+ def self.scrape_maps
9
+ doc = Nokogiri::HTML(open("http://overwatch.wikia.com/wiki/Overwatch_Wiki"))
10
+ @maps = doc.css("div#gallery-2 div.lightbox-caption").collect do |i|
11
+ {
12
+ :name=>i.text
13
+ }
14
+ end
15
+ @maps
16
+ end
17
+ end
18
+
19
+
20
+
@@ -0,0 +1,3 @@
1
+ module OverwatchHelper
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,35 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'overwatch_helper/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "overwatch_helper"
8
+ spec.version = OverwatchHelper::VERSION
9
+ spec.authors = ["krisnotchris"]
10
+ spec.email = ["krishenderson@gmail.com"]
11
+
12
+ spec.summary = "A Ruby CLI Gem used to provide the current characters and maps on the game Overwatch created by Blizzard Entertainment"
13
+ spec.homepage = "https://github.com/krisnotchris/overwatch_helper"
14
+ spec.license = "MIT"
15
+
16
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17
+ # delete this section to allow pushing this gem to any host.
18
+ # if spec.respond_to?(:metadata)
19
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
20
+ # else
21
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ # end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.add_development_dependency "bundler", "~> 1.10"
30
+ spec.add_development_dependency "rake", "~> 10.0"
31
+ spec.add_development_dependency "rspec"
32
+ spec.add_development_dependency "pry"
33
+
34
+ spec.add_dependency "nokogiri"
35
+ end
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: overwatch_helper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - krisnotchris
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-05-24 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: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
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'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: nokogiri
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description:
84
+ email:
85
+ - krishenderson@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".travis.yml"
93
+ - CODE_OF_CONDUCT.md
94
+ - Gemfile
95
+ - LICENSE.txt
96
+ - README.md
97
+ - Rakefile
98
+ - bin/console
99
+ - bin/overwatch_helper
100
+ - bin/setup
101
+ - lib/overwatch_helper.rb
102
+ - lib/overwatch_helper/character.rb
103
+ - lib/overwatch_helper/cli.rb
104
+ - lib/overwatch_helper/map.rb
105
+ - lib/overwatch_helper/version.rb
106
+ - overwatch_helper.gemspec
107
+ homepage: https://github.com/krisnotchris/overwatch_helper
108
+ licenses:
109
+ - MIT
110
+ metadata: {}
111
+ post_install_message:
112
+ rdoc_options: []
113
+ require_paths:
114
+ - lib
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ requirements: []
126
+ rubyforge_project:
127
+ rubygems_version: 2.6.4
128
+ signing_key:
129
+ specification_version: 4
130
+ summary: A Ruby CLI Gem used to provide the current characters and maps on the game
131
+ Overwatch created by Blizzard Entertainment
132
+ test_files: []