stack-service-base 0.0.26 → 0.0.27

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
  SHA256:
3
- metadata.gz: cfba1101626b121016a0d3a1dab70e11adbee81b2a67ab876514cfb97a5cb412
4
- data.tar.gz: fffd7e298815086305831e0ee1da378cd7acaf0f288e18b3f3ed54f159f41ac9
3
+ metadata.gz: 8645f0987b9ed7a867a3393f45204c7c93904509188c8292292df6dbede9a707
4
+ data.tar.gz: 621fb5de718dced1d606fc2422378351d74ba269e75d7c3347f6647592e6345a
5
5
  SHA512:
6
- metadata.gz: a618d25c38ee5afc747371d3bdbd9ac6b26c6b4a48bf443ca3bbec5e8e4c5585ed6e86ffbf3686ceaf08cfc6f2a87dbd75945f1731292dca6e3d60fe2fbc41ee
7
- data.tar.gz: 5dc0fcaf689ba14223330662c00f834555bbe327fb16a098a0dec119d023552397769335bb8a7ad41a81998d5028216114a96e7e13b151a901d9631f969c85db
6
+ metadata.gz: 87d17c8d1682ab21e7b0051e41626d2b5ceaf04e0d08966ab74ff0513a715462173834a2ba3c5800249a6d60b6d820fd5cbfef2fda3b1dd27dd438681c05769d
7
+ data.tar.gz: 3602e01ebd65e4ec37275a034a63218a36078c49ace2c56a3e6e096921802ac1a682be7d8b4d3008293c70c0daab313ae172ac6b94a6acdcbc7e5f7398236934
@@ -25,10 +25,32 @@ SSBase::CommandLine::COMMANDS[:init] = Class.new do
25
25
  update_service_name args.shift
26
26
  end
27
27
 
28
+ def cp_r(src, dst)
29
+ # Mimics cp -rn src/. dst/ behavior.
30
+ Dir.glob("#{src}/**/{*,.*}", File::FNM_DOTMATCH).each do |source_path|
31
+ next if ['.', '..'].include?(File.basename(source_path))
32
+
33
+ rel_path = source_path.sub(/^#{Regexp.escape(src)}\/?/, '')
34
+ dest_path = File.join(dst, rel_path)
35
+
36
+ next if File.exist?(dest_path)
37
+
38
+ if File.directory?(source_path)
39
+ FileUtils.mkdir_p(dest_path, verbose: true)
40
+ else
41
+ $stdout.puts "add -> #{dest_path}"
42
+ FileUtils.cp(source_path, dest_path)
43
+ end
44
+ end
45
+ end
46
+
47
+
28
48
  def copy_folder( f_name)
29
49
  $stdout.puts "Copy template: #{f_name}"
50
+ cp_r "#{__dir__}/project_template/#{f_name}/.", '.'
51
+ # FileUtils.cp_r "#{__dir__}/project_template/#{f_name}/.", '.', verbose: true
30
52
  # system "cp -rv --update=none #{__dir__}/project_template/#{f_name}/. ."
31
- system "rsync -av --ignore-existing --info=NAME,progress0,stats0 #{__dir__}/project_template/#{f_name}/ ./ | grep -v '^sending incremental file list$' | grep -v '/$' "
53
+ #system "rsync -av --ignore-existing --info=NAME,progress0,stats0 #{__dir__}/project_template/#{f_name}/ ./ | grep -v '^sending incremental file list$' | grep -v '/$' "
32
54
  end
33
55
 
34
56
  def update_service_name(s_name)
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module StackServiceBase
2
2
  class Base
3
- VERSION = '0.0.26'
3
+ VERSION = '0.0.27'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stack-service-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B