jekyll-pagebreak 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 54e8fa8c6f537f50e4f9cdc9e28d23f988dcfbcf58fefb6ff9d6c651f46ece7e
4
+ data.tar.gz: 1eeeeaa2b2e72ec8a9c43d07b006613d3d051f244b25032f28e9301d9e52013f
5
+ SHA512:
6
+ metadata.gz: 075de8f2f9dd3ed92d607a85b18c5eecd1e33682e90176ef9c660cfcfefa2eab12c9c2246bbd2453ff572bdf5fea4fe843c0d07e997676098f832005840de329
7
+ data.tar.gz: e6bb84da3e34ef4ed2fa79875998d93a5bd9c8464b38e92012cd2f1cf9d5dfdeea6dc22af4a976a244ae135dabd47ba43a01aa17d7efafc021e3af397e642fcf
data/ext/extconf.rb ADDED
@@ -0,0 +1,55 @@
1
+ $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
2
+ require "jekyll-pagebreak/version"
3
+
4
+ # Make ruby think it's building a native extension
5
+ dummy_make_content = "make:\n" \
6
+ "\t:\n" \
7
+ "install:\n" \
8
+ "\t:\n" \
9
+ "clean:\n" \
10
+ "\t:\n"
11
+ File.write('Makefile', dummy_make_content)
12
+
13
+ # Bail out if the binary already exists
14
+ if File.file?("pagebreak/pagebreak")
15
+ puts "Pagebreak binary already exists"
16
+ exit 0
17
+ end
18
+
19
+ puts "Installing Pagebreak"
20
+
21
+ # Construct our release url
22
+ def build_release_url(arch, version)
23
+ "https://github.com/CloudCannon/pagebreak/releases/download/v#{version}/pagebreak-v#{version}-#{arch}.tar.gz"
24
+ end
25
+
26
+ release_url = if RUBY_PLATFORM =~ /x86_64-darwin/
27
+ build_release_url("x86_64-apple-darwin", JekyllPagebreak::VERSION)
28
+ elsif RUBY_PLATFORM =~ /x86_64-linux/
29
+ build_release_url("x86_64-unknown-linux-musl", JekyllPagebreak::VERSION)
30
+ else
31
+ puts "Unsupported platform: #{RUBY_PLATFORM}\nPlease open an issue at https://github.com/CloudCannon/pagebreak/issues"
32
+ exit 1
33
+ end
34
+
35
+ # Download the tar.gz from GitHub
36
+ require 'open-uri'
37
+ if open(release_url)
38
+ puts "Downloading Pagebreak v#{JekyllPagebreak::VERSION} from GitHub"
39
+ open('pagebreak.tar.gz', 'wb') do |file|
40
+ file << open(release_url).read
41
+ end
42
+ else
43
+ puts "Could not find Pagebreak v#{JekyllPagebreak::VERSION}"
44
+ exit 1
45
+ end
46
+
47
+ # Extract the tar.gz using the gem helper
48
+ require 'rubygems/package'
49
+ Dir.mkdir('pagebreak') unless Dir.exist?('pagebreak')
50
+ Gem::Package.new("").extract_tar_gz(File.open("pagebreak.tar.gz", "rb"), "pagebreak")
51
+
52
+ # Clean up after ourselves
53
+ FileUtils.rm('pagebreak.tar.gz')
54
+
55
+ puts "Pagebreak Installed!"
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module JekyllPagebreak
4
+ VERSION = "0.1.1"
5
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "jekyll"
4
+
5
+ Jekyll::Hooks.register :site, :post_write do |site|
6
+ Jekyll.logger.info "Jekyll Pagebreak:", "Running in-place on destination files"
7
+ started = Time.now
8
+
9
+ executable = File.expand_path("../../ext/pagebreak/pagebreak", __FILE__)
10
+ system("#{executable} -s #{site.dest} -o #{site.dest}")
11
+
12
+ rounded_time = ((Time.now - started) * 1000).round
13
+ Jekyll.logger.info "Jekyll Pagebreak:", "Done in #{rounded_time} milliseconds"
14
+ end
15
+
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-pagebreak
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Liam Bigelow
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-09-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.7'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '3.7'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: rake
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 12.3.3
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 12.3.3
47
+ - !ruby/object:Gem::Dependency
48
+ name: rubocop-jekyll
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: 0.5.1
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: 0.5.1
61
+ description:
62
+ email:
63
+ - liam@cloudcannon.com
64
+ executables: []
65
+ extensions:
66
+ - ext/extconf.rb
67
+ extra_rdoc_files: []
68
+ files:
69
+ - ext/extconf.rb
70
+ - lib/jekyll-pagebreak.rb
71
+ - lib/jekyll-pagebreak/version.rb
72
+ homepage: https://github.com/CloudCannon/pagebreak
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubygems_version: 3.0.3
92
+ signing_key:
93
+ specification_version: 4
94
+ summary: A Jekyll plugin to paginate the output of any static site generator
95
+ test_files: []