daddy 0.5.31 → 0.5.32

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: 7c0d7f9efe640da543b365fefac97aaca91480d8
4
- data.tar.gz: 8716d3064cf35f21ef8a84060e6038918305aae1
3
+ metadata.gz: 4a1e7094fadb79cb8e63f11b1cf31ae78e3b419c
4
+ data.tar.gz: d10a84611f3f60d6bb90670018c9933ac4156e17
5
5
  SHA512:
6
- metadata.gz: 7111d8fef60d85083567ac4481378798c670e92b3d4761eb33d4408630611bda623a868c2b9eeed1f4347c49fd6794646430aad42a675150840f6ab8b6d8ce60
7
- data.tar.gz: 59df049ad22948dbe87517745cd1e7787f59a424936b14ed787bb396f290019dc29d8361dac5f88c3fc3d6544956e21700baaa50733cec7af15f4a7c40905a63
6
+ metadata.gz: bc2e7404057a351ece154bfe878525b60f83db14f9a84ede472c5da091fb412b0d509d112e0fd696bca23620bfe6e1fba853b8734a96ae5f7b3e6d0ab475a075
7
+ data.tar.gz: 841fac960968c721711503588cf914f025dcd405b8eef2c8724e59194ba1a62d94610e22067cac25dfa8ce59658c4db067cdd33f1c4693c14dd40ebaf02dcda9
@@ -8,8 +8,16 @@ package 'python-devel' do
8
8
  user 'root'
9
9
  end
10
10
 
11
- execute 'pip install trac==1.2.2 mysql-python' do
12
- user 'root'
11
+ {
12
+ 'Trac': '1.2.2',
13
+ 'MySQL-python': nil,
14
+ 'trac-github': nil,
15
+ 'requests-oauthlib': nil
16
+ }.each do |name, version|
17
+ execute "pip install #{name}" do
18
+ user 'root'
19
+ not_if "pip list --format=freeze | egrep '#{name}==#{version ? version : '.*'}'"
20
+ end
13
21
  end
14
22
 
15
23
  directory '/var/apps' do
@@ -24,4 +32,12 @@ directory '/var/apps/trac' do
24
32
  owner ENV['USER']
25
33
  group ENV['USER']
26
34
  mode '755'
27
- end
35
+ end
36
+
37
+ template '/etc/systemd/system/tracd.service' do
38
+ user 'root'
39
+ owner 'root'
40
+ group 'root'
41
+ mode '644'
42
+ variables :user => ENV['USER'], :group => ENV['USER'], :port => 8082
43
+ end
@@ -0,0 +1,14 @@
1
+ [Unit]
2
+ Description=tracd
3
+ Wants=network-online.target
4
+ After=network-online.target
5
+
6
+ [Service]
7
+ ExecStart=/usr/bin/tracd -p <%= @port %> -e /var/apps/trac/
8
+
9
+ User=<%= @user %>
10
+ Group=<%= @group %>
11
+ StandardOutput=syslog
12
+
13
+ [Install]
14
+ WantedBy=multi-user.target
@@ -1,6 +1,4 @@
1
- require 'carrierwave'
2
-
3
- CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+]/
1
+ CarrierWave::SanitizedFile.sanitize_regexp = /[^[:print:]]/
4
2
 
5
3
  CarrierWave.configure do |config|
6
4
  config.root =
@@ -9,6 +7,25 @@ CarrierWave.configure do |config|
9
7
  else
10
8
  "/data/#{::Rails.application.class.parent_name.underscore}/#{::Rails.env}"
11
9
  end
10
+
11
+ unless ::Rails.env.test?
12
+ if File.exists?('config/aws.yml')
13
+ require 'carrierwave/storage/fog'
14
+ config.storage :fog
15
+ config.cache_storage :fog
16
+
17
+ config.fog_provider = 'fog/aws'
18
+ aws = YAML.load_file('config/aws.yml')
19
+
20
+ config.fog_credentials = {
21
+ provider: 'AWS',
22
+ aws_access_key_id: aws['s3']['access_key_id'],
23
+ aws_secret_access_key: aws['s3']['secret_access_key'],
24
+ region: aws['s3']['region']
25
+ }
26
+ config.fog_directory = aws['s3']['bucket']
27
+ end
28
+ end
12
29
  end
13
30
 
14
31
  module Daddy
data/lib/daddy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Daddy
2
- VERSION = '0.5.31'
2
+ VERSION = '0.5.32'
3
3
  end
data/lib/tasks/dad.rake CHANGED
@@ -7,9 +7,3 @@ task :dad do
7
7
  end
8
8
  end
9
9
  end
10
-
11
- namespace :dad do
12
- task :install do
13
- system('rake dad:cucumber:install')
14
- end
15
- 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.5.31
4
+ version: 0.5.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-03 00:00:00.000000000 Z
11
+ date: 2017-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -306,6 +306,7 @@ files:
306
306
  - itamae/templates/etc/nginx/conf.d/default.conf.erb
307
307
  - itamae/templates/etc/nginx/nginx.conf.erb
308
308
  - itamae/templates/etc/sysconfig/jenkins.erb
309
+ - itamae/templates/etc/systemd/system/tracd.service.erb
309
310
  - itamae/templates/etc/vsftpd/vsftpd.conf.erb
