whurl_engine 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -95,6 +95,8 @@ $highlight: #F1CB31;
95
95
  width: 610px;
96
96
  height: 55px;
97
97
  margin-bottom: 10px;
98
+ font-family: Courier, monospace;
99
+ font-size: 14px;
98
100
  }
99
101
 
100
102
  .textarea_disabled {
@@ -1,5 +1,5 @@
1
- $(".new_whurl_engine_category").dialog('close');
1
+ $(".whurl_engine_category").dialog('close');
2
2
 
3
3
  - content = escape_javascript(render(@category))
4
- $('.categories').append("#{content}");
4
+ $('.category_list').append("#{content}");
5
5
  $("#category_#{@category.id}").effect("highlight", {}, 3000);
@@ -1,3 +1,3 @@
1
1
  - content = escape_javascript(render(:partial => 'form', :locals => {:category => @category}))
2
- $('.content').append("#{content}");
2
+ $('.category_list').append("#{content}");
3
3
  $('.whurl_engine_category').dialog('open');
@@ -2,6 +2,6 @@
2
2
  REST API Resources
3
3
  -if authorized?(:manage, nil, WhurlEngine::Category)
4
4
  = link_to('Add Category', new_category_path, :remote => true, :class => 'popup button')
5
- .categories
5
+ .category_list
6
6
  - @categories.each do |category|
7
7
  = render(category)
@@ -1,4 +1,4 @@
1
- $(".edit_whurl_engine_category").dialog('close');
1
+ $(".whurl_engine_category").dialog('close');
2
2
 
3
3
  - content = escape_javascript(render(@category));
4
4
  target_row = $("#category_#{@category.id}");
@@ -1,4 +1,4 @@
1
- $(".new_whurl_engine_header_definition").dialog('close');
1
+ $(".whurl_engine_header_definition").dialog('close');
2
2
 
3
3
  - content = escape_javascript(render(@header_definition))
4
4
  $('.header_definition').append("#{content}");
@@ -1,4 +1,4 @@
1
- $(".edit_whurl_engine_header_definition").dialog('close');
1
+ $(".whurl_engine_header_definition").dialog('close');
2
2
 
3
3
  - content = escape_javascript(render(@header_definition));
4
4
  $targetRow = $("#header_definition_#{@header_definition.id}");
@@ -1,4 +1,4 @@
1
- $(".new_whurl_engine_parameter_definition").dialog('close');
1
+ $(".whurl_engine_parameter_definition").dialog('close');
2
2
 
3
3
  - content = escape_javascript(render(@parameter_definition))
4
4
  $('.parameter_definition').append("#{content}");
@@ -1,4 +1,4 @@
1
- $(".edit_whurl_engine_parameter_definition").dialog('close');
1
+ $(".whurl_engine_parameter_definition").dialog('close');
2
2
 
3
3
  - content = escape_javascript(render(@parameter_definition));
4
4
  $targetRow = $("#parameter_definition_#{@parameter_definition.id}");
@@ -17,7 +17,7 @@
17
17
  = f.hidden_field :category_id
18
18
  %div
19
19
  = f.label :http_method
20
- = f.select(:http_method, options_for_select(['GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS'], 'GET'))
20
+ = f.select(:http_method, options_for_select(['GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS'], @resource.http_method))
21
21
  %div
22
22
  = f.label :base_uri
23
23
  = f.text_field :base_uri, :placeholder => 'eg. https://api.twitter.com/1, https://api.groupon.com/v1, etc.'
@@ -1,4 +1,4 @@
1
- $(".new_whurl_engine_resource").dialog('close');
1
+ $(".whurl_engine_resource").dialog('close');
2
2
 
3
3
  - content = escape_javascript(render(@resource))
4
4
  $('#category_#{@resource.category_id} .resources').append("#{content}");
@@ -1,4 +1,4 @@
1
- $(".edit_whurl_engine_resource").dialog('close');
1
+ $(".whurl_engine_resource").dialog('close');
2
2
 
3
3
  - content = escape_javascript(render(@resource));
4
4
  target_row = $("#resource_#{@resource.id}");
@@ -16,17 +16,22 @@ class String
16
16
  end
17
17
 
18
18
  def to_html(content_type, options = {:line_numbers => :table})
19
- case content_type
20
- when /xml/
21
- ::CodeRay.scan(self, :xml).div(options)
22
- when /html/
23
- ::CodeRay.scan(self, :html).div(options)
24
- when /json|javascript/
25
- ::CodeRay.scan(::JSON.pretty_generate(::JSON.parse(self)), :json).div(options)
26
- when /image|jpg|jpeg|gif|png|bmp|binary/
27
- "<img src=\"data:binary/octet;base64,#{Base64.encode64(response.body)}\" />"
28
- else
29
- self
19
+ begin
20
+ case content_type
21
+ when /xml/
22
+ ::CodeRay.scan(self, :xml).div(options)
23
+ when /html/
24
+ ::CodeRay.scan(self, :html).div(options)
25
+ when /json|javascript/
26
+ ::CodeRay.scan(::JSON.pretty_generate(::JSON.parse(self)), :json).div(options)
27
+ when /image|jpg|jpeg|gif|png|bmp|binary/
28
+ "<img src=\"data:binary/octet;base64,#{Base64.encode64(response.body)}\" />"
29
+ else
30
+ self
31
+ end
32
+
33
+ rescue
34
+ self
30
35
  end
31
36
  end
32
37
  end
@@ -1,3 +1,3 @@
1
1
  module WhurlEngine
2
- VERSION = "2.1.2"
2
+ VERSION = "2.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whurl_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-27 00:00:00.000000000 -08:00
12
+ date: 2012-03-04 00:00:00.000000000 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: coderay
17
- requirement: &2154609800 !ruby/object:Gem::Requirement
17
+ requirement: &2154669860 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0.9'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2154609800
25
+ version_requirements: *2154669860
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: coffee-script
28
- requirement: &2154609340 !ruby/object:Gem::Requirement
28
+ requirement: &2154669320 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2154609340
36
+ version_requirements: *2154669320
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: httmultiparty
39
- requirement: &2154608680 !ruby/object:Gem::Requirement
39
+ requirement: &2154668600 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0.2'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *2154608680
47
+ version_requirements: *2154668600
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: haml
50
- requirement: &2154608000 !ruby/object:Gem::Requirement
50
+ requirement: &2154667980 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '3.1'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *2154608000
58
+ version_requirements: *2154667980
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: json
61
- requirement: &2154607420 !ruby/object:Gem::Requirement
61
+ requirement: &2154667400 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '1.5'
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *2154607420
69
+ version_requirements: *2154667400
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rails
72
- requirement: &2154606780 !ruby/object:Gem::Requirement
72
+ requirement: &2154662520 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '3.1'
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *2154606780
80
+ version_requirements: *2154662520
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rinku
83
- requirement: &2154606200 !ruby/object:Gem::Requirement
83
+ requirement: &2154661940 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ~>
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '1.5'
89
89
  type: :runtime
90
90
  prerelease: false
91
- version_requirements: *2154606200
91
+ version_requirements: *2154661940
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: sass
94
- requirement: &2154605620 !ruby/object:Gem::Requirement
94
+ requirement: &2154661360 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ~>
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: '3.1'
100
100
  type: :runtime
101
101
  prerelease: false
102
- version_requirements: *2154605620
102
+ version_requirements: *2154661360
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: uglifier
105
- requirement: &2154605160 !ruby/object:Gem::Requirement
105
+ requirement: &2154660860 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ! '>='
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: '0'
111
111
  type: :runtime
112
112
  prerelease: false
113
- version_requirements: *2154605160
113
+ version_requirements: *2154660860
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: heroku
116
- requirement: &2154604540 !ruby/object:Gem::Requirement
116
+ requirement: &2154660280 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ! '>='
@@ -121,10 +121,10 @@ dependencies:
121
121
  version: '0'
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *2154604540
124
+ version_requirements: *2154660280
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: mysql
127
- requirement: &2154603940 !ruby/object:Gem::Requirement
127
+ requirement: &2154659600 !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements:
130
130
  - - ~>
@@ -132,10 +132,10 @@ dependencies:
132
132
  version: 2.8.1
133
133
  type: :development
134
134
  prerelease: false
135
- version_requirements: *2154603940
135
+ version_requirements: *2154659600
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: webmock
138
- requirement: &2154603400 !ruby/object:Gem::Requirement
138
+ requirement: &2154658940 !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
141
141
  - - ~>
@@ -143,7 +143,7 @@ dependencies:
143
143
  version: 1.7.10
144
144
  type: :development
145
145
  prerelease: false
146
- version_requirements: *2154603400
146
+ version_requirements: *2154658940
147
147
  description: ! "Whurl is a mountable engine for Rails 3.1+ apps allowing\n you
148
148
  to show the functionality of your API. You can save API calls and share them with
149
149
  your team or the public."