mafia 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -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? "Use MIT License?"
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 "Initializating git repo in #{target}"
81
- Dir.chdir(target) { `git init`; `git add .` }
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
@@ -4,6 +4,7 @@ require "sass"
4
4
 
5
5
  module <%= camelize(name) %>
6
6
  class Application < Sinatra::Base
7
+
7
8
  set :public_folder, File.join(File.dirname(__FILE__), 'public')
8
9
  set :views, File.join(File.dirname(__FILE__), 'views')
9
10
 
@@ -1,3 +1,3 @@
1
1
  module Mafia
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - George Drummond