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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b234337043ec82c82b2dc1059e3ddcf807d23a88ef01333c18790225c137ed8a
4
- data.tar.gz: cb9e5775986c4048abb880728326449d2e567bc2719a347c09a9e72acfd6f86b
3
+ metadata.gz: b249cc4bf0e7bb535b6ece14d8dce90b558a98c5f7921e735cb851341a36551f
4
+ data.tar.gz: 2ff7b7e2ea8e11abc58a6f73aab66548e82cbcb993fcd79c3ef4218024343cfa
5
5
  SHA512:
6
- metadata.gz: 396e2ac1a6553b7d3d72b2b63ec019031311f2681ebab09987ce3cb3279e69d05208efbb80005b4ae1b8de6b8c81bf86a791d828d48e15e610663baa8271f26b
7
- data.tar.gz: b5b6d775d30ef82a9efecb60ab7df5ac0c4a0bfb93610c4c9a8f5241a13458a93348df1dd444afe4da488b51289156950425f50130854fccace662929e9b1308
6
+ metadata.gz: dfab9891149e0474e8b0649282a9931a96bdf3bfaa9bc72948e2e82f5b4889ede982944ae39384637b3c1da12d347ba9b772c86f01b431ef34c32642dd6b4276
7
+ data.tar.gz: 38ee786386165c2e06ced60ab591b5aa1141530f6603adc14e5db7a9f2a20ef0b797ebc1a9ab157543660176cde326e9b0382f55b315cbd95a394d9b4b3fb75e
@@ -0,0 +1,6 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = tab
5
+ indent_size = 2
6
+
@@ -1,15 +1,17 @@
1
1
  language: ruby
2
- sudo: false
3
2
  cache: bundler
4
- rvm:
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
@@ -22,9 +22,4 @@
22
22
 
23
23
  require 'rackula/command'
24
24
 
25
- begin
26
- Rackula::Command.parse(ARGV).invoke
27
- rescue Samovar::Failure
28
- puts "Failed: #{$!.message}"
29
- exit 1
30
- end
25
+ Rackula::Command.call
@@ -24,8 +24,8 @@ require_relative 'command/generate'
24
24
 
25
25
  module Rackula
26
26
  module Command
27
- def self.parse(*args)
28
- Top.parse(*args)
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 '<command>',
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 invoke(program_name: File.basename($0))
50
+ def call
50
51
  if @options[:version]
51
- puts "utopia v#{VERSION}"
52
- elsif @options[:help] or @command.nil?
53
- print_usage(program_name)
52
+ puts "#{self.name} v#{VERSION}"
53
+ elsif @options[:help]
54
+ print_usage(output: $stdout)
54
55
  else
55
- track_time do
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 '--concurrency', "The concurrency of the server container", default: 4
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!("wget", "--mirror", "--recursive", "--continue", "--convert-links", "--adjust-extension", "--no-host-directories", "--directory-prefix", output_path.to_s, "http://localhost:#{port}")
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
- container_class = Async::Container::Threaded
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 = container_class.new(concurrency: @options[:concurrency]) do
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.stop if container
97
+ container&.stop
98
98
  end
99
99
 
100
- def invoke(parent)
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
 
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Rackula
22
- VERSION = "0.6.0"
22
+ VERSION = "1.0.0"
23
23
  end
@@ -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.8"
22
- spec.add_dependency "falcon", "~> 0.19.0"
21
+ spec.add_dependency "samovar", "~> 2.1"
22
+ spec.add_dependency "falcon", "~> 0.27"
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.15"
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.6.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: 2018-11-01 00:00:00.000000000 Z
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.8'
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.8'
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.19.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.19.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: '1.15'
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: '1.15'
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
- rubyforge_project:
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.