dnnbundler 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 96c347bb2f330fdeefd588f01d2721339587b80d
4
- data.tar.gz: d69601f50871db50d78185c5dbcad341d475eb7b
3
+ metadata.gz: 2ca56a3f1880eddf8ae88de939be914073adcaec
4
+ data.tar.gz: 781a3d692a996658ceaf8e0fd13aecfe4c36a3d8
5
5
  SHA512:
6
- metadata.gz: f2e22d533440874f46923a28e58b0ce8f1ca8e50f23fb63ae4a08b5cffe4dea32b7b12d76f447d3678872d205191771a2679718177df31b5f6691dc2e1c65b32
7
- data.tar.gz: 148501b005a3fec11644306275be2d60e0eb6d6b7aec9c2571ce0f2f83d0e4fb2579b6c4fa11877015abb3e8d989cf943476149211a9c32d5c4cc630164027b4
6
+ metadata.gz: 72a173d766a4d92933902663f2dd730c5a4278927dc6438f5b0f31167811f66829d8ab5876cef3e60c5c4a61858be467e4ac27cba4ae863b49c78438148ad89d
7
+ data.tar.gz: 55d925638392936f619cfac4424cf46d84ec7c4d7ea3f1586e2dbd1e2f77381c0a57ee4c6762e7154a6071b24ca1d0a9b8dbcc6079ca6decb848b5cc5faa37f7
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Dnnbundler
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dnnbundler`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ DNNBundler is intended to automate creation of zip packages for DotNetNuke.
4
+ Put your Ruby code in the file `lib/dnnbundler`. To experiment with that code, run `bin/console` for an interactive prompt.
4
5
 
5
6
  TODO: Delete this and the text above, and describe your gem
6
7
 
@@ -1,5 +1,6 @@
1
1
  require "dnnbundler/zipFileGenerator"
2
- require "dnnbundler/fileStringReplacer/fileStringReplacer"
2
+ require "dnnbundler/packageVersionReplacer"
3
+ require "dnnbundler/jsonConfig"
3
4
  require "thor"
4
5
  require "json"
5
6
 
@@ -14,21 +15,21 @@ module Dnnbundler
14
15
  file = File.read(config)
15
16
  data_hash = JSON.parse(file)
16
17
 
17
- manifest_files = data_hash["manifests"]
18
+ manifest_files = data_hash[JsonConfig::Manifests]
18
19
  current_version = Dnnbundler::getVersionFromManifest manifest_files[0]
19
- version_numbers = current_version.split(".").map { |x| x.to_i }
20
+ version_numbers = Dnnbundler::splitVersionNumbers current_version
20
21
 
21
22
  version_numbers[1] = version_numbers[1] + 1 if options[:bumpSprint]
22
23
  version_numbers[2] = 1 if options[:bumpSprint]
23
24
  version_numbers[2] = version_numbers[2] + 1 if options[:bumpBuild]
24
- version_numbers = options[:targetVersion].split(".").map { |x| x.to_i } if options[:targetVersion]
25
+ version_numbers = Dnnbundler::splitVersionNumbers(options[:targetVersion]) if options[:targetVersion]
25
26
 
26
27
  new_version = Dnnbundler::formatVersion(version_numbers)
27
28
  puts "current version is #{current_version}"
28
29
  puts "new version is #{new_version}"
29
30
 
30
- data_hash["packages"].each do |package|
31
- package["name"].sub! "[PACKAGE_VERSION]", new_version
31
+ data_hash[JsonConfig::Packages].each do |package|
32
+ package[JsonConfig::Name].sub! JsonConfig::PackageVersionPlaceholder, new_version
32
33
  Dnnbundler::replaceVersionInManifestFiles manifest_files, new_version
33
34
 
34
35
  generator = ZipFileGenerator.new(package)
@@ -40,4 +41,8 @@ module Dnnbundler
40
41
  def self.formatVersion(version)
41
42
  "#{version[0].to_s.rjust(4, "0")}.#{version[1].to_s.rjust(2, "0")}.#{version[2].to_s.rjust(4, "0")}"
42
43
  end
44
+
45
+ def self.splitVersionNumbers(version_string)
46
+ version_string.split(".").map { |x| x.to_i }
47
+ end
43
48
  end
@@ -6,5 +6,8 @@ module Dnnbundler
6
6
  Flatten = "flatten"
7
7
  Entries = "entries"
8
8
  IgnoreEntries = "ignoreEntries"
9
+ Packages = "packages"
10
+ Manifests = "manifests"
11
+ PackageVersionPlaceholder = "[PACKAGE_VERSION]"
9
12
  end
10
13
  end
@@ -23,4 +23,4 @@ module Dnnbundler
23
23
  OldManifestRegex = /(<version>)(\d*?\.\d*?\.\d*)(<\/version>)/
24
24
  NewManifestRegex = /(<package .*? version=")(\d*?\.\d*?\.\d*)(.*?>)/
25
25
  end
26
- end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module Dnnbundler
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnnbundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Le0Michine
@@ -102,8 +102,8 @@ files:
102
102
  - lib/dnnbundler/cli.rb
103
103
  - lib/dnnbundler/fileEntry.rb
104
104
  - lib/dnnbundler/fileEntryType.rb
105
- - lib/dnnbundler/fileStringReplacer/fileStringReplacer.rb
106
105
  - lib/dnnbundler/jsonConfig.rb
106
+ - lib/dnnbundler/packageVersionReplacer.rb
107
107
  - lib/dnnbundler/version.rb
108
108
  - lib/dnnbundler/zipFileGenerator.rb
109
109
  homepage: https://github.com/Le0Michine/dnnbundler