logirel 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.semver +5 -0
- data/Gemfile +5 -0
- data/README.md +49 -0
- data/Rakefile.rb +35 -0
- data/TODO.txt +18 -0
- data/bin/NuGet.exe +0 -0
- data/bin/logirel +3 -0
- data/lib/logirel/Initer.rb +48 -0
- data/lib/logirel/NuGet.rb +8 -0
- data/lib/logirel/details_emitter.rb +0 -0
- data/lib/logirel/logirel.rb +0 -0
- data/lib/logirel/q_model.rb +43 -0
- data/lib/logirel/version.rb +14 -0
- data/lib/logirel.rb +97 -0
- data/logirel.gemspec +39 -0
- data/spec/filestructure_spec.rb +18 -0
- data/spec/logirel_spec.rb +46 -0
- data/spec/nuget_spec.rb +10 -0
- data/spec/project_details_spec.rb +21 -0
- data/spec/query_spec.rb +41 -0
- data/spec/rakefile_init_spec.rb +26 -0
- data/spec/version_spec.rb +10 -0
- data/spec/with_sample_projects.rb +16 -0
- data/vendor/cache/albacore-0.2.5.gem +0 -0
- data/vendor/cache/devver-construct-1.1.0.gem +0 -0
- data/vendor/cache/diff-lcs-1.1.2.gem +0 -0
- data/vendor/cache/macaddr-1.0.0.gem +0 -0
- data/vendor/cache/memoize-1.3.1.gem +0 -0
- data/vendor/cache/rspec-2.6.0.gem +0 -0
- data/vendor/cache/rspec-core-2.6.4.gem +0 -0
- data/vendor/cache/rspec-expectations-2.6.0.gem +0 -0
- data/vendor/cache/rspec-mocks-2.6.0.gem +0 -0
- data/vendor/cache/rubyzip-0.9.4.gem +0 -0
- data/vendor/cache/semver-1.0.1.gem +0 -0
- data/vendor/cache/thor-0.14.6.gem +0 -0
- data/vendor/cache/uuid-2.3.2.gem +0 -0
- metadata +180 -0
data/.gitignore
ADDED
data/.semver
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
Let's try and make a gem to create .Net projects easily.
|
2
|
+
|
3
|
+
My thinking
|
4
|
+
===========
|
5
|
+
|
6
|
+
Some problems I want to solve with this project;
|
7
|
+
|
8
|
+
* (bundler/semver/rake/gems) having foundations for semver, rake for builds and nuget for packaging.
|
9
|
+
* (logirel) easily adding structure to a solution folder created with Visual Studio `logirel init`
|
10
|
+
* (gitflow) using ["a successful branching model"](http://nvie.com/posts/a-successful-git-branching-model/)
|
11
|
+
* (logirel/teamcity) continuous integration friendly with 'environments' and transform files for e.g. config files
|
12
|
+
* (logirel) easily updating buildscripts from a git repository 'logirel update', which runs `git pull -s subtree logirel master`.
|
13
|
+
* ensuring correct versions of build script dependencies
|
14
|
+
* (nuget/owrap/symbolserver.org) ensuring correct versions of source code dependencies
|
15
|
+
* (gitflow) nicely tagging your source trees corresponding to semver
|
16
|
+
* `nuget :nuget do |n|; 'git ls-files'.split("\n").each{ |f| n.file f }; end` create a nuget item with just files
|
17
|
+
|
18
|
+
TODO list
|
19
|
+
=========
|
20
|
+
|
21
|
+
1. create gemspec for releases
|
22
|
+
1. learn how to unit test ruby and put some fences around my 'release' f-n
|
23
|
+
1. build a small interactive prompt; it should set project properties when invoked
|
24
|
+
1. specify dependencies with bundler: bundler + bundle, semver, albacore, ruby, rake, nuget
|
25
|
+
1. sample configuration settings for team city to build from github
|
26
|
+
1. build rake tasks invoking semver with ruby that integrate with teamcity
|
27
|
+
1. try the gem out on the transactions, auto tx and nhibernate facility projects
|
28
|
+
1. create some guidance - links mostly on how to set up a gemserver locally
|
29
|
+
|
30
|
+
A note about aims
|
31
|
+
=================
|
32
|
+
|
33
|
+
The aim is **not** to replace nuget nor owrap. This is will principally be a gem for setting up a great
|
34
|
+
rakefile and versioning the package through rake and continuous integration and publishing the artifacts.
|
35
|
+
|
36
|
+
Nuget and OpenWrap don't integrate with continuous integration environments. They don't assist in creating
|
37
|
+
a nice build environment. With them, it's up to yourself to implement a build script that follows semantic
|
38
|
+
versioning.
|
39
|
+
|
40
|
+
Often I encounter .Net open source projects that I want to use. Because I'm increasingly writing SOA code
|
41
|
+
where each service is on its own, communicating through events/EDA and commands, I need to quickly
|
42
|
+
be able to set up a build environment for those projects and make sure I can version the dependencies
|
43
|
+
properly. Right now, hacking build scripts, is taking too much time. For example, it should be very
|
44
|
+
easy to create .Sample projects for nuget, so that people can learn about my frameworks, but the overhead
|
45
|
+
of managing another build is too large.
|
46
|
+
|
47
|
+
Shoulders of Giants
|
48
|
+
===================
|
49
|
+
* http://madduck.net/blog/2007.07.11:creating-a-git-branch-without-ancestry/
|
data/Rakefile.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
3
|
+
# Requires Bundler and adds the
|
4
|
+
#build, install and release
|
5
|
+
#Rake tasks by way of calling Bundler::GemHelper.install_tasks.
|
6
|
+
#The build task will build the current version of the gem and
|
7
|
+
#store it under the pkg folder, the install task will build
|
8
|
+
#and install the gem to our system (just like it would do if we
|
9
|
+
#gem install'd it) and release will push the gem to Rubygems for
|
10
|
+
#consumption by the public.
|
11
|
+
|
12
|
+
desc 'Tag the repository in git with gem version number'
|
13
|
+
task :tag do
|
14
|
+
changed_files = `git diff --cached --name-only`.split("\n") + `git diff --name-only`.split("\n")
|
15
|
+
v = SemVer.find
|
16
|
+
if changed_files == ['Rakefile.rb'] or changed_files.empty?
|
17
|
+
Rake::Task["build"].invoke
|
18
|
+
|
19
|
+
if `git tag`.split("\n").include?("#{v.to_s}")
|
20
|
+
raise "Version #{v.to_s} has already been released"
|
21
|
+
end
|
22
|
+
puts 'adding'
|
23
|
+
`git add #{File.expand_path("logirel.gemspec", __FILE__)}`
|
24
|
+
puts 'committing'
|
25
|
+
`git commit -m "Released version #{v.to_s}"`
|
26
|
+
puts 'tagging'
|
27
|
+
`git tag #{v.to_s}`
|
28
|
+
puts 'pushing tags'
|
29
|
+
`git push --tags`
|
30
|
+
puts 'pushing'
|
31
|
+
`git push`
|
32
|
+
else
|
33
|
+
raise "Repository contains uncommitted changes; either commit or stash."
|
34
|
+
end
|
35
|
+
end
|
data/TODO.txt
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
q
|
2
|
+
|
3
|
+
Path to search
|
4
|
+
Ensure create_stucture
|
5
|
+
For each item from path/src, ask if include
|
6
|
+
For each sln in path/src, ask if setup msbuild task for it
|
7
|
+
Create Rakefile.rb
|
8
|
+
|
9
|
+
For each include:
|
10
|
+
concatenate name => { props } to table
|
11
|
+
props := interactive questioning
|
12
|
+
include environment.rb file
|
13
|
+
include paths.rb file
|
14
|
+
include utils.rb in gem's code
|
15
|
+
|
16
|
+
Gem stuff:
|
17
|
+
|
18
|
+
* Ensude NuGet.exe is included and possible to call from the gem's code.
|
data/bin/NuGet.exe
ADDED
Binary file
|
data/bin/logirel
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
module Logirel
|
2
|
+
require 'semver'
|
3
|
+
|
4
|
+
class Initer
|
5
|
+
|
6
|
+
attr_accessor :root_path
|
7
|
+
|
8
|
+
def initialize(root = '.')
|
9
|
+
@root_path = root
|
10
|
+
end
|
11
|
+
|
12
|
+
def get_commands
|
13
|
+
cmd ||= []
|
14
|
+
cmd << "gem update"
|
15
|
+
cmd << "bundle install"
|
16
|
+
cmd << "bin\NuGet.exe update"
|
17
|
+
end
|
18
|
+
|
19
|
+
def nuget_from_codeplex(cp_ver, gem_ver)
|
20
|
+
(cp_ver <=> gem_ver) > 0
|
21
|
+
end
|
22
|
+
|
23
|
+
def create_structure
|
24
|
+
# puts "making dir #{@root_path}"
|
25
|
+
['buildscripts', 'src'].each do |d|
|
26
|
+
path = File.join(@root_path, d)
|
27
|
+
Dir.mkdir path unless Dir.exists? path
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def parse_folders
|
32
|
+
src = File.join(@root_path, 'src', '*')
|
33
|
+
Dir.
|
34
|
+
glob(src).
|
35
|
+
keep_if{ |i|
|
36
|
+
projs = File.join(i, "*.{csproj,vbproj,fsproj}")
|
37
|
+
File.directory? i and Dir.glob(projs).length > 0
|
38
|
+
}.
|
39
|
+
map{|x| File.basename(x) }
|
40
|
+
end
|
41
|
+
|
42
|
+
def init_rakefile
|
43
|
+
File.open(File.join(@root_path, "Rakefile.rb"), "w") do |f|
|
44
|
+
f.puts "require 'bundler'"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Logirel
|
2
|
+
|
3
|
+
class Q
|
4
|
+
attr_accessor :question
|
5
|
+
end
|
6
|
+
|
7
|
+
class BoolQ < Q
|
8
|
+
attr_accessor :pos_answer, :neg_answer
|
9
|
+
|
10
|
+
def initialize(question, name)
|
11
|
+
@question = question
|
12
|
+
#@pos_answer lambda { name }
|
13
|
+
#@neg_answer lambda { }
|
14
|
+
end
|
15
|
+
|
16
|
+
def exec
|
17
|
+
puts @question
|
18
|
+
#a = gets
|
19
|
+
#a == 'yes' ? q.pos_answer.call : a == '' ? q.neg_answer.call
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class StrQ < Q
|
24
|
+
attr_accessor :answer, :default
|
25
|
+
|
26
|
+
def initialize(question, default = '.')
|
27
|
+
@question = question
|
28
|
+
@default = default
|
29
|
+
end
|
30
|
+
|
31
|
+
def exec
|
32
|
+
puts @question
|
33
|
+
@answer = gets.chomp || @default
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class Querier
|
38
|
+
def include_package_for(projects)
|
39
|
+
projects.
|
40
|
+
map{ |p| BoolQ.new("Would you like to include the '#{p}' project, dear Sir?", p) }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Logirel
|
2
|
+
begin
|
3
|
+
require 'semver'
|
4
|
+
VERSION = SemVer.find.format "%M.%m.%p"
|
5
|
+
class Version < SemVer
|
6
|
+
def parse_numeric(str)
|
7
|
+
str.scan(/(\d{1,5}).?/).flatten.collect{|x| x.to_i}
|
8
|
+
end
|
9
|
+
end
|
10
|
+
rescue LoadError
|
11
|
+
puts 'First time installing, eh? Just run "bundle install"! (unless this is you running it right now!)'
|
12
|
+
VERSION = "0.0.0"
|
13
|
+
end
|
14
|
+
end
|
data/lib/logirel.rb
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'logirel/initer'
|
2
|
+
require 'logirel/version'
|
3
|
+
require 'logirel/q_model'
|
4
|
+
require 'uuid'
|
5
|
+
require 'thor'
|
6
|
+
require 'FileUtils'
|
7
|
+
|
8
|
+
module Logirel
|
9
|
+
class Application < Thor
|
10
|
+
|
11
|
+
desc "Convert projects to rake", "Convert the current folder's projects (src) into a rake+albacore build"
|
12
|
+
def convert
|
13
|
+
|
14
|
+
puts "Logirel version #{Logirel::VERSION}"
|
15
|
+
curr = Dir.pwd
|
16
|
+
|
17
|
+
puts ""
|
18
|
+
puts "Directories Selection"
|
19
|
+
puts "---------------------"
|
20
|
+
|
21
|
+
dir = StrQ.new("Specify src directory (#{Initer.new('./src').parse_folders.inspect})",
|
22
|
+
"./src",
|
23
|
+
lambda { |dir| !dir.empty? && Dir.exists?(dir) }).exec
|
24
|
+
|
25
|
+
buildscripts = StrQ.new("Buildscripts Directory", "./buildscripts").exec
|
26
|
+
tools = StrQ.new("Tools Directory", "./tools").exec
|
27
|
+
|
28
|
+
puts "initing semver in folder above #{dir}"
|
29
|
+
Dir.chdir File.join(dir, "..")
|
30
|
+
sh "semver init" do |ok, err|
|
31
|
+
ok || raise "failed to initialize semver"
|
32
|
+
end
|
33
|
+
Dir.chdir curr
|
34
|
+
|
35
|
+
puts ""
|
36
|
+
puts "Project Selection"
|
37
|
+
puts "-----------------"
|
38
|
+
|
39
|
+
selected_projs = Initer.new(dir).parse_folders.
|
40
|
+
map { |f|
|
41
|
+
BoolQ.new(f, File.basename(f)).exec # TODO: return bool
|
42
|
+
}
|
43
|
+
|
44
|
+
puts ""
|
45
|
+
puts "Project Meta-Data Definitions"
|
46
|
+
puts "-----------------------------"
|
47
|
+
|
48
|
+
metas = selected_projs.map do |p|
|
49
|
+
|
50
|
+
base = File.basename(p)
|
51
|
+
p_dir = File.join(dir, base)
|
52
|
+
|
53
|
+
{
|
54
|
+
:dir => p_dir,
|
55
|
+
:title => StrQ.new("Title", base).exec,
|
56
|
+
:test_dir => StrQ.new("Test Directory", base + ".Tests").exec,
|
57
|
+
:description => StrQ.new("Description", "#{base} at commit #{`git log --pretty-format=%H`}").exec,
|
58
|
+
:copyright => StrQ.new("Copyright").exec,
|
59
|
+
:authors => StrQ.new("Authors").exec,
|
60
|
+
:company => StrQ.new("Company").exec,
|
61
|
+
:nuget_key => StrQ.new("NuGet key", base).exec,
|
62
|
+
:ruby_key => StrQ.new("Ruby key (e.g. 'autotx')").exec,
|
63
|
+
:guid => UUID.new
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# TODO: test whether buildscripts/project_details.rb exists
|
68
|
+
details_path = File.join(buildscripts, "project_details.rb")
|
69
|
+
File.new(details_path, "w") do |f|
|
70
|
+
f.puts %q{
|
71
|
+
Projects = \{
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
metas.each do |m|
|
76
|
+
File.open(details_path, "w") do |f|
|
77
|
+
k = m.ruby_key
|
78
|
+
m.remove('ruby_key')
|
79
|
+
f.puts ":#{m.ruby_key} = #{p(m)}"
|
80
|
+
f.puts ","
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
File.open(details_path, "w") do |f|
|
85
|
+
f.puts %q{
|
86
|
+
\}
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
# TODO: paths
|
91
|
+
|
92
|
+
# TODO: Create rakefile!
|
93
|
+
|
94
|
+
# TODO: tasks in rakefile.rb
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
data/logirel.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "logirel/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "logirel"
|
7
|
+
s.version = Logirel::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Henrik Feldt"]
|
10
|
+
s.email = ["henrik@haf.se"]
|
11
|
+
s.homepage = "https://github.com/haf/logirel"
|
12
|
+
s.summary = %q{Logirel's a best-shot for scaffolding versioning for a .Net solution.}
|
13
|
+
s.description = %q{The gem works by having as its dependencies
|
14
|
+
everything you need to get started with OSS and proprietary .Net coding.
|
15
|
+
The aim of the gem is to allow developers to get up and running quickly
|
16
|
+
and provide a nice way of converting a msbuild/VSS/svn project to github and rake.
|
17
|
+
}
|
18
|
+
|
19
|
+
s.rubyforge_project = "logirel"
|
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
|
+
|
26
|
+
s.add_development_dependency "rspec", "~> 2.6.0"
|
27
|
+
s.add_development_dependency "memoize"
|
28
|
+
s.add_development_dependency "devver-construct"
|
29
|
+
s.add_dependency "albacore", "~> 0.2.5"
|
30
|
+
s.add_dependency "semver", "~> 1.0.1"
|
31
|
+
s.add_dependency "bundler", "~> 1.0.14"
|
32
|
+
s.add_dependency "thor"
|
33
|
+
s.add_dependency "uuid"
|
34
|
+
|
35
|
+
s.requirements << '.Net or Mono installation'
|
36
|
+
s.requirements << 'xbuild (on linux) or msbuild (on windows) for csproj files'
|
37
|
+
s.requirements << 'Access to the internet w/o a proxy! ;)'
|
38
|
+
|
39
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'logirel/initer'
|
2
|
+
require 'logirel/version'
|
3
|
+
require 'logirel/nuget'
|
4
|
+
require 'logirel/initer'
|
5
|
+
require 'construct'
|
6
|
+
require 'FileUtils'
|
7
|
+
|
8
|
+
describe Logirel::Initer, "when reflecting upon previous project strucure" do
|
9
|
+
it "should correctly parse the names of existing projects" do
|
10
|
+
|
11
|
+
with_sample_projects do |c|
|
12
|
+
r = Logirel::Initer.new(c)
|
13
|
+
|
14
|
+
# initer should parse names:
|
15
|
+
r.parse_folders.should =~ ['A', 'C']
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'logirel/initer'
|
2
|
+
require 'logirel/version'
|
3
|
+
require 'logirel/nuget'
|
4
|
+
require 'logirel/initer'
|
5
|
+
require 'construct'
|
6
|
+
require 'FileUtils'
|
7
|
+
|
8
|
+
describe Logirel::Initer, "when starting a new project" do
|
9
|
+
|
10
|
+
before(:each) do
|
11
|
+
include Construct::Helpers
|
12
|
+
@i = Logirel::Initer.new
|
13
|
+
end
|
14
|
+
|
15
|
+
after(:each) do
|
16
|
+
Construct.destroy_all!
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should start by performing an upgrade" do
|
20
|
+
@i.get_commands[0].should eql("gem update")
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should then proceed running bundle install" do
|
24
|
+
@i.get_commands[1].should eql("bundle install")
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should then update nuget" do
|
28
|
+
@i.get_commands[2].include?('update').should == true
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should be able to know when to download from codeplex" do
|
32
|
+
@i.nuget_from_codeplex([1,3], [1,1]).should == true
|
33
|
+
@i.nuget_from_codeplex([1,3], [1,4]).should == false
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should create the correct folder structure" do
|
37
|
+
Construct::within_construct do |c|
|
38
|
+
r = Logirel::Initer.new(c)
|
39
|
+
Dir.exists?(c+'buildscripts').should == false
|
40
|
+
r.create_structure
|
41
|
+
Dir.exists?(c+'buildscripts').should == true
|
42
|
+
Dir.exists?(c+'src').should == true
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
data/spec/nuget_spec.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'logirel'
|
2
|
+
require 'FileUtils'
|
3
|
+
|
4
|
+
describe Logirel::Initer, "when initilizing project details" do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
@temp = "buildscripts"
|
8
|
+
Dir.mkdir(@temp) unless Dir.exists?(@temp)
|
9
|
+
@r = Logirel::Initer.new(@temp)
|
10
|
+
end
|
11
|
+
|
12
|
+
after(:each) do
|
13
|
+
FileUtils.rm_rf(@temp) if Dir.exists?(@temp)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should create project_details.rb" do
|
17
|
+
pending("need impl")
|
18
|
+
File.exitist?(File.join(@temp, "project_details.rb")).should be_true
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
data/spec/query_spec.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'logirel/q_model'
|
2
|
+
require File.dirname(__FILE__) + '/with_sample_projects'
|
3
|
+
|
4
|
+
describe Logirel::Querier, "when getting available directories and having querier return the correct data structures" do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
@q = Logirel::Querier.new
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should create a query for every project folder" do
|
11
|
+
with_sample_projects do |construct|
|
12
|
+
r = Logirel::Initer.new(construct)
|
13
|
+
folders = r.parse_folders
|
14
|
+
qs = @q.include_package_for(folders)
|
15
|
+
qs.length.should >= 2
|
16
|
+
qs.each do |q|
|
17
|
+
folders.any? do |f|
|
18
|
+
q.question.include? "'#{f}'"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should not create a query for those project folders without *proj files" do
|
25
|
+
with_sample_projects do |construct|
|
26
|
+
r = Logirel::Initer.new(construct)
|
27
|
+
folders = r.parse_folders
|
28
|
+
@q.include_package_for(folders).map{|q| q.question }.
|
29
|
+
each{ |str| str.include?("'B'").should be_false }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should return two strings when two questions are asked" do
|
34
|
+
with_sample_projects do |construct|
|
35
|
+
r = Logirel::Initer.new(construct)
|
36
|
+
folders = r.parse_folders
|
37
|
+
qs = @q.include_package_for(folders)
|
38
|
+
qs.length.should eq(2)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'logirel/initer'
|
2
|
+
require 'logirel/version'
|
3
|
+
require 'logirel/nuget'
|
4
|
+
require 'logirel/initer'
|
5
|
+
require 'construct'
|
6
|
+
require 'FileUtils'
|
7
|
+
|
8
|
+
describe Logirel::Initer, "when initilizing rake file" do
|
9
|
+
|
10
|
+
attr_accessor :tmp, :r
|
11
|
+
|
12
|
+
before(:each) do
|
13
|
+
@tmp = "test-temp"
|
14
|
+
Dir.mkdir(@tmp) unless Dir.exists?(@tmp)
|
15
|
+
@r = Logirel::Initer.new(@tmp)
|
16
|
+
end
|
17
|
+
|
18
|
+
after(:each) do
|
19
|
+
FileUtils.rm_rf(@tmp) if Dir.exists?(@tmp)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should be created" do
|
23
|
+
@r.init_rakefile
|
24
|
+
File.exists?(File.join(@tmp, 'Rakefile.rb')).should == true
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'construct'
|
2
|
+
|
3
|
+
def with_sample_projects(&block)
|
4
|
+
Construct::within_construct do |c|
|
5
|
+
# given files
|
6
|
+
c.directory('src/A')
|
7
|
+
c.directory('src/B')
|
8
|
+
c.directory('src/C')
|
9
|
+
c.file('src/A/A.csproj') do |f|
|
10
|
+
f.puts "cs proj file ... xml in here"
|
11
|
+
end
|
12
|
+
|
13
|
+
c.file('src/C/HelloWorld.vbproj')
|
14
|
+
block.call(c)
|
15
|
+
end
|
16
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: logirel
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.6
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Henrik Feldt
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-06-14 00:00:00.000000000 +02:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rspec
|
17
|
+
requirement: &25700928 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.6.0
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *25700928
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: memoize
|
28
|
+
requirement: &25700520 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *25700520
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: devver-construct
|
39
|
+
requirement: &25700052 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *25700052
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: albacore
|
50
|
+
requirement: &25699392 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.2.5
|
56
|
+
type: :runtime
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *25699392
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: semver
|
61
|
+
requirement: &25698696 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ~>
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 1.0.1
|
67
|
+
type: :runtime
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *25698696
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: bundler
|
72
|
+
requirement: &25698084 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.0.14
|
78
|
+
type: :runtime
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *25698084
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: thor
|
83
|
+
requirement: &25697544 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
type: :runtime
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: *25697544
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: uuid
|
94
|
+
requirement: &25696932 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
type: :runtime
|
101
|
+
prerelease: false
|
102
|
+
version_requirements: *25696932
|
103
|
+
description: ! "The gem works by having as its dependencies \n everything you need
|
104
|
+
to get started with OSS and proprietary .Net coding.\n The aim of the gem is to
|
105
|
+
allow developers to get up and running quickly\n and provide a nice way of converting
|
106
|
+
a msbuild/VSS/svn project to github and rake.\n "
|
107
|
+
email:
|
108
|
+
- henrik@haf.se
|
109
|
+
executables:
|
110
|
+
- NuGet.exe
|
111
|
+
- logirel
|
112
|
+
extensions: []
|
113
|
+
extra_rdoc_files: []
|
114
|
+
files:
|
115
|
+
- .gitignore
|
116
|
+
- .semver
|
117
|
+
- Gemfile
|
118
|
+
- README.md
|
119
|
+
- Rakefile.rb
|
120
|
+
- TODO.txt
|
121
|
+
- bin/NuGet.exe
|
122
|
+
- bin/logirel
|
123
|
+
- lib/logirel.rb
|
124
|
+
- lib/logirel/Initer.rb
|
125
|
+
- lib/logirel/NuGet.rb
|
126
|
+
- lib/logirel/details_emitter.rb
|
127
|
+
- lib/logirel/logirel.rb
|
128
|
+
- lib/logirel/q_model.rb
|
129
|
+
- lib/logirel/version.rb
|
130
|
+
- logirel.gemspec
|
131
|
+
- spec/filestructure_spec.rb
|
132
|
+
- spec/logirel_spec.rb
|
133
|
+
- spec/nuget_spec.rb
|
134
|
+
- spec/project_details_spec.rb
|
135
|
+
- spec/query_spec.rb
|
136
|
+
- spec/rakefile_init_spec.rb
|
137
|
+
- spec/version_spec.rb
|
138
|
+
- spec/with_sample_projects.rb
|
139
|
+
- vendor/cache/albacore-0.2.5.gem
|
140
|
+
- vendor/cache/devver-construct-1.1.0.gem
|
141
|
+
- vendor/cache/diff-lcs-1.1.2.gem
|
142
|
+
- vendor/cache/macaddr-1.0.0.gem
|
143
|
+
- vendor/cache/memoize-1.3.1.gem
|
144
|
+
- vendor/cache/rspec-2.6.0.gem
|
145
|
+
- vendor/cache/rspec-core-2.6.4.gem
|
146
|
+
- vendor/cache/rspec-expectations-2.6.0.gem
|
147
|
+
- vendor/cache/rspec-mocks-2.6.0.gem
|
148
|
+
- vendor/cache/rubyzip-0.9.4.gem
|
149
|
+
- vendor/cache/semver-1.0.1.gem
|
150
|
+
- vendor/cache/thor-0.14.6.gem
|
151
|
+
- vendor/cache/uuid-2.3.2.gem
|
152
|
+
has_rdoc: true
|
153
|
+
homepage: https://github.com/haf/logirel
|
154
|
+
licenses: []
|
155
|
+
post_install_message:
|
156
|
+
rdoc_options: []
|
157
|
+
require_paths:
|
158
|
+
- lib
|
159
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
+
none: false
|
161
|
+
requirements:
|
162
|
+
- - ! '>='
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
|
+
none: false
|
167
|
+
requirements:
|
168
|
+
- - ! '>='
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '0'
|
171
|
+
requirements:
|
172
|
+
- .Net or Mono installation
|
173
|
+
- xbuild (on linux) or msbuild (on windows) for csproj files
|
174
|
+
- Access to the internet w/o a proxy! ;)
|
175
|
+
rubyforge_project: logirel
|
176
|
+
rubygems_version: 1.5.2
|
177
|
+
signing_key:
|
178
|
+
specification_version: 3
|
179
|
+
summary: Logirel's a best-shot for scaffolding versioning for a .Net solution.
|
180
|
+
test_files: []
|