funkenplate 0.0.5 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +1 -1
- data/bin/funkenplate +3 -6
- data/lib/funkenplate.rb +49 -0
- data/lib/modules/capistrano.rb +123 -0
- data/lib/modules/database.rb +10 -0
- data/lib/modules/extensions.rb +17 -0
- data/lib/modules/finished.rb +1 -0
- data/lib/modules/general.rb +14 -0
- data/lib/modules/git.rb +37 -0
- data/lib/modules/secrets.rb +67 -0
- data/lib/string.rb +17 -0
- metadata +60 -41
- data/README.textile +0 -37
- data/funkenplate.rb +0 -263
- data/lib/dummy +0 -0
- data/templates/config/deploy/header.rb +0 -17
- data/templates/config/deploy/helper.rb +0 -53
- data/templates/config/deploy/options.rb +0 -19
- data/templates/config/deploy/repositories/fs.rb +0 -7
- data/templates/config/deploy/repositories/fs_remote_fs +0 -1
- data/templates/config/deploy/repositories/fs_remote_git +0 -1
- data/templates/config/deploy/repositories/github.rb +0 -5
- data/templates/config/deploy/repositories/github_remote +0 -1
- data/templates/config/deploy/tasks.rb +0 -116
- data/templates/config/initializers/directories.rb +0 -9
- data/templates/gitignore +0 -15
- data/templates/lib/core_extensions/array.rb +0 -9
- data/templates/lib/core_extensions/object.rb +0 -19
- data/templates/lib/core_extensions/string.rb +0 -7
- data/templates/lib/gem_extensions/formtastic.rb +0 -21
- data/templates/lib/rails_extensions/action_controller_base.rb +0 -37
- data/templates/lib/rails_extensions/action_controller_restful_test_case.rb +0 -56
- data/templates/lib/rails_extensions/active_record.rb +0 -5
- data/templates/lib/rails_extensions/application_helper.rb +0 -10
- data/templates/lib/restful.rb +0 -81
- data/templates/tmproj +0 -26
@@ -1,9 +0,0 @@
|
|
1
|
-
PRIVATE_PATH = File.join(Rails.root, 'private')
|
2
|
-
|
3
|
-
# More examples:
|
4
|
-
# PRIVATE_UPLOAD_PATH = File.join(Rails.root, 'private', 'uploads')
|
5
|
-
# PUBLIC_UPLOAD_PATH = File.join(Rails.root, 'public', 'images', 'uploads')
|
6
|
-
|
7
|
-
[PRIVATE_PATH].each do |path|
|
8
|
-
Dir.mkdir(path) unless File.directory?(path)
|
9
|
-
end
|
data/templates/gitignore
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
module Formtastic #:nodoc:
|
2
|
-
class SemanticFormBuilder < ActionView::Helpers::FormBuilder
|
3
|
-
|
4
|
-
# Adapted from Formtastic::SemanticFormBuilder.input
|
5
|
-
#
|
6
|
-
def note(options={})
|
7
|
-
options[:label] = localized_string(:note, nil, :label) unless options.key?(:label)
|
8
|
-
html_class = [ :note, (options[:pointer] ? 'pointer' : nil) ]
|
9
|
-
tab_id = (options[:tab] ? "#{options[:tab]}_" : nil)
|
10
|
-
|
11
|
-
wrapper_html = options.delete(:wrapper_html) || {}
|
12
|
-
|
13
|
-
wrapper_html[:id] ||= generate_html_id("#{tab_id}note").gsub(/_input$/, '')
|
14
|
-
wrapper_html[:class] = (html_class << wrapper_html[:class]).flatten.compact.join(' ')
|
15
|
-
|
16
|
-
list_item_content = template.content_tag(:label, options[:label]) + template.content_tag(:span, options[:message])
|
17
|
-
return template.content_tag(:li, list_item_content, wrapper_html)
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module ActionController
|
2
|
-
module BaseExtensions
|
3
|
-
|
4
|
-
# "DummiesController" => "Dummies"
|
5
|
-
def bare_name
|
6
|
-
self.class.name.sub(/Test$/, '').sub(/Controller$/, '')
|
7
|
-
end
|
8
|
-
|
9
|
-
# "DummiesController" => "dummy"
|
10
|
-
def to_variable_name
|
11
|
-
bare_name.singularize.downcase
|
12
|
-
end
|
13
|
-
|
14
|
-
# "DummiesController" => "dummies"
|
15
|
-
def to_variables_name
|
16
|
-
bare_name.downcase
|
17
|
-
end
|
18
|
-
|
19
|
-
# "DummiesController" => Dummy
|
20
|
-
def to_model
|
21
|
-
bare_name.singularize.constantize
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
module ActionController
|
28
|
-
class Base
|
29
|
-
include BaseExtensions
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
module ActionController
|
34
|
-
class TestCase
|
35
|
-
include BaseExtensions
|
36
|
-
end
|
37
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
module ActionController
|
2
|
-
module RestfulTestCase
|
3
|
-
|
4
|
-
def test_index
|
5
|
-
get :index
|
6
|
-
assert_template 'index'
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_show
|
10
|
-
get :show, :id => to_model.first
|
11
|
-
assert_template 'show'
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_new
|
15
|
-
get :new
|
16
|
-
assert_template 'new'
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_create_invalid
|
20
|
-
to_model.any_instance.stubs(:valid?).returns(false)
|
21
|
-
post :create
|
22
|
-
assert_template 'new'
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_create_valid
|
26
|
-
to_model.any_instance.stubs(:valid?).returns(true)
|
27
|
-
post :create
|
28
|
-
assert_redirected_to eval("#{to_variables_name}_url")
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_edit
|
32
|
-
get :edit, :id => to_model.first
|
33
|
-
assert_template 'edit'
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_update_invalid
|
37
|
-
to_model.any_instance.stubs(:valid?).returns(false)
|
38
|
-
put :update, :id => to_model.first
|
39
|
-
assert_template 'edit'
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_update_valid
|
43
|
-
to_model.any_instance.stubs(:valid?).returns(true)
|
44
|
-
put :update, :id => to_model.first
|
45
|
-
assert_redirected_to eval("#{to_variables_name}_url")
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_destroy
|
49
|
-
continent = to_model.first
|
50
|
-
delete :destroy, :id => continent
|
51
|
-
assert_redirected_to eval("#{to_variables_name}_url")
|
52
|
-
assert !to_model.exists?(continent.id)
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
56
|
-
end
|
data/templates/lib/restful.rb
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
module Restful
|
2
|
-
|
3
|
-
def index
|
4
|
-
eval "@#{to_variables_name} = #{to_model}.all"
|
5
|
-
respond_to do |format|
|
6
|
-
format.html
|
7
|
-
format.js { render :layout => false }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def show
|
12
|
-
eval "@#{to_variable_name} = #{to_model}.find(params[:id])"
|
13
|
-
respond_to do |format|
|
14
|
-
format.html
|
15
|
-
format.js { render :layout => false }
|
16
|
-
format.json { render :json => eval("@#{to_variable_name}").to_json }
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def new
|
21
|
-
eval "@#{to_variable_name} = #{to_model}.new"
|
22
|
-
respond_to do |format|
|
23
|
-
format.html
|
24
|
-
format.js { render :layout => false }
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def create
|
29
|
-
eval <<-END
|
30
|
-
@#{to_variable_name} = #{to_model}.new(params[:#{to_variable_name}])
|
31
|
-
if @#{to_variable_name}.save
|
32
|
-
flash[:notice] = "Successfully created #{to_variable_name}."
|
33
|
-
redirect_to #{to_variables_name}_url and return
|
34
|
-
else
|
35
|
-
render :action => 'new' and return
|
36
|
-
end
|
37
|
-
END
|
38
|
-
respond_to do |format|
|
39
|
-
format.html
|
40
|
-
format.js { render :layout => false }
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def edit
|
45
|
-
eval "@#{to_variable_name} = #{to_model}.find(params[:id])"
|
46
|
-
respond_to do |format|
|
47
|
-
format.html
|
48
|
-
format.js { render :layout => false }
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def update
|
53
|
-
eval <<-END
|
54
|
-
@#{to_variable_name} = #{to_model}.find(params[:id])
|
55
|
-
if @#{to_variable_name}.update_attributes(params[:#{to_variable_name}])
|
56
|
-
flash[:notice] = "Successfully updated #{to_variable_name}."
|
57
|
-
redirect_to #{to_variables_name}_url and return
|
58
|
-
else
|
59
|
-
render :action => 'edit' and return
|
60
|
-
end
|
61
|
-
END
|
62
|
-
respond_to do |format|
|
63
|
-
format.html
|
64
|
-
format.js { render :layout => false }
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def destroy
|
69
|
-
eval <<-END
|
70
|
-
@#{to_variable_name} = #{to_model}.find(params[:id])
|
71
|
-
@#{to_variable_name}.destroy
|
72
|
-
flash[:notice] = "Successfully destroyed continent."
|
73
|
-
redirect_to #{to_variables_name}_url and return
|
74
|
-
END
|
75
|
-
respond_to do |format|
|
76
|
-
format.html
|
77
|
-
format.js { render :layout => false }
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
data/templates/tmproj
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
2
|
-
<plist version="1.0">
|
3
|
-
<dict>
|
4
|
-
<key>documents</key>
|
5
|
-
<array>
|
6
|
-
<dict>
|
7
|
-
<key>expanded</key>
|
8
|
-
<true/>
|
9
|
-
<key>name</key>
|
10
|
-
<string>~app_name~</string>
|
11
|
-
<key>regexFolderFilter</key>
|
12
|
-
<string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
|
13
|
-
<key>sourceDirectory</key>
|
14
|
-
<string></string>
|
15
|
-
</dict>
|
16
|
-
</array>
|
17
|
-
<key>fileHierarchyDrawerWidth</key>
|
18
|
-
<integer>184</integer>
|
19
|
-
<key>metaData</key>
|
20
|
-
<dict/>
|
21
|
-
<key>showFileHierarchyDrawer</key>
|
22
|
-
<true/>
|
23
|
-
<key>windowFrame</key>
|
24
|
-
<string>{{32, 4}, {1056, 735}}</string>
|
25
|
-
</dict>
|
26
|
-
</plist>
|