daddy 0.1.20 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/bin/dad +70 -0
- data/lib/daddy/cucumber.rb +1 -1
- data/lib/daddy/cucumber/capture.rb +3 -5
- data/lib/daddy/{rails/hooks.rb → cucumber/hooks/database.rb} +0 -0
- data/lib/daddy/formatter/daddy.css +12 -0
- data/lib/daddy/formatter/daddy_html.rb +10 -0
- data/lib/daddy/formatter/html.rb +17 -15
- data/lib/daddy/git.rb +3 -5
- data/lib/tasks/publish.rake +3 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjVkNTQyMjg5YzkzOTcxNWU4Njc5NzdmYmE1MDYyNDhjMGZmNTZkYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjRkZjdmYzM1ODEzY2RhZGFjNjNjYjE1Njc2MTRjYTcwZmJjMDI2OA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTQxZTAzYzhkYmE0NWUxN2M0ZDQ5YmEwYjlkZjI5ODEzY2RhYzY0ZTNiN2Q5
|
10
|
+
ZTBiM2ZlMzZhNzQ0YzdlNWFmOWU4Nzk0ZWJiZDdmNTIzYjkxNmNiN2YzOTI4
|
11
|
+
YTVhOTg3OWQzYzdjZmM1YTk4YzQwZDJmMGQ2MWMwODBhYzZlNzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTJmZTgzMGYwMTUxY2NkMjQyMTkzMDc4M2U4MTcwZjlmYzJjMDM3ZWY1Mjg4
|
14
|
+
OWE2MDBjMzc3OTAzMzY4NDgzODAyNTQ2OGU2MDgzMzZkYzJkNzA4ODczZGE2
|
15
|
+
NWI3NmU0ZGZkZTdjMGUyZTI4YmU2YWI5NDBjNmY1MDQ2NGU3Yzk=
|
data/bin/dad
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
GEMFILE = <<-EOF
|
4
|
+
source 'https://rubygems.org'
|
5
|
+
|
6
|
+
gem 'rails', '3.2.15'
|
7
|
+
|
8
|
+
# Bundle edge Rails instead:
|
9
|
+
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
10
|
+
|
11
|
+
gem 'daddy'
|
12
|
+
gem 'mysql2'
|
13
|
+
|
14
|
+
# Gems used only for assets and not required
|
15
|
+
# in production environments by default.
|
16
|
+
group :assets do
|
17
|
+
gem 'sass-rails', '~> 3.2.3'
|
18
|
+
gem 'coffee-rails', '~> 3.2.1'
|
19
|
+
|
20
|
+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
21
|
+
# gem 'therubyracer', :platforms => :ruby
|
22
|
+
|
23
|
+
gem 'uglifier', '>= 1.0.3'
|
24
|
+
end
|
25
|
+
|
26
|
+
gem 'jquery-rails'
|
27
|
+
|
28
|
+
group :development, :test do
|
29
|
+
gem 'thin'
|
30
|
+
end
|
31
|
+
|
32
|
+
# To use ActiveModel has_secure_password
|
33
|
+
# gem 'bcrypt-ruby', '~> 3.0.0'
|
34
|
+
|
35
|
+
# To use Jbuilder templates for JSON
|
36
|
+
# gem 'jbuilder'
|
37
|
+
|
38
|
+
# Use unicorn as the app server
|
39
|
+
gem 'unicorn'
|
40
|
+
|
41
|
+
# Deploy with Capistrano
|
42
|
+
# gem 'capistrano'
|
43
|
+
|
44
|
+
# To use debugger
|
45
|
+
# gem 'debugger'
|
46
|
+
EOF
|
47
|
+
|
48
|
+
ROUTES = <<-EOF
|
49
|
+
Banbanlive::Application.routes.draw do
|
50
|
+
# root :to => 'welcome#index'
|
51
|
+
end
|
52
|
+
EOF
|
53
|
+
|
54
|
+
action = ARGV[0]
|
55
|
+
|
56
|
+
if action == 'new'
|
57
|
+
app_name = ARGV[1]
|
58
|
+
rails_version = "3.2.15"
|
59
|
+
|
60
|
+
[
|
61
|
+
"rails _#{rails_version}_ new #{app_name} -d mysql --skip-bundle",
|
62
|
+
"echo \"#{GEMFILE}\" > #{app_name}/Gemfile",
|
63
|
+
"echo \"#{ROUTES}\" > #{app_name}/config/routes.rb",
|
64
|
+
"cd #{app_name} && sudo bundle install",
|
65
|
+
"cd #{app_name} && bundle exec rake dad:install",
|
66
|
+
"cd #{app_name} && bundle exec rake dad:db:config",
|
67
|
+
].each do |command|
|
68
|
+
exit 1 unless system(command)
|
69
|
+
end
|
70
|
+
end
|
data/lib/daddy/cucumber.rb
CHANGED
@@ -9,7 +9,7 @@ module Daddy
|
|
9
9
|
|
10
10
|
@@_screen_count = 0
|
11
11
|
|
12
|
-
def capture
|
12
|
+
def capture(options = {})
|
13
13
|
pause
|
14
14
|
|
15
15
|
url = Rack::Utils.unescape(current_url)
|
@@ -19,10 +19,8 @@ module Daddy
|
|
19
19
|
image = "#{IMAGE_DIR}/#{@@_screen_count}.png"
|
20
20
|
page.driver.save_screenshot("#{REPORT_DIR}/#{image}")
|
21
21
|
|
22
|
-
puts
|
23
|
-
|
24
|
-
<img class="screenshot" src="#{image}"/>
|
25
|
-
}
|
22
|
+
puts "<div>#{url}</div>" unless options[:suppress_url]
|
23
|
+
puts "<img class=\"screenshot\" src=\"#{image}\"/>"
|
26
24
|
end
|
27
25
|
|
28
26
|
def resize_window(width, height)
|
File without changes
|
@@ -99,6 +99,12 @@ div.contents {
|
|
99
99
|
}
|
100
100
|
|
101
101
|
div.feature .narrative {
|
102
|
+
margin: 10px;
|
103
|
+
line-height: 1.5em;
|
104
|
+
font-size: 1.2em;
|
105
|
+
}
|
106
|
+
|
107
|
+
div.feature .narrative > div {
|
102
108
|
margin-left: 10px;
|
103
109
|
}
|
104
110
|
|
@@ -181,3 +187,9 @@ del.differ {
|
|
181
187
|
max-width: 98%;
|
182
188
|
max-height: 98%;
|
183
189
|
}
|
190
|
+
|
191
|
+
blockquote {
|
192
|
+
border: solid 1px #999999;
|
193
|
+
border-radius: 5px 5px;
|
194
|
+
padding: 5px;
|
195
|
+
}
|
@@ -63,6 +63,16 @@ module Daddy
|
|
63
63
|
['t', 'true'].include?(ENV['EXPAND'].to_s.downcase)
|
64
64
|
end
|
65
65
|
|
66
|
+
def magic_comment?(comment_line)
|
67
|
+
comment = comment_line.to_s
|
68
|
+
|
69
|
+
['language', 'format'].each do |magic|
|
70
|
+
return true if /#\s*#{magic}\s*:.*/ =~ comment
|
71
|
+
end
|
72
|
+
|
73
|
+
false
|
74
|
+
end
|
75
|
+
|
66
76
|
end
|
67
77
|
end
|
68
78
|
end
|
data/lib/daddy/formatter/html.rb
CHANGED
@@ -90,19 +90,22 @@ module Daddy
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def before_comment(comment)
|
93
|
-
|
94
|
-
|
93
|
+
unless magic_comment?(comment)
|
94
|
+
@builder << '<pre class="comment">'
|
95
|
+
end
|
95
96
|
end
|
96
97
|
|
97
98
|
def after_comment(comment)
|
98
|
-
|
99
|
-
|
99
|
+
unless magic_comment?(comment)
|
100
|
+
@builder << '</pre>'
|
101
|
+
end
|
100
102
|
end
|
101
103
|
|
102
104
|
def comment_line(comment_line)
|
103
|
-
|
104
|
-
|
105
|
-
|
105
|
+
unless magic_comment?(comment_line)
|
106
|
+
@builder.text!(comment_line)
|
107
|
+
@builder.br
|
108
|
+
end
|
106
109
|
end
|
107
110
|
|
108
111
|
def after_tags(tags)
|
@@ -117,23 +120,22 @@ module Daddy
|
|
117
120
|
|
118
121
|
def feature_name(keyword, name)
|
119
122
|
title = feature_dir(@feature, true) + @feature.file.split('/').last.gsub(/\.feature/, '')
|
123
|
+
lines = name.split(/\r?\n/)
|
120
124
|
|
121
125
|
@builder.h2 do |h2|
|
122
126
|
@builder.span(:class => 'val') do
|
123
127
|
@builder << title
|
124
|
-
|
125
|
-
|
128
|
+
|
129
|
+
subtitle = lines.first.to_s.strip
|
130
|
+
unless subtitle.blank?
|
131
|
+
@builder.span('(' + subtitle + ')', :class => 'feature_subtitle')
|
126
132
|
end
|
127
133
|
end
|
128
134
|
end
|
129
135
|
|
130
|
-
lines = name.split(/\r?\n/)
|
131
136
|
if lines.size > 1
|
132
|
-
@builder.
|
133
|
-
lines[1..-1].
|
134
|
-
@builder.text!(line.strip)
|
135
|
-
@builder.br
|
136
|
-
end
|
137
|
+
@builder.div(:class => 'narrative') do
|
138
|
+
@builder << lines[1..-1].join("\n")
|
137
139
|
end
|
138
140
|
end
|
139
141
|
end
|
data/lib/daddy/git.rb
CHANGED
@@ -7,9 +7,7 @@ module Daddy
|
|
7
7
|
def branches(remote = false)
|
8
8
|
branches = []
|
9
9
|
`git branch -a`.split("\n").each do |b|
|
10
|
-
next
|
11
|
-
next if b.index('gh-pages')
|
12
|
-
next unless b.index('remotes/origin/')
|
10
|
+
next unless b.index('remotes/origin/master') or b.index(/remotes\/origin\/p[0-9]+(\.[0-9]+)?/)
|
13
11
|
|
14
12
|
if remote
|
15
13
|
branches << b.strip
|
@@ -25,9 +23,9 @@ module Daddy
|
|
25
23
|
1
|
26
24
|
else
|
27
25
|
if remote
|
28
|
-
b.sub('remotes/origin/p', '').
|
26
|
+
b.sub('remotes/origin/p', '').to_f <=> a.sub('remotes/origin/p', '').to_f
|
29
27
|
else
|
30
|
-
b.sub('p', '').
|
28
|
+
b.sub('p', '').to_f <=> a.sub('p', '').to_f
|
31
29
|
end
|
32
30
|
end
|
33
31
|
end
|
data/lib/tasks/publish.rake
CHANGED
@@ -47,6 +47,9 @@ namespace :dad do
|
|
47
47
|
dad_publish_extract_features(dir).each do |div|
|
48
48
|
feature = features[div['id']]
|
49
49
|
if feature
|
50
|
+
div.css('div.narrative').each do |narrative|
|
51
|
+
feature.add_child(narrative)
|
52
|
+
end
|
50
53
|
div.css('div.scenario').each do |scenario|
|
51
54
|
feature.add_child(scenario)
|
52
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ichy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -250,7 +250,8 @@ dependencies:
|
|
250
250
|
version: '0'
|
251
251
|
description: Daddy helps me build rails applications since daddy knows some good practices.
|
252
252
|
email: ichylinux@gmail.com
|
253
|
-
executables:
|
253
|
+
executables:
|
254
|
+
- dad
|
254
255
|
extensions: []
|
255
256
|
extra_rdoc_files: []
|
256
257
|
files:
|
@@ -261,6 +262,7 @@ files:
|
|
261
262
|
- lib/daddy/cucumber/capture.rb
|
262
263
|
- lib/daddy/cucumber/formatting.rb
|
263
264
|
- lib/daddy/cucumber/html.rb
|
265
|
+
- lib/daddy/cucumber/hooks/database.rb
|
264
266
|
- lib/daddy/cucumber/step_definitions/fill_in.rb
|
265
267
|
- lib/daddy/cucumber/step_definitions/select.rb
|
266
268
|
- lib/daddy/cucumber/step_definitions/click.rb
|
@@ -273,7 +275,6 @@ files:
|
|
273
275
|
- lib/daddy/http_client.rb
|
274
276
|
- lib/daddy/ocr.rb
|
275
277
|
- lib/daddy/git.rb
|
276
|
-
- lib/daddy/rails/hooks.rb
|
277
278
|
- lib/daddy/rails/quiet_assets.rb
|
278
279
|
- lib/daddy/model.rb
|
279
280
|
- lib/daddy/formatter/menu.html.erb
|
@@ -323,6 +324,7 @@ files:
|
|
323
324
|
- lib/tasks/database.yml.erb
|
324
325
|
- lib/tasks/nginx.app.conf.erb
|
325
326
|
- lib/tasks/nginx.conf.erb
|
327
|
+
- bin/dad
|
326
328
|
homepage: https://github.com/ichylinux/daddy
|
327
329
|
licenses:
|
328
330
|
- MIT
|