upc_gen 0.0.1 → 0.0.2

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: 86d988762d7b0cec64aaba45d37446f9baaa51ee52ddf93fd46f14743a851161
4
- data.tar.gz: b8d85cded9622e547d0afb48868bdcf8be0186846d351b0af1b868d975464ec8
3
+ metadata.gz: 7b17879a6472555c7f49860082ec16180efc0ddeefa372f37b041464f75d0a6e
4
+ data.tar.gz: 8b208d0fad9c7d34b2ffbadd9c196cbc0638293cc94345b3d549f87332ad7e5b
5
5
  SHA512:
6
- metadata.gz: c4b3fd02825165a9baf19053ed73a6b8849103b329c4f3ff8c444c83886cabd80b2db87f32db5ac79b660132d3534a303b7d4ba73bb80137f1c4bcb27c2c3518
7
- data.tar.gz: 48c79b7f44ebd7eaca452f2afd3205eab5b92f4f7203929d648dc0fe32e40ce34aaaaedbbc8228b5bed224a1244879552020679c2aef87c8b4f9a412f62e53f2
6
+ metadata.gz: 2e3700d5a596218846ecec4f2f418d4de349d2f6349e9c478cc3db287bb85c8402ae9ff456dab42924f15b3e77aad7184a0356ef097f0a11cb3774833479bf65
7
+ data.tar.gz: 4a1a7317ef4c0e5ab93cc4fe8389c25f5c5f11e5fd5c0f3449b5cecd83789bf30c795824496c740d1c696da9cbda548768e7599843318e126ab1430467d9eabd
data/README.md CHANGED
@@ -1,28 +1,26 @@
1
1
  # UpcGen
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/upc_gen`. 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
+ Command line utility that prints a random UPC code
6
4
 
7
5
  ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'upc_gen'
13
- ```
14
-
15
- And then execute:
7
+ The gem will provide the `upc_gen` command when you `gem install upc_gen` on your system.
16
8
 
17
- $ bundle install
18
-
19
- Or install it yourself as:
9
+ ## Usage
20
10
 
21
- $ gem install upc_gen
11
+ Run on command line like `upc_gen <optional-number-string><optional-char>`
22
12
 
23
- ## Usage
13
+ - If a number string is passed, the code before the check digit will end with those digits
14
+ - If the string of numbers is followed by a '.', the random code will start with those digits
15
+ - If the string of numbers is followed by a '-', a code will be found that ends with those digits, including check digit
24
16
 
25
- TODO: Write usage instructions here
17
+ Examples:
18
+ >: upc_gen 001234
19
+ 2938210012347
20
+ >: upc_gen 001234.
21
+ 0012348367936
22
+ >: upc_gen 001234-
23
+ 4493664001234
26
24
 
27
25
  ## Development
28
26
 
@@ -1,6 +1,4 @@
1
- #!/usr/bin/env bundle exec ruby
2
- # This script can only be run from elsewhere if BUNDLE_GEMFILE of this project
3
- # has been set.
1
+ #!/usr/bin/env ruby
4
2
 
5
3
  require 'upc_gen'
6
4
  UpcGen::Shell.start(ARGV)
@@ -3,7 +3,7 @@ require 'optparse'
3
3
  module UpcGen
4
4
  class Shell
5
5
  BANNER = <<"EOT"
6
- usage: #{$0} <optional-number-string><optional-dot>
6
+ usage: #{$0} <optional-number-string><optional-char>
7
7
 
8
8
  Prints a random UPC code
9
9
 
@@ -1,3 +1,3 @@
1
1
  module UpcGen
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: upc_gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom ten Thij