app_stack 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDM0Y2Q5OGY5NDkwMDliNmVhNzUwNTVlNWFkYTJkYWNhYjI3YjhmZQ==
4
+ ZTk2N2NhYjI5MjYyNzhiOWY0NDA2NzY4NWRmNWY1M2IxMjk3NGQyMA==
5
5
  data.tar.gz: !binary |-
6
- YjdjNDQ0NzVjNzlkYjYxNWE5OGRhNjg3N2E3ZmUxOTg5MmVjODFjNg==
6
+ NDcxNzJmMTI2M2E1ZDU5ZmNmOTZhYjVhY2U0NmM3Y2Y4MTEyYWUyMg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZmFhOTcwNjI5NjhkM2JiNjcyODc0Y2RiMTBjOWYwMjhkNWU1ZGU0ZWNjMGMz
10
- YjhjYjNkZGYyYjAxY2IzZDc4MmFlNmQ1ODM1OGUzYzc0Mjk4Mjc4NmU2MGEw
11
- M2FlN2VhNTYyODE3YjhhNTU5ODcxNGZkMTc2NzA1ZjkyYWUwMDc=
9
+ YmE3NjFkM2U4YmRkMjU0NjM2NDhhMjQ2NzJhYTVlMjcxMjJjOTE5YTA4Njll
10
+ ODY5Zjg3ZjE1NmJmMzc3YTBjMDFiOGE0MjVkNjJkYWE5NjY3MzlmZTU0MjUz
11
+ MWJlODBjMjA5NWM2ZGViZTg2OWNkNmU0Mjg3YzMyMDdmNzE1NWI=
12
12
  data.tar.gz: !binary |-
13
- MjA2MjRkZTk2NTUyOTI3NmVjYzE3YmM4MjgyMmEyM2Q2MDJiMmM0OTZkNTFm
14
- M2RkN2E5YWFmNWQxNTdhZTNmMDQwYTA2NTkwMWMzNzM3ZTJlMjNmZWMyMzA1
15
- OGQwNzllZmEwMGNiMDg5N2EwYjlkMzU5ZTI1NzJkMzYyZGNlODM=
13
+ OTFjNGNiYzkyMjA4ZjFkOGNkMjg5YmMyNWZiNGI0YWQ5MjNhYzcyNTc2OGUy
14
+ YzkxY2M3MGQxMTdiYmFlNzgxYTQ3NzBmNTFmNDNhY2E1YzNmYjEyZjAzMGMy
15
+ ZDA5ZGUyZGY5NjJiOGYxMDlmMmIwYjgxNDJlODVhMzFhY2E1NTQ=
@@ -6,7 +6,7 @@ module AppStack
6
6
  # parse command line options based
7
7
  # rubocop:disable MethodLength
8
8
  class CliOptions
9
- attr_accessor :force, :simulate, :verbose, :reverse, :conf_file
9
+ attr_accessor :force, :simulate, :verbose, :reverse, :print, :conf_file
10
10
 
11
11
  def initialize(argv = ARGV)
12
12
  parse_opt!(argv)
@@ -37,6 +37,10 @@ module AppStack
37
37
  self.reverse = true
38
38
  end
39
39
 
40
+ opts.on('-p', '--print', 'print copy relationships') do
41
+ self.print = true
42
+ end
43
+
40
44
  opts.on('--verbose', 'show debug messages') do
41
45
  self.verbose = true
42
46
  end
@@ -29,6 +29,7 @@ module AppStack
29
29
 
30
30
  def merge!
31
31
  case
32
+ when AppStack.options.print then do_print!
32
33
  when AppStack.options.force then do_copy!
33
34
  when AppStack.options.simulate then do_simulate!
34
35
  else diff_list.size > 0 ? do_warn : do_copy!
@@ -50,6 +51,27 @@ module AppStack
50
51
  lists.each { |i| @rev_list[i.to_i].process }
51
52
  end
52
53
 
54
+ def do_print!
55
+ print_list = {}
56
+ compare_list.each do |f|
57
+ next unless File.exists?(f.to_file)
58
+
59
+ print_list[f.to_file] = f
60
+ end
61
+
62
+ mapper = {}
63
+ app_stacks.keys.each { |k| mapper[k] = [] }
64
+ print_list.keys.sort.each do |k|
65
+ f = print_list[k]
66
+ mapper[f.from_app.app_name] << f
67
+ end
68
+
69
+ mapper.each do |k, list|
70
+ puts "From #{k.to_s.bold.green}"
71
+ list.each { |f| puts " - #{f.to_file_short_name.blue}" }
72
+ end
73
+ end
74
+
53
75
  private
54
76
 
55
77
  def do_copy!
@@ -2,5 +2,5 @@
2
2
 
3
3
  # AppStack module
4
4
  module AppStack
5
- VERSION = '1.5.0'
5
+ VERSION = '1.6.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Huang Wei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-03 00:00:00.000000000 Z
11
+ date: 2013-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt