safedb 0.5.1003 → 0.5.1005

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc97d7955c363f290d97994018b73806d1d465fdc8628bc299069bc0b4c2a43c
4
- data.tar.gz: a0885f01b7fd396cf0860df2ba1383fb58222e62ebd298febf5c2aaa898ab071
3
+ metadata.gz: 637a4011eceb0a65ec0139c499d2494576ff9cfbdbd90c84907e9ed734753438
4
+ data.tar.gz: 48ac523f4c4f0d457bdd6a9ddfa1ca87e5c19ee1deb62c49bd14a7129cda9aae
5
5
  SHA512:
6
- metadata.gz: 989bd998cc21841345b12f8bb2d3a74191203ce11d9895cd54e000fc597804988fe80cf76d0874a2d3c60e8e3a1d1bc1addf36f1db7a8c8edaef815b4c78091a
7
- data.tar.gz: 35856adea81b13c0940c2ef8ce122fdfa19ebbdfad734a8eb6dad08f3e430c7b803c68afd54a68a88abb0b8ec91a74b2c58797c631233b8f1729ca484b54eb21
6
+ metadata.gz: c4064ea7b9b61840733de27aec02d99e2cd2fd9d60ad9b8b41b130a77cf0606a04c25229580b25c3bc5af472eab08727fbef4d33f0b13a970246091e64bc19ef
7
+ data.tar.gz: 30c16510557f03cdcfdf4f78cf3c64f7701cfd8ca0418a6af2a11ff517071c5e2bbfced54cd401a31aa058bb1b50ae214f5894d4978a0d34d5daa1061bc601ea
data/CONTRIBUTING.md CHANGED
@@ -9,7 +9,7 @@ You can contriubute software, documentation, issues and even good ideas. Most co
9
9
  To contribute software you'll need to setup a development environment.
10
10
 
