captify 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +11 -3
- data/VERSION +1 -1
- data/bin/captify +31 -5
- data/captify.gemspec +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -9,7 +9,7 @@ For bundler, add this to your Gemfile:
|
|
9
9
|
|
10
10
|
== Usage
|
11
11
|
cd my_project
|
12
|
-
captify . # use default template: rails-basic
|
12
|
+
bundle exec captify . # use default template: rails-basic
|
13
13
|
|
14
14
|
It will:
|
15
15
|
|
@@ -19,9 +19,17 @@ It will:
|
|
19
19
|
To use a different template:
|
20
20
|
|
21
21
|
cd my_project
|
22
|
-
|
22
|
+
bundle exec captify -t sinatra-basic .
|
23
23
|
|
24
|
-
|
24
|
+
=== How to load template without bundler?
|
25
|
+
cd my_project
|
26
|
+
captify -r capistrano-templates -t rails-basic .
|
27
|
+
|
28
|
+
=== See also
|
29
|
+
captify -h
|
30
|
+
|
31
|
+
|
32
|
+
== Contributing to captify
|
25
33
|
|
26
34
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
27
35
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/bin/captify
CHANGED
@@ -1,22 +1,48 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'captify/template'
|
4
|
+
require 'optparse'
|
5
|
+
|
6
|
+
opts = OptionParser.new do |opts|
|
7
|
+
opts.banner = "Usage: captify [options] directory"
|
8
|
+
|
9
|
+
opts.separator ""
|
10
|
+
opts.separator "Options:"
|
11
|
+
|
12
|
+
opts.on("-t", "--template TEMPLATE_NAME",
|
13
|
+
"Specify the template to be used") do |template|
|
14
|
+
template_name = template
|
15
|
+
end
|
16
|
+
|
17
|
+
opts.on("-r", "--require LIBRARY",
|
18
|
+
"Add LIBRARY that contains templates into load path") do |lib|
|
19
|
+
require lib
|
20
|
+
end
|
21
|
+
|
22
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
23
|
+
puts opts
|
24
|
+
exit
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
opts.parse!(ARGV)
|
29
|
+
|
4
30
|
|
5
31
|
Captify::Template.load_all
|
6
32
|
|
7
33
|
if ARGV.empty?
|
8
|
-
abort "Please specify the directory to captify, e.g. `#{File.basename($0)} .'"
|
34
|
+
abort "Please specify the directory to captify, e.g. `#{File.basename($0)} .'\n\n#{opts}"
|
9
35
|
elsif !File.exists?(ARGV.first)
|
10
|
-
abort "`#{ARGV.first}' does not exist
|
36
|
+
abort "`#{ARGV.first}' does not exist.\n\n#{opts}"
|
11
37
|
elsif !File.directory?(ARGV.first)
|
12
|
-
abort "`#{ARGV.first}' is not a directory
|
38
|
+
abort "`#{ARGV.first}' is not a directory.\n\n#{opts}"
|
13
39
|
elsif ARGV.length > 1
|
14
|
-
abort "Too many arguments; please specify only the directory to
|
40
|
+
abort "Too many arguments; please specify only the directory to captify.\n\n#{opts}"
|
15
41
|
end
|
16
42
|
|
17
43
|
base_dir = ARGV.first
|
18
44
|
|
19
|
-
template_name =
|
45
|
+
template_name = 'rails-basic' unless template_name
|
20
46
|
file_paths = Captify::Template.template_files(template_name)
|
21
47
|
|
22
48
|
puts `capify #{base_dir}`
|
data/captify.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: captify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
segments:
|
111
111
|
- 0
|
112
|
-
hash:
|
112
|
+
hash: -100599646786744606
|
113
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
114
|
none: false
|
115
115
|
requirements:
|