tzispa 0.3.3 → 0.3.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 +4 -4
- data/lib/tzispa/context.rb +20 -0
- data/lib/tzispa/http/context.rb +4 -9
- data/lib/tzispa/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36b98fcccfc7db5bc2e1851dc330ef71f6d134d6
|
4
|
+
data.tar.gz: 6adbc025f39c5e2a08e61c1490e8833c4a4eb401
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ba7a3324decfa4aae956546fd1fdd9cd3b191439646ee482b95b9d43518626545cf5c8701f7a9af7a00bb35892ed4cf7aa2d12bf99cc528e6ee16969ea4c506
|
7
|
+
data.tar.gz: 96bffe002e67063a618059da19267120db58adec7a72d3952432f579d034781d7d8e4b5db002e45fcc7f7d37410153a38cbdc6147714a5de5233f54b22d2dc14
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
3
|
+
module Tzispa
|
4
|
+
|
5
|
+
# Thie class defines a environment to hold application state in runtime
|
6
|
+
class Context
|
7
|
+
extend Forwardable
|
8
|
+
|
9
|
+
attr_reader :app, :env, :repository
|
10
|
+
def_delegators :@app, :config, :logger, :domain
|
11
|
+
|
12
|
+
def initialize(environment)
|
13
|
+
@env = environment
|
14
|
+
@app = environment[:tzispa__app]
|
15
|
+
@repository = @app.repository.dup if @app.repository
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/lib/tzispa/http/context.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'forwardable'
|
2
|
-
require '
|
2
|
+
require 'tzispa/context'
|
3
3
|
require 'tzispa/http/response'
|
4
4
|
require 'tzispa/http/request'
|
5
5
|
require 'tzispa/http/session_flash_bag'
|
@@ -9,16 +9,14 @@ require 'tzispa/helpers/security'
|
|
9
9
|
module Tzispa
|
10
10
|
module Http
|
11
11
|
|
12
|
-
class Context
|
12
|
+
class Context < Tzispa::Context
|
13
13
|
extend Forwardable
|
14
14
|
|
15
15
|
include Tzispa::Helpers::Response
|
16
16
|
include Tzispa::Helpers::Security
|
17
17
|
|
18
|
-
attr_reader :
|
19
|
-
attr_accessor :domain
|
18
|
+
attr_reader :request, :response
|
20
19
|
def_delegators :@request, :session
|
21
|
-
def_delegators :@app, :config, :logger
|
22
20
|
|
23
21
|
SESSION_LAST_ACCESS = :__last_access
|
24
22
|
SESSION_AUTH_USER = :__auth__user
|
@@ -26,12 +24,9 @@ module Tzispa
|
|
26
24
|
|
27
25
|
|
28
26
|
def initialize(environment)
|
29
|
-
|
30
|
-
@app = environment[:tzispa__app]
|
27
|
+
super(environment)
|
31
28
|
@request = Tzispa::Http::Request.new(environment)
|
32
29
|
@response = Tzispa::Http::Response.new
|
33
|
-
@repository = @app.repository.dup if @app.repository
|
34
|
-
#set_last_access if config.sessions.enabled
|
35
30
|
end
|
36
31
|
|
37
32
|
def router_params
|
data/lib/tzispa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tzispa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Antonio Piñero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- lib/tzispa/config/routes.rb
|
125
125
|
- lib/tzispa/config/webconfig.rb
|
126
126
|
- lib/tzispa/config/yaml.rb
|
127
|
+
- lib/tzispa/context.rb
|
127
128
|
- lib/tzispa/controller/api.rb
|
128
129
|
- lib/tzispa/controller/base.rb
|
129
130
|
- lib/tzispa/controller/exceptions.rb
|
@@ -136,7 +137,7 @@ files:
|
|
136
137
|
- lib/tzispa/http/session_flash_bag.rb
|
137
138
|
- lib/tzispa/middleware.rb
|
138
139
|
- lib/tzispa/version.rb
|
139
|
-
homepage: https://
|
140
|
+
homepage: https://github.com/japiber/tzispa
|
140
141
|
licenses:
|
141
142
|
- MIT
|
142
143
|
metadata: {}
|
@@ -148,12 +149,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
149
|
requirements:
|
149
150
|
- - "~>"
|
150
151
|
- !ruby/object:Gem::Version
|
151
|
-
version: '2.
|
152
|
+
version: '2.3'
|
152
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
154
|
requirements:
|
154
|
-
- - "
|
155
|
+
- - ">="
|
155
156
|
- !ruby/object:Gem::Version
|
156
|
-
version: '
|
157
|
+
version: '0'
|
157
158
|
requirements: []
|
158
159
|
rubyforge_project:
|
159
160
|
rubygems_version: 2.5.1
|