prigner 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -1
- data/Rakefile +1 -1
- data/lib/prigner.rb +2 -2
- data/lib/prigner/cli.rb +2 -2
- data/lib/prigner/cli/copy.rb +41 -7
- data/lib/prigner/cli/list.rb +3 -2
- data/lib/prigner/cli/new.rb +4 -3
- data/prigner.gemspec +5 -2
- data/share/templates/ruby/default/models/test.rb +16 -0
- data/share/templates/ruby/gem/models/test.rb +16 -0
- data/share/templates/ruby/sinatra/models/test.rb +16 -0
- metadata +9 -6
data/CHANGELOG
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
= Prigner v0.
|
1
|
+
= Prigner v0.3.0 (2010-11-25) - Changelog
|
2
|
+
|
3
|
+
== 2010-11-25
|
4
|
+
|
5
|
+
* * Adding of command to copy templates.
|
6
|
+
* Fixes in the templates that includes test.
|
2
7
|
|
3
8
|
== 2010-11-19
|
4
9
|
|
10
|
+
* Releasing of version 0.2.2.
|
5
11
|
* Updates in documentation and metadata.
|
6
12
|
|
7
13
|
== 2010-11-17
|
data/Rakefile
CHANGED
data/lib/prigner.rb
CHANGED
data/lib/prigner/cli.rb
CHANGED
data/lib/prigner/cli/copy.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
# Copyright (c) 2010
|
1
|
+
# Copyright (c) 2010 Codigorama
|
2
|
+
# Copyright (c) 2009 Hallison Batista
|
2
3
|
|
3
4
|
require "prigner"
|
4
5
|
|
@@ -8,31 +9,64 @@ command = File.basename(__FILE__, ".rb")
|
|
8
9
|
begin
|
9
10
|
ARGV.options do |arguments|
|
10
11
|
|
12
|
+
noforce = true
|
13
|
+
|
11
14
|
arguments.summary_indent = " "
|
12
15
|
arguments.summary_width = 24
|
13
16
|
arguments.banner = <<-end_banner.gsub /^[ ]{6}/, ''
|
14
17
|
#{Prigner::Version}
|
15
18
|
|
16
19
|
Usage:
|
17
|
-
#{program} #{command} <namespace>[:template]
|
20
|
+
#{program} #{command} <namespace>[:template] [options]
|
21
|
+
#{program} #{command} <namespace>[:template] <path> [options]
|
18
22
|
|
19
23
|
Templates:
|
20
24
|
#{Prigner::CLI.templates.sort.join("\n" + arguments.summary_indent)}
|
21
25
|
|
22
26
|
end_banner
|
23
27
|
|
24
|
-
|
28
|
+
arguments.separator "Options:"
|
29
|
+
|
30
|
+
arguments.on("-f", "--force", TrueClass, "Force copy.") { noforce = false }
|
31
|
+
|
32
|
+
unless ARGV.empty?
|
33
|
+
arguments.parse!
|
34
|
+
else
|
35
|
+
# raise RuntimeError, "unable to load template '#{name}'"
|
25
36
|
puts arguments
|
26
37
|
exit 0
|
27
|
-
|
28
|
-
|
38
|
+
end
|
39
|
+
|
40
|
+
template = Prigner::Template.load(*ARGV.shift.split(":"))
|
41
|
+
path = ARGV.empty? ? Prigner.shared_path.first : ARGV.shift
|
42
|
+
status = Prigner::CLI::Status.new
|
43
|
+
|
44
|
+
include FileUtils
|
45
|
+
|
46
|
+
puts Prigner::Version
|
47
|
+
|
48
|
+
raise RuntimeError, <<-end.gsub(/^[ ]{6}|\n/,"") if File.exist?path and noforce
|
49
|
+
unable to create path #{path}, the path exists
|
50
|
+
end
|
51
|
+
|
52
|
+
status.start "Copying template #{template.mask} to #{path}" do
|
53
|
+
mkdir_p path
|
54
|
+
Dir.glob("#{template.path}/**/**").sort.inject({}) do |hash, source|
|
55
|
+
destfile = source.to_s.gsub("#{Prigner::ROOT}/share/templates", path)
|
56
|
+
if File.file? source
|
57
|
+
mkdir_p File.dirname(destfile)
|
58
|
+
cp source, destfile, :noop => true
|
59
|
+
hash[destfile.gsub(Prigner.user_home, "~")] = File.exist? destfile
|
60
|
+
end
|
61
|
+
hash
|
62
|
+
end
|
29
63
|
end
|
30
64
|
|
31
65
|
end
|
32
66
|
|
33
67
|
rescue => error
|
34
|
-
puts "#{program}: #{command}: #{error.message} (#{error.class})"
|
35
|
-
puts "
|
68
|
+
puts "\n#{program}: #{command}: #{error.message} (#{error.class})"
|
69
|
+
puts "\nTry '#{program} #{command} -h' or '#{program} #{command} --help' for more information."
|
36
70
|
exit 1
|
37
71
|
end
|
38
72
|
|
data/lib/prigner/cli/list.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
# Copyright (c) 2010 Codigorama
|
1
|
+
# Copyright (c) 2010 Codigorama
|
2
|
+
# Copyright (c) 2009 Hallison Batista
|
2
3
|
|
3
4
|
require "prigner"
|
4
5
|
|
@@ -48,7 +49,7 @@ ARGV.options do |arguments|
|
|
48
49
|
end
|
49
50
|
|
50
51
|
rescue => error
|
51
|
-
puts "#{program}: #{command}: #{error.message} (#{error.class})"
|
52
|
+
puts "\n#{program}: #{command}: #{error.message} (#{error.class})"
|
52
53
|
exit 1
|
53
54
|
end
|
54
55
|
|
data/lib/prigner/cli/new.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
# Copyright (c) 2010
|
1
|
+
# Copyright (c) 2010 Codigorama
|
2
|
+
# Copyright (c) 2009 Hallison Batista
|
2
3
|
|
3
4
|
require "prigner"
|
4
5
|
|
@@ -113,8 +114,8 @@ begin
|
|
113
114
|
end
|
114
115
|
|
115
116
|
rescue => error
|
116
|
-
puts "#{program}: #{command}: #{error.message} (#{error.class})"
|
117
|
-
puts "
|
117
|
+
puts "\n#{program}: #{command}: #{error.message} (#{error.class})"
|
118
|
+
puts "\nTry '#{program} #{command} -h' or '#{program} #{command} --help' for more information."
|
118
119
|
exit 1
|
119
120
|
end
|
120
121
|
|
data/prigner.gemspec
CHANGED
@@ -14,8 +14,8 @@ Gem::Specification.new do |spec|
|
|
14
14
|
#
|
15
15
|
|
16
16
|
#version
|
17
|
-
spec.version = "0.
|
18
|
-
spec.date = "2010-11-
|
17
|
+
spec.version = "0.3.0"
|
18
|
+
spec.date = "2010-11-25"
|
19
19
|
#
|
20
20
|
|
21
21
|
#dependencies
|
@@ -54,6 +54,7 @@ Gem::Specification.new do |spec|
|
|
54
54
|
"share/templates/ruby/default/models/README.rdoc",
|
55
55
|
"share/templates/ruby/default/models/executable",
|
56
56
|
"share/templates/ruby/default/models/module.rb",
|
57
|
+
"share/templates/ruby/default/models/test.rb",
|
57
58
|
"share/templates/ruby/default/models/testhelper.rb",
|
58
59
|
"share/templates/ruby/default/specfile",
|
59
60
|
"share/templates/ruby/gem/models/CHANGELOG",
|
@@ -64,6 +65,7 @@ Gem::Specification.new do |spec|
|
|
64
65
|
"share/templates/ruby/gem/models/executable",
|
65
66
|
"share/templates/ruby/gem/models/gemspec",
|
66
67
|
"share/templates/ruby/gem/models/module.rb",
|
68
|
+
"share/templates/ruby/gem/models/test.rb",
|
67
69
|
"share/templates/ruby/gem/models/testhelper.rb",
|
68
70
|
"share/templates/ruby/gem/specfile",
|
69
71
|
"share/templates/ruby/sinatra/models/CHANGELOG",
|
@@ -81,6 +83,7 @@ Gem::Specification.new do |spec|
|
|
81
83
|
"share/templates/ruby/sinatra/models/mvc/database.yml",
|
82
84
|
"share/templates/ruby/sinatra/models/mvc/model.rb",
|
83
85
|
"share/templates/ruby/sinatra/models/mvc/view.erb",
|
86
|
+
"share/templates/ruby/sinatra/models/test.rb",
|
84
87
|
"share/templates/ruby/sinatra/models/testhelper.rb",
|
85
88
|
"share/templates/ruby/sinatra/specfile",
|
86
89
|
"test/builder_test.rb",
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Hallison Batista
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-25 00:00:00 -04:00
|
19
19
|
default_executable: prign
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -60,6 +60,7 @@ files:
|
|
60
60
|
- share/templates/ruby/default/models/README.rdoc
|
61
61
|
- share/templates/ruby/default/models/executable
|
62
62
|
- share/templates/ruby/default/models/module.rb
|
63
|
+
- share/templates/ruby/default/models/test.rb
|
63
64
|
- share/templates/ruby/default/models/testhelper.rb
|
64
65
|
- share/templates/ruby/default/specfile
|
65
66
|
- share/templates/ruby/gem/models/CHANGELOG
|
@@ -70,6 +71,7 @@ files:
|
|
70
71
|
- share/templates/ruby/gem/models/executable
|
71
72
|
- share/templates/ruby/gem/models/gemspec
|
72
73
|
- share/templates/ruby/gem/models/module.rb
|
74
|
+
- share/templates/ruby/gem/models/test.rb
|
73
75
|
- share/templates/ruby/gem/models/testhelper.rb
|
74
76
|
- share/templates/ruby/gem/specfile
|
75
77
|
- share/templates/ruby/sinatra/models/CHANGELOG
|
@@ -87,6 +89,7 @@ files:
|
|
87
89
|
- share/templates/ruby/sinatra/models/mvc/database.yml
|
88
90
|
- share/templates/ruby/sinatra/models/mvc/model.rb
|
89
91
|
- share/templates/ruby/sinatra/models/mvc/view.erb
|
92
|
+
- share/templates/ruby/sinatra/models/test.rb
|
90
93
|
- share/templates/ruby/sinatra/models/testhelper.rb
|
91
94
|
- share/templates/ruby/sinatra/specfile
|
92
95
|
- test/builder_test.rb
|
@@ -125,7 +128,7 @@ licenses: []
|
|
125
128
|
|
126
129
|
post_install_message: |
|
127
130
|
------------------------------------------------------------------------------
|
128
|
-
Prigner v0.
|
131
|
+
Prigner v0.3.0
|
129
132
|
|
130
133
|
Thanks for use Prigner. See all shared templates running:
|
131
134
|
|
@@ -140,7 +143,7 @@ rdoc_options:
|
|
140
143
|
- --main
|
141
144
|
- Prigner
|
142
145
|
- --title
|
143
|
-
- Prigner v0.
|
146
|
+
- Prigner v0.3.0 API Documentation
|
144
147
|
require_paths:
|
145
148
|
- lib
|
146
149
|
required_ruby_version: !ruby/object:Gem::Requirement
|