app_stack 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -65,7 +65,7 @@ module AppStack
65
65
  @copy_candidates.each do |t, f|
66
66
  if File.exists?(t)
67
67
  diff = Diffy::Diff.new(f, t, :source => 'files')
68
- if diff
68
+ if diff.to_s.chomp.size > 0
69
69
  @diffs[t] = diff
70
70
  @copy_files[t] = f
71
71
  else
@@ -84,7 +84,7 @@ module AppStack
84
84
  echo 'final diff list: ', @diffs
85
85
  echo 'final render lists: ', @render_files
86
86
 
87
- if @diffs.keys.size > 0
87
+ if @diffs.keys.size > 0 and !@options.force
88
88
  ask_diffs # quit, copy and show diffs special files
89
89
  else
90
90
  do_copy!
@@ -99,9 +99,10 @@ module AppStack
99
99
  puts "[#{i.to_s.bold}] " + short_path(t).blue
100
100
  puts "from: #{@copy_files[t].blue}"
101
101
  puts diff.to_s(:color)
102
+ i += 1
102
103
  end
103
104
 
104
- puts "use -f (--option) option to overwrite all files,"
105
+ puts "use -f (--force) option to overwrite all files,"
105
106
  puts "or 'touch' local file to disable warn for specific file."
106
107
  end
107
108
 
@@ -122,12 +123,15 @@ module AppStack
122
123
 
123
124
  def copy_file!(fr, to)
124
125
  target_dir = File.dirname(to)
126
+ puts "copy #{fr.blue} \n to: " + to.green.bold
127
+ return if @options.simulate
125
128
  FileUtils.mkdir_p target_dir unless File.directory?(target_dir)
126
- puts "copied #{fr.blue} \n to: " + to.green.bold
127
129
  FileUtils.cp_r fr, to
128
130
  end
129
131
 
130
132
  def render_file!(fr, to)
133
+ puts "reader #{fr.blue}\n to: " + to.green.bold
134
+ return if @options.simulate
131
135
  oh = File.open(to, 'wb')
132
136
  if fr.match(/\.liquid$/)
133
137
  require 'liquid'
@@ -138,7 +142,6 @@ module AppStack
138
142
  oh.write tilt.render(OpenStruct.new(attrs))
139
143
  end
140
144
  oh.close
141
- puts "readered #{fr.blue}\n to: " + to.green.bold
142
145
  end
143
146
  end
144
147
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # AppStack module
4
4
  module AppStack
5
- VERSION = '1.3.3'
5
+ VERSION = '1.3.4'
6
6
  end
data/tags CHANGED
@@ -7,39 +7,38 @@
7
7
  AppStack lib/app_stack.rb /^module AppStack$/;" m
8
8
  AppStack lib/app_stack/copy_list_builder.rb /^module AppStack$/;" m
9
9
  AppStack lib/app_stack/local_files_parser.rb /^module AppStack$/;" m
10
- AppStack lib/app_stack/merger.rb /^module AppStack$/;" m
11
10
  AppStack lib/app_stack/stack_app.rb /^module AppStack$/;" m
12
11
  AppStack lib/app_stack/version.rb /^module AppStack$/;" m
13
12
  CliOptions lib/app_stack/cli_options.rb /^class CliOptions$/;" c
14
13
  CopyListBuilder lib/app_stack/copy_list_builder.rb /^ module CopyListBuilder$/;" m class:AppStack
15
- CopyListItem lib/app_stack/stack_app.rb /^ class CopyListItem$/;" c class:AppStack
16
14
  LocalFilesParser lib/app_stack/local_files_parser.rb /^ module LocalFilesParser$/;" m class:AppStack
17
- Merger lib/app_stack/merger.rb /^ class Merger$/;" c class:AppStack
18
15
  ParseError lib/app_stack/stack_app.rb /^ class ParseError < RuntimeError; end$/;" c class:AppStack
19
16
  StackApp lib/app_stack/stack_app.rb /^ class StackApp$/;" c class:AppStack
20
17
  String lib/app_stack.rb /^class String; include Term::ANSIColor end$/;" c
21
18
  app_name lib/app_stack/local_files_parser.rb /^ def app_name$/;" f class:AppStack.LocalFilesParser
