RubyApp 0.6.69 → 0.6.70

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.
data/Rakefile CHANGED
@@ -77,7 +77,7 @@ namespace :ruby_app do
77
77
  system('find . | grep \'\\.cache\'')
78
78
  end
79
79
 
80
- desc 'Remove all cached files'
80
+ desc 'Delete all cached files'
81
81
  task :destroy do
82
82
  puts 'Removing cached files ...'
83
83
  system('find . -name \'.cache\' | xargs rm -rv')
@@ -85,4 +85,5 @@ namespace :ruby_app do
85
85
 
86
86
  end
87
87
 
88
+
88
89
  end
@@ -19,7 +19,9 @@ module RubyApp
19
19
 
20
20
  @environment = {}
21
21
 
22
- RubyApp::Log.debug("LOG RubyApp::Application.root = #{RubyApp::Application.root.inspect}")
22
+ RubyApp::Log.info("LOG RubyApp::Application.root = #{RubyApp::Application.root.inspect}")
23
+ RubyApp::Log.info("LOG RubyApp::Response.configuration.cache.read? = #{RubyApp::Response.configuration.cache.read?}")
24
+ RubyApp::Log.info("LOG RubyApp::Response.configuration.cache.write? = #{RubyApp::Response.configuration.cache.write?}")
23
25
 
24
26
  end
25
27
 
@@ -26,19 +26,19 @@ module RubyApp
26
26
 
27
27
  self.page.loaded do |element, event|
28
28
  unless @authentication
29
- RubyApp::Log.debug("FACEBOOK permissions=#{permissions.inspect}")
29
+ # RubyApp::Log.debug("FACEBOOK permissions=#{permissions.inspect}")
30
30
  @authentication = ::Koala::Facebook::OAuth.new(ENV['FACEBOOK_ACCESS_KEY'] || RubyApp::Elements::Mobile::Documents::Authentication::Facebook::AuthenticationDocument.configuration.access_key,
31
31
  ENV['FACEBOOK_SECRET_KEY'] || RubyApp::Elements::Mobile::Documents::Authentication::Facebook::AuthenticationDocument.configuration.secret_key,
32
32
  RubyApp::Request.environment[RubyApp::Elements::Mobile::Documents::Authentication::AuthenticationDocument.configuration.return_to])
33
33
  url = @authentication.url_for_oauth_code(:display => 'touch',
34
34
  :permissions => permissions.is_a?(Array) ? permissions.join(',') : permissions)
35
- RubyApp::Log.debug("FACEBOOK --> #{url.inspect}")
35
+ RubyApp::Log.info("FACEBOOK --> #{url.inspect}")
36
36
  event.go(url)
37
37
  else
38
- RubyApp::Log.debug("FACEBOOK <-- #{RubyApp::Request.url.inspect}")
38
+ RubyApp::Log.info("FACEBOOK <-- #{RubyApp::Request.url.inspect}")
39
39
  code = RubyApp::Request.query['code']
40
40
  token = @authentication.get_access_token(code)
41
- RubyApp::Log.debug("FACEBOOK token=#{token.inspect}")
41
+ # RubyApp::Log.debug("FACEBOOK token=#{token.inspect}")
42
42
  self.process_token(token)
43
43
  self.hide(event)
44
44
  end
@@ -49,7 +49,7 @@ module RubyApp
49
49
  def process_token(token)
50
50
  graph = ::Koala::Facebook::API.new(token)
51
51
  me = graph.get_object('me')
52
- RubyApp::Log.debug("FACEBOOK me=#{me.inspect}")
52
+ # RubyApp::Log.debug("FACEBOOK me=#{me.inspect}")
53
53
  RubyApp::Session.identity = self.create_identity_from_me(me)
54
54
  end
55
55
 
@@ -31,13 +31,13 @@ module RubyApp
31
31
  @client = ::OAuth2::Client.new(access_key, secret_key, options)
32
32
  url = @client.auth_code.authorize_url(:redirect_uri => RubyApp::Request.environment[RubyApp::Elements::Mobile::Documents::Authentication::AuthenticationDocument.configuration.return_to],
33
33
  :scope => scopes.is_a?(Array) ? scopes.join(',') : scopes)
34
- RubyApp::Log.debug("OAUTH --> #{url.inspect}")
34
+ RubyApp::Log.info("OAUTH --> #{url.inspect}")
35
35
  event.go(url)
36
36
  else
37
- RubyApp::Log.debug("OAUTH <-- #{RubyApp::Request.url.inspect}")
37
+ RubyApp::Log.info("OAUTH <-- #{RubyApp::Request.url.inspect}")
38
38
  code = RubyApp::Request.query['code']
