yard_ghurt 1.0.1 → 1.1.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
  SHA256:
3
- metadata.gz: '09e5e44f79301b48fc0c128b2c28f92ed6214dde2e6ea95c4a251c658eba1c41'
4
- data.tar.gz: 9ae774c08a531397baac550dd52facda1d82cbc3614ec74b5737dfd3940f4acf
3
+ metadata.gz: eabd1d16b12b7055c9ab9a5c0bdc460281cc3cfe63b7b4e207e086ed30de30a6
4
+ data.tar.gz: 200b03f7a0a22016a8634dcb3b4d3e0854d97eb9714933ec6a339bb9651b281a
5
5
  SHA512:
6
- metadata.gz: 2bd582fde644bc58bf50734da87a79f3579b8c78563badd8b4dded47b234c93d54561f871563640f2a912f412d929a43dfc001bb8a721f711c23c19bba89b050
7
- data.tar.gz: f803e9360a6205b5c8af74eb548e64e5c7e00ab5cd7b8a356733db0107c7d6c854f357a79bbc376ed67f7c571a6fa3068129f93b34222924e24ef3538390a712
6
+ metadata.gz: acd5ef0039f8a3fce2f5c3ecf89a25259d38d2988585ac33a6aa1ad5540bae27ec1eb2833325c793f36df403f0db936576fce26e964750aea97fb2e8d8e67b0b
7
+ data.tar.gz: b47d674b37f759696fa23bea3b5d145c7d2561679a104bf3335df1af06a2943174f4bcc9e998bb917c04e633b94c6d67d361d8b974e9b7200289e9cb26da675c
@@ -2,7 +2,19 @@
2
2
 