22
- attr_mod? lib/app_stack/merger.rb /^ def attr_mod?(to)$/;" f class:AppStack.Merger
23
- copy_file! lib/app_stack/merger.rb /^ def copy_file!(fr, to)$/;" f class:AppStack.Merger
19
+ ask_diffs lib/app_stack/copy_list_builder.rb /^ def ask_diffs$/;" f class:AppStack.CopyListBuilder
20
+ attrs lib/app_stack/local_files_parser.rb /^ def attrs$/;" f class:AppStack.LocalFilesParser
21
+ check_diff lib/app_stack/copy_list_builder.rb /^ def check_diff$/;" f class:AppStack.CopyListBuilder
22
+ check_mtime lib/app_stack/copy_list_builder.rb /^ def check_mtime$/;" f class:AppStack.CopyListBuilder
23
+ copy_file! lib/app_stack/copy_list_builder.rb /^ def copy_file!(fr, to)$/;" f class:AppStack.CopyListBuilder
24
24
  directory lib/app_stack/local_files_parser.rb /^ def directory$/;" f class:AppStack.LocalFilesParser
25
- echo lib/app_stack/stack_app.rb /^ def echo(msg, var = nil)$/;" f class:AppStack.StackApp
25
+ do_copy! lib/app_stack/copy_list_builder.rb /^ def do_copy!$/;" f class:AppStack.CopyListBuilder
26
+ do_render! lib/app_stack/copy_list_builder.rb /^ def do_render!$/;" f class:AppStack.CopyListBuilder
27
+ echo lib/app_stack/stack_app.rb /^ def echo(msg, var = nil)$/;" f class:AppStack
26
28
  export_files lib/app_stack/local_files_parser.rb /^ def export_files(group = 'default')$/;" f class:AppStack.LocalFilesParser
27
29
  find_files lib/app_stack/local_files_parser.rb /^ def find_files(plist)$/;" f class:AppStack.LocalFilesParser
28
30
  full_path lib/app_stack/local_files_parser.rb /^ def full_path(file)$/;" f class:AppStack.LocalFilesParser
29
31
  glob_files lib/app_stack/local_files_parser.rb /^ def glob_files(dir, allow_hash = false)$/;" f class:AppStack.LocalFilesParser
30
32
  import_files lib/app_stack/copy_list_builder.rb /^ def import_files(import_conf)$/;" f class:AppStack.CopyListBuilder
31
33
  initialize lib/app_stack/cli_options.rb /^ def initialize(argv = ARGV)$/;" f class:CliOptions
32
- initialize lib/app_stack/merger.rb /^ def initialize(conf_file, verbose = false)$/;" f class:AppStack.Merger
33
34
  initialize lib/app_stack/stack_app.rb /^ def initialize(filename, options)$/;" f class:AppStack.StackApp
34
- load_stack lib/app_stack/merger.rb /^ def load_stack(stack_name, groups)$/;" f class:AppStack.Merger
35
35
  load_stack lib/app_stack/stack_app.rb /^ def load_stack$/;" f class:AppStack.StackApp
36
- merge! lib/app_stack/merger.rb /^ def merge!$/;" f class:AppStack.Merger
37
- newer? lib/app_stack/merger.rb /^ def newer?(f1, f2)$/;" f class:AppStack.Merger
36
+ merge! lib/app_stack/copy_list_builder.rb /^ def merge!$/;" f class:AppStack.CopyListBuilder
37
+ newer? lib/app_stack/copy_list_builder.rb /^ def newer?(f1, f2)$/;" f class:AppStack.CopyListBuilder
38
38
  parse_export_files lib/app_stack/local_files_parser.rb /^ def parse_export_files$/;" f class:AppStack.LocalFilesParser
39
39
  parse_opt! lib/app_stack/cli_options.rb /^ def parse_opt!(argv)$/;" f class:CliOptions
40
- parse_stacks lib/app_stack/merger.rb /^ def parse_stacks$/;" f class:AppStack.Merger
41
- prepare lib/app_stack/merger.rb /^ def prepare(verbose = false)$/;" f class:AppStack.Merger
42
- render_file! lib/app_stack/merger.rb /^ def render_file!(fr, to)$/;" f class:AppStack.Merger
40
+ render_file! lib/app_stack/copy_list_builder.rb /^ def render_file!(fr, to)$/;" f class:AppStack.CopyListBuilder
43
41
  short_path lib/app_stack/local_files_parser.rb /^ def short_path(path)$/;" f class:AppStack.LocalFilesParser
44
42
  stackup! lib/app_stack.rb /^ def stackup!(argv = ARGV)$/;" f class:AppStack
45
43
  stackup! lib/app_stack/stack_app.rb /^ def stackup!$/;" f class:AppStack.StackApp
44
+ switch_to_tpl lib/app_stack/local_files_parser.rb /^ def switch_to_tpl(file)$/;" f class:AppStack.LocalFilesParser
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: