milestoner 4.0.0 → 4.1.0

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: d59ec9f24097f54832599544a5de919b79c5820f
4
- data.tar.gz: da3aed2ba4636234804e21a9af13a1133d3e17bd
3
+ metadata.gz: 85a7f734aae088512876d9b105effac0a4d2efbb
4
+ data.tar.gz: 079fda114d2e4387968720a2af157f97ac5afc78
5
5
  SHA512:
6
- metadata.gz: 4c66221673d33f7b09c96b57736bc62b44df5746bb493ec1c7db2a63e441f4b3ceb8db001a53479621963e2138543c19dbd6fbd68f4e4d68ed63c8b7e0ec8bca
7
- data.tar.gz: d1b34c04978f023e475c94a948def99ae4177723dd2387de0fc5c8cb1d24fde235b42290818c98c0a026c9f42738757806549515b2b258d853604dd1400ff579
6
+ metadata.gz: 0421316c25c9b1f09ce4f1850b9c647315870b744f7328d4dae947d8323f0379ab27efdb60300cca4dcc83dc38b99867856004f0b11cde036016a1a971c14307
7
+ data.tar.gz: 9a773778f8c2d7f2ca23f488673607a6914f846fd6e6d9c4872190cbbf438e92ffe7eb1dd9a3f21094e30e6a83664c1144453107b602fe626ae404baf8520247
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/bin/milestoner CHANGED
@@ -1,4 +1,4 @@
1
- #! /usr/bin/ruby
1
+ #! /usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "milestoner"
data/lib/milestoner.rb CHANGED
@@ -3,7 +3,9 @@
3
3
  require "milestoner/errors/base"
4
4
  require "milestoner/errors/duplicate_tag"
5
5
  require "milestoner/errors/git"
6
- require "milestoner/git"
6
+ require "milestoner/git/config"
7
+ require "milestoner/git/kit"
8
+ require "milestoner/cli"
7
9
  require "milestoner/identity"
8
10
  require "milestoner/publisher"
9
11
  require "milestoner/pusher"
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "yaml"
4
3
  require "thor"
5
4
  require "thor/actions"
6
5
  require "thor_plus/actions"
@@ -14,8 +13,8 @@ module Milestoner
14
13
 
15
14
  package_name Identity.version_label
16
15
 