3
3
  Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [[Unreleased]](https://github.com/esotericpig/yard_ghurt/compare/v1.0.1...master)
5
+ ## [[Unreleased]](https://github.com/esotericpig/yard_ghurt/compare/v1.1.0...master)
6
+
7
+ ## [v1.1.0] - 2019-07-31
8
+ ### Added
9
+ - Added environment var *dryrun* to GFMFixTask:
10
+ - rake yard_gfm_fix dryrun=true
11
+
12
+ ### Changed
13
+ - Renamed GFMFixerTask to GFMFixTask
14
+ - lib/yard_ghurt/gfm_fixer_task.rb => lib/yard_ghurt/gfm_fix_task.rb
15
+ - Renamed GHPSyncerTask to GHPSyncTask
16
+ - lib/yard_ghurt/ghp_syncer_task.rb => lib/yard_ghurt/ghp_sync_task.rb
17
+ - Updated development dependency gems
6
18
 
7
19
  ## [v1.0.1] - 2019-07-28
8
20
  ### Changed
data/README.md CHANGED
@@ -16,8 +16,8 @@
16
16
 
17
17
  - [Setup](#setup)
18
18
  - [Using](#using)
19
- - [GFMFixerTask](#gfmfixertask)
20
- - [GHPSyncerTask](#ghpsyncertask)
19
+ - [GFMFixTask](#gfmfixtask)
20
+ - [GHPSyncTask](#ghpsynctask)
21
21
  - [Util / YardGhurt](#util--yardghurt)
22
22
  - [AnchorLinks](#anchorlinks)
23
23
  - [Hacking](#hacking)
@@ -63,8 +63,8 @@ $ bundle exec rake install:local
63
63
 
64
64
  | Task | Description |
65
65
  | --- | --- |
66
- | [GFMFixerTask](#gfmfixertask) | Fix GitHub Flavored Markdown files |
67
- | [GHPSyncerTask](#ghpsyncertask) | Sync YARDoc to a local GitHub Pages repo. |
66
+ | [GFMFixTask](#gfmfixtask) | Fix GitHub Flavored Markdown files |
67
+ | [GHPSyncTask](#ghpsynctask) | Sync YARDoc to a local GitHub Pages repo. |
68
68
 
69
69
  **Helpers:**
70
70
 
@@ -73,14 +73,18 @@ $ bundle exec rake install:local
73
73
  | [Util / YardGhurt](#util--yardghurt) | Utility methods for tasks |
74
74
  | [AnchorLinks](#anchorlinks) | A “database” of anchor links |
75
75
 
76
- ### [GFMFixerTask](#using)
76
+ ### [GFMFixTask](#using)
77
77
 
78
78
  Fix (find & replace) text in the GitHub Flavored Markdown (GFM) files in the YARDoc directory, for differences between the two formats.
79
79
 
80
+ You can set *dry_run* on the command line:
81
+
82
+ `$ rake yard_gfm_fix dryrun=true`
83
+
80
84
  **What I typically use:**
81
85
 
82
86
  ```Ruby
83
- YardGhurt::GFMFixerTask.new() do |task|
87
+ YardGhurt::GFMFixTask.new() do |task|
84
88
  task.arg_names = [:dev]
85
89
  task.dry_run = false
86
90
  task.fix_code_langs = true
@@ -102,7 +106,7 @@ end
102
106
  **Using all options:**
103
107
 
104
108
  ```Ruby
105
- YardGhurt::GFMFixerTask.new(:yard_fix) do |task|
109
+ YardGhurt::GFMFixTask.new(:yard_fix) do |task|
106
110
  task.anchor_db = {'tests' => 'Testing'} # #tests => #Testing
107
111
  task.arg_names << :name # Custom args
108
112
  task.css_styles << '<link rel="stylesheet" href="css/my_css.css" />' # Inserted at </head>
@@ -128,14 +132,14 @@ YardGhurt::GFMFixerTask.new(:yard_fix) do |task|
128
132
  end
129
133
  ```
130
134
 
131
- ### [GHPSyncerTask](#using)
135
+ ### [GHPSyncTask](#using)
132
136
 
133
137
  Sync YARDoc to a local GitHub Pages repo (uses `rsync` by default).
134
138
 
135
139
  **What I typically use:**
136
140
 
137
141
  ```Ruby
138
- YardGhurt::GHPSyncerTask.new() do |task|
142
+ YardGhurt::GHPSyncTask.new() do |task|
139
143
  task.ghp_dir = '../esotericpig.github.io/docs/yard_ghurt/yardoc'
140
144
  task.sync_args << '--delete-after'
141
145
  end
@@ -145,7 +149,7 @@ end
145
149
 
146
150
  ```Ruby
147
151
  # Execute: rake ghp_doc[false,'Ruby']
148
- YardGhurt::GHPSyncerTask.new(:ghp_doc) do |task|
152
+ YardGhurt::GHPSyncTask.new(:ghp_doc) do |task|
149
153
  task.arg_names << :name # Custom args
150
154
  task.deps << :yard # Custom dependencies
151
155
  task.description = 'Rsync my_doc/ to my page'
data/Rakefile CHANGED
@@ -47,7 +47,7 @@ desc 'Generate pristine YARDoc'
47
47
  task :yard_fresh => [:clobber,:yard,:yard_gfm_fix] do |task|
48
48
  end
49
49
 
50
- YardGhurt::GFMFixerTask.new() do |task|
50
+ YardGhurt::GFMFixTask.new() do |task|
51
51
  task.arg_names = [:dev]
52
52
  task.dry_run = false
53
53
  task.fix_code_langs = true
@@ -62,7 +62,7 @@ YardGhurt::GFMFixerTask.new() do |task|
62
62
  end
63
63
 
64
64
  # Probably not useful for others.
65
- YardGhurt::GHPSyncerTask.new() do |task|
65
+ YardGhurt::GHPSyncTask.new() do |task|
66
66
  task.ghp_dir = '../esotericpig.github.io/docs/yard_ghurt/yardoc'
67
67
  task.sync_args << '--delete-after'
68
68
  end
@@ -22,8 +22,8 @@
22
22
 
23
23
 
24
24
  require 'yard_ghurt/anchor_links'
25
- require 'yard_ghurt/gfm_fixer_task'
26
- require 'yard_ghurt/ghp_syncer_task'
25
+ require 'yard_ghurt/gfm_fix_task'
26
+ require 'yard_ghurt/ghp_sync_task'
27
27
  require 'yard_ghurt/util'
28
28
  require 'yard_ghurt/version'
29
29
 
@@ -74,7 +74,7 @@ module YardGhurt
74
74
  # @author Jonathan Bradley Whited (@esotericpig)
75
75
  # @since 1.0.0
76
76
  #
77
- # @see GFMFixerTask
77
+ # @see GFMFixTask
78
78
  ###
79
79
  class AnchorLinks
80
80
  # @return [Hash] the GFM-style anchor IDs pointing to their YARDoc ID equivalents that have been added
@@ -27,14 +27,18 @@ require 'set'
27
27
  require 'rake/tasklib'
28
28
 
29
29
  require 'yard_ghurt/anchor_links'
30
+ require 'yard_ghurt/util'
30
31
 
31
32
  module YardGhurt
32
33
  ###
33
34
  # Fix (find & replace) text in the GitHub Flavored Markdown (GFM) files in the YARDoc directory,
34
35
  # for differences between the two formats.
35
36
  #
37
+ # You can set {dry_run} on the command line:
38
+ # rake yard_gfm_fix dryrun=true
39
+ #
36
40
  # @example What I Use
37
- # YardGhurt::GFMFixerTask.new() do |task|
41
+ # YardGhurt::GFMFixTask.new() do |task|
38
42
  # task.arg_names = [:dev]
39
43
  # task.dry_run = false
40
44
  # task.fix_code_langs = true
@@ -53,7 +57,7 @@ module YardGhurt
53
57
  # end
54
58
  #
55
59
  # @example Using All Options
56
- # YardGhurt::GFMFixerTask.new(:yard_fix) do |task|
60
+ # YardGhurt::GFMFixTask.new(:yard_fix) do |task|
57
61
  # task.anchor_db = {'tests' => 'Testing'} # #tests => #Testing
58
62
  # task.arg_names << :name # Custom args
59
63
  # task.css_styles << '<link rel="stylesheet" href="css/my_css.css" />' # Inserted at </head>
@@ -79,9 +83,9 @@ module YardGhurt
79
83
  # end
80
84
  #
81
85
  # @author Jonathan Bradley Whited (@esotericpig)
82
- # @since 1.0.0
86
+ # @since 1.1.0
83
87
  ###
84
- class GFMFixerTask < Rake::TaskLib
88
+ class GFMFixTask < Rake::TaskLib
85
89
  # This is important so that a subsequent call to this task will not write the CSS again.
86
90
  #
87
91
  # @return [String] the comment tag of where to place {css_styles}
@@ -305,6 +309,12 @@ module YardGhurt
305
309
  def define()
306
310
  desc @description
307
311
  task @name,Array(@arg_names) => Array(@deps) do |task,args|
312
+ env_dryrun = ENV['dryrun']
313
+
314
+ if !env_dryrun.nil?() && !(env_dryrun = env_dryrun.to_s().strip()).empty?()
315
+ @dry_run = Util.to_bool(env_dryrun)
316
+ end
317
+
308
318
  @before.call(self,args) if @before.respond_to?(:call)
309
319
 
310
320
  @md_files.each do |md_file|
@@ -32,14 +32,14 @@ module YardGhurt
32
32
  # Sync YARDoc to a local GitHub Pages repo (uses +rsync+ by default).
33
33
  #
34
34
  # @example What I Use
35
- # YardGhurt::GHPSyncerTask.new() do |task|
35
+ # YardGhurt::GHPSyncTask.new() do |task|
36
36
  # task.ghp_dir = '../esotericpig.github.io/docs/yard_ghurt/yardoc'
37
37
  # task.sync_args << '--delete-after'
38
38
  # end
39
39
  #
40
40
  # @example Using All Options
41
41
  # # Execute: rake ghp_doc[false,'Ruby']
42
- # YardGhurt::GHPSyncerTask.new(:ghp_doc) do |task|
42
+ # YardGhurt::GHPSyncTask.new(:ghp_doc) do |task|
43
43
  # task.arg_names << :name # Custom args
44
44
  # task.deps << :yard # Custom dependencies
45
45
  # task.description = 'Rsync my_doc/ to my page'
@@ -54,9 +54,9 @@ module YardGhurt
54
54
  # end
55
55
  #
56
56
  # @author Jonathan Bradley Whited (@esotericpig)
57
- # @since 1.0.0
57
+ # @since 1.1.0
58
58
  ###
59
- class GHPSyncerTask < Rake::TaskLib
59
+ class GHPSyncTask < Rake::TaskLib
60
60
  # @return [Proc,nil] the Proc ( +respond_to?(:call)+ ) to call at the end of this task or +nil+;
61
61
  # default: +nil+
62
62
  attr_accessor :after
@@ -25,7 +25,7 @@ module YardGhurt
25
25
  ###
26
26
  # Utility methods in a separate module/mixin,
27
27
  # so that a programmer can require/load a sole task:
28
- # require 'yard_ghurt/gfm_fixer_task'
28
+ # require 'yard_ghurt/gfm_fix_task'
29
29
  #
30
30
  # Else, programmers would be required to always require/load the entire +yard_ghurt+ module:
31
31
  # require 'yard_ghurt'
@@ -70,7 +70,7 @@ module YardGhurt
70
70
  # @return [true,false] the boolean value of +str+
71
71
  #
72
72
  # @see TRUE_BOOLS
73
- # @see GHPSyncerTask#arg_names
73
+ # @see GHPSyncTask#arg_names
74
74
  def to_bool(str)
75
75
  return TRUE_BOOLS.include?(str.to_s().downcase())
76
76
  end
@@ -22,5 +22,5 @@
22
22
 
23
23
 
24
24
  module YardGhurt
25
- VERSION = '1.0.1'
25
+ VERSION = '1.1.0'
26
26
  end
@@ -56,6 +56,6 @@ Gem::Specification.new() do |spec|
56
56
 
57
57
  spec.add_development_dependency 'bundler' ,'~> 1.17'
58
58
  spec.add_development_dependency 'rdoc' ,'~> 6.1' # For RDoc for YARD (*.rb)
59
- spec.add_development_dependency 'redcarpet','~> 3.4' # For Markdown for YARD (*.md)
59
+ spec.add_development_dependency 'redcarpet','~> 3.5' # For Markdown for YARD (*.md)
60
60
  spec.add_development_dependency 'yard' ,'~> 0.9'
61
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard_ghurt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Bradley Whited (@esotericpig)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-28 00:00:00.000000000 Z
11
+ date: 2019-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.4'
61
+ version: '3.5'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.4'
68
+ version: '3.5'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: yard
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -94,8 +94,8 @@ files:
94
94
  - Rakefile
95
95
  - lib/yard_ghurt.rb
96
96
  - lib/yard_ghurt/anchor_links.rb
97
- - lib/yard_ghurt/gfm_fixer_task.rb
98
- - lib/yard_ghurt/ghp_syncer_task.rb
97
+ - lib/yard_ghurt/gfm_fix_task.rb
98
+ - lib/yard_ghurt/ghp_sync_task.rb
99
99
  - lib/yard_ghurt/util.rb
100
100
  - lib/yard_ghurt/version.rb
101
101
  - yard/templates/default/layout/html/footer.erb