tzispa 0.3.3 → 0.3.4

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: 47b98de1bcd11030f582a0f8d96de15eaba48d5d
4
- data.tar.gz: 74e37de3b51ccdf102b335df496d17f189842004
3
+ metadata.gz: 36b98fcccfc7db5bc2e1851dc330ef71f6d134d6
4
+ data.tar.gz: 6adbc025f39c5e2a08e61c1490e8833c4a4eb401
5
5
  SHA512:
6
- metadata.gz: 4bb14012a4409e313b68a895ac7d66f94d6b7ba8d05d36922daa3ecffaafc5f82d318030fae3fc38e39f1f034755443e62334fc458537e8015426e1ffa201c4c
7
- data.tar.gz: 91f86a3e97164de1d57306a2eb5bc15015dd16fb1eba08b41b42428ced1ef0540fe0b2c734a84dc1f42824fe867d4da88a56cea01745f9678b09d58d4de61d32
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
@@ -1,5 +1,5 @@
1
1
  require 'forwardable'
2
- require 'time'
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 :app, :env, :request, :response, :repository
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
- @env = environment
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
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tzispa
4
- VERSION = '0.3.3'
4
+ VERSION = '0.3.4'
5
5
  FRAMEWORK_NAME = 'Tzispa'
6
6
  GEM_NAME = 'tzispa'
7
7
  end
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.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-26 00:00:00.000000000 Z
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://www.area-integral.com
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.0'
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: '2.0'
157
+ version: '0'
157
158
  requirements: []
158
159
  rubyforge_project:
159
160
  rubygems_version: 2.5.1