mafia 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rackgem.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/mafia ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems' unless defined?(Gem) # Useful only on --dev mode
4
+ require 'bundler/setup' if %w(Gemfile .components).all? { |f| File.exist?(f) }
5
+
6
+ require 'mafia'
7
+
8
+ Mafia::Generator.start(ARGV)
data/lib/.DS_Store ADDED
Binary file
data/lib/mafia.rb ADDED
@@ -0,0 +1,53 @@
1
+ require "version"
2
+ require "thor/group"
3
+
4
+ module Mafia
5
+ class Generator < Thor::Group
6
+ include Thor::Actions
7
+
8
+ argument :name
9
+
10
+ def self.source_root
11
+ File.dirname(__FILE__)
12
+ end
13
+
14
+ def create_gemspec_file
15
+ template("mafia/templates/gemspec.tt", "#{name}/#{name}.gemspec")
16
+ end
17
+
18
+ def create_config_ru_file
19
+ template("mafia/templates/config.ru.tt", "#{name}/config.ru")
20
+ end
21
+
22
+ def create_version_file
23
+ template("mafia/templates/version.rb.tt", "#{name}/lib/version.rb")
24
+ end
25
+
26
+ def create_gem_file
27
+ template("mafia/templates/gem.rb.tt", "#{name}/lib/#{name}.rb")
28
+ end
29
+
30
+ def create_app_file
31
+ template("mafia/templates/app.rb.tt", "#{name}/lib/#{name}/app.rb")
32
+ end
33
+
34
+ def copy_rakefile
35
+ copy_file("mafia/templates/Rakefile", "#{name}/Rakefile")
36
+ end
37
+
38
+ def copy_gemfile
39
+ copy_file("mafia/templates/Gemfile", "#{name}/Gemfile")
40
+ end
41
+
42
+ def copy_readme
43
+ copy_file("mafia/templates/README", "#{name}/README")
44
+ end
45
+
46
+ def create_empty_files_and_directories
47
+ empty_directory("#{name}/lib/#{name}/public")
48
+ empty_directory("#{name}/lib/#{name}/views")
49
+ empty_directory("#{name}/lib/#{name}/lib")
50
+ end
51
+
52
+ end # Generator
53
+ end # Rackgem
Binary file
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rackgem.gemspec
4
+ gemspec
File without changes
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,14 @@
1
+ require "sinatra"
2
+ require "haml"
3
+ require "sass"
4
+
5
+ module <%= name.capitalize %>
6
+ class Application < Sinatra::Base
7
+ set :public, File.join(File.dirname(__FILE__), '<%= name %>', 'public')
8
+ set :views, File.join(File.dirname(__FILE__), '<%= name %>', 'views')
9
+
10
+ get "/admin/?" do
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ require './lib/<%= name %>/app.rb'
2
+
3
+ run <%= name.capitalize %>::Application
@@ -0,0 +1,2 @@
1
+ require "./lib/version"
2
+ require "./lib/<%= name %>/app.rb"
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "<%= name %>"
7
+ s.version = <%= name.capitalize %>::VERSION
8
+ s.authors = ["George Drummond"]
9
+ s.email = ["george@accountsapp.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{TODO: Write a gem summary}
12
+ s.description = %q{TODO: Write a gem description}
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ s.require_paths = ["lib"]
18
+
19
+ s.add_dependency "sinatra"
20
+ s.add_dependency "haml"
21
+ s.add_dependency "sass"
22
+ end
@@ -0,0 +1,3 @@
1
+ module <%= name.capitalize %>
2
+ VERSION = "0.0.1"
3
+ end
data/lib/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module Mafia
2
+ VERSION = "0.0.1"
3
+ end
data/mafia.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "mafia"
7
+ s.version = Mafia::VERSION
8
+ s.authors = ["George Drummond"]
9
+ s.email = ["george@accountsapp.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{Generator to create sinatra apps that are also gems}
12
+ s.description = %q{Generator to create sinatra apps that are also gems}
13
+
14
+ s.rubyforge_project = "mafia"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency "thor"
22
+ end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mafia
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - George Drummond
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-10-10 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: thor
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ description: Generator to create sinatra apps that are also gems
35
+ email:
36
+ - george@accountsapp.com
37
+ executables:
38
+ - mafia
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - .gitignore
45
+ - Gemfile
46
+ - Rakefile
47
+ - bin/mafia
48
+ - lib/.DS_Store
49
+ - lib/mafia.rb
50
+ - lib/mafia/.DS_Store
51
+ - lib/mafia/templates/Gemfile
52
+ - lib/mafia/templates/README
53
+ - lib/mafia/templates/Rakefile
54
+ - lib/mafia/templates/app.rb.tt
55
+ - lib/mafia/templates/config.ru.tt
56
+ - lib/mafia/templates/gem.rb.tt
57
+ - lib/mafia/templates/gemspec.tt
58
+ - lib/mafia/templates/version.rb.tt
59
+ - lib/version.rb
60
+ - mafia.gemspec
61
+ homepage: ""
62
+ licenses: []
63
+
64
+ post_install_message:
65
+ rdoc_options: []
66
+
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ hash: 3
75
+ segments:
76
+ - 0
77
+ version: "0"
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ none: false
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ hash: 3
84
+ segments:
85
+ - 0
86
+ version: "0"
87
+ requirements: []
88
+
89
+ rubyforge_project: mafia
90
+ rubygems_version: 1.8.10
91
+ signing_key:
92
+ specification_version: 3
93
+ summary: Generator to create sinatra apps that are also gems
94
+ test_files: []
95
+