snowpack 1.0.0.alpha2 → 1.0.0.alpha3

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: 117edd0edd3fc41b750a9123cc92c8d7629f6d07273b92782716fbb273dc1994
4
- data.tar.gz: 19d7853057dd9ab75dc9e2de63b2cb7c4f17dceb7135abcb677c9ec598326460
3
+ metadata.gz: b73852c042508833bb0d5cf04a80d648d552b2255f4e9585a7d290e91247b862
4
+ data.tar.gz: 2153b9dfc250ff043de4c7e52eec8b9a17adc68dcae16186a27c462de81176ce
5
5
  SHA512:
6
- metadata.gz: 35241faca184cdb00a5ccf8061f3b4df83760c1afbcf282cea88ab9deb6923d81c49aa43f7306a283f215a6b498044bafd9dbb413338d0b5e0e81bc67513e6b8
7
- data.tar.gz: 3b1b3308b56b87579230df9c7f59a18598953ca296cadfba884a7fd36009ec3be29a23572df88151af9d52c946db65ec77446e44c816fdd56916747677558cab
6
+ metadata.gz: d81b54d0dbe7ac74a588208de5c64c8ac36744d59783fcb620556a9f1aa9d3098ee06e1bdced00d221b417230a6ade208daa68c71d1a3f6d3cf2ebad1b34dece
7
+ data.tar.gz: 3c0864c755e84e3b4d112f382ed60a6ea20f5ed88f41e70fbcd386996794fed52adebf39153c46d6efb9ce6a097e1c710564634a3511df500a592dff8eb8100d
@@ -1,6 +1,25 @@
1
1
  # Changelog
2
2
 
3
- ## [1.0.0.alpha2] - 2019-07-01 [YANKED]
3
+ ## [1.0.0.alpha3] - 2019-07-11
4
+
5
+ ### Added
6
+
7
+ - Add `snowpack version` subcommand for standalone executable
8
+
9
+ ### Changed
10
+
11
+ - Add Application.slice_paths method, this can be overridden in subclasses to allow selective ignoring of some slices (this is not a perfect final solution, but helps in the interim)
12
+ - Slice.finalize! exits gracefully if Slice already finalized
13
+ - Slice.finalize! passes all its arguments to super
14
+ - Add Slice's default system_dir (if it exists) when inheriting from Snowpack::Slice
15
+ - Use internal error class in Web::EndpointResolver, allowing snowpack apps to work without hanami-controller installed
16
+
17
+ ### Fixed
18
+
19
+ - Fix bug with recersive filtering in RackLogger
20
+ - Remove require of bundler/setup preventing `snowpack` executable from working in some circumstances
21
+
22
+ ## [1.0.0.alpha2] - 2019-07-01
4
23
 
5
24
  ### Changed
6
25
 
data/README.md CHANGED
@@ -18,7 +18,7 @@ Snowpack is lightwight application framework for Icelab’s Ruby applications. I
18
18
  Install the gem:
19
19
 
20
20
  ```
21
- gem install snowpack -v "1.0.0.alpha1"
21
+ gem install snowpack -v "1.0.0.alpha2"
22
22
  ```
23
23
 
24
24
  Generate a new application:
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require "bundler/setup"
4
+ require "bundler/setup" if File.exist?("Gemfile")
5
5
  require "snowpack/cli/standalone/cli"
6
6
 
7
7
  Snowpack::CLI::Standalone::CLI.new.call
@@ -39,7 +39,7 @@ module Snowpack
39
39
  end
40
40
 
41
41
  def self.load_slices
42
- @slices ||= Dir[File.join(config.root, config.slices_dir, "*")]
42
+ @slices ||= slice_paths
43
43
  .map(&method(:load_slice))
44
44
  .compact
45
45
  .to_h
@@ -73,6 +73,10 @@ module Snowpack
73
73
 
74
74
  private
75
75
 
76
+ def self.slice_paths
77
+ Dir[File.join(config.root, config.slices_dir, "*")]
78
+ end
79
+
76
80
  def self.load_slice(base_path)
77
81
  base_path = Pathname(base_path)
78
82
  full_defn_path = Dir["#{base_path}/system/**/slice.rb"].first
@@ -7,6 +7,7 @@ module Snowpack
7
7
  extend Hanami::CLI::Registry
8
8
 
9
9
  require_relative "commands/new"
10
+ require_relative "commands/version"
10
11
  end
11
12
  end
12
13
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "snowpack/version"
4
+ require "snowpack/cli/command"
5
+
6
+ module Snowpack
7
+ module CLI
8
+ module Standalone
9
+ module Commands
10
+ class Version < Command
11
+ def call(*)
12
+ out.puts "Snowpack #{Snowpack::VERSION}"
13
+ end
14
+ end
15
+
16
+ register "version", Version, aliases: ["-v", "--version"]
17
+ end
18
+ end
19
+ end
20
+ end
@@ -26,6 +26,10 @@ module Snowpack
26
26
  if File.directory?(slice_path)
27
27
  klass.config.root = slice_path if File.directory?(slice_path)
28
28
  klass.load_paths! "lib"
29
+
30
+ if File.directory?(File.join(klass.config.root, klass.config.system_dir))
31
+ klass.load_paths! klass.config.system_dir
32
+ end
29
33
  end
30
34
 
31
35
  klass.import application: app
@@ -47,7 +51,9 @@ module Snowpack
47
51
  finalize!
48
52
  end
49
53
 
50
- def self.finalize!
54
+ def self.finalize!(*)
55
+ return self if finalized?
56
+
51
57
  # Force `after :configure` hooks to run
52
58
  configure do; end
53
59
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snowpack
4
- VERSION = "1.0.0.alpha2"
4
+ VERSION = "1.0.0.alpha3"
5
5
  end
@@ -1,12 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # FIXME: This is for the NotCallableEndpointError. It would be good if this
4
- # could be require-able without having to bring in all the routing files
5
- require "hanami/routing"
6
-
7
3
  module Snowpack
8
4
  module Web
9
5
  class EndpointResolver
6
+ class NotCallableEndpointError < StandardError
7
+ def initialize(endpoint)
8
+ super("#{endpoint.inspect} isn't compatible with Rack. Please make sure it implements #call.")
9
+ end
10
+ end
11
+
10
12
  attr_reader :application
11
13
  attr_reader :container
12
14
  attr_reader :base_namespace
@@ -42,7 +44,7 @@ module Snowpack
42
44
  end
43
45
 
44
46
  unless endpoint.respond_to?(:call)
45
- raise Hanami::Routing::NotCallableEndpointError.new(endpoint)
47
+ raise NotCallableEndpointError.new(endpoint)
46
48
  end
47
49
 
48
50
  endpoint
@@ -60,9 +60,9 @@ module Snowpack
60
60
  if filter_params.include?(k)
61
61
  h.update(k => FILTERED)
62
62
  elsif v.is_a?(Hash)
63
- h.update(k => filter_params(v))
63
+ h.update(k => filter(v))
64
64
  elsif v.is_a?(Array)
65
- h.update(k => v.map { |m| m.is_a?(Hash) ? filter_params(m) : m })
65
+ h.update(k => v.map { |m| m.is_a?(Hash) ? filter(m) : m })
66
66
  else
67
67
  h[k] = v
68
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snowpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha2
4
+ version: 1.0.0.alpha3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Riley
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-07-01 00:00:00.000000000 Z
12
+ date: 2019-07-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dry-inflector
@@ -219,6 +219,7 @@ files:
219
219
  - lib/snowpack/cli/standalone/cli.rb
220
220
  - lib/snowpack/cli/standalone/commands.rb
221
221
  - lib/snowpack/cli/standalone/commands/new.rb
222
+ - lib/snowpack/cli/standalone/commands/version.rb
222
223
  - lib/snowpack/components.rb
223
224
  - lib/snowpack/components/formalist.rb
224
225
  - lib/snowpack/components/persistence.rb