Sha256: 3fd7168522ca9f8a82f7202019dfb5e1e957d0b61da0154438542ecc3ed14f80

Contents?: true

Size: 698 Bytes

Versions: 69

Compression:

Stored size: 698 Bytes

Contents

namespace :auth do
	namespace :password do
		desc "create password"
		task :create do
			require 'webrick/httpauth/htpasswd'
			puts 'create .htpasswd file'
			print 'Username: '
			ARGV.replace([])
			username = gets().chop
			print 'New password: '
			system "stty -echo"
			password = $stdin.gets.chop
			puts
			print 'Re-type new password: '
			password2 = $stdin.gets.chop
			puts
			system "stty echo"
			if password != password2
				raise StandardError, 'password verification error'
			else
				htpasswd = WEBrick::HTTPAuth::Htpasswd.new('.htpasswd')
				htpasswd.set_passwd(nil, username, password)
				htpasswd.flush
				puts "Adding password for user #{username}"
			end
		end
	end
end

Version data entries

69 entries across 58 versions & 1 rubygems

Version Path
tdiary-5.0.13 lib/tdiary/tasks/auth.rake
tdiary-5.0.12.1 lib/tdiary/tasks/auth.rake
tdiary-5.0.11 lib/tdiary/tasks/auth.rake
tdiary-5.0.10 lib/tdiary/tasks/auth.rake
tdiary-5.0.9 lib/tdiary/tasks/auth.rake
tdiary-5.0.8 lib/tdiary/tasks/auth.rake
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/lib/tdiary/tasks/auth.rake
tdiary-5.0.7 lib/tdiary/tasks/auth.rake
tdiary-5.0.6 lib/tdiary/tasks/auth.rake
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.3/lib/tdiary/tasks/auth.rake
tdiary-5.0.5 lib/tdiary/tasks/auth.rake
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/lib/tdiary/tasks/auth.rake
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/tdiary-5.0.3/lib/tdiary/tasks/auth.rake
tdiary-5.0.4 lib/tdiary/tasks/auth.rake
tdiary-5.0.4 vendor/bundle/gems/tdiary-5.0.3/lib/tdiary/tasks/auth.rake
tdiary-5.0.3 lib/tdiary/tasks/auth.rake
tdiary-5.0.2 lib/tdiary/tasks/auth.rake
tdiary-5.0.1 lib/tdiary/tasks/auth.rake
tdiary-5.0.0 lib/tdiary/tasks/auth.rake
tdiary-4.2.1 lib/tdiary/tasks/auth.rake