bxm 0.2.2 → 0.2.3

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
  SHA1:
3
- metadata.gz: 6f422a2b790e18acba1d739d891bc3e1049b97fc
4
- data.tar.gz: 896214b3ba6717071db71b6b4c4a4564ef29b2cc
3
+ metadata.gz: 2ca91ced83a4b165fa9ab38ce05404bf6e6f42f6
4
+ data.tar.gz: c84d3198ab8d9339fbf99d40aafac5f4ff6e1ece
5
5
  SHA512:
6
- metadata.gz: 416b7a17a2a9f341ca11dcde6f9435454a54290525777e8e83c1b611935377488e3094c808c17521b7736fade7ba2c0a6782082e67a179fd1cae90a73cbaafc1
7
- data.tar.gz: '0338aa702cb5adadd6e2f52c1c4611efc71218e5cc80ad5c0d21d81f62dcbbfa689a8000dda8356a04ced62efcd2e550c5ff6f6e6f1f4f5ce179a333a1a53dee'
6
+ metadata.gz: 76c636e702d2b58fe3aeac834ba6a6d1475dafdc238794494177d590225b0fe3781d299742178526feb3ba323a99a95bf64a7f708a0e4e1879044cd6337e0489
7
+ data.tar.gz: c682cfb9ec4bbb9595f7829a77bbf5eecd5f8f248cf4f64f34232e1a7777c98a39be600ab7f12e5033da87045f5bf823ef6fca1ea8672de9bf8952bf18655c1a
data/README.md CHANGED
@@ -29,11 +29,11 @@ from some of the most common words used in the english language
29
29
  current version only supports english but a plan to support other languages will be available in the future
30
30
  Example:
31
31
  Bxm::Password.rand_key(4,words)
32
- => "74CloudRedRedRed"
32
+ => "74-Cloud-Red-Red-Red"
33
33
  Bxm::Password.rand_key(4,palabras)
34
- => "57SemanaCasoEstupendoHecho"
34
+ => "57-Semana-Caso-Estupendo-Hecho"
35
35
  Bxm::Password.rand_key(4,wort)
36
- => "90RegierungHandWocheAuge"
36
+ => "90-Regierung-Hand-Woche-Auge"
37
37
 
38
38
  ## Development
39
39
 
data/lib/bxm.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'rest-client'
2
1
  require 'csv'
3
2
  require 'yaml'
4
3
 
@@ -9,18 +8,19 @@ module Bxm
9
8
  # current version only supports english but a plan to support other languages will be available in the future
10
9
  # Example:
11
10
  # Bxm::Password.rand_key(4,words)
12
- # => "74CloudRedRedRed"
11
+ # => "50-Joshua-Thing-Work-First"
13
12
  # Bxm::Password.rand_key(4,palabras)
14
- # => "57SemanaCasoEstupendoHecho"
15
- # Bxm::Password.rand_key(4,wort)
16
- # => "90RegierungHandWocheAuge"
13
+ # => "86-Joseph-Diferente-Gran-Siguiente"
14
+ # Bxm::Password.rand_key(4,worts)
15
+ # => "69-Harry-Alt-Arbeiten-Weg"
17
16
  #
18
17
  class Password
19
- def self.rand_key(n=1,leng='words',name='names')
18
+ def self.rand_key(n=1,leng='words', special=false)
20
19
 
21
20
  lib = File.expand_path(File.dirname(__FILE__), "words.csv")
22
21
  wrds=CSV.read(lib+"/#{leng}.csv")
23
- nms=CSV.read(lib+"/#{name}.csv")
22
+ nms=CSV.read(lib+"/names.csv")
23
+ spcl=CSV.read(lib+"/special.csv")
24
24
 
25
25
  super_key = [*('0'..'9')].shuffle[0,2].join
26
26
  super_key = super_key + '-' + [*(nms)].shuffle[0,1].join.capitalize
@@ -28,7 +28,15 @@ module Bxm
28
28
  for i in 2..n
29
29
  super_key = super_key + '-' + [*(wrds)].shuffle[0,1].join.capitalize
30
30
  end
31
- return super_key
31
+
32
+ if special == true
33
+ for b in 1..n
34
+ super_key = super_key.sub! '-', [*(spcl)].shuffle[0,1].join
35
+ end
36
+ return super_key
37
+ else
38
+ return super_key
39
+ end
32
40
  end
33
41
  end
34
42
  end
@@ -2,5 +2,5 @@ module Bxm
2
2
  require 'rest-client'
3
3
  require 'csv'
4
4
  require 'yaml'
5
- VERSION = "0.2.2"
5
+ VERSION = "0.2.3"
6
6
  end
@@ -7,4 +7,20 @@ Matthew
7
7
  James
8
8
  Joseph
9
9
  Harry
10
- Samuel
10
+ Samuel
11
+ Santiago
12
+ Matias
13
+ Sebastian
14
+ Mateo
15
+ Nicolas
16
+ Alejandro
17
+ Samuel
18
+ Diego
19
+ Mia
20
+ Emma
21
+ Sofia
22
+ Hannah
23
+ Emilia
24
+ Anna
25
+ Marie
26
+ Mila
@@ -0,0 +1,23 @@
1
+ !
2
+ @
3
+ #
4
+ $
5
+ %
6
+ ^
7
+ &
8
+ *
9
+ (
10
+ )
11
+ _
12
+ -
13
+ =
14
+ +
15
+ ~
16
+ {
17
+ }
18
+ |
19
+ \
20
+ /
21
+ ?
22
+ >
23
+ <
data/server.rb CHANGED
@@ -18,6 +18,9 @@ opt_parser = OptionParser.new do |opt|
18
18
  options[:complexity] = complexity
19
19
  end
20
20
 
21
+ opt.on("-sc SPECIAL CHARACTERS","--special-characters SPECIAL CHARACTERS",String,"If you want special characters") do |specialChar|
22
+ options[:specialChar] = specialChar
23
+ end
21
24
  end
22
25
 
23
26
  opt_parser.parse!
@@ -28,13 +31,19 @@ else
28
31
  @times = options[:complexity].to_i
29
32
  end
30
33
 
34
+ if options[:specialChar] == nil
35
+ @specialChar = false
36
+ else
37
+ @specialChar = true
38
+ end
39
+
31
40
  case ARGV[0]
32
41
  when "password"
33
- STDOUT.puts Bxm::Password.rand_key(@times).to_s
42
+ STDOUT.puts Bxm::Password.rand_key(@times,"words",@specialChar).to_s
34
43
  when "palabras"
35
- STDOUT.puts Bxm::Password.rand_key(@times,"palabras").to_s
44
+ STDOUT.puts Bxm::Password.rand_key(@times,"palabras",@specialChar).to_s
36
45
  when "worts"
37
- STDOUT.puts Bxm::Password.rand_key(@times,"worts").to_s
46
+ STDOUT.puts Bxm::Password.rand_key(@times,"worts",@specialChar).to_s
38
47
  else
39
48
  puts opt_parser
40
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bxm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - alejandro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-19 00:00:00.000000000 Z
11
+ date: 2017-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -92,6 +92,7 @@ files:
92
92
  - lib/bxm/version.rb
93
93
  - lib/names.csv
94
94
  - lib/palabras.csv
95
+ - lib/special.csv
95
96
  - lib/words.csv
96
97
  - lib/worts.csv
97
98
  - server.rb