mpw 2.0.2 → 2.0.3

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
  SHA1:
3
- metadata.gz: 83b01402c23162d2d8f853020c7d8df6696b2d94
4
- data.tar.gz: 48d15d148e7cffd1d6bac0cd9a11cbc94de99859
3
+ metadata.gz: 6bb4b82dd0d113ea933f35498f0c06d204da9dd4
4
+ data.tar.gz: 6e8e787417bab3e9e5a467af6f44f99569385c0b
5
5
  SHA512:
6
- metadata.gz: dd2b6305bf72d37cb9e761eabb7c08ccb89703e4d38f448d889ccae4ea1bf8640454b56562a049e3dd8c7528f42a244090ca23db8e438b99d7c3b620f973db3e
7
- data.tar.gz: 114e56593d7ef5528e84288b6ea9672606daa6fd7d61bd494c1642ce3ba34802b1b47758638ff5744464e1cd5b59cb76c27db208a3233a85ac247c89d1262188
6
+ metadata.gz: a64bfc419f4a5ff32bf19e4c187840a0ae5929695da310d9efa7fdbc7d3f1352e6fc11270a74b6b609996eda13079f946a6faf30342cb95529337847a4f0901a
7
+ data.tar.gz: 6783a408ea98e5994845d552f5797a5cd3a30c7a921d4162ca03f46b5a2bb5bd8d9065df30a84fa8c2631b321d1e81ee9ea970ff00e062c739f9581894c823a3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.2
1
+ 2.0.3
data/bin/mpw CHANGED
@@ -37,6 +37,7 @@ I18n.locale = lang.to_sym
37
37
  options = {}
38
38
  options[:force] = false
39
39
  options[:format] = false
40
+ options[:sync] = true
40
41
  options[:group] = nil
41
42
  options[:config] = nil
42
43
 
@@ -98,6 +99,10 @@ OptionParser.new do |opts|
98
99
  options[:force] = true
99
100
  end
100
101
 
102
+ opts.on('-N', '--no-sync', I18n.t('option.no_sync')) do
103
+ options[:sync] = false
104
+ end
105
+
101
106
  opts.on('-G', '--generate-password [LENGTH]', I18n.t('option.generate_password')) do |length|
102
107
  puts MPW::MPW::password(length)
103
108
  exit 0
@@ -126,7 +131,7 @@ elsif not config.check_gpg_key?
126
131
  end
127
132
 
128
133
  cli.decrypt
129
- cli.sync
134
+ cli.sync(options[:sync])
130
135
 
131
136
  # Display the item's informations
132
137
  if not options[:show].nil?
data/i18n/cli/en.yml CHANGED
@@ -52,6 +52,7 @@ en:
52
52
  type: "Data's type export file [csv|yaml]"
53
53
  import: "Import item since a yaml or csv file"
54
54
  force: "Force an action"
55
+ no_sync: "Disable synchronization with the server"
55
56
  format: "Change the display items format by an alternative format"
56
57
  generate_password: "Generate a random password (default 8 characters)"
57
58
  help: "Show this help message"
data/i18n/cli/fr.yml CHANGED
@@ -52,6 +52,7 @@ fr:
52
52
  type: "Format des données du fichier d'export [csv|yaml]"
53
53
  import: "Importe des éléments depuis un fichier yaml ou csv"
54
54
  force: "Force une action, l'action ne demandera pas de confirmation"
55
+ no_sync: "Désactive la synchronisation avec le serveur"
55
56
  format: "Change le format d'affichage des éléments par un alternatif"
56
57
  generate_password: "Génére un mot de passe aléatoire (défaut 8 caractères)"
57
58
  help: "Affiche ce message d'aide"
data/lib/mpw/ui/cli.rb CHANGED
@@ -23,8 +23,15 @@ class Cli
23
23
  end
24
24
 
25
25
  # Sync the data with the server
26
+ # @args: allow_sync -> allow or disable sync (boolean)
26
27
  # @rtnr: true if the synchro is finish
27
- def sync
28
+ def sync(allow_sync=nil)
29
+ if not allow_sync.nil?
30
+ @allow_sync = allow_sync
31
+ end
32
+
33
+ return true if not @allow_sync
34
+
28
35
  @sync = MPW::Sync.new(@config, @mpw, @password)
29
36
 
30
37
  raise(@sync.error_msg) if not @sync.get_remote
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mpw
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - nishiki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-19 00:00:00.000000000 Z
11
+ date: 2015-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n