have-i-been-pwned 0.1.3 → 0.1.4

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: 6f95a981da0f20f1e2c806004d2a3da6f7e79b8ed57ac42d9e6ffe273d57d271
4
- data.tar.gz: cf2d95d6bbe8fc36194231a73df3064f5204c024e6a21721f352be403103642f
3
+ metadata.gz: d3621359489c64f4503be953fc536f1eb9857cd265ce6612ecd7b390186e6ec3
4
+ data.tar.gz: 3ddce5f41c4299ae05cd8a111687cc654e0f7f15f9c83f225b5cfe4daae7a8e7
5
5
  SHA512:
6
- metadata.gz: 921d961fb4f5b67ad7a5722ab79b6e2d119dbeba59840ca42a4727d782a411b4d360c6987ebcb25f4644d4a94531e2dcedfd7541dfeb81a886e896f717153c82
7
- data.tar.gz: a9871a8501af72618ee35f540f8a2f88e66bc60baa8049e24e587ed1da061b1bcb35f5b19f48e0d54a14a0952b4840b00bd3354bd1373b5bd995bdc461a9dd6c
6
+ metadata.gz: e6e57981128c2a131d438970a801136e0cfdc22c9c36968ab43caa6e54f83098dafca4fd2154d473365cea727a266068b7debdbd235c552c191be4195369fb61
7
+ data.tar.gz: 045577c3974e630d30468782e7d179e76eb8269e6f94b067de4cbceebf01eb2a1358caa744d02f1fd37d39492364a0d3a50a3492d888cb7768f97a23b59d02d8
data/.gitignore CHANGED
@@ -1,5 +1,4 @@
1
1
  Gemfile.lock
2
2
  pkg/
3
3
  coverage/
