mafia 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mafia.rb +36 -3
- data/lib/mafia/templates/app.rb.tt +1 -0
- data/lib/version.rb +1 -1
- metadata +3 -3
data/lib/mafia.rb
CHANGED
@@ -62,8 +62,16 @@ module Mafia
|
|
62
62
|
empty_directory("#{name}/lib/#{name}/lib")
|
63
63
|
end
|
64
64
|
|
65
|
+
def include_helpers
|
66
|
+
if yes? "\n\nInstall georgedrummond_sinatra_helpers gem into app?", :yellow
|
67
|
+
insert_into_file "#{name}/#{name}.gemspec", " s.add_dependency \"georgedrummond_sinatra_helpers\"\n", :after => "s.add_dependency \"sass\"\n"
|
68
|
+
insert_into_file "#{name}/lib/#{name}/app.rb", " include GeorgeDrummond::Sinatra::Helpers\n", :after => "class Application < Sinatra::Base\n"
|
69
|
+
insert_into_file "#{name}/lib/#{name}/app.rb", "require \"georgedrummond_sinatra_helpers\"\n", :after => "require \"sass\"\n"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
65
73
|
def create_license
|
66
|
-
if yes? "
|
74
|
+
if yes? "\n\nUse MIT License?", :yellow
|
67
75
|
|
68
76
|
opts = {
|
69
77
|
:name => name,
|
@@ -75,10 +83,35 @@ module Mafia
|
|
75
83
|
end
|
76
84
|
end
|
77
85
|
|
86
|
+
def run_bundle_command
|
87
|
+
target = File.join(Dir.pwd, name)
|
88
|
+
say "\n\nRunning Bundler", :yellow
|
89
|
+
Dir.chdir(target) {
|
90
|
+
run "bundle install", :verbose => false
|
91
|
+
}
|
92
|
+
end
|
93
|
+
|
78
94
|
def initalize_git_repo
|
79
95
|
target = File.join(Dir.pwd, name)
|
80
|
-
say "
|
81
|
-
Dir.chdir(target) {
|
96
|
+
say "\n\nInitializating git repo in #{target}", :yellow
|
97
|
+
Dir.chdir(target) {
|
98
|
+
run "git init", :verbose => false
|
99
|
+
run "git add .", :verbose => false
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
def show_complete_message
|
104
|
+
complete = <<-COMPLETE
|
105
|
+
|
106
|
+
|
107
|
+
Sinatra gem has been generated
|
108
|
+
|
109
|
+
For help using sinatra please visit www.sinatrarb.com
|
110
|
+
|
111
|
+
COMPLETE
|
112
|
+
|
113
|
+
say complete, :red
|
114
|
+
|
82
115
|
end
|
83
116
|
end
|
84
117
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mafia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- George Drummond
|