1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-23 13:57:52 +00:00

add require_relative

This commit is contained in:
nishiki 2015-02-08 22:54:04 +01:00
parent 24949b2bde
commit 4569ad4d1c
5 changed files with 18 additions and 17 deletions

View file

@ -1,15 +1,13 @@
#!/usr/bin/ruby #!/usr/bin/ruby
# author: nishiki # author: nishiki
# mail: nishiki@yaegashi.fr # mail: nishiki@yaegashi.fr
# info: a simple script who manage your passwords
module MPW require 'rubygems'
require 'gpgme'
require 'rubygems' require 'yaml'
require 'gpgme' require 'i18n'
require 'yaml'
require 'i18n'
module MPW
class Config class Config
attr_accessor :error_msg attr_accessor :error_msg
@ -231,5 +229,4 @@ module MPW
end end
end end
end end

View file

@ -8,7 +8,8 @@ require 'csv'
require 'i18n' require 'i18n'
require 'fileutils' require 'fileutils'
require 'yaml' require 'yaml'
require "#{APP_ROOT}/lib/Item"
require_relative './Item'
module MPW module MPW
class MPW class MPW

View file

@ -7,8 +7,9 @@ require 'rubygems'
require 'i18n' require 'i18n'
require 'yaml' require 'yaml'
require 'tempfile' require 'tempfile'
require "#{APP_ROOT}/lib/Item"
require "#{APP_ROOT}/lib/MPW" require_relative './MPW'
require_relative './Item'
module MPW module MPW
class Sync class Sync

View file

@ -10,8 +10,9 @@ require 'readline'
require 'i18n' require 'i18n'
require 'colorize' require 'colorize'
require "#{APP_ROOT}/lib/MPW" require_relative '../Sync'
require "#{APP_ROOT}/lib/Sync" require_relative '../MPW'
require_relative '../Item'
class Cli class Cli

9
mpw
View file

@ -10,10 +10,9 @@ require 'locale'
require 'set' require 'set'
require 'i18n' require 'i18n'
APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath) require_relative 'lib/UI/Cli'
require "#{APP_ROOT}/lib/UI/Cli" require_relative 'lib/Config'
require "#{APP_ROOT}/lib/Config" require_relative 'lib/MPW'
require "#{APP_ROOT}/lib/MPW"
# --------------------------------------------------------- # # --------------------------------------------------------- #
# Set local # Set local
@ -25,6 +24,8 @@ if defined?(I18n.enforce_available_locales)
I18n.enforce_available_locales = true I18n.enforce_available_locales = true
end end
APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath)
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks) 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.default_locale = :en