foresite 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/foresite/cli.rb +28 -0
- data/lib/foresite/renderer.rb +1 -1
- data/lib/foresite/version.rb +1 -1
- data/lib/foresite.rb +2 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31f026a8d80bce2b57fbe4b909cb3c6490ca50debf834de0636c7b713749fe83
|
4
|
+
data.tar.gz: 0b450e5e2639cb57ece5ae26810c8b467a6d91bc269ffcb1f96bb4e2f18fd716
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ab2348a5bb8eb90c0707a4ace0921e586a15d7d2838d72f4841fe39165a3912c129593ca4b5075dde9b62ad94a114cf4170865fb89781d2c3ec8f40d24b4c16
|
7
|
+
data.tar.gz: 543c72aad677e681b17b12eae7c43a927fbe1417b98c1cf0838fc9f9b343e55ae3730308ce679cf522cf698bedc8c3cddbb56a67f713355af1768b55d54566f0
|
data/README.md
CHANGED
@@ -107,6 +107,10 @@ In this example, the `index.html` will contain:
|
|
107
107
|
</ul>
|
108
108
|
```
|
109
109
|
|
110
|
+
### 5. Watch files and build automatically
|
111
|
+
|
112
|
+
Run `foresite watch` to detect changes to markdown or ERB files, build will run automatically. Useful for previewing content locally.
|
113
|
+
|
110
114
|
## Development
|
111
115
|
|
112
116
|
1. Clone
|
data/lib/foresite/cli.rb
CHANGED
@@ -12,6 +12,11 @@ module Foresite
|
|
12
12
|
true
|
13
13
|
end
|
14
14
|
|
15
|
+
desc "version", "Displays version"
|
16
|
+
def version
|
17
|
+
$stdout.puts(Foresite::VERSION)
|
18
|
+
end
|
19
|
+
|
15
20
|
desc "init", "Initializes foresite in current directory"
|
16
21
|
long_desc <<-LONGDESC
|
17
22
|
Initializes foresite in the current directory.
|
@@ -117,5 +122,28 @@ module Foresite
|
|
117
122
|
|
118
123
|
$stdout.puts("Created #{Foresite.relative_path(index_html_path)}")
|
119
124
|
end
|
125
|
+
|
126
|
+
desc "watch", "Watches markdown and templates files and runs `build` when they change"
|
127
|
+
long_desc <<-LONGDESC
|
128
|
+
See `build` help for more information
|
129
|
+
LONGDESC
|
130
|
+
|
131
|
+
# @todo How might we test this?
|
132
|
+
def watch
|
133
|
+
dirs_to_watch = [
|
134
|
+
Foresite::DIRNAME_MARKDOWN,
|
135
|
+
Foresite::DIRNAME_ERB
|
136
|
+
]
|
137
|
+
|
138
|
+
$stdout.puts("Watching #{dirs_to_watch.map { "./#{_1}" }.join(", ")} for changes... (Ctrl+C to exit)")
|
139
|
+
|
140
|
+
Filewatcher.new(dirs_to_watch).watch do |changes|
|
141
|
+
changes.each do |filename, event|
|
142
|
+
$stdout.puts("#{File.basename(filename)} #{event}")
|
143
|
+
end
|
144
|
+
|
145
|
+
build
|
146
|
+
end
|
147
|
+
end
|
120
148
|
end
|
121
149
|
end
|
data/lib/foresite/renderer.rb
CHANGED
data/lib/foresite/version.rb
CHANGED
data/lib/foresite.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foresite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Wiedemann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: filewatcher
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.1'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rspec
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|