staticz 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51553de1d014c695974c26a1fb9cd7650172cee243b894e23cf326537ee46ad3
4
- data.tar.gz: 98ab884e175ecc7732d330a7a3a10569f7522769d49f046bd3272599123fe772
3
+ metadata.gz: 50795783266276c8da87ba58941a7cffd3a4250be33e2124650cdddadf0efcc5
4
+ data.tar.gz: bbcecd4113494baca37b584ac1b91ac6f9cc7b9f52696d66a70625febbd5dc2d
5
5
  SHA512:
6
- metadata.gz: c0ad038f66d42971d1019a9e6fa7927d13eb684b9cb29f5258977d56975517a47a776b8f3ff0b1c5628ac1738fb39dd095b8e250b18559c9d768957e3a6a31d6
7
- data.tar.gz: 000fb933e0b1e91a32cb84606f59481a085843c13772d20e0792f9418da4a5e5af912147b18afabd72146e3a41a7ef2761c9ee2ea9edc8829499300a38dad039
6
+ metadata.gz: 5ee864bcd24ad2c33d62215f5a82668bb9f32d8455c3d36f73d311c8f190fb3f2ecd2c6cce8db75ab9a0cd0e9d5a17ef2d26ab1782ed6faf0a09d59d2487fab7
7
+ data.tar.gz: 32640a35148dfb826cd98017198146b97c74e5062703ac278b751e5a673a7768ba5f52bb4291ee579353cdaed8b5eabdd31f9b2e98e808870aeb3ef522b04785
data/lib/helpers.rb CHANGED
@@ -25,6 +25,10 @@ def javascript(path)
25
25
  "<script src=\"#{path}\"></script>"
26
26
  end
27
27
 
28
+ def inline_svg(source_path)
29
+ File.read("src/#{source_path}")
30
+ end
31
+
28
32
  def react(*component_file_paths)
29
33
  lines = [
30
34
  "<script crossorigin src=\"https://unpkg.com/react@18/umd/react.development.js\"></script>",
@@ -7,6 +7,7 @@ require_relative 'scss'
7
7
  require_relative 'js'
8
8
  require_relative 'cs'
9
9
  require_relative 'react'
10
+ require_relative 'simple_file'
10
11
 
11
12
  module Staticz
12
13
  class Manifest
@@ -49,6 +50,10 @@ module Staticz
49
50
  elements.push(Staticz::React.new(name))
50
51
  end
51
52
 
53
+ def file(name)
54
+ elements.push(Staticz::SimpleFile.new(name))
55
+ end
56
+
52
57
  def build
53
58
  load "#{Dir.pwd}/manifest.rb"
54
59
 
@@ -0,0 +1,34 @@
1
+ module Staticz
2
+ class SimpleFile
3
+ include Compilable
4
+
5
+ attr_reader :name
6
+
7
+ def source_path
8
+ "src/#{name}"
9
+ end
10
+
11
+ def build_path
12
+ "build/#{name}"
13
+ end
14
+
15
+ def create_link_function
16
+ end
17
+
18
+ def path_method_name
19
+ "no path created"
20
+ end
21
+
22
+ def tile_type_name = "File"
23
+
24
+ def initialize(name)
25
+ @name = name
26
+ end
27
+
28
+ def build
29
+ if exists?
30
+ File.write build_path, File.read(source_path)
31
+ end
32
+ end
33
+ end
34
+ end
data/lib/manifest/sub.rb CHANGED
@@ -37,6 +37,10 @@ module Staticz
37
37
  elements.push(Staticz::React.new("#{@name}/#{name}"))
38
38
  end
39
39
 
40
+ def file(name, &block)
41
+ elements.push(Staticz::SimpleFile.new("#{@name}/#{name}"))
42
+ end
43
+
40
44
  def build
41
45
  Dir.mkdir("build/#{name}") if !Dir.exist?("build/#{name}")
42
46
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staticz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipp Schlesinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-17 00:00:00.000000000 Z
11
+ date: 2022-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml
@@ -129,6 +129,7 @@ files:
129
129
  - lib/manifest/react.rb
130
130
  - lib/manifest/sass.rb
131
131
  - lib/manifest/scss.rb
132
+ - lib/manifest/simple_file.rb
132
133
  - lib/manifest/sub.rb
133
134
  - lib/server.rb
134
135
  - lib/staticz.rb