daddy 0.0.12 → 0.0.13

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGEyMjVlZDlmZjAwYTY5Yzk2YTg3YjRkN2IxMjI1NDg2MzcwNWY2OQ==
4
+ YjJjYWFmMDVmYTdiMGZhZWQwZTIwYTViMWRhM2U5MmFiODcwY2Y5Ng==
5
5
  data.tar.gz: !binary |-
6
- MzkyOWZlMWQ5YjJjMjE2MDUzYWFlNmU1OGJkNzZhZTc3MGQwMDdlNw==
6
+ NzZkYmE0NTRlNDY1NWFjOTAxOGIyNzBlYWMwOGY0YWYyNjVmMmE4Nw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NWI1ODdlNWE5ZDYwNjkwYjkyNWFmYjU2NjljNjk4ZTdiNGU0NjExNDEzMDUz
10
- M2Q4ZjRkZGZmNTBjMThlZjVjOGI4NmMwYjlhYjFmMWYyMzY5MTkxMDI1NjU2
11
- ZDJmNzFmOGE0ZjU3MmZkNzRjZGQ1MTU3MTI5MDQ1ZGI4MTc2MGM=
9
+ YjZjNWYwOWY4MjY5ZGQ3ZjdiODk1ZTM3YTNkYTNlNWY4ZTBhNTk5YThlMTBl
10
+ ZDZjMjdjZGI1OTAyYzkzN2M3MDE5NDIzYzYwNzg4MWQ2ODIzYzIyODdjYzJi
11
+ YjQ2MDk0ZjY5OTcxNGQwMjljZDJmYjI5NDRiYTA1MmQ4NDYxYWU=
12
12
  data.tar.gz: !binary |-
13
- NDZlYmNmZDRkZDA4ZDZiMzExNTQ1ZGMzMjk4Yzk0YjUzODM4YjQ5YWViNTQ2
14
- YWQ5YmIwZWUxMmZmOTI2YjE4NjRkMDNkMjhkZjlhNDliNjRmMzM3Mzg5NWIy
15
- MjFmZDYzNTU4ZTAwNGFiODZiNWFlZGIyZmM1Mjc0MGE0ZDJiZTI=
13
+ ZWQ4OTRhZGZiNjI0OTFlMDFjYmMyYTg1MmVjNTgyNzNhZDk5ZWYwMzdiOGY0
14
+ MDQ1Y2QzMWZkYWU3ZTJlMTdlNjcxM2QxNWJiYjliZWU4YzllODhmODViODJh
15
+ Mzc2N2E0YjRlY2YxYmVmMWJmMjg2MjY2ZjA3YzJjMTUxN2QxYzg=
@@ -20,6 +20,10 @@ end
20
20
  assert_choose value
21
21
  end
22
22
 
23
+ もし /^(.*?) を空白にする$/ do |name|
24
+ assert_fill_in name, ''
25
+ end
26
+
23
27
  もし /^(.*?) に (.*?) と入力(する)?$/ do |name, value, suffix|
24
28
  assert_fill_in name, value
25
29
  end
@@ -57,6 +57,21 @@
57
57
  background: #F0F8FF;
58
58
  }
59
59
 
