changelog-builder 1.0.0 → 1.0.1

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.
data/rakelib/docs.rake ADDED
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'English'
4
+ require 'yard'
5
+ require 'fileutils'
6
+
7
+ GEM_NAME = Bundler.load_gemspec(Dir.glob('*.gemspec').first).name
8
+ DOCS_REPO_NAME = "#{GEM_NAME}_docs".freeze
9
+ DOCS_REPO_PATH = "../#{DOCS_REPO_NAME}".freeze
10
+
11
+ namespace :docs do
12
+ desc 'Generate new docs and push them to repo'
13
+ task generate: :clean do
14
+ puts 'Generating docs...'
15
+ YARD::CLI::Yardoc.run
16
+ puts 'OK!'
17
+ end
18
+
19
+ desc 'Clean existing docs'
20
+ task :clean do
21
+ if File.directory?('doc')
22
+ FileUtils.rm_rf('doc')
23
+ puts 'Cleaned existing docs directory'
24
+ end
25
+ end
26
+
27
+ desc 'Pushes docs to github'
28
+ task push: :generate do
29
+ unless File.directory?(DOCS_REPO_PATH)
30
+ puts "Error: Docs repo not found at #{DOCS_REPO_PATH}"
31
+ puts 'Please clone the docs repo first:'
32
+ puts " git clone git@github.com:unurgunite/#{DOCS_REPO_NAME}.git #{DOCS_REPO_PATH}"
33
+ exit 1
34
+ end
35
+
36
+ puts "Copying docs to #{DOCS_REPO_PATH}..."
37
+ FileUtils.mkdir_p('doc') unless File.directory?('doc')
38
+ FileUtils.cp_r('doc/.', DOCS_REPO_PATH)
39
+
40
+ puts 'Changing dir...'
41
+ Dir.chdir(DOCS_REPO_PATH) do
42
+ puts 'Checking git status...'
43
+ status_output = `git status --porcelain`
44
+
45
+ if status_output.strip.empty?
46
+ puts 'No changes to commit'
47
+ else
48
+ puts 'Committing git changes...'
49
+ puts `git add .`
50
+ commit_result = `git commit -m "Update docs for #{GEM_NAME} #{Time.now.utc.strftime('%Y-%m-%d %H:%M:%S UTC')}"`
51
+ puts commit_result
52
+
53
+ if $CHILD_STATUS.success?
54
+ puts 'Pushing to GitHub...'
55
+ push_result = `git push origin master 2>&1`
56
+ puts push_result
57
+ if $CHILD_STATUS.success?
58
+ puts 'Docs successfully pushed!'
59
+ else
60
+ puts 'Push failed!'
61
+ exit 1
62
+ end
63
+ else
64
+ puts 'Commit failed!'
65
+ exit 1
66
+ end
67
+ end
68
+ end
69
+ end
70
+
71
+ desc 'Generate and push docs in one command'
72
+ task deploy: :push
73
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: changelog-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - unurgunite
@@ -20,9 +20,11 @@ executables:
20
20
  extensions: []
21
21
  extra_rdoc_files: []
22
22
  files:
23
+ - ".github/workflows/ci.yml"
23
24
  - ".gitignore"
24
25
  - ".rspec"
25
26
  - ".rubocop.yml"
27
+ - ".rubocop_todo.yml"
26
28
  - ".ruby-version"
27
29
  - ".yardopts"
28
30
  - CHANGELOG.md
@@ -33,8 +35,9 @@ files:
33
35
  - README.md
34
36
  - Rakefile
35
37
  - bin/console
38
+ - bin/release
36
39
  - bin/setup
37
- - changelogger.gemspec
40
+ - changelog-builder.gemspec
38
41
  - docs/demo.gif
39
42
  - exe/changelogger
40
43
  - lib/changelogger.rb
@@ -49,6 +52,7 @@ files:
49
52
  - lib/changelogger/tui.rb
50
53
  - lib/changelogger/version.rb
51
54
  - lib/changelogger/versioner.rb
55
+ - rakelib/docs.rake
52
56
  homepage: https://github.com/unurgunite/changelogger
53
57
  licenses:
54
58
  - MIT
@@ -57,6 +61,7 @@ metadata:
57
61
  homepage_uri: https://github.com/unurgunite/changelogger
58
62
  source_code_uri: https://github.com/unurgunite/changelogger
59
63
  changelog_uri: https://github.com/unurgunite/changelogger/CHANGELOG.md
64
+ rubygems_mfa_required: 'true'
60
65
  rdoc_options: []
61
66
  require_paths:
62
67
  - lib
@@ -64,7 +69,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
64
69
  requirements:
65
70
  - - ">="
66
71
  - !ruby/object:Gem::Version
67
- version: 2.7.0
72
+ version: 3.0.0
68
73
  required_rubygems_version: !ruby/object:Gem::Requirement
69
74
  requirements:
70
75
  - - ">="
data/changelogger.gemspec DELETED
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/changelogger/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "changelog-builder"
7
- spec.version = Changelogger::VERSION
8
- spec.authors = %w[unurgunite SY573M404]
9
- spec.email = ["senpaiguru1488@gmail.com", "admin@trolltom.xyz"]
10
-
11
- spec.summary = "Gem to generate CHANGELOG.md"
12
- spec.description = "A pretty simple gem to easily create changelogs according to your git commit history."
13
- spec.homepage = "https://github.com/unurgunite/changelogger"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.7.0"
16
-
17
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
-
19
- spec.metadata["homepage_uri"] = spec.homepage
20
- spec.metadata["source_code_uri"] = "https://github.com/unurgunite/changelogger"
21
- spec.metadata["changelog_uri"] = "https://github.com/unurgunite/changelogger/CHANGELOG.md"
22
-
23
- # Specify which files should be added to the gem when it is released.
24
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
27
- end
28
- spec.bindir = "exe"
29
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
- spec.require_paths = ["lib"]
31
-
32
- # Uncomment to register a new dependency of your gem
33
- # spec.add_dependency "example-gem", "~> 1.0"
34
-
35
- # For more information and examples about making a new gem, checkout our
36
- # guide at: https://bundler.io/guides/creating_gem.html
37
- end