alert_message 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c8f1a3901bf6a349ebd7a66dd0d079a444da6147
4
+ data.tar.gz: c27a912df58cc708ca911ab828f2525415da888a
5
+ SHA512:
6
+ metadata.gz: d4c579bda39d584af49f514643a69b1d365508bc847276c0fc9f1c134c37eaa9b502954206266ad75a1a43243b462e2c043fbfc47af58b58f0488388ee3b3453
7
+ data.tar.gz: faa323385eac7a721328c07fba973ba6faf12eba2937b61fe6778fb07097c26cf991b5808113360b37e80e2feb6cf50defce2df3252fb85fdc9359d50ae0e7db
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'jquery-rails'
4
+ gem 'sass-rails'
5
+
6
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Luiz Picolo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Alert Message
2
+
3
+ This is a simple gem for alerts messages.
4
+
5
+ ## Installation
6
+
7
+ Add to your Gemfile:
8
+
9
+ gem 'alert_message'
10
+
11
+ Then run:
12
+
13
+ $ bundle install
14
+
15
+ Run install script:
16
+
17
+ $ rails g alert_message:install
18
+
19
+ ## How to use
20
+
21
+ Add to *application.html.erb*
22
+
23
+ <%= render "layouts/alerts" %>
24
+
25
+ To show your alerts, use:
26
+
27
+ flash[:error] = "YOUR MESSAGE"
28
+ flash[:notice] = "YOUR MESSAGE"
29
+ flash[:success] = "YOUR MESSAGE"
30
+
31
+ ## Contributors
32
+
33
+ Welcome to contribute
34
+
35
+ ## License
36
+
37
+ MIT License. Copyright 2014 Luiz Picolo. http://www.luizpicolo.com.br
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ # Maintain your gem's version:
6
+ require 'version/version'
7
+
8
+ Gem::Specification.new do |s|
9
+ s.name = "alert_message"
10
+ s.version = AlertMessage::Version::VERSION
11
+ s.authors = ["Luiz Picolo"]
12
+ s.email = ["luizpicolo@gmail.com"]
13
+ s.summary = "Alert Message"
14
+ s.description = "Simple gem for alerts messages"
15
+ s.homepage = "https://github.com/luizpicolo/alert_message"
16
+ s.license = "MIT"
17
+
18
+ s.files = `git ls-files -z`.split("\x0")
19
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ s.test_files = s.files.grep(%r{^(test|s|features)/})
21
+ s.require_paths = ["lib"]
22
+
23
+ s.add_development_dependency "bundler", "~> 1.6"
24
+ s.add_development_dependency "rake"
25
+ end
@@ -0,0 +1,13 @@
1
+ // alerts
2
+
3
+ $(document).ready(function(){
4
+ var alerts = $('.alert');
5
+
6
+ setTimeout(function(){
7
+ alerts.fadeOut(400);
8
+ }, 3000);
9
+
10
+ alerts.on('click', function(){
11
+ alerts.fadeOut(400);
12
+ });
13
+ })
@@ -0,0 +1,57 @@
1
+ // alert
2
+ $text-1: #FFFFFF; // branco
3
+ $alert-success: #27ae60; // verde
4
+ $alert-danger: #e74c3c; // vermelho
5
+ $alert-notice: #2980b9; // azul
6
+
7
+ // box sizing
8
+ @mixin box-sizing($boxmodel){
9
+ -webkit-box-sizing: $boxmodel;
10
+ -moz-box-sizing: $boxmodel;
11
+ box-sizing: $boxmodel;
12
+ }
13
+
14
+ .alert {
15
+ cursor: pointer;
16
+ @include box-sizing(border-box);
17
+
18
+ position: absolute;
19
+
20
+ width: 100%;
21
+
22
+ color: $text-1;
23
+ font-size: 1.4em;
24
+ text-align: center;
25
+
26
+ padding: 10px;
27
+
28
+ .close {
29
+ outline: none;
30
+ @include box-sizing(border-box);
31
+
32
+ position: absolute;
33
+ top: 0;
34
+ right: 0;
35
+
36
+ width: 42px;
37
+ height: 42px;
38
+ line-height: 42px;
39
+
40
+ font-size: 1.4em;
41
+
42
+ border: 0;
43
+ background: none;
44
+ }
45
+ }
46
+
47
+ .alert-success {
48
+ background: $alert-success;
49
+ }
50
+
51
+ .alert-danger {
52
+ background: $alert-danger;
53
+ }
54
+
55
+ .alert-notice {
56
+ background: $alert-success;
57
+ }
@@ -0,0 +1,3 @@
1
+ module AlertMessage
2
+ # Your code goes here...
3
+ end
@@ -0,0 +1,11 @@
1
+ module AlertMessage
2
+ class InstallGenerator < Rails::Generators::Base
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ def copy_gfiles_alert
6
+ copy_file "alerts.js", "app/assets/javascripts/alerts.js"
7
+ copy_file "alerts.css.scss", "app/assets/stylesheets/alerts.css.scss"
8
+ copy_file "_alerts.html.erb", "app/views/layouts/_alerts.html.erb"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ <% flash.each do |key, value| %>
2
+ <%
3
+ if key != 'success' && key != 'danger' && key != 'notice'
4
+ key = 'danger'
5
+ end
6
+ %>
7
+ <div class="alert alert-<%= key %>">
8
+ <button type="button" class="close">&times;</button>
9
+ <%= value.html_safe %>
10
+ </div>
11
+ <% end %>
@@ -0,0 +1,5 @@
1
+ module AlertMessage
2
+ module Version
3
+ VERSION = '1.0.0'
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: alert_message
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Luiz Picolo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Simple gem for alerts messages
42
+ email:
43
+ - luizpicolo@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE
51
+ - README.md
52
+ - Rakefile
53
+ - alert_message.gemspec
54
+ - app/assets/javascripts/alert_message/alerts.js
55
+ - app/assets/stylesheets/alert_message/alerts.css.scss
56
+ - lib/alert_message.rb
57
+ - lib/generators/alert_message/install_generator.rb
58
+ - lib/generators/alert_message/templates/_alerts.html.erb
59
+ - lib/version/version.rb
60
+ homepage: https://github.com/luizpicolo/alert_message
61
+ licenses:
62
+ - MIT
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.2.2
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: Alert Message
84
+ test_files: []