Class: Papa::Task::Sandbox::Generate

Inherits:
Object
  • Object
show all
Defined in:
lib/papa/task/sandbox/generate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Generate

Returns a new instance of Generate.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/papa/task/sandbox/generate.rb', line 11

def initialize(options = {})
  @options = options
  @remote_path = Helper::Path.generate_sandbox_path('remote', options)
  @local_path = Helper::Path.generate_sandbox_path('local', options)
  @git_details = [
    {
      commit: 'APP-1 - Add butterfree gem',
      branch: 'feature/1-add-butterfree-gem',
      base_branch: 'develop'
    },
    {
      commit: 'APP-2 - Add beedrill gem',
      branch: 'feature/2-add-beedrill-gem',
      base_branch: 'develop'
    },
    {
      commit: 'APP-3 - Add pidgey gem',
      branch: 'patch/17.8.0/3-add-pidgey-gem',
      base_branch: 'develop'
    },
    {
      commit: 'APP-4 - Fix charmeleon spelling',
      branch: 'bugfix/4-fix-charmeleon-spelling',
      base_branch: 'master'
    },
    {
      commit: 'APP-5 - Fix gem source',
      branch: 'bugfix/5-fix-gem-source',
      base_branch: 'master'
    },
    {
      commit: 'APP-6 - Add pidgeotto gem',
      branch: 'feature/6-add-pidgeotto-gem',
      base_branch: 'develop'
    },
    {
      commit: 'APP-7 - Add pidgeot gem',
      branch: 'feature/7-add-pidgeot-gem',
      base_branch: 'develop'
    }
  ]
end

Instance Attribute Details

#git_detailsObject

Returns the value of attribute git_details.



9
10
11
# File 'lib/papa/task/sandbox/generate.rb', line 9

def git_details
  @git_details
end

#local_pathObject

Returns the value of attribute local_path.



9
10
11
# File 'lib/papa/task/sandbox/generate.rb', line 9

def local_path
  @local_path
end

#optionsObject

Returns the value of attribute options.



9
10
11
# File 'lib/papa/task/sandbox/generate.rb', line 9

def options
  @options
end

#remote_pathObject

Returns the value of attribute remote_path.



9
10
11
# File 'lib/papa/task/sandbox/generate.rb', line 9

def remote_path
  @remote_path
end

Instance Method Details

#runObject



54
55
56
57
58
59
60
61
# File 'lib/papa/task/sandbox/generate.rb', line 54

def run
  Helper::Output.stdout('Started generation of sandbox...') unless options[:silent]
  task_directory = File.expand_path(File.dirname(__dir__))
  @branches_directory = File.join(task_directory, 'sandbox', 'branches')
  setup_remote_repository
  setup_local_repository
  success_message unless options[:silent]
end