daddy 0.1.18 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/lib/daddy/cucumber/diff.rb +19 -5
- data/lib/daddy/formatter/daddy.css +25 -2
- data/lib/daddy/formatter/daddy_html.rb +0 -4
- data/lib/daddy/formatter/html.rb +36 -25
- data/lib/daddy/git.rb +7 -30
- data/lib/daddy/railtie.rb +2 -1
- data/lib/tasks/generate/controller.rake +29 -0
- data/lib/tasks/generate/templates/_form.html.erb +12 -0
- data/lib/tasks/generate/templates/controller.rb.erb +62 -0
- data/lib/tasks/generate/templates/edit.html.erb +6 -0
- data/lib/tasks/generate/templates/index.html.erb +28 -0
- data/lib/tasks/generate/templates/new.html.erb +5 -0
- data/lib/tasks/generate/templates/show.html.erb +15 -0
- data/lib/tasks/generate/view.rake +36 -0
- data/lib/tasks/nginx.app.conf.erb +3 -0
- metadata +75 -87
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NTMzNjJlOTUzYzJjOTg2MTEzMjM3YTcwYzA1OGU2ODYzMTVmZWE0OA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZjAzMDk4MWZjYzQ1MzQyNzZmYzY5NmIyNGExM2NkMjVhZjBhZmFkMA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZTgxZTYzYmJjOWVkYmFhZmFmNzUzMzlhODFhNDY0Yjg3Mzg1ZDNiNzhmM2Jl
|
10
|
+
OTliNjc0YTY3ZGJlNGUwMTEzMTZkZGM3YmVlMGM2ODY3NmNhZDVlODM5MzM5
|
11
|
+
MzI5MjBmNTljZmIzODQwMjVmZmRkODY0ZGEwZWU3NTIwNWM3ZTU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NGFiY2ZhMzY3M2RmZDlkYWU1ODcxMjgyNmM4ODU5ZTQ5ZmI5ZTc0ZGRiZmNh
|
14
|
+
NzU1Y2ZkMWY2N2Y0OWNlYTg3NWRjYmFkM2U0YTU3NzRiMWNkZTVhOGE5YWYz
|
15
|
+
MWJhZDVlMDZlMzk5MTdjYjRhOGYzNDJhZTI4MmMzNmI4MDk3YTY=
|
data/lib/daddy/cucumber/diff.rb
CHANGED
@@ -5,11 +5,25 @@ module Daddy
|
|
5
5
|
module Diff
|
6
6
|
|
7
7
|
def git_diff(file, options = {})
|
8
|
-
options[:as]
|
8
|
+
options[:as] = 'edit' unless options.has_key?(:as)
|
9
|
+
remote = options.has_key?(:remote) ? options[:remote] : true
|
9
10
|
|
10
11
|
git = Daddy::Git.new
|
11
|
-
|
12
|
-
|
12
|
+
|
13
|
+
if options[:between]
|
14
|
+
a = git.show_previous(file, :commit => options[:between], :remote => remote)
|
15
|
+
else
|
16
|
+
a = File.read(file)
|
17
|
+
end
|
18
|
+
a = a.gsub(/[<>]/, '<' => '<', '>' => '>')
|
19
|
+
|
20
|
+
if options[:and]
|
21
|
+
b = git.show_previous(file, :commit => options[:and], :remote => remote)
|
22
|
+
else
|
23
|
+
b = git.show_previous(file, :remote => remote)
|
24
|
+
end
|
25
|
+
b = b.gsub(/[<>]/, '<' => '<', '>' => '>')
|
26
|
+
|
13
27
|
diff = format_diff(Differ.diff(a, b), options)
|
14
28
|
|
15
29
|
show_filename(file, options)
|
@@ -22,8 +36,8 @@ module Daddy
|
|
22
36
|
end
|
23
37
|
|
24
38
|
def diff(file_a, file_b, options = {})
|
25
|
-
a = File.read(file_a)
|
26
|
-
b = File.read(file_b)
|
39
|
+
a = File.read(file_a).gsub(/[<>]/, '<' => '<', '>' => '>')
|
40
|
+
b = File.read(file_b).gsub(/[<>]/, '<' => '<', '>' => '>')
|
27
41
|
diff = format_diff(Differ.diff(a, b))
|
28
42
|
|
29
43
|
show_filename(file_a, options)
|
@@ -63,8 +63,8 @@
|
|
63
63
|
border-bottom: 1px solid #999999;
|
64
64
|
background: #F0F8FF;
|
65
65
|
color: #001111;
|
66
|
-
margin
|
67
|
-
padding
|
66
|
+
margin: 5px 0px 5px 15px;
|
67
|
+
padding: 3px 15px 3px 10px;
|
68
68
|
}
|
69
69
|
|
70
70
|
.feature_dir {
|
@@ -110,6 +110,18 @@ div.scenario {
|
|
110
110
|
margin: 10px 10px 10px 20px;
|
111
111
|
}
|
112
112
|
|
113
|
+
div.scenario.faild h3,
|
114
|
+
div.scenario.faild .scenario_file {
|
115
|
+
background: #C40D0D;
|
116
|
+
color: #FFFFFF;
|
117
|
+
}
|
118
|
+
|
119
|
+
div.scenario.pending h3,
|
120
|
+
div.scenario.pending .scenario_file {
|
121
|
+
background: #FAF834;
|
122
|
+
color: #000000;
|
123
|
+
}
|
124
|
+
|
113
125
|
div.scenario ol {
|
114
126
|
margin-left: 20px;
|
115
127
|
}
|
@@ -123,6 +135,17 @@ div.scenario td {
|
|
123
135
|
padding: 5px;
|
124
136
|
}
|
125
137
|
|
138
|
+
span.feature_subtitle {
|
139
|
+
margin-left: 20px;
|
140
|
+
color: #999999;
|
141
|
+
font-size: 0.9em;
|
142
|
+
}
|
143
|
+
|
144
|
+
span.scenario_file {
|
145
|
+
padding: 3px;
|
146
|
+
line-height: 1.2em;
|
147
|
+
}
|
148
|
+
|
126
149
|
span.new {
|
127
150
|
color: #006400;
|
128
151
|
font-weight: bold;
|
data/lib/daddy/formatter/html.rb
CHANGED
@@ -22,11 +22,9 @@ module Daddy
|
|
22
22
|
@buffer = {}
|
23
23
|
@builder = create_builder(@io)
|
24
24
|
@feature_number = 0
|
25
|
-
@scenario_number = 0
|
26
25
|
@step_number = 0
|
27
26
|
@header_red = nil
|
28
27
|
@delayed_messages = []
|
29
|
-
@img_id = 0
|
30
28
|
@inside_outline = false
|
31
29
|
end
|
32
30
|
|
@@ -121,7 +119,12 @@ module Daddy
|
|
121
119
|
title = feature_dir(@feature, true) + @feature.file.split('/').last.gsub(/\.feature/, '')
|
122
120
|
|
123
121
|
@builder.h2 do |h2|
|
124
|
-
@builder.span(
|
122
|
+
@builder.span(:class => 'val') do
|
123
|
+
@builder << title
|
124
|
+
unless name.strip.blank?
|
125
|
+
@builder.span('(' + name.strip + ')', :class => 'feature_subtitle')
|
126
|
+
end
|
127
|
+
end
|
125
128
|
end
|
126
129
|
|
127
130
|
lines = name.split(/\r?\n/)
|
@@ -147,7 +150,7 @@ module Daddy
|
|
147
150
|
|
148
151
|
def background_name(keyword, name, file_colon_line, source_indent)
|
149
152
|
@listing_background = true
|
150
|
-
@builder.h3
|
153
|
+
@builder.h3 do |h3|
|
151
154
|
@builder.span(keyword, :class => 'keyword')
|
152
155
|
@builder.text!(' ')
|
153
156
|
@builder.span(name, :class => 'val')
|
@@ -155,7 +158,6 @@ module Daddy
|
|
155
158
|
end
|
156
159
|
|
157
160
|
def before_feature_element(feature_element)
|
158
|
-
@scenario_number+=1
|
159
161
|
@scenario_red = false
|
160
162
|
css_class = {
|
161
163
|
::Cucumber::Ast::Scenario => 'scenario',
|
@@ -178,7 +180,7 @@ module Daddy
|
|
178
180
|
@listing_background = false
|
179
181
|
|
180
182
|
lines = name.split("\n")
|
181
|
-
@builder.h3
|
183
|
+
@builder.h3 do
|
182
184
|
@builder.span(lines[0], :class => 'val')
|
183
185
|
end
|
184
186
|
|
@@ -234,7 +236,6 @@ module Daddy
|
|
234
236
|
end
|
235
237
|
|
236
238
|
def before_step(step)
|
237
|
-
@step_id = step.dom_id + '_' + Daddy::Utils::StringUtils.current_time
|
238
239
|
@step_number += 1
|
239
240
|
@step = step
|
240
241
|
end
|
@@ -262,9 +263,9 @@ module Daddy
|
|
262
263
|
set_scenario_color(status)
|
263
264
|
|
264
265
|
if ! @delayed_messages.empty? and status == :passed
|
265
|
-
@builder << "<li
|
266
|
+
@builder << "<li class='step #{status} expand'>"
|
266
267
|
else
|
267
|
-
@builder << "<li
|
268
|
+
@builder << "<li class='step #{status}'>"
|
268
269
|
end
|
269
270
|
end
|
270
271
|
|
@@ -397,17 +398,10 @@ module Daddy
|
|
397
398
|
|
398
399
|
#@builder.ol do
|
399
400
|
@delayed_messages.each_with_index do |ann, i|
|
400
|
-
@builder.li(:
|
401
|
+
@builder.li(:class => 'message', :style => 'display: none;') do
|
401
402
|
@builder << ann
|
402
403
|
end
|
403
404
|
end
|
404
|
-
@builder.script do |script|
|
405
|
-
script << "$(function() {"
|
406
|
-
script << " $('##{@step_id}').css('cursor', 'pointer').click(function() {"
|
407
|
-
script << " $(this).nextAll('li[id^=\"#{@step_id}_\"]').toggle(250);"
|
408
|
-
script << " });"
|
409
|
-
script << "});"
|
410
|
-
end
|
411
405
|
#end
|
412
406
|
empty_messages
|
413
407
|
end
|
@@ -461,18 +455,26 @@ module Daddy
|
|
461
455
|
end
|
462
456
|
|
463
457
|
def set_scenario_color_failed
|
458
|
+
id = Daddy::Utils::StringUtils.current_time
|
459
|
+
style = 'display: none; margin: 0; padding: 0;'
|
460
|
+
@builder << "<div id=\"#{id}\" style=\"#{style}\"></div>"
|
461
|
+
|
464
462
|
@builder.script do
|
465
463
|
@builder.text!("makeRed('cucumber-header');") unless @header_red
|
466
464
|
@header_red = true
|
467
|
-
@builder.text!("
|
465
|
+
@builder.text!("$(function() { $('##{id}').closest('.scenario').addClass('faild'); });") unless @scenario_red
|
468
466
|
@scenario_red = true
|
469
467
|
end
|
470
468
|
end
|
471
469
|
|
472
470
|
def set_scenario_color_pending
|
471
|
+
id = Daddy::Utils::StringUtils.current_time
|
472
|
+
style = 'display: none; margin: 0; padding: 0;'
|
473
|
+
@builder << "<div id=\"#{id}\" style=\"#{style}\"></div>"
|
474
|
+
|
473
475
|
@builder.script do
|
474
476
|
@builder.text!("makeYellow('cucumber-header');") unless @header_red
|
475
|
-
@builder.text!("
|
477
|
+
@builder.text!("$(function() { $('##{id}').closest('.scenario').addClass('pending'); });") unless @scenario_red
|
476
478
|
end
|
477
479
|
end
|
478
480
|
|
@@ -546,12 +548,25 @@ module Daddy
|
|
546
548
|
def inline_daddy
|
547
549
|
ret = File.read(File.dirname(__FILE__) + '/daddy.js')
|
548
550
|
|
551
|
+
ret << %w{
|
552
|
+
$(document).ready(function() {
|
553
|
+
$('li.step').each(function() {
|
554
|
+
var messages = $(this).nextUntil('li.step').filter('.message');
|
555
|
+
if (messages.length > 0) {
|
556
|
+
$(this).css('cursor', 'pointer').click(function() {
|
557
|
+
messages.toggle(250);
|
558
|
+
});
|
559
|
+
}
|
560
|
+
});
|
561
|
+
});
|
562
|
+
}.join(' ')
|
563
|
+
|
549
564
|
if should_expand
|
550
565
|
ret << %w{
|
551
566
|
$(document).ready(function() {
|
552
567
|
$('#expander').click();
|
553
|
-
|
554
|
-
}.join
|
568
|
+
});
|
569
|
+
}.join(' ')
|
555
570
|
end
|
556
571
|
|
557
572
|
ret
|
@@ -580,9 +595,6 @@ module Daddy
|
|
580
595
|
});
|
581
596
|
});
|
582
597
|
|
583
|
-
function moveProgressBar(percentDone) {
|
584
|
-
$("cucumber-header").css('width', percentDone +"%");
|
585
|
-
}
|
586
598
|
function makeRed(element_id) {
|
587
599
|
$('#'+element_id).css('background', '#C40D0D');
|
588
600
|
$('#'+element_id).css('color', '#FFFFFF');
|
@@ -596,7 +608,6 @@ module Daddy
|
|
596
608
|
end
|
597
609
|
|
598
610
|
def move_progress
|
599
|
-
@builder << " <script type=\"text/javascript\">moveProgressBar('#{percent_done}');</script>"
|
600
611
|
end
|
601
612
|
|
602
613
|
def percent_done
|
data/lib/daddy/git.rb
CHANGED
@@ -1,17 +1,8 @@
|
|
1
1
|
# coding: UTF-8
|
2
2
|
|
3
|
-
Dir::glob(File.dirname(__FILE__) + '/git/*.rb').each do |file|
|
4
|
-
require file
|
5
|
-
end
|
6
|
-
|
7
3
|
module Daddy
|
8
4
|
|
9
5
|
class Git
|
10
|
-
@@sub_dir = nil
|
11
|
-
|
12
|
-
def self.sub_dir=(sub_dir)
|
13
|
-
@@sub_dir = sub_dir
|
14
|
-
end
|
15
6
|
|
16
7
|
def branches(remote = false)
|
17
8
|
branches = []
|
@@ -63,33 +54,19 @@ module Daddy
|
|
63
54
|
end
|
64
55
|
end
|
65
56
|
|
66
|
-
def show_previous(file,
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
57
|
+
def show_previous(file, options = {})
|
58
|
+
remote = options[:remote]
|
59
|
+
commit = options[:commit]
|
60
|
+
|
61
|
+
if commit
|
62
|
+
`git show #{commit}:#{file}`
|
71
63
|
else
|
72
64
|
`git show #{previous_branch(remote)}:#{file}`
|
73
65
|
end
|
74
66
|
end
|
75
67
|
|
76
68
|
def git_diff_name(*includes)
|
77
|
-
|
78
|
-
return diff unless @@sub_dir
|
79
|
-
|
80
|
-
ret = []
|
81
|
-
diff.split("\n").each do |line|
|
82
|
-
index = line.index(@@sub_dir)
|
83
|
-
if index
|
84
|
-
sub_file = line[@@sub_dir.length..-1]
|
85
|
-
sub_file = sub_file[1..-1] if sub_file.start_with?('/')
|
86
|
-
ret << sub_file
|
87
|
-
else
|
88
|
-
ret << line
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
ret.join("\n")
|
69
|
+
`git diff origin/#{previous_branch} --name-only #{includes.join(' ')}`
|
93
70
|
end
|
94
71
|
end
|
95
72
|
|
data/lib/daddy/railtie.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# coding: UTF-8
|
2
2
|
|
3
3
|
require 'rails_i18n'
|
4
|
+
require 'holiday_jp'
|
4
5
|
|
5
6
|
if ENV["COVERAGE"].to_s.downcase == 'true'
|
6
7
|
require 'simplecov'
|
@@ -37,7 +38,7 @@ module Daddy
|
|
37
38
|
|
38
39
|
rake_tasks do
|
39
40
|
lib = File.dirname(File.dirname(__FILE__))
|
40
|
-
Dir[File.join(lib, 'tasks
|
41
|
+
Dir[File.join(lib, 'tasks/**/*.rake')].each do |f|
|
41
42
|
load f
|
42
43
|
end
|
43
44
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: UTF-8
|
2
|
+
|
3
|
+
require 'rake'
|
4
|
+
require 'erb'
|
5
|
+
|
6
|
+
namespace :dad do
|
7
|
+
namespace :generate do
|
8
|
+
|
9
|
+
task :controller => :environment do
|
10
|
+
ARGV[1..-1].each do |arg|
|
11
|
+
unless arg.index('=')
|
12
|
+
task arg.to_sym do ; end
|
13
|
+
|
14
|
+
if @resources.nil?
|
15
|
+
@resources = arg.downcase
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
@resource = @resources.singularize
|
21
|
+
@model_class = @resource.capitalize.constantize
|
22
|
+
|
23
|
+
template = File.join(File.dirname(__FILE__), 'templates', 'controller.rb.erb')
|
24
|
+
controller_file = "#{Rails.root}/app/controllers/#{@resources}_controller.rb"
|
25
|
+
File.write(controller_file, ERB.new(File.read(template)).result)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%= @tag_begin %>= form_for @<%= @resources.singularize %> do |f| <%= @tag_end %>
|
2
|
+
<table>
|
3
|
+
<% @model_class.columns.each do |column| -%>
|
4
|
+
<% next if %w{ id deleted created_at updated_at }.include?(column.name.to_s) -%>
|
5
|
+
<tr>
|
6
|
+
<th><%= @tag_begin %>= f.label :<%= column.name %> <%= @tag_end %></th>
|
7
|
+
<td><%= @tag_begin %>= f.text_field :<%= column.name %> <%= @tag_end %></td>
|
8
|
+
</tr>
|
9
|
+
<% end -%>
|
10
|
+
</table>
|
11
|
+
<%= @tag_begin %>= f.submit <%= @tag_end %>
|
12
|
+
<%= @tag_begin %> end <%= @tag_end %>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# coding: UTF-8
|
2
|
+
|
3
|
+
class <%= @resources.capitalize %>Controller < ApplicationController
|
4
|
+
|
5
|
+
def index
|
6
|
+
@<%= @resources %> = <%= @model_class %>.not_deleted
|
7
|
+
end
|
8
|
+
|
9
|
+
def show
|
10
|
+
@<%= @resource %> = <%= @model_class.name %>.find(params[:id])
|
11
|
+
end
|
12
|
+
|
13
|
+
def new
|
14
|
+
@<%= @resource %> = <%= @model_class.name %>.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def create
|
18
|
+
@<%= @resource %> = <%= @model_class.name %>.new(params[:<%= @resource %>])
|
19
|
+
|
20
|
+
begin
|
21
|
+
@<%= @resource %>.transaction do
|
22
|
+
@<%= @resource %>.save!
|
23
|
+
end
|
24
|
+
|
25
|
+
redirect_to :action => 'show', :id => @<%= @resource %>.id
|
26
|
+
|
27
|
+
rescue ActiveRecord::RecordInvalid => e
|
28
|
+
render :new
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def edit
|
33
|
+
@<%= @resource %> = <%= @model_class.name %>.find(params[:id])
|
34
|
+
end
|
35
|
+
|
36
|
+
def update
|
37
|
+
@<%= @resource %> = <%= @model_class.name %>.find(params[:id])
|
38
|
+
|
39
|
+
begin
|
40
|
+
@<%= @resource %>.transaction do
|
41
|
+
@<%= @resource %>.attributes = params[:<%= @resource %>]
|
42
|
+
@<%= @resource %>.save!
|
43
|
+
end
|
44
|
+
|
45
|
+
redirect_to :action => 'show', :id => @<%= @resource %>.id
|
46
|
+
|
47
|
+
rescue ActiveRecord::RecordInvalid => e
|
48
|
+
render :edit
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def destroy
|
53
|
+
@<%= @resource %> = <%= @model_class.name %>.find(params[:id])
|
54
|
+
|
55
|
+
@<%= @resource %>.transaction do
|
56
|
+
@<%= @resource %>.destroy_logically!
|
57
|
+
end
|
58
|
+
|
59
|
+
redirect_to :action => 'index'
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<div class="actions">
|
2
|
+
<%= @tag_begin %>= link_to '追加', new_<%= @resource %>_path <%= @tag_end %>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<tr>
|
7
|
+
<% @model_class.columns.each do |column| -%>
|
8
|
+
<% next if %w{ id deleted created_at updated_at }.include?(column.name.to_s) -%>
|
9
|
+
<th><%= @tag_begin %>= <%= @model_class.name %>.human_attribute_name :<%= column.name %> <%= @tag_end %></th>
|
10
|
+
<% end -%>
|
11
|
+
<th colspan="2"></th>
|
12
|
+
</tr>
|
13
|
+
|
14
|
+
<%= @tag_begin %> @<%= @resources %>.each do |<%= @short_name %>| <%= @tag_end %>
|
15
|
+
<tr>
|
16
|
+
<% @model_class.columns.each do |column| -%>
|
17
|
+
<% next if %w{ id deleted created_at updated_at }.include?(column.name.to_s) -%>
|
18
|
+
<td><%= @tag_begin %>= <%= @short_name %>.<%= column.name %> <%= @tag_end %></td>
|
19
|
+
<% end -%>
|
20
|
+
<td>
|
21
|
+
<%= @tag_begin %>= link_to '編集', edit_<%= @resource %>_path(<%= @short_name %>) <%= @tag_end %>
|
22
|
+
</td>
|
23
|
+
<td>
|
24
|
+
<%= @tag_begin %>= link_to '削除', <%= @resource %>_path(<%= @short_name %>), :method => 'delete', :confirm => '削除します。よろしいですか?' <%= @tag_end %>
|
25
|
+
</td>
|
26
|
+
</tr>
|
27
|
+
<%= @tag_begin %> end <%= @tag_end %>
|
28
|
+
</table>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="actions">
|
2
|
+
<%= @tag_begin %>= link_to '一覧', <%= @resources %>_path <%= @tag_end %>
|
3
|
+
<%= @tag_begin %>= link_to '編集', edit_<%= @resource %>_path(@<%= @resource %>) <%= @tag_end %>
|
4
|
+
<%= @tag_begin %>= link_to '削除', <%= @resource %>_path(@<%= @resource %>), :method => 'delete', :confirm => '削除します。よろしいですか?' <%= @tag_end %>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<table>
|
8
|
+
<% @model_class.columns.each do |column| -%>
|
9
|
+
<% next if %w{ id deleted }.include?(column.name.to_s) -%>
|
10
|
+
<tr>
|
11
|
+
<th><%= @tag_begin %>= <%= @model_class %>.human_attribute_name :<%= column.name %> <%= @tag_end %></th>
|
12
|
+
<td><%= @tag_begin %>= @<%= @resource %>.<%= column.name %> <%= @tag_end %></td>
|
13
|
+
</tr>
|
14
|
+
<% end -%>
|
15
|
+
</table>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# coding: UTF-8
|
2
|
+
|
3
|
+
require 'rake'
|
4
|
+
require 'erb'
|
5
|
+
|
6
|
+
namespace :dad do
|
7
|
+
namespace :generate do
|
8
|
+
|
9
|
+
task :view => :environment do
|
10
|
+
ARGV[1..-1].each do |arg|
|
11
|
+
unless arg.index('=')
|
12
|
+
task arg.to_sym do ; end
|
13
|
+
|
14
|
+
if @resources.nil?
|
15
|
+
@resources = arg.downcase
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
@resource = @resources.singularize
|
21
|
+
@short_name = @resource.split('_').map(&:first).join
|
22
|
+
@model_class = @resource.capitalize.constantize
|
23
|
+
@tag_begin = '<%'
|
24
|
+
@tag_end = '%>'
|
25
|
+
|
26
|
+
Dir[File.join(File.dirname(__FILE__), 'templates/*.html.erb')].each do |template|
|
27
|
+
view_dir = "#{Rails.root}/app/views/#{@resources}"
|
28
|
+
FileUtils.mkdir_p(view_dir)
|
29
|
+
|
30
|
+
view_file = "#{view_dir}/#{File.basename(template)}"
|
31
|
+
File.write(view_file, ERB.new(File.read(template), 0, '-').result)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -11,6 +11,9 @@ server {
|
|
11
11
|
|
12
12
|
location @app {
|
13
13
|
proxy_pass http://<%= ENV['APP_NAME'] %>;
|
14
|
+
proxy_set_header Host $http_host;
|
15
|
+
proxy_set_header X-Real-IP $remote_addr;
|
16
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
14
17
|
}
|
15
18
|
|
16
19
|
<% if ENV['RAILS_ENV'] == 'production' %>
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.20
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- ichy
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-14 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: capybara
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: cucumber
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: cucumber-rails
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: ci_reporter
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ! '>='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ! '>='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: database_cleaner
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ! '>='
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ! '>='
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -94,7 +83,6 @@ dependencies:
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: differ
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - ! '>='
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,7 +90,6 @@ dependencies:
|
|
102
90
|
type: :runtime
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - ! '>='
|
108
95
|
- !ruby/object:Gem::Version
|
@@ -110,7 +97,6 @@ dependencies:
|
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: execjs
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
101
|
- - ! '>='
|
116
102
|
- !ruby/object:Gem::Version
|
@@ -118,7 +104,6 @@ dependencies:
|
|
118
104
|
type: :runtime
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
108
|
- - ! '>='
|
124
109
|
- !ruby/object:Gem::Version
|
@@ -126,7 +111,6 @@ dependencies:
|
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: faraday
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
115
|
- - ! '>='
|
132
116
|
- !ruby/object:Gem::Version
|
@@ -134,7 +118,20 @@ dependencies:
|
|
134
118
|
type: :runtime
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: holiday_jp
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
135
|
requirements:
|
139
136
|
- - ! '>='
|
140
137
|
- !ruby/object:Gem::Version
|
@@ -142,7 +139,6 @@ dependencies:
|
|
142
139
|
- !ruby/object:Gem::Dependency
|
143
140
|
name: poltergeist
|
144
141
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
142
|
requirements:
|
147
143
|
- - ! '>='
|
148
144
|
- !ruby/object:Gem::Version
|
@@ -150,7 +146,6 @@ dependencies:
|
|
150
146
|
type: :runtime
|
151
147
|
prerelease: false
|
152
148
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
149
|
requirements:
|
155
150
|
- - ! '>='
|
156
151
|
- !ruby/object:Gem::Version
|
@@ -158,7 +153,6 @@ dependencies:
|
|
158
153
|
- !ruby/object:Gem::Dependency
|
159
154
|
name: rails
|
160
155
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
156
|
requirements:
|
163
157
|
- - ~>
|
164
158
|
- !ruby/object:Gem::Version
|
@@ -166,7 +160,6 @@ dependencies:
|
|
166
160
|
type: :runtime
|
167
161
|
prerelease: false
|
168
162
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
163
|
requirements:
|
171
164
|
- - ~>
|
172
165
|
- !ruby/object:Gem::Version
|
@@ -174,7 +167,6 @@ dependencies:
|
|
174
167
|
- !ruby/object:Gem::Dependency
|
175
168
|
name: rails-i18n
|
176
169
|
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
170
|
requirements:
|
179
171
|
- - ! '>='
|
180
172
|
- !ruby/object:Gem::Version
|
@@ -182,7 +174,6 @@ dependencies:
|
|
182
174
|
type: :runtime
|
183
175
|
prerelease: false
|
184
176
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
177
|
requirements:
|
187
178
|
- - ! '>='
|
188
179
|
- !ruby/object:Gem::Version
|
@@ -190,7 +181,6 @@ dependencies:
|
|
190
181
|
- !ruby/object:Gem::Dependency
|
191
182
|
name: selenium-webdriver
|
192
183
|
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
184
|
requirements:
|
195
185
|
- - ! '>='
|
196
186
|
- !ruby/object:Gem::Version
|
@@ -198,7 +188,6 @@ dependencies:
|
|
198
188
|
type: :runtime
|
199
189
|
prerelease: false
|
200
190
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
191
|
requirements:
|
203
192
|
- - ! '>='
|
204
193
|
- !ruby/object:Gem::Version
|
@@ -206,7 +195,6 @@ dependencies:
|
|
206
195
|
- !ruby/object:Gem::Dependency
|
207
196
|
name: simplecov
|
208
197
|
requirement: !ruby/object:Gem::Requirement
|
209
|
-
none: false
|
210
198
|
requirements:
|
211
199
|
- - ! '>='
|
212
200
|
- !ruby/object:Gem::Version
|
@@ -214,7 +202,6 @@ dependencies:
|
|
214
202
|
type: :runtime
|
215
203
|
prerelease: false
|
216
204
|
version_requirements: !ruby/object:Gem::Requirement
|
217
|
-
none: false
|
218
205
|
requirements:
|
219
206
|
- - ! '>='
|
220
207
|
- !ruby/object:Gem::Version
|
@@ -222,7 +209,6 @@ dependencies:
|
|
222
209
|
- !ruby/object:Gem::Dependency
|
223
210
|
name: simplecov-rcov
|
224
211
|
requirement: !ruby/object:Gem::Requirement
|
225
|
-
none: false
|
226
212
|
requirements:
|
227
213
|
- - ! '>='
|
228
214
|
- !ruby/object:Gem::Version
|
@@ -230,7 +216,6 @@ dependencies:
|
|
230
216
|
type: :runtime
|
231
217
|
prerelease: false
|
232
218
|
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
none: false
|
234
219
|
requirements:
|
235
220
|
- - ! '>='
|
236
221
|
- !ruby/object:Gem::Version
|
@@ -238,7 +223,6 @@ dependencies:
|
|
238
223
|
- !ruby/object:Gem::Dependency
|
239
224
|
name: term-ansicolor
|
240
225
|
requirement: !ruby/object:Gem::Requirement
|
241
|
-
none: false
|
242
226
|
requirements:
|
243
227
|
- - ! '>='
|
244
228
|
- !ruby/object:Gem::Version
|
@@ -246,7 +230,6 @@ dependencies:
|
|
246
230
|
type: :runtime
|
247
231
|
prerelease: false
|
248
232
|
version_requirements: !ruby/object:Gem::Requirement
|
249
|
-
none: false
|
250
233
|
requirements:
|
251
234
|
- - ! '>='
|
252
235
|
- !ruby/object:Gem::Version
|
@@ -254,7 +237,6 @@ dependencies:
|
|
254
237
|
- !ruby/object:Gem::Dependency
|
255
238
|
name: rails-csv-fixtures
|
256
239
|
requirement: !ruby/object:Gem::Requirement
|
257
|
-
none: false
|
258
240
|
requirements:
|
259
241
|
- - ! '>='
|
260
242
|
- !ruby/object:Gem::Version
|
@@ -262,7 +244,6 @@ dependencies:
|
|
262
244
|
type: :development
|
263
245
|
prerelease: false
|
264
246
|
version_requirements: !ruby/object:Gem::Requirement
|
265
|
-
none: false
|
266
247
|
requirements:
|
267
248
|
- - ! '>='
|
268
249
|
- !ruby/object:Gem::Version
|
@@ -273,90 +254,97 @@ executables: []
|
|
273
254
|
extensions: []
|
274
255
|
extra_rdoc_files: []
|
275
256
|
files:
|
276
|
-
- lib/
|
277
|
-
- lib/
|
278
|
-
- lib/
|
279
|
-
- lib/tasks/db_config.rake
|
280
|
-
- lib/tasks/nginx.app.conf.erb
|
281
|
-
- lib/tasks/unicorn.erb
|
282
|
-
- lib/tasks/jenkins
|
283
|
-
- lib/tasks/nginx.rake
|
284
|
-
- lib/tasks/db_fixtures.rake
|
285
|
-
- lib/tasks/cucumber.rake
|
286
|
-
- lib/tasks/jenkins.conf
|
287
|
-
- lib/tasks/cucumber_install.rake
|
288
|
-
- lib/tasks/database.yml.erb
|
289
|
-
- lib/tasks/nginx.repo
|
290
|
-
- lib/tasks/phantomjs.rake
|
291
|
-
- lib/tasks/test.rake
|
292
|
-
- lib/tasks/nginx.conf.erb
|
293
|
-
- lib/tasks/db_create.rake
|
294
|
-
- lib/tasks/nginx.jenkins.conf.erb
|
295
|
-
- lib/tasks/publish.rake
|
296
|
-
- lib/tasks/jenkins.rake
|
297
|
-
- lib/tasks/cucumber_steps.rake
|
298
|
-
- lib/tasks/unicorn.rake
|
299
|
-
- lib/tasks/diary.rake
|
300
|
-
- lib/tasks/unicorn.rb.erb
|
301
|
-
- lib/daddy/ocr.rb
|
302
|
-
- lib/daddy/railtie.rb
|
303
|
-
- lib/daddy/cucumber/diff.rb
|
304
|
-
- lib/daddy/cucumber/html.rb
|
305
|
-
- lib/daddy/cucumber/capture.rb
|
257
|
+
- lib/daddy.rb
|
258
|
+
- lib/daddy/cucumber.rb
|
259
|
+
- lib/daddy/cucumber/pause.rb
|
306
260
|
- lib/daddy/cucumber/puts.rb
|
307
|
-
- lib/daddy/cucumber/
|
261
|
+
- lib/daddy/cucumber/capture.rb
|
308
262
|
- lib/daddy/cucumber/formatting.rb
|
309
|
-
- lib/daddy/cucumber/
|
310
|
-
- lib/daddy/cucumber/step_definitions/click.rb
|
311
|
-
- lib/daddy/cucumber/step_definitions/select.rb
|
263
|
+
- lib/daddy/cucumber/html.rb
|
312
264
|
- lib/daddy/cucumber/step_definitions/fill_in.rb
|
265
|
+
- lib/daddy/cucumber/step_definitions/select.rb
|
266
|
+
- lib/daddy/cucumber/step_definitions/click.rb
|
313
267
|
- lib/daddy/cucumber/step_definitions/common.rb
|
268
|
+
- lib/daddy/cucumber/assert.rb
|
314
269
|
- lib/daddy/cucumber/table.rb
|
315
|
-
- lib/daddy/
|
316
|
-
- lib/daddy/
|
317
|
-
- lib/daddy/
|
318
|
-
- lib/daddy/
|
270
|
+
- lib/daddy/cucumber/diff.rb
|
271
|
+
- lib/daddy/helpers/html_helper.rb
|
272
|
+
- lib/daddy/capistrano/remote_cache_subdir.rb
|
273
|
+
- lib/daddy/http_client.rb
|
274
|
+
- lib/daddy/ocr.rb
|
275
|
+
- lib/daddy/git.rb
|
276
|
+
- lib/daddy/rails/hooks.rb
|
277
|
+
- lib/daddy/rails/quiet_assets.rb
|
278
|
+
- lib/daddy/model.rb
|
319
279
|
- lib/daddy/formatter/menu.html.erb
|
280
|
+
- lib/daddy/formatter/html.rb
|
320
281
|
- lib/daddy/formatter/daddy_html.rb
|
282
|
+
- lib/daddy/formatter/daddy.css
|
283
|
+
- lib/daddy/formatter/cucumber.css
|
284
|
+
- lib/daddy/formatter/daddy.js
|
321
285
|
- lib/daddy/formatter/jquery-min.js
|
322
|
-
- lib/daddy/
|
323
|
-
- lib/daddy/rails/quiet_assets.rb
|
324
|
-
- lib/daddy/rails/hooks.rb
|
286
|
+
- lib/daddy/railtie.rb
|
325
287
|
- lib/daddy/models/crud_extension.rb
|
326
288
|
- lib/daddy/models/query_extension.rb
|
327
|
-
- lib/daddy/
|
328
|
-
- lib/daddy/capistrano/remote_cache_subdir.rb
|
329
|
-
- lib/daddy/helpers/html_helper.rb
|
289
|
+
- lib/daddy/differ/html_patch.rb
|
330
290
|
- lib/daddy/utils/sql_utils.rb
|
331
291
|
- lib/daddy/utils/string_utils.rb
|
332
|
-
- lib/daddy/http_client.rb
|
333
|
-
- lib/daddy/model.rb
|
334
|
-
- lib/daddy/cucumber.rb
|
335
|
-
- lib/daddy.rb
|
336
292
|
- lib/sql_builder.rb
|
293
|
+
- lib/ssl/cert.pem
|
294
|
+
- lib/tasks/tesseract.rake
|
295
|
+
- lib/tasks/jenkins
|
296
|
+
- lib/tasks/nginx.repo
|
297
|
+
- lib/tasks/nginx.jenkins.conf.erb
|
298
|
+
- lib/tasks/jenkins.rake
|
299
|
+
- lib/tasks/dad.rake
|
300
|
+
- lib/tasks/db_config.rake
|
301
|
+
- lib/tasks/publish.rake
|
302
|
+
- lib/tasks/cucumber_steps.rake
|
303
|
+
- lib/tasks/unicorn.rb.erb
|
304
|
+
- lib/tasks/db_fixtures.rake
|
305
|
+
- lib/tasks/cucumber.rake
|
306
|
+
- lib/tasks/nginx.rake
|
307
|
+
- lib/tasks/jenkins.conf
|
308
|
+
- lib/tasks/generate/controller.rake
|
309
|
+
- lib/tasks/generate/view.rake
|
310
|
+
- lib/tasks/generate/templates/index.html.erb
|
311
|
+
- lib/tasks/generate/templates/show.html.erb
|
312
|
+
- lib/tasks/generate/templates/edit.html.erb
|
313
|
+
- lib/tasks/generate/templates/new.html.erb
|
314
|
+
- lib/tasks/generate/templates/controller.rb.erb
|
315
|
+
- lib/tasks/generate/templates/_form.html.erb
|
316
|
+
- lib/tasks/cucumber_install.rake
|
317
|
+
- lib/tasks/unicorn.rake
|
318
|
+
- lib/tasks/diary.rake
|
319
|
+
- lib/tasks/db_create.rake
|
320
|
+
- lib/tasks/unicorn.erb
|
321
|
+
- lib/tasks/test.rake
|
322
|
+
- lib/tasks/phantomjs.rake
|
323
|
+
- lib/tasks/database.yml.erb
|
324
|
+
- lib/tasks/nginx.app.conf.erb
|
325
|
+
- lib/tasks/nginx.conf.erb
|
337
326
|
homepage: https://github.com/ichylinux/daddy
|
338
327
|
licenses:
|
339
328
|
- MIT
|
329
|
+
metadata: {}
|
340
330
|
post_install_message:
|
341
331
|
rdoc_options: []
|
342
332
|
require_paths:
|
343
333
|
- lib
|
344
334
|
required_ruby_version: !ruby/object:Gem::Requirement
|
345
|
-
none: false
|
346
335
|
requirements:
|
347
336
|
- - ! '>='
|
348
337
|
- !ruby/object:Gem::Version
|
349
338
|
version: '0'
|
350
339
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
351
|
-
none: false
|
352
340
|
requirements:
|
353
341
|
- - ! '>='
|
354
342
|
- !ruby/object:Gem::Version
|
355
343
|
version: '0'
|
356
344
|
requirements: []
|
357
345
|
rubyforge_project:
|
358
|
-
rubygems_version:
|
346
|
+
rubygems_version: 2.0.3
|
359
347
|
signing_key:
|
360
|
-
specification_version:
|
348
|
+
specification_version: 4
|
361
349
|
summary: My rails dad
|
362
350
|
test_files: []
|