Class: Stoor::GitConfig
- Inherits:
-
Object
- Object
- Stoor::GitConfig
- Defined in:
- lib/stoor/git_config.rb
Instance Attribute Summary collapse
-
#repo_path ⇒ Object
readonly
Returns the value of attribute repo_path.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, repo_path = nil) ⇒ GitConfig
constructor
A new instance of GitConfig.
Constructor Details
#initialize(app, repo_path = nil) ⇒ GitConfig
Returns a new instance of GitConfig.
5 6 7 |
# File 'lib/stoor/git_config.rb', line 5 def initialize(app, repo_path = nil) @app, @repo_path = app, repo_path end |
Instance Attribute Details
#repo_path ⇒ Object (readonly)
Returns the value of attribute repo_path.
3 4 5 |
# File 'lib/stoor/git_config.rb', line 3 def repo_path @repo_path end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/stoor/git_config.rb', line 9 def call(env) @request = Rack::Request.new(env) unless @request.session['gollum.author'] if repo_path && (name = git_option_value('user.name')) && (email = git_option_value('user.email')) @request.session['gollum.author'] = { :name => name, :email => email } end end @app.call(env) end |