autowow 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7482fff9d153970c14373eb4d5b3dbab430445d
4
- data.tar.gz: 3a1ffc1ae8e52213ed88bacf2985e030ca8b8a99
3
+ metadata.gz: 475fc48c1167d733a6ad51b87386286a2ab4e590
4
+ data.tar.gz: a6432265b980ab8cdeef327fc834b32118632e0f
5
5
  SHA512:
6
- metadata.gz: 2379b4578f694a293015968c6fa151ea5a378a40c2eaf48f9bf1dc0836ceb1ce6e0fbfc5c7ca971494a99de61b9d0c32f04cd11c6b6fc898c6759007ed7ea5ff
7
- data.tar.gz: de34bb3e6843016bd04a7683d18e7ade9b5d10435ad0d4797cde23797f0163fb57bee42cc122f1bb8d5071c479ab546dca2e4edc1dfae2778dfe24447283bbd3
6
+ metadata.gz: 8e79814e744d6b871dd7908885fc35bb888a444bd1e3383776e5a51dd911701f14f97351d684545dedf212e2e17a64afc63408e95f1485cd74c914ed13e7f5ea
7
+ data.tar.gz: 5a03fc636bccdcc46fd4f58dffadf0168e0845a8416c36f1e119665794b9b2aec303256120f8bb6211952b8ef8d4b6c2232cac95083a39aac9b7b89e6be1c4dd
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  #### Set of commands to [auto]mate [w]ay [o]f [w]orking
4
4
 
5
5
  <!--- Version informartion -->
6
- *You are viewing the README of version [v0.9.5](https://github.com/thisismydesign/autowow/releases/tag/v0.9.5). You can find other releases [here](https://github.com/thisismydesign/autowow/releases).*
6
+ *You are viewing the README of version [v0.10.0](https://github.com/thisismydesign/autowow/releases/tag/v0.10.0). You can find other releases [here](https://github.com/thisismydesign/autowow/releases).*
7
7
  <!--- Version informartion end -->
8
8
 
9
9
  | Branch | Status |
@@ -112,6 +112,7 @@ Day starter routine for a new start
112
112
  * Commits and pushed changes to `master`
113
113
  * Rebases `release` branch to master
114
114
  * Releases gem via `rake release`
115
+ * Changes version information to development in README if present
115
116
 
116
117
  Prerequisites: on master
117
118
 
@@ -19,7 +19,7 @@ module Autowow
19
19
 
20
20
  if version
21
21
  pretty_with_output.run(bump(version))
22
- update_readme_version_information(version)
22
+ bump_readme_version_information(version)
23
23
  pretty.run(add(["README.md", "*version.rb"]))
24
24
  pretty.run(commit("Bumps version to v#{version}"))
25
25
  end
@@ -32,6 +32,11 @@ module Autowow
32
32
  pretty_with_output.run(release)
33
33
  end
34
34
 
35
+ if version && change_readme_version_information_to_development(version)
36
+ pretty.run(add(["README.md"]))
37
+ pretty.run(commit("Changes README to development version"))
38
+ end
39
+
35
40
  pretty_with_output.run(git_status)
36
41
  end
37
42
 
@@ -55,28 +60,56 @@ module Autowow
55
60
  Autowow::Executor.pretty_with_output.run(["bundle", "exec"] + cmd)
56
61
  end
57
62
 
58
- def update_readme_version_information(version)
63
+ def bump_readme_version_information(version)
59
64
  readme = File.new("README.md")
60
- if File.file?(readme)
61
- text = File.read(readme)
62
- matches = text.match(/<!--- Version informartion -->(.+)<!--- Version informartion end -->/m)
63
- return if matches.length == 0
64
- version_information = matches[0]
65
-
66
- new_version_information = if version_information.include?("development version")
67
- releases_link = version_information.match(/\[.+\]\(.+\)/)[0].split("(")[1].split("/tag")[0]
68
- <<-HEREDOC
69
- <!--- Version informartion -->
70
- *You are viewing the README of version [v#{version}](#{releases_link}/tag/v#{version}). You can find other releases [here](#{releases_link}).*
71
- <!--- Version informartion end -->
72
- HEREDOC
73
- else
74
- version_information.gsub(/[0-9]\.[0-9]\.[0-9]/, version)
75
- end
76
-
77
- text.gsub!(version_information, new_version_information)
78
- File.write(readme, text)
65
+ return unless File.file?(readme)
66
+ text = File.read(readme)
67
+ return unless contains_version_information?(text)
68
+
69
+ version_information = get_version_information(text)
70
+
71
+ new_version_information = if version_information.include?("development version")
72
+ releases_link = version_information.match(/\[.+\]\(.+\)/)[0].split("(")[1].split("/tag")[0]
73
+ <<-HEREDOC
74
+ <!--- Version informartion -->
75
+ *You are viewing the README of version [v#{version}](#{releases_link}/tag/v#{version}). You can find other releases [here](#{releases_link}).*
76
+ <!--- Version informartion end -->
77
+ HEREDOC
78
+ else
79
+ version_information.gsub(/[0-9]\.[0-9]\.[0-9]/, version)
79
80
  end
81
+
82
+ text.gsub!(version_information, new_version_information)
83
+ File.write(readme, text)
84
+ end
85
+
86
+ def change_readme_version_information_to_development(version)
87
+ readme = File.new("README.md")
88
+ return false unless File.file?(readme)
89
+ text = File.read(readme)
90
+ return false unless contains_version_information?(text)
91
+ version_information = get_version_information(text)
92
+ return false if version_information.include?("development version")
93
+
94
+ releases_link = version_information.match(/\[.+\]\(.+\)/)[0].split("(")[1].split("/tag")[0]
95
+
96
+ new_version_information = <<-HEREDOC
97
+ <!--- Version informartion -->
98
+ *You are viewing the README of the development version. You can find the README of the latest release (v#{version}) [here](#{releases_link}/tag/v#{version}).*
99
+ <!--- Version informartion end -->
100
+ HEREDOC
101
+
102
+ text.gsub!(version_information, new_version_information)
103
+ File.write(readme, text)
104
+ true
105
+ end
106
+
107
+ def contains_version_information?(text)
108
+ text.match(/<!--- Version informartion -->(.+)<!--- Version informartion end -->/m).length > 0
109
+ end
110
+
111
+ def get_version_information(text)
112
+ text.match(/<!--- Version informartion -->(.+)<!--- Version informartion end -->/m)[0]
80
113
  end
81
114
 
82
115
  include ReflectionUtils::CreateModuleFunctions
@@ -1,3 +1,3 @@
1
1
  module Autowow
2
- VERSION = "0.9.5"
2
+ VERSION = "0.9.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autowow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - thisismydesign