whurl_engine 2.0.1 → 2.1.0

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.
Files changed (43) hide show
  1. data/README.markdown +18 -0
  2. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-bg_flat_100_ffffff_40x100.png +0 -0
  3. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-bg_flat_10_000000_40x100.png +0 -0
  4. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-bg_flat_18_f6ecd5_40x100.png +0 -0
  5. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-bg_flat_20_666666_40x100.png +0 -0
  6. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-bg_glass_65_ffffff_1x400.png +0 -0
  7. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-bg_highlight-hard_100_dddddd_1x100.png +0 -0
  8. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-bg_highlight-hard_100_eeeeee_1x100.png +0 -0
  9. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-bg_highlight-hard_40_f6a828_1x100.png +0 -0
  10. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-bg_highlight-soft_75_f1fbe5_1x100.png +0 -0
  11. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-icons_1c94c4_256x240.png +0 -0
  12. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-icons_222222_256x240.png +0 -0
  13. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-icons_8cce3b_256x240.png +0 -0
  14. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-icons_cd0a0a_256x240.png +0 -0
  15. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-icons_ef8c08_256x240.png +0 -0
  16. data/app/assets/{stylesheets/whurl_engine/custom-theme/images → images/whurl_engine}/ui-icons_ffffff_256x240.png +0 -0
  17. data/app/assets/stylesheets/whurl_engine/application.css.scss +23 -0
  18. data/app/assets/stylesheets/whurl_engine/{custom-theme/jquery-ui-1.8.16.custom.css → jquery-ui-1.8.16.custom.css} +17 -17
  19. data/app/assets/stylesheets/whurl_engine/whurl.css.scss +110 -105
  20. data/app/models/whurl_engine/whurl.rb +12 -7
  21. data/app/views/layouts/whurl_engine/application.html.haml +4 -0
  22. data/app/views/whurl_engine/whurls/_form.html.haml +9 -2
  23. data/app/views/whurl_engine/whurls/_response.html.haml +1 -1
  24. data/app/views/whurl_engine/whurls/new.html.haml +2 -2
  25. data/db/migrate/{20110209054322_create_whurls_table.rb → 20110209054322_whurl_create_whurls_table.rb} +1 -1
  26. data/db/migrate/{20111210192724_add_description_to_whurl.rb → 20111210192724_whurl_add_description_to_whurl.rb} +1 -1
  27. data/db/migrate/{20111210201607_add_custom_url_to_whurl.rb → 20111210201607_whurl_add_custom_url_to_whurl.rb} +1 -1
  28. data/db/migrate/{20111211030904_rename_whurls_to_requests.rb → 20111211030904_whurl_rename_whurls_to_requests.rb} +1 -1
  29. data/db/migrate/{20111220233800_create_fields_for_whurl_requests.rb → 20111220233800_whurl_create_fields_for_whurl_requests.rb} +1 -1
  30. data/db/migrate/{20111221011145_drop_data_from_requests.rb → 20111221011145_whurl_drop_data_from_requests.rb} +1 -1
  31. data/db/migrate/{20120106033416_create_responses.rb → 20120106033416_whurl_create_responses.rb} +1 -1
  32. data/db/migrate/{20120106190508_create_categories_table.rb → 20120106190508_whurl_create_categories_table.rb} +1 -1
  33. data/db/migrate/{20120107011500_create_resources_table.rb → 20120107011500_whurl_create_resources_table.rb} +1 -1
  34. data/db/migrate/{20120107065652_create_parameters_table.rb → 20120107065652_whurl_create_parameters_table.rb} +1 -1
  35. data/db/migrate/{20120110205837_rename_parameters_to_parameter_definitions.rb → 20120110205837_whurl_rename_parameters_to_parameter_definitions.rb} +1 -1
  36. data/db/migrate/{20120110205853_rename_requests_to_whurls.rb → 20120110205853_whurl_rename_requests_to_whurls.rb} +1 -1
  37. data/db/migrate/{20120111014928_add_raw_request_to_whurls.rb → 20120111014928_whurl_add_raw_request_to_whurls.rb} +1 -1
  38. data/db/migrate/{20120118011913_create_header_definitions_table.rb → 20120118011913_whurl_create_header_definitions_table.rb} +1 -1
  39. data/db/migrate/{20120214074332_add_message_to_whurls.rb → 20120214074332_whurl_add_message_to_whurls.rb} +1 -1
  40. data/db/migrate/20120221012000_whurl_add_basic_auth_fields.rb +6 -0
  41. data/lib/tasks/whurl_engine_tasks.rake +1 -1
  42. data/lib/whurl_engine/version.rb +1 -1
  43. metadata +58 -57
