next_buses 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/next_buses/install_generator.rb +3 -33
- data/lib/next_buses/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5d299df5e332f68689a039149ef1ff672100e38
|
4
|
+
data.tar.gz: fc135e92a7fe19765957a6583b3abede5d2bb59d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 428c2348af0162465d548ea450f8803b758b415a88cb68f4022456c28e3222299632f431e5ca0f594303faad21030331738402331efec729c5dc6f0086936988
|
7
|
+
data.tar.gz: 2e84925b60fe872b273ce058dc3adc283742aa2a63e1757b8fd30f2110a96fcc13853afe74a10b32f605f623404cbd693aba5c200a7cfd0a1fe12dc70e324f26
|
@@ -1,40 +1,10 @@
|
|
1
|
-
module
|
1
|
+
module NextBuses
|
2
2
|
module Generators
|
3
3
|
class InstallGenerator < Rails::Generators::Base
|
4
|
-
desc "Copy SimpleForm default files"
|
5
4
|
source_root File.expand_path('../templates', __FILE__)
|
6
|
-
class_option :template_engine, desc: 'Template engine to be invoked (erb, haml or slim).'
|
7
|
-
class_option :bootstrap, type: :boolean, desc: 'Add the Twitter Bootstrap wrappers to the SimpleForm initializer.'
|
8
|
-
class_option :foundation, type: :boolean, desc: 'Add the Zurb Foundation 3 wrappers to the SimpleForm initializer.'
|
9
5
|
|
10
|
-
def
|
11
|
-
|
12
|
-
puts "SimpleForm 2 supports Twitter Bootstrap and Zurb Foundation 3. If you want "\
|
13
|
-
"a configuration that is compatible with one of these frameworks, then please " \
|
14
|
-
"re-run this generator with --bootstrap or --foundation as an option."
|
15
|
-
end
|
16
|
-
|
17
|
-
def copy_config
|
18
|
-
template "config/initializers/simple_form.rb"
|
19
|
-
|
20
|
-
if options[:bootstrap]
|
21
|
-
template "config/initializers/simple_form_bootstrap.rb"
|
22
|
-
elsif options[:foundation]
|
23
|
-
template "config/initializers/simple_form_foundation.rb"
|
24
|
-
end
|
25
|
-
|
26
|
-
directory 'config/locales'
|
27
|
-
end
|
28
|
-
|
29
|
-
def copy_scaffold_template
|
30
|
-
engine = options[:template_engine]
|
31
|
-
copy_file "_form.html.#{engine}", "lib/templates/#{engine}/scaffold/_form.html.#{engine}"
|
32
|
-
end
|
33
|
-
|
34
|
-
def show_readme
|
35
|
-
if behavior == :invoke && options.bootstrap?
|
36
|
-
readme "README"
|
37
|
-
end
|
6
|
+
def copy_initializer
|
7
|
+
copy_file 'next_buses.rb', 'config/initializers/next_buses.rb'
|
38
8
|
end
|
39
9
|
end
|
40
10
|
end
|
data/lib/next_buses/version.rb
CHANGED