middleman-presentation-helpers 0.16.0 → 0.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +14 -165
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd81044a7e31c72fcf1eebcea181c4e5a0496d6a
|
4
|
+
data.tar.gz: 910ddee21f82e2495ab9c173b2037f7307a624c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c24d50265b51b80c9370bc98a8245accb0f98c62e9a2cae4ab937a250b3223f8e98921706a59f3e5487958e0cbb62ee446463b822353bed0b516977930aa3d6
|
7
|
+
data.tar.gz: e6e01e64f8d1d6a9c46f9169f26dab3db0774fd45595db7e17ee7bec8b263c31d1f520ef9c14074c2e4180577c0ab2844f338d1327f06f7778c19f691399a7da
|
data/Rakefile
CHANGED
@@ -1,114 +1,28 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'fedux_org_stdlib/rake_tasks'
|
5
|
-
require 'active_support/all'
|
6
|
-
require 'open3'
|
3
|
+
require 'fedux_org_stdlib/rake_tasks/gems'
|
4
|
+
require 'fedux_org_stdlib/rake_tasks/software_version/bump'
|
7
5
|
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
|
12
|
-
def module_name
|
13
|
-
software.gsub(/-/, '/').camelcase
|
14
|
-
end
|
15
|
-
|
16
|
-
def require_name
|
17
|
-
software
|
18
|
-
end
|
19
|
-
|
20
|
-
def gemspec
|
21
|
-
# rubocop:disable Lint/Eval
|
22
|
-
eval File.read(Dir.glob(File.join(File.expand_path('../', __FILE__), '*.gemspec')).first)
|
23
|
-
# rubocop:enable Lint/Eval
|
24
|
-
end
|
25
|
-
|
26
|
-
def hardware_architecture
|
27
|
-
`uname -m`.chomp
|
28
|
-
end
|
29
|
-
|
30
|
-
def archlinux_package_name
|
31
|
-
File.join(archlinux_build_directory, "#{software}-#{version}-*-#{hardware_architecture}.pkg.tar.xz")
|
32
|
-
end
|
33
|
-
|
34
|
-
def version
|
35
|
-
require "#{require_name}/version"
|
36
|
-
"#{module_name}::VERSION".constantize
|
37
|
-
end
|
38
|
-
|
39
|
-
def root_directory
|
40
|
-
::File.expand_path('../', __FILE__)
|
41
|
-
end
|
42
|
-
|
43
|
-
def tar_file
|
44
|
-
::File.join(pkg_directory, "#{software}-#{version}.tar.gz")
|
45
|
-
end
|
46
|
-
|
47
|
-
def tmp_directory
|
48
|
-
::File.join(root_directory, 'tmp', "#{software}-#{version}")
|
49
|
-
end
|
50
|
-
|
51
|
-
def archlinux_build_directory
|
52
|
-
::File.join(root_directory, 'share', 'archlinux')
|
53
|
-
end
|
54
|
-
|
55
|
-
def gem_file
|
56
|
-
::File.join(root_directory, 'pkg', "#{software}-#{version}.gem")
|
57
|
-
end
|
58
|
-
|
59
|
-
def pkg_directory
|
60
|
-
::File.join(root_directory, 'pkg')
|
61
|
-
end
|
62
|
-
|
63
|
-
def gem_directory
|
64
|
-
::File.join(root_directory, 'vendor', 'cache')
|
65
|
-
end
|
66
|
-
|
67
|
-
task default: 'package:gem'
|
68
|
-
|
69
|
-
file tmp_directory do
|
70
|
-
FileUtils.mkdir_p tmp_directory
|
71
|
-
end
|
72
|
-
|
73
|
-
file archlinux_build_directory do
|
74
|
-
FileUtils.mkdir_p archlinux_build_directory
|
75
|
-
end
|
76
|
-
|
77
|
-
def extract_sha
|
78
|
-
`makepkg -g 2>/dev/null`.split(/\n/).find { |l| l =~ /sha256/ }
|
79
|
-
end
|
80
|
-
|
81
|
-
namespace :package do
|
82
|
-
desc 'build gem package'
|
83
|
-
task :gem do
|
84
|
-
sh 'RAILS_ENV=production bundle exec rake -f Rakefile.rails assets:clobber'
|
85
|
-
sh 'RAILS_ENV=production bundle exec rake -f Rakefile.rails assets:precompile'
|
86
|
-
|
87
|
-
base_path = File.expand_path('..', __FILE__)
|
88
|
-
FileUtils.chmod_R 'a+r', Dir.glob(File.join(base_path, 'public', 'assets', '**', '*')).keep_if { |f| File.file? f }
|
89
|
-
|
90
|
-
Rake::Task['gem:clean'].invoke
|
91
|
-
Rake::Task['gem:build'].invoke
|
92
|
-
end
|
6
|
+
desc 'Run test suite'
|
7
|
+
task test: ['test:rspec', 'test:rubocop', 'test:cucumber']
|
93
8
|
|
94
|
-
|
95
|
-
task :
|
96
|
-
|
9
|
+
namespace :coveralls do
|
10
|
+
task :push do
|
11
|
+
sh 'bundle exec coveralls push'
|
97
12
|
end
|
98
13
|
end
|
99
14
|
|
100
|
-
require 'coveralls/rake/task'
|
101
|
-
Coveralls::RakeTask.new
|
102
|
-
|
103
|
-
desc 'Run test suite'
|
104
|
-
task test: ['test:rspec', 'test:rubocop', 'test:cucumber']
|
105
|
-
|
106
15
|
namespace :test do
|
107
16
|
desc 'Test with coveralls'
|
108
17
|
task coveralls: ['test', 'coveralls:push']
|
109
18
|
|
110
|
-
|
111
|
-
|
19
|
+
task :rubocop do
|
20
|
+
sh 'bundle exec rubocop'
|
21
|
+
end
|
22
|
+
|
23
|
+
task 'rubocop:autocorrect' do
|
24
|
+
sh 'bundle exec rubocop --auto-correct'
|
25
|
+
end
|
112
26
|
|
113
27
|
desc 'Run rspec'
|
114
28
|
task :rspec do
|
@@ -120,10 +34,6 @@ namespace :test do
|
|
120
34
|
sh 'bundle exec cucumber -p all'
|
121
35
|
end
|
122
36
|
|
123
|
-
task :parallel_cucumber do
|
124
|
-
sh 'bundle exec parallel_cucumber features -o "-p all" --serialize-stdout'
|
125
|
-
end
|
126
|
-
|
127
37
|
desc 'Run mutant'
|
128
38
|
task :mutant do
|
129
39
|
sh 'mutant --include lib --require middleman-presentation --use rspec "Middleman::Presentation*"'
|
@@ -136,64 +46,3 @@ namespace :gem do
|
|
136
46
|
FileUtils.rm Dir.glob(File.join(pkg_directory, '*.gem'))
|
137
47
|
end
|
138
48
|
end
|
139
|
-
|
140
|
-
namespace :archlinux do
|
141
|
-
desc 'Install arch linux package'
|
142
|
-
task :install do
|
143
|
-
sh "sudo pacman -U #{archlinux_package_name}"
|
144
|
-
end
|
145
|
-
|
146
|
-
desc 'Prepare package build'
|
147
|
-
task prepare: ['package:gem', archlinux_build_directory] do
|
148
|
-
generator = Filegen::Rubygen.new
|
149
|
-
template = File.read(File.expand_path('../share/archlinux/PKGBUILD.sh.erb', __FILE__))
|
150
|
-
build_file = File.expand_path('../share/archlinux/PKGBUILD', __FILE__)
|
151
|
-
|
152
|
-
if ENV.key?('LOCAL_BUILD')
|
153
|
-
package_file = ::File.join(pkg_directory, "#{software}-#{version}.gem")
|
154
|
-
source = ''
|
155
|
-
else
|
156
|
-
# package_file = '$pkgname-$pkgver.gem'
|
157
|
-
package_file = '$pkgname'
|
158
|
-
source = 'http://gems.rubyforge.org/gems/$pkgname-$pkgver.gem'
|
159
|
-
end
|
160
|
-
|
161
|
-
data = {
|
162
|
-
sha: nil,
|
163
|
-
version: version,
|
164
|
-
package: package_file,
|
165
|
-
source: source
|
166
|
-
}
|
167
|
-
|
168
|
-
Dir.chdir(archlinux_build_directory) do
|
169
|
-
File.open(build_file, 'w') do |f|
|
170
|
-
f.write generator.run(template, data)
|
171
|
-
end
|
172
|
-
|
173
|
-
data = {
|
174
|
-
sha: extract_sha,
|
175
|
-
version: version,
|
176
|
-
package: package_file,
|
177
|
-
source: source
|
178
|
-
}
|
179
|
-
|
180
|
-
File.open(build_file, 'w') do |f|
|
181
|
-
f.write generator.run(template, data)
|
182
|
-
end
|
183
|
-
end
|
184
|
-
end
|
185
|
-
|
186
|
-
desc 'Build package'
|
187
|
-
task build: 'archlinux:prepare' do
|
188
|
-
Dir.chdir(archlinux_build_directory) do
|
189
|
-
sh 'makepkg -f'
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
desc 'Build source package for aur'
|
194
|
-
task build_source: 'archlinux:prepare' do
|
195
|
-
Dir.chdir(archlinux_build_directory) do
|
196
|
-
sh 'makepkg --source'
|
197
|
-
end
|
198
|
-
end
|
199
|
-
end
|