marvel_characters_cli_gem_ethel 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1146fe930cbf3387eac92998956d1c2d54b959cf7507ee0a61d68cd0d4b255f6
4
- data.tar.gz: 5a4df50b62fb5a3dffefeded95f6e331186be8eab4514d6a6281dc7aa136fe95
3
+ metadata.gz: b385896581def9fe36a43dffddd8961776ad2ecb979f1fd5ffbc0435bb5ade58
4
+ data.tar.gz: 40d58e4430677c601327a086a8fe6974b83e51b76f515ca3f906e5790f1aae64
5
5
  SHA512:
6
- metadata.gz: 6f920dc8e08fd1abb5143cd72c323f0fa147eefa899d41f7928f61d6cf486f1e9a1b01cd315a7155496e6127c47d318b2f792168c60ff891b143b0306faab2f1
7
- data.tar.gz: ecf262e357b7f208c6bd2a49c05c1dc878f9c8f458390fe8dd924c0000f20c3d54df39570ef5055751546ed45bc272321860a110a5717de9e89830ba2abe0361
6
+ metadata.gz: 41f040bca1cbe6c2212880a93600a4ba0484b7556ff3aca88e8033f3e83c3f27c786c0d773359a2b3b9e110dffa18ff558f7ffb9e1f825fa8e03f4f43506ff80
7
+ data.tar.gz: dd31e0566a8f8a0f497348e26bf9752f38530bba5cb81a2f25186cd1708613036215f44dd085e43f79ebde504815e64e378ab4d1a5e903baf664e65dc1c4a4c8
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MarvelCharactersCliGemEthel
2
2
 
3
- This gem
3
+ This Ruby Gem provides a CLI application to view the top 10 Marvel Characters.
4
4
 
5
5
  ## Installation
6
6
 
@@ -20,7 +20,8 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ Type the below and follow the on screen prompts.
24
+ ruby bin/marvel_characters_cli_gem_ethel
24
25
 
25
26
  ## Development
26
27
 
@@ -30,7 +31,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
30
31
 
31
32
  ## Contributing
32
33
 
33
- Bug reports and pull requests are welcome on GitHub at https://github.com/<github username>/marvel_characters_cli_gem_ethel. 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
+ Bug reports and pull requests are welcome on GitHub at https://github.com/<edb-c>/marvel_characters_cli_gem_ethel. 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
 
35
36
  ## License
36
37
 
@@ -38,5 +39,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
38
39
 
39
40
  ## Code of Conduct
40
41
 
41
- Everyone interacting in the MarvelCharactersCliGemEthel project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<github username>/marvel_characters_cli_gem_ethel/blob/master/CODE_OF_CONDUCT.md).
42
+ Everyone interacting in the MarvelCharactersCliGemEthel project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<edb-c>/marvel_characters_cli_gem_ethel/blob/master/CODE_OF_CONDUCT.md).
42
43
  # marvel_characters_cli_gem_ethel
@@ -1,16 +1,39 @@
1
1
  class MarvelCharactersCliGemEthel::Characters
2
2
 
3
- attr_accessor :super_name, :real_name, :character_type, :number_of_powers, :list_of_powers
3
+ attr_accessor :number, :super_name, :real_name, :character_type, :number_of_powers, :list_of_powers
4
4
 
5
5
  @@character_array = []
6
6
 
7
- def initialize(super_name=nil, real_name=nil, character_type=nil, number_of_powers=nil, list_of_powers)
8
- @super_name = super_name
9
- @real_name = real_name
10
- @character_type = character_type
11
- @number_of_powers = number_of_powers
12
- @list_of_powers = list_of_powers
7
+ def initialize(number = nil, super_name=nil, real_name=nil, character_type=nil, number_of_powers=nil, list_of_powers)
8
+ puts "in initialize"
9
+ puts super_name
10
+ @number = number
11
+ @@super_name = super_name
12
+ @@real_name = real_name
13
+ @@character_type = character_type
14
+ @@number_of_powers = number_of_powers
15
+ @@list_of_powers = list_of_powers
13
16
  @@character_array << self
14
17
  end
