daddy 0.1.20 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTMzNjJlOTUzYzJjOTg2MTEzMjM3YTcwYzA1OGU2ODYzMTVmZWE0OA==
4
+ ZjVkNTQyMjg5YzkzOTcxNWU4Njc5NzdmYmE1MDYyNDhjMGZmNTZkYQ==
5
5
  data.tar.gz: !binary |-
6
- ZjAzMDk4MWZjYzQ1MzQyNzZmYzY5NmIyNGExM2NkMjVhZjBhZmFkMA==
6
+ YjRkZjdmYzM1ODEzY2RhZGFjNjNjYjE1Njc2MTRjYTcwZmJjMDI2OA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZTgxZTYzYmJjOWVkYmFhZmFmNzUzMzlhODFhNDY0Yjg3Mzg1ZDNiNzhmM2Jl
10
- OTliNjc0YTY3ZGJlNGUwMTEzMTZkZGM3YmVlMGM2ODY3NmNhZDVlODM5MzM5
11
- MzI5MjBmNTljZmIzODQwMjVmZmRkODY0ZGEwZWU3NTIwNWM3ZTU=
9
+ ZTQxZTAzYzhkYmE0NWUxN2M0ZDQ5YmEwYjlkZjI5ODEzY2RhYzY0ZTNiN2Q5
10
+ ZTBiM2ZlMzZhNzQ0YzdlNWFmOWU4Nzk0ZWJiZDdmNTIzYjkxNmNiN2YzOTI4
11
+ YTVhOTg3OWQzYzdjZmM1YTk4YzQwZDJmMGQ2MWMwODBhYzZlNzA=
12
12
  data.tar.gz: !binary |-
13
- NGFiY2ZhMzY3M2RmZDlkYWU1ODcxMjgyNmM4ODU5ZTQ5ZmI5ZTc0ZGRiZmNh
14
- NzU1Y2ZkMWY2N2Y0OWNlYTg3NWRjYmFkM2U0YTU3NzRiMWNkZTVhOGE5YWYz
15
- MWJhZDVlMDZlMzk5MTdjYjRhOGYzNDJhZTI4MmMzNmI4MDk3YTY=
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
@@ -55,7 +55,7 @@ AfterConfiguration do |configuration|
55
55
  }
56
56
  end
57
57
 
58
- require_relative 'rails/hooks' if defined?(Rails)
58
+ require_relative 'cucumber/hooks/database' if defined?(Rails)
59
59
 
60
60
  Before do
61
61
  resize_window(1280, 720)
@@ -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
- <div>#{url}</div>
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)
@@ -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
@@ -90,19 +90,22 @@ module Daddy
90
90
  end
91
91
 
92
92
  def before_comment(comment)
93
- return if comment == '# language: ja'
94
- @builder << '<pre class="comment">'
93
+ unless magic_comment?(comment)
94
+ @builder << '<pre class="comment">'
95
+ end
95
96
  end
96
97
 
97
98
  def after_comment(comment)
98
- return if comment == '# language: ja'
99
- @builder << '</pre>'
99
+ unless magic_comment?(comment)
100
+ @builder << '</pre>'
101
+ end
100
102
  end
101
103
 
102
104
  def comment_line(comment_line)
103
- return if comment_line == '# language: ja'
104
- @builder.text!(comment_line)
105
- @builder.br
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
- unless name.strip.blank?
125
- @builder.span('(' + name.strip + ')', :class => 'feature_subtitle')
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.p(:class => 'narrative') do
133
- lines[1..-1].each do |line|
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
@@ -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 if b.index('HEAD')
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', '').to_i <=> a.sub('remotes/origin/p', '').to_i
26
+ b.sub('remotes/origin/p', '').to_f <=> a.sub('remotes/origin/p', '').to_f
29
27
  else
30
- b.sub('p', '').to_i <=> a.sub('p', '').to_i
28
+ b.sub('p', '').to_f <=> a.sub('p', '').to_f
31
29
  end
32
30
  end
33
31
  end
@@ -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.20
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-14 00:00:00.000000000 Z
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