mafia 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mafia.rb +7 -6
- data/lib/mafia/templates/bin.tt +10 -33
- data/lib/mafia/templates/gemspec.tt +3 -4
- data/lib/version.rb +1 -1
- metadata +4 -4
data/lib/mafia.rb
CHANGED
@@ -36,12 +36,6 @@ module Mafia
|
|
36
36
|
template("version.rb.tt", "#{name}/lib/version.rb")
|
37
37
|
end
|
38
38
|
|
39
|
-
def create_bin_file
|
40
|
-
if yes? "\n\nCreate a binary to run your application?", :green
|
41
|
-
template("bin.tt", "#{name}/bin/#{name}")
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
39
|
def create_gem_file
|
46
40
|
template("gem.rb.tt", "#{name}/lib/#{name}.rb")
|
47
41
|
end
|
@@ -68,6 +62,13 @@ module Mafia
|
|
68
62
|
empty_directory("#{name}/lib/#{name}/lib")
|
69
63
|
end
|
70
64
|
|
65
|
+
def create_bin_file
|
66
|
+
if yes? "\n\nCreate a binary to run your application?", :green
|
67
|
+
template("bin.tt", "#{name}/bin/#{name}")
|
68
|
+
inject_into_file "#{name}/#{name}.gemspec", "\n s.add_dependency \"thor\"", :after => "s.add_dependency \"sinatra\", \"1.3.1\""
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
71
72
|
def create_license
|
72
73
|
if yes? "\n\nUse MIT License?", :green
|
73
74
|
|
data/lib/mafia/templates/bin.tt
CHANGED
@@ -1,40 +1,17 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
require 'rubygems' unless defined?(Gem) # Useful only on --dev mode
|
4
|
+
require 'bundler/setup' if %w(Gemfile .components).all? { |f| File.exist?(f) }
|
4
5
|
|
5
|
-
require
|
6
|
-
require "<%= name %>"
|
7
|
-
require "version"
|
6
|
+
require 'thor'
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
opts.separator ''
|
17
|
-
opts.separator "Configuration options:"
|
18
|
-
|
19
|
-
opts.on_tail( "-v", "--version", "Show version") do
|
20
|
-
puts "<%= camelize(name) %> version #{<%= camelize(name) %>::VERSION}"
|
21
|
-
exit
|
22
|
-
end
|
23
|
-
|
24
|
-
opts.separator ""
|
25
|
-
opts.separator "Common options:"
|
26
|
-
|
27
|
-
opts.on_tail("-h", "--help", "Display this screen" ) do
|
28
|
-
puts opts
|
29
|
-
exit
|
8
|
+
module <%= camelize(name) %>
|
9
|
+
class Runner < Thor
|
10
|
+
desc "info", "about this gem"
|
11
|
+
def info
|
12
|
+
say "This is the command line executable and can be found in <%= name %>/bin"
|
13
|
+
end
|
30
14
|
end
|
31
15
|
end
|
32
16
|
|
33
|
-
|
34
|
-
optparse.parse!
|
35
|
-
<%= camelize(name) %>::Application.run!
|
36
|
-
rescue OptionParser::InvalidArgument, OptionParser::InvalidOption, OptionParser::MissingArgument
|
37
|
-
puts $!.to_s
|
38
|
-
puts optparse
|
39
|
-
exit
|
40
|
-
end
|
17
|
+
<%= camelize(name) %>::Runner.start
|
@@ -10,10 +10,9 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.homepage = ""
|
11
11
|
s.summary = %q{TODO: Write a gem summary}
|
12
12
|
s.description = %q{TODO: Write a gem description}
|
13
|
-
|
14
|
-
s.
|
15
|
-
s.
|
16
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
13
|
+
s.files = Dir["lib/**/*"] + ["Rakefile", "README.md", "Gemfile", "Gemfile.lock", "config.ru"]
|
14
|
+
s.test_files = Dir["{test, spec, features}/**/*"]
|
15
|
+
s.executables = Dir["bin/*"].entries.map{ |f| File.basename(f) }
|
17
16
|
s.require_paths = ["lib"]
|
18
17
|
|
19
18
|
s.add_dependency "sinatra", "1.3.1"
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mafia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-15 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70288365289800 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70288365289800
|
25
25
|
description: Generator to create sinatra apps that are also gems
|
26
26
|
email:
|
27
27
|
- george@accountsapp.com
|