rackula 0.6.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +6 -0
- data/.travis.yml +11 -9
- data/bin/rackula +1 -6
- data/lib/rackula/command.rb +9 -10
- data/lib/rackula/command/generate.rb +9 -9
- data/lib/rackula/version.rb +1 -1
- data/rackula.gemspec +4 -3
- metadata +26 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b249cc4bf0e7bb535b6ece14d8dce90b558a98c5f7921e735cb851341a36551f
|
4
|
+
data.tar.gz: 2ff7b7e2ea8e11abc58a6f73aab66548e82cbcb993fcd79c3ef4218024343cfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfab9891149e0474e8b0649282a9931a96bdf3bfaa9bc72948e2e82f5b4889ede982944ae39384637b3c1da12d347ba9b772c86f01b431ef34c32642dd6b4276
|
7
|
+
data.tar.gz: 38ee786386165c2e06ced60ab591b5aa1141530f6603adc14e5db7a9f2a20ef0b797ebc1a9ab157543660176cde326e9b0382f55b315cbd95a394d9b4b3fb75e
|
data/.editorconfig
ADDED
data/.travis.yml
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
language: ruby
|
2
|
-
sudo: false
|
3
2
|
cache: bundler
|
4
|
-
|
5
|
-
- 2.3
|
6
|
-
- 2.4
|
7
|
-
- 2.5
|
8
|
-
- 2.6
|
9
|
-
- jruby-head
|
10
|
-
- ruby-head
|
11
|
-
env: COVERAGE=true
|
3
|
+
|
12
4
|
matrix:
|
5
|
+
include:
|
6
|
+
- rvm: 2.3
|
7
|
+
- rvm: 2.4
|
8
|
+
- rvm: 2.5
|
9
|
+
- rvm: 2.6
|
10
|
+
env: COVERAGE=BriefSummary,Coveralls
|
11
|
+
- rvm: ruby-head
|
12
|
+
- rvm: jruby-head
|
13
|
+
- rvm: truffleruby
|
13
14
|
allow_failures:
|
14
15
|
- rvm: ruby-head
|
15
16
|
- rvm: jruby-head
|
17
|
+
- rvm: truffleruby
|
data/bin/rackula
CHANGED
data/lib/rackula/command.rb
CHANGED
@@ -24,8 +24,8 @@ require_relative 'command/generate'
|
|
24
24
|
|
25
25
|
module Rackula
|
26
26
|
module Command
|
27
|
-
def self.
|
28
|
-
Top.
|
27
|
+
def self.call(*args)
|
28
|
+
Top.call(*args)
|
29
29
|
end
|
30
30
|
|
31
31
|
# The top level utopia command.
|
@@ -38,23 +38,22 @@ module Rackula
|
|
38
38
|
option '-v/--version', "Print out the application version."
|
39
39
|
end
|
40
40
|
|
41
|
-
nested
|
41
|
+
nested :command, {
|
42
42
|
'generate' => Generate
|
43
|
+
}, default: 'generate'
|
43
44
|
|
44
45
|
# The root directory for the site.
|
45
46
|
def root
|
46
47
|
File.expand_path(@options.fetch(:root, ''), Dir.getwd)
|
47
48
|
end
|
48
49
|
|
49
|
-
def
|
50
|
+
def call
|
50
51
|
if @options[:version]
|
51
|
-
puts "
|
52
|
-
elsif @options[:help]
|
53
|
-
print_usage(
|
52
|
+
puts "#{self.name} v#{VERSION}"
|
53
|
+
elsif @options[:help]
|
54
|
+
print_usage(output: $stdout)
|
54
55
|
else
|
55
|
-
|
56
|
-
@command.invoke(self)
|
57
|
-
end
|
56
|
+
@command.call
|
58
57
|
end
|
59
58
|
end
|
60
59
|
end
|
@@ -36,13 +36,13 @@ module Rackula
|
|
36
36
|
self.description = "Start a local server and generate a static version of a site."
|
37
37
|
|
38
38
|
options do
|
39
|
-
option '-c/--config <path>', "Rackup configuration file to load", default: 'config.ru'
|
40
|
-
option '-p/--public <path>', "The public path to copy initial files from", default: 'public'
|
41
|
-
option '-o/--output-path <path>', "The output path to save static site", default: 'static'
|
39
|
+
option '-c/--config <path>', "Rackup configuration file to load.", default: 'config.ru'
|
40
|
+
option '-p/--public <path>', "The public path to copy initial files from.", default: 'public'
|
41
|
+
option '-o/--output-path <path>', "The output path to save static site.", default: 'static'
|
42
42
|
|
43
43
|
option '-f/--force', "If the output path exists, delete it.", default: false
|
44
44
|
|
45
|
-
option '--
|
45
|
+
option '--count', "The number of server instances to spawn.", default: 4
|
46
46
|
end
|
47
47
|
|
48
48
|
def copy_and_fetch(port, root)
|
@@ -68,11 +68,11 @@ module Rackula
|
|
68
68
|
end
|
69
69
|
|
70
70
|
# Generate HTML pages:
|
71
|
-
system
|
71
|
+
system("wget", "--mirror", "--recursive", "--continue", "--convert-links", "--adjust-extension", "--no-host-directories", "--directory-prefix", output_path.to_s, "http://localhost:#{port}")
|
72
72
|
end
|
73
73
|
|
74
74
|
def serve(endpoint, root)
|
75
|
-
|
75
|
+
container = Async::Container::Threaded.new
|
76
76
|
|
77
77
|
config_path = root + @options[:config]
|
78
78
|
rack_app, options = Rack::Builder.parse_file(config_path.to_s)
|
@@ -80,7 +80,7 @@ module Rackula
|
|
80
80
|
app = ::Falcon::Server.middleware(rack_app, verbose: @options[:verbose])
|
81
81
|
server = ::Falcon::Server.new(app, endpoint)
|
82
82
|
|
83
|
-
container
|
83
|
+
container.run(count: @options[:count]) do
|
84
84
|
server.run
|
85
85
|
end
|
86
86
|
end
|
@@ -94,10 +94,10 @@ module Rackula
|
|
94
94
|
# puts "Copy and fetch site to static..."
|
95
95
|
copy_and_fetch(address.ip_port, root)
|
96
96
|
ensure
|
97
|
-
container
|
97
|
+
container&.stop
|
98
98
|
end
|
99
99
|
|
100
|
-
def
|
100
|
+
def call
|
101
101
|
# We set the default RACK_ENV to static unless it was already set to something.
|
102
102
|
ENV['RACK_ENV'] ||= 'static'
|
103
103
|
|
data/lib/rackula/version.rb
CHANGED
data/rackula.gemspec
CHANGED
@@ -18,10 +18,11 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f)}
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "samovar", "~> 1
|
22
|
-
spec.add_dependency "falcon", "~> 0.
|
21
|
+
spec.add_dependency "samovar", "~> 2.1"
|
22
|
+
spec.add_dependency "falcon", "~> 0.27"
|
23
23
|
|
24
|
-
spec.add_development_dependency "
|
24
|
+
spec.add_development_dependency "covered"
|
25
|
+
spec.add_development_dependency "bundler"
|
25
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
27
|
spec.add_development_dependency "rspec", "~> 3.0"
|
27
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rackula
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: samovar
|
@@ -16,42 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1
|
19
|
+
version: '2.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1
|
26
|
+
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: falcon
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: '0.27'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: '0.27'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: covered
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - "
|
59
|
+
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
61
|
+
version: '0'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - "
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,6 +102,7 @@ executables:
|
|
88
102
|
extensions: []
|
89
103
|
extra_rdoc_files: []
|
90
104
|
files:
|
105
|
+
- ".editorconfig"
|
91
106
|
- ".gitignore"
|
92
107
|
- ".rspec"
|
93
108
|
- ".travis.yml"
|
@@ -119,8 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
134
|
- !ruby/object:Gem::Version
|
120
135
|
version: '0'
|
121
136
|
requirements: []
|
122
|
-
|
123
|
-
rubygems_version: 2.7.7
|
137
|
+
rubygems_version: 3.0.3
|
124
138
|
signing_key:
|
125
139
|
specification_version: 4
|
126
140
|
summary: Generate a static site from any rackup compatible application.
|