european-carry-all 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +56 -0
- data/Guardfile +30 -0
- data/Rakefile +21 -0
- data/european-carry-all.gemspec +25 -0
- data/lib/european.rb +6 -0
- data/lib/european/build.rb +19 -0
- data/lib/european/build_system.rb +45 -0
- data/lib/european/carry_all.rb +88 -0
- data/lib/european/named_carry_all_item.rb +17 -0
- data/lib/european/project.rb +37 -0
- data/lib/european/source_system.rb +36 -0
- data/lib/european/version.rb +3 -0
- data/spec/data/configs/jedcn.rb +28 -0
- data/spec/lib/european/carry_all_spec.rb +80 -0
- data/spec/lib/european/named_carry_all_item_spec.rb +73 -0
- data/spec/lib/european/project_spec.rb +65 -0
- data/spec/spec_helper.rb +8 -0
- metadata +113 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YTdjMmQ5ZTg0YzI1MTY4NjJmZTYxNjYyMTFlZTA4NGJiYTg1MWQ5Yg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZjQ0MThhNWMyNDkwZGRkMGRkOTM2YzZhMThjODRlMDFkY2IwZWVkNg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZjgyMDE1OWZkZTMzMTFlNzBiMTgxYzdhOWZmNGRhMWNmMDU4MDg2MGI1MzU1
|
10
|
+
MTJiZmRmZGE3ZmE0ZDc1YzE0MzgxYmI0ODE4YjZkNDEwZTQyODM3YjFiODIx
|
11
|
+
MmQ2OWZjMjNkNGY5OTIxNGUzZGY0MDZjMzIyMDg5ODkyMDU4OTg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
M2Y3ZjI3Zjk5NmFlZGMzNTRhNDEwZmVjMDIyZjQwOWFmN2E5N2EwMjU5MjIw
|
14
|
+
NTlkOTU0YzdmZDc5YjU4MTkxODQxZDQ2NjdjODE3OTE3YWZjZDg3MzU5YmRj
|
15
|
+
NWZkYzM0NmY4NTQ1NjJlZTgzODJiOTljZjIzYjFlNzQyNTQxNmU=
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
tmp/rspec_guard_result
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
european-carry-all
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-1.9.3-head
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
european-carry-all (0.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
coderay (1.0.9)
|
10
|
+
diff-lcs (1.2.4)
|
11
|
+
ffi (1.9.0)
|
12
|
+
formatador (0.2.4)
|
13
|
+
guard (1.8.1)
|
14
|
+
formatador (>= 0.2.4)
|
15
|
+
listen (>= 1.0.0)
|
16
|
+
lumberjack (>= 1.0.2)
|
17
|
+
pry (>= 0.9.10)
|
18
|
+
thor (>= 0.14.6)
|
19
|
+
guard-rspec (3.0.2)
|
20
|
+
guard (>= 1.8)
|
21
|
+
rspec (~> 2.13)
|
22
|
+
listen (1.2.2)
|
23
|
+
rb-fsevent (>= 0.9.3)
|
24
|
+
rb-inotify (>= 0.9)
|
25
|
+
rb-kqueue (>= 0.2)
|
26
|
+
lumberjack (1.0.4)
|
27
|
+
method_source (0.8.1)
|
28
|
+
pry (0.9.12.2)
|
29
|
+
coderay (~> 1.0.5)
|
30
|
+
method_source (~> 0.8)
|
31
|
+
slop (~> 3.4)
|
32
|
+
rake (10.0.4)
|
33
|
+
rb-fsevent (0.9.3)
|
34
|
+
rb-inotify (0.9.0)
|
35
|
+
ffi (>= 0.5.0)
|
36
|
+
rb-kqueue (0.2.0)
|
37
|
+
ffi (>= 0.5.0)
|
38
|
+
rspec (2.14.1)
|
39
|
+
rspec-core (~> 2.14.0)
|
40
|
+
rspec-expectations (~> 2.14.0)
|
41
|
+
rspec-mocks (~> 2.14.0)
|
42
|
+
rspec-core (2.14.4)
|
43
|
+
rspec-expectations (2.14.0)
|
44
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
45
|
+
rspec-mocks (2.14.1)
|
46
|
+
slop (3.4.6)
|
47
|
+
thor (0.18.1)
|
48
|
+
|
49
|
+
PLATFORMS
|
50
|
+
ruby
|
51
|
+
|
52
|
+
DEPENDENCIES
|
53
|
+
european-carry-all!
|
54
|
+
guard-rspec
|
55
|
+
rake
|
56
|
+
rspec
|
data/Guardfile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
guard :rspec, cli: '--color --format nested' do
|
2
|
+
|
3
|
+
watch(%r{^spec/.+_spec\.rb$}) do |m|
|
4
|
+
changed_spec = m[0]
|
5
|
+
puts "Running something like 'rspec #{changed_spec}'."
|
6
|
+
changed_spec
|
7
|
+
end
|
8
|
+
|
9
|
+
watch(%r{^lib/(.+)\.rb$}) do |m|
|
10
|
+
changed_library = m[0]
|
11
|
+
associated_spec = "spec/lib/#{m[1]}_spec.rb"
|
12
|
+
puts "#{changed_library} has changed."
|
13
|
+
puts "Running something like 'rspec #{associated_spec}'."
|
14
|
+
associated_spec
|
15
|
+
end
|
16
|
+
|
17
|
+
watch('spec/spec_helper.rb') do |m|
|
18
|
+
puts 'spec/spec_helper has changed. Running all specs.'
|
19
|
+
puts "Running something like 'rspec spec'."
|
20
|
+
'spec'
|
21
|
+
end
|
22
|
+
|
23
|
+
watch('^spec/data/(.+)$') do |m|
|
24
|
+
changed_data_file = m[0]
|
25
|
+
puts "#{changed_data_file} has changed. Running all specs."
|
26
|
+
puts "Running something like 'rspec spec'."
|
27
|
+
'spec'
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'rubygems'
|
3
|
+
|
4
|
+
require 'bundler'
|
5
|
+
Bundler::GemHelper.install_tasks
|
6
|
+
|
7
|
+
begin
|
8
|
+
Bundler.setup(:default, :development)
|
9
|
+
rescue Bundler::BundlerError => e
|
10
|
+
$stderr.puts e.message
|
11
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
12
|
+
exit e.status_code
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'rspec/core'
|
16
|
+
require 'rspec/core/rake_task'
|
17
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
18
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
19
|
+
end
|
20
|
+
|
21
|
+
task :default => [:spec]
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "european/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "european-carry-all"
|
7
|
+
s.version = European::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ['Jed Northridge']
|
10
|
+
s.email = ['northridge@gmail.com']
|
11
|
+
s.homepage = 'https://github.com/jedcn/european-carry-all'
|
12
|
+
s.summary = %q{A lightweight DSL for describing a project portfolio}
|
13
|
+
s.description = %q{A scheme for describing project portfolios. It's not a purse, and I'm not a cat lady!}
|
14
|
+
|
15
|
+
s.add_development_dependency 'rspec'
|
16
|
+
s.add_development_dependency 'guard-rspec'
|
17
|
+
s.add_development_dependency 'rake'
|
18
|
+
|
19
|
+
s.rubyforge_project = "european-carry-all"
|
20
|
+
|
21
|
+
s.files = `git ls-files`.split("\n")
|
22
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
23
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
24
|
+
s.require_paths = ['lib']
|
25
|
+
end
|
data/lib/european.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
module European
|
2
|
+
class Build
|
3
|
+
|
4
|
+
attr_reader :name, :build_system, :project, :url
|
5
|
+
|
6
|
+
def initialize(args)
|
7
|
+
@build_system = args[:build_system] || raise(':build_system is required')
|
8
|
+
@project = args[:project] || raise(':project is required')
|
9
|
+
@name = args[:name] || raise(':name is required')
|
10
|
+
@url = args[:url] || raise(':url is required')
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_s
|
14
|
+
"Build '#{name}'"
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module European
|
2
|
+
|
3
|
+
class BuildSystem < NamedCarryAllItem
|
4
|
+
|
5
|
+
attr_reader :projects, :builds
|
6
|
+
|
7
|
+
attr_reader :url, :project_path
|
8
|
+
|
9
|
+
def initialize(args)
|
10
|
+
super args
|
11
|
+
@projects = {}
|
12
|
+
@builds = {}
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
"BuildSystem '#{name}'"
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# Methods invoked by CarryAll
|
21
|
+
def url_for_project_named(name)
|
22
|
+
eval project_path
|
23
|
+
end
|
24
|
+
|
25
|
+
def add_project(project)
|
26
|
+
projects[project.name] = project
|
27
|
+
end
|
28
|
+
|
29
|
+
def add_build(build)
|
30
|
+
builds[build.name] = build
|
31
|
+
end
|
32
|
+
|
33
|
+
#
|
34
|
+
# DSL
|
35
|
+
def url_is(url)
|
36
|
+
@url = url
|
37
|
+
end
|
38
|
+
|
39
|
+
def hosts_projects_at(project_path)
|
40
|
+
@project_path = project_path
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
module European
|
2
|
+
|
3
|
+
class CarryAll
|
4
|
+
|
5
|
+
attr_reader :projects, :build_systems, :source_systems
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@projects = {}
|
9
|
+
@build_systems = {}
|
10
|
+
@source_systems = {}
|
11
|
+
end
|
12
|
+
|
13
|
+
def setup
|
14
|
+
source_systems.values.each { |system| system.setup }
|
15
|
+
build_systems.values.each { |system| system.setup }
|
16
|
+
projects.values.each { |project| project.setup }
|
17
|
+
end
|
18
|
+
|
19
|
+
def add_project(project)
|
20
|
+
projects[project.name] = project
|
21
|
+
end
|
22
|
+
|
23
|
+
def add_build_system(build_system)
|
24
|
+
build_systems[build_system.name] = build_system
|
25
|
+
end
|
26
|
+
|
27
|
+
def add_source_system(source_system)
|
28
|
+
source_systems[source_system.name] = source_system
|
29
|
+
end
|
30
|
+
|
31
|
+
def register(item, action, name)
|
32
|
+
if item.class == Project
|
33
|
+
project = item
|
34
|
+
if action == :builds_in
|
35
|
+
build_system = @build_systems[name]
|
36
|
+
raise "Unknown BuildSystem '#{name}'" unless build_system
|
37
|
+
project.build_system = build_system
|
38
|
+
build_system.add_project project
|
39
|
+
elsif action == :has_build
|
40
|
+
build_system = project.build_system
|
41
|
+
if build_system.builds[name]
|
42
|
+
raise "#{build_system} already has a build named #{name}'"
|
43
|
+
end
|
44
|
+
url = build_system.url_for_project_named name
|
45
|
+
build = Build.new build_system: build_system, project: project, name: name, url: url
|
46
|
+
build_system.add_build build
|
47
|
+
project.add_build build
|
48
|
+
elsif action == :is_hosted_on
|
49
|
+
source_system = @source_systems[name]
|
50
|
+
raise "Unknown SourceSystem '#{name}'" unless source_system
|
51
|
+
project.source_system = source_system
|
52
|
+
source_system.add_project project
|
53
|
+
url = source_system.src_url_for_project_named project.name
|
54
|
+
project.src_url = url
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
module European
|
64
|
+
|
65
|
+
class CarryAll
|
66
|
+
|
67
|
+
def self.load_file(file)
|
68
|
+
carry_all = CarryAll.new
|
69
|
+
lambda {
|
70
|
+
Kernel.send :define_method, :project do |name, &block|
|
71
|
+
carry_all.add_project(European::Project.new({name: name, proc: block, carry_all: carry_all}))
|
72
|
+
end
|
73
|
+
|
74
|
+
Kernel.send :define_method, :build_system do |name, &block|
|
75
|
+
carry_all.add_build_system(European::BuildSystem.new({name: name, proc: block, carry_all: carry_all}))
|
76
|
+
end
|
77
|
+
|
78
|
+
Kernel.send :define_method, :source_system do |name, &block|
|
79
|
+
carry_all.add_source_system(European::SourceSystem.new({name: name, proc: block, carry_all: carry_all}))
|
80
|
+
end
|
81
|
+
}.call
|
82
|
+
load file
|
83
|
+
carry_all.setup
|
84
|
+
carry_all
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module European
|
2
|
+
class Project < NamedCarryAllItem
|
3
|
+
|
4
|
+
attr_reader :carry_all
|
5
|
+
|
6
|
+
attr_accessor :build_system, :source_system
|
7
|
+
|
8
|
+
attr_accessor :builds, :src_url
|
9
|
+
|
10
|
+
def initialize(args)
|
11
|
+
@carry_all = args[:carry_all] || raise(':carry_all is required')
|
12
|
+
@builds = {}
|
13
|
+
super args
|
14
|
+
end
|
15
|
+
|
16
|
+
#
|
17
|
+
# Methods invoked by CarryAll
|
18
|
+
def has_build(name)
|
19
|
+
carry_all.register self, :has_build, name
|
20
|
+
end
|
21
|
+
|
22
|
+
def add_build(build)
|
23
|
+
builds[build.name] = build
|
24
|
+
end
|
25
|
+
|
26
|
+
#
|
27
|
+
# DSL
|
28
|
+
def builds_in(name)
|
29
|
+
carry_all.register self, :builds_in, name
|
30
|
+
end
|
31
|
+
|
32
|
+
def is_hosted_on(name)
|
33
|
+
carry_all.register self, :is_hosted_on, name
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module European
|
2
|
+
|
3
|
+
class SourceSystem < NamedCarryAllItem
|
4
|
+
|
5
|
+
attr_reader :projects
|
6
|
+
|
7
|
+
attr_reader :project_path
|
8
|
+
|
9
|
+
def initialize(args)
|
10
|
+
super args
|
11
|
+
@projects = {}
|
12
|
+
end
|
13
|
+
|
14
|
+
def to_s
|
15
|
+
"SourceSystem '#{name}'"
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
# Methods invoked by CarryAll
|
20
|
+
def src_url_for_project_named(name)
|
21
|
+
eval project_path
|
22
|
+
end
|
23
|
+
|
24
|
+
def add_project(project)
|
25
|
+
projects[project.name] = project
|
26
|
+
end
|
27
|
+
|
28
|
+
#
|
29
|
+
# DSL
|
30
|
+
def hosts_projects_at(project_path)
|
31
|
+
@project_path = project_path
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
source_system 'github' do
|
2
|
+
hosts_projects_at '"https://github.com/jedcn/#{name}.git"'
|
3
|
+
end
|
4
|
+
|
5
|
+
build_system 'travis/jedcn' do
|
6
|
+
url_is 'https://travis-ci.org/jedcn'
|
7
|
+
hosts_projects_at '"#{url}/#{name}/"'
|
8
|
+
end
|
9
|
+
|
10
|
+
project 'reveal-ck' do
|
11
|
+
builds_in 'travis/jedcn'
|
12
|
+
has_build 'reveal-ck'
|
13
|
+
is_hosted_on 'github'
|
14
|
+
end
|
15
|
+
|
16
|
+
project 'rake-to-web' do
|
17
|
+
builds_in 'travis/jedcn'
|
18
|
+
has_build 'rake-to-web'
|
19
|
+
is_hosted_on 'github'
|
20
|
+
end
|
21
|
+
|
22
|
+
project 'reveal-ck-template' do
|
23
|
+
is_hosted_on 'github'
|
24
|
+
end
|
25
|
+
|
26
|
+
project 'emacs-setup' do
|
27
|
+
is_hosted_on 'github'
|
28
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module European
|
4
|
+
describe CarryAll do
|
5
|
+
|
6
|
+
let :file do
|
7
|
+
File.join Dir.pwd, 'spec', 'data', 'configs', 'jedcn.rb'
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '.load_file "/path/to/a/carry-all-config.rb"' do
|
11
|
+
|
12
|
+
it 'parses a file and returns a CarryAll' do
|
13
|
+
result = CarryAll.load_file file
|
14
|
+
expect(result).to be_a CarryAll
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
describe 'an instantiated CarryAll' do
|
20
|
+
|
21
|
+
let :carry_all do
|
22
|
+
CarryAll.load_file file
|
23
|
+
end
|
24
|
+
|
25
|
+
let :projects do
|
26
|
+
carry_all.projects
|
27
|
+
end
|
28
|
+
|
29
|
+
let :reveal_ck do
|
30
|
+
projects['reveal-ck']
|
31
|
+
end
|
32
|
+
|
33
|
+
let :travis do
|
34
|
+
carry_all.build_systems['travis/jedcn']
|
35
|
+
end
|
36
|
+
|
37
|
+
let :known_project_names do
|
38
|
+
['reveal-ck', 'reveal-ck-template', 'rake-to-web', 'emacs-setup']
|
39
|
+
end
|
40
|
+
|
41
|
+
describe '#projects' do
|
42
|
+
|
43
|
+
it 'returns a map of European::Projects in the CarryAll' do
|
44
|
+
|
45
|
+
expect(projects.keys).to match_array known_project_names
|
46
|
+
|
47
|
+
carry_all.projects.values.each do |project|
|
48
|
+
expect(project.class).to eq European::Project
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'knits projects, source systems, build systems, and builds together' do
|
56
|
+
# reveal_ck's build system has been set to travis
|
57
|
+
expect(reveal_ck.build_system).to eq travis
|
58
|
+
|
59
|
+
# travis has been told of reveal_ck
|
60
|
+
expect(travis.projects.values).to include reveal_ck
|
61
|
+
|
62
|
+
# reveal_ck has a single build
|
63
|
+
reveal_ck_build = reveal_ck.builds['reveal-ck']
|
64
|
+
expect(reveal_ck.builds.size).to eq 1
|
65
|
+
|
66
|
+
# The build's name has been set
|
67
|
+
expect(reveal_ck_build.name).to eq 'reveal-ck'
|
68
|
+
# The build is aware of the project that it belongs to
|
69
|
+
expect(reveal_ck_build.project).to eq reveal_ck
|
70
|
+
# The build is aware of the build system that it belongs to
|
71
|
+
expect(reveal_ck_build.build_system).to eq travis
|
72
|
+
|
73
|
+
# travis knows about the build
|
74
|
+
expect(travis.builds['reveal-ck']).to eq reveal_ck_build
|
75
|
+
expect(reveal_ck.src_url).to eq 'https://github.com/jedcn/reveal-ck.git'
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module European
|
4
|
+
|
5
|
+
describe NamedCarryAllItem do
|
6
|
+
|
7
|
+
describe '#new' do
|
8
|
+
|
9
|
+
let :new_without_name do
|
10
|
+
lambda {
|
11
|
+
NamedCarryAllItem.new({})
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
let :new_with_name_and_proc do
|
16
|
+
lambda {
|
17
|
+
proc = Proc.new {
|
18
|
+
@some_value = 1
|
19
|
+
def some_value
|
20
|
+
@some_value
|
21
|
+
end
|
22
|
+
}
|
23
|
+
NamedCarryAllItem.new({ name: 'RandomItem', proc: proc })
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'requires args with a :name' do
|
28
|
+
expect(new_without_name).to raise_error ':name is required'
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'can optionally process args with a :proc' do
|
32
|
+
expect(new_with_name_and_proc).to_not raise_error
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'does not immediately instance eval the proc' do
|
36
|
+
proc = Proc.new {
|
37
|
+
@some_value = 1
|
38
|
+
def some_value
|
39
|
+
@some_value
|
40
|
+
end
|
41
|
+
}
|
42
|
+
ncai = NamedCarryAllItem.new({ name: 'RandomItem', proc: proc })
|
43
|
+
expect(ncai).to_not respond_to :some_value
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#setup' do
|
49
|
+
|
50
|
+
it 'instance evals the associated proc' do
|
51
|
+
proc = Proc.new {
|
52
|
+
@some_value = 1
|
53
|
+
def some_value
|
54
|
+
@some_value
|
55
|
+
end
|
56
|
+
}
|
57
|
+
ncai = NamedCarryAllItem.new({ name: 'RandomItem', proc: proc })
|
58
|
+
ncai.setup
|
59
|
+
expect(ncai.some_value).to eq 1
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'does not blow up if there is no associated proc' do
|
63
|
+
expect(lambda {
|
64
|
+
ncai = NamedCarryAllItem.new({ name: 'RandomItem' })
|
65
|
+
ncai.setup
|
66
|
+
}).to_not raise_error
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module European
|
4
|
+
describe Project do
|
5
|
+
|
6
|
+
let :name_of_project do
|
7
|
+
'name_of_project'
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#new' do
|
11
|
+
|
12
|
+
let :carry_all do
|
13
|
+
double 'carry_all'
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'requires a :name and a :carry_all' do
|
17
|
+
expect(lambda {
|
18
|
+
Project.new({ name: name_of_project, carry_all: carry_all })
|
19
|
+
}).to_not raise_error
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#builds_in' do
|
25
|
+
|
26
|
+
let :carry_all do
|
27
|
+
double 'carry_all'
|
28
|
+
end
|
29
|
+
|
30
|
+
let :name_of_build_system do
|
31
|
+
'name_of_build_system'
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'registers the referenced build_system with the carry_all' do
|
35
|
+
project = Project.new({ name: name_of_project, carry_all: carry_all })
|
36
|
+
carry_all.should_receive(:register).with(project, :builds_in, name_of_build_system)
|
37
|
+
project.builds_in name_of_build_system
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '#has_build' do
|
43
|
+
|
44
|
+
let :carry_all do
|
45
|
+
double 'carry_all'
|
46
|
+
end
|
47
|
+
|
48
|
+
let :name_of_build do
|
49
|
+
'name_of_build'
|
50
|
+
end
|
51
|
+
|
52
|
+
let :project do
|
53
|
+
Project.new({ name: name_of_project, carry_all: carry_all })
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'registers the referenced build with the carry_all' do
|
57
|
+
carry_all.should_receive(:register).with(project, :has_build, name_of_build)
|
58
|
+
project.has_build name_of_build
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: european-carry-all
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jed Northridge
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-07-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: guard-rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: A scheme for describing project portfolios. It's not a purse, and I'm
|
56
|
+
not a cat lady!
|
57
|
+
email:
|
58
|
+
- northridge@gmail.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- .gitignore
|
64
|
+
- .rspec
|
65
|
+
- .ruby-gemset
|
66
|
+
- .ruby-version
|
67
|
+
- Gemfile
|
68
|
+
- Gemfile.lock
|
69
|
+
- Guardfile
|
70
|
+
- Rakefile
|
71
|
+
- european-carry-all.gemspec
|
72
|
+
- lib/european.rb
|
73
|
+
- lib/european/build.rb
|
74
|
+
- lib/european/build_system.rb
|
75
|
+
- lib/european/carry_all.rb
|
76
|
+
- lib/european/named_carry_all_item.rb
|
77
|
+
- lib/european/project.rb
|
78
|
+
- lib/european/source_system.rb
|
79
|
+
- lib/european/version.rb
|
80
|
+
- spec/data/configs/jedcn.rb
|
81
|
+
- spec/lib/european/carry_all_spec.rb
|
82
|
+
- spec/lib/european/named_carry_all_item_spec.rb
|
83
|
+
- spec/lib/european/project_spec.rb
|
84
|
+
- spec/spec_helper.rb
|
85
|
+
homepage: https://github.com/jedcn/european-carry-all
|
86
|
+
licenses: []
|
87
|
+
metadata: {}
|
88
|
+
post_install_message:
|
89
|
+
rdoc_options: []
|
90
|
+
require_paths:
|
91
|
+
- lib
|
92
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
requirements: []
|
103
|
+
rubyforge_project: european-carry-all
|
104
|
+
rubygems_version: 2.0.3
|
105
|
+
signing_key:
|
106
|
+
specification_version: 4
|
107
|
+
summary: A lightweight DSL for describing a project portfolio
|
108
|
+
test_files:
|
109
|
+
- spec/data/configs/jedcn.rb
|
110
|
+
- spec/lib/european/carry_all_spec.rb
|
111
|
+
- spec/lib/european/named_carry_all_item_spec.rb
|
112
|
+
- spec/lib/european/project_spec.rb
|
113
|
+
- spec/spec_helper.rb
|