Class: Simp::Metadata::Bootstrap_source

Inherits:
Object
  • Object
show all
Defined in:
lib/simp/metadata/bootstrap_source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(edition) ⇒ Bootstrap_source

Returns a new instance of Bootstrap_source.



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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/simp/metadata/bootstrap_source.rb', line 16

def initialize(edition)
  @releases = {}
  @components = {}
  @edition = edition

  case edition
  when 'enterprise'
    @data = {
      'components' => {
        'enterprise-metadata' => {
          'component-type' => 'simp-metadata',
          'authoritative' => true,
          'locations' => [
            {
              'url' => 'simp-enterprise:///enterprise-metadata?version=master&filetype=tgz',
              'method' => 'file',
              'extract' => true,
              'primary' => true
            }
          ]
        },
        'simp-metadata' => {
          'component-type' => 'simp-metadata',
          'authoritative' => true,
          'locations' => [
            {
              'url' => 'https://github.com/simp/simp-metadata',
              'method' => 'git',
              'primary' => true
            }
          ]
        }
      }
    }
  when 'enterprise-only'
    @data = {
      'components' => {
        'enterprise-metadata' => {
          'component-type' => 'simp-metadata',
          'authoritative' => true,
          'locations' => [
            {
              'url' => 'simp-enterprise:///enterprise-metadata?version=master&filetype=tgz',
              'method' => 'file',
              'extract' => true,
              'primary' => true
            }
          ]
        }
      }
    }
  else
    @data = {
      'components' => {
        'simp-metadata' => {
          'component-type' => 'simp-metadata',
          'authoritative' => true,
          'locations' => [
            {
              'url' => 'https://github.com/simp/simp-metadata',
              'method' => 'git',
              'primary' => true
            }
          ]
        }
      }
    }
  end
  @components = @data['components']
end

Instance Attribute Details

#basenameObject

Returns the value of attribute basename.



11
12
13
# File 'lib/simp/metadata/bootstrap_source.rb', line 11

def basename
  @basename
end

#cachepathObject

Returns the value of attribute cachepath.



8
9
10
# File 'lib/simp/metadata/bootstrap_source.rb', line 8

def cachepath
  @cachepath
end

#componentsObject

Returns the value of attribute components.



9
10
11
# File 'lib/simp/metadata/bootstrap_source.rb', line 9

def components
  @components
end

#dataObject

Returns the value of attribute data.



12
13
14
# File 'lib/simp/metadata/bootstrap_source.rb', line 12

def data
  @data
end

#editionObject

Returns the value of attribute edition.



14
15
16
# File 'lib/simp/metadata/bootstrap_source.rb', line 14

def edition
  @edition
end

#releasesObject

Returns the value of attribute releases.



10
11
12
# File 'lib/simp/metadata/bootstrap_source.rb', line 10

def releases
  @releases
end

#urlObject

Returns the value of attribute url.



7
8
9
# File 'lib/simp/metadata/bootstrap_source.rb', line 7

def url
  @url
end

Instance Method Details

#cleanupObject



129
130
# File 'lib/simp/metadata/bootstrap_source.rb', line 129

def cleanup
end

#create_release(_destination, _source = 'master') ⇒ Object

Stub out ‘writing’ methods as they don’t apply to bootstrap_source



114
115
# File 'lib/simp/metadata/bootstrap_source.rb', line 114

def create_release(_destination, _source = 'master')
end

#dirty?Boolean

Returns:

  • (Boolean)


121
122
123
# File 'lib/simp/metadata/bootstrap_source.rb', line 121

def dirty?
  false
end

#nameObject



136
137
138
# File 'lib/simp/metadata/bootstrap_source.rb', line 136

def name
  'bootstrap_metadata'
end

#release(_version) ⇒ Object



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/simp/metadata/bootstrap_source.rb', line 87

def release(_version)
  case edition
  when 'enterprise'
    {
      'enterprise-metadata' => {
        'version' => 'master'
      },
      'simp-metadata' => {
        'branch' => 'master'
      }
    }
  when 'enterprise-only'
    {
      'enterprise-metadata' => {
        'version' => 'master'
      }
    }
  else
    {
      'simp-metadata' => {
        'branch' => 'master'
      }
    }
  end
end

#saveObject



125
126
127
# File 'lib/simp/metadata/bootstrap_source.rb', line 125

def save
  true
end

#to_sObject



132
133
134
# File 'lib/simp/metadata/bootstrap_source.rb', line 132

def to_s
  name
end

#writable?Boolean

Returns:

  • (Boolean)


117
118
119
# File 'lib/simp/metadata/bootstrap_source.rb', line 117

def writable?
  false
end