17
- def self.defaults
18
- {
16
+ def self.configuration
17
+ Runcom::Configuration.new file_name: Identity.file_name, defaults: {
19
18
  version: "0.1.0",
20
19
  git_commit_prefixes: %w[Fixed Added Updated Removed Refactored],
21
20
  git_tag_sign: false
@@ -25,9 +24,8 @@ module Milestoner
25
24
  # rubocop:disable Metrics/AbcSize
26
25
  def initialize args = [], options = {}, config = {}
27
26
  super args, options, config
28
- @configuration = Runcom::Configuration.new file_name: Identity.file_name, defaults: self.class.defaults
29
- @tagger = Tagger.new configuration.to_h[:version],
30
- commit_prefixes: configuration.to_h[:git_commit_prefixes]
27
+ @tagger = Tagger.new self.class.configuration.to_h[:version],
28
+ commit_prefixes: self.class.configuration.to_h[:git_commit_prefixes]
31
29
  @pusher = Pusher.new
32
30
  @publisher = Publisher.new tagger: tagger, pusher: pusher
33
31
  end
@@ -43,7 +41,7 @@ module Milestoner
43
41
  desc "-t, [--tag=VERSION]", "Tag local repository with new version."
44
42
  map %w[-t --tag] => :tag
45
43
  method_option :sign, aliases: "-s", desc: "Sign tag with GPG key.", type: :boolean, default: false
46
- def tag version = configuration.to_h[:version]
44
+ def tag version = self.class.configuration.to_h[:version]
47
45
  tagger.create version, sign: sign_tag?(options[:sign])
48
46
  say "Repository tagged: #{tagger.version_label}."
49
47
  rescue StandardError => exception
@@ -62,7 +60,7 @@ module Milestoner
62
60
  desc "-P, [--publish=VERSION]", "Tag and push milestone to remote repository."
63
61
  map %w[-P --publish] => :publish
64
62
  method_option :sign, aliases: "-s", desc: "Sign tag with GPG key.", type: :boolean, default: false
65
- def publish version = configuration.to_h[:version]
63
+ def publish version = self.class.configuration.to_h[:version]
66
64
  publisher.publish version, sign: sign_tag?(options[:sign])
67
65
  info "Repository tagged and pushed: #{tagger.version_label}."
68
66
  info "Milestone published!"
@@ -70,13 +68,21 @@ module Milestoner
70
68
  error exception.message
71
69
  end
72
70
 
73
- desc "-c, [--config]", "Manage gem configuration."
71
+ desc "-c, [--config]", %(Manage gem configuration ("#{configuration.computed_path}").)
74
72
  map %w[-c --config] => :config
75
- method_option :edit, aliases: "-e", desc: "Edit gem configuration.", type: :boolean, default: false
76
- method_option :info, aliases: "-i", desc: "Print gem configuration info.", type: :boolean, default: false
73
+ method_option :edit,
74
+ aliases: "-e",
75
+ desc: "Edit gem configuration.",
76
+ type: :boolean, default: false
77
+ method_option :info,
78
+ aliases: "-i",
79
+ desc: "Print gem configuration.",
80
+ type: :boolean, default: false
77
81
  def config
78
- if options.edit? then `#{editor} #{configuration.computed_path}`
79
- elsif options.info? then say("Using: #{configuration.computed_path}.")
82
+ path = self.class.configuration.computed_path
83
+
84
+ if options.edit? then `#{editor} #{path}`
85
+ elsif options.info? then say(path)
80
86
  else help(:config)
81
87
  end
82
88
  end
@@ -98,7 +104,7 @@ module Milestoner
98
104
  attr_reader :configuration, :tagger, :pusher, :publisher
99
105
 
100
106
  def sign_tag? sign
101
- sign | configuration.to_h[:git_tag_sign]
107
+ sign | self.class.configuration.to_h[:git_tag_sign]
102
108
  end
103
109
  end
104
110
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "open3"
4
+
5
+ module Milestoner
6
+ module Git
7
+ # A lightweight Git Config wrapper.
8
+ class Config
9
+ def initialize shell: Open3
10
+ @shell = shell
11
+ end
12
+
13
+ def get key
14
+ shell.capture3 "git config --get #{key}"
15
+ end
16
+
17
+ def set key, value
18
+ shell.capture3 %(git config --add #{key} "#{value}")
19
+ end
20
+
21
+ def value key
22
+ get(key).first.chomp
23
+ end
24
+
25
+ private
26
+
27
+ attr_reader :shell
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Milestoner
4
+ module Git
5
+ # A lightweight Git wrapper.
6
+ class Kit
7
+ def supported?
8
+ File.exist? File.join(Dir.pwd, ".git")
9
+ end
10
+
11
+ def commits?
12
+ system "git log > /dev/null 2>&1"
13
+ end
14
+
15
+ def remote?
16
+ system "git config remote.origin.url"
17
+ end
18
+ end
19
+ end
20
+ end
@@ -12,7 +12,7 @@ module Milestoner
12
12
  end
13
13
 
14
14
  def self.version
15
- "4.0.0"
15
+ "4.1.0"
16
16
  end
17
17
 
18
18
  def self.version_label
@@ -3,7 +3,7 @@
3
3
  module Milestoner
4
4
  # Handles publishing of Git tags to remote repository.
5
5
  class Pusher
6
- def initialize git: Git.new, shell: Kernel
6
+ def initialize git: Git::Kit.new, shell: Kernel
7
7
  @git = git
8
8
  @shell = shell
9
9
  end
@@ -13,7 +13,7 @@ module Milestoner
13
13
 
14
14
  def_delegator :version, :label, :version_label
15
15
 
16
- def initialize version = "0.1.0", commit_prefixes: [], git: Git.new
16
+ def initialize version = "0.1.0", commit_prefixes: [], git: Git::Kit.new
17
17
  @version = Versionaire::Version version
18
18
  @commit_prefixes = commit_prefixes
19
19
  @git = git
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require "reek/rake/task"
5
+ Reek::Rake::Task.new
6
+ rescue LoadError => error
7
+ puts error.message
8
+ end
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: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -30,7 +30,7 @@ cert_chain:
30
30
  n/LUZ1dKhIHzfKx1B4+TEIefArObGfkLIDM8+Dq1RX7TF1k81Men7iu4MgE9bYBn
31
31
  3dE+xI3FdB5gWcdWxdtgRCmWjtXeYYyb4z6NQQ==
32
32
  -----END CERTIFICATE-----
33
- date: 2016-11-05 00:00:00.000000000 Z
33
+ date: 2016-11-13 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: thor
@@ -52,42 +52,42 @@ dependencies:
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '4.0'
55
+ version: '4.1'
56
56
  type: :runtime
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '4.0'
62
+ version: '4.1'
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: runcom
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '0.2'
69
+ version: '0.3'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '0.2'
76
+ version: '0.3'
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: versionaire
79
79
  requirement: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '2.0'
83
+ version: '2.1'
84
84
  type: :runtime
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '2.0'
90
+ version: '2.1'
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rake
93
93
  requirement: !ruby/object:Gem::Requirement
@@ -102,6 +102,20 @@ dependencies:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
104
  version: '11.0'
105
+ - !ruby/object:Gem::Dependency
106
+ name: gemsmith
107
+ requirement: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '8.0'
112
+ type: :development
113
+ prerelease: false
114
+ version_requirements: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '8.0'
105
119
  - !ruby/object:Gem::Dependency
106
120
  name: pry
107
121
  requirement: !ruby/object:Gem::Requirement
@@ -242,6 +256,20 @@ dependencies:
242
256
  - - "~>"
243
257
  - !ruby/object:Gem::Version
244
258
  version: '0.0'
259
+ - !ruby/object:Gem::Dependency
260
+ name: reek
261
+ requirement: !ruby/object:Gem::Requirement
262
+ requirements:
263
+ - - "~>"
264
+ - !ruby/object:Gem::Version
265
+ version: '4.5'
266
+ type: :development
267
+ prerelease: false
268
+ version_requirements: !ruby/object:Gem::Requirement
269
+ requirements:
270
+ - - "~>"
271
+ - !ruby/object:Gem::Version
272
+ version: '4.5'
245
273
  - !ruby/object:Gem::Dependency
246
274
  name: rubocop
247
275
  requirement: !ruby/object:Gem::Requirement
@@ -262,14 +290,14 @@ dependencies:
262
290
  requirements:
263
291
  - - "~>"
264
292
  - !ruby/object:Gem::Version
265
- version: '0.6'
293
+ version: '1.0'
266
294
  type: :development
267
295
  prerelease: false
268
296
  version_requirements: !ruby/object:Gem::Requirement
269
297
  requirements:
270
298
  - - "~>"
271
299
  - !ruby/object:Gem::Version
272
- version: '0.6'
300
+ version: '1.0'
273
301
  description:
274
302
  email:
275
303
  - brooke@alchemists.io
@@ -288,11 +316,13 @@ files:
288
316
  - lib/milestoner/errors/base.rb
289
317
  - lib/milestoner/errors/duplicate_tag.rb
290
318
  - lib/milestoner/errors/git.rb
291
- - lib/milestoner/git.rb
319
+ - lib/milestoner/git/config.rb
320
+ - lib/milestoner/git/kit.rb
292
321
  - lib/milestoner/identity.rb
293
322
  - lib/milestoner/publisher.rb
294
323
  - lib/milestoner/pusher.rb
295
324
  - lib/milestoner/tagger.rb
325
+ - lib/tasks/reek.rake
296
326
  - lib/tasks/rspec.rake
297
327
  - lib/tasks/rubocop.rake
298
328
  homepage: https://github.com/bkuhlmann/milestoner
metadata.gz.sig CHANGED
Binary file
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Milestoner
4
- # A lightweight Git wrapper.
5
- class Git
6
- def supported?
7
- File.exist? File.join(Dir.pwd, ".git")
8
- end
9
-
10
- def commits?
11
- system "git log > /dev/null 2>&1"
12
- end
13
-
14
- def remote?
15
- system "git config remote.origin.url"
16
- end
17
- end
18
- end