39
39
  access_token = @client.auth_code.get_token(code, :redirect_uri => RubyApp::Request.url)
40
- RubyApp::Log.debug("OAUTH token=#{access_token.token.inspect}")
40
+ # RubyApp::Log.debug("OAUTH token=#{access_token.token.inspect}")
41
41
  self.process_token(access_token)
42
42
  self.hide(event)
43
43
  end
@@ -28,7 +28,7 @@ module RubyApp
28
28
 
29
29
  def create_identity_from_token(token)
30
30
  user = JSON.parse(token.get('/user').body)
31
- RubyApp::Log.debug("GITHUB user=#{user.inspect}")
31
+ # RubyApp::Log.debug("GITHUB user=#{user.inspect}")
32
32
  return self.create_identity_from_email(user['email'])
33
33
  end
34
34
 
@@ -31,10 +31,10 @@ module RubyApp
31
31
  self.process_request(request)
32
32
  url = request.redirect_url(RubyApp::Request.environment[RubyApp::Elements::Mobile::Documents::Authentication::AuthenticationDocument.configuration.return_to],
33
33
  RubyApp::Request.environment[RubyApp::Elements::Mobile::Documents::Authentication::AuthenticationDocument.configuration.return_to])
34
- RubyApp::Log.debug("OPENID --> #{url.inspect}")
34
+ RubyApp::Log.info("OPENID --> #{url.inspect}")
35
35
  event.go(url)
36
36
  else
37
- RubyApp::Log.debug("OPENID <-- #{RubyApp::Request.url.inspect}")
37
+ RubyApp::Log.info("OPENID <-- #{RubyApp::Request.url.inspect}")
38
38
  response = @consumer.complete(RubyApp::Request.query,
39
39
  RubyApp::Request.environment[RubyApp::Elements::Mobile::Documents::Authentication::AuthenticationDocument.configuration.return_to])
40
40
  case response.status
@@ -36,7 +36,6 @@ module RubyApp
36
36
  end
37
37
 
38
38
  route(RubyApp::Mixins::RouteMixin::GET, /\/elements\/([^\.]+)\.([^\.\?]+)/) do |method, path, element_id, format|
39
- #RubyApp::Log.debug("#{RubyApp::Log.prefix(self, __method__)} --> #{method} #{path} #{element_id} #{format}")
40
39
  begin
41
40
  element = RubyApp::Element.get_element(element_id)
42
41
  RubyApp::Log.duration(RubyApp::Log::INFO, "GET #{element.class} #{format}") do
@@ -47,7 +46,6 @@ module RubyApp
47
46
  RubyApp::Log.exception(RubyApp::Log::ERROR, exception)
48
47
  raise
49
48
  end
50
- #RubyApp::Log.debug("#{RubyApp::Log.prefix(self, __method__)} <-- #{method} #{path} #{element_id} #{format}")
51
49
  end
52
50
 
53
51
  route(RubyApp::Mixins::RouteMixin::GET, /\.([^\.\?]+)/) do |method, path, format|
@@ -34,13 +34,13 @@ module RubyApp
34
34
  if RubyApp::Response.configuration.cache.formats.include?(format)
35
35
  cache = element.get_cache(format)
36
36
  if RubyApp::Response.configuration.cache.read? && File.exists?(cache)
37
- #RubyApp::Log.debug("#{RubyApp::Log.prefix(self, __method__)} READ #{cache.inspect}")
37
+ RubyApp::Log.info("READ #{cache.inspect}")
38
38
  self.write(File.read(cache))
39
39
  else
40
40
  content = element.render(format)
41
41
  if RubyApp::Response.configuration.cache.write? && !File.exists?(cache)
42
42
  FileUtils.mkdir_p(File.dirname(cache))
43
- #RubyApp::Log.debug("#{RubyApp::Log.prefix(self, __method__)} WRITE #{cache.inspect}")
43
+ RubyApp::Log.info("WRITE #{cache.inspect}")
44
44
  File.open(cache, 'w') do |file|
45
45
  file.write(content)
46
46
  file.flush
@@ -1,4 +1,4 @@
1
1
  module RubyApp
2
- VERSION = "0.6.69"
2
+ VERSION = "0.6.70"
3
3
  ROOT = File.expand_path(File.dirname(__FILE__))
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RubyApp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 141
4
+ hash: 139
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 69
10
- version: 0.6.69
9
+ - 70
10
+ version: 0.6.70
11
11
  platform: ruby
12
12
  authors:
13
13
  - Frank G. Ficnar
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-02-23 00:00:00 Z
18
+ date: 2013-02-24 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement