controller_action_hud 0.0.1
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.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/MIT-LICENSE +20 -0
- data/README.md +20 -0
- data/Rakefile +44 -0
- data/controller_action_hud.gemspec +21 -0
- data/lib/controller_action_hud.rb +1 -0
- data/lib/controller_action_hud/version.rb +3 -0
- data/lib/controller_action_hud/widget.rb +44 -0
- metadata +52 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 51bf6dc9451673ef76349d4eff4e4235d576140e
|
4
|
+
data.tar.gz: bd9e3ddaaab8e7cbd32a37ee2818550e04d62d52
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7a29a4c85baa232602bfb945b3c6c3d72f5c8af932fd02ee1ff27d159c1b064dd34615004ff1b12a2fbafe62947b2e3fc2b47ec1b8e482e77285965419670b30
|
7
|
+
data.tar.gz: 38879b96d950f086690566d033861d277074ceb09533965eef113668222a2884d0cc1cb40771058bf3103f79f1cc68e174c8b4bb3edbea265ddaf5f554ef68f7
|
data/.gitignore
ADDED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Henning Koch
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Controller & Action HUD
|
2
|
+
|
3
|
+
### Installation
|
4
|
+
|
5
|
+
Add it to your Gemfile with
|
6
|
+
```
|
7
|
+
gem 'controller_action_hud', git: 'git://github.com/daveallie/controller_action_hud.git'
|
8
|
+
```
|
9
|
+
|
10
|
+
Now add the widget to your application layout, like
|
11
|
+
```
|
12
|
+
# app/views/layout/application.html.erb
|
13
|
+
# ...
|
14
|
+
<body>
|
15
|
+
<%= controller_action_hud_widget if Rails.env.development? %>
|
16
|
+
<%= yield %>
|
17
|
+
</body>
|
18
|
+
```
|
19
|
+
|
20
|
+
It's recommended you only use the gem with the development environment.
|
data/Rakefile
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
|
4
|
+
desc 'Default: Run all specs.'
|
5
|
+
task :default => 'all:spec'
|
6
|
+
|
7
|
+
namespace :all do
|
8
|
+
|
9
|
+
desc "Run specs on all spec apps"
|
10
|
+
task :spec do
|
11
|
+
for_each_directory_of('spec/**/Rakefile') do |directory|
|
12
|
+
env = "SPEC=../../#{ENV['SPEC']} " if ENV['SPEC']
|
13
|
+
system("cd #{directory} && #{env} bundle exec rake spec")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
namespace :bundle do
|
18
|
+
|
19
|
+
desc "Bundle all spec apps"
|
20
|
+
task :install do
|
21
|
+
for_each_directory_of('spec/**/Gemfile') do |directory|
|
22
|
+
system("cd #{directory} && bundle install")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
desc "Update a gem given by the GEM environment variable"
|
27
|
+
task :update do
|
28
|
+
gem = ENV['GEM'] or raise "Name the gem you wish to update by setting a environment variable GEM"
|
29
|
+
for_each_directory_of('spec/**/Gemfile') do |directory|
|
30
|
+
system("cd #{directory} && bundle update #{gem}")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
def for_each_directory_of(path, &block)
|
39
|
+
Dir[path].sort.each do |rakefile|
|
40
|
+
directory = File.dirname(rakefile)
|
41
|
+
puts '', "\033[44m#{directory}\033[0m", ''
|
42
|
+
block.call(directory)
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$: << File.expand_path('../lib', __FILE__)
|
3
|
+
require 'controller_action_hud/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.authors = "Dave Allie"
|
7
|
+
gem.email = "dave@daveallie.com"
|
8
|
+
gem.description = "HUD to show current controller and action"
|
9
|
+
gem.summary = gem.description
|
10
|
+
gem.homepage = "https://github.com/daveallie/controller_action_hud"
|
11
|
+
gem.license = 'MIT'
|
12
|
+
|
13
|
+
gem.files = `git ls-files`.split($\)
|
14
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
15
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
|
+
gem.name = "controller_action_hud"
|
17
|
+
gem.require_paths = ["lib"]
|
18
|
+
gem.version = ControllerActionHUD::VERSION
|
19
|
+
|
20
|
+
gem.post_install_message = "Remember to put <%= controller_action_hud_widget if Rails.env.development? %> into your app layout."
|
21
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'controller_action_hud/widget'
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module ControllerActionHUD
|
2
|
+
module Widget
|
3
|
+
class << self
|
4
|
+
|
5
|
+
def css
|
6
|
+
<<-EOF
|
7
|
+
<style type="text/css">
|
8
|
+
div#controller_action_hud {
|
9
|
+
position: fixed;
|
10
|
+
bottom: 0;
|
11
|
+
right: 0;
|
12
|
+
background-color: black;
|
13
|
+
color: white;
|
14
|
+
z-index: 999;
|
15
|
+
padding: 4px 6px;
|
16
|
+
font: normal bold 12px/12px Arial, sans-serif;
|
17
|
+
cursor: pointer;
|
18
|
+
}
|
19
|
+
</style>
|
20
|
+
EOF
|
21
|
+
end
|
22
|
+
|
23
|
+
def html(controller_name, action_name)
|
24
|
+
<<-EOF
|
25
|
+
<div id="controller_action_hud" onclick="this.parentNode.removeChild(this);">
|
26
|
+
#{controller_name}##{action_name}
|
27
|
+
</div>
|
28
|
+
EOF
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
module Helper
|
34
|
+
def controller_action_hud_widget
|
35
|
+
html = Widget.css + Widget.html(params[:controller], params[:action])
|
36
|
+
html.respond_to?(:html_safe) ? html.html_safe : html
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
ActionView::Base.send :include, ControllerActionHUD::Widget::Helper
|
metadata
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: controller_action_hud
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dave Allie
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-03 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: HUD to show current controller and action
|
14
|
+
email: dave@daveallie.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- ".gitignore"
|
20
|
+
- MIT-LICENSE
|
21
|
+
- README.md
|
22
|
+
- Rakefile
|
23
|
+
- controller_action_hud.gemspec
|
24
|
+
- lib/controller_action_hud.rb
|
25
|
+
- lib/controller_action_hud/version.rb
|
26
|
+
- lib/controller_action_hud/widget.rb
|
27
|
+
homepage: https://github.com/daveallie/controller_action_hud
|
28
|
+
licenses:
|
29
|
+
- MIT
|
30
|
+
metadata: {}
|
31
|
+
post_install_message: Remember to put <%= controller_action_hud_widget if Rails.env.development?
|
32
|
+
%> into your app layout.
|
33
|
+
rdoc_options: []
|
34
|
+
require_paths:
|
35
|
+
- lib
|
36
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
requirements: []
|
47
|
+
rubyforge_project:
|
48
|
+
rubygems_version: 2.4.5.1
|
49
|
+
signing_key:
|
50
|
+
specification_version: 4
|
51
|
+
summary: HUD to show current controller and action
|
52
|
+
test_files: []
|