Module: Dnnbundler
- Defined in:
- lib/dnnbundler.rb,
lib/dnnbundler/cli.rb,
lib/dnnbundler/version.rb,
lib/dnnbundler/fileEntry.rb,
lib/dnnbundler/jsonConfig.rb,
lib/dnnbundler/fileEntryType.rb,
lib/dnnbundler/zipFileGenerator.rb,
lib/dnnbundler/packageVersionReplacer.rb
Defined Under Namespace
Modules: FileEntryType, JsonConfig, ManifestVersionRegex
Classes: CLI, FileEntry, ZipFileGenerator
Constant Summary
collapse
- VERSION =
"0.1.7"
Class Method Summary
collapse
Class Method Details
41
42
43
|
# File 'lib/dnnbundler/cli.rb', line 41
def self.formatVersion(version)
"#{version[0].to_s.rjust(4, "0")}.#{version[1].to_s.rjust(2, "0")}.#{version[2].to_s.rjust(4, "0")}"
end
|
.getVersionFromManifest(file_name) ⇒ Object
17
18
19
20
|
# File 'lib/dnnbundler/packageVersionReplacer.rb', line 17
def self.getVersionFromManifest(file_name)
text = File.read(file_name)
(ManifestVersionRegex::NewManifestRegex.match(text) || ManifestVersionRegex::OldManifestRegex.match(text)).captures[1]
end
|
.replaceVersionInManifestFiles(file_names, new_version) ⇒ Object
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/dnnbundler/packageVersionReplacer.rb', line 2
def self.replaceVersionInManifestFiles(file_names, new_version)
file_names.each do |file_name|
text = File.read(file_name)
replace_expr = '\1' + new_version + '\3'
text.gsub!(ManifestVersionRegex::NewManifestRegex, replace_expr )
text.gsub!(ManifestVersionRegex::OldManifestRegex, replace_expr )
File.open(file_name, "w") {|file| file.puts text }
end
end
|
.splitVersionNumbers(version_string) ⇒ Object
45
46
47
|
# File 'lib/dnnbundler/cli.rb', line 45
def self.splitVersionNumbers(version_string)
version_string.split(".").map { |x| x.to_i }
end
|