Class: Egads::Extract

Inherits:
Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/egads/command/extract.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Group

exit_on_failure?

Instance Attribute Details

#seed_pathObject

Returns the value of attribute seed_path.



9
10
11
# File 'lib/egads/command/extract.rb', line 9

def seed_path
  @seed_path
end

#seed_shaObject

Returns the value of attribute seed_sha.



9
10
11
# File 'lib/egads/command/extract.rb', line 9

def seed_sha
  @seed_sha
end

Instance Method Details

#extractObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/egads/command/extract.rb', line 15

def extract
  if should_extract?
    # Download_patch
    do_download(sha, File.join(patch_dir, "#{sha}.tar.gz"), 'patch')

    do_extract patch_path

    # Download seed
    self.seed_sha = Pathname.new(patch_dir).join("egads-seed").read.strip
    self.seed_path = File.join(RemoteConfig.seed_dir, "#{seed_sha}.tar.gz")
    do_download(seed_sha, seed_path, 'seed')

    do_extract seed_path

    apply_patch
    finish_extraction
  else
    say_status :done, "#{sha} already extracted. Use --force to overwrite"
  end
end

#setup_environmentObject



11
12
13
# File 'lib/egads/command/extract.rb', line 11

def setup_environment
  RemoteConfig.setup_environment
end