nexmo_markdown_renderer 0.4.0 → 0.4.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.
- checksums.yaml +4 -4
- data/lib/nexmo_markdown_renderer/filters/partial_filter.rb +1 -1
- data/lib/nexmo_markdown_renderer/filters/screenshot_filter.rb +1 -1
- data/lib/nexmo_markdown_renderer/filters/tab_filter.rb +3 -3
- data/lib/nexmo_markdown_renderer/filters/utils.rb +1 -1
- data/lib/nexmo_markdown_renderer/models/code_language.rb +1 -1
- data/lib/nexmo_markdown_renderer/services/doc_finder.rb +2 -2
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f8453119db56f41713832d6a32fe559cd0076cef1f829e161465cb31bd81fb1
|
4
|
+
data.tar.gz: 5f82937effa52f7587533c3b039ed609c5095829cbec0c1bb8871306f00501c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cc17d94d7ef7d83f315747521569ad545601e9165532d94cd8bb08306b7ed4be95b11995ce76038ef51785eea8ef7809c8446fa3b5da8486059dc87a458aaac
|
7
|
+
data.tar.gz: d22a8f38997cacf2dbdfb00ca34f3beae65ca75f1736ff5db335207da246d7a2513eb6fa89e181964f99589d3f076ffde06f730f95f3ef7694fc22af0d13a336
|
@@ -5,7 +5,7 @@ module Nexmo
|
|
5
5
|
input.gsub(/```partial(.+?)```/m) do |_s|
|
6
6
|
config = YAML.safe_load($1)
|
7
7
|
file_path = if config['source'].starts_with? 'app/views'
|
8
|
-
config['source']
|
8
|
+
"#{Rails.root}/#{config['source']}"
|
9
9
|
else
|
10
10
|
"#{Nexmo::Markdown::Config.docs_base_path}/#{config['source']}"
|
11
11
|
end
|
@@ -4,7 +4,7 @@ module Nexmo
|
|
4
4
|
def call(input)
|
5
5
|
input.gsub(/```screenshot(.+?)```/m) do |_s|
|
6
6
|
config = YAML.safe_load($1)
|
7
|
-
if config['image'] && File.file?(config['image'])
|
7
|
+
if config['image'] && File.file?("#{Nexmo::Markdown::Config.docs_base_path}/#{config['image']}")
|
8
8
|
"})"
|
9
9
|
else
|
10
10
|
<<~HEREDOC
|
@@ -10,9 +10,9 @@ module Nexmo
|
|
10
10
|
@config = YAML.safe_load($3)
|
11
11
|
|
12
12
|
if tabbed_folder?
|
13
|
-
raise "#{@config['source']} is not a directory" unless File.directory? "#{
|
13
|
+
raise "#{@config['source']} is not a directory" unless File.directory? "#{@config['source']}"
|
14
14
|
|
15
|
-
@tabbed_config = YAML.safe_load(File.read("#{
|
15
|
+
@tabbed_config = YAML.safe_load(File.read("#{@config['source']}/.config.yml"))
|
16
16
|
@path = @config['source']
|
17
17
|
validate_folder_config
|
18
18
|
else
|
@@ -169,7 +169,7 @@ module Nexmo
|
|
169
169
|
end
|
170
170
|
|
171
171
|
def content_from_folder
|
172
|
-
source_path = "#{
|
172
|
+
source_path = "#{@config['source']}"
|
173
173
|
source_path += '/*.md'
|
174
174
|
|
175
175
|
files = Dir.glob(source_path)
|
@@ -19,7 +19,7 @@ module Nexmo
|
|
19
19
|
line_section += "-L#{code['to_line']}" if code['to_line']
|
20
20
|
else
|
21
21
|
# By default we read to the end of the file
|
22
|
-
line_section += "-L#{File.read(code['source']).lines.count}"
|
22
|
+
line_section += "-L#{File.read("#{Nexmo::Markdown::Config.docs_base_path}/#{code['source']}").lines.count}"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -91,9 +91,9 @@ module Nexmo
|
|
91
91
|
|
92
92
|
def self.load_english
|
93
93
|
paths.each do |path|
|
94
|
-
if path.starts_with?(
|
94
|
+
if defined?(Rails) && path.starts_with?("#{Rails.root}/app/views")
|
95
95
|
Dir["#{path}/**/*.*"].each do |file|
|
96
|
-
dictionary[file][::I18n.default_locale.to_s] = ::I18n.default_locale.to_s
|
96
|
+
dictionary[file.gsub("#{Rails.root}/", '')][::I18n.default_locale.to_s] = ::I18n.default_locale.to_s
|
97
97
|
end
|
98
98
|
else
|
99
99
|
path_with_locale = "#{path}/#{::I18n.default_locale}"
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexmo_markdown_renderer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nexmo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: banzai
|