data/README.markdown CHANGED
@@ -29,6 +29,24 @@ comes with a default CanCan adapter. To us it install the cancan gem in your app
29
29
  config.authorize_with(:cancan)
30
30
  end
31
31
 
32
+ ...and your ability.rb file looks like this:
33
+
34
+ class Ability
35
+ include CanCan::Ability
36
+
37
+ def initialize(user)
38
+ user ||= User.new # guest user (not logged in)
39
+ if user.admin?
40
+ can :manage, :all
41
+ else
42
+ can :read, :all
43
+ can :access, :whurl_engine
44
+ can :create, WhurlEngine::Whurl
45
+ end
46
+ end
47
+ end
48
+
49
+
32
50
  Finally, look at your new API playground by starting your rails server and hitting up the right URL:
33
51
 
34
52
  http://localhost:3000/whurl
@@ -11,6 +11,8 @@ body {
11
11
  font-family: Arial, sans-serif;
12
12
  font-size: 14px;
13
13
  background-color: white;
14
+ padding-top: 50px;
15
+ padding-bottom: 50px;
14
16
  }
15
17
 
16
18
  h1, h2, h3 {
@@ -92,3 +94,24 @@ select {
92
94
  vertical-align: middle;
93
95
  }
94
96
 
97
+ .header {
98
+ position: fixed;
99
+ top: 0;
100
+ padding-left: 20px;
101
+ left: 0;
102
+ width:100%;
103
+ text-align: left;
104
+ background-color: #CCC;
105
+ z-index: 10;
106
+ }
107
+
108
+ .footer {
109
+ position: fixed;
110
+ bottom: 0;
111
+ padding-right: 20px;
112
+ right: 0;
113
+ width:100%;
114
+ text-align: right;
115
+ background-color: #CCC;
116
+ z-index: 10;
117
+ }
@@ -57,26 +57,26 @@
57
57
  /* Component containers
58
58
  ----------------------------------*/
59
59
  .ui-widget { font-family: Arial,sans-serif; font-size: 14px; }
60
- .ui-widget-content { border: 1px solid #dddddd; background: #ffffff url(images/ui-bg_flat_100_ffffff_40x100.png) 50% 50% repeat-x; color: #333333; }
60
+ .ui-widget-content { border: 1px solid #dddddd; background: #ffffff url(ui-bg_flat_100_ffffff_40x100.png) 50% 50% repeat-x; color: #333333; }
61
61
  .ui-widget-content a { color: #333333; }
62
- .ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_highlight-hard_40_f6a828_1x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
62
+ .ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(ui-bg_highlight-hard_40_f6a828_1x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
63
63
  .ui-widget-header a { color: #ffffff; }
64
64
 
65
65
  /* Interaction states
66
66
  ----------------------------------*/
67
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #dddddd url(images/ui-bg_highlight-hard_100_dddddd_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
67
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #dddddd url(ui-bg_highlight-hard_100_dddddd_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
68
68
  .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
69
- .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #cccccc; background: #eeeeee url(images/ui-bg_highlight-hard_100_eeeeee_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
69
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #cccccc; background: #eeeeee url(ui-bg_highlight-hard_100_eeeeee_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
70
70
  .ui-state-hover a, .ui-state-hover a:hover { color: #1c94c4; text-decoration: none; }
71
- .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #dddddd; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
71
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #dddddd; background: #ffffff url(ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
72
72
  .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; }
73
73
  .ui-widget :active { outline: none; }
74
74
 
75
75
  /* Interaction Cues
76
76
  ----------------------------------*/
77
- .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #8cce3b; background: #f1fbe5 url(images/ui-bg_highlight-soft_75_f1fbe5_1x100.png) 50% top repeat-x; color: #363636; }
77
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #8cce3b; background: #f1fbe5 url(ui-bg_highlight-soft_75_f1fbe5_1x100.png) 50% top repeat-x; color: #363636; }
78
78
  .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
79
- .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #f6ecd5 url(images/ui-bg_flat_18_f6ecd5_40x100.png) 50% 50% repeat-x; color: #444444; }
79
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #f6ecd5 url(ui-bg_flat_18_f6ecd5_40x100.png) 50% 50% repeat-x; color: #444444; }
80
80
  .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #444444; }
81
81
  .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #444444; }
82
82
  .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
@@ -87,14 +87,14 @@
87
87
  ----------------------------------*/
88
88
 
89
89
  /* states and images */
90
- .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
91
- .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
92
- .ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
93
- .ui-state-default .ui-icon { background-image: url(images/ui-icons_1c94c4_256x240.png); }
94
- .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
95
- .ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
96
- .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_8cce3b_256x240.png); }
97
- .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
90
+ .ui-icon { width: 16px; height: 16px; background-image: url(ui-icons_222222_256x240.png); }
91
+ .ui-widget-content .ui-icon {background-image: url(ui-icons_222222_256x240.png); }
92
+ .ui-widget-header .ui-icon {background-image: url(ui-icons_ffffff_256x240.png); }
93
+ .ui-state-default .ui-icon { background-image: url(ui-icons_1c94c4_256x240.png); }
94
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(ui-icons_ef8c08_256x240.png); }
95
+ .ui-state-active .ui-icon {background-image: url(ui-icons_ef8c08_256x240.png); }
96
+ .ui-state-highlight .ui-icon {background-image: url(ui-icons_8cce3b_256x240.png); }
97
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(ui-icons_cd0a0a_256x240.png); }
98
98
 
99
99
  /* positioning */
100
100
  .ui-icon-carat-1-n { background-position: 0 0; }
@@ -284,8 +284,8 @@
284
284
  .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 14px; -webkit-border-bottom-right-radius: 14px; -khtml-border-bottom-right-radius: 14px; border-bottom-right-radius: 14px; }
285
285
 
286
286
  /* Overlays */
287
- .ui-widget-overlay { background: #666666 url(images/ui-bg_flat_20_666666_40x100.png) 50% 50% repeat-x; opacity: .50;filter:Alpha(Opacity=50); }
288
- .ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 19px; -khtml-border-radius: 19px; -webkit-border-radius: 19px; border-radius: 19px; }/*
287
+ .ui-widget-overlay { background: #666666 url(ui-bg_flat_20_666666_40x100.png) 50% 50% repeat-x; opacity: .50;filter:Alpha(Opacity=50); }
288
+ .ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 19px; -khtml-border-radius: 19px; -webkit-border-radius: 19px; border-radius: 19px; }/*
289
289
  * jQuery UI Resizable 1.8.16
290
290
  *
291
291
  * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
@@ -1,128 +1,133 @@
1
1
  $dark: #2B2F38;
2
2
  $highlight: #F1CB31;
3
3
 
4
- @mixin rounded-corners($topleft, $topright: $topleft, $bottomright: $topleft, $bottomleft: $topleft) {
4
+ @mixin rounded-corners($topleft, $topright: $topleft, $bottomright: $topleft, $bottomleft: $topleft){
5
5
  border-radius: $topleft $topright $bottomright $bottomleft;
6
6
  -moz-border-radius: $topleft $topright $bottomright $bottomleft;
7
7
  -webkit-border-radius: $topleft $topright $bottomright $bottomleft;
8
8
  }
9
9
 
10
- @mixin rotate($degrees) {
11
- transform: rotate($degrees);
12
- -ms-transform: rotate($degrees);
13
- -webkit-transform: rotate($degrees);
14
- -o-transform: rotate($degrees);
15
- -moz-transform: rotate($degrees);
10
+ @mixin rotate($degrees){
11
+ transform: rotate($degrees);
12
+ -ms-transform: rotate($degrees);
13
+ -webkit-transform: rotate($degrees);
14
+ -o-transform: rotate($degrees);
15
+ -moz-transform: rotate($degrees);
16
16
  }
17
17
 
18
18
  .whurls.show {
19
- .menu {
20
- position: fixed;
21
- bottom: 20px;
22
- left: 0;
23
- border: 1px solid #666;
24
- border-left: none;
25
- background-color: #f6a828;
26
- border-radius: 0 20px 20px 0;
27
- width: auto;
28
- font-size: 16px;
29
- padding: 5px;
30
- }
19
+ .menu {
20
+ position: fixed;
21
+ bottom: 20px;
22
+ left: 0;
23
+ border: 1px solid #666;
24
+ border-left: none;
25
+ background-color: #f6a828;
26
+ border-radius: 0 20px 20px 0;
27
+ width: auto;
28
+ font-size: 16px;
29
+ padding: 5px;
30
+ z-index: 20;
31
+ }
31
32
  }
32
33
 
33
34
  .whurl {
34
- td.line_numbers pre, td.code pre, td.code span {
35
- font-family: monospace;
36
- }
37
-
38
- table.CodeRay {
39
- border-collapse: collapse;
40
- }
41
-
42
- td.line_numbers {
43
- background-color: #DDD;
44
- text-align: right;
45
- padding: 0 5px;
46
- }
35
+ td.line_numbers pre, td.code pre, td.code span {
36
+ font-family: monospace;
37
+ }
38
+
39
+ table.CodeRay {
40
+ border-collapse: collapse;
41
+ }
42
+
43
+ td.line_numbers {
44
+ background-color: #DDD;
45
+ text-align: right;
46
+ padding: 0 5px;
47
+ }
47
48
  }
48
49
 
49
50
  .whurl_form {
50
- .headers, .params, .url, .post_body, .button_row {
51
- margin-left: 162px;
52
- min-height: 31px;
53
- margin-bottom: 10px;
54
- }
55
-
56
- .header_pair, .param_pair {
57
- padding: 4px 0;
58
- }
59
-
60
- .key {
61
- width: 200px;
62
- }
63
-
64
- .value {
65
- width: 400px;
66
- }
67
-
68
- .long {
69
- width: 525px;
70
- }
71
-
72
- #whurl_request_url {
73
- width: 514px;
74
- }
75
-
76
- input.one {
77
- width: 480px;
78
- }
79
-
80
- input.two {
81
- width: 225px;
82
- }
83
-
84
- input.three {
85
- width: 350px;
86
- margin-left: 10px;
87
- }
88
-
89
- input.four {
90
- width: 350px;
91
- }
92
-
93
- textarea#whurl_request_body {
94
- width: 610px;
95
- height: 55px;
96
- margin-bottom: 10px;
97
- }
98
-
99
- .textarea_disabled {
100
- background-color: lightgray;
101
- }
102
-
103
- .section_title {
51
+ .headers, .params, .fields, .url, .post_body, .button_row {
52
+ margin-left: 162px;
53
+ min-height: 31px;
54
+ margin-bottom: 10px;
55
+ }
56
+
57
+ .header_pair, .param_pair, .field_pair {
58
+ padding: 4px 0;
59
+ }
60
+
61
+ .key, #whurl_basic_auth_user {
62
+ width: 200px;
63
+ }
64
+
65
+ .value, #whurl_basic_auth_password {
66
+ width: 400px;
67
+ }
68
+
69
+ .long {
70
+ width: 525px;
71
+ }
72
+
73
+ #whurl_request_url {
74
+ width: 514px;
75
+ }
76
+
77
+ input.one {
78
+ width: 480px;
79
+ }
80
+
81
+ input.two {
82
+ width: 225px;
83
+ }
84
+
85
+ input.three {
86
+ width: 350px;
87
+ margin-left: 10px;
88
+ }
89
+
90
+ input.four {
91
+ width: 350px;
92
+ }
93
+
94
+ textarea#whurl_request_body {
95
+ width: 610px;
96
+ height: 55px;
97
+ margin-bottom: 10px;
98
+ }
99
+
100
+ .textarea_disabled {
101
+ background-color: lightgray;
102
+ }
103
+
104
+ .section_title {
104
105
  padding: 4px 0;
105
106
  float: left;
106
107
  text-align: right;
107
108
  width: 155px;
108
109
  line-height: 26px;
109
- }
110
-
111
- a.copy_link {
112
- width: 115.5px;
113
- height: 44px;
114
- background: url('copyURL.png') no-repeat 0 0;
115
- margin: 30px 0 0 45px;
116
- display: block;
117
- }
118
-
119
- a.copy_link:hover {
120
- background-position: -116px 0;
121
- }
122
-
123
- .param_pair:first-child,
124
- .header_pair:first-child
125
- {
126
- display: none;
127
- }
110
+ }
111
+
112
+ a.copy_link {
113
+ width: 115.5px;
114
+ height: 44px;
115
+ background: url('copyURL.png') no-repeat 0 0;
116
+ margin: 30px 0 0 45px;
117
+ display: block;
118
+ }
119
+
120
+ a.copy_link:hover {
121
+ background-position: -116px 0;
122
+ }
123
+
124
+ .param_pair:first-child,
125
+ .header_pair:first-child {
126
+ display: none;
127
+ }
128
+
129
+ #give_it_a-whurl {
130
+ float:right;
131
+ margin-right: 170px;
132
+ }
128
133
  }
@@ -24,13 +24,18 @@ module WhurlEngine
24
24
  end
25
25
 
26
26
  def make_request
27
- response = AnyClient.send(request_method.downcase,
28
- request_url,
29
- :headers => request_headers.to_hash,
30
- :query => request_parameters.blank? ? nil : request_parameters,
31
- :body => request_body,
32
- :follow_redirects => false
33
- )
27
+ request_params = {
28
+ :headers => request_headers.to_hash,
29
+ :query => request_parameters.blank? ? nil : request_parameters,
30
+ :body => request_body,
31
+ :follow_redirects => false
32
+ }
33
+
34
+ if basic_auth_user.present? && basic_auth_password.present?
35
+ request_params.merge!({:basic_auth => { :username => basic_auth_user, :password => basic_auth_password }})
36
+ end
37
+
38
+ response = AnyClient.send(request_method.downcase, request_url, request_params)
34
39
  self.response_message = "HTTP/#{response.http_version} #{response.code} #{Rack::Utils::HTTP_STATUS_CODES[response.code]}"
35
40
  self.response_content_type = response.content_type
36
41
  self.response_body = response.body
@@ -26,6 +26,10 @@
26
26
 
27
27
  %title Whurl - API Console
28
28
  %body{:class => [controller_name, action_name]}
29
+ .header
30
+ %p
31
+ =link_to "Documentation Home", root_path
32
+ =link_to "Console", new_whurl_path
29
33
  .content
30
34
  - if notice || alert
31
35
  .flash
@@ -12,6 +12,13 @@
12
12
  = f.select(:request_method, options_for_select(["GET", "POST", "PUT", "DELETE", "HEAD"], whurl.request_method))
13
13
  \/
14
14
  \#{f.text_field(:request_url)}
15
+ .row
16
+ .section_title
17
+ Basic Auth
18
+ .fields
19
+ .field_pair
20
+ = f.text_field(:basic_auth_user, :placeholder => 'username')
21
+ = f.text_field(:basic_auth_password, :placeholder => 'password')
15
22
  .row
16
23
  .section_title
17
24
  %a.trash_headers{:class => 'trash button icon_only', :title => "trash all headers"}
@@ -38,5 +45,5 @@
38
45
  .post_body
39
46
  = f.text_area(:request_body)
40
47
  .button_row
41
- %input{:type => 'submit', :value => "Give it a Whurl!"}/
42
- %input#clear_fields{:type => 'button', :value => "Clear", :class => 'clear_fields'}
48
+ %input#clear_fields{:type => 'button', :value => "Clear", :class => 'clear_fields'}
49
+ %input#give_it_a-whurl{:type => 'submit', :value => "Give it a Whurl!"}/
@@ -1,7 +1,7 @@
1
1
  -#- response_body = response.to_html(:line_numbers => :table).force_encoding(Encoding.default_external)
2
2
  %h3 Response Headers
3
3
  .container
4
- = whurl.response_message
4
+ %pre= whurl.response_message
5
5
  = find_and_preserve(whurl.response_headers.to_html)
6
6
  %h3 Response Body
7
7
  .container= find_and_preserve(whurl.response_body.to_html(whurl.response_content_type))
@@ -1,5 +1,5 @@
1
- = render :partial => 'form'
1
+ = render :partial => 'form', :locals => {:whurl => @whurl}
2
2
  :javascript
3
- $(document).ready(function() {
3
+ $(function() {
4
4
  $('#url').focus();
5
5
  });
@@ -1,4 +1,4 @@
1
- class CreateWhurlsTable < ActiveRecord::Migration
1
+ class WhurlCreateWhurlsTable < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :whurls do |t|
4
4
  t.string :hash_key, :limit => 6, :null => false
@@ -1,4 +1,4 @@
1
- class AddDescriptionToWhurl < ActiveRecord::Migration
1
+ class WhurlAddDescriptionToWhurl < ActiveRecord::Migration
2
2
  def self.up
3
3
  add_column :whurls, :description, :string
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddCustomUrlToWhurl < ActiveRecord::Migration
1
+ class WhurlAddCustomUrlToWhurl < ActiveRecord::Migration
2
2
  def self.up
3
3
  add_column :whurls, :custom_url, :string
4
4
  end
@@ -1,4 +1,4 @@
1
- class RenameWhurlsToRequests < ActiveRecord::Migration
1
+ class WhurlRenameWhurlsToRequests < ActiveRecord::Migration
2
2
  def change
3
3
  rename_table :whurls, :whurl_engine_requests
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreateFieldsForWhurlRequests < ActiveRecord::Migration
1
+ class WhurlCreateFieldsForWhurlRequests < ActiveRecord::Migration
2
2
  def self.up
3
3
  add_column :whurl_engine_requests, :http_method, :string, :limit => 10
4
4
  add_column :whurl_engine_requests, :body, :text
@@ -1,4 +1,4 @@
1
- class DropDataFromRequests < ActiveRecord::Migration
1
+ class WhurlDropDataFromRequests < ActiveRecord::Migration
2
2
  def self.up
3
3
  remove_column :whurl_engine_requests, :data
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreateResponses < ActiveRecord::Migration
1
+ class WhurlCreateResponses < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :whurl_engine_responses do |t|
4
4
  t.integer :request_id
@@ -1,4 +1,4 @@
1
- class CreateCategoriesTable < ActiveRecord::Migration
1
+ class WhurlCreateCategoriesTable < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :whurl_engine_categories do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateResourcesTable < ActiveRecord::Migration
1
+ class WhurlCreateResourcesTable < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :whurl_engine_resources do |t|
4
4
  t.integer :category_id
@@ -1,4 +1,4 @@
1
- class CreateParametersTable < ActiveRecord::Migration
1
+ class WhurlCreateParametersTable < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :whurl_engine_parameters do |t|
4
4
  t.integer :resource_id
@@ -1,4 +1,4 @@
1
- class RenameParametersToParameterDefinitions < ActiveRecord::Migration
1
+ class WhurlRenameParametersToParameterDefinitions < ActiveRecord::Migration
2
2
  def change
3
3
  rename_table :whurl_engine_parameters, :whurl_engine_parameter_definitions
4
4
  end
@@ -1,4 +1,4 @@
1
- class RenameRequestsToWhurls < ActiveRecord::Migration
1
+ class WhurlRenameRequestsToWhurls < ActiveRecord::Migration
2
2
  def up
3
3
  rename_table :whurl_engine_requests, :whurl_engine_whurls
4
4
  drop_table :whurl_engine_responses
@@ -1,4 +1,4 @@
1
- class AddRawRequestToWhurls < ActiveRecord::Migration
1
+ class WhurlAddRawRequestToWhurls < ActiveRecord::Migration
2
2
  def change
3
3
  add_column :whurl_engine_whurls, :raw_request, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreateHeaderDefinitionsTable < ActiveRecord::Migration
1
+ class WhurlCreateHeaderDefinitionsTable < ActiveRecord::Migration
2
2
  create_table :whurl_engine_header_definitions do |t|
3
3
  t.integer :resource_id
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class AddMessageToWhurls < ActiveRecord::Migration
1
+ class WhurlAddMessageToWhurls < ActiveRecord::Migration
2
2
  def change
3
3
  add_column :whurl_engine_whurls, :response_message, :string
4
4
  end
@@ -0,0 +1,6 @@
1
+ class WhurlAddBasicAuthFields < ActiveRecord::Migration
2
+ def change
3
+ add_column :whurl_engine_whurls, :basic_auth_user, :string
4
+ add_column :whurl_engine_whurls, :basic_auth_password, :string
5
+ end
6
+ end
@@ -1,4 +1,4 @@
1
1
  # desc "Explaining what the task does"
2
2
  # task :whurl_engine do
3
3
  # # Task goes here
4
- # end
4
+ # end
@@ -1,3 +1,3 @@
1
1
  module WhurlEngine
2
- VERSION = "2.0.1"
2
+ VERSION = "2.1.0"
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.0.1
4
+ version: 2.1.0
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-15 00:00:00.000000000 -08:00
12
+ date: 2012-02-20 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: &2158232900 !ruby/object:Gem::Requirement
17
+ requirement: &2152434520 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.9.6
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2158232900
25
+ version_requirements: *2152434520
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: coffee-script
28
- requirement: &2158232480 !ruby/object:Gem::Requirement
28
+ requirement: &2152434100 !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: *2158232480
36
+ version_requirements: *2152434100
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: httmultiparty
39
- requirement: &2158231940 !ruby/object:Gem::Requirement
39
+ requirement: &2157985420 !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: *2158231940
47
+ version_requirements: *2157985420
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: haml
50
- requirement: &2158231440 !ruby/object:Gem::Requirement
50
+ requirement: &2157984920 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 3.1.4
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *2158231440
58
+ version_requirements: *2157984920
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: json
61
- requirement: &2158230980 !ruby/object:Gem::Requirement
61
+ requirement: &2157984460 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 1.5.1
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *2158230980
69
+ version_requirements: *2157984460
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rails
72
- requirement: &2158230520 !ruby/object:Gem::Requirement
72
+ requirement: &2157984000 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: 3.1.3
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *2158230520
80
+ version_requirements: *2157984000
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rinku
83
- requirement: &2158230060 !ruby/object:Gem::Requirement
83
+ requirement: &2157983540 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ~>
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: 1.5.0
89
89
  type: :runtime
90
90
  prerelease: false
91
- version_requirements: *2158230060
91
+ version_requirements: *2157983540
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: sass
94
- requirement: &2158229600 !ruby/object:Gem::Requirement
94
+ requirement: &2157983080 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ~>
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: 3.1.10
100
100
  type: :runtime
101
101
  prerelease: false
102
- version_requirements: *2158229600
102
+ version_requirements: *2157983080
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: uglifier
105
- requirement: &2158229220 !ruby/object:Gem::Requirement
105
+ requirement: &2157982700 !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: *2158229220
113
+ version_requirements: *2157982700
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: heroku
116
- requirement: &2158228760 !ruby/object:Gem::Requirement
116
+ requirement: &2157982240 !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: *2158228760
124
+ version_requirements: *2157982240
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: mysql
127
- requirement: &2158228260 !ruby/object:Gem::Requirement
127
+ requirement: &2157981740 !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: *2158228260
135
+ version_requirements: *2157981740
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: webmock
138
- requirement: &2158227760 !ruby/object:Gem::Requirement
138
+ requirement: &2157981240 !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: *2158227760
146
+ version_requirements: *2157981240
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."
@@ -173,28 +173,28 @@ files:
173
173
  - app/assets/images/whurl_engine/rails.png
174
174
  - app/assets/images/whurl_engine/send_button.jpg
175
175
  - app/assets/images/whurl_engine/splash.png
176
+ - app/assets/images/whurl_engine/ui-bg_flat_100_ffffff_40x100.png
177
+ - app/assets/images/whurl_engine/ui-bg_flat_10_000000_40x100.png
178
+ - app/assets/images/whurl_engine/ui-bg_flat_18_f6ecd5_40x100.png
179
+ - app/assets/images/whurl_engine/ui-bg_flat_20_666666_40x100.png
180
+ - app/assets/images/whurl_engine/ui-bg_glass_65_ffffff_1x400.png
181
+ - app/assets/images/whurl_engine/ui-bg_highlight-hard_100_dddddd_1x100.png
182
+ - app/assets/images/whurl_engine/ui-bg_highlight-hard_100_eeeeee_1x100.png
183
+ - app/assets/images/whurl_engine/ui-bg_highlight-hard_40_f6a828_1x100.png
184
+ - app/assets/images/whurl_engine/ui-bg_highlight-soft_75_f1fbe5_1x100.png
185
+ - app/assets/images/whurl_engine/ui-icons_1c94c4_256x240.png
186
+ - app/assets/images/whurl_engine/ui-icons_222222_256x240.png
187
+ - app/assets/images/whurl_engine/ui-icons_8cce3b_256x240.png
188
+ - app/assets/images/whurl_engine/ui-icons_cd0a0a_256x240.png
189
+ - app/assets/images/whurl_engine/ui-icons_ef8c08_256x240.png
190
+ - app/assets/images/whurl_engine/ui-icons_ffffff_256x240.png
176
191
  - app/assets/javascripts/whurl_engine/application.js
177
192
  - app/assets/javascripts/whurl_engine/jquery-1-7-1-min.js
178
193
  - app/assets/javascripts/whurl_engine/jquery-livequery.js
179
194
  - app/assets/javascripts/whurl_engine/jquery-ui-1-8-16-min.js
180
195
  - app/assets/javascripts/whurl_engine/jquery-ujs.js
181
196
  - app/assets/stylesheets/whurl_engine/application.css.scss
182
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-bg_flat_100_ffffff_40x100.png
183
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-bg_flat_10_000000_40x100.png
184
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-bg_flat_18_f6ecd5_40x100.png
185
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-bg_flat_20_666666_40x100.png
186
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png
187
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-bg_highlight-hard_100_dddddd_1x100.png
188
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-bg_highlight-hard_100_eeeeee_1x100.png
189
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-bg_highlight-hard_40_f6a828_1x100.png
190
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-bg_highlight-soft_75_f1fbe5_1x100.png
191
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-icons_1c94c4_256x240.png
192
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-icons_222222_256x240.png
193
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-icons_8cce3b_256x240.png
194
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-icons_cd0a0a_256x240.png
195
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-icons_ef8c08_256x240.png
196
- - app/assets/stylesheets/whurl_engine/custom-theme/images/ui-icons_ffffff_256x240.png
197
- - app/assets/stylesheets/whurl_engine/custom-theme/jquery-ui-1.8.16.custom.css
197
+ - app/assets/stylesheets/whurl_engine/jquery-ui-1.8.16.custom.css
198
198
  - app/assets/stylesheets/whurl_engine/whurl.css.scss
199
199
  - app/controllers/whurl_engine/application_controller.rb
200
200
  - app/controllers/whurl_engine/categories_controller.rb
@@ -255,21 +255,22 @@ files:
255
255
  - config/initializers/nilclass.rb
256
256
  - config/initializers/string.rb
257
257
  - config/routes.rb
258
- - db/migrate/20110209054322_create_whurls_table.rb
259
- - db/migrate/20111210192724_add_description_to_whurl.rb
260
- - db/migrate/20111210201607_add_custom_url_to_whurl.rb
261
- - db/migrate/20111211030904_rename_whurls_to_requests.rb
262
- - db/migrate/20111220233800_create_fields_for_whurl_requests.rb
263
- - db/migrate/20111221011145_drop_data_from_requests.rb
264
- - db/migrate/20120106033416_create_responses.rb
265
- - db/migrate/20120106190508_create_categories_table.rb
266
- - db/migrate/20120107011500_create_resources_table.rb
267
- - db/migrate/20120107065652_create_parameters_table.rb
268
- - db/migrate/20120110205837_rename_parameters_to_parameter_definitions.rb
269
- - db/migrate/20120110205853_rename_requests_to_whurls.rb
270
- - db/migrate/20120111014928_add_raw_request_to_whurls.rb
271
- - db/migrate/20120118011913_create_header_definitions_table.rb
272
- - db/migrate/20120214074332_add_message_to_whurls.rb
258
+ - db/migrate/20110209054322_whurl_create_whurls_table.rb
259
+ - db/migrate/20111210192724_whurl_add_description_to_whurl.rb
260
+ - db/migrate/20111210201607_whurl_add_custom_url_to_whurl.rb
261
+ - db/migrate/20111211030904_whurl_rename_whurls_to_requests.rb
262
+ - db/migrate/20111220233800_whurl_create_fields_for_whurl_requests.rb
263
+ - db/migrate/20111221011145_whurl_drop_data_from_requests.rb
264
+ - db/migrate/20120106033416_whurl_create_responses.rb
265
+ - db/migrate/20120106190508_whurl_create_categories_table.rb
266
+ - db/migrate/20120107011500_whurl_create_resources_table.rb
267
+ - db/migrate/20120107065652_whurl_create_parameters_table.rb
268
+ - db/migrate/20120110205837_whurl_rename_parameters_to_parameter_definitions.rb
269
+ - db/migrate/20120110205853_whurl_rename_requests_to_whurls.rb
270
+ - db/migrate/20120111014928_whurl_add_raw_request_to_whurls.rb
271
+ - db/migrate/20120118011913_whurl_create_header_definitions_table.rb
272
+ - db/migrate/20120214074332_whurl_add_message_to_whurls.rb
273
+ - db/migrate/20120221012000_whurl_add_basic_auth_fields.rb
273
274
  - lib/tasks/whurl_engine_tasks.rake
274
275
  - lib/whurl_engine/config.rb
275
276
  - lib/whurl_engine/engine.rb