roll 0.8.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/{LICENSE → COPYING} +1 -1
  2. data/HISTORY +62 -0
  3. data/README.rdoc +169 -0
  4. data/TODO +4 -0
  5. data/bin/roll +3 -44
  6. data/lib/oll.rb +1 -2
  7. data/lib/roll.rb +87 -0
  8. data/lib/roll/command.rb +207 -0
  9. data/lib/roll/config.rb +80 -0
  10. data/lib/roll/environment.rb +317 -0
  11. data/lib/roll/errors.rb +13 -0
  12. data/lib/roll/kernel.rb +41 -0
  13. data/lib/roll/ledger.rb +299 -0
  14. data/lib/roll/library.rb +241 -558
  15. data/lib/roll/locals.rb +96 -0
  16. data/lib/roll/metadata.rb +112 -0
  17. data/lib/roll/original.rb +10 -0
  18. data/lib/roll/version.rb +91 -101
  19. data/meta/active +1 -0
  20. data/meta/authors +1 -0
  21. data/meta/contact +1 -0
  22. data/meta/created +1 -0
  23. data/meta/description +5 -0
  24. data/meta/homepage +1 -0
  25. data/meta/maintainer +1 -0
  26. data/meta/name +1 -0
  27. data/meta/repository +1 -0
  28. data/meta/ruby +2 -0
  29. data/meta/suite +1 -0
  30. data/meta/summary +1 -0
  31. data/meta/version +1 -0
  32. data/script/rdoc +4 -0
  33. data/script/setup +1344 -0
  34. data/script/test +23 -0
  35. data/test/benchmarks/vsgems.rb +11 -0
  36. data/test/benchmarks/vsgems_bm.rb +17 -0
  37. data/test/demonstrations/01_library.rdoc +33 -0
  38. data/test/demonstrations/04_version.rdoc +56 -0
  39. data/test/fixtures/env.list +1 -0
  40. data/{demo/sample → test/fixtures}/inspect.rb +0 -0
  41. data/test/fixtures/tryme/1.0/lib/tryme.rb +1 -0
  42. data/test/fixtures/tryme/1.0/meta/homepage +1 -0
  43. data/test/fixtures/tryme/1.0/meta/name +1 -0
  44. data/test/fixtures/tryme/1.0/meta/version +1 -0
  45. data/test/fixtures/tryme/1.1/lib/tryme.rb +1 -0
  46. data/test/fixtures/tryme/1.1/meta/homepage +1 -0
  47. data/test/fixtures/tryme/1.1/meta/name +1 -0
  48. data/test/fixtures/tryme/1.1/meta/version +1 -0
  49. data/test/{test_version.rb → unit/version_test.rb} +21 -21
  50. data/test/unitcases/version_case.rb +69 -0
  51. metadata +102 -65
  52. data/README +0 -17
  53. data/demo/bench/bench_load.rb +0 -7
  54. data/demo/sample/tryme/1.0/lib/tryme.rb +0 -1
  55. data/demo/sample/tryme/1.1/lib/tryme.rb +0 -1
  56. data/lib/roll/attributes.rb +0 -72
  57. data/lib/roll/package.rb +0 -300
  58. data/lib/roll/remote.rb +0 -37
  59. data/meta/ROLL-0.8.0.roll +0 -21
  60. data/task/rdoc +0 -9
  61. data/task/setup +0 -1616
  62. data/task/test +0 -5
  63. data/test/test_library.rb +0 -10
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Run unit tests
4
+
5
+ live = ARGV.delete('--live')
6
+
7
+ unless live
8
+ $LOAD_PATH.unshift(File.expand_path('lib'))
9
+ end
10
+
11
+ if find = ARGV[0]
12
+ unless File.file?(find)
13
+ find = File.join(find, '**', 'test_*.rb')
14
+ end
15
+ else
16
+ find = 'test/**/test_*.rb'
17
+ end
18
+
19
+ Dir.glob(find).each do |file|
20
+ next if File.directory?(file)
21
+ load file
22
+ end
23
+
@@ -0,0 +1,11 @@
1
+
2
+ time_roll_init = `export RUBYOPT=""; ruby -e't=Time.now; require "roll"; puts Time.now - t'`.strip
3
+ time_roll_reqs = `export RUBYOPT=""; ruby -e'require "roll"; t=Time.now; require "facets"; puts Time.now - t'`.strip
4
+
5
+ time_gems_init = `export RUBYOPT=""; ruby -e't=Time.now; require "rubygems"; puts Time.now - t'`.strip
6
+ time_gems_reqs = `export RUBYOPT=""; ruby -e'require "rubygems"; t=Time.now; require "facets"; puts Time.now - t'`.strip
7
+
8
+ puts " %20s %20s" % [ 'Roll', 'Gems' ]
9
+ puts "Init: %20s %20s" % [ time_roll_init, time_gems_init ]
10
+ puts "Reqs: %20s %20s" % [ time_roll_reqs, time_gems_reqs ]
11
+
@@ -0,0 +1,17 @@
1
+ require 'benchmark'
2
+
3
+ puts "Ruby Roll"
4
+
5
+ Benchmark.bmbm do |x|
6
+ x.report("Reqiure Roll: ") { system "ruby -roll -e'nil'" }
7
+ x.report("Require Facets via Roll: ") { system %[export RUBYOPT=""; ruby -roll -e'require "facets"'] }
8
+ end
9
+
10
+ puts; puts
11
+ puts "RubyGems"
12
+
13
+ Benchmark.bmbm do |x|
14
+ x.report("Require Gems: ") { system "ruby -rubygems -e'nil'" }
15
+ x.report("Require Facets via Gems: ") { system %[export RUBYOPT=""; ruby -rubygems -e'require "facets"'] }
16
+ end
17
+
@@ -0,0 +1,33 @@
1
+ = Library Instances
2
+
3
+ To demonstrate the Library instance, we first need to load the Library library ;)
4
+
5
+ require 'roll/library'
6
+
7
+ A Library class can be initialized given the location of the "project".
8
+
9
+ tryme10 = Roll::Library.new('../fixtures/tryme/1.0')
10
+ tryme11 = Roll::Library.new('../fixtures/tryme/1.1')
11
+
12
+ With a library instance in hand we can query it for primary information, or
13
+ metadata, about itself.
14
+
15
+ tryme10.name.assert == "tryme"
16
+ tryme11.name.assert == "tryme"
17
+
18
+ tryme10.version.to_s.assert == "1.0"
19
+ tryme11.version.to_s.assert == "1.1"
20
+
21
+ Secondary and arbitrary information can be queried vie the #metadata method.
22
+
23
+ tryme10.metadata.homepage.assert == "http://proutils.github.com/roll/"
24
+ tryme11.metadata.homepage.assert == "http://proutils.github.com/roll/"
25
+
26
+ Of course, the most important function of a library is to load/require a file.
27
+
28
+ tryme10.load('tryme.rb')
29
+ $message.assert == "Try Me v1.0"
30
+
31
+ tryme11.load('tryme.rb')
32
+ $message.assert == "Try Me v1.1"
33
+
@@ -0,0 +1,56 @@
1
+ = Version Class
2
+
3
+ Load the library.
4
+
5
+ require 'roll/version'
6
+
7
+ Test #to_s:
8
+
9
+ v = Roll::Version.new('1.2.3')
10
+ '1.2.3'.assert == v.to_s
11
+
12
+ Test #to_str:
13
+
14
+ v = Roll::Version.new('1.2.3')
15
+ '1.2.3'.assert == v.to_str
16
+
17
+ Test #[]:
18
+
19
+ v = Roll::Version.new('1.2.3')
20
+ 1.assert == v[0]
21
+ 2.assert == v[1]
22
+ 3.assert == v[2]
23
+
24
+ Test #<=>:
25
+
26
+ v1 = Roll::Version.new('1.2.3')
27
+ v2 = Roll::Version.new('1.2.4')
28
+ 1.assert == (v2 <=> v1)
29
+
30
+ Test #=~ (pessimistic constraint):
31
+
32
+ v1 = Roll::Version.new('1.2.4')
33
+ v2 = Roll::Version.new('1.2')
34
+ assert(v1 =~ v2)
35
+
36
+ Test #major:
37
+
38
+ v = Roll::Version.new('1.2.3')
39
+ 1.assert == v.major
40
+
41
+ Test #minor:
42
+
43
+ v = Roll::Version.new('1.2.3')
44
+ 2.assert == v.minor
45
+
46
+ Test #teeny:
47
+
48
+ v = Roll::Version.new('1.2.3')
49
+ 3.assert == v.teeny
50
+
51
+ Test #parse_constraint:
52
+
53
+ a = Roll::Version.parse_constraint("~> 1.0.0")
54
+ e = [ "=~", Roll::Version['1.0.0'] ]
55
+ e.assert == a
56
+
@@ -0,0 +1 @@
1
+ tryme
@@ -0,0 +1 @@
1
+ $message = "Try Me v1.0"
@@ -0,0 +1 @@
1
+ http://proutils.github.com/roll/
@@ -0,0 +1 @@
1
+ tryme
@@ -0,0 +1 @@
1
+ $message = "Try Me v1.1"
@@ -0,0 +1 @@
1
+ http://proutils.github.com/roll/
@@ -0,0 +1 @@
1
+ tryme
@@ -1,38 +1,38 @@
1
1
  require 'roll/version'
