teleporter 0.0.32 → 0.0.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/generators/initial/bootstrap.rb +2 -0
- data/lib/generators/initial/simple_form.rb +30 -0
- data/lib/generators/initial/templates/bootstrap/bootstrap_flash_helper.rb +26 -0
- data/lib/teleporter.rb +1 -0
- data/lib/teleporter/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4bda2b44ece6a95fdfb10ad26fc58faa8a28e5e
|
4
|
+
data.tar.gz: 81ded03d4eaea495e40733bb1d8643bbec67df72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9806def67a123f62e4ccf6649df904bdefdab18497b74402a378f4b1834a414d4ac301fe3e37182664ef48a197b0cd339886375a9868833d7855388508f86878
|
7
|
+
data.tar.gz: 5474b680b48532f4e021971c8bb2dfbc81e283fef5fff430bf16760f6469b6bf190980d59b561a025f1e312b8aabe20626196351df586ca8122912eb0f9503ff
|
data/README.md
CHANGED
@@ -14,6 +14,8 @@ module Initial
|
|
14
14
|
|
15
15
|
copy_file 'bootstrap/bootstrap-base.scss',
|
16
16
|
'app/assets/stylesheets/shared/bootstrap-base.scss'
|
17
|
+
copy_file 'bootstrap/bootstrap_flash_helper.rb',
|
18
|
+
'app/helpers/bootstrap_flash_helper.rb'
|
17
19
|
insert_into_file "app/assets/stylesheets/application.css",
|
18
20
|
"*= require shared/bootstrap-base\n",
|
19
21
|
after: "/*\n"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Initial
|
2
|
+
class SimpleFormGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path("../templates", __FILE__)
|
4
|
+
|
5
|
+
def add
|
6
|
+
gem 'simple_form'
|
7
|
+
|
8
|
+
Bundler.with_clean_env do
|
9
|
+
run "bundle install"
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
str = %q{
|
14
|
+
Install simple form (choose variant):
|
15
|
+
1. Basic
|
16
|
+
2. Bootstrap
|
17
|
+
3. Zurb
|
18
|
+
}
|
19
|
+
var = ask str, limited: ['1', '2', '3']
|
20
|
+
case var
|
21
|
+
when '1'
|
22
|
+
generate 'simple_form:install'
|
23
|
+
when '2'
|
24
|
+
generate 'simple_form:install --bootstrap'
|
25
|
+
when '3'
|
26
|
+
generate 'simple_form:install --foundation'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# = bootstrap_flash
|
2
|
+
module BootstrapFlashHelper
|
3
|
+
ALERT_TYPES = [:success, :info, :warning, :danger] unless const_defined?(:ALERT_TYPES)
|
4
|
+
|
5
|
+
def bootstrap_flash(options = {})
|
6
|
+
flash_messages = []
|
7
|
+
flash.each do |type, message|
|
8
|
+
# Skip empty messages, e.g. for devise messages set to nothing in a locale file.
|
9
|
+
next if message.blank?
|
10
|
+
|
11
|
+
type = type.to_sym
|
12
|
+
type = :success if type == :notice
|
13
|
+
type = :danger if type == :alert
|
14
|
+
type = :danger if type == :error
|
15
|
+
next unless ALERT_TYPES.include?(type)
|
16
|
+
|
17
|
+
Array(message).each do |msg|
|
18
|
+
text = content_tag(:div,
|
19
|
+
content_tag(:button, raw("×"), :class => "close", "data-dismiss" => "alert") +
|
20
|
+
msg, :class => "alert fade in alert-#{type} #{options[:class]}")
|
21
|
+
flash_messages << text if msg
|
22
|
+
end
|
23
|
+
end
|
24
|
+
flash_messages.join("\n").html_safe
|
25
|
+
end
|
26
|
+
end
|
data/lib/teleporter.rb
CHANGED
@@ -9,6 +9,7 @@ require "generators/initial/rspec"
|
|
9
9
|
require "generators/initial/welcome"
|
10
10
|
require "generators/initial/capistrano"
|
11
11
|
require "generators/initial/bootstrap"
|
12
|
+
require "generators/initial/simple_form"
|
12
13
|
require "generators/initial/devise"
|
13
14
|
require "generators/initial/devise_oauth"
|
14
15
|
require "generators/initial/gitignore"
|
data/lib/teleporter/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teleporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ponomarev Nikolay
|
@@ -74,8 +74,10 @@ files:
|
|
74
74
|
- lib/generators/initial/gemfile.rb
|
75
75
|
- lib/generators/initial/gitignore.rb
|
76
76
|
- lib/generators/initial/rspec.rb
|
77
|
+
- lib/generators/initial/simple_form.rb
|
77
78
|
- lib/generators/initial/start.rb
|
78
79
|
- lib/generators/initial/templates/bootstrap/bootstrap-base.scss
|
80
|
+
- lib/generators/initial/templates/bootstrap/bootstrap_flash_helper.rb
|
79
81
|
- lib/generators/initial/templates/capistrano/deploy/deploy.rb
|
80
82
|
- lib/generators/initial/templates/capistrano/deploy/production.rb
|
81
83
|
- lib/generators/initial/templates/capistrano/shared/application.yml.erb
|