passphrase 0.1.0 → 1.0.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.
@@ -0,0 +1,30 @@
1
+ require "passphrase"
2
+
3
+ module Passphrase
4
+ RSpec.describe WordQuery, "queries the words table in a valid wordlist database" do
5
+ before do
6
+ wordlist_file = "../../lib/passphrase/wordlist/words.sqlite3"
7
+ wordlist_path = File.join(File.dirname(__FILE__), wordlist_file)
8
+ db = SQLite3::Database.new(wordlist_path, readonly: true)
9
+ @words = WordQuery.new(db)
10
+ end
11
+
12
+ it "responds to the where() method with one argument" do
13
+ expect(@words).to respond_to(:where).with(1).argument
14
+ end
15
+
16
+ context "#where([Hash])" do
17
+ before do
18
+ @selection = @words.where(language: "afrikaans", die_rolls: "11111")
19
+ end
20
+
21
+ it "returns a string" do
22
+ expect(@selection).to be_an_instance_of(String)
23
+ end
24
+
25
+ it "that is not empty" do
26
+ expect(@selection).not_to be_empty
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,91 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # The `.rspec` file also contains a few flags that are not defaults but that
16
+ # users commonly want.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # The settings below are suggested to provide a good initial experience
44
+ # with RSpec, but feel free to customize to your heart's content.
45
+ =begin
46
+ # These two settings work together to allow you to limit a spec run
47
+ # to individual examples or groups you care about by tagging them with
48
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
49
+ # get run.
50
+ config.filter_run :focus
51
+ config.run_all_when_everything_filtered = true
52
+
53
+ # Limits the available syntax to the non-monkey patched syntax that is
54
+ # recommended. For more details, see:
55
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
56
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
57
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
58
+ config.disable_monkey_patching!
59
+
60
+ # This setting enables warnings. It's recommended, but in some cases may
61
+ # be too noisy due to issues in dependencies.
62
+ config.warnings = true
63
+
64
+ # Many RSpec users commonly either run the entire suite or an individual
65
+ # file, and it's useful to allow more verbose output when running an
66
+ # individual spec file.
67
+ if config.files_to_run.one?
68
+ # Use the documentation formatter for detailed output,
69
+ # unless a formatter has already been configured
70
+ # (e.g. via a command-line flag).
71
+ config.default_formatter = 'doc'
72
+ end
73
+
74
+ # Print the 10 slowest examples and example groups at the
75
+ # end of the spec run, to help surface which specs are running
76
+ # particularly slow.
77
+ config.profile_examples = 10
78
+
79
+ # Run specs in random order to surface order dependencies. If you find an
80
+ # order dependency and want to debug it, you can fix the order by providing
81
+ # the seed, which is printed after each run.
82
+ # --seed 1234
83
+ config.order = :random
84
+
85
+ # Seed global randomization in this process using the `--seed` CLI option.
86
+ # Setting this allows you to use `--seed` to deterministically reproduce
87
+ # test failures related to randomization by passing the same `--seed` value
88
+ # as the one that triggered the failure.
89
+ Kernel.srand config.seed
90
+ =end
91
+ end
metadata CHANGED
@@ -1,158 +1,178 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: passphrase
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
6
5
  platform: ruby
7
- authors:
8
- - Edmund Sumbar
6
+ authors:
7
+ - Edmund Sumbar
9
8
  autorequire:
10
9
  bindir: bin
