rackula 0.1.0 → 0.2.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
  SHA1:
3
- metadata.gz: 1d0bc83a56d30e353cac5b7d6251db7c88262002
4
- data.tar.gz: 6cf455534074dd54a56e94589542b5d995db723e
3
+ metadata.gz: 14b8327cf9e0de3dbdd6a4ab1a7a3b7bbd5e54f6
4
+ data.tar.gz: cf597e0f91ecef47d8e646c5abeb1f59a07597e4
5
5
  SHA512:
6
- metadata.gz: 9030cfbbdf15bffa0a9c7f1f08d1d9190badc07b8795a9db475a929fb166d178d568962a175ddd226370727b2be384081dc9a1529dd054f446b4020bc3c1902b
7
- data.tar.gz: 7ba5cb6bbc37258a3645a7a030741c1baf2c4f9185ecc43a5908beabc5212ca2b5509ce1f5738cb7d267b4b24129d873375bb48bb12e5c42d4d39e2d1d3766f7
6
+ metadata.gz: 051a3016a2fdca53ef98cfe89edd4aca4e7ced3739810e0bcb1115ba7881e45c55be6434410c95b251391ad31edb28fce6a848aa43033b1f18d6e419af5111c8
7
+ data.tar.gz: a125fd7382bfb98df771dd3f617b9e1d1bd6eb230be8728bf174b240f6f844635064f071cccccef302bd66c97f6cccd053b3c9b3c097ca08c324b3e3b3ddcaf4
data/.rspec CHANGED
@@ -1,2 +1,4 @@
1
1
  --format documentation
2
- --color
2
+ --backtrace
3
+ --require spec_helper
4
+ --warnings
@@ -1,5 +1,14 @@
1
- sudo: false
2
1
  language: ruby
2
+ sudo: false
3
+ cache: bundler
3
4
  rvm:
4
- - 2.4.0
5
- before_install: gem install bundler -v 1.15.3
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
@@ -1,6 +1,9 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
3
  # Specify your gem's dependencies in rackula.gemspec
6
4
  gemspec
5
+
6
+ group :test do
7
+ gem 'simplecov'
8
+ gem 'coveralls', require: false
9
+ end
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
+ [![Build Status](https://secure.travis-ci.org/socketry/rackula.svg)](http://travis-ci.org/socketry/rackula)
6
+ [![Coverage Status](https://coveralls.io/repos/socketry/rackula/badge.svg)](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 = File.join(root, @options[:output_path])
48
+ output_path = root + @options[:output_path]
47
49
 
48
- if File.exist? output_path
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
- Dir.glob(File.join(root, @options[:public], '*')).each do |path|
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
- app, options = Rack::Builder.parse_file(File.join(root, @options[:config]))
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
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Rackula
22
- VERSION = "0.1.0"
22
+ VERSION = "0.2.0"
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rackula
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams