zxcvbn-ruby 1.1.0 → 1.2.1

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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -3
  3. data/README.md +5 -5
  4. data/lib/zxcvbn/clock.rb +10 -0
  5. data/lib/zxcvbn/password_strength.rb +3 -3
  6. data/lib/zxcvbn/version.rb +3 -1
  7. metadata +9 -77
  8. data/.gitignore +0 -18
  9. data/.rspec +0 -1
  10. data/.travis.yml +0 -12
  11. data/CODE_OF_CONDUCT.md +0 -130
  12. data/Gemfile +0 -10
  13. data/Guardfile +0 -26
  14. data/Rakefile +0 -22
  15. data/spec/dictionary_ranker_spec.rb +0 -12
  16. data/spec/feedback_giver_spec.rb +0 -212
  17. data/spec/matchers/date_spec.rb +0 -109
  18. data/spec/matchers/dictionary_spec.rb +0 -30
  19. data/spec/matchers/digits_spec.rb +0 -15
  20. data/spec/matchers/l33t_spec.rb +0 -87
  21. data/spec/matchers/repeat_spec.rb +0 -18
  22. data/spec/matchers/sequences_spec.rb +0 -21
  23. data/spec/matchers/spatial_spec.rb +0 -20
  24. data/spec/matchers/year_spec.rb +0 -15
  25. data/spec/omnimatch_spec.rb +0 -24
  26. data/spec/scorer_spec.rb +0 -5
  27. data/spec/scoring/crack_time_spec.rb +0 -106
  28. data/spec/scoring/entropy_spec.rb +0 -216
  29. data/spec/scoring/math_spec.rb +0 -135
  30. data/spec/spec_helper.rb +0 -54
  31. data/spec/support/js_helpers.rb +0 -35
  32. data/spec/support/js_source/adjacency_graphs.js +0 -8
  33. data/spec/support/js_source/compiled.js +0 -1188
  34. data/spec/support/js_source/frequency_lists.js +0 -10
  35. data/spec/support/js_source/init.coffee +0 -63
  36. data/spec/support/js_source/init.js +0 -95
  37. data/spec/support/js_source/matching.coffee +0 -444
  38. data/spec/support/js_source/matching.js +0 -685
  39. data/spec/support/js_source/scoring.coffee +0 -270
  40. data/spec/support/js_source/scoring.js +0 -390
  41. data/spec/support/matcher.rb +0 -35
  42. data/spec/tester_spec.rb +0 -99
  43. data/spec/zxcvbn_spec.rb +0 -24
  44. data/zxcvbn-ruby.gemspec +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 871b2fb9d5b2db321db8625aae3ecff0f0ae13f3e9eb834ca79153c950951a89
4
- data.tar.gz: 1eba0af7e3e6b6e982149d45a43356f91890b71328db17d03ee0bfa3cc45f37e
3
+ metadata.gz: e00f4d1e74aab0e662091f1adbcd1e86abeb11bfe3ac0440f0d5c83988b16649
4
+ data.tar.gz: 30164328d27edf8e12a8fcb0d79a3eea47c910f0f2cd6cf1d56b9aa1da515b9e
5
5
  SHA512:
