rails_info 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -11,41 +11,21 @@ There will be a configuration option for deactivating syntax highlighting soon f
11
11
 
12
12
  Tested on MacOS with: Rails 3.1 & Ruby 1.9.2, Rails 3.2.6 & Ruby 1.9.3.
13
13
 
14
+ <img src="http://img207.imageshack.us/img207/8505/railsinfonavigation001.png"/>
15
+
14
16
  == Installation
15
17
 
16
18
  In <b>Rails 3</b>, add this under your development group to the Gemfile of your Rails 3 application and run the +bundle+ command.
17
19
 
18
20
  gem "rails_info"
21
+
22
+ OPTIONAL: users of catch-all-routes like match '*not_found' => 'errors#404' have to add the following line before this catch-all-route:
19
23
 
20
- == Getting Started
21
-
22
- === 1) Request the Web interface
23
-
24
- Just start your Rails 3 application server and request the following page in your browser.
25
-
26
- http://localhost:3001/rails/info
27
-
28
- === 2) Custom Exception Stack Trace View
29
-
30
- Add the following line at the top of your ApplicationController to replace the standard stack trace view by a customized version which displays the code snippet for each file of the stack trace inline:
31
-
32
- include RailsInfo::Controller::ExceptionDiagnostics
33
-
34
- Consider those sporadic Ruby segmentation faults mentioned above when you include this line ;-)
35
-
36
- === 3) RSpec Log
37
-
38
- Write the result of an rspec command to log/rspec.log
39
-
40
- bundle exec rspec spec/whatever_you_want > log/rspec.log
41
-
42
- Run your rails development server if not already started and request the following page:
43
-
44
- http://localhost:3000/rails/info/logs/test/rspec
24
+ mount_rails_info if Rails.env.development?
45
25
 
46
26
  == Wiki Docs
47
27
 