60
+ .cucumber ol li.message, td ol li.message, th ol li.message {
61
+ border-left: 5px solid #999999;
62
+ border-bottom: 1px solid #999999;
63
+ background: #F0F8FF;
64
+ color: #001111;
65
+ margin-left: 10px;
66
+ }
67
+
68
+ .feature_dir {
69
+ font-size: 1.5em;
70
+ font-weight: bold;
71
+ padding: 2px;
72
+ margin: 10px 10px 0px 10px;
73
+ }
74
+
60
75
  .step_contents {
61
76
  display: none;
62
77
  background: #FFFFFF;
@@ -0,0 +1,36 @@
1
+ # coding: UTF-8
2
+
3
+ module Daddy
4
+ module Formatter
5
+ module DaddyHtml
6
+
7
+ def feature_dir(feature, short = false)
8
+ ret = ''
9
+
10
+ split = feature.file.split('/')
11
+ split.reverse[1..-1].each_with_index do |dir, i|
12
+ break if dir == '仕様書' or dir == '開発日記'
13
+
14
+ if i == 0
15
+ if short
16
+ ret = dir.split('.').first + '.'
17
+ else
18
+ ret = dir
19
+ end
20
+ else
21
+ ret = dir.split('.').first + '.' + ret
22
+ end
23
+ end
24
+
25
+ ret
26
+ end
27
+
28
+ def should_expand
29
+ return false unless ENV['EXPAND']
30
+ return false if ['f', 'false'].include?(ENV['EXPAND'].downcase)
31
+ true
32
+ end
33
+
34
+ end
35
+ end
36
+ end
@@ -4,6 +4,7 @@ require 'erb'
4
4
  require 'cucumber/formatter/ordered_xml_markup'
5
5
  require 'cucumber/formatter/duration'
6
6
  require 'cucumber/formatter/io'
7
+ require 'daddy/formatter/daddy_html'
7
8
 
8
9
  module Daddy
9
10
  module Formatter
@@ -11,6 +12,7 @@ module Daddy
11
12
  include ERB::Util # for the #h method
12
13
  include ::Cucumber::Formatter::Duration
13
14
  include ::Cucumber::Formatter::Io
15
+ include Daddy::Formatter::DaddyHtml
14
16
 
15
17
  def initialize(runtime, path_or_io, options)
16
18
  @path_or_io = path_or_io
@@ -108,6 +110,14 @@ module Daddy
108
110
  end
109
111
 
110
112
  def before_feature(feature)
113
+ dir = feature_dir(feature)
114
+ if @feature_dir != dir
115
+ @builder << '<div class="feature_dir"><span class="val">'
116
+ @builder << dir
117
+ @builder << '</span></div>'
118
+ end
119
+
120
+ @feature_dir = dir
111
121
  @feature = feature
112
122
  @exceptions = []
113
123
  @builder << '<div class="feature">'
@@ -144,7 +154,7 @@ module Daddy
144
154
  end
145
155
 
146
156
  def feature_name(keyword, name)
147
- title = @feature.file.split('/').last.gsub(/\.feature/, '')
157
+ title = feature_dir(@feature, true) + @feature.file.split('/').last.gsub(/\.feature/, '')
148
158
 
149
159
  @builder.h2 do |h2|
150
160
  @builder.span(title, :class => 'val')
@@ -576,17 +586,17 @@ module Daddy
576
586
  @builder.script do
577
587
  @builder << inline_jquery
578
588
  @builder << inline_js_content
579
- if ENV['EXPAND']
589
+ if should_expand
580
590
  @builder << %w{
581
591
  $(document).ready(function() {
582
592
  $(SCENARIOS).siblings().show();
583
- $('li.message').show();
593
+ $('li.message').hide();
584
594
  });
585
595
  }.join
586
596
  else
587
597
  @builder << %w{
588
598
  $(document).ready(function() {
589
- $(SCENARIOS).siblings().show();
599
+ $(SCENARIOS).siblings().hide();
590
600
  $('li.message').hide();
591
601
  });
592
602
  }.join
@@ -619,6 +629,7 @@ module Daddy
619
629
  $("#expander").click(function() {
620
630
  $(SCENARIOS).siblings().show();
621
631
  });
632
+
622
633
  })
623
634
 
