damnson 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79efeb048f0fb2d6167ba8238e95cfb817929088
4
- data.tar.gz: 18e51e792b18a97c6896ac92a518c742f6f4741a
3
+ metadata.gz: 7e8338d985b931ec4ff0e365221f7a9948802977
4
+ data.tar.gz: e30bba7fed7f6c19e6eecc9b65eb08aace06f5af
5
5
  SHA512:
6
- metadata.gz: a20578577511a931d8664d36f3d44567ca873695c95e0cfad25b72a2d4691fbee3e8ca2fa24f525deb568aa850307b7bce836bfa5874b4313d884e0fe6e1443c
7
- data.tar.gz: ca7aedcfcf55e941df537fd8b9ee6d1938e12841aedb18268e4db09038707e559e691631624143abd72064471dc7940535b696202db4363598ffb527e8bd1b23
6
+ metadata.gz: 44c27ed0e568ebc2efb5988e95d99a4dccbe5be4f5edb5629b364b9222fed55666afe3beb22fb2a0a4354fbe6d1d1eae82d0ee6675ac68d515a6841bf990a1b8
7
+ data.tar.gz: 48fa4bdb3add3f00663b373ca9dd88bf55826c22d90f380dc8093fb27b4f4b8d4939d4888e7871276f8ae875cf367fd56d287a5ffe2873587db092df15f28c12
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Damnson
2
+
3
+ This gem provides your rails app a floating control panel for your non-production environments.
4
+
2
5
  ## Installation
3
6
 
4
7
  Add this line to your application's Gemfile:
@@ -17,7 +20,53 @@ Or install it yourself as:
17
20
 
18
21
  ## Usage
19
22
 
20
- TODO: Write usage instructions here
23
+ Create a controller for your actions
24
+
25
+ ```ruby
26
+ # panel_controller.rb
27
+
28
+ class PanelController < ApplicationController
29
+ unless Rails.env.production?
30
+ def do_some_stuff
31
+ # Code here
32
+ redirect_to :back
33
+ end
34
+ end
35
+ end
36
+
37
+ ```
38
+
39
+ Create the associated routes wrapped in non-production condition
40
+
41
+ ```ruby
42
+ # routes.rb
43
+
44
+ unless Rails.env.production?
45
+ get 'panel/awesome', to: 'panel#do_some_stuff', as: :damnson
46
+ end
47
+
48
+ ```
49
+
50
+ Call damnson with the actions required
51
+
52
+ ```ruby
53
+ # _javascript.html.erb
54
+
55
+ <% unless Rails.env.production? %>
56
+ <%
57
+ ds_opts = {}
58
+ ds_opts[:items] = [
59
+ { label: 'Create some projects', path: damnson_path },
60
+ { label: 'Add random contributions', path: damnson_path },
61
+ { label: 'Delete everything', path: damnson_path },
62
+ { label: 'Add random data', path: damnson_path }
63
+ ]
64
+ %>
65
+ <%= javascript_tag do %>
66
+ damnson(<%= raw ds_opts.to_json %>)
67
+ <% end %>
68
+ <% end %>
69
+ ```
21
70
 
22
71
  ## Development
23
72
 
@@ -22,4 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "bundler", "~> 1.11"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
24
  spec.add_development_dependency "rspec", "~> 3.0"
25
+ spec.add_development_dependency "sass-rails"
26
+ spec.add_development_dependency "coffee-rails"
25
27
  end
@@ -1,3 +1,3 @@
1
1
  module Damnson
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -0,0 +1,9 @@
1
+ @damnson = (opts) ->
2
+ elemHtml = ''
3
+
4
+ for control in opts['items']
5
+ label = control['label']
6
+ path = control['path']
7
+ elemHtml = elemHtml + "<div class=\"ds-control\"><a class=\"ds-link\" href=\"#{path}\">#{label}</a></div>"
8
+
9
+ $("body").prepend("<div class=\"damnson-panel\"><div class=\"indicator\"></div> #{elemHtml} </div>")
@@ -0,0 +1,57 @@
1
+ @keyframes fading-ds {
2
+ 0% { border-left: 10px solid #33ff99; }
3
+ 33% { border-left: 10px solid #55bbff; }
4
+ 66% { border-left: 10px solid #da7aff; }
5
+ 100% { border-left: 10px solid #22ffd4; }
6
+ }
7
+
8
+ @-webkit-keyframes fading-ds {
9
+ 0% { border-left: 10px solid #33ff99; }
10
+ 33% { border-left: 10px solid #55bbff; }
11
+ 66% { border-left: 10px solid #da7aff; }
12
+ 100% { border-left: 10px solid #22ffd4; }
13
+ }
14
+
15
+ .damnson-panel {
16
+ z-index: 500;
17
+ position: fixed;
18
+ top: 0;
19
+ left: -250px;
20
+ background-color: lightcyan;
21
+ width: 250px;
22
+ -webkit-transition: all 0.5s ease-in-out;
23
+ transition: all 0.5s ease-in-out;
24
+ border: 2px solid grey;
25
+ border-top: none;
26
+ border-left: none;
27
+ border-radius: 0 0 5px 0;
28
+
29
+ .indicator {
30
+ position: absolute;
31
+ right: -15px;
32
+ top: 30%;
33
+ width: 15px;
34
+ height: 15px;
35
+ animation: fading-ds 30s infinite;
36
+ -webkit-animation: fading-ds 30s infinite;
37
+ border-top: 10px solid transparent;
38
+ border-bottom: 10px solid transparent;
39
+ }
40
+
41
+ &:hover {
42
+ top: 0;
43
+ left: 0;
44
+ }
45
+
46
+ .ds-control {
47
+ text-align: center;
48
+ border-bottom: 1px solid lightgrey;
49
+ border-top: 1px solid lightgrey;
50
+
51
+ .ds-link {
52
+ font-weight: bold;
53
+ color: #333333;
54
+ line-height: 40px;
55
+ }
56
+ }
57
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: damnson
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Terry Raimondo
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sass-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coffee-rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  description: This gem adds a customizable control panel with data controls, you can
56
84
  add / delete / customize your data just by interacting with this panel.
57
85
  email:
@@ -73,6 +101,8 @@ files:
73
101
  - damnson.gemspec
74
102
  - lib/damnson.rb
75
103
  - lib/damnson/version.rb
104
+ - vendor/assets/javascripts/damnson.js.coffee
105
+ - vendor/assets/stylesheets/damnson.scss
76
106
  homepage: https://github.com/terry90/damnson
77
107
  licenses:
78
108
  - MIT