2
2
  require 'test/unit'
3
3
 
4
- class TestVersionNumber < Test::Unit::TestCase
4
+ class TestVersion < Test::Unit::TestCase
5
5
 
6
- def initialize( *args )
7
- args = args.join('.').split(/\W+/)
8
- @self = args.collect { |i| i.to_i }
9
- end
6
+ #def initialize(*args)
7
+ # args = args.join('.').split(/\W+/)
8
+ # @self = args.collect { |i| i.to_i }
9
+ #end
10
10
 
11
11
  def test_to_s
12
- v = VersionNumber.new('1.2.3')
12
+ v = Roll::Version.new('1.2.3')
13
13
  assert_equal('1.2.3', v.to_s)
14
14
  end
15
15
 
16
16
  def test_to_str
17
- v = VersionNumber.new('1.2.3')
17
+ v = Roll::Version.new('1.2.3')
18
18
  assert_equal('1.2.3', v.to_str)
19
19
  end
20
20
 
21
- def test_inspect
22
- v = VersionNumber.new('1.2.3')
23
- assert_equal('1.2.3', v.inspect)
24
- end
21
+ #def test_inspect
22
+ # v = Roll::Version.new('1.2.3')
23
+ # assert_equal('1.2.3', v.inspect)
24
+ #end
25
25
 