48
- * TODO
28
+ * {Modules}[https://github.com/Applicat/rails_info/wiki/modules]
49
29
 
50
30
  == Contribution
51
31
 
@@ -0,0 +1,11 @@
1
+ module RailsInfo::ApplicationHelper
2
+ def rails_info_stylesheet
3
+ if controller.send(:_layout) == 'rails_info'
4
+ 'rails_info/application'
5
+ elsif controller.send(:_layout).is_a?(String) && controller.send(:_layout).match('rails_info')
6
+ controller.send(:_layout)
7
+ else
8
+ 'rails_info/exception'
9
+ end
10
+ end
11
+ end
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Rails Info</title>
5
- <%= stylesheet_link_tag controller.send(:_layout) == 'rails_info' ? 'rails_info/application' : controller.send(:_layout), media: 'all' %>
5
+ <%= stylesheet_link_tag rails_info_stylesheet, media: 'all' %>
6
6
  <%= javascript_include_tag 'rails_info/application' %>
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
@@ -8,8 +8,8 @@
8
8
  <tbody>
9
9
  <% request.env['action_dispatch.routes'].routes.each do |route| %>
10
10
  <tr>
11
- <td><%= route.verb.source.gsub(/[$^]/, '') %></td>
12
- <td><%= route.path.respond_to?('spec') ? route.path.spec.to_s : route.path %></td>
11
+ <td><%= (route.verb.respond_to?(:source) ? route.verb.source : route.verb).gsub(/[$^]/, '') %></td>
12
+ <td><%= route.path.respond_to?(:source) ? route.path.spec.to_s : route.path %></td>
13
13
  <td><%= route.name %></td>
14
14
  <td><%= route.requirements.inspect %></td>
15
15
  </tr>
data/config/routes.rb CHANGED
@@ -1,20 +1,3 @@
1
1
  Rails.application.routes.draw do
2
- get '/rails/info' => 'rails_info/properties#index', as: 'rails_info'
3
-
4
- get '/rails/info/properties', to: 'rails_info/properties#index', as: 'rails_info_properties'
5
- get '/rails/info/routes', to: 'rails_info/routes#index', as: 'rails_info_routes'
6
-
7
- get '/rails/info/model', to: 'rails_info/model#index', as: 'rails_info_model'
8
-
9
- get '/rails/info/data', to: 'rails_info/data#index', as: 'rails_info_data', as: 'rails_info_data'
10
- post '/rails/info/data/update_multiple', to: 'rails_info/data#update_multiple', as: 'update_multiple_rails_info_data'
11
-
12
- get '/rails/info/logs/server' => 'rails_info/logs/server#new', as: 'new_rails_info_server_log'
13
- put '/rails/info/logs/server' => 'rails_info/logs/server#update', as: 'rails_info_server_log'
14
-
15
- get '/rails/info/logs/test/rspec' => 'rails_info/logs/test/rspec#new', as: 'new_rails_info_rspec_log'
16
- put '/rails/info/logs/test/rspec' => 'rails_info/logs/test/rspec#update', as: 'rails_info_rspec_log'
17
-
18
- get '/rails/info/stack_traces/new' => 'rails_info/stack_traces#new', as: 'new_rails_info_stack_trace'
19
- post '/rails/info/stack_traces' => 'rails_info/stack_traces#create', as: 'rails_info_stack_trace'
2
+ mount_rails_info
20
3
  end
data/lib/rails_info.rb CHANGED
@@ -2,9 +2,11 @@
2
2
  require 'jquery-rails'
3
3
  require 'jquery-ui-rails'
4
4
  require 'pygments'
5
+ require 'twitter-bootstrap-rails'
5
6
  require 'simple-navigation-bootstrap'
6
7
 
7
8
  require 'rails_info/engine'
9
+ require 'rails_info/routing'
8
10
  require 'rails_info/controller'
9
11
  require 'rails_info/controller/exception_diagnostics'
10
12
  require 'rails_info/model'
@@ -65,14 +65,6 @@ class RailsInfo::Logs::Test::Rspec
65
65
  end
66
66
 
67
67
  after_stack_trace_entry, stack_trace = nil, []
68
-
69
- # 1) Community::CronJobs::Statistics.total_feedbacks_one_hour_ago principally works
70
-
71
- =begin
72
- line = line.split(')').second.strip.split(' ')
73
- line.shift
74
- example = line.join(' ') # principally works
75
- =end
76
68
 
77
69
  example = line.split(')').second.strip
78
70
 
@@ -0,0 +1,27 @@
1
+ module ActionDispatch::Routing
2
+ class Mapper
3
+ # Includes mount_sextant method for routes. This method is responsible to
4
+ # generate all needed routes for sextant
5
+ def mount_rails_info
6
+ match '/rails/info' => 'rails_info/properties#index', via: :get, via: :get, as: 'rails_info'
7
+
8
+ match '/rails/info/properties' => 'rails_info/properties#index', via: :get, via: :get, as: 'rails_info_properties'
9
+ match '/rails/info/routes' => 'rails_info/routes#index', via: :get, as: 'rails_info_routes'
10
+
11
+ match '/rails/info/model' => 'rails_info/model#index', via: :get, as: 'rails_info_model'
12
+
13
+ match '/rails/info/data' => 'rails_info/data#index', via: :get, as: 'rails_info_data', via: :get, as: 'rails_info_data'
14
+ post '/rails/info/data/update_multiple' => 'rails_info/data#update_multiple', via: :post, as: 'rails_update_multiple_rails_info_data'
15
+
16
+ match '/rails/info/logs/server' => 'rails_info/logs/server#new', via: :get, as: 'new_rails_info_server_log'
17
+ put '/rails/info/logs/server' => 'rails_info/logs/server#update', via: :put, as: 'rails_info_server_log'
18
+
19
+ match '/rails/info/logs/test/rspec' => 'rails_info/logs/test/rspec#new', via: :get, as: 'new_rails_info_rspec_log'
20
+ put '/rails/info/logs/test/rspec' => 'rails_info/logs/test/rspec#update', via: :put, as: 'rails_info_rspec_log'
21
+
22
+ match '/rails/info/stack_traces/new' => 'rails_info/stack_traces#new', via: :get, as: 'new_rails_info_stack_trace'
23
+ post '/rails/info/stack_traces' => 'rails_info/stack_traces#create', via: :post, as: 'rails_info_stack_trace'
24
+ end
25
+ end
26
+ end
27
+
@@ -1,3 +1,3 @@
1
1
  module RailsInfo
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-03 00:00:00.000000000 Z
12
+ date: 2012-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70129925875360 !ruby/object:Gem::Requirement
16
+ requirement: &70105709058400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 3.2.6
21
+ version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70129925875360
24
+ version_requirements: *70105709058400
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: coffee-script
27
- requirement: &70129925874920 !ruby/object:Gem::Requirement
27
+ requirement: &70105709057980 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70129925874920
35
+ version_requirements: *70105709057980
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: uglifier
38
- requirement: &70129925874460 !ruby/object:Gem::Requirement
38
+ requirement: &70105709057500 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70129925874460
46
+ version_requirements: *70105709057500
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jquery-rails
49
- requirement: &70129925874020 !ruby/object:Gem::Requirement
49
+ requirement: &70105709057080 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70129925874020
57
+ version_requirements: *70105709057080
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jquery-ui-rails
60
- requirement: &70129925873600 !ruby/object:Gem::Requirement
60
+ requirement: &70105709056660 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70129925873600
68
+ version_requirements: *70105709056660
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pygments.rb
71
- requirement: &70129925873180 !ruby/object:Gem::Requirement
71
+ requirement: &70105709056240 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70129925873180
79
+ version_requirements: *70105709056240
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: twitter-bootstrap-rails
82
- requirement: &70129925872760 !ruby/object:Gem::Requirement
82
+ requirement: &70105709055800 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70129925872760
90
+ version_requirements: *70105709055800
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: simple-navigation-bootstrap
93
- requirement: &70129925872340 !ruby/object:Gem::Requirement
93
+ requirement: &70105709055380 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70129925872340
101
+ version_requirements: *70105709055380
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: mysql2
104
- requirement: &70129925871900 !ruby/object:Gem::Requirement
104
+ requirement: &70105709054840 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70129925871900
112
+ version_requirements: *70105709054840
113
113
  description: Engine for a rails application which extends /rails/info about some information
114
114
  resources in development environment.
115
115
  email:
@@ -135,6 +135,7 @@ files:
135
135
  - app/controllers/rails_info/routes_controller.rb
136
136
  - app/controllers/rails_info/stack_traces_controller.rb
137
137
  - app/controllers/rails_info_controller.rb
138
+ - app/helpers/rails_info/application_helper.rb
138
139
  - app/helpers/rails_info/resources_helper.rb
139
140
  - app/presenters/rails_info/code_presenter.rb
140
141
  - app/presenters/rails_info/data/object_presenter.rb
@@ -173,6 +174,7 @@ files:
173
174
  - lib/rails_info/logs/test.rb
174
175
  - lib/rails_info/logs.rb
175
176
  - lib/rails_info/model.rb
177
+ - lib/rails_info/routing.rb
176
178
  - lib/rails_info/stack_trace.rb
177
179
  - lib/rails_info/version.rb
178
180
  - lib/rails_info.rb
@@ -210,7 +212,7 @@ files:
210
212
  - spec/dummy/Rakefile
211
213
  - spec/dummy/README.rdoc
212
214
  - spec/dummy/script/rails
213
- homepage: http://Murd.ch
215
+ homepage: http://applicat.github.com/rails_info
214
216
  licenses: []
215
217
  post_install_message:
216
218
  rdoc_options: []
@@ -224,7 +226,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
224
226
  version: '0'
225
227
  segments:
226
228
  - 0
227
- hash: -2149159514130258787
229
+ hash: -3659071187917234569
228
230
  required_rubygems_version: !ruby/object:Gem::Requirement
229
231
  none: false
230
232
  requirements:
@@ -233,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
235
  version: '0'
234
236
  segments:
235
237
  - 0
236
- hash: -2149159514130258787
238
+ hash: -3659071187917234569
237
239
  requirements: []
238
240
  rubyforge_project:
239
241
  rubygems_version: 1.8.17