outreach_gem 1.0.60 → 1.0.62

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
  SHA256:
3
- metadata.gz: a2568f9276ebe9ffa271c36d35582cc6be434086368a3c546705ac6d6683de26
4
- data.tar.gz: 61ae2d3315b0d4a7a7177b56fc989ecc4fb0ac38aee773cc3903176b81d2af42
3
+ metadata.gz: 8b2db4ddc7c1e2a1bf76bbc52eafd4a507af30f9bb5758c64809033dbaa6f3ec
4
+ data.tar.gz: 657130bb74db470e8211b74a7c80d661a2bf2056a2adf658a21a0db6a0e80279
5
5
  SHA512:
6
- metadata.gz: d74f56a34fbd4c99f101ddc25752eabf1f81f56afb7df1a38bfb88ce903b7786cc86b3632890470d729799f38dbaf4346e36e2a6aa4c357da2bc45d455615884
7
- data.tar.gz: ee0ff39ef9c2f4e44198231e87150f649d9a67796d11092a7395d654cafc58441e6831ee88be3cb01ab00db734c49b7be5c9077e525c2dfe14db78f2dde16cef
6
+ metadata.gz: '0931e9151072b9e1d05156a914225e644dc1f9d2f5d738ad61a007caccecb3ddb520a2b346b827a770b3be7de7aabd5e019b8e6bfe0b3ffbd31a11e5447879ce'
7
+ data.tar.gz: 54744a18ef6b061c0cfb29e285727e4e82269fdc14d916d09f95364ad358d2606124b976fee940a7582a150b826c8805922fc6633842e8c80901c42cf2288bc5
data/lib/outreach_gem.rb CHANGED
@@ -6,4 +6,7 @@ require_relative 'rest-client/restfulclient'
6
6
  require_relative 'rest-client/resttype'
7
7
 
8
8
  # Used to perform invocations to Amazon S3 in Ruby
9
- require_relative 'outreach-s3/ruby-upload-s3'
9
+ require_relative 'outreach-s3/ruby-upload-s3'
10
+
11
+ # Used to perform invocations to Amazon S3 in Ruby
12
+ require_relative 'release/release-ruby'
@@ -0,0 +1,91 @@
1
+ require 'json'
2
+
3
+ class Release
4
+
5
+ # This function is used to increase the Maven project version
6
+ # @param version [String] the version of project
7
+ # @param releaseType [String] this function accepts either 'minor' or 'major' as its param values
8
+ # @return The newly versioned project value
9
+ def self.increaseVersion(version, releasetype)
10
+ nums = version.split(".")
11
+ if releasetype.eql? 'major'
12
+ nums[1] = nums[1].to_i + 1
13
+ elsif releasetype.eql? 'minor'
14
+ nums[nums.length - 1] = nums[nums.length - 1].to_i + 1
15
+ else
16
+ raise 'major or minor was not passed into the function please the appropriate value'
17
+ end
18
+ return nums.join('.').to_s
19
+ end
20
+
21
+ # This fuction takes in the location of the Maven project and returns its version
22
+ # Must be running Maven 3.6.x in order for this to work properly
23
+ # @param [String] projectLocation this is the location as to where the Maven project resides on disk
24
+ # @return [String] currentVersion_1 this is the version of the maven project
25
+ def self.getProjectVersion(projectLocation)
26
+ Dir.chdir(projectLocation){
27
+ # Get current project version
28
+ currentVersion_1 = `mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout`
29
+ return currentVersion_1
30
+ }
31
+ end
32
+
33
+ def self.removeSnapshot(version)
34
+ return version.sub('-SNAPSHOT', '')
35
+ end
36
+
37
+ def self.mavenVersion(projectLocation, newVersion)
38
+ Dir.chdir(projectLocation){
39
+ `mvn versions:set -DnewVersion=#{newVersion} -DgenerateBackupPoms=false`
40
+ }
41
+ end
42
+
43
+ def self.gitMerge(projectLocation, branch)
44
+ Dir.chdir(projectLocation) {
45
+ `git merge #{branch}`
46
+ }
47
+ end
48
+
49
+ def self.gitCheckout(projectLocation, branch)
50
+ Dir.chdir(projectLocation) {
51
+ `git checkout #{branch}`
52
+ }
53
+ end
54
+
55
+ def self.gitAddAll(projectLocation)
56
+ Dir.chdir(projectLocation) {
57
+ `git add .`
58
+ }
59
+ end
60
+
61
+ def self.gitCommit(projectLocation, commitMessage)
62
+ Dir.chdir(projectLocation) {
63
+ `git commit -m "#{commitMessage}"`
64
+ }
65
+ end
66
+
67
+ def self.gitPush(projectLocation)
68
+ Dir.chdir(projectLocation) {
69
+ `git push origin`
70
+ }
71
+ end
72
+
73
+ def self.gitTag(projectLocation, tagName)
74
+ Dir.chdir(projectLocation) {
75
+ `git tag #{tagName}`
76
+ `git push origin --tags`
77
+ }
78
+ end
79
+
80
+ # This function will change the contents of a file.
81
+ # The function takes the text `from` and converts it `to`
82
+ # It then returns the file as a response
83
+ # @param file [File] A file to be changed
84
+ # @param from [String] The original String value
85
+ # @param to [String] The String value to change the from value too
86
+ # @result new_contents [File] The changed file
87
+ def self.changeVersionNumber(file, from, to)
88
+ new_contents = file.sub(from, to)
89
+ return new_contents
90
+ end
91
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: outreach_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.60
4
+ version: 1.0.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrique Legault
@@ -19,6 +19,7 @@ files:
19
19
  - lib/helpers/helpers.rb
20
20
  - lib/outreach-s3/ruby-upload-s3.rb
21
21
  - lib/outreach_gem.rb
22
+ - lib/release/release-ruby.rb
22
23
  - lib/rest-client/restfulclient.rb
23
24
  - lib/rest-client/resttype.rb
24
25
  homepage: https://github.com/AES-Outreach/Outreach-Ruby-Gems