rack-action 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 621787e5506a3dc0d6b990e929f25a53c28867b4
4
+ data.tar.gz: 60972718dea29f5539f3bad1699763be3cab23ba
5
+ SHA512:
6
+ metadata.gz: 339db39c041d319a81399684d4320693c90fed36e0a9d5eb58800c2a43ce0000e4cd9651ccbc30218cba8112d38162b62f2d50e7b53851b2bd7062998243d4bb
7
+ data.tar.gz: 17f8286a43e612c1665675479853bf46cb83cbd71af355a55fad23cd28a848a893589cb71b41e7e05b1f78748bbf83b1c6074b0693dff8f1a89fc303001d167c
@@ -5,7 +5,7 @@ require 'rack/filters'
5
5
 
6
6
  module Rack
7
7
  class Action
8
- VERSION = '0.3.0'
8
+ VERSION = '0.4.0'
9
9
 
10
10
  extend Filters
11
11
 
@@ -23,6 +23,8 @@ module Rack
23
23
  LOCATION = 'Location'.freeze
24
24
  # @private
25
25
  DEFAULT_RESPONSE = "Default Rack::Action Response"
26
+ # @private
27
+ RACK_INPUT = 'rack.input'.freeze
26
28
 
27
29
  # This implements the Rack interface
28
30
  #
@@ -49,6 +51,11 @@ module Rack
49
51
  def params
50
52
  @params ||= begin
51
53
  p = request.params.merge(env[RACK_ROUTE_PARAMS] || {})
54
+ if request.content_type == APPLICATION_JSON
55
+ body = env[RACK_INPUT].read
56
+ env[RACK_INPUT].rewind
57
+ p.merge!(JSON.parse(body))
58
+ end
52
59
  p.respond_to?(:with_indifferent_access) ? p.with_indifferent_access : p
53
60
  end
54
61
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
13
  gem.name = "rack-action"
14
14
  gem.require_paths = ["lib"]
15
- gem.version = "0.3.0"
15
+ gem.version = "0.4.0"
16
16
 
17
17
  gem.add_runtime_dependency "rack"
18
18
  end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-action
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
5
- prerelease:
4
+ version: 0.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Paul Barry
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-13 00:00:00.000000000 Z
11
+ date: 2015-07-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rack
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  description: a small, simple framework for generating Rack responses
@@ -34,9 +31,9 @@ executables: []
34
31
  extensions: []
35
32
  extra_rdoc_files: []
36
33
  files:
37
- - .gitignore
38
- - .rvmrc
39
- - .yardopts
34
+ - ".gitignore"
35
+ - ".rvmrc"
36
+ - ".yardopts"
40
37
  - Gemfile
41
38
  - LICENSE
42
39
  - README.md
@@ -51,27 +48,26 @@ files:
51
48
  - test/rack_test.rb
52
49
  homepage: http://github.com/pjb3/rack-action
53
50
  licenses: []
51
+ metadata: {}
54
52
  post_install_message:
55
53
  rdoc_options: []
56
54
  require_paths:
57
55
  - lib
58
56
  required_ruby_version: !ruby/object:Gem::Requirement
59
- none: false
60
57
  requirements:
61
- - - ! '>='
58
+ - - ">="
62
59
  - !ruby/object:Gem::Version
63
60
  version: '0'
64
61
  required_rubygems_version: !ruby/object:Gem::Requirement
65
- none: false
66
62
  requirements:
67
- - - ! '>='
63
+ - - ">="
68
64
  - !ruby/object:Gem::Version
69
65
  version: '0'
70
66
  requirements: []
71
67
  rubyforge_project:
72
- rubygems_version: 1.8.25
68
+ rubygems_version: 2.4.5
73
69
  signing_key:
74
- specification_version: 3
70
+ specification_version: 4
75
71
  summary: a small, simple framework for generating Rack responses
76
72
  test_files:
77
73
  - test/rack/action_test.rb