phlexite 0.1.1 → 0.1.3

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
2
  SHA256:
3
- metadata.gz: 05aad9b8ad120754abcab830dc68c4b92a758dca8c91db1c0c49718444cb9085
4
- data.tar.gz: 22d1aeee0435b2ece141ebeb05b07398a8e301d2ca2d5d722598d0a42128de1d
3
+ metadata.gz: 520b8bfb1862cdf7fd0b22dfbc9e441ac011c76eedb42a40c85f2eb1682e329a
4
+ data.tar.gz: 70c50a2bd83965ce006e262268d6e5110c871b8ac42372a3dd8b889a3968de38
5
5
  SHA512:
6
- metadata.gz: 2a122670bf11ad798e4ea5bbeb48002c4e26d35805810489dd599bc9a3c8687bf52775b60b0124cb480d2543af23bf4ab999359bc9cdc5d7524a21f57149a11f
7
- data.tar.gz: 7baa8f22fba1d1b4257ac6597000bc9d0bedccd11839bddf988f8153382686eedc7ff411cd80b88fedb91ca2e2a4b913a02f6b21c8236042f869863dd8431ee5
6
+ metadata.gz: 722d435572366e79cfd515ef854c6d5ad0663214a9b7d121cc80a794864e4cd8ca81b3dc9db870b6b9768991d7fb02be026d49b1ed656a5ae9a1744a5fcb4b56
7
+ data.tar.gz: 9d16f8e277670c5261ce7902af40d9770605affbbe77bcf9ce20cc19f6fb5e7f7c2038cef1fe839b84bff505af55d03faf8fe2d59fe5f299fa76a8a39606884f
data/Steepfile CHANGED
@@ -6,6 +6,7 @@ target :lib do
6
6
  check "lib" # Directory name
7
7
  # ignore "lib/templates/*.rb"
8
8
 
9
+ library "fileutils"
9
10
  # library "pathname" # Standard libraries
10
11
  # library "strong_json" # Gems
11
12
  # library "phlex"
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  class Phlexite::Router
2
4
  def initialize(base, site)
3
5
  @base = base
@@ -11,10 +13,16 @@ class Phlexite::Router
11
13
 
12
14
  def page(out_path, component)
13
15
  out = full_out_path(out_path)
14
- system("mkdir -p #{File::dirname(out)}")
16
+ FileUtils::mkdir_p File::dirname(out)
15
17
  File::write(out, component.call)
16
18
  end
17
19
 
20
+ def mount(local_directory, on:)
21
+ out = full_out_path(on)
22
+ FileUtils::mkdir_p out
23
+ FileUtils::cp_r File::join(local_directory, "."), out
24
+ end
25
+
18
26
  private
19
27
 
20
28
  def full_out_path(out_path)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Phlexite
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
data/sig/phlexite.rbs CHANGED
@@ -8,6 +8,7 @@ module Phlexite
8
8
  def initialize: (String, Site) -> void
9
9
  def page: (String, untyped) -> void
10
10
  def group: (String) { (Router) -> void } -> void
11
+ def mount: (String, on: String) -> void
11
12
 
12
13
  private
13
14
  def full_out_path: (String) -> String
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlexite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleks Rūtiņš