milestoner 0.4.0 → 0.5.0

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: 2f8ac8304b27843a087593b12cf0ed45945701bc
4
- data.tar.gz: 2fc0db25d0afba6db7131dc340d3404b478e19a2
3
+ metadata.gz: 6db913cce4d7f76264021448bd432d2567bdff6e
4
+ data.tar.gz: b898d30b6c7a9fbb4abae5faf8702cab53f4d829
5
5
  SHA512:
6
- metadata.gz: 1eebacca1ca1eb38c801ffbd1ee35ad749e07a6f64394faa381385a325f83a11f6ad2fbdb533b313109e267775ce9fca4057f6eebf076929c205ead896cd57b4
7
- data.tar.gz: bf566fa3250f24929aa519d647f64b2b77e47e0c6c235a79d70e68060d0bbf61d562bf91454988f187834d8e43c70cf9b77081240b1e226d7e12bdcad74bde83
6
+ metadata.gz: e3eb38029c7bb71f797fcbe218a5ad254d811739941a0efd92ea264a2cf040e871f25672949041b0d92beb447d1e3b4bc8233f39f37de1015673e74e9aa8abfc
7
+ data.tar.gz: 1b245772463afde2da6cd849961b51db56f14cd082b3cf3f4a2ea737d88d3f77725bbe83179646a72c62bd6501acaa357d8da1dd045b151241521abcfb9de974
@@ -1,2 +1,2 @@
1
- U��?�!Z�Ɓ:} b�.�*���te8��@��,�e�3Y�ʷ�;�|)��
2
- ݘ7��i��:0��f9{<OZWv6 5��00��[��4O=��o��/��vJD]l
1
+ Sf,NHE��$#Eٲ,������Zay��T(���Kr$���&̝�1{�D6<�T�
2
+ ����644uj��/���e �1���_w �،�I� ���rrg,ý��S>j�����|�)T��)�%�������Y,��BE�~�h�}�<�i1��FL[�k�(�=��5N �N����S8��M�M���ɞ8��ì�H@2.��7�+ԤQ��f@�,0
data.tar.gz.sig CHANGED
@@ -1,2 +1,4 @@
1
- f�wR�O��Ȑ���:���O�3�4O'<�>�j{m�T�kW�no{�͊�d��+�G���
2
- Q��4��l*k�q����s���u�S��sê�RB�o����W� �/����~831������t*$��)�l4��ƥu%ET3�Iզ 8J�V�(sp���cJ����x6[p͋x�{��75����:�B�X��'�tnE}�g�T��nx�l���$|�t# �C��uX�����P
1
+ ��,u0{
2
+ /�� �Q��� ��9k!Y
3
+ ��J.\���|���:9I|Ք��Fw���1J{1)S�ֽb��fO�%����
4
+ +�� �w�J�~�؁u�(;f� |(1G���"gt���p��b����)�<=���/e���2���橉��=b�z�`��(�V�ʾw����_:���v-��N��`�!��^{E$�#��D��/͙I��$�^i�@�^�ˆ�В�$̩Η��� ��=���^�
@@ -6,5 +6,6 @@ require "milestoner/errors/git"
6
6
  require "milestoner/errors/version"
7
7
  require "milestoner/configuration"
8
8
  require "milestoner/identity"
9
+ require "milestoner/publisher"
9
10
  require "milestoner/pusher"
10
11
  require "milestoner/tagger"
@@ -5,6 +5,10 @@ module Milestoner
5
5
  def git_supported?
6
6
  File.exist? File.join(Dir.pwd, ".git")
7
7
  end
8
+
9
+ def git_remote?
10
+ !`git config remote.origin.url`.empty?
11
+ end
8
12
  end
9
13
  end
10
14
  end
@@ -17,6 +17,7 @@ module Milestoner
17
17
  @tagger = Milestoner::Tagger.new configuration.settings[:version],
18
18
  commit_prefixes: configuration.settings[:git_commit_prefixes]
19
19
  @pusher = Milestoner::Pusher.new
20
+ @publisher = Milestoner::Publisher.new tagger, pusher
20
21
  end
21
22
 
22
23
  desc "-c, [--commits]", "Show commits for next milestone."
@@ -50,7 +51,9 @@ module Milestoner
50
51
  map %w(-P --publish) => :publish
51
52
  method_option :sign, aliases: "-s", desc: "Sign tag with GPG key.", type: :boolean, default: false
52
53
  def publish version = configuration.settings[:version]
53
- tag_and_push version, options
54
+ publisher.publish version, sign: sign_tag?(options[:sign])
55
+ info "Repository tagged and pushed: #{tagger.version_label}."
56
+ info "Milestone published!"
54
57
  rescue Milestoner::Errors::Base => base_error
55
58
  error base_error.message
56
59
  end
@@ -76,7 +79,7 @@ module Milestoner
76
79
 
77
80
  private
78
81
 
79
- attr_reader :configuration, :tagger, :pusher
82
+ attr_reader :configuration, :tagger, :pusher, :publisher
80
83
 
81
84
  def defaults
82
85
  {
@@ -89,14 +92,5 @@ module Milestoner
89
92
  def sign_tag? sign
90
93
  sign | configuration.settings[:git_tag_sign]
91
94
  end
92
-
93
- def tag_and_push version, options
94
- if tagger.create(version, sign: sign_tag?(options[:sign])) && pusher.push
95
- info "Repository tagged and pushed: #{tagger.version_label}."
96
- info "Milestone published!"
97
- else
98
- tagger.destroy
99
- end
100
- end
101
95
  end
102
96
  end
@@ -10,7 +10,7 @@ module Milestoner
10
10
  end
11
11
 
12
12
  def self.version
13
- "0.4.0"
13
+ "0.5.0"
14
14
  end
15
15
 
16
16
  def self.version_label
@@ -0,0 +1,20 @@
1
+ module Milestoner
2
+ # Handles the tagging and pushing of a milestone to a remote repository.
3
+ class Publisher
4
+ def initialize tagger, pusher
5
+ @tagger = tagger
6
+ @pusher = pusher
7
+ end
8
+
9
+ def publish version, sign: false
10
+ tagger.create version, sign: sign
11
+ pusher.push
12
+ ensure
13
+ tagger.destroy
14
+ end
15
+
16
+ private
17
+
18
+ attr_reader :tagger, :pusher
19
+ end
20
+ end
@@ -9,6 +9,7 @@ module Milestoner
9
9
 
10
10
  def push
11
11
  fail(Errors::Git) unless git_supported?
12
+ fail(Errors::Git, "Git remote repository is not configured.") unless git_remote?
12
13
  kernel.system "git push --tags"
13
14
  end
14
15
 
@@ -1,3 +1,5 @@
1
+ require "open3"
2
+
1
3
  module Milestoner
2
4
  # Handles the tagging of a project repository.
3
5
  class Tagger
@@ -59,7 +61,7 @@ module Milestoner
59
61
 
60
62
  def destroy
61
63
  fail(Errors::Git) unless git_supported?
62
- `git tag --delete #{version_label}`
64
+ Open3.capture3 "git tag --delete #{version_label}" if duplicate?
63
65
  end
64
66
 
65
67
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: milestoner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -30,7 +30,7 @@ cert_chain:
30
30
  aSif+qBc6oHD7EQWPF5cZkzkIURuwNwPBngZGxIKaMAgRhjGFXzUMAaq++r59cS9
31
31
  xTfQ4k6fglKEgpnLAXiKdo2c8Ym+X4rIKFfedQ==
32
32
  -----END CERTIFICATE-----
33
- date: 2015-09-13 00:00:00.000000000 Z
33
+ date: 2015-09-17 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: thor
@@ -298,7 +298,7 @@ dependencies:
298
298
  - - ">="
299
299
  - !ruby/object:Gem::Version
300
300
  version: '0'
301
- description: A tool for automating and releasing Git repository milestones.
301
+ description: A command line interface for releasing Git repository milestones.
302
302
  email:
303
303
  - brooke@alchemists.io
304
304
  executables:
@@ -321,6 +321,7 @@ files:
321
321
  - lib/milestoner/errors/git.rb
322
322
  - lib/milestoner/errors/version.rb
323
323
  - lib/milestoner/identity.rb
324
+ - lib/milestoner/publisher.rb
324
325
  - lib/milestoner/pusher.rb
325
326
  - lib/milestoner/tagger.rb
326
327
  - lib/milestoner/tasks/rspec.rake
@@ -348,5 +349,5 @@ rubyforge_project:
348
349
  rubygems_version: 2.4.8
349
350
  signing_key:
350
351
  specification_version: 4
351
- summary: A tool for automating and releasing Git repository milestones.
352
+ summary: A command line interface for releasing Git repository milestones.
352
353
  test_files: []
metadata.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- d�#AI-�[�I��rs����7y�iZ2��d��O`�-�;�#�����ye[4�z��d��La���'���faYWDܩ���<��P�xW �47 �}�ٴ��8Ͳ��a�+';�e�m6��K/�'����u}H�qZT����
2
- /������ǟ z,�6җ��_DH�D4�
1
+ ��yRN�K�k��@�j(R(�I�$�F�\iPyJ���PsH��+���p��ʫmoT0��_�����fr[ڸ��3G��ـ��/D=-���ú���~�S���25u
2
+ Q���`JqX;���i���޷p{D�:�"
3
+ ��y���^�f����<����_sR꒜U�@�@|i��ϛj=�����^и�$�Y�i;�Z