15
18
 
19
+ def self.get_super_name
20
+ @@super_name
21
+ end
22
+
23
+ def self.get_real_name
24
+ @@real_name
25
+ end
26
+
27
+ def self.get_character_type
28
+ @@character_type
29
+ end
30
+
31
+ def self.get_number_of_powers
32
+ @@number_of_powers
33
+ end
34
+
35
+ def self.get_list_of_powers
36
+ @@list_of_powers
37
+ end
38
+
16
39
  end #end Class
@@ -24,25 +24,30 @@ class MarvelCharactersCliGemEthel::CLI
24
24
  puts ""
25
25
  input = gets.strip.to_i-1
26
26
 
27
+ build_character(input)
27
28
  print_character(input)
28
29
  select_another_character
29
30
 
30
31
  end #end start
31
32
 
32
- #Provide Detailed View of Selected Character
33
+ #Create Character
33
34
 
34
- def print_character(input)
35
+ def build_character(input)
36
+ MarvelCharactersCliGemEthel::Scraper.get_character_info(input)
37
+ end
35
38
 
36
- character_info = MarvelCharactersCliGemEthel::Scraper.get_character_info(input)
39
+ #Provide Detailed View of Selected Character
37
40
 
38
- puts "Super Name: " + character_info.super_name
39
- puts "Real Name: " + character_info.real_name
40
- puts "Character Type: " + character_info.character_type
41
- puts "Number of Powers: " + character_info.number_of_powers.to_s
42
- puts "List of Powers: "
43
- puts character_info.list_of_powers.each{|one_power| puts one_power.to_s if one_power.to_s != "0"}
44
- puts ""
45
- puts '--------------------------------'
41
+ def print_character(input)
42
+ acharacter = MarvelCharactersCliGemEthel::Characters
43
+ puts "Super Name: #{acharacter.getsuper_name}"
44
+ puts "Real Name: #{acharacter.get_real_name}"
45
+ puts "Character Type: #{acharacter.get_character_type}"
46
+ puts "Number of Powers: #{acharacter.get_number_of_powers}"
47
+ puts "List of Powers: "
48
+ puts acharacter.get_list_of_powers.each{|one_power| puts one_power.to_s if one_power.to_s != "0"}
49
+ puts ""
50
+ puts '--------------------------------'
46
51
  end
47
52
 
48
53
  def select_another_character
@@ -21,6 +21,8 @@ class MarvelCharactersCliGemEthel::Scraper
21
21
  content2 = document2.read
22
22
  character_page = Nokogiri::HTML(content2)
23
23
 
24
+ number = input
25
+
24
26
  super_name = character_page.css('div.wiki-details').css('table').css('tr')[0].css('td').css('div').css('span').text
25
27
 
26
28
  real_name = character_page.css('div.wiki-details').css('table').css('tr')[1].css('td').css('div').css('span').text
@@ -31,7 +33,7 @@ class MarvelCharactersCliGemEthel::Scraper
31
33
 
32
34
  list_of_powers = character_page.css('div.wiki-details').css('table').css('tr')[11].css('td/div[1]/div').children
33
35
 
34
- character_info = MarvelCharactersCliGemEthel::Characters.new(super_name, real_name, character_type, number_of_powers, list_of_powers)
36
+ character_info = MarvelCharactersCliGemEthel::Characters.new(number, super_name, real_name, character_type, number_of_powers, list_of_powers)
35
37
  character_info
36
38
  end
37
39
 
@@ -1,3 +1,3 @@
1
1
  module MarvelCharactersCliGemEthel
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "bundler", "~> 1.16"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
- spec.add_development_dependency "nokogiri", ">= 0"
28
- spec.add_development_dependency "pry", ">= 0"
27
+ spec.add_development_dependency "nokogiri", ">= 1.0"
28
+ spec.add_development_dependency "pry", ">= 1.0"
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marvel_characters_cli_gem_ethel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - edb-c
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-22 00:00:00.000000000 Z
11
+ date: 2018-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '1.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '1.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '1.0'
83
83
  description:
84
84
  email:
85
85
  - edb.cofresi@gmail.com