petrify 0.3.1 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4196552f668eeff27be617562e588c9d56ad1939
4
- data.tar.gz: cf67c0b5d6e3d78c101b4f9be65121d74da51393
2
+ SHA256:
3
+ metadata.gz: 19212a61976c5091d49228bd0fe4b6c8bd1ffa5799d368c7f494bb782925e24a
4
+ data.tar.gz: 6299b2d5edf609297a847b2c43b3275a3425db21a8c07ffd995f4f00e1c368d6
5
5
  SHA512:
6
- metadata.gz: a7aebd7d716a7824d0e698271a647ccadda03889bb84707277a277a1f23c05659f8ff1cb9c225781342d2f6c1f38591baaa0006c51b88647c0102a3b3470abf0
7
- data.tar.gz: 282def2a456fbbcc08bcdfd82cef1b9ca2f2bfdca94e5ac8c597082d107b44405dd422d7fc41b39f03b2f1e5c4e2e7a0d5a254df5f1f2e20377d53d0493b37d3
6
+ metadata.gz: 8131eb1c620af354634d08af5a64de6d096fcc72ad2af290be68addf7f356e9f16c44004a755741145e31a33244965e1b451af5db9f389d3540d230aae6f1f64
7
+ data.tar.gz: 3528476df843a4de660db70eab9fb283ec8326b0be59a0918418c4160c8fe029edcf4a59ea86beb69dafd04ddbc4f2151963af2aa2f0af56bcd27cc2b1dce10f
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Adrian Short
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/lib/petrify.rb CHANGED
@@ -13,6 +13,7 @@ module Petrify
13
13
  @@log = Logger.new($stdout)
14
14
  @@log.level = Logger::INFO
15
15
 
16
+ # Write an HTML page using a specified template and optional data
16
17
  def self.page(path_items, template, locals = {})
17
18
  dir = create_path(path_items)
18
19
  fn = File.join(dir, 'index.html')
@@ -28,6 +29,7 @@ module Petrify
28
29
  # https://support.google.com/webmasters/answer/183668?hl=en&ref_topic=4581190
29
30
  end
30
31
 
32
+ # Write a CSV file
31
33
  def self.csv(path_items, filename, data)
32
34
  dir = create_path(path_items)
33
35
  fn = File.join(dir, filename + '.csv')
@@ -40,6 +42,14 @@ module Petrify
40
42
  File.write(fn, csv_string)
41
43
  @@log.info fn
42
44
  end
45
+
46
+ # Write an arbitrary file to output (eg a JSON file)
47
+ def self.file(path_items, filename, data)
48
+ dir = create_path(path_items)
49
+ fn = File.join(dir, filename)
50
+ File.write(fn, data)
51
+ @@log.info fn
52
+ end
43
53
 
44
54
  def self.setup
45
55
  # Recursively delete working directory to ensure no redundant files are left behind from previous builds.
@@ -1,3 +1,3 @@
1
1
  module Petrify
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: petrify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Short
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-22 00:00:00.000000000 Z
11
+ date: 2019-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -61,6 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
63
  - Gemfile
64
+ - LICENSE
64
65
  - README.md
65
66
  - Rakefile
66
67
  - bin/console
@@ -87,8 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  - !ruby/object:Gem::Version
88
89
  version: '0'
89
90
  requirements: []
90
- rubyforge_project:
91
- rubygems_version: 2.6.12
91
+ rubygems_version: 3.0.2
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: A data(base)-driven static site generator with Haml templates.