26
26
  def test_op_fetch
27
- v = VersionNumber.new('1.2.3')
27
+ v = Roll::Version.new('1.2.3')
28
28
  assert_equal(1, v[0])
29
29
  assert_equal(2, v[1])
30
30
  assert_equal(3, v[2])
31
31
  end
32
32
 
33
33
  def test_spaceship
34
- v1 = VersionNumber.new('1.2.3')
35
- v2 = VersionNumber.new('1.2.4')
34
+ v1 = Roll::Version.new('1.2.3')
35
+ v2 = Roll::Version.new('1.2.4')
36
36
  assert_equal(1, v2 <=> v1)
37
37
  end
38
38
 
@@ -44,28 +44,28 @@ class TestVersionNumber < Test::Unit::TestCase
44
44
  # end
45
45
 
46
46
  def test_pessimistic
47
- v1 = VersionNumber.new('1.3')
48
- v2 = VersionNumber.new('1.2.4')
49
- assert_equal(true, v2 <=> v1)
47
+ v1 = Roll::Version.new('1.2.4')
48
+ v2 = Roll::Version.new('1.2')
49
+ assert_equal(true, v1 =~ v2)
50
50
  end
51
51
 
52
52
  def test_major
53
- v = VersionNumber.new('1.2.3')
53
+ v = Roll::Version.new('1.2.3')
54
54
  assert_equal(1, v.major)
55
55
  end
56
56
 
57
57
  def test_minor
