shufflino 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b292f18ace326fb263ad97ca292d2e64d2dc1efa7fd0a362b9dfd979cfa851d
4
- data.tar.gz: b339de49479966abc63f5de208632b153bffc93fd5460a6f035cd4e8351ecb58
3
+ metadata.gz: 055a7e285d85a35ea1419927b9484b6991eaf7032d759338c206f0e48f0ab2ae
4
+ data.tar.gz: 73c54fa867ae235217cda1beb87d582498bc959772686af4847a6424644687cb
5
5
  SHA512:
6
- metadata.gz: fe2251fb7803926c731310d2533903c68f839cae66792c354332ab03ed809b300f0da1fcd10f6a45858f15cfa9ffc0b2d0a813e85cb0eaa0955b1c5e1da673df
7
- data.tar.gz: a7609ff5ec117bdc6351cfe0715436bb32d9b3e0c7b2e41849fbe7b2949f98be6c09e931f761054e22e36203f6c71cd10e8ad159f33adbb83400beea04197a45
6
+ metadata.gz: e655bd0247e8ad985978acbb5f06b39888079c67e0efdcb29ac1dcc43c73d3710e653569c21879d6ba06b23664f653d29f0b493764638ee05fc83c1c85114d77
7
+ data.tar.gz: 4ac23d05d2ea34a7dc8f0a622916b8eca97c4f418c922fad05f0fd0b45ee950cf8ae9a6deb94936e929ce87370be6d056360d7f22fad50a7cb59552fc48dc8dc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shufflino (0.1.1)
4
+ shufflino (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/Makefile CHANGED
@@ -2,13 +2,18 @@ test:
2
2
  rake test
3
3
 
4
4
  build:
5
- rm pkg/*.gem
5
+ - rm pkg/*.gem
6
6
  rake build
7
7
 
8
8
  publish:
9
9
  gem push pkg/*.gem
10
10
  rm pkg/*.gem
11
11
 
12
+ console:
13
+ bin/console
14
+
15
+ c: console
16
+
12
17
  push:
13
18
  git push origin master
14
19
 
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Shufflino
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/shufflino`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Generates random-looking like strings from shuffled seed arrays
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,13 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ ```
24
+ seeds = [[:f, :m, :e, :W], [:U, :t, 3, :Q], [9, :S, :j, :w]]
25
+ shufflino = Shufflino::Core.new(seeds)
26
+ shufflino.generate(0) # =>"fU9"
27
+ shufflino.generate(63) # => "WQw"
28
+ shufflino.generate(64) # Raises error (Not enough seeds)
29
+ ```
26
30
 
27
31
  ## Development
28
32
 
@@ -32,12 +36,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
36
 
33
37
  ## Contributing
34
38
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/shufflino. 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.
39
+ Bug reports and pull requests are welcome on GitHub at https://github.com/inem/shufflino. 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.
36
40
 
37
41
  ## License
38
42
 
39
43
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
-
41
- ## Code of Conduct
42
-
43
- Everyone interacting in the Shufflino project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/shufflino/blob/master/CODE_OF_CONDUCT.md).
@@ -1,3 +1,3 @@
1
1
  module Shufflino
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/shufflino.rb CHANGED
@@ -6,7 +6,11 @@ module Shufflino
6
6
 
7
7
  class Core
8
8
  def initialize(seeds)
9
- @seeds = seeds
9
+ if seeds.first.is_a? Array
10
+ @seeds = seeds
11
+ elsif seeds.first.is_a? String
12
+ @seeds = seeds.map {|s| s.split("") }
13
+ end
10
14
 
11
15
  raise "Empty seeds array" if seeds.empty?
12
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shufflino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nemytchenko