daddy 0.2.12 → 0.2.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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73f1816d995079c15c31166434b1901e91b7703a
4
- data.tar.gz: 88e2987c1b79e2b5c1e6ff94466c9ae5b1640431
3
+ metadata.gz: 07f46ca45e9a85190b5d6ce0717138db05aed390
4
+ data.tar.gz: 54ec45bf1cff99e654a5e153d9c50d6ff9c9bbaf
5
5
  SHA512:
6
- metadata.gz: 1950fefd2010ccb6819016e517903919ec808c615cefaab20482285339a6dc5055c7e2fa134660f0f5b33120461fa6493ed7184ad4d5791435bbcb1e599af6d8
7
- data.tar.gz: 39403aa998b88bbd11a3c53829b7e82750d99306de00450cbd4ae8e23eb497121e29bebd78854d163a188cc35a7bc7ebe8c60db09fb229f6f822d991eaaee672
6
+ metadata.gz: 39b3333f363be123447bf7122bc6cd73a67f05b86249df25962f66f9cc91e2b2dcd9c3dcd4aa68a3478f84458f767db8eec78c93c377595d7f0bbdc9e2be5c5e
7
+ data.tar.gz: f59575e2a410ecc40606bc7ba2e2ab25683c083d7bca05c9db2d2a5d71589100158f3b1e5e711ba904452df22a46dbbf38168cceff8275bb189a0d452ea3998e
@@ -1,3 +1,5 @@
1
+ require 'erb'
2
+
1
3
  module Daddy
2
4
  module Formatter
3
5
  module DaddyHtml
@@ -29,10 +31,8 @@ module Daddy
29
31
  end
30
32
 
31
33
  def make_menu_for_publish
32
- FileUtils.mkdir_p('tmp')
33
- menu = File.join('tmp', 'menu.html')
34
- system("erb -T - #{File.dirname(__FILE__)}/menu.html.erb > #{menu}")
35
- File.read(menu)
34
+ template = File.join(File.dirname(__FILE__), 'menu.html.erb')
35
+ ERB.new(File.read(template), 0, '-').result
36
36
  end
37
37
 
38
38
  def feature_id
@@ -1,7 +1,6 @@
1
1
  <%
2
- load File.dirname(File.dirname(__FILE__)) + '/git.rb'
3
2
  git = Daddy::Git.new
4
- title = ENV['TITLE'].sub(' ', '_').downcase
3
+ title = Daddy.config.cucumber.title.sub(' ', '_').downcase
5
4
  -%>
6
5
 
7
6
  <script>
@@ -1,5 +1,3 @@
1
- # coding: UTF-8
2
-
3
1
  require 'rake'
4
2
  require 'erb'
5
3
 
@@ -1,11 +1,9 @@
1
- # coding: UTF-8
2
-
3
1
  require 'daddy/git'
4
2
  require 'nokogiri'
5
3
 
6
4
  namespace :dad do
7
5
  task :publish do
8
- fail('環境編集 TITLE を指定してください。') unless ENV['TITLE'] and not ENV['TITLE'].empty?
6
+ fail('設定「cucumber.title」がありません。') unless Daddy.config.cucumber.title?
9
7
 
10
8
  if File.exist?("db/schema.rb")
11
9
  fail unless system('rake db:schema:load RAILS_ENV=test')
@@ -30,7 +28,7 @@ namespace :dad do
30
28
  branch = git.current_branch
31
29
 
32
30
  # 公開
33
- base_dir = dad_publish_base_dir(ENV['TITLE'])
31
+ base_dir = dad_publish_base_dir
34
32
  system("sudo mkdir -p #{base_dir}")
35
33
  system("sudo chown -R #{ENV['USER']}:#{ENV['USER']} #{base_dir}")
36
34
  system("mkdir -p #{base_dir}/#{branch}")
@@ -97,10 +95,10 @@ def self.dad_publish_extract_features(dir)
97
95
  ret
98
96
  end
99
97
 
100
- def self.dad_publish_base_dir(title)
101
- '/var/lib/daddy/' + dad_publish_title_to_dirname(title)
98
+ def self.dad_publish_base_dir
99
+ '/var/lib/daddy/' + dad_publish_title_to_dirname
102
100
  end
103
101
 
104
- def self.dad_publish_title_to_dirname(title)
105
- title.sub(' ', '_').downcase
102
+ def self.dad_publish_title_to_dirname
103
+ Daddy.config.cucumber.title.sub(' ', '_').downcase
106
104
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy