Class: Pbmenv::VersionPathname

Inherits:
Object
  • Object
show all
Defined in:
lib/pbmenv/version_pathname.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ VersionPathname

Returns a new instance of VersionPathname.



5
6
7
# File 'lib/pbmenv/version_pathname.rb', line 5

def initialize(version)
  self.version = version
end

Instance Attribute Details

#versionObject

Returns the value of attribute version.



3
4
5
# File 'lib/pbmenv/version_pathname.rb', line 3

def version
  @version
end

Class Method Details

.currentObject



67
68
69
# File 'lib/pbmenv/version_pathname.rb', line 67

def self.current
  File.join(Pbmenv.pbm_dir, "current")
end

.device_id_path_in_sharedObject



63
64
65
# File 'lib/pbmenv/version_pathname.rb', line 63

def self.device_id_path_in_shared
  File.join(shared, "device_id")
end

.sharedObject



71
72
73
# File 'lib/pbmenv/version_pathname.rb', line 71

def self.shared
  File.join(Pbmenv.pbm_dir, "shared")
end

Instance Method Details

#app_rb_erb_pathObject



21
22
23
# File 'lib/pbmenv/version_pathname.rb', line 21

def app_rb_erb_path
  File.join(version_path, "app.rb.erb")
end

#app_rb_pathObject



17
18
19
# File 'lib/pbmenv/version_pathname.rb', line 17

def app_rb_path
  File.join(version_path, "app.rb")
end

#device_id_path_in_sharedObject



43
44
45
# File 'lib/pbmenv/version_pathname.rb', line 43

def device_id_path_in_shared
  File.join(self.class.shared, "device_id")
end

#device_id_path_in_versionObject



25
26
27
# File 'lib/pbmenv/version_pathname.rb', line 25

def device_id_path_in_version
  File.join(version_path, "device_id")
end

#lib_app_generatorObject



55
56
57
# File 'lib/pbmenv/version_pathname.rb', line 55

def lib_app_generator
  File.join(src_pbm_project_template_path, "lib", "app_generator")
end

#project_template_file_paths(include_app_erb:) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/pbmenv/version_pathname.rb', line 33

def project_template_file_paths(include_app_erb: )
  paths = ["README.md", "setting.yml"]
  if include_app_erb
    paths << "app.rb.erb"
  else
    paths << "app.rb"
  end
  return paths.map { |path| File.join(src_pbm_project_template_path, path) }
end

#src_pbm_pathObject



29
30
31
# File 'lib/pbmenv/version_pathname.rb', line 29

def src_pbm_path
  File.join("/tmp", "procon_bypass_man-#{version}")
end

#src_pbm_project_template_app_rb_erb_pathObject



51
52
53
# File 'lib/pbmenv/version_pathname.rb', line 51

def src_pbm_project_template_app_rb_erb_path
  File.join(src_pbm_project_template_path, "app.rb.erb")
end

#src_pbm_project_template_pathObject



47
48
49
# File 'lib/pbmenv/version_pathname.rb', line 47

def src_pbm_project_template_path
  File.join(src_pbm_path, "project_template")
end

#src_project_template_systemd_unitsObject



59
60
61
# File 'lib/pbmenv/version_pathname.rb', line 59

def src_project_template_systemd_units
  File.join(src_pbm_project_template_path, "systemd_units")
end

#version_pathObject



9
10
11
# File 'lib/pbmenv/version_pathname.rb', line 9

def version_path
  File.join(Pbmenv.pbm_dir, "v#{version}")
end

#version_path_without_vObject



13
14
15
# File 'lib/pbmenv/version_pathname.rb', line 13

def version_path_without_v
  File.join(Pbmenv.pbm_dir, "#{version}")
end