app_stack 1.4.4 → 1.5.0
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 +8 -8
- data/lib/app_stack/app.rb +1 -1
- data/lib/app_stack/cli_options.rb +3 -3
- data/lib/app_stack/compare_list.rb +16 -2
- data/lib/app_stack/operator.rb +15 -0
- data/lib/app_stack/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDM0Y2Q5OGY5NDkwMDliNmVhNzUwNTVlNWFkYTJkYWNhYjI3YjhmZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjdjNDQ0NzVjNzlkYjYxNWE5OGRhNjg3N2E3ZmUxOTg5MmVjODFjNg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmFhOTcwNjI5NjhkM2JiNjcyODc0Y2RiMTBjOWYwMjhkNWU1ZGU0ZWNjMGMz
|
10
|
+
YjhjYjNkZGYyYjAxY2IzZDc4MmFlNmQ1ODM1OGUzYzc0Mjk4Mjc4NmU2MGEw
|
11
|
+
M2FlN2VhNTYyODE3YjhhNTU5ODcxNGZkMTc2NzA1ZjkyYWUwMDc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjA2MjRkZTk2NTUyOTI3NmVjYzE3YmM4MjgyMmEyM2Q2MDJiMmM0OTZkNTFm
|
14
|
+
M2RkN2E5YWFmNWQxNTdhZTNmMDQwYTA2NTkwMWMzNzM3ZTJlMjNmZWMyMzA1
|
15
|
+
OGQwNzllZmEwMGNiMDg5N2EwYjlkMzU5ZTI1NzJkMzYyZGNlODM=
|
data/lib/app_stack/app.rb
CHANGED
@@ -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, :
|
9
|
+
attr_accessor :force, :simulate, :verbose, :reverse, :conf_file
|
10
10
|
|
11
11
|
def initialize(argv = ARGV)
|
12
12
|
parse_opt!(argv)
|
@@ -33,8 +33,8 @@ module AppStack
|
|
33
33
|
self.simulate = true
|
34
34
|
end
|
35
35
|
|
36
|
-
opts.on('-r', '--
|
37
|
-
self.
|
36
|
+
opts.on('-r', '--reverse', 'copy local update to remote') do
|
37
|
+
self.reverse = true
|
38
38
|
end
|
39
39
|
|
40
40
|
opts.on('--verbose', 'show debug messages') do
|
@@ -10,6 +10,13 @@ module AppStack
|
|
10
10
|
@to_file ||= to_app.get_file_path(from_file_short_name)
|
11
11
|
end
|
12
12
|
|
13
|
+
def reverse!
|
14
|
+
fail 'can not reverse an import or render item' if import? || render?
|
15
|
+
from_app_, from_file_ = from_app.dup, from_file.dup
|
16
|
+
@from_app, @from_file = to_app, to_file
|
17
|
+
@to_app, @to_file = from_app_, from_file_
|
18
|
+
end
|
19
|
+
|
13
20
|
def render?
|
14
21
|
render ? true : false
|
15
22
|
end
|
@@ -57,8 +64,15 @@ module AppStack
|
|
57
64
|
end
|
58
65
|
|
59
66
|
def label
|
60
|
-
"#{operation} #{from_file_short_name.blue} from " +
|
61
|
-
|
67
|
+
str = "#{operation} #{from_file_short_name.blue} from " +
|
68
|
+
"#{from_app.app_name.bold}"
|
69
|
+
str << "as #{to_file_short_name.blue}" unless
|
70
|
+
to_file_short_name == from_file_short_name
|
71
|
+
str
|
72
|
+
end
|
73
|
+
|
74
|
+
def reverse_label
|
75
|
+
"Copy back #{from_file_short_name.blue} to #{to_app.app_name.bold}"
|
62
76
|
end
|
63
77
|
|
64
78
|
def skip(msg)
|
data/lib/app_stack/operator.rb
CHANGED
@@ -35,6 +35,21 @@ module AppStack
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
def do_reverse!
|
39
|
+
@rev_list = {}
|
40
|
+
@diff_list.each_with_index do |f, i|
|
41
|
+
f.reverse!
|
42
|
+
puts "[#{i + 1}] " + f.reverse_label
|
43
|
+
@rev_list[i + 1] = f
|
44
|
+
end
|
45
|
+
|
46
|
+
puts "Which file you want to copy reversely?"
|
47
|
+
print "(1 2 ...):"
|
48
|
+
lists = gets.chomp.split(/\s+/)
|
49
|
+
lists.each { |i| fail "unknown option #{i}" unless @rev_list[i.to_i] }
|
50
|
+
lists.each { |i| @rev_list[i.to_i].process }
|
51
|
+
end
|
52
|
+
|
38
53
|
private
|
39
54
|
|
40
55
|
def do_copy!
|
data/lib/app_stack/version.rb
CHANGED
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.
|
4
|
+
version: 1.5.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-
|
11
|
+
date: 2013-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|