dandy 0.7.3 → 0.7.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af583fe991810c4ce8873669ccc55248766dfb5a
4
- data.tar.gz: 99c79307b3ef562083c1348cbdb68ba1f9f705aa
3
+ metadata.gz: 957ee61c0f0fc8a9891b30d458af1c6f0c4e08b9
4
+ data.tar.gz: 7fa0d88828eec48189ee75e54191663853a69e37
5
5
  SHA512:
6
- metadata.gz: e5c36f1369f38976c68f111c112bd961f108808a863db942aaffd24e76f1616a32ebe9076dccb8e686ba250f13420a15658033eed81a0302155427f94755fe53
7
- data.tar.gz: 306a501d1d3a9c7d1b0e28797cce6ad2650e1607c881ac64e237ea74432e3a2c376a6f35b9f55019000ce65e12bc3a21ec37280ccd38ebf89791d416a54a76df
6
+ metadata.gz: d604e83febbd93b0e10ba5dfd100c83d1675ca9a0f1ffa03affb9f0d4074a0c634b622d3a1febb524c73f700626ef57751c2408a8c39bae0012aef6125e50f69
7
+ data.tar.gz: 7b7691cc316bc47363c272f7be1a29de5bdac66f73403789c92d3e0b9eaa2b228287177d07f91a961187ea4ac9bedbd78c2afb8c082bbffba95dde4f09d9abe1
data/lib/dandy/chain.rb CHANGED
@@ -32,17 +32,19 @@ module Dandy
32
32
  def run_commands
33
33
  threads = []
34
34
  Thread.abort_on_exception = true
35
+
36
+ result = nil
35
37
  @commands.each_with_index do |command, index|
36
38
  if command.sequential?
37
39
  # all previous parallel commands should be done before the current sequential
38
40
  threads.each {|t| t.join}
39
41
  threads = []
40
42
 
41
- run_command(command)
43
+ result = run_command(command)
42
44
  else
43
45
  thread = Thread.new {
44
46
  Timeout::timeout(@async_timeout) {
45
- run_command(command)
47
+ result = run_command(command)
46
48
  }
47
49
  }
48
50
  threads << thread if command.parallel?
@@ -53,6 +55,8 @@ module Dandy
53
55
  threads.each {|t| t.join}
54
56
  end
55
57
  end
58
+
59
+ result
56
60
  end
57
61
 
58
62
  def run_command(command)
@@ -63,6 +67,8 @@ module Dandy
63
67
  .register_instance(result, command.result_name.to_sym)
64
68
  .using_lifetime(:scope)
65
69
  .bound_to(:dandy_request)
70
+
71
+ result
66
72
  end
67
73
  end
68
74
  end
@@ -12,6 +12,7 @@ module Dandy
12
12
  desc 'new NAME', 'Create new Dandy application'
13
13
  method_options :jet_set => :boolean
14
14
  def new(name)
15
+ copy_file 'templates/.gitignore', "#{name}/.gitignore"
15
16
 
16
17
  if options[:jet_set]
17
18
  copy_file 'templates/app/app_jet_set.rb', "#{name}/app/app.rb"
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
13
+
14
+ .ruby-gemset
15
+ .ruby-version
@@ -8,6 +8,12 @@ use Rack::Parser, :content_types => {
8
8
 
9
9
  use Rack::Cors do
10
10
  # Setup your CORS policy
11
+ #
12
+ # Example:
13
+ # allow do
14
+ # origins '*'
15
+ # resource '*', :headers => :any, :methods => [:get, :post, :options]
16
+ # end
11
17
  end
12
18
 
13
19
  if ENV['DANDY_ENV'] == 'development' || ENV['DANDY_ENV'] == ''
data/lib/dandy/request.rb CHANGED
@@ -30,12 +30,9 @@ module Dandy
30
30
  register_params(data, :dandy_data)
31
31
 
32
32
  chain = @chain_factory.create(match)
33
- chain.execute
33
+ result = chain.execute
34
34
 
35
- body = ''
36
- if match.route.view
37
- body = @view_factory.create(match.route.view, content_type)
38
- end
35
+ body = match.route.view ? @view_factory.create(match.route.view, content_type) : result
39
36
 
40
37
  status = @container.resolve(:dandy_status)
41
38
  result = [status, { 'Content-Type' => content_type }, [body]]
data/lib/dandy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dandy
2
- VERSION = '0.7.3'.freeze
2
+ VERSION = '0.7.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dandy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Kalinkin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-13 00:00:00.000000000 Z
11
+ date: 2018-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hypo
@@ -209,6 +209,7 @@ files:
209
209
  - lib/dandy/errors/view_engine_error.rb
210
210
  - lib/dandy/extensions/hash.rb
211
211
  - lib/dandy/generators/cli.rb
212
+ - lib/dandy/generators/templates/.gitignore
212
213
  - lib/dandy/generators/templates/Gemfile
213
214
  - lib/dandy/generators/templates/Gemfile_jet_set
214
215
  - lib/dandy/generators/templates/actions/common/handle_errors.rb