624
635
  function moveProgressBar(percentDone) {
@@ -3,12 +3,13 @@
3
3
  require 'rake'
4
4
 
5
5
  namespace :dad do
6
+
6
7
  task :cucumber => :environment do |t, args|
7
- phase_no = `git branch`.gsub(/[a-zA-Z]*/, '').to_i
8
8
  driver = ENV['DRIVER'] || :webkit
9
9
  pause = ENV['PAUSE'] || 0
10
10
  coverage = ENV['COVERAGE'] || true
11
- options = "PHASE_NO=#{phase_no} DRIVER=#{driver} PAUSE=#{pause} COVERAGE=#{coverage}"
11
+ expand = ENV['EXPAND']
12
+ options = "DRIVER=#{driver} PAUSE=#{pause} COVERAGE=#{coverage} EXPAND=#{expand}"
12
13
 
13
14
  output_file = ENV['OUTPUT_FILE'] || 'index.html'
14
15
 
@@ -1,4 +1,4 @@
1
- # coding: utf-8
1
+ # coding: UTF-8
2
2
 
3
3
  require 'rake'
4
4
 
@@ -1,6 +1,7 @@
1
1
  # coding: UTF-8
2
+
2
3
  require 'rake'
3
4
 
4
5
  task :dad do
5
- system('rake -aT | grep dad:')
6
+ system('rake -T | grep dad:')
6
7
  end
@@ -4,6 +4,8 @@ require 'rake'
4
4
 
5
5
  namespace :dad do
6
6
  namespace :db do
7
+
8
+ desc 'database.yml を生成します。'
7
9
  task :config do
8
10
  pwd = `pwd`.strip
9
11
  command = "APP_NAME=#{File.basename(pwd)} erb -T - #{File.dirname(__FILE__)}/database.yml.erb > config/database.yml"
@@ -4,6 +4,8 @@ require 'rake'
4
4
 
5
5
  namespace :dad do
6
6
  namespace :db do
7
+
8
+ desc 'database.yml に従ってDBを作成します。'
7
9
  task :create do
8
10
  config = YAML.load_file("#{Rails.root}/config/database.yml")
9
11
 
@@ -0,0 +1,33 @@
1
+ # coding: UTF-8
2
+
3
+ require 'rake'
4
+
5
+ namespace :dad do
6
+
7
+ desc '本日用の日記を準備します。'
8
+ task :diary do
9
+ today = Date.today.strftime('%Y-%m-%d')
10
+
11
+ system("rake dad:cucumber:install")
12
+
13
+ today = Date.today.strftime('%Y-%m-%d')
14
+
15
+ feature = "features/開発日記/#{today}.feature"
16
+ if File.exist?(feature)
17
+ puts "すでに #{feature} が存在します。上書きはしません。"
18
+ else
19
+ system("echo '# language: ja' > #{feature}")
20
+ system("echo >> #{feature}")
21
+ system("echo '機能:' >> #{feature}")
22
+ system("echo >> #{feature}")
23
+ end
24
+
25
+ step = "features/step_definitions/開発日記/#{today}.rb"
26
+ if File.exist?(step)
27
+ puts "すでに #{step} が存在します。上書きはしません。"
28
+ else
29
+ system("echo '# coding: UTF-8' > #{step}")
30
+ system("echo >> #{step}")
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,100 @@
1
+ ## Path: Development/Jenkins
2
+ ## Description: Configuration for the Jenkins continuous build server
3
+ ## Type: string
4
+ ## Default: "/var/lib/jenkins"
5
+ ## ServiceRestart: jenkins
6
+ #
7
+ # Directory where Jenkins store its configuration and working
8
+ # files (checkouts, build reports, artifacts, ...).
9
+ #
10
+ JENKINS_HOME="/var/lib/jenkins"
11
+
12
+ ## Type: string
13
+ ## Default: ""
14
+ ## ServiceRestart: jenkins
15
+ #
16
+ # Java executable to run Jenkins
17
+ # When left empty, we'll try to find the suitable Java.
18
+ #
19
+ JENKINS_JAVA_CMD=""
20
+
21
+ ## Type: string
22
+ ## Default: "jenkins"
23
+ ## ServiceRestart: jenkins
24
+ #
25
+ # Unix user account that runs the Jenkins daemon
26
+ # Be careful when you change this, as you need to update
27
+ # permissions of $JENKINS_HOME and /var/log/jenkins.
28
+ #
29
+ JENKINS_USER="jenkins"
30
+
31
+ ## Type: string
32
+ ## Default: "-Djava.awt.headless=true"
33
+ ## ServiceRestart: jenkins
34
+ #
35
+ # Options to pass to java when running Jenkins.
36
+ #
37
+ JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
38
+
39
+ ## Type: integer(0:65535)
40
+ ## Default: 8080
41
+ ## ServiceRestart: jenkins
42
+ #
43
+ # Port Jenkins is listening on.
44
+ # Set to -1 to disable
45
+ #
46
+ JENKINS_PORT="8081"
47
+
48
+ ## Type: integer(0:65535)
49
+ ## Default: 8009
50
+ ## ServiceRestart: jenkins
51
+ #
52
+ # Ajp13 Port Jenkins is listening on.
53
+ # Set to -1 to disable
54
+ #
55
+ JENKINS_AJP_PORT="-1"
56
+
57
+ ## Type: integer(1:9)
58
+ ## Default: 5
59
+ ## ServiceRestart: jenkins
60
+ #
61
+ # Debug level for logs -- the higher the value, the more verbose.
62
+ # 5 is INFO.
63
+ #
64
+ JENKINS_DEBUG_LEVEL="5"
65
+
66
+ ## Type: yesno
67
+ ## Default: no
68
+ ## ServiceRestart: jenkins
69
+ #
70
+ # Whether to enable access logging or not.
71
+ #
72
+ JENKINS_ENABLE_ACCESS_LOG="no"
73
+
74
+ ## Type: integer
75
+ ## Default: 100
76
+ ## ServiceRestart: jenkins
77
+ #
78
+ # Maximum number of HTTP worker threads.
79
+ #
80
+ JENKINS_HANDLER_MAX="100"
81
+
82
+ ## Type: integer
83
+ ## Default: 20
84
+ ## ServiceRestart: jenkins
85
+ #
86
+ # Maximum number of idle HTTP worker threads.
87
+ #
88
+ JENKINS_HANDLER_IDLE="20"
89
+
90
+ ## Type: string
91
+ ## Default: ""
92
+ ## ServiceRestart: jenkins
93
+ #
94
+ # Pass arbitrary arguments to Jenkins.
95
+ # Full option list: java -jar jenkins.war --help
96
+ #
97
+ JENKINS_ARGS="--prefix=/jenkins"
98
+
99
+ export QMAKE=/usr/bin/qmake-qt4
100
+ export PATH="${PATH}":/usr/local/bin
@@ -0,0 +1,3 @@
1
+ ProxyPass /jenkins http://localhost:8081/jenkins
2
+ ProxyPassReverse /jenkins http://localhost:8081/jenkins
3
+ ProxyRequests Off
@@ -0,0 +1,28 @@
1
+ # coding: UTF-8
2
+
3
+ require 'rake'
4
+
5
+ namespace :dad do
6
+ namespace :jenkins do
7
+
8
+ desc 'Jenkinsをインストールします。'
9
+ task :install do
10
+ [
11
+ "sudo bash #{File.dirname(__FILE__)}/jenkins_install.sh",
12
+ "sudo cp -f #{File.dirname(__FILE__)}/jenkins.conf /etc/httpd/conf.d",
13
+ "sudo cp -f #{File.dirname(__FILE__)}/jenkins /etc/sysconfig",
14
+ "sudo chown root:root /etc/sysconfig/jenkins",
15
+ "sudo chmod 600 /etc/sysconfig/jenkins",
16
+ "sudo wget http://updates.jenkins-ci.org/download/plugins/build-pipeline-plugin/1.3.3/build-pipeline-plugin.hpi -O /var/lib/jenkins/plugins/build-pipeline-plugin.hpi",
17
+ "sudo wget http://updates.jenkins-ci.org/download/plugins/git/1.1.26/git.hpi -O /var/lib/jenkins/plugins/git.hpi",
18
+ "sudo wget http://updates.jenkins-ci.org/download/plugins/rake/1.7.7/rake.hpi -O /var/lib/jenkins/plugins/rake.hpi",
19
+ "sudo wget http://updates.jenkins-ci.org/download/plugins/rubyMetrics/1.5.0/rubyMetrics.hpi -O /var/lib/jenkins/plugins/rubyMetrics.hpi",
20
+ ].each do |command|
21
+ puts command
22
+ system(command)
23
+ end
24
+ end
25
+
26
+ end
27
+
28
+ end
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ echo "ライブラリのインストール"
4
+ yum install httpd-devel libxslt-devel libxml2-devel qt-webkit-devel Xvfb
5
+
6
+ echo "リポジトリ情報を取得"
7
+ wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
8
+ rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
9
+
10
+ echo "Jenkinsをインストール"
11
+ yum install jenkins
@@ -6,8 +6,8 @@ namespace :dad do
6
6
  task :publish do
7
7
  system("mkdir -p features/reports")
8
8
  system("bundle exec rake db:test:prepare")
9
- system("bundle exec rake dad:cucumber PUBLISH=true OUTPUT_FILE=diary.html features/開発日記")
10
- system("bundle exec rake dad:cucumber PUBLISH=true OUTPUT_FILE=index.html features/仕様書")
9
+ system("bundle exec rake dad:cucumber PUBLISH=true EXPAND=false OUTPUT_FILE=diary.html features/開発日記")
10
+ system("bundle exec rake dad:cucumber PUBLISH=true EXPAND=false OUTPUT_FILE=index.html features/仕様書")
11
11
 
12
12
  system("mkdir -p tmp")
13
13
 
@@ -3,6 +3,8 @@
3
3
  require 'rake'
4
4
 
5
5
  namespace :dad do
6
+
7
+ desc 'Cucumberを使用してテストを実行します。'
6
8
  task :test => :environment do
7
9
  system("mkdir -p features/reports")
8
10
  system("bundle exec rake db:test:prepare")
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-20 00:00:00.000000000 Z
11
+ date: 2013-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: capistrano
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ! '>='
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ! '>='
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: capybara
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -140,16 +126,16 @@ dependencies:
140
126
  name: rails
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
- - - ! '>='
129
+ - - ~>
144
130
  - !ruby/object:Gem::Version
145
- version: '0'
131
+ version: 3.2.0
146
132
  type: :runtime
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
- - - ! '>='
136
+ - - ~>
151
137
  - !ruby/object:Gem::Version
152
- version: '0'
138
+ version: 3.2.0
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: rails-i18n
155
141
  requirement: !ruby/object:Gem::Requirement
@@ -211,16 +197,22 @@ files:
211
197
  - lib/daddy/git.rb
212
198
  - lib/daddy/formatter/menu.html.erb
213
199
  - lib/daddy/formatter/html.rb
200
+ - lib/daddy/formatter/daddy_html.rb
214
201
  - lib/daddy/formatter/daddy.css
215
202
  - lib/daddy/formatter/cucumber.css
216
203
  - lib/daddy/formatter/jquery-min.js
217
204
  - lib/daddy/railtie.rb
205
+ - lib/tasks/jenkins
206
+ - lib/tasks/jenkins.rake
218
207
  - lib/tasks/dad.rake
219
208
  - lib/tasks/db_config.rake
220
209
  - lib/tasks/publish.rake
221
210
  - lib/tasks/cucumber_steps.rake
211
+ - lib/tasks/jenkins_install.sh
222
212
  - lib/tasks/cucumber.rake
213
+ - lib/tasks/jenkins.conf
223
214
  - lib/tasks/cucumber_install.rake
215
+ - lib/tasks/diary.rake
224
216
  - lib/tasks/db_create.rake
225
217
  - lib/tasks/test.rake
226
218
  - lib/tasks/database.yml.erb