hoe-markdown 1.2.0 → 1.3.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: bf9a6074da2a981e30084b7dd2f80f2d0e7d809351511e5f84459c9efdce7278
4
- data.tar.gz: 35aa2d0edbcb62fd2d080eed18fbe108512027cbe16c7bfa2eb3da2ba1cb32a8
3
+ metadata.gz: abfcef683457297af7eaad6d438adcf6c2035d7a44a42f04218551344705b6a7
4
+ data.tar.gz: ce73aa0a2e6354778d23169ae711498bcf37816b8dea3c3406590243f39c59f7
5
5
  SHA512:
6
- metadata.gz: cede2c0ad7e980d5f9d5ebb4b2daf577c191aab523dae0a6af1c28be3aa0b7549357530e0eb78d81f463d17fd51f999c5380f4ccacd57835c91f7817a6003fd6
7
- data.tar.gz: eb4d6e81582ad7dca15338f1c90a4323a9a8405a923f960207f99a6a1ee43ee9fee823deaa7fd1261b318b6ff106ecff72beeab8752e5a8d5a0d1c9394de5cb0
6
+ metadata.gz: 9f45e91e75a7687ab261fa7ec651fb27bff58e5a3df6d1235cc256b6b1b31d79071c6178294244f753eb0d1c82abfd3be956164efc59cb577f04d55f48266b6c
7
+ data.tar.gz: 50fdb38dba957a40d68e3b1b2eb6b78ca3d8bc338cb258c10ec7fcd096cab15a94b54093f6974b00f82d4a928be65bc3c2adb4f7ecc72fe982ba072e4e08bd01
@@ -1,5 +1,12 @@
1
1
  # Hoe::Markdown CHANGELOG
2
2
 
3
+ ## v1.3.0 / 2020-08-28
4
+
5
+ Feature:
6
+
7
+ - Hoe::Markdown::Standalone allows use of these rake tasks outside of Hoe
8
+
9
+
3
10
  ## v1.2.0 / 2020-06-16
4
11
 
5
12
  Fix:
data/Gemfile CHANGED
@@ -3,5 +3,4 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in hoe-markdown.gemspec
4
4
  gemspec
5
5
 
6
- gem "rake", "~> 12.0"
7
6
  gem "rspec", "~> 3.0"
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Hoe::Markdown is a [Hoe](https://www.zenspider.com/projects/hoe.html) plugin to help manage your project's markdown files. It's intended for gem maintainers, but the underlying library of markdown manipulation methods might be generally useful.
4
4
 
5
+ Hoe::Markdown::Standalone can be used without Hoe.
6
+
5
7
 
6
8
  ## Installation
7
9
 
@@ -20,7 +22,7 @@ Or install it yourself as:
20
22
  $ gem install hoe-markdown
21
23
 
22
24
 
23
- ## Usage
25
+ ## Usage with Hoe
24
26
 
25
27
  In your Rakefile:
26
28
 
@@ -30,7 +32,6 @@ Hoe::plugin :markdown
30
32
 
31
33
  Rake tasks are exposed under the `markdown` namespace.
32
34
 
33
-
34
35
  ### Choosing your markdown files correctly
35
36
 
36
37
  Hoe makes some outdated assumptions about the location of your README and your changelog files, which you (as a maintainer) need to opt out of. Specifically, you probably have something like this in your Rakefile
@@ -88,6 +89,18 @@ Thanks, [@hobbes](https://github.com/hobbes)!
88
89
  Feature: Finagle the sprocket. See [#456](https://github.com/cogswellcogs/sprocketkiller/issues/456)
89
90
  ```
90
91
 
92
+ ## Usage without Hoe
93
+
94
+ In your Rakefile:
95
+
96
+ ``` ruby
97
+ require "hoe/markdown"
98
+ Hoe::Markdown::Standalone.new("gemname").define_markdown_tasks
99
+ ```
100
+
101
+ This will attempt to read your gemspec from `#{gemname}.gemspec`, and then the same rake tasks described above are created and behave the same way.
102
+
103
+
91
104
  ## Contributing
92
105
 
93
106
  Bug reports and pull requests are welcome on GitHub at https://github.com/flavorjones/hoe-markdown. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/flavorjones/hoe-markdown/blob/master/CODE_OF_CONDUCT.md).
@@ -22,4 +22,6 @@ Gem::Specification.new do |spec|
22
22
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
23
  end
24
24
  spec.require_paths = ["lib"]
25
+
26
+ spec.add_runtime_dependency("rake", ">0")
25
27
  end
@@ -1,5 +1,9 @@
1
+ require "rake"
2
+
1
3
  class Hoe
2
4
  module Markdown
5
+ include ::Rake::DSL
6
+
3
7
  #
4
8
  # Optional: used to specify which markdown files to linkify. [default: any markdown files found in `files`].
5
9
  #
@@ -35,8 +39,7 @@ class Hoe
35
39
 
36
40
  desc "hyperlink github issues and usernames in #{mdfile_name}"
37
41
  task task_name do
38
- puts "linkifying #{mdfile_path} ..."
39
- markdown = File.read(mdfile_path)
42
+ original_markdown = markdown = File.read(mdfile_path)
40
43
 
41
44
  markdown = Hoe::Markdown::Util.linkify_github_usernames(markdown)
42
45
  if spec.metadata["bug_tracker_uri"]
@@ -45,7 +48,12 @@ class Hoe
45
48
  warn "Spec metadata URI for 'bugs' is missing, skipping linkification of issues and pull requests"
46
49
  end
47
50
 
48
- File.open(mdfile_path, "w") { |f| f.write markdown }
51
+ if markdown == original_markdown
52
+ puts "markdown:linkify: no changes to #{mdfile_path}"
53
+ else
54
+ puts "markdown:linkify: updating #{mdfile_path}"
55
+ File.open(mdfile_path, "w") { |f| f.write markdown }
56
+ end
49
57
  end
50
58
  linkify_tasks << "#{namespace_name}:#{task_name}"
51
59
  end
@@ -59,3 +67,4 @@ end
59
67
 
60
68
  require "hoe/markdown/version"
61
69
  require "hoe/markdown/util"
70
+ require "hoe/markdown/standalone"
@@ -0,0 +1,13 @@
1
+ class Hoe
2
+ module Markdown
3
+ class Standalone
4
+ include Hoe::Markdown
5
+
6
+ attr_reader :spec
7
+
8
+ def initialize gem_name
9
+ @spec = eval(File.read("./#{gem_name}.gemspec"))
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  class Hoe
2
2
  module Markdown
3
- VERSION = "1.2.0"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoe-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-16 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2020-08-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">"
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">"
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: Hoe plugin with markdown helpers, for example to hyperlink github issues
14
28
  and github usernames in markdown files.
15
29
  email:
@@ -29,6 +43,7 @@ files:
29
43
  - Rakefile
30
44
  - hoe-markdown.gemspec
31
45
  - lib/hoe/markdown.rb
46
+ - lib/hoe/markdown/standalone.rb
32
47
  - lib/hoe/markdown/util.rb
33
48
  - lib/hoe/markdown/version.rb
34
49
  homepage: https://github.com/flavorjones/hoe-markdown