310
311
  - itamae/templates/etc/yum.repos.d/docker.repo.erb
311
312
  - itamae/templates/etc/yum.repos.d/nginx.repo.erb
@@ -316,7 +317,6 @@ files:
316
317
  - lib/daddy/cucumber.rb
317
318
  - lib/daddy/cucumber/helpers.rb
318
319
  - lib/daddy/cucumber/helpers/assert.rb
319
- - lib/daddy/cucumber/helpers/diff.rb
320
320
  - lib/daddy/cucumber/helpers/html.rb
321
321
  - lib/daddy/cucumber/helpers/pause.rb
322
322
  - lib/daddy/cucumber/helpers/puts.rb
@@ -355,7 +355,6 @@ files:
355
355
  - lib/daddy/version.rb
356
356
  - lib/sql_builder.rb
357
357
  - lib/tasks/app_base_dir.rake
358
- - lib/tasks/cucumber_install.rake
359
358
  - lib/tasks/cucumber_steps.rake
360
359
  - lib/tasks/dad.rake
361
360
  - lib/tasks/db/database.yml.erb
@@ -1,125 +0,0 @@
1
- # coding: UTF-8
2
-
3
- module Daddy
4
- module Cucumber
5
- module Diff
6
-
7
- def git_diff(file, options = {})
8
- options[:as] = 'edit' unless options.has_key?(:as)
9
- remote = options.has_key?(:remote) ? options[:remote] : true
10
-
11
- git = Daddy::Git.new
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(/[<>]/, '<' => '&lt;', '>' => '&gt;')
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(/[<>]/, '<' => '&lt;', '>' => '&gt;')
26
-
27
- diff = format_diff(Differ.diff(a, b), options)
28
-
29
- show_filename(file, options)
30
- puts "<pre>#{diff}</pre>"
31
- end
32
-
33
- def git_diff_name(*includes)
34
- git = Daddy::Git.new
35
- puts '<pre>' + git.git_diff_name(*includes) + '</pre>'
36
- end
37
-
38
- def diff(file_a, file_b, options = {})
39
- a = File.read(file_a).gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;')
40
- b = File.read(file_b).gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;')
41
- diff = format_diff(Differ.diff(a, b))
42
-
43
- show_filename(file_a, options)
44
- puts "<pre>#{diff}</pre>"
45
- end
46
-
47
- def show(file, options = {})
48
- show_filename(file, options)
49
-
50
- if options[:commit].present?
51
- git = Daddy::Git.new
52
- content = git.show_previous(file, :commit => options[:commit], :remote => options[:remote])
53
- lines = content.split(/\r\n|\r|\n/).map{|line| line + "\n"}
54
- else
55
- lines = File.readlines(file)
56
- end
57
-
58
- if options[:from] and options[:to]
59
- from = options[:from] - 1
60
- to = options[:to] - 1
61
- lines = lines[from..to]
62
- elsif options[:from]
63
- from = options[:from] - 1
64
- lines = lines[from..-1]
65
- elsif options[:to]
66
- to = options[:to] - 1
67
- lines = lines[0..to]
68
- end
69
-
70
- lines = lines.join.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;')
71
- puts "<pre>#{lines}</pre>"
72
-
73
- end
74
-
75
- private
76
-
77
- def show_filename(filename, options = {})
78
- labels = []
79
- if options[:as].is_a?(String) or options[:as].is_a?(Symbol)
80
- labels << options[:as]
81
- elsif options[:as].is_a?(Array)
82
- labels += options[:as]
83
- end
84
-
85
- html = "<span class=\"#{labels.join(' ')}\">"
86
- labels.each do |label|
87
- case label.to_s
88
- when 'auto'
89
- html << '[自動生成] '
90
- when 'new'
91
- html << '[新規作成] '
92
- when 'edit'
93
- html << '[編集] '
94
- end
95
- end
96
-
97
- html << filename
98
- html << "</span>"
99
-
100
- puts html
101
- end
102
-
103
- def format_diff(diff, options = {})
104
- diff_lines = diff.to_s.split("\n")
105
-
106
- if options[:from] and options[:to]
107
- from = options[:from] - 1
108
- to = options[:to] - 1
109
- diff_lines = diff_lines[from..to]
110
- elsif options[:from]
111
- from = options[:from] - 1
112
- diff_lines = diff_lines[from..-1]
113
- elsif options[:to]
114
- to = options[:to] - 1
115
- diff_lines = diff_lines[0..to]
116
- end
117
-
118
- diff_lines.join("\n")
119
- end
120
-
121
- end
122
- end
123
- end
124
-
125
- World(Daddy::Cucumber::Diff)
@@ -1,18 +0,0 @@
1
- require 'rake'
2
-
3
- namespace :dad do
4
- namespace :cucumber do
5
- task :install do
6
- FileUtils.mkdir_p("features")
7
- FileUtils.mkdir_p("features/step_definitions")
8
- FileUtils.touch("features/step_definitions/.keep")
9
-
10
- FileUtils.mkdir_p("features/support")
11
- system("touch features/support/.keep")
12
- File.write "features/support/env.rb", <<-EOF
13
- require 'rails'
14
- require 'daddy/cucumber'
15
- EOF
16
- end
17
- end
18
- end