egads 0.0.3 → 0.0.4

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
- MzVkZmVlZjU0OWJmMWYwOWI0OWY3ODA5ZjJhNzMzODM3YmI3MTYxZg==
4
+ NTUwYTQ0MTFjOTlhNDhkYTIxMWFiYTE1ZmJlMjk2NTI5OTgxYTViMg==
5
5
  data.tar.gz: !binary |-
6
- YzU1NzMyMjdmZjZmODg1ZjU4NTIyZjgwMmIxZDlmMTg3M2U1ZDFlMQ==
6
+ M2EyZWFmNWY0NTdlNDgxMTJiNDQ1NTI1NjRhY2YxMTUwYzJmYzIxNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MjFiYzY2YWRhMDVkZjEyNTIxZDY0M2MxYTU3NmVjYTgyNjA3MmU0ZDlhNmFk
10
- OTg1ZmI4YmNkN2ZiNjgzNDQ1M2JhODU0NzkzODk4MmM0M2E2YmMyYTIyOTE4
11
- ZGNkYzUzMThkODcyMmExZDU1NjEwOGQ2OGI1YTQ2OWVmNjM2YTQ=
9
+ NjdiMmRhOTM3YWE4Mzc5OTQ5MTQ1MDcxMmVjM2Q3NzZkNmVlOTA3N2E4YTdm
10
+ YjNjZmEzMzdhYWQyYjhiZGE2MmVjNjhiZTBlMGE5YmE2YmQ1ZWQzNTc0ZDRm
11
+ ODkzMzEyYjE0ZDI4NTZjNTYwN2ViY2Q2NjU4YmE5ZjgzN2Q1YmQ=
12
12
  data.tar.gz: !binary |-
13
- ZWNlNjY4YTA0NzlhMzc4MzYyYTY4MWE0MmFjMmM0NDZlMDcwZWEyOGUxNWI0
14
- Zjc3NmVjYzk0YmIyMjhhZDMyNWRiMzQ5NWE0ZTA1ZGEwZmE4NDg0ZTg2NjQ4
15
- NzA2NDU0YWQ3MGI0NmJhYjRhMDI5YWEwOThmMThiY2I3Y2ZkOTc=
13
+ ZjFkMDhjZjhjYTIyOWM5MmU0MmMwN2MwYjg1MjYyMmViYjU3ZTBlM2Q1OGVi
14
+ ZjAwMjM0ZGM2YzkyYWMxYThkNjM0MmZlOWRhYzZmYzFhMzQ4NzkwNjE4YWYx
15
+ YjMxYWQ0MDZiOWU3MjhiN2VhY2MxN2NmZWNhMmU0MGM2NTdhNGE=
data/lib/egads/cli.rb CHANGED
@@ -41,7 +41,7 @@ module Egads
41
41
  File.open('REVISION', 'w') {|f| f << sha + "\n" }
42
42
  run_or_die "tar -uf #{tarball.local_tar_path} REVISION"
43
43
 
44
- run_hooks_for(:build, :post)
44
+ run_hooks_for(:build, :after)
45
45
 
46
46
  extra_paths = Config.build_extra_paths
47
47
  if extra_paths.any?
@@ -85,19 +85,19 @@ module Egads
85
85
  tarball = S3Tarball.new(sha, true)
86
86
 
87
87
  inside dir do
88
- if options[:force] || !File.exists?(path)
88
+ if options[:force] || File.zero?(path) || !File.exists?(path)
89
89
  say "Downloading tarball"
90
90
  duration = Benchmark.realtime do
91
- File.open(path, 'w') {|f| f << tarball.body }
91
+ File.open(path, 'w') {|f| f << tarball.contents }
92
92
  end
93
93
  size = File.size(path)
94
94
  say "Downloaded in %.1f seconds (%.1f KB/s)" % [duration, (size.to_f / 2**10) / duration]
95
95
  else
96
- say "Tarball already downloads. Use --force to overwrite"
96
+ say "Tarball already downloaded. Use --force to overwrite"
97
97
  end
98
98
 
99
99
  # Check revision file to see if tarball is already extracted
100
- extract_flag_path File.join(dir, '.egads-extract-success')
100
+ extract_flag_path = File.join(dir, '.egads-extract-success')
101
101
  if options[:force] || !File.exists?(extract_flag_path)
102
102
  say "Extracting tarball"
103
103
  run_or_die "tar -zxf #{path}"
@@ -118,7 +118,7 @@ module Egads
118
118
  inside dir do
119
119
  run_hooks_for(:stage, :before)
120
120
 
121
- run_or_die("bundle install --deployment --quiet") if File.readable?("GEMFILE")
121
+ run_or_die("bundle install --deployment --quiet") if File.readable?("Gemfile")
122
122
  if ENV['SHARED_PATH']
123
123
  symlinked_dirs = %w(public/system tmp/pids log)
124
124
  symlinked_dirs.each do |d|
@@ -169,7 +169,7 @@ module Egads
169
169
 
170
170
  private
171
171
  # Run command hooks from config file
172
- # E.g. run_hooks_for(:build, :post)
172
+ # E.g. run_hooks_for(:build, :after)
173
173
  def run_hooks_for(cmd, hook)
174
174
  say_status :hooks, "Running #{cmd} #{hook} hooks"
175
175
  Config.hooks_for(cmd, hook).each do |command|
data/lib/egads/config.rb CHANGED
@@ -22,7 +22,7 @@ module Egads
22
22
  extend CommonConfig
23
23
 
24
24
  def self.config_path
25
- path = ENV['EGADS_CONFIG'] || File.join(ENV['PWD'], 'egads.yml')
25
+ path = ENV['EGADS_CONFIG'] || File.join(Dir.pwd, 'egads.yml')
26
26
  unless path && File.readable?(path)
27
27
  raise ArgumentError.new("Could not read config file. Set either EGADS_CONFIG, or create egads.yml in the current directory")
28
28
  end
@@ -6,8 +6,12 @@ module Egads
6
6
  @remote = remote
7
7
  end
8
8
 
9
+ def config
10
+ remote ? RemoteConfig : Config
11
+ end
12
+
9
13
  def key
10
- [Config.s3_prefix, "#{sha}.tar.gz"].compact * '/'
14
+ [config.s3_prefix, "#{sha}.tar.gz"].compact * '/'
11
15
  end
12
16
 
13
17
  def exists?
@@ -30,11 +34,11 @@ module Egads
30
34
 
31
35
  # Load the file contents from S3
32
36
  def contents
33
- bucket.files.get(key: key).body
37
+ bucket.files.get(key).body
34
38
  end
35
39
 
36
40
  def bucket
37
- remote ? RemoteConfig.s3_bucket : Config.s3_bucket
41
+ config.s3_bucket
38
42
  end
39
43
  end
40
44
  end
data/lib/egads/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Egads
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Suggs