soaring 0.1.13 → 0.1.14

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
  SHA1:
3
- metadata.gz: 503051fded1b4029754fa4c1b3b1109b3e46a3e4
4
- data.tar.gz: 28bafd2427c9d3fa9ae58ac665679d918a1b79f6
3
+ metadata.gz: 5f08168c3868aa4efb089ce195a7fc9c409e1728
4
+ data.tar.gz: 7ce5dc40d3f040f0a030bf7e48f77ae9df957152
5
5
  SHA512:
6
- metadata.gz: 9f6a1ee83928c44203a70b029753bdfb8b8db42d19cf13af4c0935976ff348c92668bbc11b763deeb816480e5f89fc91c9e4538db995fdbd6ad0eb5ddddf7dde
7
- data.tar.gz: 9522e72b3352a3720af203fc9169dbbd9e86f2fb746a2380a8fe8d0930a0f99205fbd601a43a7916a5ab5188dfda91cbcfae93f655aabb0921ecff6867a8df2c
6
+ metadata.gz: 7e13384d5238fa3422689086eca042562b8642bbb31c3d4bb3fce38c2ca167921b4a9c26affdb4a3a16bd525c690173c7ee9637e3a3778488d271ce5f899fff4
7
+ data.tar.gz: 7d8f3af9d9dafe286b9081aeb7fab4fb7dcacc93f2d1c1f8afafc19177c9c534f0fc14458dfa3449b830d92a47e0b08c63fb3d273aa4849da8a7a1c8cf98633b
@@ -5,6 +5,13 @@ module Soaring
5
5
  end
6
6
 
7
7
  def initialize_project
8
+ Dir.chdir(@options[:project_root]) do
9
+ get_soar_sc_template
10
+ create_symlink_to_public_folder
11
+ end
12
+ end
13
+
14
+ def get_soar_sc_template
8
15
  Dir.mktmpdir { |dir|
9
16
  temporary_folder = dir
10
17
  temporary_soar_sc_folder = "#{temporary_folder}/soar_sc"
@@ -22,14 +29,10 @@ module Soaring
22
29
  `yes | cp -rf #{temporary_soar_sc_folder}/.ebextensions #{@options[:project_root]}`
23
30
  `yes | cp -rf #{temporary_soar_sc_folder}/jewels #{@options[:project_root]}`
24
31
  }
25
-
26
- create_symlink_to_public_folder
27
32
  end
28
33
 
29
34
  def create_symlink_to_public_folder
30
- Dir.chdir(@options[:project_root]) do
31
- `ln -s lib/web/public public`
32
- end
35
+ File.symlink("lib/web/public", "public") if not File.symlink?("public")
33
36
  end
34
37
  end
35
38
  end
@@ -5,12 +5,14 @@ module Soaring
5
5
  end
6
6
 
7
7
  def package
8
- validate_project if not @options[:ignore_git_checks]
9
- build_output_location = generate_build_output_location(@options[:project_root])
10
- update_project_commit_hash
11
- `mkdir -p #{@options[:project_root]}/build`
12
- `cd #{@options[:project_root]}; zip -r #{build_output_location} * .ebextensions --exclude=build/* --exclude=config/environment.yml`
13
- puts "Build packaged at #{build_output_location}"
8
+ Dir.chdir(@options[:project_root]) do
9
+ validate_project if not @options[:ignore_git_checks]
10
+ build_output_location = generate_build_output_location(@options[:project_root])
11
+ update_project_commit_hash
12
+ `mkdir -p #{@options[:project_root]}/build`
13
+ `zip -r #{build_output_location} * .ebextensions --exclude=build/* --exclude=config/environment.yml`
14
+ puts "Build packaged at #{build_output_location}"
15
+ end
14
16
  end
15
17
 
16
18
  private
@@ -30,7 +32,7 @@ module Soaring
30
32
  end
31
33
 
32
34
  def update_project_commit_hash
33
- response, exit_status = Executor::execute("cd #{@options[:project_root]}; git rev-parse HEAD > commit-hash")
35
+ response, exit_status = Executor::execute("git rev-parse HEAD > commit-hash")
34
36
  if not exit_status.success?
35
37
  puts 'Failed to package, unable to get commit hash from local git repository'
36
38
  exit 1
@@ -38,13 +40,13 @@ module Soaring
38
40
  end
39
41
 
40
42
  def is_git_repo_up_to_date?
41
- response, exit_status = Executor::execute("cd #{@options[:project_root]}; git status --porcelain")
43
+ response, exit_status = Executor::execute("git status --porcelain")
42
44
  return true if ('' == response) and (exit_status.success?)
43
45
  false
44
46
  end
45
47
 
46
48
  def get_short_commit_hash
47
- response, exit_status = Executor::execute("cd #{@options[:project_root]}; git rev-parse --short HEAD")
49
+ response, exit_status = Executor::execute("git rev-parse --short HEAD")
48
50
  if not exit_status.success?
49
51
  puts 'Failed to package, unable to get short commit hash from local git repository'
50
52
  exit 1
@@ -5,10 +5,12 @@ module Soaring
5
5
  end
6
6
 
7
7
  def run
8
- if @options[:autorestart]
9
- run_repeatedly
10
- else
11
- run_once
8
+ Dir.chdir(@options[:project_root]) do
9
+ if @options[:autorestart]
10
+ run_repeatedly
11
+ else
12
+ run_once
13
+ end
12
14
  end
13
15
  end
14
16
 
@@ -17,14 +19,14 @@ module Soaring
17
19
  def run_repeatedly
18
20
  while true do
19
21
  $stderr.puts "starting rackup repeatedly with parameters #{compile_rackup_parameters}" if @options[:verbose]
20
- response, exit_status = Executor::execute("cd #{@options[:project_root]}; bundle exec rackup #{compile_rackup_parameters}")
22
+ response, exit_status = Executor::execute("bundle exec rackup #{compile_rackup_parameters}")
21
23
  sleep(0.5)
22
24
  end
23
25
  end
24
26
 
25
27
  def run_once
26
28
  $stderr.puts "starting rackup once with parameters #{compile_rackup_parameters}" if @options[:verbose]
27
- exec("cd #{@options[:project_root]}; bundle exec rackup #{compile_rackup_parameters}")
29
+ exec("bundle exec rackup #{compile_rackup_parameters}")
28
30
  end
29
31
 
30
32
  def compile_rackup_parameters
@@ -1,3 +1,3 @@
1
1
  module Soaring
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soaring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barney de Villiers