fezinha_generator 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
+ SHA1:
3
+ metadata.gz: 6265d50566d7a02485f6a2e8311d06fc68f8a712
4
+ data.tar.gz: e9d2a88eecd47de32271886639d714d96929a17b
5
+ SHA512:
6
+ metadata.gz: 783c0484023752e6d6add993a604ab3135aa94529827e95ab2081397fe2ce85e17980e1e1d26c8f6d710625f9cf625371bbf0afa930e07a9c2fe555f8fc8a42a
7
+ data.tar.gz: 83d4ea228401bae82284536568b8e53a7d9ea1d197e1a09981624b5c7e8a5c20e6e1c9cf8374c66fbfa0000285a8b12553676fb0c4d937136f76f5ba43a06a4a
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .byebug_history
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fezinha_generator.gemspec
4
+ gemspec
5
+
6
+ gem 'byebug'
7
+ gem 'nokogiri'
data/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # 📿 FézinhaGenerator
2
+
3
+ Gerador de fézinha
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'fezinha_generator'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install fezinha_generator
20
+
21
+ ## Usage
22
+
23
+ Grab the latest lotery winning 6 numbers
24
+
25
+ ` FezinhaGenerator.resultado
26
+ ` => "04 08 29 38 49 50"
27
+ Returns the latest six winning numbers in a string format.
28
+
29
+ Generate six numbers for lotery bet
30
+
31
+ ` FezinhaGenerator.fezinha
32
+ ` => [22, 27, 28, 33, 47, 51]
33
+ Returns the default 6 numbers bet in an array format.
34
+
35
+ ` FezinhaGenerator.fezinha_to_s
36
+ ` => "1 5 24 29 32 60"
37
+ Returns the default 6 numbers bet in a string.
38
+
39
+ Generate N numbers for lotery bet
40
+ ` FezinhaGenerator.fezinha 8
41
+ ` => [1, 3, 4, 9, 11, 30, 49, 59]
42
+ ` FezinhaGenerator.fezinha_to_s 10
43
+ ` => "6 18 26 27 30 35 36 40 51 56"
44
+
45
+ ## Development
46
+
47
+ 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.
48
+
49
+ 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).
50
+
51
+ ## Contributing
52
+
53
+ Bug reports and pull requests are welcome on GitHub at https://github.com/brenodamata/fezinha_generator.
54
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "fezinha_generator"
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
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'fezinha_generator/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "fezinha_generator"
8
+ spec.version = FezinhaGenerator::VERSION
9
+ spec.authors = ["brenodamata"]
10
+ spec.email = ["bjrdamata@gmail.com"]
11
+
12
+ spec.summary = %q{Gerador de fézinha}
13
+ spec.description = %q{Gera numeros para apostas na megasena}
14
+ spec.homepage = "https://www.github.com/brenodamata/#{spec.name}"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.11"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ end
@@ -0,0 +1,38 @@
1
+ require "fezinha_generator/version"
2
+ require 'byebug'
3
+ require "nokogiri"
4
+ require 'open-uri'
5
+
6
+ module FezinhaGenerator
7
+
8
+ def self.fezinha aposta=nil
9
+ if aposta.nil?
10
+ tamanho_da_fe = 6 # default menor possivel
11
+ else
12
+ tamanho_da_fe = aposta
13
+ end
14
+
15
+ fezinha = []
16
+ while fezinha.size < tamanho_da_fe do
17
+ bola = rand(1..60)
18
+ fezinha << bola unless fezinha.include?(bola)
19
+ end
20
+ fezinha.sort
21
+ end
22
+
23
+ def self.fezinha_to_s aposta=nil
24
+ self.fezinha(aposta).join(" ")
25
+ end
26
+
27
+ def self.resultado
28
+ get_results[:concurso][:numeros_sorteados].join(" ")
29
+ end
30
+
31
+ protected
32
+
33
+ def self.get_results
34
+ doc = Nokogiri::HTML(open("http://developers.agenciaideias.com.br/loterias/megasena/json"))
35
+ string = doc.children.children.children.children.first.content
36
+ eval(string)
37
+ end
38
+ end
@@ -0,0 +1,3 @@
1
+ module FezinhaGenerator
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fezinha_generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - brenodamata
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-03-29 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.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
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
+ description: Gera numeros para apostas na megasena
42
+ email:
43
+ - bjrdamata@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - README.md
51
+ - Rakefile
52
+ - bin/console
53
+ - bin/setup
54
+ - fezinha_generator.gemspec
55
+ - lib/fezinha_generator.rb
56
+ - lib/fezinha_generator/version.rb
57
+ homepage: https://www.github.com/brenodamata/fezinha_generator
58
+ licenses: []
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubyforge_project:
76
+ rubygems_version: 2.4.6
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: Gerador de fézinha
80
+ test_files: []