the_heist 0.0.3 → 0.0.4
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.
- data/lib/heist/main.rb +2 -2
- data/lib/heist/version.rb +1 -1
- data/tests/gemlist.txt +4 -0
- data/tests/test_the_heist.rb +36 -0
- data/tests/test_the_heist.rb~ +36 -0
- metadata +11 -6
data/lib/heist/main.rb
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
module Heist
|
|
6
6
|
|
|
7
|
-
GEM_RE = /^([^ ]+) \(([0-
|
|
7
|
+
GEM_RE = /^([^ ]+) \(([0-9a-z\., ]+)\)/
|
|
8
8
|
|
|
9
9
|
class << self
|
|
10
10
|
def usage
|
|
@@ -29,7 +29,7 @@ module Heist
|
|
|
29
29
|
# at some point, abstract this to a config/settings
|
|
30
30
|
# module elsewhere...
|
|
31
31
|
if ARGV.include?('--recent')
|
|
32
|
-
versions = versions.first
|
|
32
|
+
versions = [versions.first]
|
|
33
33
|
end
|
|
34
34
|
# </lazy>
|
|
35
35
|
|
data/lib/heist/version.rb
CHANGED
data/tests/gemlist.txt
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
|
|
2
|
+
require 'test/unit'
|
|
3
|
+
require 'heist'
|
|
4
|
+
|
|
5
|
+
class TestHeist < Test::Unit::TestCase
|
|
6
|
+
|
|
7
|
+
def setup
|
|
8
|
+
# load in the gemlist.txt fixture
|
|
9
|
+
@gem_list = File.open('tests/gemlist.txt').read.split("\n")
|
|
10
|
+
@gem_versions_count = @gem_list.to_s.count(",") + @gem_list.size
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def test_heist_no_argv
|
|
14
|
+
install_commands = %x[cat tests/gemlist.txt | bin/heist].split("\n")
|
|
15
|
+
assert_equal(@gem_versions_count, install_commands.size)
|
|
16
|
+
# this test assumes that we have a "rc" versioned gem
|
|
17
|
+
assert_match(/rc/, install_commands.join(" "))
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def test_heist_recent_argv
|
|
21
|
+
install_commands = %x[cat tests/gemlist.txt | bin/heist --recent].split("\n")
|
|
22
|
+
assert_equal(@gem_list.size, install_commands.size)
|
|
23
|
+
# this test assumes that we have a "rc" versioned gem which isn't the most recent
|
|
24
|
+
assert_no_match(/rc/, install_commands.join(" "))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def test_heist_recent_argv_correct_version
|
|
28
|
+
# with each gem install command, make sure it's the newest version
|
|
29
|
+
install_commands = %x[cat tests/gemlist.txt | bin/heist --recent].split("\n")
|
|
30
|
+
@gem_list.each do |gemline|
|
|
31
|
+
recent_version = gemline.match(/\((.*?)[,\)]/)[1]
|
|
32
|
+
assert(install_commands.join("").match(recent_version))
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
|
|
2
|
+
require 'test/unit'
|
|
3
|
+
require 'heist'
|
|
4
|
+
|
|
5
|
+
class TestHeist < Test::Unit::TestCase
|
|
6
|
+
|
|
7
|
+
def setup
|
|
8
|
+
# load in the gemlist.txt fixture
|
|
9
|
+
@gem_list = File.open('tests/gemlist.txt').read.split("\n")
|
|
10
|
+
@gem_versions_count = @gem_list.to_s.count(",") + @gem_list.size
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def test_heist_no_argv
|
|
14
|
+
install_commands = %x[cat tests/gemlist.txt | bin/heist].split("\n")
|
|
15
|
+
assert_equal(@gem_versions_count, install_commands.size)
|
|
16
|
+
# this test assumes that we have a "rc" versioned gem
|
|
17
|
+
assert_match(/rc/, install_commands.join(" "))
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def test_heist_recent_argv
|
|
21
|
+
install_commands = %x[cat tests/gemlist.txt | bin/heist --recent].split("\n")
|
|
22
|
+
assert_equal(@gem_list.size, install_commands.size)
|
|
23
|
+
# this test assumes that we have a "rc" versioned gem which isn't the most recent
|
|
24
|
+
assert_no_match(/rc/, install_commands.join(" "))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def test_heist_recent_argv_correct_version
|
|
28
|
+
# with each gem install command, make sure it's the newest version
|
|
29
|
+
install_commands = %x[cat tests/gemlist.txt | bin/heist --recent].split("\n")
|
|
30
|
+
@gem_list.each do |gemline|
|
|
31
|
+
recent_version = gemline.match(/\((.*?)[,\)]/)[1]
|
|
32
|
+
assert(install_commands.join("").match(recent_version))
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: the_heist
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 23
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 4
|
|
10
|
+
version: 0.0.4
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Jerry Chen
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-04-
|
|
18
|
+
date: 2011-04-19 00:00:00 -05:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies: []
|
|
21
21
|
|
|
@@ -34,6 +34,9 @@ files:
|
|
|
34
34
|
- lib/heist/version.rb
|
|
35
35
|
- lib/heist.rb
|
|
36
36
|
- LICENSE
|
|
37
|
+
- tests/gemlist.txt
|
|
38
|
+
- tests/test_the_heist.rb
|
|
39
|
+
- tests/test_the_heist.rb~
|
|
37
40
|
- bin/heist
|
|
38
41
|
has_rdoc: true
|
|
39
42
|
homepage: http://github.com/jcsalterego/the_heist
|
|
@@ -69,5 +72,7 @@ rubygems_version: 1.3.7
|
|
|
69
72
|
signing_key:
|
|
70
73
|
specification_version: 3
|
|
71
74
|
summary: Heist allows you to clone gem configs.
|
|
72
|
-
test_files:
|
|
73
|
-
|
|
75
|
+
test_files:
|
|
76
|
+
- tests/gemlist.txt
|
|
77
|
+
- tests/test_the_heist.rb
|
|
78
|
+
- tests/test_the_heist.rb~
|