appoxy_rails 0.0.27 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rails/api_controller.rb +6 -6
- data/lib/ui/binding_hack.rb +13 -13
- data/lib/ui/test.rb +7 -7
- data/lib/utils.rb +11 -11
- metadata +96 -69
data/lib/rails/api_controller.rb
CHANGED
@@ -15,7 +15,7 @@ module Appoxy
|
|
15
15
|
|
16
16
|
def verify_signature
|
17
17
|
params2 = nil
|
18
|
-
if request.put? || request.post?
|
18
|
+
if request.put? || (request.post? && !params["file"]) # we could not load binary in json
|
19
19
|
# We'll extract params from body instead here
|
20
20
|
# todo: maybe check for json format first in case this is a file or something?
|
21
21
|
body = request.body.read
|
@@ -90,14 +90,14 @@ module Appoxy
|
|
90
90
|
|
91
91
|
|
92
92
|
def send_error(statuscode_or_error, msg=nil)
|
93
|
-
|
93
|
+
backtrace = nil
|
94
94
|
if statuscode_or_error.is_a? Exception
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
backtrace = statuscode_or_error.backtrace.to_s
|
96
|
+
msg = statuscode_or_error.message
|
97
|
+
statuscode_or_error = 500
|
98
98
|
end
|
99
99
|
# deprecate status, should use status_code
|
100
|
-
json_msg = {"status_code"=>statuscode_or_error, "msg"=>msg}
|
100
|
+
json_msg = {"status_code"=>statuscode_or_error, "msg"=>msg, "backtrace"=>backtrace}
|
101
101
|
render :json=>json_msg, :status=>statuscode_or_error
|
102
102
|
true
|
103
103
|
end
|
data/lib/ui/binding_hack.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
module Appoxy
|
2
|
-
module UI
|
3
|
-
class BindingHack
|
4
|
-
|
5
|
-
def initialize(hash)
|
6
|
-
@options = hash
|
7
|
-
end
|
8
|
-
|
9
|
-
def get_binding
|
10
|
-
binding
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
1
|
+
module Appoxy
|
2
|
+
module UI
|
3
|
+
class BindingHack
|
4
|
+
|
5
|
+
def initialize(hash)
|
6
|
+
@options = hash
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_binding
|
10
|
+
binding
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
14
|
end
|
data/lib/ui/test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'erb'
|
2
|
-
require_relative 'binding_hack'
|
3
|
-
|
4
|
-
options = Appoxy::UI::BindingHack.new(:x=>"hi")
|
5
|
-
template = ERB.new(File.read(File.join(File.dirname(__FILE__), '_geo_location_finder.html.erb')))
|
6
|
-
ret = template.result(options.get_binding)
|
7
|
-
p ret
|
1
|
+
require 'erb'
|
2
|
+
require_relative 'binding_hack'
|
3
|
+
|
4
|
+
options = Appoxy::UI::BindingHack.new(:x=>"hi")
|
5
|
+
template = ERB.new(File.read(File.join(File.dirname(__FILE__), '_geo_location_finder.html.erb')))
|
6
|
+
ret = template.result(options.get_binding)
|
7
|
+
p ret
|
data/lib/utils.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
module Appoxy
|
2
|
-
module Utils
|
3
|
-
def self.random_string(length=10)
|
4
|
-
chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'
|
5
|
-
password = ''
|
6
|
-
length.times { password << chars[rand(chars.size)] }
|
7
|
-
password
|
8
|
-
end
|
9
|
-
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module Appoxy
|
2
|
+
module Utils
|
3
|
+
def self.random_string(length=10)
|
4
|
+
chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'
|
5
|
+
password = ''
|
6
|
+
length.times { password << chars[rand(chars.size)] }
|
7
|
+
password
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
metadata
CHANGED
@@ -1,90 +1,109 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: appoxy_rails
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 28
|
9
|
+
version: 0.0.28
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Travis Reeder
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
16
|
+
|
17
|
+
date: 2011-03-24 00:00:00 -07:00
|
13
18
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
16
21
|
name: rest-client
|
17
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
18
24
|
none: false
|
19
|
-
requirements:
|
20
|
-
- -
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
23
31
|
type: :runtime
|
24
|
-
|
25
|
-
|
26
|
-
- !ruby/object:Gem::Dependency
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
27
34
|
name: oauth
|
28
|
-
|
35
|
+
prerelease: false
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
29
37
|
none: false
|
30
|
-
requirements:
|
31
|
-
- -
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
34
44
|
type: :runtime
|
35
|
-
|
36
|
-
|
37
|
-
- !ruby/object:Gem::Dependency
|
45
|
+
version_requirements: *id002
|
46
|
+
- !ruby/object:Gem::Dependency
|
38
47
|
name: ruby-openid
|
39
|
-
|
48
|
+
prerelease: false
|
49
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
50
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
segments:
|
55
|
+
- 0
|
56
|
+
version: "0"
|
45
57
|
type: :runtime
|
46
|
-
|
47
|
-
|
48
|
-
- !ruby/object:Gem::Dependency
|
58
|
+
version_requirements: *id003
|
59
|
+
- !ruby/object:Gem::Dependency
|
49
60
|
name: appoxy_api
|
50
|
-
|
61
|
+
prerelease: false
|
62
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
51
63
|
none: false
|
52
|
-
requirements:
|
53
|
-
- -
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
version: "0"
|
56
70
|
type: :runtime
|
57
|
-
|
58
|
-
|
59
|
-
- !ruby/object:Gem::Dependency
|
71
|
+
version_requirements: *id004
|
72
|
+
- !ruby/object:Gem::Dependency
|
60
73
|
name: mini_fb
|
61
|
-
|
74
|
+
prerelease: false
|
75
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
62
76
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
segments:
|
81
|
+
- 0
|
82
|
+
version: "0"
|
67
83
|
type: :runtime
|
68
|
-
|
69
|
-
|
70
|
-
- !ruby/object:Gem::Dependency
|
84
|
+
version_requirements: *id005
|
85
|
+
- !ruby/object:Gem::Dependency
|
71
86
|
name: simple_record
|
72
|
-
|
87
|
+
prerelease: false
|
88
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
73
89
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
version: "0"
|
78
96
|
type: :runtime
|
79
|
-
|
80
|
-
version_requirements: *26133036
|
97
|
+
version_requirements: *id006
|
81
98
|
description: Appoxy API Helper gem description...
|
82
99
|
email: travis@appoxy.com
|
83
100
|
executables: []
|
101
|
+
|
84
102
|
extensions: []
|
85
|
-
|
103
|
+
|
104
|
+
extra_rdoc_files:
|
86
105
|
- README.markdown
|
87
|
-
files:
|
106
|
+
files:
|
88
107
|
- lib/appoxy_rails.rb
|
89
108
|
- lib/appoxy_sessions.rb
|
90
109
|
- lib/appoxy_ui.rb
|
@@ -108,26 +127,34 @@ files:
|
|
108
127
|
has_rdoc: true
|
109
128
|
homepage: http://www.appoxy.com
|
110
129
|
licenses: []
|
130
|
+
|
111
131
|
post_install_message:
|
112
132
|
rdoc_options: []
|
113
|
-
|
133
|
+
|
134
|
+
require_paths:
|
114
135
|
- lib
|
115
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
137
|
none: false
|
117
|
-
requirements:
|
118
|
-
- -
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
|
121
|
-
|
138
|
+
requirements:
|
139
|
+
- - ">="
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
segments:
|
142
|
+
- 0
|
143
|
+
version: "0"
|
144
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
145
|
none: false
|
123
|
-
requirements:
|
124
|
-
- -
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
segments:
|
150
|
+
- 0
|
151
|
+
version: "0"
|
127
152
|
requirements: []
|
153
|
+
|
128
154
|
rubyforge_project:
|
129
|
-
rubygems_version: 1.
|
155
|
+
rubygems_version: 1.3.7
|
130
156
|
signing_key:
|
131
157
|
specification_version: 3
|
132
158
|
summary: Appoxy Rails Helper gem
|
133
159
|
test_files: []
|
160
|
+
|