xkpassword 0.6.0 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8679b970d4279654ff7aa2f1212267bd2874466af8adfb197d4005dd94fb62a
4
- data.tar.gz: 46877ecf578b62ced17e1ba35c8463387c34676d15cf301e8de5188af7619a79
3
+ metadata.gz: fdff2f4fcb5e0c775d3d8581385a5e350daca4b3a1be10901de8839969030b19
4
+ data.tar.gz: 54a97217ed32f945ee871a652238114ececfa9350fd10c66781b371329cc1beb
5
5
  SHA512:
6
- metadata.gz: 512d12534d4a4d0072dfb2581f98c7b9e1464647739b7b508cea5e3fb4e9ab972158d3b4ffa58fafc12f1a904ddc369b308ec33d57a32355b29028e2424d5476
7
- data.tar.gz: '0828510166c54f05316e349a0187aee1d9fd49acf19ee4d8fd970309c938e9a0cb2a06390436f32788a87dc2e71a3cbc23aaf31d82dff868340b45dbd3244a38'
6
+ metadata.gz: ee8ca201d276a89ba1943a0e73ab647c9bb376d8d94d11c8aa0c6fbf183de85c915556007e4a8873335562906ddc141bab98497d1d506032325e5dec0dd5e80d
7
+ data.tar.gz: d79edd75630888c69445da8c9b01345e0c3398b5afb8ee8538ea1493d19c9c964b0c75ef00265c7ee8256dfb3a48dbbe401ecb3b98af01a35e9bb6adf923294a
data/.rubocop.yml ADDED
@@ -0,0 +1,21 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ SuggestExtensions: false
4
+ TargetRubyVersion: 3.3
5
+
6
+ Gemspec/AddRuntimeDependency:
7
+ Enabled: false
8
+
9
+ Gemspec/DevelopmentDependencies:
10
+ Enabled: false
11
+
12
+ Metrics/AbcSize:
13
+ Max: 21
14
+
15
+ Metrics/BlockLength:
16
+ Exclude:
17
+ - 'spec/**/*'
18
+ - 'xkpassword.gemspec'
19
+
20
+ Style/Documentation:
21
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,13 +1,7 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
  rvm:
3
- - 2.3.8
4
- - 2.4.9
5
- - 2.5.8
6
- - 2.6.6
7
- - 2.7.2
8
- - 3.0.0
9
- before_install: gem install bundler
4
+ - '3.3'
5
+ - '3.4'
6
+ - '4.0'
10
7
  script: bundle exec rspec
11
- addons:
12
- code_climate:
13
- repo_token: 1a754006a15f983b39ddc25c65543fab4a956a4ff607a636e135415c5350e4e0
data/Gemfile CHANGED
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in xkpassword.gemspec
4
6
  gemspec
5
7
 
6
8
  group :development do
7
- gem 'yard'
8
9
  gem 'pry'
9
10
  gem 'rubocop', require: false
11
+ gem 'yard'
10
12
  end
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/xkpassword.svg)](https://badge.fury.io/rb/xkpassword)
2
- [![Build Status](https://travis-ci.org/jdeen/xkpassword.svg?branch=master)](https://travis-ci.org/jdeen/xkpassword)
2
+ [![Build Status](https://app.travis-ci.com/jdeen/xkpassword.svg?branch=master)](https://app.travis-ci.com/jdeen/xkpassword)
3
3
  [![Inline docs](http://inch-ci.org/github/jdeen/xkpassword.svg?branch=master)](http://inch-ci.org/github/jdeen/xkpassword)
4
4
  [![Code Climate](https://codeclimate.com/github/jdeen/xkpassword/badges/gpa.svg)](https://codeclimate.com/github/jdeen/xkpassword)
5
5
 
@@ -29,8 +29,8 @@ it.
29
29
 
30
30
  ## Installation
31
31
 
32
- Developed in Linux/Ubuntu, this should work fine on Linux machines. I cannot say
33
- the same is true with Mac or Windows systems.
32
+ The gem currently supports the Ruby release series that Ruby core still maintains:
33
+ Ruby 3.3, Ruby 3.4, and Ruby 4.0.
34
34
 
35
35
  Add this line to your application's Gemfile:
36
36
 
@@ -148,6 +148,8 @@ The default `:xkcd` preset keeps the gem's original behavior of generating 4 wor
148
148
  `case_transform` supports `:upcase`, `:downcase`, and `:capitalize`, and applies the
149
149
  selected transform to every generated word in the password.
150
150
 
151
+ Word lengths, words, and random uppercasing are all chosen with Ruby's `SecureRandom`.
152
+
151
153
  ## The GEM
152
154
 
153
155
  Releases are intended for functional updates such as new features and bug fixes.
@@ -155,7 +157,7 @@ Check the Git tags or RubyGems release history for the latest published version.
155
157
 
156
158
  ## Development
157
159
 
158
- After checking out the repo, run `bin/setup` to install dependencies. You can also run
160
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run
159
161
  `bin/console` for an interactive prompt that will allow you to experiment.
160
162
 
161
163
  To install this gem onto your local machine, run `bundle exec rake install`. To release
data/Rakefile CHANGED
@@ -1,2 +1,4 @@
1
- require "bundler/gem_tasks"
2
- task :default => :spec
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ task default: :spec
data/bin/console CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "bundler/setup"
4
- require "xkpassword"
4
+ require 'bundler/setup'
5
+ require 'xkpassword'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "xkpassword"
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require "irb"
14
+ require 'irb'
14
15
  IRB.start
@@ -5,7 +5,8 @@ require 'psych'
5
5
  module XKPassword
6
6
  # Loads and initializes the CLI config file stored at ~/.xkpassword.
7
7
  class ConfigFile
8
- Error = Class.new(StandardError)
8
+ class Error < StandardError
9
+ end
9
10
 
10
11
  ALLOWED_OPTIONS = %i[
11
12
  preset
@@ -1,159 +1,163 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'securerandom'
1
4
  require 'xkpassword/words'
2
5
 
3
6
  # The Generator class which finds words based on the requirement and using the provided options to build a
4
7
  # new random passowrd.
5
8
  # Presets provide convenient defaults for common password styles, and callers can override any
6
9
  # preset-derived value by passing explicit generation options.
7
- #
10
+ #
8
11
  # @attr_reader [XKPassword::Words] words A word database that gen provide you words for the length required
9
- class XKPassword::Generator
10
- # The preset used when `:preset` is omitted.
11
- DEFAULT_PRESET = :xkcd
12
-
13
- # Built-in password presets.
14
- #
15
- # - `:xkcd` generates 4 words between 4 and 8 letters separated by `-`, preserving the gem's
16
- # original default behavior.
17
- # - `:web32` generates 4 shorter words between 4 and 5 letters separated by `-`.
18
- # - `:wifi` generates 6 words between 4 and 8 letters separated by `-`.
19
- # - `:security` generates 6 lowercase words between 4 and 8 letters separated by spaces.
20
- # - `:apple_id` generates 3 words between 4 and 7 letters separated by `-`.
21
- PRESETS = {
22
- xkcd: {
23
- case_transform: nil,
24
- max_length: 8,
25
- min_length: 4,
26
- separator: '-',
27
- words: 4,
28
- },
29
- web32: {
30
- case_transform: nil,
31
- max_length: 5,
32
- min_length: 4,
33
- separator: '-',
34
- words: 4,
35
- },
36
- wifi: {
37
- case_transform: nil,
38
- max_length: 8,
39
- min_length: 4,
40
- separator: '-',
41
- words: 6,
42
- },
43
- security: {
44
- case_transform: :downcase,
45
- max_length: 8,
46
- min_length: 4,
47
- separator: ' ',
48
- words: 6,
49
- },
50
- apple_id: {
51
- case_transform: nil,
52
- max_length: 7,
53
- min_length: 4,
54
- separator: '-',
55
- words: 3,
56
- },
57
- }
58
- VALID_CASE_TRANSFORMS = [:upcase, :downcase, :capitalize]
59
-
60
- attr_reader :words
61
-
62
- def initialize
63
- @words = XKPassword::Words.new
64
- end
12
+ module XKPassword
13
+ class Generator
14
+ # The preset used when `:preset` is omitted.
15
+ DEFAULT_PRESET = :xkcd
16
+
17
+ # Built-in password presets.
18
+ #
19
+ # - `:xkcd` generates 4 words between 4 and 8 letters separated by `-`, preserving the gem's
20
+ # original default behavior.
21
+ # - `:web32` generates 4 shorter words between 4 and 5 letters separated by `-`.
22
+ # - `:wifi` generates 6 words between 4 and 8 letters separated by `-`.
23
+ # - `:security` generates 6 lowercase words between 4 and 8 letters separated by spaces.
24
+ # - `:apple_id` generates 3 words between 4 and 7 letters separated by `-`.
25
+ PRESETS = {
26
+ xkcd: {
27
+ case_transform: nil,
28
+ max_length: 8,
29
+ min_length: 4,
30
+ separator: '-',
31
+ words: 4
32
+ },
33
+ web32: {
34
+ case_transform: nil,
35
+ max_length: 5,
36
+ min_length: 4,
37
+ separator: '-',
38
+ words: 4
39
+ },
40
+ wifi: {
41
+ case_transform: nil,
42
+ max_length: 8,
43
+ min_length: 4,
44
+ separator: '-',
45
+ words: 6
46
+ },
47
+ security: {
48
+ case_transform: :downcase,
49
+ max_length: 8,
50
+ min_length: 4,
51
+ separator: ' ',
52
+ words: 6
53
+ },
54
+ apple_id: {
55
+ case_transform: nil,
56
+ max_length: 7,
57
+ min_length: 4,
58
+ separator: '-',
59
+ words: 3
60
+ }
61
+ }.freeze
62
+ VALID_CASE_TRANSFORMS = %i[upcase downcase capitalize].freeze
63
+
64
+ attr_reader :words
65
+
66
+ def initialize
67
+ @words = XKPassword::Words.new
68
+ end
65
69
 
66
- # Generates a password absed on the configuration provided.
67
- # A preset supplies a base configuration and any explicit options passed in `options` override
68
- # those preset defaults.
69
- #
70
- # @param [Hash] options The options to populate a generator
71
- # @option options [String, Symbol] :preset The preset to use. Supports `:xkcd`, `:web32`,
72
- # `:wifi`, `:security`, and `:apple_id`.
73
- # String values like `"apple_id"` and `"apple-id"`
74
- # are normalized to `:apple_id`. Defaults to `:xkcd`.
75
- # @option options [Integer] :words The number of words to include in the generated password
76
- # @option options [String] :separator The separator symbol to use joining words used in password
77
- # @option options [Integer] :min_length The minimum length of a word to be used in the process
78
- # @option options [Integer] :max_length The maximum length of a word to be used in the process
79
- # @option options [String, Symbol] :case_transform The transform to apply to every generated word
80
- #
81
- # @return [String] The generated password
82
- #
83
- # @example Using the default xkcd preset
84
- # generator = XKPassword::Generator.new
85
- # generator.generate
86
- #
87
- # @example Using the security preset
88
- # generator = XKPassword::Generator.new
89
- # generator.generate(preset: :security)
90
- #
91
- # @example Populating the method with a preset and explicit overrides
92
- # options = {
93
- # preset: :security,
94
- # separator: ' ',
95
- # words: 6,
96
- # min_length: 4,
97
- # max_length: 8,
98
- # case_transform: :downcase
99
- # }
100
- #
101
- # generator = XKPassword::Generator.new
102
- # generator.generate(options)
103
- #
104
- # @example Built-in preset defaults
105
- # :xkcd # 4 words, 4..8 letters, "-" separator, random per-word uppercasing
106
- # :web32 # 4 words, 4..5 letters, "-" separator, random per-word uppercasing
107
- # :wifi # 6 words, 4..8 letters, "-" separator, random per-word uppercasing
108
- # :security # 6 words, 4..8 letters, " " separator, lowercase
109
- # :apple_id # 3 words, 4..7 letters, "-" separator, random per-word uppercasing
110
- def generate(options = nil)
111
- options = (options || {}).dup
112
- preset = normalize_preset(options.delete(:preset))
113
- options = PRESETS.fetch(preset).merge(options)
114
- case_transform = normalize_case_transform(options[:case_transform])
115
- length_vals = (options[:min_length]..options[:max_length]).to_a
116
-
117
- data = options[:words].times.map do
118
- word = words.random(length_vals.sample)
119
- transform_word(word, case_transform)
70
+ # Generates a password absed on the configuration provided.
71
+ # A preset supplies a base configuration and any explicit options passed in `options` override
72
+ # those preset defaults.
73
+ #
74
+ # @param [Hash] options The options to populate a generator
75
+ # @option options [String, Symbol] :preset The preset to use. Supports `:xkcd`, `:web32`,
76
+ # `:wifi`, `:security`, and `:apple_id`.
77
+ # String values like `"apple_id"` and `"apple-id"`
78
+ # are normalized to `:apple_id`. Defaults to `:xkcd`.
79
+ # @option options [Integer] :words The number of words to include in the generated password
80
+ # @option options [String] :separator The separator symbol to use joining words used in password
81
+ # @option options [Integer] :min_length The minimum length of a word to be used in the process
82
+ # @option options [Integer] :max_length The maximum length of a word to be used in the process
83
+ # @option options [String, Symbol] :case_transform The transform to apply to every generated word
84
+ #
85
+ # @return [String] The generated password
86
+ #
87
+ # @example Using the default xkcd preset
88
+ # generator = XKPassword::Generator.new
89
+ # generator.generate
90
+ #
91
+ # @example Using the security preset
92
+ # generator = XKPassword::Generator.new
93
+ # generator.generate(preset: :security)
94
+ #
95
+ # @example Populating the method with a preset and explicit overrides
96
+ # options = {
97
+ # preset: :security,
98
+ # separator: ' ',
99
+ # words: 6,
100
+ # min_length: 4,
101
+ # max_length: 8,
102
+ # case_transform: :downcase
103
+ # }
104
+ #
105
+ # generator = XKPassword::Generator.new
106
+ # generator.generate(options)
107
+ #
108
+ # @example Built-in preset defaults
109
+ # :xkcd # 4 words, 4..8 letters, "-" separator, random per-word uppercasing
110
+ # :web32 # 4 words, 4..5 letters, "-" separator, random per-word uppercasing
111
+ # :wifi # 6 words, 4..8 letters, "-" separator, random per-word uppercasing
112
+ # :security # 6 words, 4..8 letters, " " separator, lowercase
113
+ # :apple_id # 3 words, 4..7 letters, "-" separator, random per-word uppercasing
114
+ def generate(options = nil)
115
+ options = (options || {}).dup
116
+ preset = normalize_preset(options.delete(:preset))
117
+ options = PRESETS.fetch(preset).merge(options)
118
+ case_transform = normalize_case_transform(options[:case_transform])
119
+ length_vals = (options[:min_length]..options[:max_length]).to_a
120
+
121
+ data = options[:words].times.map do
122
+ word = words.random(length_vals.sample(random: SecureRandom))
123
+ transform_word(word, case_transform)
124
+ end
125
+
126
+ data.join(options[:separator])
120
127
  end
121
-
122
- data.join(options[:separator])
123
- end
124
128
 
125
- private
129
+ private
126
130
 
127
- def transform_word(word, case_transform)
128
- return randomly_upcase(word) unless case_transform
131
+ def transform_word(word, case_transform)
132
+ return randomly_upcase(word) unless case_transform
129
133
 
130
- word.public_send(case_transform)
131
- end
134
+ word.public_send(case_transform)
135
+ end
132
136
 
133
- def randomly_upcase(word)
134
- upcase = [true, false].sample
135
- word = word.upcase if upcase
136
- word
137
- end
137
+ def randomly_upcase(word)
138
+ upcase = [true, false].sample(random: SecureRandom)
139
+ word = word.upcase if upcase
140
+ word
141
+ end
138
142
 
139
- def normalize_case_transform(case_transform)
140
- return nil if case_transform.nil?
143
+ def normalize_case_transform(case_transform)
144
+ return nil if case_transform.nil?
141
145
 
142
- case_transform = case_transform.to_sym if case_transform.is_a?(String)
146
+ case_transform = case_transform.to_sym if case_transform.is_a?(String)
143
147
 
144
- return case_transform if VALID_CASE_TRANSFORMS.include?(case_transform)
148
+ return case_transform if VALID_CASE_TRANSFORMS.include?(case_transform)
145
149
 
146
- fail ArgumentError, "case_transform should be one of: #{ VALID_CASE_TRANSFORMS.join(', ') }"
147
- end
150
+ raise ArgumentError, "case_transform should be one of: #{VALID_CASE_TRANSFORMS.join(', ')}"
151
+ end
148
152
 
149
- def normalize_preset(preset)
150
- return DEFAULT_PRESET if preset.nil?
153
+ def normalize_preset(preset)
154
+ return DEFAULT_PRESET if preset.nil?
151
155
 
152
- preset = preset.strip.downcase.tr(' -', '_').to_sym if preset.is_a?(String)
156
+ preset = preset.strip.downcase.tr(' -', '_').to_sym if preset.is_a?(String)
153
157
 
154
- return preset if PRESETS.key?(preset)
158
+ return preset if PRESETS.key?(preset)
155
159
 
156
- fail ArgumentError, "preset should be one of: #{ PRESETS.keys.join(', ') }"
160
+ raise ArgumentError, "preset should be one of: #{PRESETS.keys.join(', ')}"
161
+ end
157
162
  end
158
-
159
163
  end
@@ -1,16 +1,20 @@
1
- class XKPassword::Store
2
- SOURCE = 'google-10000-english-no-swears.txt'
1
+ # frozen_string_literal: true
3
2
 
4
- attr_reader :data
3
+ module XKPassword
4
+ class Store
5
+ SOURCE = 'google-10000-english-no-swears.txt'
5
6
 
6
- def initialize
7
- load_data
8
- end
7
+ attr_reader :data
8
+
9
+ def initialize
10
+ load_data
11
+ end
9
12
 
10
- private
13
+ private
11
14
 
12
- def load_data
13
- path = "#{ File.dirname(__FILE__) }/data/#{ SOURCE }"
14
- @data = IO.readlines(path).map{ |item| item.delete("\n") }
15
+ def load_data
16
+ path = "#{File.dirname(__FILE__)}/data/#{SOURCE}"
17
+ @data = File.readlines(path).map { |item| item.delete("\n") }
18
+ end
15
19
  end
16
20
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module XKPassword
4
- VERSION = '0.6.0'
4
+ VERSION = '0.7.0'
5
5
  end
@@ -1,3 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'securerandom'
1
4
  require 'xkpassword/store'
2
5
 
3
6
  # XKPassword::Words basically is a mini database of words. Its job is to provide words
@@ -10,70 +13,73 @@ require 'xkpassword/store'
10
13
  # @attr_reader [Hash] words A collection of words store in a hash with the
11
14
  # corresponding key to a word be a function of the
12
15
  # lenght of the word.
13
- class XKPassword::Words
14
- attr_reader :words
16
+ module XKPassword
17
+ class Words
18
+ attr_reader :words
15
19
 
16
- def initialize
17
- @words = {}
18
- setup
19
- end
20
+ def initialize
21
+ @words = {}
22
+ setup
23
+ end
20
24
 
21
- # Provide an array of words having the specified number of characters in it
22
- #
23
- # @param length [String] The number of characters of words should contain
24
- #
25
- # @return [Array<String>] Words from the source that match the length requirement.
26
- def with_length(length)
27
- fail ArgumentError 'Length should be a numeric' unless length.is_a? Numeric
28
- words[key(length)]
29
- end
25
+ # Provide an array of words having the specified number of characters in it
26
+ #
27
+ # @param length [String] The number of characters of words should contain
28
+ #
29
+ # @return [Array<String>] Words from the source that match the length requirement.
30
+ def with_length(length)
31
+ raise ArgumentError 'Length should be a numeric' unless length.is_a? Numeric
30
32
 
33
+ words[key(length)]
34
+ end
31
35
 
32
- # Provides a random word with the specified length
33
- #
34
- # @param length [Integer] The number of characters the word should contain
35
- #
36
- # @return [String] A random word with length
37
- def random(length)
38
- fail ArgumentError, 'Length should be numeric' unless length.is_a? Numeric
39
- with_length(length).sample
40
- end
36
+ # Provides a random word with the specified length, chosen with SecureRandom
37
+ #
38
+ # @param length [Integer] The number of characters the word should contain
39
+ #
40
+ # @return [String] A random word with length
41
+ def random(length)
42
+ raise ArgumentError, 'Length should be numeric' unless length.is_a? Numeric
41
43
 
42
- # Provide lengths available in the databse
43
- #
44
- # @return [Array<Integer>] A collection of lengths of words available
45
- def lengths
46
- words.keys.map{ |key| key.delete("l").to_i }
47
- end
44
+ with_length(length).sample(random: SecureRandom)
45
+ end
48
46
 
49
- # The lenght of the shortest word
50
- #
51
- # @return [Integer] The length of the shortest word
52
- def min_length
53
- lengths.min
54
- end
47
+ # Provide lengths available in the databse
48
+ #
49
+ # @return [Array<Integer>] A collection of lengths of words available
50
+ def lengths
51
+ words.keys.map { |key| key.delete('l').to_i }
52
+ end
55
53
 
56
- # The length of the longest word
57
- #
58
- # @return [Integer] The length of the longest word
59
- def max_length
60
- lengths.max
61
- end
54
+ # The lenght of the shortest word
55
+ #
56
+ # @return [Integer] The length of the shortest word
57
+ def min_length
58
+ lengths.min
59
+ end
62
60
 
63
- private
61
+ # The length of the longest word
62
+ #
63
+ # @return [Integer] The length of the longest word
64
+ def max_length
65
+ lengths.max
66
+ end
67
+
68
+ private
64
69
 
65
- def setup
66
- store = XKPassword::Store.new
67
- data = store.data
70
+ def setup
71
+ store = XKPassword::Store.new
72
+ data = store.data
68
73
 
69
- data.each do |datum|
70
- k = key(datum.length)
71
- words[k] = [] unless words[k]
72
- words[k] << datum
74
+ data.each do |datum|
75
+ k = key(datum.length)
76
+ words[k] = [] unless words[k]
77
+ words[k] << datum
78
+ end
73
79
  end
74
- end
75
80
 
76
- def key(length)
77
- "l#{ length }"
81
+ def key(length)
82
+ "l#{length}"
83
+ end
78
84
  end
79
85
  end
data/lib/xkpassword.rb CHANGED
@@ -1,5 +1,6 @@
1
- module XKPassword
1
+ # frozen_string_literal: true
2
2
 
3
+ module XKPassword
3
4
  # Generates a random password by intializing a `XKPassword::Generator` instance.
4
5
  # This accepts argumennts identcal to the above class.
5
6
  #
@@ -34,7 +35,6 @@ module XKPassword
34
35
  generator = XKPassword::Generator.new
35
36
  generator.generate(options)
36
37
  end
37
-
38
38
  end
39
39
 
40
40
  require 'xkpassword/version'
data/mise.toml CHANGED
@@ -1,5 +1,5 @@
1
1
  [tools]
2
- ruby = "3.3"
2
+ ruby = "4.0.2"
3
3
 
4
4
  [tasks.test]
5
5
  description = "Run the test suite"
data/xkpassword.gemspec CHANGED
@@ -1,36 +1,42 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
4
6
  require 'xkpassword/version'
5
7
 
6
8
  Gem::Specification.new do |spec|
7
- spec.name = "xkpassword"
9
+ spec.name = 'xkpassword'
8
10
  spec.version = XKPassword::VERSION
9
- spec.authors = ["Ziyan Junaideen"]
10
- spec.email = ["ziyan@jdeen.com"]
11
-
12
- spec.summary = %q{Hard to crack - XKPassword Generator for Ruby}
13
- spec.description = """
14
- Passwords are hard to remember, specially when they are hard to crack. I'd spend countless hours
15
- every year resetting passwords and eventually running out of options that I can remember. I found
16
- an interesting concept among a comic XKCD, it is to generate passwords using words and thus easier
17
- to remember. Here is XKPassword, a lib which you can install to our Ruby app or run independently
18
- in the command line.
19
-
20
- Wish you a safer future.
21
-
22
- Ziyan
23
- """
24
- spec.homepage = "https://github.com/jdeen/xkpassword"
25
- spec.license = "MIT"
26
-
27
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
- spec.bindir = "exe"
29
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
- spec.require_paths = ["lib"]
31
-
32
- spec.add_dependency "artii", "~> 2.1"
33
- spec.add_development_dependency "bundler", "~> 2.2"
34
- spec.add_development_dependency "rake", "~> 13.0"
35
- spec.add_development_dependency "rspec", "~> 3.10"
11
+ spec.authors = ['Ziyan Junaideen']
12
+ spec.email = ['ziyan@jdeen.com']
13
+
14
+ spec.summary = 'Hard to crack - XKPassword Generator for Ruby'
15
+ spec.description = <<~DESCRIPTION
16
+ Passwords are hard to remember, especially when they are hard to crack. I'd spend countless hours
17
+ every year resetting passwords and eventually running out of options that I can remember. I found
18
+ an interesting concept in an XKCD comic: generate passwords using words so they are easier to
19
+ remember. Here is XKPassword, a library you can install into your Ruby app or run independently
20
+ from the command line.
21
+
22
+ Wish you a safer future.
23
+
24
+ Ziyan
25
+ DESCRIPTION
26
+ spec.homepage = 'https://github.com/jdeen/xkpassword'
27
+ spec.license = 'MIT'
28
+ spec.required_ruby_version = Gem::Requirement.new('>= 3.3', '< 4.1')
29
+ spec.metadata = {
30
+ 'rubygems_mfa_required' => 'true'
31
+ }
32
+
33
+ spec.files = `git ls-files -z`.split("\x0").reject { |file| file.match(%r{^(test|spec|features)/}) }
34
+ spec.bindir = 'exe'
35
+ spec.executables = spec.files.grep(%r{^exe/}) { |file| File.basename(file) }
36
+ spec.require_paths = ['lib']
37
+
38
+ spec.add_dependency 'artii', '~> 2.1'
39
+ spec.add_development_dependency 'bundler', '>= 2.5', '< 3.0'
40
+ spec.add_development_dependency 'rake', '~> 13.3'
41
+ spec.add_development_dependency 'rspec', '~> 3.13'
36
42
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xkpassword
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziyan Junaideen
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2026-04-17 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: artii
@@ -28,50 +27,60 @@ dependencies:
28
27
  name: bundler
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - "~>"
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '2.5'
33
+ - - "<"
32
34
  - !ruby/object:Gem::Version
33
- version: '2.2'
35
+ version: '3.0'
34
36
  type: :development
35
37
  prerelease: false
36
38
  version_requirements: !ruby/object:Gem::Requirement
37
39
  requirements:
38
- - - "~>"
40
+ - - ">="
39
41
  - !ruby/object:Gem::Version
40
- version: '2.2'
42
+ version: '2.5'
43
+ - - "<"
44
+ - !ruby/object:Gem::Version
45
+ version: '3.0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rake
43
48
  requirement: !ruby/object:Gem::Requirement
44
49
  requirements:
45
50
  - - "~>"
46
51
  - !ruby/object:Gem::Version
47
- version: '13.0'
52
+ version: '13.3'
48
53
  type: :development
49
54
  prerelease: false
50
55
  version_requirements: !ruby/object:Gem::Requirement
51
56
  requirements:
52
57
  - - "~>"
53
58
  - !ruby/object:Gem::Version
54
- version: '13.0'
59
+ version: '13.3'
55
60
  - !ruby/object:Gem::Dependency
56
61
  name: rspec
57
62
  requirement: !ruby/object:Gem::Requirement
58
63
  requirements:
59
64
  - - "~>"
60
65
  - !ruby/object:Gem::Version
61
- version: '3.10'
66
+ version: '3.13'
62
67
  type: :development
63
68
  prerelease: false
64
69
  version_requirements: !ruby/object:Gem::Requirement
65
70
  requirements:
66
71
  - - "~>"
67
72
  - !ruby/object:Gem::Version
68
- version: '3.10'
69
- description: "\n Passwords are hard to remember, specially when they are hard to
70
- crack. I'd spend countless hours\n every year resetting passwords and eventually
71
- running out of options that I can remember. I found\n an interesting concept among
72
- a comic XKCD, it is to generate passwords using words and thus easier\n to remember.
73
- Here is XKPassword, a lib which you can install to our Ruby app or run independently\n
74
- \ in the command line.\n\n Wish you a safer future.\n\n Ziyan\n "
73
+ version: '3.13'
74
+ description: |
75
+ Passwords are hard to remember, especially when they are hard to crack. I'd spend countless hours
76
+ every year resetting passwords and eventually running out of options that I can remember. I found
77
+ an interesting concept in an XKCD comic: generate passwords using words so they are easier to
78
+ remember. Here is XKPassword, a library you can install into your Ruby app or run independently
79
+ from the command line.
80
+
81
+ Wish you a safer future.
82
+
83
+ Ziyan
75
84
  email:
76
85
  - ziyan@jdeen.com
77
86
  executables:
@@ -81,6 +90,7 @@ extra_rdoc_files: []
81
90
  files:
82
91
  - ".gitignore"
83
92
  - ".rspec"
93
+ - ".rubocop.yml"
84
94
  - ".travis.yml"
85
95
  - CODE_OF_CONDUCT.md
86
96
  - Gemfile
@@ -106,8 +116,8 @@ files:
106
116
  homepage: https://github.com/jdeen/xkpassword
107
117
  licenses:
108
118
  - MIT
109
- metadata: {}
110
- post_install_message:
119
+ metadata:
120
+ rubygems_mfa_required: 'true'
111
121
  rdoc_options: []
112
122
  require_paths:
113
123
  - lib
@@ -115,15 +125,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
125
  requirements:
116
126
  - - ">="
117
127
  - !ruby/object:Gem::Version
118
- version: '0'
128
+ version: '3.3'
129
+ - - "<"
130
+ - !ruby/object:Gem::Version
131
+ version: '4.1'
119
132
  required_rubygems_version: !ruby/object:Gem::Requirement
120
133
  requirements:
121
134
  - - ">="
122
135
  - !ruby/object:Gem::Version
123
136
  version: '0'
124
137
  requirements: []
125
- rubygems_version: 3.5.22
126
- signing_key:
138
+ rubygems_version: 4.0.6
127
139
  specification_version: 4
128
140
  summary: Hard to crack - XKPassword Generator for Ruby
129
141
  test_files: []