ruta_destroy 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c92aa9518247f8db3a0a8b29e3ebfced3be7c600
4
+ data.tar.gz: 1e00113f95c16b8635fe077827ea269a75ff4d86
5
+ SHA512:
6
+ metadata.gz: 4e6b3efde970a8dea8129d7674fcbb5eee3ff62f90e5fc8e41cba1b861888fa3ddd02b7ee3b712aeaff8308bd385db642b4c48e8d95f93ecd47e757713a1a54b
7
+ data.tar.gz: b88f8f906a9bf07d73d1f64df3877167ca6f4a25e736b8693e85cafd00a77c691fe1d4c145e58eb922be0bfd8ac0f710eaf5a6e76f3dcec039362a3f0d360245
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+
4
+ Style/StringLiterals:
5
+ EnforcedStyle: double_quotes
6
+
7
+ Documentation:
8
+ Enabled: false
9
+
10
+ Style/RegexpLiteral:
11
+ Enabled: false
12
+
13
+ Metrics/LineLength:
14
+ Max: 90
data/.travis.yml ADDED
@@ -0,0 +1,18 @@
1
+ language: ruby
2
+ cache: bundler
3
+
4
+ rvm:
5
+ - 2.2.0
6
+ - 2.1.2
7
+ - 2.1.0
8
+ - 2.0.0
9
+ - 1.9.3
10
+
11
+ script: 'bundle exec rake'
12
+
13
+ notifications:
14
+ email:
15
+ on_failure: change
16
+ on_success: never
17
+ slack:
18
+ secure: j0pMnM5JiBxiNsFf1n4DtsNSSkmaSW6w8KRy9D5V0ArxPEr7GdlAVfmsgqFIsOCEnm7CvREvUDGEQqx2Y9oIUxjxtnKYhQgru+DG+dONZQIEtOyRGL4UQKYDms/843DnXKuHuFUVeAu7alL9sKFTXFqaVT/r+YRk79cGt4vdfYg=
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in ruta_destroy.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Usman Bashir
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # Ruta Destroy
2
+ forked from [Haikunator](https://github.com/usmanbashir/haikunator)
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/ruta_destroy.svg)](http://badge.fury.io/rb/ruta_destroy)
5
+ [![Build Status](https://travis-ci.org/demipel8/ruta_destroy.svg?branch=master)](https://travis-ci.org/demipel8/ruta_destroy)
6
+ [![Coverage Status](https://coveralls.io/repos/demipel8/ruta_destroy/badge.svg)](https://coveralls.io/r/demipel8/ruta_destroy)
7
+
8
+ Generate Heroku-like memorable random names to use in your apps or anywhere else with names from ruta destroy.
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ gem 'ruta_destroy'
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install ruta_destroy
23
+
24
+ ## Usage
25
+
26
+ Ruta destroy is pretty simple. There is nothing to configure and it only has a single method, `.sesion`:
27
+
28
+ ```ruby
29
+ RutaDestroy.sesion # => "LuisBonias-Penelope-3014"
30
+
31
+ # Token range
32
+ RutaDestroy.sesion(100) # => "RafaMarco-Bananas-47"
33
+
34
+ # Don't include the token
35
+ RutaDestroy.sesion(0) # => "CarlosSimo-Bodegón"
36
+
37
+ # Use a different delimiter
38
+ RutaDestroy.sesion(9999, '.') # => "LuisBonías.Penelope.4214"
39
+
40
+ # No token, no delimiter
41
+ RutaDestroy.sesion(0, ' ') # => "PacoPil Distrito10"
42
+ ```
43
+
44
+ ## Contributing
45
+
46
+ Everyone is encouraged to help improve this project. Here are a few ways you can help:
47
+
48
+ - [Report bugs](https://github.com/demipel8/ruta_destroy/issues)
49
+ - Fix bugs and [submit pull requests](https://github.com/demipel8/ruta_destroy/pulls)
50
+ - Write, clarify, or fix documentation
51
+ - Suggest or add new features
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "rake"
2
+ require "bundler/gem_tasks"
3
+
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,50 @@
1
+ require_relative "ruta_destroy/version"
2
+ require "securerandom"
3
+
4
+ module RutaDestroy
5
+ class << self
6
+ def sesion(token_range = 9999, delimiter = "-")
7
+ build(token_range, delimiter)
8
+ end
9
+
10
+ private
11
+
12
+ def build(token_range, delimiter)
13
+ sections = [
14
+ artists[random_seed % artists.length],
15
+ discos[random_seed % discos.length],
16
+ token(token_range)
17
+ ]
18
+
19
+ sections.compact.join(delimiter)
20
+ end
21
+
22
+ def random_seed
23
+ SecureRandom.random_number(4096)
24
+ end
25
+
26
+ def token(range)
27
+ SecureRandom.random_number(range) if range > 0
28
+ end
29
+
30
+ def artists
31
+ %w(
32
+ PacoPil ChimoBayo ToniVidal CarlosSimo JuanitoTorpedo
33
+ FranLenaers DjTete CarlosRufian RafaMarco RafaPastor
34
+ JoséLuiselNano LuisBonías ArturoWitten VicenteMafia
35
+ QuiqueyJuanjoSerrano JesúsBrisa LuisBonias LosGemelos
36
+ Ganimedes ArturoRoger DJJosel KikeJaen DjNino
37
+ )
38
+ end
39
+
40
+ def discos
41
+ %w(
42
+ Barraca Spook Factory Chocolate Espiral NOD Puzzle ACTV OTK
43
+ Zona Rockola Tuculca Heaven Arena Distrito10 Arabesco Bananas
44
+ TheFace JardinesDelReal Woody Aquarela Bodegón GiorgioAndEnrico
45
+ ElTemplo CaballitodeMar Apache Penelope ChivagoRivers KuManises
46
+ Sucre Coliseum
47
+ )
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,3 @@
1
+ module RutaDestroy
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "ruta_destroy/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ruta_destroy"
8
+ spec.version = RutaDestroy::VERSION
9
+ spec.authors = ["Demi"]
10
+ spec.email = ["demipel8@gmail.com"]
11
+ spec.summary = "Heroku-like random name generator for Ruta Destroy names."
12
+ spec.description = "Generate memorable random names to use in your apps"\
13
+ " or anywhere else. Remember la ruta destroy while working"
14
+ spec.homepage = "https://github.com/demipel8/ruta_destroy"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0")
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "rspec"
24
+ spec.add_development_dependency "coveralls"
25
+ end
@@ -0,0 +1,40 @@
1
+ require_relative "../spec_helper"
2
+
3
+ describe RutaDestroy do
4
+ it "generates a name like still-silence-5012" do
5
+ name = RutaDestroy.sesion
6
+
7
+ expect(name).to match(/\A\w+-\w+-\d{1,4}\z/)
8
+ end
9
+
10
+ it "won't return the same name for subsequent calls" do
11
+ name1 = RutaDestroy.sesion
12
+ name2 = RutaDestroy.sesion
13
+
14
+ expect(name1).not_to eql(name2)
15
+ end
16
+
17
+ it "permits optional configuration of the token range" do
18
+ name = RutaDestroy.sesion(9)
19
+
20
+ expect(name).to match(/-\d{1}\z/)
21
+ end
22
+
23
+ it "drops the token if token range is 0" do
24
+ name = RutaDestroy.sesion(0)
25
+
26
+ expect(name).to match(/\A\w+-\w+\z/)
27
+ end
28
+
29
+ it "permits optional configuration of the delimiter" do
30
+ name = RutaDestroy.sesion(9999, ".")
31
+
32
+ expect(name).to match(/\A\w+\.\w+\.\d{1,4}\z/)
33
+ end
34
+
35
+ it "drops the token and delimiter if token range is 0 and delimiter empty space" do
36
+ name = RutaDestroy.sesion(0, " ")
37
+
38
+ expect(name).to match(/\A\w+ \w+\z/)
39
+ end
40
+ end
@@ -0,0 +1,23 @@
1
+ require "coveralls"
2
+ Coveralls.wear!
3
+
4
+ require "ruta_destroy"
5
+
6
+ RSpec.configure do |config|
7
+ config.expect_with :rspec do |expectations|
8
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
9
+ end
10
+
11
+ config.mock_with :rspec do |mocks|
12
+ mocks.verify_partial_doubles = true
13
+ end
14
+
15
+ # Use the specified formatter
16
+ config.formatter = :documentation
17
+
18
+ # Print top 2 slowest examples
19
+ config.profile_examples = 2
20
+
21
+ # Run specs in random order
22
+ config.order = :random
23
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruta_destroy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Demi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-10-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: coveralls
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
+ description: Generate memorable random names to use in your apps or anywhere else.
56
+ Remember la ruta destroy while working
57
+ email:
58
+ - demipel8@gmail.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".coveralls.yml"
64
+ - ".gitignore"
65
+ - ".rspec"
66
+ - ".rubocop.yml"
67
+ - ".travis.yml"
68
+ - Gemfile
69
+ - LICENSE.txt
70
+ - README.md
71
+ - Rakefile
72
+ - lib/ruta_destroy.rb
73
+ - lib/ruta_destroy/version.rb
74
+ - ruta_destroy.gemspec
75
+ - spec/lib/ruta_destroy_spec.rb
76
+ - spec/spec_helper.rb
77
+ homepage: https://github.com/demipel8/ruta_destroy
78
+ licenses:
79
+ - MIT
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.6.13
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Heroku-like random name generator for Ruta Destroy names.
101
+ test_files:
102
+ - spec/lib/ruta_destroy_spec.rb
103
+ - spec/spec_helper.rb