6
- metadata.gz: 6dd4ec7906a109a2094e6f2d44606748a778c6aa35111f967cbaa143313b8b7e149b21bb926dc9d31d96c14a53489a7ec879fbc5618c6f804117a262673b5d81
7
- data.tar.gz: d2b3b14f62904c31db52da50066fe6a4cccdb3acb058407fd1fdef5bbdac0b9e045eca99835f2875c8cb31350158f868276976a3f54d15e85d4d02ce5f3052db
6
+ metadata.gz: e50ab32776c2ab1aed4bb5adccd6067efad60bf203f9d3f7e700e03ba5ecd60e8fb06725fa95ca44683045f2f5471f00a0af586cd8ded69bd985e4f14a09e9e5
7
+ data.tar.gz: 107abf8ef445ad4462c62801d53b14c6d6f695707ecb40819973b2e949eaf385dee15bf3e8326138febc088df2c069f959a937e852c0dce56acda6b3bbad051d
data/CHANGELOG.md CHANGED
@@ -6,7 +6,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- [Unreleased]: https://github.com/envato/zxcvbn-ruby/compare/v1.1.0...HEAD
9
+ [Unreleased]: https://github.com/envato/zxcvbn-ruby/compare/v1.2.1...HEAD
10
+
11
+ ## [1.2.1] - 2025-12-05
12
+
13
+ ### Removed
14
+ - Removed the dependency on the Ruby `benchmark` module ([#44]).
15
+ - Tests are no longer included in the gem package ([#45]).
16
+
17
+ [1.2.1]: https://github.com/envato/zxcvbn-ruby/compare/v1.2.0...v.1.2.1
18
+ [#44]: https://github.com/envato/zxcvbn-ruby/pull/44
19
+ [#45]: https://github.com/envato/zxcvbn-ruby/pull/45
20
+
21
+ ## [1.2.0] - 2021-01-05
22
+
23
+ ### Added
24
+ - Support for Ruby 3 (thanks [@RSO] ([#32]))
25
+
26
+ ### Changed
27
+ - Use [mini\_racer] for running JavaScript specs (thanks [@RSO] ([#33]))
28
+ - Moved CI to GitHub Actions ([#34])
29
+
30
+ [1.2.0]: https://github.com/envato/zxcvbn-ruby/compare/v1.1.0...v.1.2.0
31
+ [@rso]: https://github.com/RSO
32
+ [mini\_racer]: https://rubygems.org/gems/mini_racer/
33
+ [#32]: https://github.com/envato/zxcvbn-ruby/pull/32
34
+ [#33]: https://github.com/envato/zxcvbn-ruby/pull/33
35
+ [#34]: https://github.com/envato/zxcvbn-ruby/pull/34
10
36
 
11
37
  ## [1.1.0] - 2020-07-16
12
38
  ### Added
@@ -21,8 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
21
47
  - Invalid user dictionaries are handled more robustly ([#28])
22
48
 
23
49
  [1.1.0]: https://github.com/envato/zxcvbn-ruby/compare/v1.0.0...v1.1.0
24
- [28]: https://github.com/envato/zxcvbn-ruby/pull/28
25
- [29]: https://github.com/envato/zxcvbn-ruby/pull/29
50
+ [#28]: https://github.com/envato/zxcvbn-ruby/pull/28
51
+ [#29]: https://github.com/envato/zxcvbn-ruby/pull/29
26
52
 
27
53
  ## [1.0.0] - 2019-05-14
28
54
  ### Added
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This is a Ruby port of Dropbox's [zxcvbn.js][zxcvbn.js] JavaScript library.
4
4
 
5
- ## Development status [![Build Status](https://travis-ci.org/envato/zxcvbn-ruby.svg?branch=master)](https://travis-ci.org/envato/zxcvbn-ruby)
5
+ ## Development status [![CI Status](https://github.com/envato/zxcvbn-ruby/workflows/CI/badge.svg)](https://github.com/envato/zxcvbn-ruby/actions?query=workflow%3ACI)
6
6
 
7
7
  `zxcvbn-ruby` is considered stable and is used in projects around [Envato][envato].
8
8
 
@@ -119,7 +119,7 @@ $ irb
119
119
  **Note**: Storing the entropy of an encrypted or hashed value provides
120
120
  information that can make cracking the value orders of magnitude easier for an
121
121
  attacker. For this reason we advise you not to store the results of
122
- `Zxcvbn::Tester#test`. Further reading: [A Tale of Security Gone Wrong](http://gavinmiller.io/2016/a-tale-of-security-gone-wrong/).
122
+ `Zxcvbn::Tester#test`. Further reading: [A Tale of Security Gone Wrong](https://web.archive.org/web/20240715041147/http://gavinmiller.io/2016/a-tale-of-security-gone-wrong/).
123
123
 
124
124
  ## Contact
125
125
 
@@ -137,16 +137,16 @@ attacker. For this reason we advise you not to store the results of
137
137
  - [Matthieu Aussaguel](https://github.com/matthieua)
138
138
  - [_et al._](https://github.com/envato/zxcvbn-ruby/graphs/contributors)
139
139
 
140
- ## License [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/envato/zxcvbn-ruby/blob/master/LICENSE.txt)
140
+ ## License [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/envato/zxcvbn-ruby/blob/HEAD/LICENSE.txt)
141
141
 
142
142
  `zxcvbn-ruby` uses MIT license, the same as [zxcvbn.js][zxcvbn.js] itself. See
143
- [`LICENSE.txt`](https://github.com/envato/zxcvbn-ruby/blob/master/LICENSE.txt)
143
+ [`LICENSE.txt`](https://github.com/envato/zxcvbn-ruby/blob/HEAD/LICENSE.txt)
144
144
  for details.
145
145
 
146
146
  ## Code of Conduct
147
147
 
148
148
  We welcome contribution from everyone. Read more about it in
149
- [`CODE_OF_CONDUCT.md`](https://github.com/envato/zxcvbn-ruby/blob/master/CODE_OF_CONDUCT.md).
149
+ [`CODE_OF_CONDUCT.md`](https://github.com/envato/zxcvbn-ruby/blob/HEAD/CODE_OF_CONDUCT.md).
150
150
 
151
151
  ## Contributing [![PRs welcome](https://img.shields.io/badge/PRs-welcome-orange.svg?style=flat-square)](https://github.com/envato/zxcvbn-ruby/issues)
152
152
 
@@ -0,0 +1,10 @@
1
+ module Zxcvbn
2
+ module Clock
3
+ def self.realtime
4
+ start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
5
+ yield
6
+ Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
7
+ end
8
+ end
9
+ end
10
+
@@ -1,4 +1,4 @@
1
- require 'benchmark'
1
+ require 'zxcvbn/clock'
2
2
  require 'zxcvbn/feedback_giver'
3
3
  require 'zxcvbn/omnimatch'
4
4
  require 'zxcvbn/scorer'
@@ -13,7 +13,7 @@ module Zxcvbn
13
13
  def test(password, user_inputs = [])
14
14
  password = password || ''
15
15
  result = nil
16
- calc_time = Benchmark.realtime do
16
+ calc_time = Clock.realtime do
17
17
  matches = @omnimatch.matches(password, user_inputs)
18
18
  result = @scorer.minimum_entropy_match_sequence(password, matches)
19
19
  end
@@ -22,4 +22,4 @@ module Zxcvbn
22
22
  result
23
23
  end
24
24
  end
25
- end
25
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Zxcvbn
2
- VERSION = '1.1.0'.freeze
4
+ VERSION = '1.2.1'
3
5
  end
metadata CHANGED
@@ -1,18 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zxcvbn-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Hodgkiss
8
8
  - Matthieu Aussaguel
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2020-07-15 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: therubyracer
14
+ name: mini_racer
16
15
  requirement: !ruby/object:Gem::Requirement
17
16
  requirements:
18
17
  - - ">="
@@ -47,16 +46,9 @@ executables: []
47
46
  extensions: []
48
47
  extra_rdoc_files: []
49
48
  files:
50
- - ".gitignore"
51
- - ".rspec"
52
- - ".travis.yml"
53
49
  - CHANGELOG.md
54
- - CODE_OF_CONDUCT.md
55
- - Gemfile
56
- - Guardfile
57
50
  - LICENSE.txt
58
51
  - README.md
59
- - Rakefile
60
52
  - data/adjacency_graphs.json
61
53
  - data/frequency_lists/english.txt
62
54
  - data/frequency_lists/female_names.txt
@@ -64,6 +56,7 @@ files:
64
56
  - data/frequency_lists/passwords.txt
65
57
  - data/frequency_lists/surnames.txt
66
58
  - lib/zxcvbn.rb
59
+ - lib/zxcvbn/clock.rb
67
60
  - lib/zxcvbn/crack_time.rb
68
61
  - lib/zxcvbn/data.rb
69
62
  - lib/zxcvbn/dictionary_ranker.rb
@@ -88,52 +81,21 @@ files:
88
81
  - lib/zxcvbn/scorer.rb
89
82
  - lib/zxcvbn/tester.rb
90
83
  - lib/zxcvbn/version.rb
91
- - spec/dictionary_ranker_spec.rb
92
- - spec/feedback_giver_spec.rb
93
- - spec/matchers/date_spec.rb
94
- - spec/matchers/dictionary_spec.rb
95
- - spec/matchers/digits_spec.rb
96
- - spec/matchers/l33t_spec.rb
97
- - spec/matchers/repeat_spec.rb
98
- - spec/matchers/sequences_spec.rb
99
- - spec/matchers/spatial_spec.rb
100
- - spec/matchers/year_spec.rb
101
- - spec/omnimatch_spec.rb
102
- - spec/scorer_spec.rb
103
- - spec/scoring/crack_time_spec.rb
104
- - spec/scoring/entropy_spec.rb
105
- - spec/scoring/math_spec.rb
106
- - spec/spec_helper.rb
107
- - spec/support/js_helpers.rb
108
- - spec/support/js_source/adjacency_graphs.js
109
- - spec/support/js_source/compiled.js
110
- - spec/support/js_source/frequency_lists.js
111
- - spec/support/js_source/init.coffee
112
- - spec/support/js_source/init.js
113
- - spec/support/js_source/matching.coffee
114
- - spec/support/js_source/matching.js
115
- - spec/support/js_source/scoring.coffee
116
- - spec/support/js_source/scoring.js
117
- - spec/support/matcher.rb
118
- - spec/tester_spec.rb
119
- - spec/zxcvbn_spec.rb
120
- - zxcvbn-ruby.gemspec
121
84
  homepage: http://github.com/envato/zxcvbn-ruby
122
85
  licenses:
123
86
  - MIT
124
87
  metadata:
125
88
  bug_tracker_uri: https://github.com/envato/zxcvbn-ruby/issues
126
- changelog_uri: https://github.com/envato/zxcvbn-ruby/blob/master/CHANGELOG.md
127
- documentation_uri: https://github.com/envato/zxcvbn-ruby/blob/master/README.md
89
+ changelog_uri: https://github.com/envato/zxcvbn-ruby/blob/HEAD/CHANGELOG.md
90
+ documentation_uri: https://github.com/envato/zxcvbn-ruby/blob/HEAD/README.md
128
91
  homepage_uri: https://github.com/envato/zxcvbn-ruby
129
92
  source_code_uri: https://github.com/envato/zxcvbn-ruby
130
- post_install_message:
131
93
  rdoc_options: []
132
94
  require_paths:
133
95
  - lib
134
96
  required_ruby_version: !ruby/object:Gem::Requirement
135
97
  requirements:
136
- - - "~>"
98
+ - - ">="
137
99
  - !ruby/object:Gem::Version
138
100
  version: '2.5'
139
101
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -142,37 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
104
  - !ruby/object:Gem::Version
143
105
  version: '0'
144
106
  requirements: []
145
- rubygems_version: 3.1.2
146
- signing_key:
107
+ rubygems_version: 4.0.0
147
108
  specification_version: 4
148
109
  summary: ''
149
- test_files:
150
- - spec/dictionary_ranker_spec.rb
151
- - spec/feedback_giver_spec.rb
152
- - spec/matchers/date_spec.rb
153
- - spec/matchers/dictionary_spec.rb
154
- - spec/matchers/digits_spec.rb
155
- - spec/matchers/l33t_spec.rb
156
- - spec/matchers/repeat_spec.rb
157
- - spec/matchers/sequences_spec.rb
158
- - spec/matchers/spatial_spec.rb
159
- - spec/matchers/year_spec.rb
160
- - spec/omnimatch_spec.rb
161
- - spec/scorer_spec.rb
162
- - spec/scoring/crack_time_spec.rb
163
- - spec/scoring/entropy_spec.rb
164
- - spec/scoring/math_spec.rb
165
- - spec/spec_helper.rb
166
- - spec/support/js_helpers.rb
167
- - spec/support/js_source/adjacency_graphs.js
168
- - spec/support/js_source/compiled.js
169
- - spec/support/js_source/frequency_lists.js
170
- - spec/support/js_source/init.coffee
171
- - spec/support/js_source/init.js
172
- - spec/support/js_source/matching.coffee
173
- - spec/support/js_source/matching.js
174
- - spec/support/js_source/scoring.coffee
175
- - spec/support/js_source/scoring.js
176
- - spec/support/matcher.rb
177
- - spec/tester_spec.rb
178
- - spec/zxcvbn_spec.rb
110
+ test_files: []
data/.gitignore DELETED
@@ -1,18 +0,0 @@
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
- bin/
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --colour
data/.travis.yml DELETED
@@ -1,12 +0,0 @@
1
- before_install:
2
- - gem install bundler
3
- language: ruby
4
- rvm:
5
- - '2.5'
6
- - '2.6'
7
- - '2.7'
8
- - ruby-head
9
- matrix:
10
- allow_failures:
11
- - rvm: ruby-head
12
- fast_finish: true
data/CODE_OF_CONDUCT.md DELETED
@@ -1,130 +0,0 @@
1
-
2
- # Contributor Covenant Code of Conduct
3
-
4
- ## Our Pledge
5
-
6
- We as members, contributors, and leaders pledge to make participation in our
7
- community a harassment-free experience for everyone, regardless of age, body
8
- size, visible or invisible disability, ethnicity, sex characteristics, gender
9
- identity and expression, level of experience, education, socio-economic status,
10
- nationality, personal appearance, race, religion, or sexual identity
11
- and orientation.
12
-
13
- We pledge to act and interact in ways that contribute to an open, welcoming,
14
- diverse, inclusive, and healthy community.
15
-
16
- ## Our Standards
17
-
18
- Examples of behavior that contributes to a positive environment for our
19
- community include:
20
-
21
- * Demonstrating empathy and kindness toward other people
22
- * Being respectful of differing opinions, viewpoints, and experiences
23
- * Giving and gracefully accepting constructive feedback
24
- * Accepting responsibility and apologizing to those affected by our mistakes,
25
- and learning from the experience
26
- * Focusing on what is best not just for us as individuals, but for the
27
- overall community
28
-
29
- Examples of unacceptable behavior include:
30
-
31
- * The use of sexualized language or imagery, and sexual attention or
32
- advances of any kind
33
- * Trolling, insulting or derogatory comments, and personal or political attacks
34
- * Public or private harassment
35
- * Publishing others' private information, such as a physical or email
36
- address, without their explicit permission
37
- * Other conduct which could reasonably be considered inappropriate in a
38
- professional setting
39
-
40
- ## Enforcement Responsibilities
41
-
42
- Community leaders are responsible for clarifying and enforcing our standards of
43
- acceptable behavior and will take appropriate and fair corrective action in
44
- response to any behavior that they deem inappropriate, threatening, offensive,
45
- or harmful.
46
-
47
- Community leaders have the right and responsibility to remove, edit, or reject
48
- comments, commits, code, wiki edits, issues, and other contributions that are
49
- not aligned to this Code of Conduct, and will communicate reasons for moderation
50
- decisions when appropriate.
51
-
52
- ## Scope
53
-
54
- This Code of Conduct applies within all community spaces, and also applies when
55
- an individual is officially representing the community in public spaces.
56
- Examples of representing our community include using an official e-mail address,
57
- posting via an official social media account, or acting as an appointed
58
- representative at an online or offline event.
59
-
60
- ## Enforcement
61
-
62
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
- reported to the community leaders responsible for enforcement at
64
- pete.johns@envato.com
65
- All complaints will be reviewed and investigated promptly and fairly.
66
-
67
- All community leaders are obligated to respect the privacy and security of the
68
- reporter of any incident.
69
-
70
- ## Enforcement Guidelines
71
-
72
- Community leaders will follow these Community Impact Guidelines in determining
73
- the consequences for any action they deem in violation of this Code of Conduct:
74
-
75
- ### 1. Correction
76
-
77
- **Community Impact**: Use of inappropriate language or other behavior deemed
78
- unprofessional or unwelcome in the community.
79
-
80
- **Consequence**: A private, written warning from community leaders, providing
81
- clarity around the nature of the violation and an explanation of why the
82
- behavior was inappropriate. A public apology may be requested.
83
-
84
- ### 2. Warning
85
-
86
- **Community Impact**: A violation through a single incident or series
87
- of actions.
88
-
89
- **Consequence**: A warning with consequences for continued behavior. No
90
- interaction with the people involved, including unsolicited interaction with
91
- those enforcing the Code of Conduct, for a specified period of time. This
92
- includes avoiding interactions in community spaces as well as external channels
93
- like social media. Violating these terms may lead to a temporary or
94
- permanent ban.
95
-
96
- ### 3. Temporary Ban
97
-
98
- **Community Impact**: A serious violation of community standards, including
99
- sustained inappropriate behavior.
100
-
101
- **Consequence**: A temporary ban from any sort of interaction or public
102
- communication with the community for a specified period of time. No public or
103
- private interaction with the people involved, including unsolicited interaction
104
- with those enforcing the Code of Conduct, is allowed during this period.
105
- Violating these terms may lead to a permanent ban.
106
-
107
- ### 4. Permanent Ban
108
-
109
- **Community Impact**: Demonstrating a pattern of violation of community
110
- standards, including sustained inappropriate behavior, harassment of an
111
- individual, or aggression toward or disparagement of classes of individuals.
112
-
113
- **Consequence**: A permanent ban from any sort of public interaction within
114
- the community.
115
-
116
- ## Attribution
117
-
118
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
- version 2.0, available at
120
- https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
121
-
122
- Community Impact Guidelines were inspired by [Mozilla's code of conduct
123
- enforcement ladder](https://github.com/mozilla/diversity).
124
-
125
- [homepage]: https://www.contributor-covenant.org
126
-
127
- For answers to common questions about this code of conduct, see the FAQ at
128
- https://www.contributor-covenant.org/faq. Translations are available at
129
- https://www.contributor-covenant.org/translations.
130
-
data/Gemfile DELETED
@@ -1,10 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- group :development do
6
- gem 'guard'
7
- gem 'guard-bundler', require: false
8
- gem 'guard-rspec', require: false
9
- gem 'rake'
10
- end
data/Guardfile DELETED
@@ -1,26 +0,0 @@
1
- guard :bundler do
2
- require 'guard/bundler'
3
- require 'guard/bundler/verify'
4
- helper = Guard::Bundler::Verify.new
5
-
6
- files = ['Gemfile']
7
- files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
8
-
9
- # Assume files are symlinked from somewhere
10
- files.each { |file| watch(helper.real_path(file)) }
11
- end
12
-
13
- guard :rspec, cmd: "bundle exec rspec" do
14
- require "guard/rspec/dsl"
15
- dsl = Guard::RSpec::Dsl.new(self)
16
-
17
- # RSpec files
18
- rspec = dsl.rspec
19
- watch(rspec.spec_helper) { rspec.spec_dir }
20
- watch(rspec.spec_support) { rspec.spec_dir }
21
- watch(rspec.spec_files)
22
-
23
- # Ruby files
24
- ruby = dsl.ruby
25
- dsl.watch_spec_files_for(ruby.lib_files)
26
- end
data/Rakefile DELETED
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env rake
2
- require "bundler/gem_tasks"
3
- require "bundler/setup"
4
- require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new('spec')
7
- task default: [:spec]
8
-
9
- task :console do
10
- require 'zxcvbn'
11
- require './spec/support/js_helpers'
12
- include JsHelpers
13
- require 'irb'
14
- ARGV.clear
15
- IRB.start
16
- 1
17
- end
18
-
19
- task :compile_coffeescript do
20
- `coffee --compile --bare spec/support/js_source/{matching,scoring,init}.coffee`
21
- `cat spec/support/js_source/{matching,scoring,adjacency_graphs,frequency_lists,init}.js > spec/support/js_source/compiled.js`
22
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Zxcvbn::DictionaryRanker do
4
- describe '.rank_dictionaries' do
5
- it 'ranks word lists' do
6
- result = Zxcvbn::DictionaryRanker.rank_dictionaries({:test => ['ABC', 'def'],
7
- :test2 => ['def', 'ABC']})
8
- expect(result[:test]).to eq({'abc' => 1, 'def' => 2})
9
- expect(result[:test2]).to eq({'def' => 1, 'abc' => 2})
10
- end
11
- end
12
- end