rackula 0.1.0 → 0.2.0
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 +4 -4
- data/.rspec +3 -1
- data/.travis.yml +12 -3
- data/Gemfile +5 -2
- data/README.md +3 -0
- data/lib/rackula/command/generate.rb +10 -6
- data/lib/rackula/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14b8327cf9e0de3dbdd6a4ab1a7a3b7bbd5e54f6
|
4
|
+
data.tar.gz: cf597e0f91ecef47d8e646c5abeb1f59a07597e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 051a3016a2fdca53ef98cfe89edd4aca4e7ced3739810e0bcb1115ba7881e45c55be6434410c95b251391ad31edb28fce6a848aa43033b1f18d6e419af5111c8
|
7
|
+
data.tar.gz: a125fd7382bfb98df771dd3f617b9e1d1bd6eb230be8728bf174b240f6f844635064f071cccccef302bd66c97f6cccd053b3c9b3c097ca08c324b3e3b3ddcaf4
|
data/.rspec
CHANGED
data/.travis.yml
CHANGED
@@ -1,5 +1,14 @@
|
|
1
|
-
sudo: false
|
2
1
|
language: ruby
|
2
|
+
sudo: false
|
3
|
+
cache: bundler
|
3
4
|
rvm:
|
4
|
-
- 2.
|
5
|
-
|
5
|
+
- 2.2
|
6
|
+
- 2.3
|
7
|
+
- 2.4
|
8
|
+
- jruby-head
|
9
|
+
- ruby-head
|
10
|
+
env: COVERAGE=true
|
11
|
+
matrix:
|
12
|
+
allow_failures:
|
13
|
+
- rvm: ruby-head
|
14
|
+
- rvm: jruby-head
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
Rackula will immortalize your rackup web app by generating a static copy. It can be used to generate a static site from any rack-compatible middleware (e.g. rails, sinatra, utopia).
|
4
4
|
|
5
|
+
[](http://travis-ci.org/socketry/rackula)
|
6
|
+
[](https://coveralls.io/r/socketry/rackula)
|
7
|
+
|
5
8
|
## Installation
|
6
9
|
|
7
10
|
Install the gem:
|
@@ -20,6 +20,8 @@
|
|
20
20
|
|
21
21
|
require 'samovar'
|
22
22
|
|
23
|
+
require 'pathname'
|
24
|
+
|
23
25
|
require 'falcon/server'
|
24
26
|
require 'async/io'
|
25
27
|
require 'async/container'
|
@@ -43,12 +45,12 @@ module Rackula
|
|
43
45
|
end
|
44
46
|
|
45
47
|
def copy_and_fetch(port, root)
|
46
|
-
output_path =
|
48
|
+
output_path = root + @options[:output_path]
|
47
49
|
|
48
|
-
if
|
50
|
+
if output_path.exist?
|
49
51
|
if @options[:force]
|
50
52
|
# Delete any existing stuff:
|
51
|
-
FileUtils.rm_rf(output_path)
|
53
|
+
FileUtils.rm_rf(output_path.to_s)
|
52
54
|
else
|
53
55
|
# puts "Failing due to error..."
|
54
56
|
raise Samovar::Failure.new("Output path already exists!")
|
@@ -56,7 +58,8 @@ module Rackula
|
|
56
58
|
end
|
57
59
|
|
58
60
|
# Copy all public assets:
|
59
|
-
|
61
|
+
asset_pattern = root + @options[:public] + '*'
|
62
|
+
Dir.glob(asset_pattern.to_s).each do |path|
|
60
63
|
FileUtils.cp_r(path, output_path)
|
61
64
|
end
|
62
65
|
|
@@ -67,7 +70,8 @@ module Rackula
|
|
67
70
|
def serve(endpoint, root)
|
68
71
|
container_class = Async::Container::Threaded
|
69
72
|
|
70
|
-
|
73
|
+
config_path = root + @options[:config]
|
74
|
+
app, options = Rack::Builder.parse_file(config_path.to_s)
|
71
75
|
|
72
76
|
container = container_class.new(concurrency: @options[:concurrency]) do
|
73
77
|
server = Falcon::Server.new(app, [
|
@@ -96,7 +100,7 @@ module Rackula
|
|
96
100
|
|
97
101
|
# We bind to a socket to generate a temporary port:
|
98
102
|
endpoint.bind do |socket|
|
99
|
-
run(socket.local_address, parent.root)
|
103
|
+
run(socket.local_address, Pathname.new(parent.root))
|
100
104
|
end
|
101
105
|
end
|
102
106
|
end
|
data/lib/rackula/version.rb
CHANGED