harp2hugo 0.0.1 → 0.0.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/.gitignore +4 -1
- data/README.md +15 -13
- data/bin/harp2hugo +6 -0
- data/harp2hugo.gemspec +2 -1
- data/lib/harp2hugo/cli.rb +12 -0
- data/lib/harp2hugo/converter.rb +26 -0
- data/lib/harp2hugo/meta_data.rb +10 -10
- data/lib/harp2hugo/version.rb +1 -1
- data/lib/harp2hugo.rb +1 -1
- data/spec/dropwizard-https-jerseyclient-with-runtime-jssecacerts.md +18 -0
- data/spec/harp2hugo_spec.rb +2 -2
- data/spec/meta_data_spec.rb +2 -2
- metadata +24 -7
- data/.idea/workspace.xml +0 -1524
- data/harp2hugo.iml +0 -29
- data/lib/harp2hugo/harp2hugo.rb +0 -24
data/harp2hugo.iml
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<module type="RUBY_MODULE" version="4">
|
3
|
-
<component name="FacetManager">
|
4
|
-
<facet type="gem" name="Ruby Gem">
|
5
|
-
<configuration>
|
6
|
-
<option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
|
7
|
-
<option name="GEM_APP_TEST_PATH" value="$MODULE_DIR$/test" />
|
8
|
-
<option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
|
9
|
-
</configuration>
|
10
|
-
</facet>
|
11
|
-
</component>
|
12
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
13
|
-
<exclude-output />
|
14
|
-
<content url="file://$MODULE_DIR$">
|
15
|
-
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
16
|
-
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
|
17
|
-
</content>
|
18
|
-
<orderEntry type="jdk" jdkName="rbenv: 2.2.2" jdkType="RUBY_SDK" />
|
19
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
20
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.10.5, rbenv: 2.2.2) [gem]" level="application" />
|
21
|
-
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, rbenv: 2.2.2) [gem]" level="application" />
|
22
|
-
<orderEntry type="library" scope="PROVIDED" name="rake (v10.4.2, rbenv: 2.2.2) [gem]" level="application" />
|
23
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.3.0, rbenv: 2.2.2) [gem]" level="application" />
|
24
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.3.1, rbenv: 2.2.2) [gem]" level="application" />
|
25
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.3.0, rbenv: 2.2.2) [gem]" level="application" />
|
26
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.3.1, rbenv: 2.2.2) [gem]" level="application" />
|
27
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.3.0, rbenv: 2.2.2) [gem]" level="application" />
|
28
|
-
</component>
|
29
|
-
</module>
|
data/lib/harp2hugo/harp2hugo.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require "json"
|
2
|
-
|
3
|
-
class Harp2hugo
|
4
|
-
|
5
|
-
def initialize input_file
|
6
|
-
@data_json = JSON.parse(File.read input_file)
|
7
|
-
end
|
8
|
-
|
9
|
-
def convert output_dir
|
10
|
-
|
11
|
-
@data_json.delete("feed")
|
12
|
-
|
13
|
-
Dir.mkdir(output_dir) unless Dir.exist?output_dir
|
14
|
-
@data_json.each {|key, value|
|
15
|
-
post_content = File.read("#{key}.md")
|
16
|
-
File.open("#{output_dir}/#{key}.md", 'w') { |output_file|
|
17
|
-
output_file.write MetaData.new(value).to_yaml
|
18
|
-
output_file.write post_content
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|