Skip to content

Commit

Permalink
Style fixes and bump minor version
Browse files Browse the repository at this point in the history
  • Loading branch information
gazay committed Dec 24, 2014
1 parent bd3d53d commit 4d7b1be
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions lib/gon/sinatra/helpers.rb
Expand Up @@ -2,6 +2,7 @@

module Gon
module Sinatra

module Helpers
def include_gon(options = {})
return '' if gon.all_variables.empty?
Expand Down Expand Up @@ -29,5 +30,6 @@ def gon
@gon = env['gon']
end
end

end
end
13 changes: 6 additions & 7 deletions lib/gon/sinatra/store.rb
@@ -1,4 +1,3 @@

module Gon
module Sinatra
class Store
Expand All @@ -16,19 +15,19 @@ def clear
@env.clear
end

def method_missing(m, *args, &block)
if ( m.to_s =~ /=$/ )
if public_methods.include? m.to_s[0..-2].to_sym
def method_missing(method, *args, &block)
if ( method.to_s =~ /=$/ )
if public_methods.include? method.to_s[0..-2].to_sym
raise "You can't use Gon public methods for storing data"
end
set_variable(m.to_s.delete('='), args[0])
set_variable(method.to_s.delete('='), args[0])
else
get_variable(m.to_s)
get_variable(method.to_s)
end
end

def get_variable(name)
@env[name]
@env && @env[name]
end
alias :get :get_variable

Expand Down
2 changes: 1 addition & 1 deletion lib/gon/sinatra/version.rb
@@ -1,5 +1,5 @@
module Gon
module Sinatra
VERSION = '0.1.1'
VERSION = '0.1.2'
end
end

0 comments on commit 4d7b1be

Please sign in to comment.