soul 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +14 -0
- data/PostInstall.txt +0 -0
- data/README.rdoc +50 -0
- data/Rakefile +25 -0
- data/lib/soul.rb +15 -0
- data/lib/soul/project.rb +8 -0
- data/lib/soul/solution.rb +13 -0
- data/lib/soul/solution_parser.rb +30 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/test/test_helper.rb +7 -0
- data/test/test_soul.rb +78 -0
- metadata +116 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
History.txt
|
2
|
+
Manifest.txt
|
3
|
+
PostInstall.txt
|
4
|
+
README.rdoc
|
5
|
+
Rakefile
|
6
|
+
lib/soul.rb
|
7
|
+
lib/soul/solution_parser.rb
|
8
|
+
lib/soul/solution.rb
|
9
|
+
lib/soul/project.rb
|
10
|
+
script/console
|
11
|
+
script/destroy
|
12
|
+
script/generate
|
13
|
+
test/test_helper.rb
|
14
|
+
test/test_soul.rb
|
data/PostInstall.txt
ADDED
File without changes
|
data/README.rdoc
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
= soul
|
2
|
+
|
3
|
+
* http://github.com/jthigpen/soul
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Solution parser for .NET .sln files.
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* Can Parse Solution Files
|
12
|
+
* Can't do much else
|
13
|
+
|
14
|
+
== SYNOPSIS:
|
15
|
+
|
16
|
+
require 'soul'
|
17
|
+
solution = Soul.parse("MyProject.sln")
|
18
|
+
|
19
|
+
== REQUIREMENTS:
|
20
|
+
|
21
|
+
Just itself.
|
22
|
+
|
23
|
+
== INSTALL:
|
24
|
+
|
25
|
+
sudo gem install soul
|
26
|
+
|
27
|
+
== LICENSE:
|
28
|
+
|
29
|
+
(The MIT License)
|
30
|
+
|
31
|
+
Copyright (c) 2010 James Thigpen
|
32
|
+
|
33
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
34
|
+
a copy of this software and associated documentation files (the
|
35
|
+
'Software'), to deal in the Software without restriction, including
|
36
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
37
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
38
|
+
permit persons to whom the Software is furnished to do so, subject to
|
39
|
+
the following conditions:
|
40
|
+
|
41
|
+
The above copyright notice and this permission notice shall be
|
42
|
+
included in all copies or substantial portions of the Software.
|
43
|
+
|
44
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
45
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
46
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
47
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
48
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
49
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
50
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
gem 'hoe', '>= 2.1.0'
|
3
|
+
require 'hoe'
|
4
|
+
require 'fileutils'
|
5
|
+
require './lib/soul'
|
6
|
+
|
7
|
+
Hoe.plugin :newgem
|
8
|
+
# Hoe.plugin :website
|
9
|
+
# Hoe.plugin :cucumberfeatures
|
10
|
+
|
11
|
+
# Generate all the Rake tasks
|
12
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
13
|
+
$hoe = Hoe.spec 'soul' do
|
14
|
+
self.developer 'James Thigpen', 'james.r.thigpen@gmail.com'
|
15
|
+
self.rubyforge_name = self.name # TODO this is default value
|
16
|
+
# self.extra_deps = [['activesupport','>= 2.0.2']]
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
require 'newgem/tasks'
|
21
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
22
|
+
|
23
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
24
|
+
# remove_task :default
|
25
|
+
# task :default => [:spec, :features]
|
data/lib/soul.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__)) unless
|
2
|
+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
|
+
|
4
|
+
module Soul
|
5
|
+
VERSION = '0.0.1'
|
6
|
+
|
7
|
+
def self.parse(filename)
|
8
|
+
parser = SolutionParser.new
|
9
|
+
return parser.parse(filename)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'soul/project'
|
14
|
+
require 'soul/solution'
|
15
|
+
require 'soul/solution_parser'
|
data/lib/soul/project.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
module Soul
|
2
|
+
class SolutionParser
|
3
|
+
def parse(filename)
|
4
|
+
solution = Solution.new
|
5
|
+
|
6
|
+
File.open(filename).read().each do |line|
|
7
|
+
if line.start_with? "Project"
|
8
|
+
project = parse_line line
|
9
|
+
solution.add_project project
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
return solution
|
14
|
+
end
|
15
|
+
|
16
|
+
def parse_line(line)
|
17
|
+
name = get_project_name line
|
18
|
+
project_file = get_project_file line
|
19
|
+
return Project.new(name, project_file)
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_project_name(project_line)
|
23
|
+
project_line.split("\"")[3]
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_project_file(project_line)
|
27
|
+
project_line.split("\"")[5]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/script/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# File: script/console
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
+
|
5
|
+
libs = " -r irb/completion"
|
6
|
+
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
+
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
+
libs << " -r #{File.dirname(__FILE__) + '/../lib/soul.rb'}"
|
9
|
+
puts "Loading soul gem"
|
10
|
+
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/destroy'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV)
|
data/test/test_helper.rb
ADDED
data/test/test_soul.rb
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
class TestSoul < Test::Unit::TestCase
|
2
|
+
def setup
|
3
|
+
end
|
4
|
+
|
5
|
+
def test_soul_module_imported_in_tests
|
6
|
+
assert_equal Soul.class, Module
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_soul_module_version_defined
|
10
|
+
assert_not_nil defined? Soul::VERSION
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_can_create_solution_parser
|
14
|
+
parser = Soul::SolutionParser.new
|
15
|
+
assert_not_nil parser
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_can_get_project_name
|
19
|
+
solution_parser = Soul::SolutionParser.new
|
20
|
+
line = 'Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bones.Test", "Bones.Test\Bones.Test.csproj", "{4EA753DE-62C8-492E-BE40-E479A03B10BC}"'
|
21
|
+
name = solution_parser.get_project_name line
|
22
|
+
assert_equal name, "Bones.Test"
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_can_get_project_file
|
26
|
+
solution_parser = Soul::SolutionParser.new
|
27
|
+
line = 'Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bones.Test", "Bones.Test\Bones.Test.csproj", "{4EA753DE-62C8-492E-BE40-E479A03B10BC}"'
|
28
|
+
name = solution_parser.get_project_file line
|
29
|
+
assert_equal name, "Bones.Test\\Bones.Test.csproj"
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_can_create_solution
|
33
|
+
solution = Soul::Solution.new
|
34
|
+
assert_not_nil solution
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_can_create_project
|
38
|
+
project = Soul::Project.new("Bones.Test", "Bones.Test\\Bones.Test.csproj")
|
39
|
+
assert_not_nil project
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_example_solution_file_exists
|
43
|
+
assert File.exists? solution_file
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_can_put_projects_in_solution
|
47
|
+
solution = Soul::Solution.new
|
48
|
+
project = Soul::Project.new("foo", "foo.csproj")
|
49
|
+
solution.add_project project
|
50
|
+
assert_same solution.projects[0], project
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_can_parse_solution
|
54
|
+
parser = Soul::SolutionParser.new
|
55
|
+
solution = parser.parse solution_file
|
56
|
+
assert_equal Soul::Solution, solution.class
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_parsed_solution_contains_two_projects
|
60
|
+
parser = Soul::SolutionParser.new
|
61
|
+
solution = parser.parse solution_file
|
62
|
+
assert_equal 1, solution.projects.length
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_parsed_solution_contains_correct_project_name
|
66
|
+
parser = Soul::SolutionParser.new
|
67
|
+
solution = parser.parse solution_file
|
68
|
+
project = solution.projects.first
|
69
|
+
assert_equal "Bones.Test", project.name
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_parsed_solution_contains_correct_project_file_path
|
73
|
+
parser = Soul::SolutionParser.new
|
74
|
+
solution = parser.parse solution_file
|
75
|
+
project = solution.projects.first
|
76
|
+
assert_equal "Bones.Test\\Bones.Test.csproj", project.project_file_path
|
77
|
+
end
|
78
|
+
end
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: soul
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- James Thigpen
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-10-14 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rubyforge
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 0
|
33
|
+
- 4
|
34
|
+
version: 2.0.4
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: hoe
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 19
|
46
|
+
segments:
|
47
|
+
- 2
|
48
|
+
- 6
|
49
|
+
- 2
|
50
|
+
version: 2.6.2
|
51
|
+
type: :development
|
52
|
+
version_requirements: *id002
|
53
|
+
description: Solution parser for .NET .sln files.
|
54
|
+
email:
|
55
|
+
- james.r.thigpen@gmail.com
|
56
|
+
executables: []
|
57
|
+
|
58
|
+
extensions: []
|
59
|
+
|
60
|
+
extra_rdoc_files:
|
61
|
+
- History.txt
|
62
|
+
- Manifest.txt
|
63
|
+
- PostInstall.txt
|
64
|
+
files:
|
65
|
+
- History.txt
|
66
|
+
- Manifest.txt
|
67
|
+
- PostInstall.txt
|
68
|
+
- README.rdoc
|
69
|
+
- Rakefile
|
70
|
+
- lib/soul.rb
|
71
|
+
- lib/soul/solution_parser.rb
|
72
|
+
- lib/soul/solution.rb
|
73
|
+
- lib/soul/project.rb
|
74
|
+
- script/console
|
75
|
+
- script/destroy
|
76
|
+
- script/generate
|
77
|
+
- test/test_helper.rb
|
78
|
+
- test/test_soul.rb
|
79
|
+
has_rdoc: true
|
80
|
+
homepage: http://github.com/jthigpen/soul
|
81
|
+
licenses: []
|
82
|
+
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options:
|
85
|
+
- --main
|
86
|
+
- README.rdoc
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
hash: 3
|
95
|
+
segments:
|
96
|
+
- 0
|
97
|
+
version: "0"
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
hash: 3
|
104
|
+
segments:
|
105
|
+
- 0
|
106
|
+
version: "0"
|
107
|
+
requirements: []
|
108
|
+
|
109
|
+
rubyforge_project: soul
|
110
|
+
rubygems_version: 1.3.7
|
111
|
+
signing_key:
|
112
|
+
specification_version: 3
|
113
|
+
summary: Solution parser for .NET .sln files.
|
114
|
+
test_files:
|
115
|
+
- test/test_helper.rb
|
116
|
+
- test/test_soul.rb
|