1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-26 23:33:03 +00:00

add install with gem

This commit is contained in:
nishiki 2015-06-21 23:45:25 +02:00
parent 107e9047dd
commit ccd188bc2f
17 changed files with 48 additions and 51 deletions

View file

@ -1,4 +1,10 @@
= CHANGELOG =
== v2.0.0 ==
* change format csv to yaml
* easy install with gem
* add sync with ftp and ssh
* many improvement
== v1.1.0 ==

View file

@ -1,23 +0,0 @@
all:
$(info 'Nothing todo!')
$(info 'Use make install or make uninstall')
dep-ubuntu:
apt-get install ruby ruby-gpgme ruby-highline ruby-i18n ruby-locale
install:
mkdir -p /usr/local/mpw
cp -r ./lib /usr/local/mpw/
cp -r ./i18n /usr/local/mpw/
cp ./mpw /usr/local/mpw/
ln -snf /usr/local/mpw/mpw /usr/local/bin/
cp ./mpw-server /usr/local/mpw/
ln -snf /usr/local/mpw/mpw-server /usr/local/bin/mpw-server
cp ./mpw-ssh /usr/local/mpw/
ln -snf /usr/local/mpw/mpw-ssh /usr/local/bin/mpw-ssh
uninstall:
rm /usr/local/bin/mpw-server
rm /usr/local/bin/mpw
rm /usr/local/bin/mpw-ssh
rm -rf /usr/local/mpw

View file

@ -1 +1 @@
2.0.0 - dev
2.0.0

View file

@ -9,10 +9,9 @@ require 'pathname'
require 'locale'
require 'set'
require 'i18n'
require_relative 'lib/UI/Cli'
require_relative 'lib/Config'
require_relative 'lib/MPW'
require 'mpw/mpw'
require 'mpw/config'
require 'mpw/ui/cli'
# --------------------------------------------------------- #
# Set local
@ -27,7 +26,7 @@ end
APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath)
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
I18n.load_path = Dir["#{APP_ROOT}/i18n/cli/*.yml"]
I18n.load_path = Dir["#{APP_ROOT}/../i18n/cli/*.yml"]
I18n.default_locale = :en
I18n.locale = lang.to_sym

View file

@ -8,9 +8,9 @@ require 'optparse'
require 'pathname'
require 'locale'
require 'i18n'
require 'mpw/server'
APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath)
require "#{APP_ROOT}/lib/Server.rb"
# --------------------------------------------------------- #
# Set local
@ -23,7 +23,7 @@ if defined?(I18n.enforce_available_locales)
end
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
I18n.load_path = Dir["#{APP_ROOT}/i18n/server/*.yml"]
I18n.load_path = Dir["#{APP_ROOT}/../i18n/server/*.yml"]
I18n.default_locale = :en
I18n.locale = lang.to_sym

View file

@ -8,23 +8,22 @@ require 'optparse'
require 'pathname'
require 'locale'
require 'i18n'
APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath)
require "#{APP_ROOT}/lib/UI/CliSSH"
require "#{APP_ROOT}/lib/Config"
lang = Locale::Tag.parse(ENV['LANG']).to_simple.to_s[0..1]
require 'mpw/ui/clissh'
require 'mpw/config'
# --------------------------------------------------------- #
# Set local
# --------------------------------------------------------- #
APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath)
lang = Locale::Tag.parse(ENV['LANG']).to_simple.to_s[0..1]
if defined?(I18n.enforce_available_locales)
I18n.enforce_available_locales = true
end
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
I18n.load_path = Dir["#{APP_ROOT}/i18n/cli/*.yml"]
I18n.load_path = Dir["#{APP_ROOT}/../i18n/cli/*.yml"]
I18n.default_locale = :en
I18n.locale = lang.to_sym

View file

@ -8,8 +8,7 @@ require 'csv'
require 'i18n'
require 'fileutils'
require 'yaml'
require_relative './Item'
require 'mpw/item'
module MPW
class MPW

View file

@ -7,9 +7,8 @@ require 'rubygems'
require 'i18n'
require 'yaml'
require 'tempfile'
require_relative './MPW'
require_relative './Item'
require 'mpw/mpw'
require 'mpw/item'
module MPW
class Sync
@ -32,13 +31,13 @@ module MPW
def get_remote
case @config.sync_type
when 'mpw'
require "#{APP_ROOT}/lib/Sync/SyncMPW"
require 'mpw/sync/mpw'
@sync = SyncMPW.new(@config.sync_host, @config.sync_user, @config.sync_pwd, @config.sync_path, @config.sync_port)
when 'sftp', 'scp', 'ssh'
require "#{APP_ROOT}/lib/Sync/SSH"
require 'mpw/sync/ssh'
@sync = SyncSSH.new(@config.sync_host, @config.sync_user, @config.sync_pwd, @config.sync_path, @config.sync_port)
when 'ftp'
require "#{APP_ROOT}/lib/Sync/FTP"
require 'mpw/sync/ftp'
@sync = SyncFTP.new(@config.sync_host, @config.sync_user, @config.sync_pwd, @config.sync_path, @config.sync_port)
else
@error_msg = I18n.t('error.unknown_type')

View file

@ -9,10 +9,9 @@ require 'pathname'
require 'readline'
require 'i18n'
require 'colorize'
require_relative '../Sync'
require_relative '../MPW'
require_relative '../Item'
require 'mpw/sync'
require 'mpw/mpw'
require 'mpw/item'
class Cli

View file

@ -3,7 +3,7 @@
# mail: nishiki@yaegashi.fr
# info: a simple script who manage your passwords
require "#{APP_ROOT}/lib/UI/Cli"
require 'mpw/ui/cli'
class CliSSH < Cli

19
mpw.gemspec Normal file
View file

@ -0,0 +1,19 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Gem::Specification.new do |spec|
spec.name = 'mpw'
spec.version = File.open('VERSION').read
spec.authors = ['nishiki']
spec.email = ['gems@yae.im']
spec.summary = 'Manage your password'
spec.description = 'Save and read your password with gpg'
spec.homepage = 'https://github.com/nishiki/checkupdate'
spec.license = 'GPL'
spec.files = `git ls-files -z`.split("\x0")
spec.executables = ['mpw', 'mpw-server']
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
end