mafia 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
data/lib/mafia.rb
CHANGED
@@ -2,8 +2,15 @@ require "version"
|
|
2
2
|
require "thor/group"
|
3
3
|
|
4
4
|
module Mafia
|
5
|
+
module Helpers
|
6
|
+
def camelize(string)
|
7
|
+
string.split(/[\W_]/).map {|c| c.capitalize}.join
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
5
11
|
class Generator < Thor::Group
|
6
12
|
include Thor::Actions
|
13
|
+
include Mafia::Helpers
|
7
14
|
|
8
15
|
argument :name
|
9
16
|
|
@@ -73,6 +80,5 @@ module Mafia
|
|
73
80
|
say "Initializating git repo in #{target}"
|
74
81
|
Dir.chdir(target) { `git init`; `git add .` }
|
75
82
|
end
|
76
|
-
|
77
|
-
|
78
|
-
end # Rackgem
|
83
|
+
end
|
84
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
# <%= name
|
1
|
+
# <%= camelize(name) %>
|
2
2
|
|
3
|
-
**<%= name
|
3
|
+
**<%= camelize(name) %>** is a [sinatra](http://www.sinatrarb.com) app/middleware that can be run standalone app or required as a gem.
|
4
4
|
|
5
5
|
## Running standalone
|
6
6
|
Simply run the ``bundle`` and then ``rackup`` commands.
|
@@ -2,7 +2,7 @@ require "sinatra"
|
|
2
2
|
require "haml"
|
3
3
|
require "sass"
|
4
4
|
|
5
|
-
module <%= name
|
5
|
+
module <%= camelize(name) %>
|
6
6
|
class Application < Sinatra::Base
|
7
7
|
set :public_folder, File.join(File.dirname(__FILE__), '<%= name %>', 'public')
|
8
8
|
set :views, File.join(File.dirname(__FILE__), '<%= name %>', 'views')
|
@@ -4,7 +4,7 @@ require "version"
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "<%= config[:name] %>"
|
7
|
-
s.version = <%= config[:name]
|
7
|
+
s.version = <%= camelize(config[:name]) %>::VERSION
|
8
8
|
s.authors = ["<%= config[:creator_name] %>"]
|
9
9
|
s.email = ["<%= config[:creator_email] %>"]
|
10
10
|
s.homepage = ""
|
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: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- George Drummond
|