marky_markdown 0.2.0 → 0.2.2
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 +4 -4
- data/.github/release-drafter.yml +3 -0
- data/.github/workflows/gempush.yml +41 -0
- data/.github/workflows/release-management.yml +16 -0
- data/Gemfile.lock +2 -2
- data/README.md +2 -0
- data/lib/marky_markdown.rb +12 -3
- data/lib/marky_markdown/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1aee39fad8edace1049da79fff831f4dd85fbb1016c1590a2632cfc41741930
|
4
|
+
data.tar.gz: ab6c2ca42c666450fe530dd1c697787411f2a1bf65ace33998df13305e93908f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d636935f5f14ea653fa0daa8e21a521b709177be7f1476468de522aa1bc70aa3be64ffc960e75d38b3dfefa75a039f821bde51f03f5841018ae4f911c476e0e
|
7
|
+
data.tar.gz: f666f943397ac65aabf76a25d54c169494a23bb08cd9180943fb604bd09bb72bf67811d8af87fdae5df2e2ff5f0a6d6b92af54241baf44d9df332db1dfcf321c
|
@@ -0,0 +1,41 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
build:
|
10
|
+
name: Build + Publish
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@master
|
15
|
+
- name: Set up Ruby 2.6
|
16
|
+
uses: actions/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
version: 2.6.x
|
19
|
+
|
20
|
+
- name: Publish to GPR
|
21
|
+
run: |
|
22
|
+
mkdir -p $HOME/.gem
|
23
|
+
touch $HOME/.gem/credentials
|
24
|
+
chmod 0600 $HOME/.gem/credentials
|
25
|
+
printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
26
|
+
gem build *.gemspec
|
27
|
+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
28
|
+
env:
|
29
|
+
GEM_HOST_API_KEY: ${{secrets.GPR_AUTH_TOKEN}}
|
30
|
+
OWNER: bdougie
|
31
|
+
|
32
|
+
- name: Publish to RubyGems
|
33
|
+
run: |
|
34
|
+
mkdir -p $HOME/.gem
|
35
|
+
touch $HOME/.gem/credentials
|
36
|
+
chmod 0600 $HOME/.gem/credentials
|
37
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
38
|
+
gem build *.gemspec
|
39
|
+
gem push *.gem
|
40
|
+
env:
|
41
|
+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
name: Release Management
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
# branches to consider in the event; optional, defaults to all
|
6
|
+
branches:
|
7
|
+
- master
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
update_draft_release:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
# Drafts your next Release notes as Pull Requests are merged into "master"
|
14
|
+
- uses: toolmantim/release-drafter@v5.2.0
|
15
|
+
env:
|
16
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -45,3 +45,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
45
45
|
## Code of Conduct
|
46
46
|
|
47
47
|
Everyone interacting in the MarkyMarkdown project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/marky_markdown/blob/master/CODE_OF_CONDUCT.md).
|
48
|
+
|
49
|
+
_This project is unrelated to the npm [marky-markdown](https://www.npmjs.com/package/marky-markdown) package_
|
data/lib/marky_markdown.rb
CHANGED
@@ -4,7 +4,7 @@ module MarkyMarkdown
|
|
4
4
|
class Transformer
|
5
5
|
def self.transform(str)
|
6
6
|
variable_hash = self.identify_variables(str)
|
7
|
-
self.
|
7
|
+
self.compile({variables: variable_hash, body: str})
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.identify_variables(str)
|
@@ -17,12 +17,16 @@ module MarkyMarkdown
|
|
17
17
|
Hash[key_value_array.map { |key, value| [key, value] }]
|
18
18
|
end
|
19
19
|
|
20
|
-
def self.
|
20
|
+
def self.compile(input)
|
21
21
|
input[:variables].each do |k, v|
|
22
22
|
next if v.nil?
|
23
23
|
|
24
24
|
key = "{{ #{k} }}"
|
25
|
-
|
25
|
+
occurences = Helpers.count_occurences_for(key, input[:body])
|
26
|
+
|
27
|
+
occurences.times do
|
28
|
+
input[:body] [key] = v if input[:body].include? key
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
input[:body]
|
@@ -43,5 +47,10 @@ module MarkyMarkdown
|
|
43
47
|
puts e.message
|
44
48
|
puts e.backtrace.inspect
|
45
49
|
end
|
50
|
+
|
51
|
+
def self.count_occurences_for(key, body)
|
52
|
+
length = key.length
|
53
|
+
body.count(key) / length
|
54
|
+
end
|
46
55
|
end
|
47
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marky_markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian 'bdougie' Douglas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -59,6 +59,9 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- ".github/release-drafter.yml"
|
63
|
+
- ".github/workflows/gempush.yml"
|
64
|
+
- ".github/workflows/release-management.yml"
|
62
65
|
- ".github/workflows/ruby.yml"
|
63
66
|
- ".gitignore"
|
64
67
|
- ".travis.yml"
|
@@ -93,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
96
|
version: '0'
|
94
97
|
requirements: []
|
95
98
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.7.
|
99
|
+
rubygems_version: 2.7.10
|
97
100
|
signing_key:
|
98
101
|
specification_version: 4
|
99
102
|
summary: Tranform your markdown with variable interpolation
|