build_promotion_tool 0.1.2 → 0.1.3

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: d04e5ad794fd4b9daf0b5cf73982c193896849f5
4
- data.tar.gz: 75905ba06e84bc586ad9c936169fa989130d8bae
3
+ metadata.gz: 2473c9777f583422960cad63483c22979395b49f
4
+ data.tar.gz: 033b74bdf3dc56ab3382a7ba0fcee9a92ef41044
5
5
  SHA512:
6
- metadata.gz: 47a14e598ba2e16648294e40ae454b607d44488cd76827a2ea71158c475aee368b19b1dfa688a4ab9822caca2529163481408523b9a814b847a4761a288969ba
7
- data.tar.gz: c5da3d7d24b04aa0a7b40b7a8a739f45905306c866a848030d7a2c4ba387703c350a4e1ad411cfb77308b7a4a7efbb558209af4b41aac446d5c6b83c1a6179b6
6
+ metadata.gz: 985d179f620aee7c874f5bfb08a6290785f1ad513779f5f1c9ea43fc8ed2eb5d83e1a0739040168dd18f39cf9a3129175cf1e931d7701932f998b04f2dd8f8ba
7
+ data.tar.gz: 60c532af340656c9c4f22a3ea64044e1e0fbd504d8821d91703ef390467590a7816f400e2fb185b345c03e5a7bf322defc8705d876d9410b005fd6bc98d8090d
data/README.md CHANGED
@@ -31,7 +31,7 @@ __First Deploy Step: Dev Tag__
31
31
  ```
32
32
 
33
33
  - If no prior develop tag has been assigned, the user will be asked whether they would like to assign the first develop tag. If they select yes, first tag 'dev-v0.0.1' is applied.
34
- - If previous develop tags have been applied, the latest develop tag is displayed and the user is asked whether they would like to do a _major, minor, or patch_ update. See: [Semantic Versioning](http://semver.org).
34
+ - If previous develop tags have been applied, the latest develop tag is displayed and the user is asked whether they would like to do a `major/ma`, `minor/mi`, or `patch/p` update. See: [Semantic Versioning](http://semver.org).
35
35
  - The user inputs their choice, the user is shown the new tag (e.g. dev-v0.1.2) and is asked to confirm their choice and apply the tag.
36
36
  - When the user selects yes to updating the tag, the tag version number is updated.
37
37
  - The tag is then added to the repository and pushed to the remote.
@@ -68,7 +68,7 @@ class DeployController
68
68
  loop do
69
69
  @user_comms.ask_increment_type
70
70
  @to_increment = @user_comms.user_increment_choice
71
- break if ['major', 'minor', 'patch'].include? @to_increment
71
+ break if ['major', 'minor', 'patch', 'p', 'mi', 'ma'].include? @to_increment
72
72
  end
73
73
  @to_increment
74
74
  end
@@ -12,11 +12,11 @@ class DevelopTagGenerator
12
12
  def next_develop_tag(to_increment)
13
13
  last_version = biggest_version
14
14
  case to_increment
15
- when "major"
15
+ when "major", "ma"
16
16
  "dev-v#{last_version.major + 1}.0.0"
17
- when "minor"
17
+ when "minor", "mi"
18
18
  "dev-v#{last_version.major}.#{last_version.minor + 1}.0"
19
- when "patch"
19
+ when "patch", "p"
20
20
  "dev-v#{last_version.major}.#{last_version.minor}.#{last_version.patch + 1}"
21
21
  end
22
22
  end
@@ -4,7 +4,7 @@ class UserCommsHelper
4
4
  all_tags = Configure.tag_types['all_tags']
5
5
  ERROR_INITIALISE_WITH_STRING_IO = "Initialise with StringIO objects"
6
6
  TELL_USER_NO_DEVELOP_TAGS = "No develop tags exist for this repository"
7
- ASK_USER_INCREMENT_TYPE = "Would you like to do a major, minor, or patch increment?"
7
+ ASK_USER_INCREMENT_TYPE = "Would you like to do a major(ma), minor(mi), or patch(p) increment?"
8
8
  ERROR_SELECT_ACCEPTED_INCREMENT_TYPE = "Error: please select major, minor or patch update"
9
9
  ERROR_NEXT_TAG_NOT_ASSIGNED = "Next tag has not been assigned"
10
10
  ERROR_SELECT_Y_OR_N = "Error: please select y/n"
@@ -28,7 +28,7 @@ class UserCommsHelper
28
28
 
29
29
  def user_increment_choice
30
30
  increment_choice = @stdin.gets.chomp().downcase
31
- if increment_choice == "major" || increment_choice == "minor" || increment_choice == "patch"
31
+ if ['major', 'minor', 'patch', 'p', 'mi','ma'].include? increment_choice
32
32
  return increment_choice
33
33
  else
34
34
  @stdout.puts ERROR_SELECT_ACCEPTED_INCREMENT_TYPE
@@ -67,13 +67,28 @@ describe 'DevelopTagGenerator' do
67
67
  expect(next_tag).to eq("dev-v2.0.0")
68
68
  end
69
69
 
70
+ it 'returns the next version for Ma (major) update' do
71
+ next_tag = develop_tag_generator.next_develop_tag("ma")
72
+ expect(next_tag).to eq("dev-v2.0.0")
73
+ end
74
+
70
75
  it 'returns the next version for minor update' do
71
76
  next_tag = develop_tag_generator.next_develop_tag("minor")
72
77
  expect(next_tag).to eq("dev-v1.2.0")
73
78
  end
74
79
 
75
- it 'returns the next version for patch update' do
76
- next_tag = develop_tag_generator.next_develop_tag("patch")
80
+ it 'returns the next version for mI (minor) update' do
81
+ next_tag = develop_tag_generator.next_develop_tag("mi")
82
+ expect(next_tag).to eq("dev-v1.2.0")
83
+ end
84
+
85
+ it 'returns the next version for p (patch) update' do
86
+ next_tag = develop_tag_generator.next_develop_tag("p")
87
+ expect(next_tag).to eq("dev-v1.1.2")
88
+ end
89
+
90
+ it 'returns the next version for p (patch) update' do
91
+ next_tag = develop_tag_generator.next_develop_tag("p")
77
92
  expect(next_tag).to eq("dev-v1.1.2")
78
93
  end
79
94
  end
@@ -59,6 +59,20 @@ describe 'UserCommsHelper' do
59
59
  end
60
60
  end
61
61
 
62
+ context "when the user inputs their increment_choice as 'ma'" do
63
+ it "should accept the user's input as major" do
64
+ allow(stdin).to receive(:gets).and_return("ma")
65
+ expect(user_comms.user_increment_choice).to eq("ma")
66
+ end
67
+ end
68
+
69
+ context "when the user inputs their increment_choice as 'mA'" do
70
+ it "should accept the user's input as major" do
71
+ allow(stdin).to receive(:gets).and_return("mA")
72
+ expect(user_comms.user_increment_choice).to eq("ma")
73
+ end
74
+ end
75
+
62
76
  context "when the user inputs a choice which is not major, minor, or patch" do
63
77
  it "returns an error asking the user to choose major, minor, or patch" do
64
78
  allow(stdin).to receive(:gets).and_return("hello")
@@ -1,3 +1,3 @@
1
1
  module BuildPromotionTool
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build_promotion_tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emily Woods
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-10 00:00:00.000000000 Z
11
+ date: 2017-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -54,7 +54,6 @@ files:
54
54
  - bin/console
55
55
  - bin/deploy
56
56
  - bin/setup
57
- - build_promotion_tool-0.1.1.gem
58
57
  - build_promotion_tool.gemspec
59
58
  - lib/build_promotion_tool.rb
60
59
  - lib/build_promotion_tool/.rspec
Binary file