4
- bin/*
5
4
  *.gem
data/.travis.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.0.0
3
4
  - 2.3.1
4
5
  script:
5
6
  - bundle exec rake
data/README.md CHANGED
@@ -37,8 +37,8 @@ end
37
37
  - Open an issue about your change
38
38
  - Fork it, DL it
39
39
  - Run `bundle`
40
- - Run `rake test`
40
+ - Run `bundle exec rake`
41
41
  - Make your additions, changes, fixes, etc. (Do not make changes to version, Rakefile or spec
42
42
  - Add tests for the above (no pr acceptance without them)
43
- - Run `rake test`
43
+ - Run `bundle exec rake`
44
44
  - Make your PR. :smile:
data/bin/bundle ADDED
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "rubygems"
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($0) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV["BUNDLER_VERSION"]
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
+ bundler_version = nil
28
+ update_index = nil
29
+ ARGV.each_with_index do |a, i|
30
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31
+ bundler_version = a
32
+ end
33
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34
+ bundler_version = $1 || ">= 0.a"
35
+ update_index = i
36
+ end
37
+ bundler_version
38
+ end
39
+
40
+ def gemfile
41
+ gemfile = ENV["BUNDLE_GEMFILE"]
42
+ return gemfile if gemfile && !gemfile.empty?
43
+
44
+ File.expand_path("../../Gemfile", __FILE__)
45
+ end
46
+
47
+ def lockfile
48
+ lockfile =
49
+ case File.basename(gemfile)
50
+ when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
51
+ else "#{gemfile}.lock"
52
+ end
53
+ File.expand_path(lockfile)
54
+ end
55
+
56
+ def lockfile_version
57
+ return unless File.file?(lockfile)
58
+ lockfile_contents = File.read(lockfile)
59
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60
+ Regexp.last_match(1)
61
+ end
62
+
63
+ def bundler_version
64
+ @bundler_version ||= begin
65
+ env_var_version || cli_arg_version ||
66
+ lockfile_version || "#{Gem::Requirement.default}.a"
67
+ end
68
+ end
69
+
70
+ def load_bundler!
71
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
72
+
73
+ # must dup string for RG < 1.8 compatibility
74
+ activate_bundler(bundler_version.dup)
75
+ end
76
+
77
+ def activate_bundler(bundler_version)
78
+ if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0")
79
+ bundler_version = "< 2"
80
+ end
81
+ gem_error = activation_error_handling do
82
+ gem "bundler", bundler_version
83
+ end
84
+ return if gem_error.nil?
85
+ require_error = activation_error_handling do
86
+ require "bundler/version"
87
+ end
88
+ return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))
89
+ warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`"
90
+ exit 42
91
+ end
92
+
93
+ def activation_error_handling
94
+ yield
95
+ nil
96
+ rescue StandardError, LoadError => e
97
+ e
98
+ end
99
+ end
100
+
101
+ m.load_bundler!
102
+
103
+ if m.invoked_as_script?
104
+ load Gem.bin_path("bundler", "bundle")
105
+ end
data/bin/httparty ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'httparty' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("httparty", "httparty")
data/bin/rake ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rake' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rake", "rake")
@@ -10,9 +10,11 @@ Gem::Specification.new do |s|
10
10
  s.date = '2019-06-27'
11
11
  s.summary = 'Check to see if your passwords are safe'
12
12
  s.description = 'A simple gem to check and see if a given password was compromised by a hack. Special thanks to Troy Hunt for facilitating haveibeenpwned.'
13
- s.authors = ["Dale Myszewski"]
13
+ s.authors = ['Dale Myszewski']
14
14
  s.email = 'dale@daleslab.com'
15
- s.homepage = "https://github.com/Dales-Lab/haveibeenpwned-ruby-sdk"
15
+ s.homepage = 'https://github.com/Dales-Lab/haveibeenpwned-ruby-sdk'
16
+
17
+ s.required_ruby_version = '>= 2.0.0'
16
18
 
17
19
  s.add_runtime_dependency "httparty"
18
20
 
@@ -26,6 +28,6 @@ Gem::Specification.new do |s|
26
28
  test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
27
29
 
28
30
  s.files = all_files - test_files
29
- s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
30
- s.require_paths = ["lib"]
31
+ s.executables = `git ls-files -- {bin}/*`.split("\n").map { |f| File.basename(f) }
32
+ s.require_paths = ['lib']
31
33
  end
@@ -12,7 +12,7 @@ module HaveIBeenPwned
12
12
  first_five = digest[0..4]
13
13
  # make the API call
14
14
  results = HTTParty.get("https://api.pwnedpasswords.com/range/#{first_five}")
15
-
15
+
16
16
  # guard: if we dont get something back
17
17
  return unless results.code == 200
18
18
 
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module HaveIBeenPwned
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
data/test/helper.rb CHANGED
@@ -10,5 +10,5 @@ SimpleCov.formatter = SimpleCov::Formatter::Codecov
10
10
  require 'test/unit'
11
11
  require 'mocha/setup'
12
12
 
13
- require 'have_i_been_pwned'
13
+ require 'have-i-been-pwned'
14
14
  require 'version'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: have-i-been-pwned
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Myszewski
@@ -108,9 +108,12 @@ files:
108
108
  - LICENSE
109
109
  - README.md
110
110
  - Rakefile
111
+ - bin/bundle
112
+ - bin/httparty
113
+ - bin/rake
111
114
  - codecov.yml
112
115
  - have-i-been-pwned.gemspec
113
- - lib/have_i_been_pwned.rb
116
+ - lib/have-i-been-pwned.rb
114
117
  - lib/version.rb
115
118
  - test/helper.rb
116
119
  - test/test_have_i_been_pwned.rb
@@ -127,7 +130,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
130
  requirements:
128
131
  - - ">="
129
132
  - !ruby/object:Gem::Version
130
- version: '0'
133
+ version: 2.0.0
131
134
  required_rubygems_version: !ruby/object:Gem::Requirement
132
135
  requirements:
133
136
  - - ">="