58
- v = VersionNumber.new('1.2.3')
58
+ v = Roll::Version.new('1.2.3')
59
59
  assert_equal(2, v.minor)
60
60
  end
61
61
 
62
62
  def test_teeny
63
- v = VersionNumber.new('1.2.3')
63
+ v = Roll::Version.new('1.2.3')
64
64
  assert_equal(3, v.teeny)
65
65
  end
66
66
 
67
67
  def test_parse_constraint
68
- assert_equal(["=~", VersionNumber('1.0.0')], VersionNumber.parse_constraint("~> 1.0.0"))
68
+ assert_equal(["=~", Roll::Version['1.0.0']], Roll::Version.parse_constraint("~> 1.0.0"))
69
69
  end
70
70
 
71
71
  end
@@ -0,0 +1,69 @@
1
+ require 'roll/version'
2
+
3
+ Case Roll::Version do
4
+
5
+ Concern "Ensure functionality of Roll's Version class."
6
+
7
+ Unit :to_s do
8
+ v = Roll::Version.new('1.2.3')
9
+ v.to_s.assert == '1.2.3'
10
+ end
11
+
12
+ Unit :to_str do
13
+ v = Roll::Version.new('1.2.3')
14
+ v.to_str.assert == '1.2.3'
15
+ end
16
+
17
+ #def test_inspect
18
+ # v = Roll::Version.new('1.2.3')
19
+ # assert_equal('1.2.3', v.inspect)
20
+ #end
21
+
22
+ Unit :[] do
23
+ v = Roll::Version.new('1.2.3')
24
+ v[0].assert == 1
25
+ v[1].assert == 2
26
+ v[2].assert == 3
27
+ end
28
+
29
+ Unit :<=> do
30
+ v1 = Roll::Version.new('1.2.3')
31
+ v2 = Roll::Version.new('1.2.4')
32
+ (v2 <=> v1).assert == 1
33
+ end
34
+
35
+ # def =~( other )
36
+ # #other = other.to_t
37
+ # upver = other.dup
38
+ # upver[0] += 1
39
+ # @self >= other and @self < upver
40
+ # end
41
+
42
+ Unit :=~, "pessimistic constraint" do
43
+ v1 = Roll::Version.new('1.2.4')
44
+ v2 = Roll::Version.new('1.2')
45
+ assert(v1 =~ v2)
46
+ end
47
+
48
+ Unit :major do
49
+ v = Roll::Version.new('1.2.3')
50
+ v.major.assert == 1
51
+ end
52
+
53
+ Unit :minor do
54
+ v = Roll::Version.new('1.2.3')
55
+ v.minor.assert == 2
56
+ end
57
+
58
+ Unit :teeny do
59
+ v = Roll::Version.new('1.2.3')
60
+ v.teeny.assert == v.teeny
61
+ end
62
+
63
+ Unit :parse_constraint do
64
+ constraint = Roll::Version.parse_constraint("~> 1.0.0")
65
+ constraint.assert == ["=~", Roll::Version['1.0.0']]
66
+ end
67
+
68
+ end
69
+
metadata CHANGED
@@ -1,79 +1,116 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: roll
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.8.0
7
- date: 2007-10-29 00:00:00 -04:00
8
- summary: Roll is a library manager for Ruby. Code repositories can be made visible to Ruby just by setting an environment variable. Rolls effectively trivializes Ruby package management.
9
- require_paths:
10
- - lib
11
- email: transfire@gmail.com
12
- homepage: http://roll.rubyforge.org
13
- rubyforge_project:
14
- description: Roll is a library manager for Ruby. Code repositories can be made visible to Ruby just by setting an environment variable. Rolls effectively trivializes Ruby package management.
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc:
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 1
8
+ - 0
9
+ version: 1.1.0
25
10
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
11
  authors:
30
12
  - Thomas Sawyer
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-05-06 00:00:00 -04:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: |-
22
+ Roll is a library manager for Ruby. Code repositories
23
+ can be made visible to Ruby just by setting an
24
+ environment variable. Rolls effectively trivializes
25
+ Ruby package management.
26
+ email: transfire@gmail.com
27
+ executables:
28
+ - roll
29
+ extensions: []
30
+
31
+ extra_rdoc_files: []
32
+
31
33
  files:
