summaryrefslogtreecommitdiff
path: root/new/userfriendly/bin
diff options
context:
space:
mode:
Diffstat (limited to 'new/userfriendly/bin')
-rwxr-xr-xnew/userfriendly/bin/build.rb22
-rwxr-xr-xnew/userfriendly/bin/deploy.rb10
-rwxr-xr-xnew/userfriendly/bin/server.rb10
3 files changed, 42 insertions, 0 deletions
diff --git a/new/userfriendly/bin/build.rb b/new/userfriendly/bin/build.rb
new file mode 100755
index 00000000..a72a5294
--- /dev/null
+++ b/new/userfriendly/bin/build.rb
@@ -0,0 +1,22 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+require_relative '../lib/userfriendly'
+require_relative '../../bin/builder'
+
+output_dir = "#{File.dirname(File.dirname(__FILE__))}/output"
+image_dir = "#{File.dirname(File.dirname(File.expand_path(__FILE__)))}/assets/images"
+pages_db_path = "#{File.dirname(File.dirname(__FILE__))}/db/pages.yaml"
+pages_db_manager = Crys::PagesDbManager.new(db_path: pages_db_path)
+
+file_path = @options[:filepath]
+batch = file_path == :all
+
+builder = Crys::Builder.new(file_path: file_path, output_dir: output_dir, image_dir: image_dir, pages_db_manager: pages_db_manager)
+batch_builder = Crys::BatchBuilder.new(pages_db_manager: pages_db_manager, output_dir: output_dir, image_dir: image_dir, builder_class: Crys::Builder)
+
+Crys::BuilderRunner.new(
+ builder: builder,
+ batch_builder: batch_builder,
+ batch: batch
+).run
diff --git a/new/userfriendly/bin/deploy.rb b/new/userfriendly/bin/deploy.rb
new file mode 100755
index 00000000..46058108
--- /dev/null
+++ b/new/userfriendly/bin/deploy.rb
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+require_relative '../lib/userfriendly'
+require_relative '../../bin/deployer'
+
+source = "#{File.dirname(File.dirname(File.expand_path(__FILE__)))}/output/"
+dest = 'site-crys-userfriendly'
+
+Crys::DeployerRunner.new(source: source, dest: dest).run
diff --git a/new/userfriendly/bin/server.rb b/new/userfriendly/bin/server.rb
new file mode 100755
index 00000000..9ed534ae
--- /dev/null
+++ b/new/userfriendly/bin/server.rb
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+require_relative '../lib/userfriendly'
+require_relative '../../bin/server'
+
+server_class = Crys::Server
+
+root = "#{File.dirname(File.dirname(__FILE__))}/output"
+Crys::ServerRunner.new(root: root, server_class: server_class, section: 'Userfirendly mirror').serve