otp_kickoff 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/otp_kickoff.rb +19 -2
- data/otp_kickoff.gemspec +3 -2
- data/resources/template_test.erl +21 -0
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.8
|
data/lib/otp_kickoff.rb
CHANGED
@@ -32,7 +32,7 @@ class OTPKickOff < Thor
|
|
32
32
|
|
33
33
|
no_tasks { attr_accessor :author_name, :author_email }
|
34
34
|
|
35
|
-
no_tasks { attr_accessor :application_name, :supervisor_name, :server_name, :handler_name }
|
35
|
+
no_tasks { attr_accessor :application_name, :supervisor_name, :server_name, :handler_name, :test_name }
|
36
36
|
|
37
37
|
# task: configure
|
38
38
|
|
@@ -63,6 +63,7 @@ author_email: #{author_email}
|
|
63
63
|
@application_name = options[:name]
|
64
64
|
@supervisor_name = @application_name
|
65
65
|
@server_name = @application_name
|
66
|
+
@test_name = @application_name
|
66
67
|
|
67
68
|
@author_name, @author_email = get_config_info
|
68
69
|
|
@@ -73,6 +74,7 @@ author_email: #{author_email}
|
|
73
74
|
template 'resources/template_server.erl', "#{application_name}/src/#{application_name}_server.erl"
|
74
75
|
template 'resources/template_appstart.erl', "#{application_name}/src/#{application_name}.erl"
|
75
76
|
template 'resources/template_include.hrl', "#{application_name}/src/#{application_name}.hrl"
|
77
|
+
template 'resources/template_test.erl', "#{application_name}/test/#{application_name}_test.erl"
|
76
78
|
|
77
79
|
# create required directories
|
78
80
|
empty_directory "#{application_name}/ebin"
|
@@ -112,7 +114,7 @@ author_email: #{author_email}
|
|
112
114
|
template 'resources/template_server.erl', "#{server_name}_server.erl"
|
113
115
|
end
|
114
116
|
|
115
|
-
# task:
|
117
|
+
# task: new_event_handler
|
116
118
|
|
117
119
|
desc 'new_event_handler', 'generate a new Erlang/OTP gen_event handler stub'
|
118
120
|
method_option :name, :type => :string, :required => true, :aliases => "-n"
|
@@ -127,6 +129,21 @@ author_email: #{author_email}
|
|
127
129
|
template 'resources/template_handler.erl', "#{handler_name}_handler.erl"
|
128
130
|
end
|
129
131
|
|
132
|
+
# task: new_test
|
133
|
+
|
134
|
+
desc 'new_test', 'generate a new Erlang/OTP test stub'
|
135
|
+
method_option :name, :type => :string, :required => true, :aliases => "-n"
|
136
|
+
|
137
|
+
def new_test
|
138
|
+
# set data to templates
|
139
|
+
@test_name = options[:name]
|
140
|
+
|
141
|
+
@author_name, @author_email = get_config_info
|
142
|
+
|
143
|
+
# generate templates
|
144
|
+
template 'resources/template_test.erl', "#{test_name}_test.erl"
|
145
|
+
end
|
146
|
+
|
130
147
|
private
|
131
148
|
|
132
149
|
def get_config_info
|
data/otp_kickoff.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{otp_kickoff}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Leandro Silva"]
|
12
|
-
s.date = %q{2009-12-
|
12
|
+
s.date = %q{2009-12-28}
|
13
13
|
s.default_executable = %q{otp_kickoff}
|
14
14
|
s.email = %q{leandrodoze@gmail.com}
|
15
15
|
s.executables = ["otp_kickoff"]
|
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
|
|
34
34
|
"resources/template_include.hrl",
|
35
35
|
"resources/template_server.erl",
|
36
36
|
"resources/template_sup.erl",
|
37
|
+
"resources/template_test.erl",
|
37
38
|
"spec/otp-kickoff_spec.rb",
|
38
39
|
"spec/spec_helper.rb"
|
39
40
|
]
|
@@ -0,0 +1,21 @@
|
|
1
|
+
%%
|
2
|
+
%% Test module
|
3
|
+
%%
|
4
|
+
%% File : <%=test_name%>_test.erl
|
5
|
+
%% Created: <%=TODAY%>
|
6
|
+
%%
|
7
|
+
%% @author <%=author_name%> <<%=author_email%>>
|
8
|
+
%% @copyright <%=TODAY.year%> <%=author_name%>
|
9
|
+
%%
|
10
|
+
%% @doc TODO make nice description
|
11
|
+
%%
|
12
|
+
|
13
|
+
-module(<%=test_name%>_test).
|
14
|
+
-author('<%=author_name%> <<%=author_email%>>').
|
15
|
+
|
16
|
+
-include_lib("eunit/include/eunit.hrl").
|
17
|
+
|
18
|
+
%% @spec some_test() -> ok
|
19
|
+
%% @doc Some test.
|
20
|
+
some_test() ->
|
21
|
+
ok.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: otp_kickoff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Silva
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-28 00:00:00 -08:00
|
13
13
|
default_executable: otp_kickoff
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- resources/template_include.hrl
|
69
69
|
- resources/template_server.erl
|
70
70
|
- resources/template_sup.erl
|
71
|
+
- resources/template_test.erl
|
71
72
|
- spec/otp-kickoff_spec.rb
|
72
73
|
- spec/spec_helper.rb
|
73
74
|
has_rdoc: true
|