mafia 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- end # Generator
78
- end # Rackgem
83
+ end
84
+ end
@@ -1,6 +1,6 @@
1
- # <%= name.capitalize %>
1
+ # <%= camelize(name) %>
2
2
 
3
- **<%= name.capitalize %>** is a [sinatra](http://www.sinatrarb.com) app/middleware that can be run standalone app or required as a gem.
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.capitalize %>
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')
@@ -1,3 +1,3 @@
1
1
  require './lib/<%= name %>/app.rb'
2
2
 
3
- run <%= name.capitalize %>::Application
3
+ run <%= camelize(name) %>::Application
@@ -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].capitalize %>::VERSION
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 = ""
@@ -1,3 +1,3 @@
1
- module <%= name.capitalize %>
1
+ module <%= camelize(name) %>
2
2
  VERSION = "0.0.1"
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module Mafia
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
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: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - George Drummond