32
- - LICENSE
33
- - README
34
- - bin
35
34
  - bin/roll
36
- - demo
37
- - demo/bench
38
- - demo/bench/bench_load.rb
39
- - demo/sample
40
- - demo/sample/inspect.rb
41
- - demo/sample/tryme
42
- - demo/sample/tryme/1.0
43
- - demo/sample/tryme/1.0/lib
44
- - demo/sample/tryme/1.0/lib/tryme.rb
45
- - demo/sample/tryme/1.1
46
- - demo/sample/tryme/1.1/lib
47
- - demo/sample/tryme/1.1/lib/tryme.rb
48
- - lib
49
35
  - lib/oll.rb
50
- - lib/roll
51
- - lib/roll/attributes.rb
36
+ - lib/roll/command.rb
37
+ - lib/roll/config.rb
38
+ - lib/roll/environment.rb
39
+ - lib/roll/errors.rb
40
+ - lib/roll/kernel.rb
41
+ - lib/roll/ledger.rb
52
42
  - lib/roll/library.rb
53
- - lib/roll/package.rb
54
- - lib/roll/remote.rb
43
+ - lib/roll/locals.rb
44
+ - lib/roll/metadata.rb
45
+ - lib/roll/original.rb
55
46
  - lib/roll/version.rb
56
- - meta
57
- - meta/ROLL-0.8.0.roll
58
- - task
59
- - task/rdoc
60
- - task/setup
61
- - task/test
62
- - test
63
- - test/test_library.rb
64
- - test/test_version.rb
65
- test_files:
66
- - test/test_library.rb
67
- - test/test_version.rb
68
- rdoc_options: []
69
-
70
- extra_rdoc_files: []
71
-
72
- executables: []
73
-
74
- extensions: []
47
+ - lib/roll.rb
48
+ - meta/active
49
+ - meta/authors
50
+ - meta/contact
51
+ - meta/created
52
+ - meta/description
53
+ - meta/homepage
54
+ - meta/maintainer
55
+ - meta/name
56
+ - meta/repository
57
+ - meta/ruby
58
+ - meta/suite
59
+ - meta/summary
60
+ - meta/version
61
+ - script/rdoc
62
+ - script/setup
63
+ - script/test
64
+ - test/benchmarks/vsgems.rb
65
+ - test/benchmarks/vsgems_bm.rb
66
+ - test/demonstrations/01_library.rdoc
67
+ - test/demonstrations/04_version.rdoc
68
+ - test/fixtures/env.list
69
+ - test/fixtures/inspect.rb
70
+ - test/fixtures/tryme/1.0/lib/tryme.rb
71
+ - test/fixtures/tryme/1.0/meta/homepage
72
+ - test/fixtures/tryme/1.0/meta/name
73
+ - test/fixtures/tryme/1.0/meta/version
74
+ - test/fixtures/tryme/1.1/lib/tryme.rb
75
+ - test/fixtures/tryme/1.1/meta/homepage
76
+ - test/fixtures/tryme/1.1/meta/name
77
+ - test/fixtures/tryme/1.1/meta/version
78
+ - test/unit/version_test.rb
79
+ - test/unitcases/version_case.rb
80
+ - TODO
81
+ - README.rdoc
82
+ - HISTORY
83
+ - COPYING
84
+ has_rdoc: true
85
+ homepage: http://proutils.github.com/roll
86
+ licenses: []
75
87
 
88
+ post_install_message:
89
+ rdoc_options:
90
+ - --title
91
+ - Roll API
92
+ require_paths:
93
+ - lib
94
+ required_ruby_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ segments:
99
+ - 0
100
+ version: "0"
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ segments:
106
+ - 0
107
+ version: "0"
76
108
  requirements: []
77
109
 
78
- dependencies: []
79
-
110
+ rubyforge_project: roll
111
+ rubygems_version: 1.3.6
112
+ signing_key:
113
+ specification_version: 3
114
+ summary: Ruby Object-Oriented Library Ledger
115
+ test_files:
116
+ - test/unit/version_test.rb