11
- cert_chain: []
12
-
13
- date: 2011-04-25 00:00:00 -06:00
14
- default_executable: passphrase
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: bundler
18
- version_requirements: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ~>
22
- - !ruby/object:Gem::Version
23
- version: 1.0.0
24
- requirement: *id001
25
- prerelease: false
26
- type: :development
27
- - !ruby/object:Gem::Dependency
28
- name: jeweler
29
- version_requirements: &id002 !ruby/object:Gem::Requirement
30
- none: false
31
- requirements:
32
- - - ~>
33
- - !ruby/object:Gem::Version
34
- version: 1.5.2
35
- requirement: *id002
36
- prerelease: false
37
- type: :development
38
- description: |+
39
- = passphrase
40
-
41
- Trying to come up with a good passphrase when creating an SSH public key pair
42
- or when signing up for an online service is a pain. Typical password generators
43
- yield a string of random characters which may be strong but is often hard to
44
- type. The {Diceware method}[http://world.std.com/~reinhold/diceware.html]
45
- constructs a passphrase made up of more-or-less recognizable words. This makes
46
- it easier to type, while still being reasonably secure. Passphrase is a command
47
- line tool written in Ruby for generating a passphrase using the Diceware
48
- method.
49
-
50
- The act of rolling dice is simulated by requesting random numbers from
51
- {www.random.org}[http://www.random.org]. If a network error occurs or a request
52
- fails, the program gracefully degenerates to using SecureRandom::random_number.
53
-
54
- Words in the generated passphrase are selected from either the Diceware list or
55
- the alternate list edited by Alan Beale, referred to as the _Beale_ list. The
56
- choice of list for each word is made randomly. Both lists are embedded into the
57
- code as compressed, base64 encoded strings. No external files are referenced.
58
-
59
- == Generating a passphrase
60
-
61
- The command line interface is simple. You have the option to request from 3 to
62
- 10 words in the generated passphrase. The default is 5 if a number is not
63
- specified. In addition, at least one capital letter, one number character, and
64
- one non-alphanumeric character are automatically mixed into the passphrase.
65
- However, you can omit mixing if desired.
66
-
67
- Usage: passphrase [options]
68
- Options:
69
- -n, --num-words NUMBER Desired number of words (3..10), default 5
70
- -x, --[no-]mix Mix in cap, num, non-alphanum, default mix
71
- -l, --local Force use of local random number generator
72
- -h, --help Show this message and exit
73
- -v, --version Show version and exit
74
-
75
- == Examples
76
-
77
- $ passphrase --num-words 3
78
- unmixed phrase => tomb sima smog
79
- passphrase => ]omb s0ma smoG
80
-
81
- $ passphrase --num-words 4 --no-mix
82
- passphrase => humus smooth persia mz
83
-
84
- If you don't like a generated passphrase, repeat the command.
85
-
86
- == Contributing to passphrase
87
-
88
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
89
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
90
- * Fork the project
91
- * Start a feature/bugfix branch
92
- * Commit and push until you are happy with your contribution
93
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
94
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
95
-
96
- == Copyright
97
-
98
- Copyright (c) 2011 Edmund Sumbar. See LICENSE.txt for
99
- further details.
100
-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ZnV87aUCyLaHtnWp
28
+ BfwHGTPNVaKMvIUHOUfnR9a3Ihr1kNFGhaI45VWS/SKp8TqC8vMZBb/YIFHXFs/i
29
+ uHdQbzbF30cT0zYIRcexE8NQx8s8YQpLGPEC9mp6YIZAWjv5d6d3EVimq+CoAsG8
30
+ aoKZhUfRmAZDUgzW4PMtMxO34fQDbDYevBzMcxmkHNDs87ROMOuPLWJGLcKpgGwJ
31
+ TxzUtBfb7E+Qa/wyo0Ws7A==
32
+ -----END CERTIFICATE-----
33
+ date: 2015-04-06 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: sqlite3
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.0'
42
+ type: :runtime
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '1.0'
49
+ - !ruby/object:Gem::Dependency
50
+ name: rspec
51
+ requirement: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '3.0'
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '3.0'
63
+ - !ruby/object:Gem::Dependency
64
+ name: bundler
65
+ requirement: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '1.9'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '1.9'
77
+ - !ruby/object:Gem::Dependency
78
+ name: rake
79
+ requirement: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '10.0'
84
+ type: :development
85
+ prerelease: false
86
+ version_requirements: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '10.0'
91
+ - !ruby/object:Gem::Dependency
92
+ name: yard
93
+ requirement: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '0.8'
98
+ type: :development
99
+ prerelease: false
100
+ version_requirements: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '0.8'
105
+ - !ruby/object:Gem::Dependency
106
+ name: redcarpet
107
+ requirement: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '3.2'
112
+ type: :development
113
+ prerelease: false
114
+ version_requirements: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '3.2'
119
+ description: |2
120
+ Passphrase is a library and command-line tool for generating passphrases
121
+ using the Diceware Method. The method selects words from a predefined
122
+ database of more-or-less recognizable words, making the resulting
123
+ passphrases easier to remember and type. And because the words are selected
124
+ randomly, the result is more secure.
101
125
  email: esumbar@gmail.com
102
- executables:
103
- - passphrase
126
+ executables:
127
+ - passphrase
104
128
  extensions: []
105
-
106
- extra_rdoc_files:
107
- - LICENSE.txt
108
- - README.rdoc
109
- files:
110
- - Gemfile
111
- - Gemfile.lock
112
- - LICENSE.txt
113
- - README.rdoc
114
- - Rakefile
115
- - VERSION
116
- - bin/passphrase
117
- - lib/passphrase/data.rb
118
- - lib/passphrase/generator.rb
119
- - lib/passphrase/options.rb
120
- - lib/passphrase/random.rb
121
- - lib/passphrase/version.rb
122
- - lib/passphrase/wordlist.rb
123
- - test/test_options.rb
124
- - test/test_wordlist.rb
125
- has_rdoc: true
126
- homepage: http://github.com/esumbar/passphrase
127
- licenses: []
128
-
129
+ extra_rdoc_files: []
130
+ files:
131
+ - CHANGELOG.md
132
+ - LICENSE
133
+ - README.md
134
+ - bin/passphrase
135
+ - lib/passphrase.rb
136
+ - lib/passphrase/CLI.rb
137
+ - lib/passphrase/default.rb
138
+ - lib/passphrase/diceware_method.rb
139
+ - lib/passphrase/diceware_random.rb
140
+ - lib/passphrase/language_query.rb
141
+ - lib/passphrase/passphrase.rb
142
+ - lib/passphrase/version.rb
143
+ - lib/passphrase/word_query.rb
144
+ - lib/passphrase/wordlist/words.sqlite3
145
+ - spec/passphrase/cli_spec.rb
146
+ - spec/passphrase/diceware_method_spec.rb
147
+ - spec/passphrase/diceware_random_spec.rb
148
+ - spec/passphrase/language_query_spec.rb
149
+ - spec/passphrase/passphrase_spec.rb
150
+ - spec/passphrase/word_query_spec.rb
151
+ - spec/spec_helper.rb
152
+ homepage: https://github.com/esumbar/passphrase
153
+ licenses:
154
+ - MIT
155
+ metadata: {}
129
156
  post_install_message:
130
157
  rdoc_options: []
131
-
132
- require_paths:
133
- - lib
134
- required_ruby_version: !ruby/object:Gem::Requirement
135
- none: false
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- hash: 2
140
- segments:
141
- - 0
142
- version: "0"
143
- required_rubygems_version: !ruby/object:Gem::Requirement
144
- none: false
145
- requirements:
146
- - - ">="
147
- - !ruby/object:Gem::Version
148
- version: "0"
149
- requirements: []
150
-
158
+ require_paths:
159
+ - lib
160
+ required_ruby_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '1.9'
165
+ required_rubygems_version: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ requirements:
171
+ - SQLite 3 system library
151
172
  rubyforge_project:
152
- rubygems_version: 1.4.1
173
+ rubygems_version: 2.4.5
153
174
  signing_key:
154
- specification_version: 3
155
- summary: Generate a passphrase using the Diceware method.
156
- test_files:
157
- - test/test_options.rb
158
- - test/test_wordlist.rb
175
+ specification_version: 4
176
+ summary: Generate passphrases using the Diceware Method
177
+ test_files: []
178
+ has_rdoc:
metadata.gz.sig ADDED
Binary file