fedux_org-stdlib 0.7.19 → 0.7.20
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 +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -2
- data/lib/fedux_org_stdlib/fixtures_management.rb +4 -0
- data/lib/fedux_org_stdlib/fixtures_management/fixture.rb +46 -0
- data/lib/fedux_org_stdlib/fixtures_management/fixtures_manager.rb +48 -0
- data/lib/fedux_org_stdlib/fixtures_management/no_fixture.rb +26 -0
- data/lib/fedux_org_stdlib/project/generators/taskjuggler.rb +1 -1
- data/lib/fedux_org_stdlib/project/plan.rb +2 -3
- data/lib/fedux_org_stdlib/rake/version_bump_task.rb +2 -2
- data/lib/fedux_org_stdlib/rake_tasks/software_version/restore.rb +2 -2
- data/lib/fedux_org_stdlib/rake_tasks/software_version/show.rb +2 -2
- data/lib/fedux_org_stdlib/roles/comparable_by_name.rb +24 -0
- data/lib/fedux_org_stdlib/roles/versionable.rb +19 -0
- data/lib/fedux_org_stdlib/version.rb +1 -1
- data/spec/app_config_spec.rb +25 -25
- data/spec/fixtures_management/fixtures_manager_spec.rb +33 -0
- data/spec/project/plan_spec.rb +4 -2
- data/spec/project/report_spec.rb +10 -12
- data/spec/project/taskjuggler_spec.rb +10 -12
- data/spec/support/aruba.rb +51 -0
- data/spec/template_directory_spec.rb +65 -65
- data/spec/template_file_spec.rb +20 -20
- data/spec/version_management/rubygem_version_file_parser_spec.rb +40 -32
- data/spec/version_management/rubygem_version_file_spec.rb +2 -2
- metadata +11 -6
- data/lib/fedux_org_stdlib/versionable.rb +0 -17
- data/spec/support/environment.rb +0 -16
- data/spec/support/filesystem.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff269d3997e33745be195a1f065d0245fa3990fc
|
4
|
+
data.tar.gz: 43dc8d4414f98613161f245835f7f5a10516126f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df8ac0a49c961608aef74e34290d24e650fe5cabdb8c223fa3d2db6c1da33124fe3d7394f62622bda7c167431200b4a03de7a22d16b47f8a1f6c2796d4449723
|
7
|
+
data.tar.gz: d84f598ede35f0800ef1b2e9ced14ba5e7da8799c0c41114da8c2314a720aa2ce11009358ed15b2c125c7b473321f42dcf436e925c46bdab8c1613dc9ce3916e
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fedux_org-stdlib (0.7.
|
4
|
+
fedux_org-stdlib (0.7.19)
|
5
5
|
activesupport
|
6
6
|
|
7
7
|
PATH
|
@@ -157,7 +157,7 @@ PLATFORMS
|
|
157
157
|
ruby
|
158
158
|
|
159
159
|
DEPENDENCIES
|
160
|
-
aruba
|
160
|
+
aruba (>= 0.6.1)
|
161
161
|
awesome_print
|
162
162
|
bundler (>= 1.3)
|
163
163
|
byebug
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'fedux_org_stdlib/roles/comparable_by_name'
|
3
|
+
|
4
|
+
module FeduxOrgStdlib
|
5
|
+
module FixturesManagement
|
6
|
+
# Fixture
|
7
|
+
class Fixture
|
8
|
+
include Roles::ComparableByName
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
attr_reader :type
|
13
|
+
|
14
|
+
public
|
15
|
+
|
16
|
+
attr_reader :name, :path
|
17
|
+
|
18
|
+
def initialize(path)
|
19
|
+
@path = Pathname.new(path)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Name of fixture
|
23
|
+
def name
|
24
|
+
path.basename.to_s.to_sym
|
25
|
+
end
|
26
|
+
|
27
|
+
# Is of type?
|
28
|
+
#
|
29
|
+
# @return [TrueClass,FalseClass]
|
30
|
+
# The result of test
|
31
|
+
def type?(t)
|
32
|
+
type == t
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def type
|
38
|
+
if path.end_with? '-plugin'
|
39
|
+
:plugin
|
40
|
+
else
|
41
|
+
:app
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module FeduxOrgStdlib
|
3
|
+
module FixturesManagement
|
4
|
+
# Fixture manager
|
5
|
+
class FixturesManager
|
6
|
+
private
|
7
|
+
|
8
|
+
attr_reader :fixtures, :creator, :null_klass
|
9
|
+
|
10
|
+
public
|
11
|
+
|
12
|
+
def initialize(creator: Fixture, null_klass: NoFixture)
|
13
|
+
@fixtures = Set.new
|
14
|
+
@creator = creator
|
15
|
+
@null_klass = null_klass
|
16
|
+
end
|
17
|
+
|
18
|
+
# Load fixtures found at path
|
19
|
+
def load_fixtures(path)
|
20
|
+
path = Pathname.new(path)
|
21
|
+
|
22
|
+
path.entries.each do |f|
|
23
|
+
next if f.to_s[/^\.\.?/]
|
24
|
+
|
25
|
+
add f.expand_path(path)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# Add fixture
|
30
|
+
def add(path)
|
31
|
+
fixtures << creator.new(path)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Find fixture
|
35
|
+
def find(name)
|
36
|
+
name = name.to_sym
|
37
|
+
|
38
|
+
fixtures.find(null_klass.new(name)) { |f| f.name == name }
|
39
|
+
end
|
40
|
+
|
41
|
+
# String representation
|
42
|
+
def to_s
|
43
|
+
data = frontend_components.sort.reduce([]) { |a, e| a << { name: e.name, path: e.path } }
|
44
|
+
List.new(data).to_s
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module FeduxOrgStdlib
|
3
|
+
module FixturesManagement
|
4
|
+
# Placeholder when no associated fixture found, displays warning
|
5
|
+
class NoFixture
|
6
|
+
private
|
7
|
+
|
8
|
+
attr_reader :name
|
9
|
+
|
10
|
+
public
|
11
|
+
|
12
|
+
def initialize(name)
|
13
|
+
@name = name
|
14
|
+
end
|
15
|
+
|
16
|
+
# Is not an existing plugin
|
17
|
+
def blank?
|
18
|
+
true
|
19
|
+
end
|
20
|
+
|
21
|
+
def method_missing(*_args)
|
22
|
+
warn "Warning: The fixture '#{name}' was not found!"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -5,8 +5,7 @@ module FeduxOrgStdlib
|
|
5
5
|
|
6
6
|
private
|
7
7
|
|
8
|
-
attr_reader :main_file,
|
9
|
-
:additional_files
|
8
|
+
attr_reader :main_file, :additional_files
|
10
9
|
|
11
10
|
public
|
12
11
|
|
@@ -17,7 +16,7 @@ module FeduxOrgStdlib
|
|
17
16
|
# @param [Array] additional_files
|
18
17
|
# Additional files containing information about project plan
|
19
18
|
def initialize(
|
20
|
-
main_file: File.
|
19
|
+
main_file: File.expand_path('plan.tjp'),
|
21
20
|
additional_files: []
|
22
21
|
)
|
23
22
|
@main_file = main_file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'fedux_org_stdlib/version_management/rubygem_version_file'
|
3
|
-
require 'fedux_org_stdlib/versionable'
|
3
|
+
require 'fedux_org_stdlib/roles/versionable'
|
4
4
|
|
5
5
|
module FeduxOrgStdlib
|
6
6
|
module Rake
|
@@ -26,7 +26,7 @@ module FeduxOrgStdlib
|
|
26
26
|
#
|
27
27
|
# @see Rakefile
|
28
28
|
class VersionBumpTask < Task
|
29
|
-
include Versionable
|
29
|
+
include Roles::Versionable
|
30
30
|
|
31
31
|
# @private
|
32
32
|
def bump_version(type)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require 'fedux_org_stdlib/versionable'
|
3
|
+
require 'fedux_org_stdlib/roles/versionable'
|
4
4
|
require 'fedux_org_stdlib/rake/shell_task'
|
5
5
|
|
6
6
|
task = FeduxOrgStdlib::Rake::ShellTask.new(
|
@@ -8,4 +8,4 @@ task = FeduxOrgStdlib::Rake::ShellTask.new(
|
|
8
8
|
description: 'Restore version file from repository',
|
9
9
|
command: "git checkout <%= version_file %>"
|
10
10
|
)
|
11
|
-
task.include FeduxOrgStdlib::Versionable
|
11
|
+
task.include FeduxOrgStdlib::Roles::Versionable
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require 'fedux_org_stdlib/versionable'
|
2
|
+
require 'fedux_org_stdlib/roles/versionable'
|
3
3
|
require 'fedux_org_stdlib/rake/task'
|
4
4
|
|
5
5
|
task = FeduxOrgStdlib::Rake::Task.new(
|
@@ -8,5 +8,5 @@ task = FeduxOrgStdlib::Rake::Task.new(
|
|
8
8
|
) do |t|
|
9
9
|
$stderr.puts FeduxOrgStdlib::VersionManagement::RubygemVersionFile.read(version_file).version
|
10
10
|
end
|
11
|
-
task.include FeduxOrgStdlib::Versionable
|
11
|
+
task.include FeduxOrgStdlib::Roles::Versionable
|
12
12
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module FeduxOrgStdlib
|
3
|
+
module Roles
|
4
|
+
# Included if class can be compared by name
|
5
|
+
module ComparableByName
|
6
|
+
include Comparable
|
7
|
+
|
8
|
+
# @private
|
9
|
+
def hash
|
10
|
+
name.hash
|
11
|
+
end
|
12
|
+
|
13
|
+
# @private
|
14
|
+
def eql?(other)
|
15
|
+
name.eql? other.name
|
16
|
+
end
|
17
|
+
|
18
|
+
# @private
|
19
|
+
def <=>(other)
|
20
|
+
name <=> other.name
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'fedux_org_stdlib/rake/exceptions'
|
3
|
+
|
4
|
+
module FeduxOrgStdlib
|
5
|
+
module Roles
|
6
|
+
module Versionable
|
7
|
+
def version_file(working_directory = Dir.getwd)
|
8
|
+
paths = []
|
9
|
+
paths << File.join(working_directory, 'lib', '**', 'version.rb')
|
10
|
+
|
11
|
+
file = Dir.glob(paths.shift).first while !paths.blank? and file.blank?
|
12
|
+
|
13
|
+
raise FeduxOrgStdlib::Rake::Exceptions::VersionFileNotFound, JSON.dump(message: 'Cannot find version file') unless file
|
14
|
+
|
15
|
+
file
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/spec/app_config_spec.rb
CHANGED
@@ -6,7 +6,7 @@ RSpec.describe AppConfig do
|
|
6
6
|
|
7
7
|
context 'options' do
|
8
8
|
it 'creates readers and writers' do
|
9
|
-
|
9
|
+
with_env 'HOME' => absolute_path('.') do
|
10
10
|
config_klass = Class.new(AppConfig) do
|
11
11
|
option :opt1, nil
|
12
12
|
|
@@ -28,7 +28,7 @@ RSpec.describe AppConfig do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'creates readers' do
|
31
|
-
|
31
|
+
with_env 'HOME' => absolute_path('.') do
|
32
32
|
config_klass = Class.new(AppConfig) do
|
33
33
|
option_reader :opt1, nil
|
34
34
|
|
@@ -53,7 +53,7 @@ RSpec.describe AppConfig do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'checks for reserved key words' do
|
56
|
-
|
56
|
+
with_env 'HOME' => absolute_path('.') do
|
57
57
|
expect do
|
58
58
|
Class.new(AppConfig) do
|
59
59
|
option_reader :_config_file, nil
|
@@ -73,7 +73,7 @@ RSpec.describe AppConfig do
|
|
73
73
|
|
74
74
|
context '#lock' do
|
75
75
|
it 'raises error if config is locked and one tries to modify a config option' do
|
76
|
-
|
76
|
+
with_env 'HOME' => absolute_path('.') do
|
77
77
|
config_klass = Class.new(AppConfig) do
|
78
78
|
option :opt1, nil
|
79
79
|
|
@@ -95,7 +95,7 @@ RSpec.describe AppConfig do
|
|
95
95
|
|
96
96
|
context '#preferred_configuration_file' do
|
97
97
|
it 'has a default configuration file which is the preferred place to store the configuration' do
|
98
|
-
|
98
|
+
with_env 'HOME' => absolute_path('.') do
|
99
99
|
config_klass = Class.new(AppConfig) do
|
100
100
|
|
101
101
|
def _class_name
|
@@ -113,7 +113,7 @@ RSpec.describe AppConfig do
|
|
113
113
|
end
|
114
114
|
|
115
115
|
it 'works with nested module names' do
|
116
|
-
|
116
|
+
with_env 'HOME' => absolute_path('.') do
|
117
117
|
config_klass = Class.new(AppConfig) do
|
118
118
|
|
119
119
|
def _class_name
|
@@ -134,8 +134,8 @@ RSpec.describe AppConfig do
|
|
134
134
|
context 'config files' do
|
135
135
|
|
136
136
|
it 'looks at ~/.test.yaml' do
|
137
|
-
|
138
|
-
|
137
|
+
with_env 'HOME' => absolute_path('.') do
|
138
|
+
write_file '.tests.yaml', <<-EOS.strip_heredoc
|
139
139
|
---
|
140
140
|
opt1: hello world
|
141
141
|
EOS
|
@@ -158,8 +158,8 @@ RSpec.describe AppConfig do
|
|
158
158
|
end
|
159
159
|
|
160
160
|
it 'looks at ~/.config/my_application/tests.yaml' do
|
161
|
-
|
162
|
-
|
161
|
+
with_env 'HOME' => absolute_path('.') do
|
162
|
+
write_file '.config/my_application/tests.yaml', <<-EOS.strip_heredoc
|
163
163
|
---
|
164
164
|
opt1: hello world
|
165
165
|
EOS
|
@@ -182,8 +182,8 @@ RSpec.describe AppConfig do
|
|
182
182
|
end
|
183
183
|
|
184
184
|
it 'looks at ~/.my_application/tests.yaml' do
|
185
|
-
|
186
|
-
|
185
|
+
with_env 'HOME' => absolute_path('.') do
|
186
|
+
write_file '.my_application/tests.yaml', <<-EOS.strip_heredoc
|
187
187
|
---
|
188
188
|
opt1: hello world
|
189
189
|
EOS
|
@@ -206,8 +206,8 @@ RSpec.describe AppConfig do
|
|
206
206
|
end
|
207
207
|
|
208
208
|
it 'looks at ~/.tests.yaml' do
|
209
|
-
|
210
|
-
|
209
|
+
with_env 'HOME' => absolute_path('.') do
|
210
|
+
write_file '.tests.yaml', <<-EOS.strip_heredoc
|
211
211
|
---
|
212
212
|
opt1: hello world
|
213
213
|
EOS
|
@@ -230,8 +230,8 @@ RSpec.describe AppConfig do
|
|
230
230
|
end
|
231
231
|
|
232
232
|
it 'looks at ~/.testsrc' do
|
233
|
-
|
234
|
-
|
233
|
+
with_env 'HOME' => absolute_path('.') do
|
234
|
+
write_file '.testsrc', <<-EOS.strip_heredoc
|
235
235
|
---
|
236
236
|
opt1: hello world
|
237
237
|
EOS
|
@@ -254,8 +254,8 @@ RSpec.describe AppConfig do
|
|
254
254
|
end
|
255
255
|
|
256
256
|
it 'loads yaml files with the following data types' do
|
257
|
-
|
258
|
-
|
257
|
+
with_env 'HOME' => absolute_path('.') do
|
258
|
+
write_file '.testsrc', <<-EOS.strip_heredoc
|
259
259
|
---
|
260
260
|
opt1: hello world
|
261
261
|
opt2: :test
|
@@ -293,8 +293,8 @@ RSpec.describe AppConfig do
|
|
293
293
|
end
|
294
294
|
|
295
295
|
it 'raises error on invalid yaml file' do
|
296
|
-
|
297
|
-
|
296
|
+
with_env 'HOME' => absolute_path('.') do
|
297
|
+
write_file '.testsrc', random_binary_string(100)
|
298
298
|
|
299
299
|
config_klass = Class.new(AppConfig) do
|
300
300
|
def _class_name
|
@@ -311,8 +311,8 @@ RSpec.describe AppConfig do
|
|
311
311
|
end
|
312
312
|
|
313
313
|
it 'returns an empty config if data file cannot be transformed to hash' do
|
314
|
-
|
315
|
-
|
314
|
+
with_env 'HOME' => absolute_path('.') do
|
315
|
+
write_file '.testsrc', <<-EOS.strip_heredoc
|
316
316
|
---
|
317
317
|
- hello
|
318
318
|
- world
|
@@ -339,7 +339,7 @@ RSpec.describe AppConfig do
|
|
339
339
|
|
340
340
|
context '#to_s' do
|
341
341
|
it 'outputs a list of variables' do
|
342
|
-
|
342
|
+
with_env 'HOME' => absolute_path('.') do
|
343
343
|
config_klass = Class.new(AppConfig) do
|
344
344
|
option :opt1, 'test1'
|
345
345
|
option :opt2, 'test2'
|
@@ -366,7 +366,7 @@ RSpec.describe AppConfig do
|
|
366
366
|
end
|
367
367
|
|
368
368
|
it 'outputs is undefined for blank values (nil, '', ...)' do
|
369
|
-
|
369
|
+
with_env 'HOME' => absolute_path('.') do
|
370
370
|
config_klass = Class.new(AppConfig) do
|
371
371
|
option :opt1, nil
|
372
372
|
option :opt2, ''
|
@@ -397,7 +397,7 @@ RSpec.describe AppConfig do
|
|
397
397
|
|
398
398
|
context '#known_options' do
|
399
399
|
it 'outputs a list of known options' do
|
400
|
-
|
400
|
+
with_env 'HOME' => absolute_path('.') do
|
401
401
|
config_klass = Class.new(AppConfig) do
|
402
402
|
option :opt1, 'test1'
|
403
403
|
option :opt2, 'test2'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'fedux_org_stdlib/fixtures_management'
|
4
|
+
|
5
|
+
RSpec.describe FixturesManagement::FixturesManager do
|
6
|
+
|
7
|
+
describe '#load_fixtures' do
|
8
|
+
let(:creator_stub) { Class.new }
|
9
|
+
let(:creator) { stub_const('FeduxOrgStdlib::FixturesManagement::Fixture', creator_stub) }
|
10
|
+
|
11
|
+
it 'load fixtures from path' do
|
12
|
+
expect(creator).to receive(:new).with(Pathname.new(absolute_path('images-app')))
|
13
|
+
|
14
|
+
touch_file 'images-app/image1.png'
|
15
|
+
touch_file 'images-app/image2.png'
|
16
|
+
|
17
|
+
manager = FixturesManagement::FixturesManager.new
|
18
|
+
manager.load_fixtures(absolute_path('.'))
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe '#find' do
|
23
|
+
it 'find fixture' do
|
24
|
+
touch_file 'images-app/image1.png'
|
25
|
+
touch_file 'images-app/image2.png'
|
26
|
+
|
27
|
+
manager = FixturesManagement::FixturesManager.new
|
28
|
+
manager.load_fixtures(absolute_path('.'))
|
29
|
+
|
30
|
+
expect(manager.find('images-app').name).to eq :'images-app'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/spec/project/plan_spec.rb
CHANGED
@@ -5,9 +5,11 @@ require 'fedux_org_stdlib/project/plan'
|
|
5
5
|
RSpec.describe FeduxOrgStdlib::Project::Plan do
|
6
6
|
context '#to_s' do
|
7
7
|
it 'uses the working directory by default to find plan' do
|
8
|
-
|
8
|
+
plan_file = absolute_path('plan.tjp')
|
9
|
+
|
10
|
+
in_current_dir do
|
9
11
|
plan = FeduxOrgStdlib::Project::Plan.new
|
10
|
-
expect(plan.to_s).to eq
|
12
|
+
expect(plan.to_s).to eq plan_file
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
data/spec/project/report_spec.rb
CHANGED
@@ -4,11 +4,16 @@ require 'fedux_org_stdlib/project/report'
|
|
4
4
|
require 'fedux_org_stdlib/filesystem'
|
5
5
|
|
6
6
|
RSpec.describe FeduxOrgStdlib::Project::Report do
|
7
|
+
before :each do
|
8
|
+
touch_file('plan.tjp')
|
9
|
+
touch_file('reports/Overview.html')
|
10
|
+
end
|
11
|
+
|
12
|
+
let(:plan_file) { absolute_path('plan.tjp') }
|
13
|
+
let(:report_file) { absolute_path('reports/Overview.html') }
|
14
|
+
|
7
15
|
context '#generate' do
|
8
16
|
it 'generates report' do
|
9
|
-
plan_file = create_file('plan.tjp')
|
10
|
-
report_file = create_file('reports/Overview.html')
|
11
|
-
|
12
17
|
plan = double('Plan')
|
13
18
|
allow(plan).to receive(:to_s).and_return(plan_file)
|
14
19
|
expect(plan).to receive(:needs_to_be_compiled?).with(report_file).and_return(true)
|
@@ -21,9 +26,6 @@ RSpec.describe FeduxOrgStdlib::Project::Report do
|
|
21
26
|
end
|
22
27
|
|
23
28
|
it 'generates report only if plan file is newer than output file' do
|
24
|
-
plan_file = create_file('plan.tjp')
|
25
|
-
report_file = create_file('reports/Overview.html')
|
26
|
-
|
27
29
|
FileUtils.touch report_file, :mtime => Time.now - 2.hours
|
28
30
|
|
29
31
|
plan = double('Plan')
|
@@ -33,16 +35,13 @@ RSpec.describe FeduxOrgStdlib::Project::Report do
|
|
33
35
|
generator = double('Generator')
|
34
36
|
expect(generator).to receive(:generate_report).once
|
35
37
|
|
36
|
-
|
38
|
+
in_current_dir do
|
37
39
|
report = FeduxOrgStdlib::Project::Report.new(plan: plan, generator: generator, output_file: report_file)
|
38
40
|
report.generate
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
42
44
|
it 'does not generate report if plan file is older or of eqal age than output file' do
|
43
|
-
plan_file = create_file('plan.tjp')
|
44
|
-
report_file = create_file('reports/Overview.html')
|
45
|
-
|
46
45
|
FileUtils.touch plan_file, :mtime => Time.now - 2.hours
|
47
46
|
|
48
47
|
plan = double('Plan')
|
@@ -51,7 +50,7 @@ RSpec.describe FeduxOrgStdlib::Project::Report do
|
|
51
50
|
generator = double('Generator')
|
52
51
|
expect(generator).not_to receive(:generate_report)
|
53
52
|
|
54
|
-
|
53
|
+
in_current_dir do
|
55
54
|
report = FeduxOrgStdlib::Project::Report.new(plan: plan, generator: generator, output_file: report_file)
|
56
55
|
|
57
56
|
silence(:stderr) do
|
@@ -65,7 +64,6 @@ RSpec.describe FeduxOrgStdlib::Project::Report do
|
|
65
64
|
it 'can open a report in a browser' do
|
66
65
|
plan = double('Plan')
|
67
66
|
generator = double('Generator')
|
68
|
-
report_file = create_file('reports/Overview.html')
|
69
67
|
|
70
68
|
report = FeduxOrgStdlib::Project::Report.new(plan: plan, generator: generator, output_file: report_file)
|
71
69
|
expect(report).to respond_to :open
|
@@ -4,34 +4,32 @@ require 'fedux_org_stdlib/project/generators/taskjuggler'
|
|
4
4
|
|
5
5
|
RSpec.describe FeduxOrgStdlib::Project::Generators::Taskjuggler do
|
6
6
|
context '#generate_report' do
|
7
|
+
before :each do
|
8
|
+
create_dir('projects')
|
9
|
+
end
|
10
|
+
|
11
|
+
let(:directory) { absolute_path('projects') }
|
12
|
+
|
7
13
|
it "generates a report using taskjuggler" do
|
8
|
-
directory = create_directory('projects')
|
9
14
|
plan_file = File.join(examples_directory, 'project', 'plan.tjp')
|
10
15
|
|
11
16
|
generator = FeduxOrgStdlib::Project::Generators::Taskjuggler.new
|
12
17
|
|
13
|
-
|
14
|
-
|
15
|
-
generator.generate_report(directory, plan_file)
|
16
|
-
end
|
18
|
+
silence(:stderr) do
|
19
|
+
generator.generate_report(directory, plan_file)
|
17
20
|
end
|
18
21
|
end
|
19
22
|
|
20
23
|
it "fails if an error occured while generating the report" do
|
21
|
-
directory = create_directory('projects')
|
22
24
|
plan_file = File.join(examples_directory, 'project', 'plan_does_not_exist.tjp')
|
23
25
|
|
24
26
|
generator = FeduxOrgStdlib::Project::Generators::Taskjuggler.new
|
25
27
|
|
26
28
|
expect {
|
27
|
-
|
28
|
-
|
29
|
-
generator.generate_report(directory, plan_file)
|
30
|
-
end
|
31
|
-
|
29
|
+
silence(:stderr) do
|
30
|
+
generator.generate_report(directory, plan_file)
|
32
31
|
end
|
33
32
|
}.to raise_error SystemExit
|
34
|
-
|
35
33
|
end
|
36
34
|
end
|
37
35
|
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'aruba/api'
|
3
|
+
require 'aruba/reporting'
|
4
|
+
|
5
|
+
module FeduxOrgStdlib
|
6
|
+
# Spec Helpers
|
7
|
+
module SpecHelper
|
8
|
+
# Helpers for aruba
|
9
|
+
module Aruba
|
10
|
+
include ::Aruba::Api
|
11
|
+
|
12
|
+
def dirs
|
13
|
+
@dirs ||= %w(tmp rspec)
|
14
|
+
end
|
15
|
+
|
16
|
+
def absolute_path(*args)
|
17
|
+
in_current_dir { File.expand_path File.join(*args) }
|
18
|
+
end
|
19
|
+
|
20
|
+
def _create_file(*args)
|
21
|
+
super
|
22
|
+
|
23
|
+
args.first
|
24
|
+
end
|
25
|
+
|
26
|
+
def create_dir(*args)
|
27
|
+
super
|
28
|
+
|
29
|
+
args.first
|
30
|
+
end
|
31
|
+
|
32
|
+
def touch_file(file_name)
|
33
|
+
in_current_dir do
|
34
|
+
file_name = File.expand_path(file_name)
|
35
|
+
_mkdir(File.dirname(file_name))
|
36
|
+
FileUtils.touch file_name
|
37
|
+
end
|
38
|
+
|
39
|
+
file_name
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
RSpec.configure do |c|
|
46
|
+
c.include FeduxOrgStdlib::SpecHelper::Aruba
|
47
|
+
c.before :each do
|
48
|
+
clean_current_dir
|
49
|
+
restore_env
|
50
|
+
end
|
51
|
+
end
|
@@ -6,38 +6,38 @@ RSpec.describe TemplateDirectory do
|
|
6
6
|
|
7
7
|
context '#preferred_template_directory' do
|
8
8
|
it 'has a default template file which is the preferred place to store the template' do
|
9
|
-
|
10
|
-
create_file '.config/my_application/templates/tests.d/test.tt'
|
9
|
+
touch_file '.config/my_application/templates/tests.d/test.tt'
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
template_klass = Class.new(TemplateDirectory) do
|
12
|
+
def class_name
|
13
|
+
'TestTemplateDirectory'
|
14
|
+
end
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
end
|
16
|
+
def module_name
|
17
|
+
'MyApplication'
|
20
18
|
end
|
19
|
+
end
|
21
20
|
|
21
|
+
with_env 'HOME' => absolute_path('.') do
|
22
22
|
template = template_klass.new
|
23
23
|
expect(template.preferred_template_directory).to eq File.expand_path('~/.config/my_application/templates/tests.d')
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'works with nested module names' do
|
28
|
-
|
29
|
-
create_file '.config/my_application/my_sub/templates/tests.d/test.tt'
|
28
|
+
touch_file '.config/my_application/my_sub/templates/tests.d/test.tt'
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
template_klass = Class.new(TemplateDirectory) do
|
31
|
+
def class_name
|
32
|
+
'TestTemplateDirectory'
|
33
|
+
end
|
35
34
|
|
36
|
-
|
37
|
-
|
38
|
-
end
|
35
|
+
def module_name
|
36
|
+
'MyApplication::MySub'
|
39
37
|
end
|
38
|
+
end
|
40
39
|
|
40
|
+
with_env 'HOME' => absolute_path('.') do
|
41
41
|
template = template_klass.new
|
42
42
|
expect(template.preferred_template_directory).to eq File.expand_path('~/.config/my_application/my_sub/templates/tests.d')
|
43
43
|
end
|
@@ -46,93 +46,93 @@ RSpec.describe TemplateDirectory do
|
|
46
46
|
|
47
47
|
context 'template files' do
|
48
48
|
it 'looks at ~/.config/my_application/templates/tests.d/test.tt' do
|
49
|
-
|
50
|
-
file = create_file '.config/my_application/templates/tests.d/test.tt', <<-EOS.strip_heredoc
|
49
|
+
write_file '.config/my_application/templates/tests.d/test.tt', <<-EOS.strip_heredoc
|
51
50
|
<%= hello world %>
|
52
|
-
|
51
|
+
EOS
|
53
52
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
53
|
+
template_klass = Class.new(TemplateDirectory) do
|
54
|
+
def class_name
|
55
|
+
'TestTemplateDirectory'
|
56
|
+
end
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
end
|
58
|
+
def module_name
|
59
|
+
'MyApplication'
|
62
60
|
end
|
61
|
+
end
|
63
62
|
|
63
|
+
with_env 'HOME' => absolute_path('.') do
|
64
64
|
template = template_klass.new
|
65
|
-
expect(template.template_files).to include
|
65
|
+
expect(template.template_files).to include absolute_path('.config/my_application/templates/tests.d/test.tt')
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
69
|
it 'looks at ~/.my_application/templates/tests.d/test.tt' do
|
70
|
-
|
71
|
-
file = create_file '.my_application/templates/tests.d/test.tt', <<-EOS.strip_heredoc
|
70
|
+
write_file '.my_application/templates/tests.d/test.tt', <<-EOS.strip_heredoc
|
72
71
|
<%= hello world %>
|
73
|
-
|
72
|
+
EOS
|
74
73
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
template_klass = Class.new(TemplateDirectory) do
|
75
|
+
def class_name
|
76
|
+
'TestTemplateDirectory'
|
77
|
+
end
|
79
78
|
|
80
|
-
|
81
|
-
|
82
|
-
end
|
79
|
+
def module_name
|
80
|
+
'MyApplication'
|
83
81
|
end
|
82
|
+
end
|
84
83
|
|
84
|
+
with_env 'HOME' => absolute_path('.') do
|
85
85
|
template = template_klass.new
|
86
|
-
expect(template.template_files).to include
|
86
|
+
expect(template.template_files).to include absolute_path('.my_application/templates/tests.d/test.tt')
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
90
|
it 'returns templates in subdirectories as well' do
|
91
|
-
|
92
|
-
file = create_file '.my_application/templates/tests.d/blub/test.tt', <<-EOS.strip_heredoc
|
91
|
+
write_file '.my_application/templates/tests.d/blub/test.tt', <<-EOS.strip_heredoc
|
93
92
|
<%= hello world %>
|
94
|
-
|
93
|
+
EOS
|
95
94
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
95
|
+
template_klass = Class.new(TemplateDirectory) do
|
96
|
+
def class_name
|
97
|
+
'TestTemplateDirectory'
|
98
|
+
end
|
100
99
|
|
101
|
-
|
102
|
-
|
103
|
-
end
|
100
|
+
def module_name
|
101
|
+
'MyApplication'
|
104
102
|
end
|
103
|
+
end
|
105
104
|
|
105
|
+
with_env 'HOME' => absolute_path('.') do
|
106
106
|
template = template_klass.new
|
107
|
-
expect(template.template_files).to include
|
107
|
+
expect(template.template_files).to include absolute_path('.my_application/templates/tests.d/blub/test.tt')
|
108
108
|
end
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
112
|
context '#template_files' do
|
113
113
|
it 'returns template_files in template directory' do
|
114
|
-
|
115
|
-
file1 = create_file '.my_application/templates/tests.d/test1.tt', <<-EOS.strip_heredoc
|
114
|
+
write_file '.my_application/templates/tests.d/test1.tt', <<-EOS.strip_heredoc
|
116
115
|
<%= hello world %>
|
117
|
-
|
116
|
+
EOS
|
118
117
|
|
119
|
-
|
118
|
+
write_file '.my_application/templates/tests.d/test2.tt', <<-EOS.strip_heredoc
|
120
119
|
<%= hello world %>
|
121
|
-
|
120
|
+
EOS
|
122
121
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
122
|
+
template_klass = Class.new(TemplateDirectory) do
|
123
|
+
def class_name
|
124
|
+
'TestTemplateDirectory'
|
125
|
+
end
|
127
126
|
|
128
|
-
|
129
|
-
|
130
|
-
end
|
127
|
+
def module_name
|
128
|
+
'MyApplication'
|
131
129
|
end
|
130
|
+
end
|
132
131
|
|
132
|
+
with_env 'HOME' => absolute_path('.') do
|
133
133
|
template = template_klass.new
|
134
|
-
expect(template.template_files).to include
|
135
|
-
expect(template.template_files).to include
|
134
|
+
expect(template.template_files).to include absolute_path('.my_application/templates/tests.d/test1.tt')
|
135
|
+
expect(template.template_files).to include absolute_path('.my_application/templates/tests.d/test2.tt')
|
136
136
|
end
|
137
137
|
end
|
138
138
|
end
|
data/spec/template_file_spec.rb
CHANGED
@@ -6,8 +6,8 @@ RSpec.describe FileTemplate do
|
|
6
6
|
|
7
7
|
context '#proposed_file' do
|
8
8
|
it 'generates a propose file path based on template basename' do
|
9
|
-
|
10
|
-
|
9
|
+
with_env 'HOME' => absolute_path('.') do
|
10
|
+
touch_file '.config/my_application/templates/test.tt'
|
11
11
|
|
12
12
|
template_klass = Class.new(FileTemplate) do
|
13
13
|
def class_name
|
@@ -19,16 +19,16 @@ RSpec.describe FileTemplate do
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
template = template_klass.new(working_directory:
|
23
|
-
expect(template.proposed_file).to eq
|
22
|
+
template = template_klass.new(working_directory: absolute_path('.'))
|
23
|
+
expect(template.proposed_file).to eq absolute_path('test')
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
context '#preferred_template_file' do
|
29
29
|
it 'has a default template file which is the preferred place to store the template' do
|
30
|
-
|
31
|
-
|
30
|
+
with_env 'HOME' => absolute_path('.') do
|
31
|
+
touch_file '.config/my_application/templates/test.tt'
|
32
32
|
|
33
33
|
template_klass = Class.new(FileTemplate) do
|
34
34
|
def class_name
|
@@ -46,8 +46,8 @@ RSpec.describe FileTemplate do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'works with nested module names' do
|
49
|
-
|
50
|
-
|
49
|
+
with_env 'HOME' => absolute_path('.') do
|
50
|
+
touch_file '.config/my_application/my_sub/templates/test.tt'
|
51
51
|
|
52
52
|
template_klass = Class.new(FileTemplate) do
|
53
53
|
def class_name
|
@@ -67,8 +67,8 @@ RSpec.describe FileTemplate do
|
|
67
67
|
|
68
68
|
context 'template files' do
|
69
69
|
it 'looks at ~/.config/my_application/templates/test.tt' do
|
70
|
-
|
71
|
-
|
70
|
+
with_env 'HOME' => absolute_path('.') do
|
71
|
+
write_file '.config/my_application/templates/test.tt', <<-EOS.strip_heredoc
|
72
72
|
<%= hello world %>
|
73
73
|
EOS
|
74
74
|
|
@@ -88,8 +88,8 @@ RSpec.describe FileTemplate do
|
|
88
88
|
end
|
89
89
|
|
90
90
|
it 'looks at ~/.my_application/templates/test.tt' do
|
91
|
-
|
92
|
-
|
91
|
+
with_env 'HOME' => absolute_path('.') do
|
92
|
+
write_file '.my_application/templates/test.tt', <<-EOS.strip_heredoc
|
93
93
|
<%= hello world %>
|
94
94
|
EOS
|
95
95
|
|
@@ -109,8 +109,8 @@ RSpec.describe FileTemplate do
|
|
109
109
|
end
|
110
110
|
|
111
111
|
it 'supports star operator in suffix: ~/.my_application/templates/test*.tt' do
|
112
|
-
|
113
|
-
|
112
|
+
with_env 'HOME' => absolute_path('.') do
|
113
|
+
write_file '.my_application/templates/test.erb.tt', <<-EOS.strip_heredoc
|
114
114
|
<%= hello world %>
|
115
115
|
EOS
|
116
116
|
|
@@ -132,8 +132,8 @@ RSpec.describe FileTemplate do
|
|
132
132
|
|
133
133
|
context '#content' do
|
134
134
|
it 'returns content of template file' do
|
135
|
-
|
136
|
-
|
135
|
+
with_env 'HOME' => absolute_path('.') do
|
136
|
+
write_file '.my_application/templates/test.tt', <<-EOS.strip_heredoc
|
137
137
|
<%= hello world %>
|
138
138
|
EOS
|
139
139
|
|
@@ -155,8 +155,8 @@ RSpec.describe FileTemplate do
|
|
155
155
|
|
156
156
|
context '#proposed_extname' do
|
157
157
|
it 'propose a erb as default extname' do
|
158
|
-
|
159
|
-
|
158
|
+
with_env 'HOME' => absolute_path('.') do
|
159
|
+
touch_file '.my_application/templates/test.tt'
|
160
160
|
|
161
161
|
template_klass = Class.new(FileTemplate) do
|
162
162
|
def class_name
|
@@ -174,8 +174,8 @@ RSpec.describe FileTemplate do
|
|
174
174
|
end
|
175
175
|
|
176
176
|
it 'extracts the extname from file name' do
|
177
|
-
|
178
|
-
|
177
|
+
with_env 'HOME' => absolute_path('.') do
|
178
|
+
touch_file '.my_application/templates/test.md.tt'
|
179
179
|
|
180
180
|
template_klass = Class.new(FileTemplate) do
|
181
181
|
def class_name
|
@@ -7,57 +7,65 @@ RSpec.describe FeduxOrgStdlib::VersionManagement::RubygemVersionFileParser do
|
|
7
7
|
|
8
8
|
context '#parse' do
|
9
9
|
it 'extracts version number' do
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
write_file(
|
11
|
+
'version.rb',
|
12
|
+
<<-EOS.strip_heredoc
|
13
|
+
#main MyLibrary
|
14
|
+
module MyLibrary
|
15
|
+
VERSION = '0.0.0'
|
16
|
+
end
|
17
|
+
EOS
|
18
|
+
)
|
17
19
|
|
18
|
-
parser.parse(
|
20
|
+
parser.parse(absolute_path('version.rb'))
|
19
21
|
|
20
22
|
expect(parser.version).to eq('0.0.0')
|
21
23
|
end
|
22
24
|
|
23
25
|
it 'extracts modules' do
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
write_file(
|
27
|
+
'version.rb',
|
28
|
+
<<-EOS.strip_heredoc
|
29
|
+
#main MyLibrary
|
30
|
+
module MyLibrary
|
31
|
+
VERSION = '0.0.0'
|
32
|
+
end
|
33
|
+
EOS
|
34
|
+
)
|
31
35
|
|
32
|
-
parser.parse(
|
36
|
+
parser.parse(absolute_path('version.rb'))
|
33
37
|
|
34
38
|
expect(parser.modules).to eq([ 'MyLibrary' ])
|
35
39
|
end
|
36
40
|
|
37
41
|
it 'extracts nested modules as well' do
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
write_file(
|
43
|
+
'version.rb',
|
44
|
+
<<-EOS.strip_heredoc
|
45
|
+
#main MyLibrary
|
46
|
+
module MyLibrary
|
47
|
+
module MyClass
|
48
|
+
VERSION = '0.0.0'
|
49
|
+
end
|
50
|
+
end
|
51
|
+
EOS
|
52
|
+
)
|
47
53
|
|
48
|
-
parser.parse(
|
54
|
+
parser.parse(absolute_path('version.rb'))
|
49
55
|
|
50
|
-
expect(parser.modules).to eq([
|
56
|
+
expect(parser.modules).to eq(['MyLibrary', 'MyClass'])
|
51
57
|
end
|
52
58
|
|
53
59
|
it 'fails if version cannot be extracted' do
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
60
|
+
write_file(
|
61
|
+
'version.rb',
|
62
|
+
<<-EOS.strip_heredoc
|
63
|
+
#main MyLibrary
|
64
|
+
EOS
|
65
|
+
)
|
58
66
|
|
59
67
|
expect {
|
60
|
-
parser.parse(
|
68
|
+
parser.parse(absolute_path('version.rb'))
|
61
69
|
}.to raise_error VersionManagement::Exceptions::VersionFileInvalid
|
62
70
|
end
|
63
71
|
end
|
@@ -53,7 +53,7 @@ RSpec.describe FeduxOrgStdlib::VersionManagement::RubygemVersionFile do
|
|
53
53
|
expect(library).to receive(:module_names).and_return([ 'MyLibrary', 'MyClass' ])
|
54
54
|
version_file = FeduxOrgStdlib::VersionManagement::RubygemVersionFile.new(version, library)
|
55
55
|
|
56
|
-
|
56
|
+
in_current_dir do
|
57
57
|
version_file.write('version.rb')
|
58
58
|
expect(File).to be_exists('version.rb')
|
59
59
|
end
|
@@ -75,7 +75,7 @@ RSpec.describe FeduxOrgStdlib::VersionManagement::RubygemVersionFile do
|
|
75
75
|
expect(parser).to receive(:version).and_return('0.0.0')
|
76
76
|
expect(parser).to receive(:modules).and_return([ 'MyModule' ])
|
77
77
|
|
78
|
-
version_file =
|
78
|
+
version_file = write_file('version.rb', <<-EOS.strip_heredoc
|
79
79
|
# encoding: utf-8
|
80
80
|
# MyLibrary
|
81
81
|
module MyLibrary
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fedux_org-stdlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Meyer
|
@@ -74,6 +74,10 @@ files:
|
|
74
74
|
- lib/fedux_org_stdlib/file_template/exceptions.rb
|
75
75
|
- lib/fedux_org_stdlib/filesystem.rb
|
76
76
|
- lib/fedux_org_stdlib/filesystem/exceptions.rb
|
77
|
+
- lib/fedux_org_stdlib/fixtures_management.rb
|
78
|
+
- lib/fedux_org_stdlib/fixtures_management/fixture.rb
|
79
|
+
- lib/fedux_org_stdlib/fixtures_management/fixtures_manager.rb
|
80
|
+
- lib/fedux_org_stdlib/fixtures_management/no_fixture.rb
|
77
81
|
- lib/fedux_org_stdlib/gem_plugins.rb
|
78
82
|
- lib/fedux_org_stdlib/gem_plugins/exceptions.rb
|
79
83
|
- lib/fedux_org_stdlib/gem_plugins/no_plugin.rb
|
@@ -136,6 +140,8 @@ files:
|
|
136
140
|
- lib/fedux_org_stdlib/rake_tasks/tests/rspec.rb
|
137
141
|
- lib/fedux_org_stdlib/rake_tasks/tests/travis.rb
|
138
142
|
- lib/fedux_org_stdlib/require_files.rb
|
143
|
+
- lib/fedux_org_stdlib/roles/comparable_by_name.rb
|
144
|
+
- lib/fedux_org_stdlib/roles/versionable.rb
|
139
145
|
- lib/fedux_org_stdlib/shell_language_detector.rb
|
140
146
|
- lib/fedux_org_stdlib/shell_language_detector/language.rb
|
141
147
|
- lib/fedux_org_stdlib/support_information.rb
|
@@ -149,7 +155,6 @@ files:
|
|
149
155
|
- lib/fedux_org_stdlib/version_management/rubygem_version_file_parser.rb
|
150
156
|
- lib/fedux_org_stdlib/version_management/software_version.rb
|
151
157
|
- lib/fedux_org_stdlib/version_management/version_builder.rb
|
152
|
-
- lib/fedux_org_stdlib/versionable.rb
|
153
158
|
- rakefiles/default.rake
|
154
159
|
- rakefiles/travis.rake
|
155
160
|
- script/console
|
@@ -176,6 +181,7 @@ files:
|
|
176
181
|
- spec/examples/models/filesystem_based/find_files/abc.rb.swp
|
177
182
|
- spec/examples/models/filesystem_based/find_files/cde.rb
|
178
183
|
- spec/examples/project/plan.tjp
|
184
|
+
- spec/fixtures_management/fixtures_manager_spec.rb
|
179
185
|
- spec/gem_plugins/plugin_manager_spec.rb
|
180
186
|
- spec/list_spec.rb
|
181
187
|
- spec/logger/logger_spec.rb
|
@@ -192,8 +198,7 @@ files:
|
|
192
198
|
- spec/project/taskjuggler_spec.rb
|
193
199
|
- spec/shell_language_detector_spec.rb
|
194
200
|
- spec/spec_helper.rb
|
195
|
-
- spec/support/
|
196
|
-
- spec/support/filesystem.rb
|
201
|
+
- spec/support/aruba.rb
|
197
202
|
- spec/support/generator.rb
|
198
203
|
- spec/support/reporting.rb
|
199
204
|
- spec/support/rspec.rb
|
@@ -254,6 +259,7 @@ test_files:
|
|
254
259
|
- spec/examples/models/filesystem_based/find_files/abc.rb.swp
|
255
260
|
- spec/examples/models/filesystem_based/find_files/cde.rb
|
256
261
|
- spec/examples/project/plan.tjp
|
262
|
+
- spec/fixtures_management/fixtures_manager_spec.rb
|
257
263
|
- spec/gem_plugins/plugin_manager_spec.rb
|
258
264
|
- spec/list_spec.rb
|
259
265
|
- spec/logger/logger_spec.rb
|
@@ -270,8 +276,7 @@ test_files:
|
|
270
276
|
- spec/project/taskjuggler_spec.rb
|
271
277
|
- spec/shell_language_detector_spec.rb
|
272
278
|
- spec/spec_helper.rb
|
273
|
-
- spec/support/
|
274
|
-
- spec/support/filesystem.rb
|
279
|
+
- spec/support/aruba.rb
|
275
280
|
- spec/support/generator.rb
|
276
281
|
- spec/support/reporting.rb
|
277
282
|
- spec/support/rspec.rb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'fedux_org_stdlib/rake/exceptions'
|
3
|
-
|
4
|
-
module FeduxOrgStdlib
|
5
|
-
module Versionable
|
6
|
-
def version_file(working_directory = Dir.getwd)
|
7
|
-
paths = []
|
8
|
-
paths << File.join(working_directory, 'lib', '**', 'version.rb')
|
9
|
-
|
10
|
-
file = Dir.glob(paths.shift).first while !paths.blank? and file.blank?
|
11
|
-
|
12
|
-
raise FeduxOrgStdlib::Rake::Exceptions::VersionFileNotFound, JSON.dump(message: 'Cannot find version file') unless file
|
13
|
-
|
14
|
-
file
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
data/spec/support/environment.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'fedux_org_stdlib/environment'
|
3
|
-
|
4
|
-
module FeduxOrgStdlib
|
5
|
-
module SpecHelper
|
6
|
-
module Environment
|
7
|
-
include FeduxOrgStdlib::Environment
|
8
|
-
alias_method :with_environment, :isolated_environment
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
RSpec.configure do |c|
|
14
|
-
c.include FeduxOrgStdlib::SpecHelper::Environment
|
15
|
-
end
|
16
|
-
|
data/spec/support/filesystem.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'fedux_org_stdlib/filesystem'
|
3
|
-
|
4
|
-
module FeduxOrgStdlib
|
5
|
-
module SpecHelper
|
6
|
-
module Filesystem
|
7
|
-
include FeduxOrgStdlib::Filesystem
|
8
|
-
|
9
|
-
def root_directory
|
10
|
-
::File.expand_path('../../../', __FILE__)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
RSpec.configure do |c|
|
17
|
-
c.include FeduxOrgStdlib::SpecHelper::Filesystem
|
18
|
-
c.before(:each) { cleanup_working_directory }
|
19
|
-
end
|