11
11
  ```
12
- sudo apt-get install --assume-yes ruby-full libicu-dev git
12
+ sudo apt install --assume-yes ruby-full libicu-dev git
13
13
  sudo chown -R $USER:$USER /var/lib/gems
14
14
  sudo chown -R $USER:$USER /usr/local/bin
15
15
  sudo chown -R $USER:$USER /usr/local/lib
data/lib/cli.rb CHANGED
@@ -205,19 +205,9 @@ class CLI < Thor
205
205
 
206
206
 
207
207
  # Description of the diff use case command from the point of view
208
- # of either a refresh from master to branch, a commit from branch
209
- # to master or a diff listing prophesying about both.
210
- desc "diff", "master and branch diff with --commit (-i), --refresh (-o) or both."
211
-
212
- # A commit is basically a copy-overwrite operation which does not finesse
213
- # like the merging refresh does. The diff report illustrates that the master
214
- # will essentially reflect the working branch's current state.
215
- method_option :commit, :type => :boolean, :aliases => "-c"
216
-
217
- # A refresh is effectively an incoming merge of the master's data
218
- # structure into the working branch. With refreshs nothing ever gets
219
- # deleted.
220
- method_option :refresh, :type => :boolean, :aliases => "-r"
208
+ # of either a refresh from master to branch, or a commit from branch
209
+ # to master, depending on what is permissible given the state.
210
+ desc "diff", "master and branch diff that indicates whether a commit or refresh can happen."
221
211
 
222
212
  # The <b>diff use case</b> spells out the key differences between the safe book
223
213
  # on the master line the one on the current working branch.
@@ -225,11 +215,8 @@ class CLI < Thor
225
215
  # By default when conflicts occur, priority is given to the current working branch.
226
216
  # No parameters are required to perform a diff.
227
217
  def diff
228
- log.info(x) { "prophesy list of refresh and/or commit actions. CLI options are #{options.to_s()}" }
229
- diff_uc = SafeDb::Diff.new()
230
- diff_uc.commit = true if options[ :commit ]
231
- diff_uc.refresh = true if options[ :refresh ]
232
- diff_uc.flow()
218
+ log.info(x) { "prophesy list of either refresh or commit actions." }
219
+ SafeDb::Diff.new().flow()
233
220
  end
234
221
 
235
222
 
@@ -35,34 +35,28 @@ module SafeDb
35
35
  #
36
36
  class Diff < Controller
37
37
 
38
- # The commit and refresh boolean flags that signal which way round to do the diff
39
- attr_writer :commit, :refresh
40
-
41
38
  # The <b>diff use case</b> compares the database state of the branch with
42
39
  # that of the master and displays the results without masking sensitive
43
40
  # credentials.
44
41
  def execute
45
42
 
46
- print_both = @commit.nil?() && @refresh.nil?()
47
- print_commit = !@commit.nil?() || print_both
48
- print_refresh = !@refresh.nil?() || print_both
49
-
50
- puts ""
51
- puts " == Birth Day := #{@book.init_time()}\n"
52
- puts " == Book Name := #{@book.book_name()} [#{@book.book_id}]\n"
53
- puts " == Book Mark := #{@book.get_open_chapter_name()}/#{@book.get_open_verse_name()}\n" if @book.is_opened?()
54
- puts ""
55
-
56
43
  master_data = @book.to_master_data()
57
44
  branch_data = @book.to_branch_data()
58
45
 
59
- StateInspect.refresh_prophecies( master_data, branch_data ) if print_refresh
60
- StateInspect.commit_prophecies( master_data, branch_data ) if print_commit
61
-
62
46
  puts ""
63
47
  puts " master has #{master_data.length()} chapters, and #{@book.get_master_verse_count()} verses.\n"
64
48
  puts " branch has #{branch_data.length()} chapters, and #{@book.get_branch_verse_count()} verses.\n"
65
49
  puts ""
50
+ puts " You can commit to (or refresh from) the master branch." if @book.can_commit?()
51
+ puts " List of commit differences" if @book.can_commit?()
52
+ puts " You must refresh from the master branch." unless @book.can_commit?()
53
+ puts " List of refresh differences" unless @book.can_commit?()
54
+ puts ""
55
+
56
+ StateInspect.refresh_prophecies( master_data, branch_data ) unless @book.can_commit?()
57
+ StateInspect.commit_prophecies( master_data, branch_data ) if @book.can_commit?()
58
+
59
+ puts ""
66
60
 
67
61
  end
68
62
 
@@ -95,13 +95,7 @@ module SafeDb
95
95
  # @param master_data [Hash] data structure from the master line of the book
96
96
  # @param branch_data [Hash] data structure from the current working branch
97
97
  def self.refresh_prophecies( master_data, branch_data )
98
-
99
- puts " = safe diff --refresh"
100
- puts " = incoming from master to working branch"
101
- puts ""
102
-
103
98
  data_differences( master_data, branch_data )
104
-
105
99
  end
106
100
 
107
101
 
@@ -122,14 +116,8 @@ module SafeDb
122
116
  # @param master_data [Hash] data structure from the master line of the book
123
117
  # @param branch_data [Hash] data structure from the current working branch
124
118
  def self.commit_prophecies( master_data, branch_data )
125
-
126
- puts " = safe diff --commit"
127
- puts " = outgoing from working branch to master"
128
- puts ""
129
-
130
119
  data_differences( branch_data, master_data )
131
120
  drop_differences( master_data, branch_data )
132
-
133
121
  end
134
122
 
135
123
 
@@ -204,31 +192,31 @@ module SafeDb
204
192
 
205
193
 
206
194
  def self.print_chapter_2b_added( fq_chap_name )
207
- puts " + Chapter 2b added -> #{fq_chap_name}"
195
+ puts " + Chapter 2b added -> #{fq_chap_name}"
208
196
  end
209
197
 
210
198
  def self.print_verse_2_be_added( fq_vers_name )
211
- puts " + Verse 2 be added -> #{fq_vers_name}"
199
+ puts " + Verse 2 be added -> #{fq_vers_name}"
212
200
  end
213
201
 
214
202
  def self.print_line_to_be_added( fq_line_name )
215
- puts " + Line to be added -> #{fq_line_name}"
203
+ puts " + Line to be added -> #{fq_line_name}"
216
204
  end
217
205
 
218
206
  def self.print_line_will_change( fq_line_name )
219
- puts " + Line will change -> #{fq_line_name}"
207
+ puts " + Line will change -> #{fq_line_name}"
220
208
  end
221
209
 
222
210
  def self.print_chapter_2b_removed( fq_chap_name )
223
- puts " - Chapter 2b removed -> #{fq_chap_name}"
211
+ puts " - Chapter 2b removed -> #{fq_chap_name}"
224
212
  end
225
213
 
226
214
  def self.print_verse_2_be_removed( fq_vers_name )
227
- puts " - Verse 2 be removed -> #{fq_vers_name}"
215
+ puts " - Verse 2 be removed -> #{fq_vers_name}"
228
216
  end
229
217
 
230
218
  def self.print_line_to_be_removed( fq_line_name )
231
- puts " - Line to be removed -> #{fq_line_name}"
219
+ puts " - Line to be removed -> #{fq_line_name}"
232
220
  end
233
221
 
234
222
 
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SafeDb
2
- VERSION = "0.5.1003"
2
+ VERSION = "0.5.1005"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safedb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1003
4
+ version: 0.5.1005
5
5
  platform: ruby
6
6
  authors:
7
7
  - Apollo Akora
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-27 00:00:00.000000000 Z
11
+ date: 2019-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt