template 1.4.0 → 2.0.0
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.
- data/VERSION +1 -1
- data/lib/generators/template/install_generator.rb +5 -8
- data/template.gemspec +1 -1
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0
|
@@ -1,13 +1,11 @@
|
|
1
|
+
require 'rake'
|
1
2
|
require 'rails/generators'
|
2
|
-
require 'Rake' #need rake to be able to execute shell commands
|
3
3
|
module Template
|
4
|
-
#kudos to Mike Farmer from stackoverflow http://stackoverflow.com/users/4082/mike-farmer
|
5
4
|
class InstallGenerator < Rails::Generators::Base
|
6
|
-
desc "
|
5
|
+
desc "Installs some simple files needed for a rails 3 app"
|
7
6
|
|
8
|
-
# Add some extra options here:
|
9
7
|
# Commandline options can be defined here using Thor-like options:
|
10
|
-
|
8
|
+
class_option :my_opt, :type => :boolean, :default => false, :desc => "My Option"
|
11
9
|
|
12
10
|
# I can later access that option using:
|
13
11
|
# options[:my_opt]
|
@@ -17,6 +15,8 @@ module Template
|
|
17
15
|
@source_root ||= File.join(File.dirname(__FILE__), 'templates')
|
18
16
|
end
|
19
17
|
|
18
|
+
# Generator Code. Remember this is just suped-up Thor so methods are executed in order
|
19
|
+
|
20
20
|
def copy_template_files
|
21
21
|
copy_file 'app/controllers/welcome_controller.rb','app/controllers/welcome_controller.rb'
|
22
22
|
template 'app/views/layouts/application.html.erb'
|
@@ -60,8 +60,5 @@ module Template
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
63
|
end
|
67
64
|
end
|
data/template.gemspec
CHANGED
metadata
CHANGED