pr-changelog 0.1.6 → 0.1.7

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.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/chlog +20 -10
  3. data/lib/pr_changelog_utils.rb +11 -2
  4. metadata +8 -14
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 15566580bd6ccd4581d395dc5ab903754d00687a
4
+ data.tar.gz: 080462740fddce2156bc62e60e2d90b5caba093d
5
+ SHA512:
6
+ metadata.gz: 1e010854516351cecb3d21c24e9636c0eb721a5f31c9119d11d997ac9fd40a94766b72c74097367070666ad8c548318cc2665cc9bb80d98ebb66d29f433b4d3d
7
+ data.tar.gz: 5573fa90b2625f6fd458d3e2fc45a338922c9772608ae961b0172b5dd670f4fcf5bb9d436142b88dfdca0fd4a7cb43bdac56077eb45f87b13cdd11cec6f427c0
data/bin/chlog CHANGED
@@ -8,27 +8,37 @@ program :version, '0.0.1'
8
8
  program :description, 'changelog will make a change log for an iOS project for current version'
9
9
 
10
10
  command :show do |c|
11
- c.syntax = 'changelog show [options]'
11
+ c.syntax = 'chlog show [options]'
12
12
  c.summary = ''
13
- c.description = ''
14
- c.example 'description', 'command example'
15
- c.option '--some-switch', 'Some switch that does something'
13
+ c.description = 'Show the changelog of the project in the current version'
14
+ c.example 'show last change', 'chlog show -l 1'
15
+ c.option '--char STRING', String, 'A character that should begin the PR message'
16
+ c.option '--l LINES', Integer, 'Number of lines of changelog show'
17
+ c.option '--noversion', 'Don\'t show a title with the number of version'
18
+ c.option '--nobullet', 'Don\'t show a bullet in the beggining of a PR message'
16
19
  c.action do |args, options|
17
20
 
18
- ChangelogUtils.validateCurrentDirectory
19
-
20
21
  currentVersion = ChangelogUtils.showVersion
21
- puts currentVersion
22
- puts "=============="
22
+ if !options.noversion
23
+ puts currentVersion
24
+ puts "=============="
25
+ end
23
26
 
27
+ ChangelogUtils.validateCurrentDirectory
28
+
29
+ count = 0
24
30
  while (ChangelogUtils.showVersion == currentVersion)
25
31
  ChangelogUtils.goBack
26
32
  if (ChangelogUtils.isPullRequestMerge)
27
- puts ChangelogUtils.printCurrentChange
33
+ if (options.l and options.l == count)
34
+ break
35
+ end
36
+ message = ChangelogUtils.printCurrentChange(options)
37
+ puts message if message
38
+ count = count + 1
28
39
  end
29
40
  end
30
41
 
31
42
  ChangelogUtils.goForward
32
43
  end
33
44
  end
34
-
@@ -28,8 +28,17 @@ class ChangelogUtils
28
28
  `/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" #{ChangelogUtils.plistFile}`.strip
29
29
  end
30
30
 
31
- def self.printCurrentChange
32
- " * #{ChangelogUtils.getLastMessageFromGit.strip} (#{ChangelogUtils.getPullRequestHash.strip})"
31
+ def self.printCurrentChange (options)
32
+ if (options.char)
33
+ if (options.char != ChangelogUtils.getLastMessageFromGit.strip[0])
34
+ return
35
+ end
36
+ end
37
+ if (!options.nobullet)
38
+ " * #{ChangelogUtils.getLastMessageFromGit.strip} (#{ChangelogUtils.getPullRequestHash.strip})"
39
+ else
40
+ "#{ChangelogUtils.getLastMessageFromGit.strip} (#{ChangelogUtils.getPullRequestHash.strip})"
41
+ end
33
42
  end
34
43
 
35
44
  def self.goBack
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pr-changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
5
- prerelease:
4
+ version: 0.1.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - David Cortés
@@ -14,7 +13,6 @@ dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: commander
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,17 +27,15 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: xcoder
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  description: With this gem you can generate a changelog using Pull Requests logs on
@@ -56,27 +51,26 @@ files:
56
51
  homepage: https://github.com/davebcn87/pr-changelog
57
52
  licenses:
58
53
  - MIT
54
+ metadata: {}
59
55
  post_install_message:
60
56
  rdoc_options: []
61
57
  require_paths:
62
58
  - lib
63
59
  required_ruby_version: !ruby/object:Gem::Requirement
64
- none: false
65
60
  requirements:
66
- - - ! '>='
61
+ - - '>='
67
62
  - !ruby/object:Gem::Version
68
63
  version: '0'
69
64
  required_rubygems_version: !ruby/object:Gem::Requirement
70
- none: false
71
65
  requirements:
72
- - - ! '>='
66
+ - - '>='
73
67
  - !ruby/object:Gem::Version
74
68
  version: '0'
75
69
  requirements: []
76
70
  rubyforge_project:
77
- rubygems_version: 1.8.25
71
+ rubygems_version: 2.0.3
78
72
  signing_key:
79
- specification_version: 3
73
+ specification_version: 4
80
74
  summary: Create a changelog for an iOS app using git history of Pull Requests already
81
75
  merged and xcode version
82
76
  test_files: []